1#include <xrpld/app/paths/TrustLine.h>
2#include <xrpld/rpc/Context.h>
3#include <xrpld/rpc/detail/RPCLedgerHelpers.h>
5#include <xrpl/ledger/ReadView.h>
6#include <xrpl/protocol/ErrorCodes.h>
7#include <xrpl/protocol/RPCErr.h>
8#include <xrpl/protocol/jss.h>
15 auto& params = context.
params;
17 if (!(params.isMember(jss::account) || params.isMember(jss::ident)))
21 if (params.isMember(jss::account))
23 if (!params[jss::account].isString())
25 strIdent = params[jss::account].asString();
27 else if (params.isMember(jss::ident))
29 if (!params[jss::ident].isString())
31 strIdent = params[jss::ident].asString();
41 auto id = parseBase58<AccountID>(strIdent);
47 auto const accountID{std::move(
id.value())};
55 STAmount const& saBalance = rspEntry.getBalance();
57 if (saBalance < rspEntry.getLimit())
59 if ((-saBalance) < rspEntry.getLimitPeer())
68 for (
auto const& c : send)
73 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)