20#include <xrpld/app/ledger/LedgerToJson.h>
21#include <xrpld/rpc/Context.h>
22#include <xrpld/rpc/detail/RPCHelpers.h>
24#include <xrpl/protocol/ErrorCodes.h>
25#include <xrpl/protocol/jss.h>
38 auto res = getLedgerByContext(context);
40 if (std::holds_alternative<Json::Value>(res))
41 return std::get<Json::Value>(res);
43 auto const& ledger = std::get<std::shared_ptr<Ledger const>>(res);
46 jvResult[jss::ledger_index] = ledger->info().seq;
47 addJson(jvResult, {*ledger, &context, 0});
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Json::Value doLedgerRequest(RPC::JsonContext &)
void addJson(Json::Value &json, LedgerFill const &fill)
Given a Ledger and options, fill a Json::Object or Json::Value with a description of the ledger.