4#include <xrpl/protocol/STTx.h>
5#include <xrpl/protocol/STParsedJSON.h>
6#include <xrpl/protocol/jss.h>
7#include <xrpl/protocol_autogen/TransactionBase.h>
8#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
9#include <xrpl/json/json_value.h>
55 SF_ACCOUNT::type::value_type
58 return this->
tx_->at(sfDestination);
67 SF_AMOUNT::type::value_type
70 return this->
tx_->at(sfAmount);
84 return this->
tx_->at(sfSendMax);
97 return this->
tx_->isFieldPresent(sfSendMax);
108 if (this->
tx_->isFieldPresent(sfPaths))
109 return this->
tx_->getFieldPathSet(sfPaths);
121 return this->
tx_->isFieldPresent(sfPaths);
134 return this->
tx_->at(sfInvoiceID);
147 return this->
tx_->isFieldPresent(sfInvoiceID);
160 return this->
tx_->at(sfDestinationTag);
173 return this->
tx_->isFieldPresent(sfDestinationTag);
187 return this->
tx_->at(sfDeliverMin);
200 return this->
tx_->isFieldPresent(sfDeliverMin);
213 return this->
tx_->at(sfCredentialIDs);
226 return this->
tx_->isFieldPresent(sfCredentialIDs);
239 return this->
tx_->at(sfDomainID);
252 return this->
tx_->isFieldPresent(sfDomainID);
291 if (tx->getTxnType() != ttPAYMENT)
307 object_[sfDestination] = value;
364 object_[sfDestinationTag] = value;
387 object_[sfCredentialIDs] = value;
411 sign(publicKey, secretKey);
void setFieldPathSet(SField const &field, STPathSet const &)
Builder for Payment transactions.
PaymentBuilder & setDeliverMin(std::decay_t< typename SF_AMOUNT::type::value_type > const &value)
Set sfDeliverMin (soeOPTIONAL)
PaymentBuilder & setCredentialIDs(std::decay_t< typename SF_VECTOR256::type::value_type > const &value)
Set sfCredentialIDs (soeOPTIONAL)
PaymentBuilder & setAmount(std::decay_t< typename SF_AMOUNT::type::value_type > const &value)
Set sfAmount (soeREQUIRED)
PaymentBuilder & setSendMax(std::decay_t< typename SF_AMOUNT::type::value_type > const &value)
Set sfSendMax (soeOPTIONAL)
PaymentBuilder(SF_ACCOUNT::type::value_type account, std::decay_t< typename SF_ACCOUNT::type::value_type > const &destination, std::decay_t< typename SF_AMOUNT::type::value_type > const &amount, std::optional< SF_UINT32::type::value_type > sequence=std::nullopt, std::optional< SF_AMOUNT::type::value_type > fee=std::nullopt)
Construct a new PaymentBuilder with required fields.
PaymentBuilder(std::shared_ptr< STTx const > tx)
Construct a PaymentBuilder from an existing STTx object.
PaymentBuilder & setDestination(std::decay_t< typename SF_ACCOUNT::type::value_type > const &value)
Transaction-specific field setters.
PaymentBuilder & setInvoiceID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfInvoiceID (soeOPTIONAL)
PaymentBuilder & setDestinationTag(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfDestinationTag (soeOPTIONAL)
PaymentBuilder & setPaths(STPathSet const &value)
Set sfPaths (soeDEFAULT)
Payment build(PublicKey const &publicKey, SecretKey const &secretKey)
Build and return the Payment wrapper.
PaymentBuilder & setDomainID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfDomainID (soeOPTIONAL)
bool hasPaths() const
Check if sfPaths is present.
std::optional< std::reference_wrapper< STPathSet const > > getPaths() const
Get sfPaths (soeDEFAULT)
static constexpr xrpl::TxType txType
protocol_autogen::Optional< SF_AMOUNT::type::value_type > getSendMax() const
Get sfSendMax (soeOPTIONAL)
bool hasDomainID() const
Check if sfDomainID is present.
protocol_autogen::Optional< SF_VECTOR256::type::value_type > getCredentialIDs() const
Get sfCredentialIDs (soeOPTIONAL)
bool hasDestinationTag() const
Check if sfDestinationTag is present.
protocol_autogen::Optional< SF_AMOUNT::type::value_type > getDeliverMin() const
Get sfDeliverMin (soeOPTIONAL)
protocol_autogen::Optional< SF_UINT256::type::value_type > getInvoiceID() const
Get sfInvoiceID (soeOPTIONAL)
Payment(std::shared_ptr< STTx const > tx)
Construct a Payment transaction wrapper from an existing STTx object.
bool hasInvoiceID() const
Check if sfInvoiceID is present.
bool hasSendMax() const
Check if sfSendMax is present.
bool hasCredentialIDs() const
Check if sfCredentialIDs is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getDestinationTag() const
Get sfDestinationTag (soeOPTIONAL)
bool hasDeliverMin() const
Check if sfDeliverMin is present.
protocol_autogen::Optional< SF_UINT256::type::value_type > getDomainID() const
Get sfDomainID (soeOPTIONAL)
SF_AMOUNT::type::value_type getAmount() const
Get sfAmount (soeREQUIRED)
SF_ACCOUNT::type::value_type getDestination() const
Get sfDestination (soeREQUIRED)
Base class for all transaction wrapper types.
std::shared_ptr< STTx const > tx_
The underlying transaction object being wrapped.
Base class for all transaction builders.
PaymentBuilder & sign(PublicKey const &publicKey, SecretKey const &secretKey)
Sign the transaction with the given keys.
TxType
Transaction type identifiers.