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

Ledger Entry: RippleState. More...

#include <RippleState.h>

Inheritance diagram for xrpl::ledger_entries::RippleState:
Collaboration diagram for xrpl::ledger_entries::RippleState:

Public Member Functions

 RippleState (SLE::const_pointer sle)
 Construct a RippleState ledger entry wrapper from an existing SLE object.
SF_AMOUNT::type::value_type getBalance () const
 Get sfBalance (SoeRequired).
SF_AMOUNT::type::value_type getLowLimit () const
 Get sfLowLimit (SoeRequired).
SF_AMOUNT::type::value_type getHighLimit () const
 Get sfHighLimit (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_UINT64::type::value_type > getLowNode () const
 Get sfLowNode (SoeOptional).
bool hasLowNode () const
 Check if sfLowNode is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getLowQualityIn () const
 Get sfLowQualityIn (SoeOptional).
bool hasLowQualityIn () const
 Check if sfLowQualityIn is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getLowQualityOut () const
 Get sfLowQualityOut (SoeOptional).
bool hasLowQualityOut () const
 Check if sfLowQualityOut is present.
protocol_autogen::Optional< SF_UINT64::type::value_type > getHighNode () const
 Get sfHighNode (SoeOptional).
bool hasHighNode () const
 Check if sfHighNode is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getHighQualityIn () const
 Get sfHighQualityIn (SoeOptional).
bool hasHighQualityIn () const
 Check if sfHighQualityIn is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getHighQualityOut () const
 Get sfHighQualityOut (SoeOptional).
bool hasHighQualityOut () const
 Check if sfHighQualityOut 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 = ltRIPPLE_STATE

Protected Attributes

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

Detailed Description

Ledger Entry: RippleState.

Type: ltRIPPLE_STATE (0x0072) RPC Name: state

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

Definition at line 27 of file RippleState.h.

Constructor & Destructor Documentation

◆ RippleState()

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

Construct a RippleState 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 RippleState.h.

Member Function Documentation

◆ getBalance()

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

Get sfBalance (SoeRequired).

Returns
The field value.

Definition at line 54 of file RippleState.h.

◆ getLowLimit()

SF_AMOUNT::type::value_type xrpl::ledger_entries::RippleState::getLowLimit ( ) const
nodiscard

Get sfLowLimit (SoeRequired).

Returns
The field value.

Definition at line 65 of file RippleState.h.

◆ getHighLimit()

SF_AMOUNT::type::value_type xrpl::ledger_entries::RippleState::getHighLimit ( ) const
nodiscard

Get sfHighLimit (SoeRequired).

Returns
The field value.

Definition at line 76 of file RippleState.h.

◆ getPreviousTxnID()

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

Get sfPreviousTxnID (SoeRequired).

Returns
The field value.

Definition at line 87 of file RippleState.h.

◆ getPreviousTxnLgrSeq()

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

Get sfPreviousTxnLgrSeq (SoeRequired).

Returns
The field value.

Definition at line 98 of file RippleState.h.

◆ getLowNode()

protocol_autogen::Optional< SF_UINT64::type::value_type > xrpl::ledger_entries::RippleState::getLowNode ( ) const
nodiscard

Get sfLowNode (SoeOptional).

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

Definition at line 109 of file RippleState.h.

◆ hasLowNode()

bool xrpl::ledger_entries::RippleState::hasLowNode ( ) const
nodiscard

Check if sfLowNode is present.

Returns
True if the field is present, false otherwise.

Definition at line 122 of file RippleState.h.

◆ getLowQualityIn()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::RippleState::getLowQualityIn ( ) const
nodiscard

Get sfLowQualityIn (SoeOptional).

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

Definition at line 133 of file RippleState.h.

◆ hasLowQualityIn()

bool xrpl::ledger_entries::RippleState::hasLowQualityIn ( ) const
nodiscard

Check if sfLowQualityIn is present.

Returns
True if the field is present, false otherwise.

Definition at line 146 of file RippleState.h.

◆ getLowQualityOut()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::RippleState::getLowQualityOut ( ) const
nodiscard

Get sfLowQualityOut (SoeOptional).

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

Definition at line 157 of file RippleState.h.

◆ hasLowQualityOut()

bool xrpl::ledger_entries::RippleState::hasLowQualityOut ( ) const
nodiscard

Check if sfLowQualityOut is present.

Returns
True if the field is present, false otherwise.

Definition at line 170 of file RippleState.h.

◆ getHighNode()

protocol_autogen::Optional< SF_UINT64::type::value_type > xrpl::ledger_entries::RippleState::getHighNode ( ) const
nodiscard

Get sfHighNode (SoeOptional).

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

Definition at line 181 of file RippleState.h.

◆ hasHighNode()

bool xrpl::ledger_entries::RippleState::hasHighNode ( ) const
nodiscard

Check if sfHighNode is present.

Returns
True if the field is present, false otherwise.

Definition at line 194 of file RippleState.h.

◆ getHighQualityIn()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::RippleState::getHighQualityIn ( ) const
nodiscard

Get sfHighQualityIn (SoeOptional).

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

Definition at line 205 of file RippleState.h.

◆ hasHighQualityIn()

bool xrpl::ledger_entries::RippleState::hasHighQualityIn ( ) const
nodiscard

Check if sfHighQualityIn is present.

Returns
True if the field is present, false otherwise.

Definition at line 218 of file RippleState.h.

◆ getHighQualityOut()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::RippleState::getHighQualityOut ( ) const
nodiscard

Get sfHighQualityOut (SoeOptional).

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

Definition at line 229 of file RippleState.h.

◆ hasHighQualityOut()

bool xrpl::ledger_entries::RippleState::hasHighQualityOut ( ) const
nodiscard

Check if sfHighQualityOut is present.

Returns
True if the field is present, false otherwise.

Definition at line 242 of file RippleState.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::RippleState::entryType = ltRIPPLE_STATE
staticconstexpr

Definition at line 30 of file RippleState.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.