3#include <xrpl/basics/Number.h>
4#include <xrpl/beast/utility/Journal.h>
5#include <xrpl/ledger/ApplyView.h>
6#include <xrpl/ledger/ReadView.h>
7#include <xrpl/protocol/AccountID.h>
8#include <xrpl/protocol/Asset.h>
9#include <xrpl/protocol/Issue.h>
10#include <xrpl/protocol/MPTIssue.h>
11#include <xrpl/protocol/Rate.h>
12#include <xrpl/protocol/STAmount.h>
13#include <xrpl/protocol/STLedgerEntry.h>
14#include <xrpl/protocol/TER.h>
15#include <xrpl/protocol/UintTypes.h>
16#include <xrpl/protocol/XRPAmount.h>
115 ReadView
const& view,
121 ReadView
const& view,
128 ReadView
const& view,
130 MPTIssue
const& mptIssue,
140 ReadView
const& view,
184 ReadView
const& view,
211 ReadView
const& view,
235[[nodiscard]] STAmount
237 ReadView
const& view,
245[[nodiscard]] STAmount
247 ReadView
const& view,
254[[nodiscard]] STAmount
256 ReadView
const& view,
258 MPTIssue
const& mptIssue,
264[[nodiscard]] STAmount
266 ReadView
const& view,
279[[nodiscard]] STAmount
281 ReadView
const& view,
283 STAmount
const& saDefault,
288[[nodiscard]] STAmount
290 ReadView
const& view,
292 STAmount
const& saDefault,
303transferRate(ReadView
const& view, STAmount
const& amount);
316 ApplyViewContext ctx,
318 XRPAmount priorBalance,
324 ApplyViewContext ctx,
337 ReadView
const& view,
344 ReadView
const& view,
372 STAmount
const& saAmount,
385 STAmount
const& saAmount,
A generic endpoint for log messages.
Writeable view to a ledger, for applying a transaction.
std::shared_ptr< STLedgerEntry > const & ref
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
TER checkDeepFrozen(ReadView const &view, AccountID const &account, Issue const &issue)
FreezeHandling
Controls the treatment of frozen account balances.
SpendableHandling
Controls whether to include the account's full spendable balance.
TER checkIndividualFrozen(ReadView const &view, AccountID const &account, Asset const &asset)
bool isIndividualFrozen(ReadView const &view, AccountID const &account, MPTIssue const &mptIssue)
Returns true if account's MPToken for mptIssue carries the individual-lock flag (lsfMPTLocked).
TER accountSend(ApplyView &view, AccountID const &from, AccountID const &to, STAmount const &saAmount, beast::Journal j, SLE::ref sponsorSle={}, WaiveTransferFee waiveFee=WaiveTransferFee::No, AllowMPTOverflow allowOverflow=AllowMPTOverflow::No)
Calls static accountSendIOU if saAmount represents Issue.
TER checkDepositFreeze(ReadView const &view, AccountID const &srcAcct, AccountID const &pseudoAcct, Asset const &asset)
Checks freeze compliance for depositing an asset into a pseudo-account (e.g.
AllowMPTOverflow
Controls whether accountSend is allowed to overflow OutstandingAmount *.
TER removeEmptyHolding(ApplyViewContext ctx, AccountID const &accountID, MPTIssue const &mptIssue, beast::Journal journal)
TER checkFrozen(ReadView const &view, AccountID const &account, Issue const &issue)
BaseUInt< 160, detail::CurrencyTag > Currency
Currency is a hash representing a specific currency.
TER addEmptyHolding(ApplyViewContext ctx, AccountID const &accountID, XRPAmount priorBalance, MPTIssue const &mptIssue, beast::Journal journal)
TER canTransfer(ReadView const &view, MPTIssue const &mptIssue, AccountID const &from, AccountID const &to, WaiveMPTCanTransfer waive=WaiveMPTCanTransfer::No, std::uint8_t depth=0)
Check whether to may receive the given MPT from from.
bool isDeepFrozen(ReadView const &view, AccountID const &account, Currency const ¤cy, AccountID const &issuer)
@ Yes
We have consensus along with the network.
@ No
We do not have consensus.
STAmount accountFunds(ReadView const &view, AccountID const &id, STAmount const &saDefault, FreezeHandling freezeHandling, beast::Journal j)
bool isGlobalFrozen(ReadView const &view, AccountID const &issuer)
Check if the issuer has the global freeze flag set.
TER canAddHolding(ReadView const &view, MPTIssue const &mptIssue)
AuthHandling
Controls the treatment of unauthorized MPT balances.
Rate transferRate(ReadView const &view, AccountID const &issuer)
Returns IOU issuer transfer fee as Rate.
TER directSendNoFee(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, bool bCheckIssuer, beast::Journal j)
Calls static directSendNoFeeIOU if saAmount represents Issue.
TER transferXRP(ApplyView &view, AccountID const &from, AccountID const &to, STAmount const &amount, beast::Journal j)
WaiveMPTCanTransfer
Controls whether canTransfer enforces lsfMPTCanTransfer on MPTs.
bool isFrozen(ReadView const &view, AccountID const &account, MPTIssue const &mptIssue, std::uint8_t depth=0)
TER checkGlobalFrozen(ReadView const &view, Asset const &asset)
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
bool isAnyFrozen(ReadView const &view, std::initializer_list< AccountID > const &accounts, MPTIssue const &mptIssue, std::uint8_t depth=0)
TERSubset< CanCvtToTER > TER
TER requireAuth(ReadView const &view, MPTIssue const &mptIssue, AccountID const &account, AuthType authType=AuthType::Legacy, std::uint8_t depth=0)
Check if the account lacks required authorization for MPT.
std::vector< std::pair< AccountID, Number > > MultiplePaymentDestinations
TER accountSendMulti(ApplyView &view, AccountID const &senderID, Asset const &asset, MultiplePaymentDestinations const &receivers, beast::Journal j, WaiveTransferFee waiveFee=WaiveTransferFee::No)
Like accountSend, except one account is sending multiple payments (with the same asset!...
TER checkWithdrawFreeze(ReadView const &view, AccountID const &pseudoAcct, AccountID const &submitterAcct, AccountID const &dstAcct, Asset const &asset)
Checks freeze compliance for withdrawing an asset from a pseudo-account (e.g.
STAmount accountHolds(ReadView const &view, AccountID const &account, Currency const ¤cy, AccountID const &issuer, FreezeHandling zeroIfFrozen, beast::Journal j, SpendableHandling includeFullBalance=SpendableHandling::SimpleBalance)