rippled
Loading...
Searching...
No Matches
offer.cpp
1#include <test/jtx/offer.h>
2
3#include <xrpl/protocol/jss.h>
4
5namespace xrpl {
6namespace test {
7namespace jtx {
8
10offer(Account const& account, STAmount const& takerPays, STAmount const& takerGets, std::uint32_t flags)
11{
12 Json::Value jv;
13 jv[jss::Account] = account.human();
14 jv[jss::TakerPays] = takerPays.getJson(JsonOptions::none);
15 jv[jss::TakerGets] = takerGets.getJson(JsonOptions::none);
16 if (flags)
17 jv[jss::Flags] = flags;
18 jv[jss::TransactionType] = jss::OfferCreate;
19 return jv;
20}
21
23offer_cancel(Account const& account, std::uint32_t offerSeq)
24{
25 Json::Value jv;
26 jv[jss::Account] = account.human();
27 jv[jss::OfferSequence] = offerSeq;
28 jv[jss::TransactionType] = jss::OfferCancel;
29 return jv;
30}
31
32} // namespace jtx
33} // namespace test
34} // namespace xrpl
Represents a JSON value.
Definition json_value.h:131
Json::Value getJson(JsonOptions=JsonOptions::none) const override
Definition STAmount.cpp:721
Immutable cryptographic account descriptor.
Definition Account.h:20
Match set account flags.
Definition flags.h:109
Json::Value offer_cancel(Account const &account, std::uint32_t offerSeq)
Cancel an offer.
Definition offer.cpp:23
Json::Value offer(Account const &account, STAmount const &takerPays, STAmount const &takerGets, std::uint32_t flags)
Create an offer.
Definition offer.cpp:10
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6