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