20 #include <ripple/app/main/Application.h>
21 #include <ripple/json/json_writer.h>
22 #include <ripple/ledger/ReadView.h>
23 #include <ripple/net/RPCErr.h>
24 #include <ripple/protocol/ErrorCodes.h>
25 #include <ripple/protocol/Indexes.h>
26 #include <ripple/protocol/LedgerFormats.h>
27 #include <ripple/protocol/jss.h>
28 #include <ripple/resource/Fees.h>
29 #include <ripple/rpc/Context.h>
30 #include <ripple/rpc/impl/RPCHelpers.h>
31 #include <ripple/rpc/impl/Tuning.h>
52 auto const& params = context.
params;
53 if (!params.isMember(jss::account))
58 if (ledger ==
nullptr)
63 auto const strIdent = params[jss::account].asString();
66 for (
auto it = jv.begin(); it != jv.end(); ++it)
67 result[it.memberName()] = *it;
76 boost::optional<std::vector<LedgerEntryType>> typeFilter;
78 if (params.isMember(jss::deletion_blockers_only) &&
79 params[jss::deletion_blockers_only].asBool())
85 }
static constexpr deletionBlockers[] = {
92 typeFilter->reserve(
std::size(deletionBlockers));
94 for (
auto [name, type] : deletionBlockers)
96 if (params.isMember(jss::type) && name != params[jss::type])
101 typeFilter->push_back(type);
111 rpcStatus.inject(result);
126 if (params.isMember(jss::marker))
128 auto const& marker = params[jss::marker];
129 if (!marker.isString())
143 if (!entryIndex.
SetHex(s))
const Charge feeMediumBurdenRPC
@ arrayValue
array value (ordered list)
Json::Value doAccountObjects(RPC::JsonContext &context)
General RPC command that can retrieve objects in the account root.
Resource::Charge & loadType
bool getAccountObjects(ReadView const &ledger, AccountID const &account, boost::optional< std::vector< LedgerEntryType >> const &typeFilter, uint256 dirIndex, uint256 const &entryIndex, std::uint32_t const limit, Json::Value &jvResult)
Gathers all objects for an account in a ledger.
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.
virtual AccountIDCache const & accountIDCache() const =0
Json::Value expected_field_error(std::string const &name, std::string const &type)
Json::Value missing_field_error(std::string const &name)
Keylet account(AccountID const &id) noexcept
AccountID root.
bool SetHex(const char *psz, bool bStrict=false)
Parse a hex string into a base_uint The input can be:
virtual bool exists(Keylet const &k) const =0
Determine if a state item exists.
static constexpr LimitRange accountObjects
Limits for the account_objects command.
Json::Value rpcError(int iError, Json::Value jvResult)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
LedgerEntryType
Ledger entry types.
std::pair< RPC::Status, LedgerEntryType > chooseLedgerEntryType(Json::Value const ¶ms)
Lightweight wrapper to tag static string.
Json::Value invalid_field_error(std::string const &name)
Json::Value accountFromString(AccountID &result, std::string const &strIdent, bool bStrict)
std::string toBase58(AccountID const &) const
Return ripple::toBase58 for the AccountID.