xrpld
Loading...
Searching...
No Matches
xrpl::ledger_entries::AccountRoot Class Reference

Ledger Entry: AccountRoot. More...

#include <AccountRoot.h>

Inheritance diagram for xrpl::ledger_entries::AccountRoot:
Collaboration diagram for xrpl::ledger_entries::AccountRoot:

Public Member Functions

 AccountRoot (SLE::const_pointer sle)
 Construct a AccountRoot ledger entry wrapper from an existing SLE object.
SF_ACCOUNT::type::value_type getAccount () const
 Get sfAccount (SoeRequired).
SF_UINT32::type::value_type getSequence () const
 Get sfSequence (SoeRequired).
SF_AMOUNT::type::value_type getBalance () const
 Get sfBalance (SoeRequired).
SF_UINT32::type::value_type getOwnerCount () const
 Get sfOwnerCount (SoeRequired).
SF_UINT256::type::value_type getPreviousTxnID () const
 Get sfPreviousTxnID (SoeRequired).
SF_UINT32::type::value_type getPreviousTxnLgrSeq () const
 Get sfPreviousTxnLgrSeq (SoeRequired).
protocol_autogen::Optional< SF_UINT256::type::value_type > getAccountTxnID () const
 Get sfAccountTxnID (SoeOptional).
bool hasAccountTxnID () const
 Check if sfAccountTxnID is present.
protocol_autogen::Optional< SF_ACCOUNT::type::value_type > getRegularKey () const
 Get sfRegularKey (SoeOptional).
bool hasRegularKey () const
 Check if sfRegularKey is present.
protocol_autogen::Optional< SF_UINT128::type::value_type > getEmailHash () const
 Get sfEmailHash (SoeOptional).
bool hasEmailHash () const
 Check if sfEmailHash is present.
protocol_autogen::Optional< SF_UINT256::type::value_type > getWalletLocator () const
 Get sfWalletLocator (SoeOptional).
bool hasWalletLocator () const
 Check if sfWalletLocator is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getWalletSize () const
 Get sfWalletSize (SoeOptional).
bool hasWalletSize () const
 Check if sfWalletSize is present.
protocol_autogen::Optional< SF_VL::type::value_type > getMessageKey () const
 Get sfMessageKey (SoeOptional).
bool hasMessageKey () const
 Check if sfMessageKey is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getTransferRate () const
 Get sfTransferRate (SoeOptional).
bool hasTransferRate () const
 Check if sfTransferRate is present.
protocol_autogen::Optional< SF_VL::type::value_type > getDomain () const
 Get sfDomain (SoeOptional).
bool hasDomain () const
 Check if sfDomain is present.
protocol_autogen::Optional< SF_UINT8::type::value_type > getTickSize () const
 Get sfTickSize (SoeOptional).
bool hasTickSize () const
 Check if sfTickSize is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getTicketCount () const
 Get sfTicketCount (SoeOptional).
bool hasTicketCount () const
 Check if sfTicketCount is present.
protocol_autogen::Optional< SF_ACCOUNT::type::value_type > getNFTokenMinter () const
 Get sfNFTokenMinter (SoeOptional).
bool hasNFTokenMinter () const
 Check if sfNFTokenMinter is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getMintedNFTokens () const
 Get sfMintedNFTokens (SoeDefault).
bool hasMintedNFTokens () const
 Check if sfMintedNFTokens is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getBurnedNFTokens () const
 Get sfBurnedNFTokens (SoeDefault).
bool hasBurnedNFTokens () const
 Check if sfBurnedNFTokens is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getFirstNFTokenSequence () const
 Get sfFirstNFTokenSequence (SoeOptional).
bool hasFirstNFTokenSequence () const
 Check if sfFirstNFTokenSequence is present.
protocol_autogen::Optional< SF_UINT256::type::value_type > getAMMID () const
 Get sfAMMID (SoeOptional).
bool hasAMMID () const
 Check if sfAMMID is present.
