20#include <xrpld/app/paths/TrustLine.h>
21#include <xrpld/rpc/Context.h>
22#include <xrpld/rpc/detail/RPCHelpers.h>
24#include <xrpl/ledger/ReadView.h>
25#include <xrpl/protocol/ErrorCodes.h>
26#include <xrpl/protocol/RPCErr.h>
27#include <xrpl/protocol/jss.h>
34 auto& params = context.
params;
36 if (!(params.isMember(jss::account) || params.isMember(jss::ident)))
40 if (params.isMember(jss::account))
42 if (!params[jss::account].isString())
44 strIdent = params[jss::account].asString();
46 else if (params.isMember(jss::ident))
48 if (!params[jss::ident].isString())
50 strIdent = params[jss::ident].asString();
60 auto id = parseBase58<AccountID>(strIdent);
66 auto const accountID{std::move(
id.value())};
74 STAmount const& saBalance = rspEntry.getBalance();
76 if (saBalance < rspEntry.getLimit())
78 if ((-saBalance) < rspEntry.getLimitPeer())
87 for (
auto const& c : send)
92 for (
auto const& c : receive)
Value & append(Value const &value)
Append value to array at the end.
static std::vector< RPCTrustLine > getItems(AccountID const &accountID, ReadView const &view)
Currency const & getCurrency() const
@ arrayValue
array value (ordered list)
Json::Value invalid_field_error(std::string const &name)
void inject_error(error_code_i code, JsonValue &json)
Add or update the json update to reflect the error code.
Status lookupLedger(std::shared_ptr< ReadView const > &ledger, JsonContext &context, Json::Value &result)
Look up a ledger from a request and fill a Json::Result with the data representing a ledger.
Json::Value missing_field_error(std::string const &name)
Keylet account(AccountID const &id) noexcept
AccountID root.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Currency const & badCurrency()
We deliberately disallow the currency that looks like "XRP" because too many people were using it ins...
Json::Value rpcError(int iError)
std::string to_string(base_uint< Bits, Tag > const &a)
Json::Value doAccountCurrencies(RPC::JsonContext &context)