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 Escrow");
53 SF_ACCOUNT::type::value_type
56 return this->
sle_->at(sfAccount);
68 return this->
sle_->at(sfSequence);
80 return this->
sle_->isFieldPresent(sfSequence);
88 SF_ACCOUNT::type::value_type
91 return this->
sle_->at(sfDestination);
99 SF_AMOUNT::type::value_type
102 return this->
sle_->at(sfAmount);
114 return this->
sle_->at(sfCondition);
126 return this->
sle_->isFieldPresent(sfCondition);
138 return this->
sle_->at(sfCancelAfter);
150 return this->
sle_->isFieldPresent(sfCancelAfter);
162 return this->
sle_->at(sfFinishAfter);
174 return this->
sle_->isFieldPresent(sfFinishAfter);
186 return this->
sle_->at(sfSourceTag);
198 return this->
sle_->isFieldPresent(sfSourceTag);
210 return this->
sle_->at(sfDestinationTag);
222 return this->
sle_->isFieldPresent(sfDestinationTag);
230 SF_UINT64::type::value_type
233 return this->
sle_->at(sfOwnerNode);
241 SF_UINT256::type::value_type
244 return this->
sle_->at(sfPreviousTxnID);
252 SF_UINT32::type::value_type
255 return this->
sle_->at(sfPreviousTxnLgrSeq);
267 return this->
sle_->at(sfDestinationNode);
279 return this->
sle_->isFieldPresent(sfDestinationNode);
291 return this->
sle_->at(sfTransferRate);
303 return this->
sle_->isFieldPresent(sfTransferRate);
315 return this->
sle_->at(sfIssuerNode);
327 return this->
sle_->isFieldPresent(sfIssuerNode);
368 if (sle->at(sfLedgerEntryType) != ltESCROW)
406 object_[sfDestination] = value;
439 object_[sfCancelAfter] = value;
450 object_[sfFinishAfter] = value;
472 object_[sfDestinationTag] = value;
494 object_[sfPreviousTxnID] = value;
505 object_[sfPreviousTxnLgrSeq] = value;
516 object_[sfDestinationNode] = value;
527 object_[sfTransferRate] = value;
std::shared_ptr< STLedgerEntry const > const_pointer
Builder for Escrow ledger entries.
EscrowBuilder & setAmount(std::decay_t< typename SF_AMOUNT::type::value_type > const &value)
Set sfAmount (SoeRequired).
EscrowBuilder & setSourceTag(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfSourceTag (SoeOptional).
EscrowBuilder & setDestinationNode(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfDestinationNode (SoeOptional).
EscrowBuilder & setCancelAfter(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfCancelAfter (SoeOptional).
EscrowBuilder & setFinishAfter(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfFinishAfter (SoeOptional).
EscrowBuilder & setPreviousTxnLgrSeq(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfPreviousTxnLgrSeq (SoeRequired).
EscrowBuilder & setDestination(std::decay_t< typename SF_ACCOUNT::type::value_type > const &value)
Set sfDestination (SoeRequired).
EscrowBuilder & setCondition(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfCondition (SoeOptional).
EscrowBuilder(SLE::const_pointer sle)
Construct a EscrowBuilder from an existing SLE object.
EscrowBuilder & setSequence(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfSequence (SoeOptional).
EscrowBuilder & setAccount(std::decay_t< typename SF_ACCOUNT::type::value_type > const &value)
Ledger entry-specific field setters.
EscrowBuilder & setOwnerNode(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfOwnerNode (SoeRequired).
Escrow build(uint256 const &index)
Build and return the completed Escrow wrapper.
EscrowBuilder & setTransferRate(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfTransferRate (SoeOptional).
EscrowBuilder(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 &amount, std::decay_t< typename SF_UINT64::type::value_type > const &ownerNode, 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 EscrowBuilder with required fields.
EscrowBuilder & setIssuerNode(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfIssuerNode (SoeOptional).
EscrowBuilder & setPreviousTxnID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfPreviousTxnID (SoeRequired).
EscrowBuilder & setDestinationTag(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfDestinationTag (SoeOptional).
bool hasDestinationTag() const
Check if sfDestinationTag is present.
SF_UINT64::type::value_type getOwnerNode() const
Get sfOwnerNode (SoeRequired).
protocol_autogen::Optional< SF_UINT32::type::value_type > getDestinationTag() const
Get sfDestinationTag (SoeOptional).
bool hasCancelAfter() const
Check if sfCancelAfter is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getCancelAfter() const
Get sfCancelAfter (SoeOptional).
protocol_autogen::Optional< SF_UINT32::type::value_type > getSequence() const
Get sfSequence (SoeOptional).
protocol_autogen::Optional< SF_UINT64::type::value_type > getIssuerNode() const
Get sfIssuerNode (SoeOptional).
protocol_autogen::Optional< SF_VL::type::value_type > getCondition() const
Get sfCondition (SoeOptional).
SF_UINT32::type::value_type getPreviousTxnLgrSeq() const
Get sfPreviousTxnLgrSeq (SoeRequired).
bool hasCondition() const
Check if sfCondition is present.
bool hasSequence() const
Check if sfSequence is present.
Escrow(SLE::const_pointer sle)
Construct a Escrow ledger entry wrapper from an existing SLE object.
protocol_autogen::Optional< SF_UINT32::type::value_type > getFinishAfter() const
Get sfFinishAfter (SoeOptional).
SF_AMOUNT::type::value_type getAmount() const
Get sfAmount (SoeRequired).
bool hasTransferRate() const
Check if sfTransferRate is present.
SF_ACCOUNT::type::value_type getAccount() const
Get sfAccount (SoeRequired).
bool hasSourceTag() const
Check if sfSourceTag is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getSourceTag() const
Get sfSourceTag (SoeOptional).
static constexpr LedgerEntryType entryType
protocol_autogen::Optional< SF_UINT32::type::value_type > getTransferRate() const
Get sfTransferRate (SoeOptional).
bool hasFinishAfter() const
Check if sfFinishAfter is present.
SF_UINT256::type::value_type getPreviousTxnID() const
Get sfPreviousTxnID (SoeRequired).
bool hasDestinationNode() const
Check if sfDestinationNode is present.
SF_ACCOUNT::type::value_type getDestination() const
Get sfDestination (SoeRequired).
protocol_autogen::Optional< SF_UINT64::type::value_type > getDestinationNode() const
Get sfDestinationNode (SoeOptional).
bool hasIssuerNode() const
Check if sfIssuerNode 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.