protocol_autogen::Optional< SF_UINT256::type::value_type > getVaultID () const
 Get sfVaultID (SoeOptional).
bool hasVaultID () const
 Check if sfVaultID is present.
protocol_autogen::Optional< SF_UINT256::type::value_type > getLoanBrokerID () const
 Get sfLoanBrokerID (SoeOptional).
bool hasLoanBrokerID () const
 Check if sfLoanBrokerID is present.
bool validate () const
 Validate the ledger entry.
LedgerEntryType getType () const
 Get the ledger entry type.
uint256 const & getKey () const
 Get the key (index) of this ledger entry.
std::optional< uint256getLedgerIndex () const
 Get the ledger index (sfLedgerIndex).
bool hasLedgerIndex () const
 Check if the ledger entry has a ledger index.
uint16_t getLedgerEntryType () const
 Get the ledger entry type field (sfLedgerEntryType).
std::uint32_t getFlags () const
 Get the flags field (sfFlags).
bool isFlag (std::uint32_t f) const
 Check if a specific flag is set.
SLE::const_pointer getSle () const
 Get the underlying SLE object.

Static Public Attributes

static constexpr LedgerEntryType entryType = ltACCOUNT_ROOT

Protected Attributes

SLE::const_pointer sle_
 The underlying serialized ledger entry being wrapped.

Detailed Description

Ledger Entry: AccountRoot.

Type: ltACCOUNT_ROOT (0x0061) RPC Name: account

Immutable wrapper around SLE providing type-safe field access. Use AccountRootBuilder to construct new ledger entries.

Definition at line 27 of file AccountRoot.h.

Constructor & Destructor Documentation

◆ AccountRoot()

xrpl::ledger_entries::AccountRoot::AccountRoot ( SLE::const_pointer sle)
explicit

Construct a AccountRoot ledger entry wrapper from an existing SLE object.

Exceptions
std::runtime_errorif the ledger entry type doesn't match.

Definition at line 36 of file AccountRoot.h.

Member Function Documentation

◆ getAccount()

SF_ACCOUNT::type::value_type xrpl::ledger_entries::AccountRoot::getAccount ( ) const
nodiscard

Get sfAccount (SoeRequired).

Returns
The field value.

Definition at line 54 of file AccountRoot.h.

◆ getSequence()

SF_UINT32::type::value_type xrpl::ledger_entries::AccountRoot::getSequence ( ) const
nodiscard

Get sfSequence (SoeRequired).

Returns
The field value.

Definition at line 65 of file AccountRoot.h.

◆ getBalance()

SF_AMOUNT::type::value_type xrpl::ledger_entries::AccountRoot::getBalance ( ) const
nodiscard

Get sfBalance (SoeRequired).

Returns
The field value.

Definition at line 76 of file AccountRoot.h.

◆ getOwnerCount()

SF_UINT32::type::value_type xrpl::ledger_entries::AccountRoot::getOwnerCount ( ) const
nodiscard

Get sfOwnerCount (SoeRequired).

Returns
The field value.

Definition at line 87 of file AccountRoot.h.

◆ getPreviousTxnID()

SF_UINT256::type::value_type xrpl::ledger_entries::AccountRoot::getPreviousTxnID ( ) const
nodiscard

Get sfPreviousTxnID (SoeRequired).

Returns
The field value.

Definition at line 98 of file AccountRoot.h.

◆ getPreviousTxnLgrSeq()

SF_UINT32::type::value_type xrpl::ledger_entries::AccountRoot::getPreviousTxnLgrSeq ( ) const
nodiscard

Get sfPreviousTxnLgrSeq (SoeRequired).

Returns
The field value.

Definition at line 109 of file AccountRoot.h.

◆ getAccountTxnID()

protocol_autogen::Optional< SF_UINT256::type::value_type > xrpl::ledger_entries::AccountRoot::getAccountTxnID ( ) const
nodiscard

