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

Ledger Entry: Loan. More...

#include <Loan.h>

Inheritance diagram for xrpl::ledger_entries::Loan:
Collaboration diagram for xrpl::ledger_entries::Loan:

Public Member Functions

 Loan (SLE::const_pointer sle)
 Construct a Loan ledger entry wrapper from an existing SLE object.
SF_UINT256::type::value_type getPreviousTxnID () const
 Get sfPreviousTxnID (SoeRequired).
SF_UINT32::type::value_type getPreviousTxnLgrSeq () const
 Get sfPreviousTxnLgrSeq (SoeRequired).
SF_UINT64::type::value_type getOwnerNode () const
 Get sfOwnerNode (SoeRequired).
SF_UINT64::type::value_type getLoanBrokerNode () const
 Get sfLoanBrokerNode (SoeRequired).
SF_UINT256::type::value_type getLoanBrokerID () const
 Get sfLoanBrokerID (SoeRequired).
SF_UINT32::type::value_type getLoanSequence () const
 Get sfLoanSequence (SoeRequired).
SF_ACCOUNT::type::value_type getBorrower () const
 Get sfBorrower (SoeRequired).
protocol_autogen::Optional< SF_NUMBER::type::value_type > getLoanOriginationFee () const
 Get sfLoanOriginationFee (SoeDefault).
bool hasLoanOriginationFee () const
 Check if sfLoanOriginationFee is present.
protocol_autogen::Optional< SF_NUMBER::type::value_type > getLoanServiceFee () const
 Get sfLoanServiceFee (SoeDefault).
bool hasLoanServiceFee () const
 Check if sfLoanServiceFee is present.
protocol_autogen::Optional< SF_NUMBER::type::value_type > getLatePaymentFee () const
 Get sfLatePaymentFee (SoeDefault).
bool hasLatePaymentFee () const
 Check if sfLatePaymentFee is present.
protocol_autogen::Optional< SF_NUMBER::type::value_type > getClosePaymentFee () const
 Get sfClosePaymentFee (SoeDefault).
bool hasClosePaymentFee () const
 Check if sfClosePaymentFee is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getOverpaymentFee () const
 Get sfOverpaymentFee (SoeDefault).
bool hasOverpaymentFee () const
 Check if sfOverpaymentFee is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getInterestRate () const
 Get sfInterestRate (SoeDefault).
bool hasInterestRate () const
 Check if sfInterestRate is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getLateInterestRate () const
 Get sfLateInterestRate (SoeDefault).
bool hasLateInterestRate () const
 Check if sfLateInterestRate is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getCloseInterestRate () const
 Get sfCloseInterestRate (SoeDefault).
bool hasCloseInterestRate () const
 Check if sfCloseInterestRate is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getOverpaymentInterestRate () const
 Get sfOverpaymentInterestRate (SoeDefault).
bool hasOverpaymentInterestRate () const
 Check if sfOverpaymentInterestRate is present.
SF_UINT32::type::value_type getStartDate () const
 Get sfStartDate (SoeRequired).
SF_UINT32::type::value_type getPaymentInterval () const
 Get sfPaymentInterval (SoeRequired).
protocol_autogen::Optional< SF_UINT32::type::value_type > getGracePeriod () const
 Get sfGracePeriod (SoeDefault).
bool hasGracePeriod () const
 Check if sfGracePeriod is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getPreviousPaymentDueDate () const
 Get sfPreviousPaymentDueDate (SoeDefault).
bool hasPreviousPaymentDueDate () const
 Check if sfPreviousPaymentDueDate is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getNextPaymentDueDate () const
 Get sfNextPaymentDueDate (SoeDefault).
bool hasNextPaymentDueDate () const
 Check if sfNextPaymentDueDate is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getPaymentRemaining () const
 Get sfPaymentRemaining (SoeDefault).
bool hasPaymentRemaining () const
 Check if sfPaymentRemaining is present.
SF_NUMBER::type::value_type getPeriodicPayment () const
 Get sfPeriodicPayment (SoeRequired).
protocol_autogen::Optional< SF_NUMBER::type::value_type > getPrincipalOutstanding () const
 Get sfPrincipalOutstanding (SoeDefault).
