4#include <xrpl/protocol/STLedgerEntry.h>
5#include <xrpl/protocol/STParsedJSON.h>
6#include <xrpl/protocol/jss.h>
7#include <xrpl/protocol_autogen/LedgerEntryBase.h>
8#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
9#include <xrpl/json/json_value.h>
42 throw std::runtime_error(
"Invalid ledger entry type for Check");
53 SF_ACCOUNT::type::value_type
56 return this->
sle_->at(sfAccount);
64 SF_ACCOUNT::type::value_type
67 return this->
sle_->at(sfDestination);
75 SF_AMOUNT::type::value_type
78 return this->
sle_->at(sfSendMax);
86 SF_UINT32::type::value_type
89 return this->
sle_->at(sfSequence);
97 SF_UINT64::type::value_type
100 return this->
sle_->at(sfOwnerNode);
108 SF_UINT64::type::value_type
111 return this->
sle_->at(sfDestinationNode);
123 return this->
sle_->at(sfExpiration);
135 return this->
sle_->isFieldPresent(sfExpiration);
147 return this->
sle_->at(sfInvoiceID);
159 return this->
sle_->isFieldPresent(sfInvoiceID);
171 return this->
sle_->at(sfSourceTag);
183 return this->
sle_->isFieldPresent(sfSourceTag);
195 return this->
sle_->at(sfDestinationTag);
207 return this->
sle_->isFieldPresent(sfDestinationTag);
215 SF_UINT256::type::value_type
218 return this->
sle_->at(sfPreviousTxnID);
226 SF_UINT32::type::value_type
229 return this->
sle_->at(sfPreviousTxnLgrSeq);
274 if (sle->at(sfLedgerEntryType) != ltCHECK)
301 object_[sfDestination] = value;
345 object_[sfDestinationNode] = value;
389 object_[sfDestinationTag] = value;
400 object_[sfPreviousTxnID] = value;
411 object_[sfPreviousTxnLgrSeq] = value;
std::shared_ptr< STLedgerEntry const > const_pointer
Builder for Check ledger entries.
CheckBuilder & setDestination(std::decay_t< typename SF_ACCOUNT::type::value_type > const &value)
Set sfDestination (SoeRequired).
CheckBuilder & setDestinationNode(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfDestinationNode (SoeRequired).
CheckBuilder & setSourceTag(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfSourceTag (SoeOptional).
CheckBuilder & setOwnerNode(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfOwnerNode (SoeRequired).
CheckBuilder & setSendMax(std::decay_t< typename SF_AMOUNT::type::value_type > const &value)
Set sfSendMax (SoeRequired).
CheckBuilder(std::decay_t< typename SF_ACCOUNT::type::value_type > const &account, std::decay_t< typename SF_ACCOUNT::type::value_type > const &destination, std::decay_t< typename SF_AMOUNT::type::value_type > const &sendMax, std::decay_t< typename SF_UINT32::type::value_type > const &sequence, std::decay_t< typename SF_UINT64::type::value_type > const &ownerNode, std::decay_t< typename SF_UINT64::type::value_type > const &destinationNode, std::decay_t< typename SF_UINT256::type::value_type > const &previousTxnID, std::decay_t< typename SF_UINT32::type::value_type > const &previousTxnLgrSeq)
Construct a new CheckBuilder with required fields.
CheckBuilder(SLE::const_pointer sle)
Construct a CheckBuilder from an existing SLE object.
CheckBuilder & setPreviousTxnLgrSeq(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfPreviousTxnLgrSeq (SoeRequired).
CheckBuilder & setSequence(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfSequence (SoeRequired).
CheckBuilder & setExpiration(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfExpiration (SoeOptional).
CheckBuilder & setPreviousTxnID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfPreviousTxnID (SoeRequired).
Check build(uint256 const &index)
Build and return the completed Check wrapper.
CheckBuilder & setAccount(std::decay_t< typename SF_ACCOUNT::type::value_type > const &value)
Ledger entry-specific field setters.
CheckBuilder & setDestinationTag(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfDestinationTag (SoeOptional).
CheckBuilder & setInvoiceID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfInvoiceID (SoeOptional).
SF_ACCOUNT::type::value_type getDestination() const
Get sfDestination (SoeRequired).
bool hasInvoiceID() const
Check if sfInvoiceID is present.
SF_UINT32::type::value_type getSequence() const
Get sfSequence (SoeRequired).
bool hasSourceTag() const
Check if sfSourceTag is present.
SF_UINT256::type::value_type getPreviousTxnID() const
Get sfPreviousTxnID (SoeRequired).
protocol_autogen::Optional< SF_UINT32::type::value_type > getExpiration() const
Get sfExpiration (SoeOptional).
Check(SLE::const_pointer sle)
Construct a Check ledger entry wrapper from an existing SLE object.
SF_UINT64::type::value_type getOwnerNode() const
Get sfOwnerNode (SoeRequired).
protocol_autogen::Optional< SF_UINT256::type::value_type > getInvoiceID() const
Get sfInvoiceID (SoeOptional).
bool hasDestinationTag() const
Check if sfDestinationTag is present.
SF_UINT32::type::value_type getPreviousTxnLgrSeq() const
Get sfPreviousTxnLgrSeq (SoeRequired).
static constexpr LedgerEntryType entryType
protocol_autogen::Optional< SF_UINT32::type::value_type > getSourceTag() const
Get sfSourceTag (SoeOptional).
protocol_autogen::Optional< SF_UINT32::type::value_type > getDestinationTag() const
Get sfDestinationTag (SoeOptional).
SF_AMOUNT::type::value_type getSendMax() const
Get sfSendMax (SoeRequired).
SF_ACCOUNT::type::value_type getAccount() const
Get sfAccount (SoeRequired).
SF_UINT64::type::value_type getDestinationNode() const
Get sfDestinationNode (SoeRequired).
bool hasExpiration() const
Check if sfExpiration is present.
LedgerEntryBase(SLE::const_pointer sle)
Construct a ledger entry wrapper from an existing SLE object.
SLE::const_pointer sle_
The underlying serialized ledger entry being wrapped.
LedgerEntryBuilderBase()=default
std::conditional_t< std::is_reference_v< ValueType >, std::optional< std::reference_wrapper< std::remove_reference_t< ValueType > > >, std::optional< ValueType > > Optional
LedgerEntryType
Identifiers for on-ledger objects.