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

Ledger Entry: Offer. More...

#include <Offer.h>

Inheritance diagram for xrpl::ledger_entries::Offer:
Collaboration diagram for xrpl::ledger_entries::Offer:

Public Member Functions

 Offer (SLE::const_pointer sle)
 Construct a Offer 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 getTakerPays () const
 Get sfTakerPays (SoeRequired).
SF_AMOUNT::type::value_type getTakerGets () const
 Get sfTakerGets (SoeRequired).
SF_UINT256::type::value_type getBookDirectory () const
 Get sfBookDirectory (SoeRequired).
SF_UINT64::type::value_type getBookNode () const
 Get sfBookNode (SoeRequired).
SF_UINT64::type::value_type getOwnerNode () const
 Get sfOwnerNode (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_UINT32::type::value_type > getExpiration () const
 Get sfExpiration (SoeOptional).
bool hasExpiration () const
 Check if sfExpiration is present.
protocol_autogen::Optional< SF_UINT256::type::value_type > getDomainID () const
 Get sfDomainID (SoeOptional).
bool hasDomainID () const
 Check if sfDomainID is present.
std::optional< std::reference_wrapper< STArray const > > getAdditionalBooks () const
 Get sfAdditionalBooks (SoeOptional).
bool hasAdditionalBooks () const
 Check if sfAdditionalBooks 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 = ltOFFER

Protected Attributes

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

Detailed Description

Ledger Entry: Offer.

Type: ltOFFER (0x006f) RPC Name: offer

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

Definition at line 27 of file protocol_autogen/ledger_entries/Offer.h.

Constructor & Destructor Documentation

◆ Offer()

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

Construct a Offer 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 protocol_autogen/ledger_entries/Offer.h.

Member Function Documentation

◆ getAccount()

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

Get sfAccount (SoeRequired).

Returns
The field value.

Definition at line 54 of file protocol_autogen/ledger_entries/Offer.h.

◆ getSequence()

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

Get sfSequence (SoeRequired).

Returns
The field value.

Definition at line 65 of file protocol_autogen/ledger_entries/Offer.h.

◆ getTakerPays()

SF_AMOUNT::type::value_type xrpl::ledger_entries::Offer::getTakerPays ( ) const
nodiscard

Get sfTakerPays (SoeRequired).

Returns
The field value.

Definition at line 76 of file protocol_autogen/ledger_entries/Offer.h.

◆ getTakerGets()

SF_AMOUNT::type::value_type xrpl::ledger_entries::Offer::getTakerGets ( ) const
nodiscard

Get sfTakerGets (SoeRequired).

Returns
The field value.

Definition at line 87 of file protocol_autogen/ledger_entries/Offer.h.

◆ getBookDirectory()

SF_UINT256::type::value_type xrpl::ledger_entries::Offer::getBookDirectory ( ) const
nodiscard

Get sfBookDirectory (SoeRequired).

Returns
The field value.

Definition at line 98 of file protocol_autogen/ledger_entries/Offer.h.

◆ getBookNode()

SF_UINT64::type::value_type xrpl::ledger_entries::Offer::getBookNode ( ) const
nodiscard

Get sfBookNode (SoeRequired).

Returns
The field value.

Definition at line 109 of file protocol_autogen/ledger_entries/Offer.h.

◆ getOwnerNode()

SF_UINT64::type::value_type xrpl::ledger_entries::Offer::getOwnerNode ( ) const
nodiscard

Get sfOwnerNode (SoeRequired).

Returns
The field value.

Definition at line 120 of file protocol_autogen/ledger_entries/Offer.h.

◆ getPreviousTxnID()

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

Get sfPreviousTxnID (SoeRequired).

Returns
The field value.

Definition at line 131 of file protocol_autogen/ledger_entries/Offer.h.

◆ getPreviousTxnLgrSeq()

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

Get sfPreviousTxnLgrSeq (SoeRequired).

Returns
The field value.

Definition at line 142 of file protocol_autogen/ledger_entries/Offer.h.

◆ getExpiration()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::Offer::getExpiration ( ) const
nodiscard

Get sfExpiration (SoeOptional).

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

Definition at line 153 of file protocol_autogen/ledger_entries/Offer.h.

◆ hasExpiration()

bool xrpl::ledger_entries::Offer::hasExpiration ( ) const
nodiscard

Check if sfExpiration is present.

Returns
True if the field is present, false otherwise.

Definition at line 166 of file protocol_autogen/ledger_entries/Offer.h.

◆ getDomainID()

protocol_autogen::Optional< SF_UINT256::type::value_type > xrpl::ledger_entries::Offer::getDomainID ( ) const
nodiscard

Get sfDomainID (SoeOptional).

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

Definition at line 177 of file protocol_autogen/ledger_entries/Offer.h.

◆ hasDomainID()

bool xrpl::ledger_entries::Offer::hasDomainID ( ) const
nodiscard

Check if sfDomainID is present.

Returns
True if the field is present, false otherwise.

Definition at line 190 of file protocol_autogen/ledger_entries/Offer.h.

◆ getAdditionalBooks()

std::optional< std::reference_wrapper< STArray const > > xrpl::ledger_entries::Offer::getAdditionalBooks ( ) const
nodiscard

Get sfAdditionalBooks (SoeOptional).

Note
This is an untyped field (unknown).
Returns
The field value, or std::nullopt if not present.

Definition at line 202 of file protocol_autogen/ledger_entries/Offer.h.

◆ hasAdditionalBooks()

bool xrpl::ledger_entries::Offer::hasAdditionalBooks ( ) const
nodiscard

Check if sfAdditionalBooks is present.

Returns
True if the field is present, false otherwise.

Definition at line 215 of file protocol_autogen/ledger_entries/Offer.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::Offer::entryType = ltOFFER
staticconstexpr

Definition at line 30 of file protocol_autogen/ledger_entries/Offer.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.