bool hasPrincipalOutstanding () const
 Check if sfPrincipalOutstanding is present.
protocol_autogen::Optional< SF_NUMBER::type::value_type > getTotalValueOutstanding () const
 Get sfTotalValueOutstanding (SoeDefault).
bool hasTotalValueOutstanding () const
 Check if sfTotalValueOutstanding is present.
protocol_autogen::Optional< SF_NUMBER::type::value_type > getManagementFeeOutstanding () const
 Get sfManagementFeeOutstanding (SoeDefault).
bool hasManagementFeeOutstanding () const
 Check if sfManagementFeeOutstanding is present.
protocol_autogen::Optional< SF_INT32::type::value_type > getLoanScale () const
 Get sfLoanScale (SoeDefault).
bool hasLoanScale () const
 Check if sfLoanScale 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 = ltLOAN

Protected Attributes

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

Detailed Description

Ledger Entry: Loan.

Type: ltLOAN (0x0089) RPC Name: loan

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

Definition at line 27 of file Loan.h.

Constructor & Destructor Documentation

◆ Loan()

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

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

Member Function Documentation

◆ getPreviousTxnID()

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

Get sfPreviousTxnID (SoeRequired).

Returns
The field value.

Definition at line 54 of file Loan.h.

◆ getPreviousTxnLgrSeq()

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

Get sfPreviousTxnLgrSeq (SoeRequired).

Returns
The field value.

Definition at line 65 of file Loan.h.

◆ getOwnerNode()

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

Get sfOwnerNode (SoeRequired).

Returns
The field value.

Definition at line 76 of file Loan.h.

◆ getLoanBrokerNode()

SF_UINT64::type::value_type xrpl::ledger_entries::Loan::getLoanBrokerNode ( ) const
nodiscard

Get sfLoanBrokerNode (SoeRequired).

Returns
The field value.

Definition at line 87 of file Loan.h.

◆ getLoanBrokerID()

SF_UINT256::type::value_type xrpl::ledger_entries::Loan::getLoanBrokerID ( ) const
nodiscard

Get sfLoanBrokerID (SoeRequired).

Returns
The field value.

Definition at line 98 of file Loan.h.

◆ getLoanSequence()

SF_UINT32::type::value_type xrpl::ledger_entries::Loan::getLoanSequence ( ) const
nodiscard

Get sfLoanSequence (SoeRequired).

Returns
The field value.

Definition at line 109 of file Loan.h.

◆ getBorrower()

SF_ACCOUNT::type::value_type xrpl::ledger_entries::Loan::getBorrower ( ) const
nodiscard

Get sfBorrower (SoeRequired).

Returns
The field value.

Definition at line 120 of file Loan.h.

◆ getLoanOriginationFee()

protocol_autogen::Optional< SF_NUMBER::type::value_type > xrpl::ledger_entries::Loan::getLoanOriginationFee ( ) const
nodiscard

Get sfLoanOriginationFee (SoeDefault).

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

Definition at line 131 of file Loan.h.

◆ hasLoanOriginationFee()

bool xrpl::ledger_entries::Loan::hasLoanOriginationFee ( ) const
nodiscard

Check if sfLoanOriginationFee is present.

Returns
True if the field is present, false otherwise.

Definition at line 144 of file Loan.h.

◆ getLoanServiceFee()

protocol_autogen::Optional< SF_NUMBER::type::value_type > xrpl::ledger_entries::Loan::getLoanServiceFee ( ) const
nodiscard

Get sfLoanServiceFee (SoeDefault).

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

Definition at line 155 of file Loan.h.

◆ hasLoanServiceFee()

bool xrpl::ledger_entries::Loan::hasLoanServiceFee ( ) const
nodiscard

Check if sfLoanServiceFee is present.

Returns
True if the field is present, false otherwise.

Definition at line 168 of file Loan.h.

◆ getLatePaymentFee()

protocol_autogen::Optional< SF_NUMBER::type::value_type > xrpl::ledger_entries::Loan::getLatePaymentFee ( ) const
nodiscard

Get sfLatePaymentFee (SoeDefault).

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

Definition at line 179 of file Loan.h.

