rippled
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
xrpl::ledger_entries::AccountRoot Class Reference

Ledger Entry: AccountRoot. More...

#include <AccountRoot.h>

Inheritance diagram for xrpl::ledger_entries::AccountRoot:
Inheritance graph
[legend]
Collaboration diagram for xrpl::ledger_entries::AccountRoot:
Collaboration graph
[legend]

Public Member Functions

 AccountRoot (std::shared_ptr< SLE const > 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).
 
std::shared_ptr< SLE const > getSle () const
 Get the underlying SLE object.
 

Static Public Attributes

static constexpr LedgerEntryType entryType = ltACCOUNT_ROOT
 

Protected Attributes

std::shared_ptr< SLE const > 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 ( std::shared_ptr< SLE const >  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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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
inherited

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
inherited

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
inherited

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
inherited

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
inherited

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
inherited

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
inherited

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.

◆ getSle()

std::shared_ptr< SLE const > xrpl::ledger_entries::LedgerEntryBase::getSle ( ) const
inherited

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 142 of file LedgerEntryBase.h.

Member Data Documentation

◆ entryType

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

Definition at line 30 of file AccountRoot.h.

◆ sle_

std::shared_ptr<SLE const> xrpl::ledger_entries::LedgerEntryBase::sle_
protectedinherited

The underlying serialized ledger entry being wrapped.

Definition at line 149 of file LedgerEntryBase.h.