20 #include <ripple/ledger/ReadView.h>
21 #include <ripple/protocol/AmountConversions.h>
22 #include <ripple/protocol/STAmount.h>
23 #include <ripple/protocol/Indexes.h>
34 STAmount result ({currency, account});
36 auto sleRippleState = view.
read(
41 result = sleRippleState->getFieldAmount (
43 result.setIssuer (account);
46 assert (result.getIssuer () == account);
47 assert (result.getCurrency () == currency);
67 STAmount result ({currency, account});
69 auto sleRippleState = view.
read(
74 result = sleRippleState->getFieldAmount (
sfBalance);
77 result.setIssuer (account);
80 assert (result.getIssuer () == account);
81 assert (result.getCurrency () == currency);
STAmount creditBalance(ReadView const &view, AccountID const &account, AccountID const &issuer, Currency const ¤cy)
Returns the amount of IOUs issued by issuer that are held by an account.
IOUAmount creditLimit2(ReadView const &v, AccountID const &acc, AccountID const &iss, Currency const &cur)
const SF_Amount sfHighLimit(access, STI_AMOUNT, 7, "HighLimit")
IOUAmount toAmount< IOUAmount >(STAmount const &amt)
const SF_Amount sfLowLimit(access, STI_AMOUNT, 6, "LowLimit")
STAmount creditLimit(ReadView const &view, AccountID const &account, AccountID const &issuer, Currency const ¤cy)
Calculate the maximum amount of IOUs that an account can hold.
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
const SF_Amount sfBalance(access, STI_AMOUNT, 2, "Balance")