xrpld
Loading...
Searching...
No Matches
test
jtx
impl
offer.cpp
1
#include <test/jtx/offer.h>
2
3
#include <test/jtx/Account.h>
4
5
#include <xrpl/json/json_value.h>
6
#include <xrpl/protocol/STAmount.h>
7
#include <xrpl/protocol/jss.h>
8
9
#include <
cstdint
>
10
11
namespace
xrpl::test::jtx
{
12
13
json::Value
14
offer
(
15
Account
const
& account,
16
STAmount
const
& takerPays,
17
STAmount
const
& takerGets,
18
std::uint32_t
flags)
19
{
20
json::Value
jv;
21
jv[jss::Account] = account.human();
22
jv[jss::TakerPays] = takerPays.
getJson
(
JsonOptions::Values::None
);
23
jv[jss::TakerGets] = takerGets.
getJson
(
JsonOptions::Values::None
);
24
if
(flags != 0u)
25
jv[jss::Flags] = flags;
26
jv[jss::TransactionType] = jss::OfferCreate;
27
return
jv;
28
}
29
30
json::Value
31
offerCancel
(
Account
const
& account,
std::uint32_t
offerSeq)
32
{
33
json::Value
jv;
34
jv[jss::Account] = account.human();
35
jv[jss::OfferSequence] = offerSeq;
36
jv[jss::TransactionType] = jss::OfferCancel;
37
return
jv;
38
}
39
40
}
// namespace xrpl::test::jtx
json::Value
Represents a JSON value.
Definition
json_value.h:130
xrpl::STAmount
Definition
STAmount.h:32
xrpl::STAmount::getJson
json::Value getJson(JsonOptions=JsonOptions::Values::None) const override
Definition
STAmount.cpp:734
xrpl::test::jtx::Account
Immutable cryptographic account descriptor.
Definition
jtx/Account.h:17
cstdint
std::uint32_t
xrpl::test::jtx
Definition
Oracle_test.cpp:34
xrpl::test::jtx::offerCancel
json::Value offerCancel(Account const &account, std::uint32_t offerSeq)
Cancel an offer.
Definition
offer.cpp:31
xrpl::test::jtx::offer
json::Value offer(Account const &account, STAmount const &takerPays, STAmount const &takerGets, std::uint32_t flags)
Create an offer.
Definition
offer.cpp:14
xrpl::JsonOptions::Values::None
@ None
Definition
STBase.h:22
Generated by
1.16.1