◆ hasLatePaymentFee()

bool xrpl::ledger_entries::Loan::hasLatePaymentFee ( ) const
nodiscard

Check if sfLatePaymentFee is present.

Returns
True if the field is present, false otherwise.

Definition at line 192 of file Loan.h.

◆ getClosePaymentFee()

protocol_autogen::Optional< SF_NUMBER::type::value_type > xrpl::ledger_entries::Loan::getClosePaymentFee ( ) const
nodiscard

Get sfClosePaymentFee (SoeDefault).

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

Definition at line 203 of file Loan.h.

◆ hasClosePaymentFee()

bool xrpl::ledger_entries::Loan::hasClosePaymentFee ( ) const
nodiscard

Check if sfClosePaymentFee is present.

Returns
True if the field is present, false otherwise.

Definition at line 216 of file Loan.h.

◆ getOverpaymentFee()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::Loan::getOverpaymentFee ( ) const
nodiscard

Get sfOverpaymentFee (SoeDefault).

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

Definition at line 227 of file Loan.h.

◆ hasOverpaymentFee()

bool xrpl::ledger_entries::Loan::hasOverpaymentFee ( ) const
nodiscard

Check if sfOverpaymentFee is present.

Returns
True if the field is present, false otherwise.

Definition at line 240 of file Loan.h.

◆ getInterestRate()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::Loan::getInterestRate ( ) const
nodiscard

Get sfInterestRate (SoeDefault).

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

Definition at line 251 of file Loan.h.

◆ hasInterestRate()

bool xrpl::ledger_entries::Loan::hasInterestRate ( ) const
nodiscard

Check if sfInterestRate is present.

Returns
True if the field is present, false otherwise.

Definition at line 264 of file Loan.h.

◆ getLateInterestRate()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::Loan::getLateInterestRate ( ) const
nodiscard

Get sfLateInterestRate (SoeDefault).

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

Definition at line 275 of file Loan.h.

◆ hasLateInterestRate()

bool xrpl::ledger_entries::Loan::hasLateInterestRate ( ) const
nodiscard

Check if sfLateInterestRate is present.

Returns
True if the field is present, false otherwise.

Definition at line 288 of file Loan.h.

◆ getCloseInterestRate()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::Loan::getCloseInterestRate ( ) const
nodiscard

Get sfCloseInterestRate (SoeDefault).

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

Definition at line 299 of file Loan.h.

◆ hasCloseInterestRate()

bool xrpl::ledger_entries::Loan::hasCloseInterestRate ( ) const
nodiscard

Check if sfCloseInterestRate is present.

Returns
True if the field is present, false otherwise.

Definition at line 312 of file Loan.h.

◆ getOverpaymentInterestRate()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::Loan::getOverpaymentInterestRate ( ) const
nodiscard

Get sfOverpaymentInterestRate (SoeDefault).

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

Definition at line 323 of file Loan.h.

◆ hasOverpaymentInterestRate()

bool xrpl::ledger_entries::Loan::hasOverpaymentInterestRate ( ) const
nodiscard

Check if sfOverpaymentInterestRate is present.

Returns
True if the field is present, false otherwise.

Definition at line 336 of file Loan.h.

◆ getStartDate()

SF_UINT32::type::value_type xrpl::ledger_entries::Loan::getStartDate ( ) const
nodiscard

Get sfStartDate (SoeRequired).

Returns
The field value.

Definition at line 347 of file Loan.h.

◆ getPaymentInterval()

SF_UINT32::type::value_type xrpl::ledger_entries::Loan::getPaymentInterval ( ) const
nodiscard

Get sfPaymentInterval (SoeRequired).

Returns
The field value.

Definition at line 358 of file Loan.h.

◆ getGracePeriod()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::Loan::getGracePeriod ( ) const
nodiscard

Get sfGracePeriod (SoeDefault).

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

Definition at line 369 of file Loan.h.

◆ hasGracePeriod()

bool xrpl::ledger_entries::Loan::hasGracePeriod ( ) const
nodiscard

Check if sfGracePeriod is present.

Returns
True if the field is present, false otherwise.

Definition at line 382 of file Loan.h.

