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 DirectoryNode");
57 return this->
sle_->at(sfOwner);
69 return this->
sle_->isFieldPresent(sfOwner);
81 return this->
sle_->at(sfTakerPaysCurrency);
93 return this->
sle_->isFieldPresent(sfTakerPaysCurrency);
105 return this->
sle_->at(sfTakerPaysIssuer);
117 return this->
sle_->isFieldPresent(sfTakerPaysIssuer);
129 return this->
sle_->at(sfTakerPaysMPT);
141 return this->
sle_->isFieldPresent(sfTakerPaysMPT);
153 return this->
sle_->at(sfTakerGetsCurrency);
165 return this->
sle_->isFieldPresent(sfTakerGetsCurrency);
177 return this->
sle_->at(sfTakerGetsIssuer);
189 return this->
sle_->isFieldPresent(sfTakerGetsIssuer);
201 return this->
sle_->at(sfTakerGetsMPT);
213 return this->
sle_->isFieldPresent(sfTakerGetsMPT);
225 return this->
sle_->at(sfExchangeRate);
237 return this->
sle_->isFieldPresent(sfExchangeRate);
245 SF_VECTOR256::type::value_type
248 return this->
sle_->at(sfIndexes);
256 SF_UINT256::type::value_type
259 return this->
sle_->at(sfRootIndex);
271 return this->
sle_->at(sfIndexNext);
283 return this->
sle_->isFieldPresent(sfIndexNext);
295 return this->
sle_->at(sfIndexPrevious);
307 return this->
sle_->isFieldPresent(sfIndexPrevious);
319 return this->
sle_->at(sfNFTokenID);
331 return this->
sle_->isFieldPresent(sfNFTokenID);
343 return this->
sle_->at(sfPreviousTxnID);
355 return this->
sle_->isFieldPresent(sfPreviousTxnID);
367 return this->
sle_->at(sfPreviousTxnLgrSeq);
379 return this->
sle_->isFieldPresent(sfPreviousTxnLgrSeq);
391 return this->
sle_->at(sfDomainID);
403 return this->
sle_->isFieldPresent(sfDomainID);
436 if (sle->at(sfLedgerEntryType) != ltDIR_NODE)
463 object_[sfTakerPaysCurrency] = value;
474 object_[sfTakerPaysIssuer] = value;
485 object_[sfTakerPaysMPT] = value;
496 object_[sfTakerGetsCurrency] = value;
507 object_[sfTakerGetsIssuer] = value;
518 object_[sfTakerGetsMPT] = value;
529 object_[sfExchangeRate] = value;
573 object_[sfIndexPrevious] = value;
595 object_[sfPreviousTxnID] = value;
606 object_[sfPreviousTxnLgrSeq] = value;
std::shared_ptr< STLedgerEntry const > const_pointer
Builder for DirectoryNode ledger entries.
DirectoryNodeBuilder & setIndexes(std::decay_t< typename SF_VECTOR256::type::value_type > const &value)
Set sfIndexes (SoeRequired).
DirectoryNodeBuilder & setTakerPaysMPT(std::decay_t< typename SF_UINT192::type::value_type > const &value)
Set sfTakerPaysMPT (SoeOptional).
DirectoryNodeBuilder & setTakerGetsIssuer(std::decay_t< typename SF_UINT160::type::value_type > const &value)
Set sfTakerGetsIssuer (SoeOptional).
DirectoryNodeBuilder & setDomainID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfDomainID (SoeOptional).
DirectoryNodeBuilder & setPreviousTxnLgrSeq(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfPreviousTxnLgrSeq (SoeOptional).
DirectoryNodeBuilder & setTakerGetsCurrency(std::decay_t< typename SF_UINT160::type::value_type > const &value)
Set sfTakerGetsCurrency (SoeOptional).
DirectoryNodeBuilder & setIndexNext(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfIndexNext (SoeOptional).
DirectoryNodeBuilder(SLE::const_pointer sle)
Construct a DirectoryNodeBuilder from an existing SLE object.
DirectoryNodeBuilder & setTakerPaysIssuer(std::decay_t< typename SF_UINT160::type::value_type > const &value)
Set sfTakerPaysIssuer (SoeOptional).
DirectoryNodeBuilder & setRootIndex(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfRootIndex (SoeRequired).
DirectoryNodeBuilder & setIndexPrevious(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfIndexPrevious (SoeOptional).
DirectoryNodeBuilder & setNFTokenID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfNFTokenID (SoeOptional).
DirectoryNodeBuilder & setPreviousTxnID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfPreviousTxnID (SoeOptional).
DirectoryNodeBuilder(std::decay_t< typename SF_VECTOR256::type::value_type > const &indexes, std::decay_t< typename SF_UINT256::type::value_type > const &rootIndex)
Construct a new DirectoryNodeBuilder with required fields.
DirectoryNodeBuilder & setTakerGetsMPT(std::decay_t< typename SF_UINT192::type::value_type > const &value)
Set sfTakerGetsMPT (SoeOptional).
DirectoryNodeBuilder & setExchangeRate(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfExchangeRate (SoeOptional).
DirectoryNodeBuilder & setTakerPaysCurrency(std::decay_t< typename SF_UINT160::type::value_type > const &value)
Set sfTakerPaysCurrency (SoeOptional).
DirectoryNodeBuilder & setOwner(std::decay_t< typename SF_ACCOUNT::type::value_type > const &value)
Ledger entry-specific field setters.
DirectoryNode build(uint256 const &index)
Build and return the completed DirectoryNode wrapper.
Ledger Entry: DirectoryNode.
SF_UINT256::type::value_type getRootIndex() const
Get sfRootIndex (SoeRequired).
protocol_autogen::Optional< SF_UINT64::type::value_type > getIndexNext() const
Get sfIndexNext (SoeOptional).
protocol_autogen::Optional< SF_ACCOUNT::type::value_type > getOwner() const
Get sfOwner (SoeOptional).
protocol_autogen::Optional< SF_UINT192::type::value_type > getTakerGetsMPT() const
Get sfTakerGetsMPT (SoeOptional).
bool hasIndexPrevious() const
Check if sfIndexPrevious is present.
protocol_autogen::Optional< SF_UINT64::type::value_type > getIndexPrevious() const
Get sfIndexPrevious (SoeOptional).
bool hasPreviousTxnID() const
Check if sfPreviousTxnID is present.
protocol_autogen::Optional< SF_UINT160::type::value_type > getTakerPaysCurrency() const
Get sfTakerPaysCurrency (SoeOptional).
protocol_autogen::Optional< SF_UINT256::type::value_type > getNFTokenID() const
Get sfNFTokenID (SoeOptional).
bool hasTakerPaysCurrency() const
Check if sfTakerPaysCurrency is present.
bool hasTakerGetsIssuer() const
Check if sfTakerGetsIssuer is present.
DirectoryNode(SLE::const_pointer sle)
Construct a DirectoryNode ledger entry wrapper from an existing SLE object.
bool hasIndexNext() const
Check if sfIndexNext is present.
bool hasTakerGetsMPT() const
Check if sfTakerGetsMPT is present.
bool hasDomainID() const
Check if sfDomainID is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getPreviousTxnLgrSeq() const
Get sfPreviousTxnLgrSeq (SoeOptional).
bool hasTakerPaysMPT() const
Check if sfTakerPaysMPT is present.
protocol_autogen::Optional< SF_UINT160::type::value_type > getTakerGetsIssuer() const
Get sfTakerGetsIssuer (SoeOptional).
bool hasPreviousTxnLgrSeq() const
Check if sfPreviousTxnLgrSeq is present.
protocol_autogen::Optional< SF_UINT192::type::value_type > getTakerPaysMPT() const
Get sfTakerPaysMPT (SoeOptional).
bool hasTakerGetsCurrency() const
Check if sfTakerGetsCurrency is present.
SF_VECTOR256::type::value_type getIndexes() const
Get sfIndexes (SoeRequired).
protocol_autogen::Optional< SF_UINT256::type::value_type > getDomainID() const
Get sfDomainID (SoeOptional).
bool hasExchangeRate() const
Check if sfExchangeRate is present.
bool hasNFTokenID() const
Check if sfNFTokenID is present.
protocol_autogen::Optional< SF_UINT64::type::value_type > getExchangeRate() const
Get sfExchangeRate (SoeOptional).
bool hasOwner() const
Check if sfOwner is present.
protocol_autogen::Optional< SF_UINT160::type::value_type > getTakerGetsCurrency() const
Get sfTakerGetsCurrency (SoeOptional).
bool hasTakerPaysIssuer() const
Check if sfTakerPaysIssuer is present.
protocol_autogen::Optional< SF_UINT160::type::value_type > getTakerPaysIssuer() const
Get sfTakerPaysIssuer (SoeOptional).
static constexpr LedgerEntryType entryType
protocol_autogen::Optional< SF_UINT256::type::value_type > getPreviousTxnID() const
Get sfPreviousTxnID (SoeOptional).
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.