1#include <xrpld/rpc/detail/TrustLine.h>
3#include <xrpl/json/json_value.h>
4#include <xrpl/ledger/ReadView.h>
5#include <xrpl/ledger/helpers/DirectoryHelpers.h>
6#include <xrpl/protocol/AccountID.h>
7#include <xrpl/protocol/LedgerFormats.h>
8#include <xrpl/protocol/SField.h>
9#include <xrpl/protocol/STAmount.h>
10#include <xrpl/protocol/STLedgerEntry.h>
19 ,
lowLimit_(sle->getFieldAmount(sfLowLimit))
21 ,
balance_(sle->getFieldAmount(sfBalance))
22 ,
flags_(sle->getFieldU32(sfFlags))
41 if (!sle || sle->getType() != ltRIPPLE_STATE)
56 auto ret = T::makeItem(accountID, sleCur);
89 if (!sle || sle->getType() != ltRIPPLE_STATE)
static std::vector< PathFindTrustLine > getItems(AccountID const &accountID, ReadView const &view, LineDirection direction)
static std::optional< PathFindTrustLine > makeItem(AccountID const &accountID, SLE::const_ref sle)
TrustLineBase(SLE::const_ref sle, AccountID const &viewAccount)
static std::vector< RPCTrustLine > getItems(AccountID const &accountID, ReadView const &view)
static std::optional< RPCTrustLine > makeItem(AccountID const &accountID, SLE::const_ref sle)
std::shared_ptr< STLedgerEntry const > const & const_ref
TrustLineBase(SLE::const_ref sle, AccountID const &viewAccount)
uint256 const & key() const
Returns the state map key for the ledger entry.
STAmount const highLimit_
@ Object
object value (collection of name/value pairs).
std::vector< T > getTrustLineItems(AccountID const &accountID, ReadView const &view, LineDirection direction=LineDirection::Outgoing)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::string to_string(BaseUInt< Bits, Tag > const &a)
LineDirection
Describes how an account was found in a path, and how to find the next set of paths.
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(SLE::const_ref)> const &f)
Iterate all items in the given directory.
T shrink_to_fit(T... args)