Get sfAccountTxnID (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 120 of file AccountRoot.h.

◆ hasAccountTxnID()

bool xrpl::ledger_entries::AccountRoot::hasAccountTxnID ( ) const
nodiscard

Check if sfAccountTxnID is present.

Returns
True if the field is present, false otherwise.

Definition at line 133 of file AccountRoot.h.

◆ getRegularKey()

protocol_autogen::Optional< SF_ACCOUNT::type::value_type > xrpl::ledger_entries::AccountRoot::getRegularKey ( ) const
nodiscard

Get sfRegularKey (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 144 of file AccountRoot.h.

◆ hasRegularKey()

bool xrpl::ledger_entries::AccountRoot::hasRegularKey ( ) const
nodiscard

Check if sfRegularKey is present.

Returns
True if the field is present, false otherwise.

Definition at line 157 of file AccountRoot.h.

◆ getEmailHash()

protocol_autogen::Optional< SF_UINT128::type::value_type > xrpl::ledger_entries::AccountRoot::getEmailHash ( ) const
nodiscard

Get sfEmailHash (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 168 of file AccountRoot.h.

◆ hasEmailHash()

bool xrpl::ledger_entries::AccountRoot::hasEmailHash ( ) const
nodiscard

Check if sfEmailHash is present.

Returns
True if the field is present, false otherwise.

Definition at line 181 of file AccountRoot.h.

◆ getWalletLocator()

protocol_autogen::Optional< SF_UINT256::type::value_type > xrpl::ledger_entries::AccountRoot::getWalletLocator ( ) const
nodiscard

Get sfWalletLocator (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 192 of file AccountRoot.h.

◆ hasWalletLocator()

bool xrpl::ledger_entries::AccountRoot::hasWalletLocator ( ) const
nodiscard

Check if sfWalletLocator is present.

Returns
True if the field is present, false otherwise.

Definition at line 205 of file AccountRoot.h.

◆ getWalletSize()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::AccountRoot::getWalletSize ( ) const
nodiscard

Get sfWalletSize (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 216 of file AccountRoot.h.

◆ hasWalletSize()

bool xrpl::ledger_entries::AccountRoot::hasWalletSize ( ) const
nodiscard

Check if sfWalletSize is present.

Returns
True if the field is present, false otherwise.

Definition at line 229 of file AccountRoot.h.

◆ getMessageKey()

protocol_autogen::Optional< SF_VL::type::value_type > xrpl::ledger_entries::AccountRoot::getMessageKey ( ) const
nodiscard

Get sfMessageKey (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 240 of file AccountRoot.h.

◆ hasMessageKey()

bool xrpl::ledger_entries::AccountRoot::hasMessageKey ( ) const
nodiscard

Check if sfMessageKey is present.

Returns
True if the field is present, false otherwise.

Definition at line 253 of file AccountRoot.h.

◆ getTransferRate()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::AccountRoot::getTransferRate ( ) const
nodiscard

Get sfTransferRate (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 264 of file AccountRoot.h.

◆ hasTransferRate()

bool xrpl::ledger_entries::AccountRoot::hasTransferRate ( ) const
nodiscard

Check if sfTransferRate is present.

Returns
True if the field is present, false otherwise.

Definition at line 277 of file AccountRoot.h.

◆ getDomain()

protocol_autogen::Optional< SF_VL::type::value_type > xrpl::ledger_entries::AccountRoot::getDomain ( ) const
nodiscard

Get sfDomain (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 288 of file AccountRoot.h.

◆ hasDomain()

bool xrpl::ledger_entries::AccountRoot::hasDomain ( ) const
nodiscard

Check if sfDomain is present.

Returns
True if the field is present, false otherwise.

Definition at line 301 of file AccountRoot.h.

◆ getTickSize()

protocol_autogen::Optional< SF_UINT8::type::value_type > xrpl::ledger_entries::AccountRoot::getTickSize ( ) const
nodiscard

Get sfTickSize (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 312 of file AccountRoot.h.

◆ hasTickSize()

bool xrpl::ledger_entries::AccountRoot::hasTickSize ( ) const
nodiscard

Check if sfTickSize is present.

Returns
True if the field is present, false otherwise.

Definition at line 325 of file AccountRoot.h.

◆ getTicketCount()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::AccountRoot::getTicketCount ( ) const
nodiscard

Get sfTicketCount (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 336 of file AccountRoot.h.

◆ hasTicketCount()

bool xrpl::ledger_entries::AccountRoot::hasTicketCount ( ) const
nodiscard

Check if sfTicketCount is present.

Returns
True if the field is present, false otherwise.

Definition at line 349 of file AccountRoot.h.

◆ getNFTokenMinter()

protocol_autogen::Optional< SF_ACCOUNT::type::value_type > xrpl::ledger_entries::AccountRoot::getNFTokenMinter ( ) const
nodiscard

Get sfNFTokenMinter (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 360 of file AccountRoot.h.

◆ hasNFTokenMinter()

bool xrpl::ledger_entries::AccountRoot::hasNFTokenMinter ( ) const
nodiscard

Check if sfNFTokenMinter is present.

Returns
True if the field is present, false otherwise.

Definition at line 373 of file AccountRoot.h.

◆ getMintedNFTokens()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::AccountRoot::getMintedNFTokens ( ) const
nodiscard

Get sfMintedNFTokens (SoeDefault).

Returns
The field value, or std::nullopt if not present.

Definition at line 384 of file AccountRoot.h.

◆ hasMintedNFTokens()

bool xrpl::ledger_entries::AccountRoot::hasMintedNFTokens ( ) const
nodiscard

Check if sfMintedNFTokens is present.

Returns
True if the field is present, false otherwise.

Definition at line 397 of file AccountRoot.h.

◆ getBurnedNFTokens()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::AccountRoot::getBurnedNFTokens ( ) const
nodiscard

Get sfBurnedNFTokens (SoeDefault).

Returns
The field value, or std::nullopt if not present.

Definition at line 408 of file AccountRoot.h.

◆ hasBurnedNFTokens()

bool xrpl::ledger_entries::AccountRoot::hasBurnedNFTokens ( ) const
nodiscard

Check if sfBurnedNFTokens is present.

Returns
True if the field is present, false otherwise.

Definition at line 421 of file AccountRoot.h.

◆ getFirstNFTokenSequence()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::AccountRoot::getFirstNFTokenSequence ( ) const
nodiscard

Get sfFirstNFTokenSequence (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 432 of file AccountRoot.h.

◆ hasFirstNFTokenSequence()

bool xrpl::ledger_entries::AccountRoot::hasFirstNFTokenSequence ( ) const
nodiscard

Check if sfFirstNFTokenSequence is present.

Returns
True if the field is present, false otherwise.

Definition at line 445 of file AccountRoot.h.

◆ getAMMID()

protocol_autogen::Optional< SF_UINT256::type::value_type > xrpl::ledger_entries::AccountRoot::getAMMID ( ) const
nodiscard

Get sfAMMID (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 456 of file AccountRoot.h.

◆ hasAMMID()

bool xrpl::ledger_entries::AccountRoot::hasAMMID ( ) const
nodiscard

Check if sfAMMID is present.

Returns
True if the field is present, false otherwise.

Definition at line 469 of file AccountRoot.h.

◆ getVaultID()

protocol_autogen::Optional< SF_UINT256::type::value_type > xrpl::ledger_entries::AccountRoot::getVaultID ( ) const
nodiscard

Get sfVaultID (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 480 of file AccountRoot.h.

◆ hasVaultID()

bool xrpl::ledger_entries::AccountRoot::hasVaultID ( ) const
nodiscard

Check if sfVaultID is present.

Returns
True if the field is present, false otherwise.

Definition at line 493 of file AccountRoot.h.

◆ getLoanBrokerID()

protocol_autogen::Optional< SF_UINT256::type::value_type > xrpl::ledger_entries::AccountRoot::getLoanBrokerID ( ) const
nodiscard

Get sfLoanBrokerID (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 504 of file AccountRoot.h.

◆ hasLoanBrokerID()

bool xrpl::ledger_entries::AccountRoot::hasLoanBrokerID ( ) const
nodiscard

Check if sfLoanBrokerID is present.

Returns
True if the field is present, false otherwise.

Definition at line 517 of file AccountRoot.h.

◆ validate()

bool xrpl::ledger_entries::LedgerEntryBase::validate ( ) const
nodiscardinherited

Validate the ledger entry.

Returns
true if validation passes, false otherwise

Definition at line 40 of file LedgerEntryBase.h.

◆ getType()

LedgerEntryType xrpl::ledger_entries::LedgerEntryBase::getType ( ) const
nodiscardinherited

Get the ledger entry type.

Returns
The type of this ledger entry

Definition at line 57 of file LedgerEntryBase.h.

◆ getKey()

uint256 const & xrpl::ledger_entries::LedgerEntryBase::getKey ( ) const
nodiscardinherited

Get the key (index) of this ledger entry.

The key uniquely identifies this ledger entry in the ledger state.

Returns
A constant reference to the 256-bit key

Definition at line 70 of file LedgerEntryBase.h.

◆ getLedgerIndex()

std::optional< uint256 > xrpl::ledger_entries::LedgerEntryBase::getLedgerIndex ( ) const
nodiscardinherited

Get the ledger index (sfLedgerIndex).

This field is OPTIONAL and represents the index of the ledger entry.

Returns
The ledger index if present, std::nullopt otherwise

Definition at line 85 of file LedgerEntryBase.h.

◆ hasLedgerIndex()

bool xrpl::ledger_entries::LedgerEntryBase::hasLedgerIndex ( ) const
nodiscardinherited

Check if the ledger entry has a ledger index.

Returns
true if sfLedgerIndex is present, false otherwise

Definition at line 100 of file LedgerEntryBase.h.

◆ getLedgerEntryType()

uint16_t xrpl::ledger_entries::LedgerEntryBase::getLedgerEntryType ( ) const
nodiscardinherited

Get the ledger entry type field (sfLedgerEntryType).

This field is REQUIRED for all ledger entries and indicates the type of the ledger entry (e.g., AccountRoot, RippleState, Offer, etc.).

Returns
The ledger entry type as a 16-bit unsigned integer

Definition at line 114 of file LedgerEntryBase.h.

◆ getFlags()

std::uint32_t xrpl::ledger_entries::LedgerEntryBase::getFlags ( ) const
nodiscardinherited

Get the flags field (sfFlags).

This field is REQUIRED for all ledger entries and contains type-specific flags that modify the behavior of the ledger entry.

Returns
The flags value as a 32-bit unsigned integer

Definition at line 128 of file LedgerEntryBase.h.

◆ isFlag()

bool xrpl::ledger_entries::LedgerEntryBase::isFlag ( std::uint32_t f) const
nodiscardinherited

Check if a specific flag is set.

Parameters
fThe flag bitmask to check
Returns
true if all bits in f are set in the flags field

Definition at line 141 of file LedgerEntryBase.h.

◆ getSle()

SLE::const_pointer xrpl::ledger_entries::LedgerEntryBase::getSle ( ) const
nodiscardinherited

Get the underlying SLE object.

Provides direct access to the wrapped serialized ledger entry object for cases where the type-safe accessors are insufficient.

Returns
A constant reference to the underlying SLE object

Definition at line 155 of file LedgerEntryBase.h.

Member Data Documentation

◆ entryType

LedgerEntryType xrpl::ledger_entries::AccountRoot::entryType = ltACCOUNT_ROOT
staticconstexpr

Definition at line 30 of file AccountRoot.h.

◆ sle_

SLE::const_pointer xrpl::ledger_entries::LedgerEntryBase::sle_
protectedinherited

The underlying serialized ledger entry being wrapped.

Definition at line 162 of file LedgerEntryBase.h.