xrpld
Loading...
Searching...
No Matches
xrpl::detail::DeferredCredits Class Reference

#include <PaymentSandbox.h>

Collaboration diagram for xrpl::detail::DeferredCredits:

Classes

struct  ValueIOU
struct  HolderValueMPT
struct  IssuerValueMPT
struct  AdjustmentIOU

Public Member Functions

std::optional< AdjustmentIOUadjustmentsIOU (AccountID const &main, AccountID const &other, Currency const &currency) const
std::optional< AdjustmentMPTadjustmentsMPT (MPTID const &mptID) const
void creditIOU (AccountID const &sender, AccountID const &receiver, STAmount const &amount, STAmount const &preCreditSenderBalance)
void creditMPT (AccountID const &sender, AccountID const &receiver, STAmount const &amount, std::uint64_t preCreditBalanceHolder, std::int64_t preCreditBalanceIssuer)
void issuerSelfDebitMPT (MPTIssue const &issue, std::uint64_t amount, std::int64_t origBalance)
void ownerCount (AccountID const &id, OwnerCounts const &cur, OwnerCounts const &next)
std::optional< OwnerCountsownerCount (AccountID const &id) const
void apply (DeferredCredits &to)

Private Types

using KeyIOU = std::tuple<AccountID, AccountID, Currency>
using AdjustmentMPT = IssuerValueMPT

Static Private Member Functions

static KeyIOU makeKeyIOU (AccountID const &a1, AccountID const &a2, Currency const &currency)

Private Attributes

std::map< KeyIOU, ValueIOUcreditsIOU_
std::map< MPTID, IssuerValueMPTcreditsMPT_
std::map< AccountID, OwnerCountsownerCounts_

Detailed Description

Definition at line 26 of file PaymentSandbox.h.

Member Typedef Documentation

◆ KeyIOU

◆ AdjustmentMPT

Member Function Documentation

◆ adjustmentsIOU()

auto xrpl::detail::DeferredCredits::adjustmentsIOU ( AccountID const & main,
AccountID const & other,
Currency const & currency ) const
nodiscard

Definition at line 196 of file PaymentSandbox.cpp.

◆ adjustmentsMPT()

auto xrpl::detail::DeferredCredits::adjustmentsMPT ( xrpl::MPTID const & mptID) const
nodiscard

Definition at line 221 of file PaymentSandbox.cpp.

◆ creditIOU()

void xrpl::detail::DeferredCredits::creditIOU ( AccountID const & sender,
AccountID const & receiver,
STAmount const & amount,
STAmount const & preCreditSenderBalance )

Definition at line 38 of file PaymentSandbox.cpp.

◆ creditMPT()

void xrpl::detail::DeferredCredits::creditMPT ( AccountID const & sender,
AccountID const & receiver,
STAmount const & amount,
std::uint64_t preCreditBalanceHolder,
std::int64_t preCreditBalanceIssuer )

Definition at line 87 of file PaymentSandbox.cpp.

◆ issuerSelfDebitMPT()

void xrpl::detail::DeferredCredits::issuerSelfDebitMPT ( MPTIssue const & issue,
std::uint64_t amount,
std::int64_t origBalance )

Definition at line 152 of file PaymentSandbox.cpp.

◆ ownerCount() [1/2]

void xrpl::detail::DeferredCredits::ownerCount ( AccountID const & id,
OwnerCounts const & cur,
OwnerCounts const & next )

Definition at line 174 of file PaymentSandbox.cpp.

◆ ownerCount() [2/2]

std::optional< OwnerCounts > xrpl::detail::DeferredCredits::ownerCount ( AccountID const & id) const
nodiscard

Definition at line 186 of file PaymentSandbox.cpp.

◆ apply()

void xrpl::detail::DeferredCredits::apply ( DeferredCredits & to)

Definition at line 230 of file PaymentSandbox.cpp.

◆ makeKeyIOU()

auto xrpl::detail::DeferredCredits::makeKeyIOU ( AccountID const & a1,
AccountID const & a2,
Currency const & currency )
staticprivate

Definition at line 27 of file PaymentSandbox.cpp.

Member Data Documentation

◆ creditsIOU_

std::map<KeyIOU, ValueIOU> xrpl::detail::DeferredCredits::creditsIOU_
private

Definition at line 126 of file PaymentSandbox.h.

◆ creditsMPT_

std::map<MPTID, IssuerValueMPT> xrpl::detail::DeferredCredits::creditsMPT_
private

Definition at line 127 of file PaymentSandbox.h.

◆ ownerCounts_

std::map<AccountID, OwnerCounts> xrpl::detail::DeferredCredits::ownerCounts_
private

Definition at line 128 of file PaymentSandbox.h.