xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
test
jtx
impl
pay.cpp
1
#include <test/jtx/pay.h>
2
3
#include <test/jtx/Account.h>
4
#include <test/jtx/amount.h>
5
6
#include <xrpl/json/json_value.h>
7
#include <xrpl/protocol/AccountID.h>
8
#include <xrpl/protocol/TxFlags.h>
9
#include <xrpl/protocol/jss.h>
10
11
namespace
xrpl::test::jtx
{
12
13
json::Value
14
pay
(
AccountID
const
& account,
AccountID
const
& to,
AnyAmount
amount)
15
{
16
amount.
to
(to);
17
json::Value
jv;
18
jv[jss::Account] =
to_string
(account);
19
jv[jss::Amount] = amount.
value
.
getJson
(
JsonOptions::Values::None
);
20
jv[jss::Destination] =
to_string
(to);
21
jv[jss::TransactionType] = jss::Payment;
22
jv[jss::Flags] =
tfFullyCanonicalSig
;
23
return
jv;
24
}
25
json::Value
26
pay
(
Account
const
& account,
Account
const
& to,
AnyAmount
amount)
27
{
28
return
pay
(account.id(), to.
id
(), amount);
29
}
30
31
}
// namespace xrpl::test::jtx
json::Value
Represents a JSON value.
Definition
json_value.h:117
xrpl::STAmount::getJson
json::Value getJson(JsonOptions=JsonOptions::Values::None) const override
Definition
STAmount.cpp:735
xrpl::test::jtx::Account
Immutable cryptographic account descriptor.
Definition
jtx/Account.h:21
xrpl::test::jtx::Account::id
AccountID id() const
Returns the Account ID.
Definition
jtx/Account.h:104
xrpl::test::jtx
Definition
Oracle_test.cpp:34
xrpl::test::jtx::pay
json::Value pay(AccountID const &account, AccountID const &to, AnyAmount amount)
Create a payment.
Definition
pay.cpp:14
xrpl::to_string
std::string to_string(BaseUInt< Bits, Tag > const &a)
Definition
base_uint.h:657
xrpl::AccountID
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition
AccountID.h:34
xrpl::tfFullyCanonicalSig
constexpr FlagValue tfFullyCanonicalSig
Definition
TxFlags.h:43
xrpl::JsonOptions::Values::None
@ None
Definition
STBase.h:27
xrpl::test::jtx::AnyAmount
Amount specifier with an option for any issuer.
Definition
src/test/jtx/amount.h:608
xrpl::test::jtx::AnyAmount::to
void to(AccountID const &id)
Definition
src/test/jtx/amount.h:627
xrpl::test::jtx::AnyAmount::value
STAmount value
Definition
src/test/jtx/amount.h:610
Generated by
1.17.0