◆ getPreviousPaymentDueDate()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::Loan::getPreviousPaymentDueDate ( ) const
nodiscard

Get sfPreviousPaymentDueDate (SoeDefault).

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

Definition at line 393 of file Loan.h.

◆ hasPreviousPaymentDueDate()

bool xrpl::ledger_entries::Loan::hasPreviousPaymentDueDate ( ) const
nodiscard

Check if sfPreviousPaymentDueDate is present.

Returns
True if the field is present, false otherwise.

Definition at line 406 of file Loan.h.

◆ getNextPaymentDueDate()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::Loan::getNextPaymentDueDate ( ) const
nodiscard

Get sfNextPaymentDueDate (SoeDefault).

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

Definition at line 417 of file Loan.h.

◆ hasNextPaymentDueDate()

bool xrpl::ledger_entries::Loan::hasNextPaymentDueDate ( ) const
nodiscard

Check if sfNextPaymentDueDate is present.

Returns
True if the field is present, false otherwise.

Definition at line 430 of file Loan.h.

◆ getPaymentRemaining()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::Loan::getPaymentRemaining ( ) const
nodiscard

Get sfPaymentRemaining (SoeDefault).

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

Definition at line 441 of file Loan.h.

◆ hasPaymentRemaining()

bool xrpl::ledger_entries::Loan::hasPaymentRemaining ( ) const
nodiscard

Check if sfPaymentRemaining is present.

Returns
True if the field is present, false otherwise.

Definition at line 454 of file Loan.h.

◆ getPeriodicPayment()

SF_NUMBER::type::value_type xrpl::ledger_entries::Loan::getPeriodicPayment ( ) const
nodiscard

Get sfPeriodicPayment (SoeRequired).

Returns
The field value.

Definition at line 465 of file Loan.h.

◆ getPrincipalOutstanding()

protocol_autogen::Optional< SF_NUMBER::type::value_type > xrpl::ledger_entries::Loan::getPrincipalOutstanding ( ) const
nodiscard

Get sfPrincipalOutstanding (SoeDefault).

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

Definition at line 476 of file Loan.h.

◆ hasPrincipalOutstanding()

bool xrpl::ledger_entries::Loan::hasPrincipalOutstanding ( ) const
nodiscard

Check if sfPrincipalOutstanding is present.

Returns
True if the field is present, false otherwise.

Definition at line 489 of file Loan.h.

◆ getTotalValueOutstanding()

protocol_autogen::Optional< SF_NUMBER::type::value_type > xrpl::ledger_entries::Loan::getTotalValueOutstanding ( ) const
nodiscard

Get sfTotalValueOutstanding (SoeDefault).

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

Definition at line 500 of file Loan.h.

◆ hasTotalValueOutstanding()

bool xrpl::ledger_entries::Loan::hasTotalValueOutstanding ( ) const
nodiscard

Check if sfTotalValueOutstanding is present.

Returns
True if the field is present, false otherwise.

Definition at line 513 of file Loan.h.

◆ getManagementFeeOutstanding()

protocol_autogen::Optional< SF_NUMBER::type::value_type > xrpl::ledger_entries::Loan::getManagementFeeOutstanding ( ) const
nodiscard

Get sfManagementFeeOutstanding (SoeDefault).

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

Definition at line 524 of file Loan.h.

◆ hasManagementFeeOutstanding()

bool xrpl::ledger_entries::Loan::hasManagementFeeOutstanding ( ) const
nodiscard

Check if sfManagementFeeOutstanding is present.

Returns
True if the field is present, false otherwise.

Definition at line 537 of file Loan.h.

◆ getLoanScale()

protocol_autogen::Optional< SF_INT32::type::value_type > xrpl::ledger_entries::Loan::getLoanScale ( ) const
nodiscard

Get sfLoanScale (SoeDefault).

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

Definition at line 548 of file Loan.h.

◆ hasLoanScale()

bool xrpl::ledger_entries::Loan::hasLoanScale ( ) const
nodiscard

Check if sfLoanScale is present.

Returns
True if the field is present, false otherwise.

Definition at line 561 of file Loan.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::Loan::entryType = ltLOAN
staticconstexpr

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