mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-06 18:26:51 +00:00
39 lines
857 B
C++
39 lines
857 B
C++
#include <test/jtx/offer.h>
|
|
|
|
#include <xrpl/protocol/jss.h>
|
|
|
|
namespace xrpl {
|
|
namespace test {
|
|
namespace jtx {
|
|
|
|
Json::Value
|
|
offer(
|
|
Account const& account,
|
|
STAmount const& takerPays,
|
|
STAmount const& takerGets,
|
|
std::uint32_t flags)
|
|
{
|
|
Json::Value jv;
|
|
jv[jss::Account] = account.human();
|
|
jv[jss::TakerPays] = takerPays.getJson(JsonOptions::none);
|
|
jv[jss::TakerGets] = takerGets.getJson(JsonOptions::none);
|
|
if (flags != 0u)
|
|
jv[jss::Flags] = flags;
|
|
jv[jss::TransactionType] = jss::OfferCreate;
|
|
return jv;
|
|
}
|
|
|
|
Json::Value
|
|
offer_cancel(Account const& account, std::uint32_t offerSeq)
|
|
{
|
|
Json::Value jv;
|
|
jv[jss::Account] = account.human();
|
|
jv[jss::OfferSequence] = offerSeq;
|
|
jv[jss::TransactionType] = jss::OfferCancel;
|
|
return jv;
|
|
}
|
|
|
|
} // namespace jtx
|
|
} // namespace test
|
|
} // namespace xrpl
|