xrpld
Loading...
Searching...
No Matches
LedgerToJson.h
1#pragma once
2
3#include <xrpld/app/ledger/LedgerMaster.h>
4#include <xrpld/app/misc/TxQ.h>
5#include <xrpld/rpc/Context.h>
6
7#include <xrpl/basics/chrono.h>
8#include <xrpl/json/json_value.h>
9#include <xrpl/ledger/ReadView.h>
10
11#include <optional>
12#include <utility>
13#include <vector>
14
15namespace xrpl {
16
18{
20 ReadView const& l,
21 rpc::Context const* ctx,
22 int o = 0,
24 : ledger(l), options(o), txQueue(std::move(q)), context(ctx)
25 {
26 if (context != nullptr)
28 }
29
30 enum class Options {
33 Expand = 4,
34 Full = 8,
35 Binary = 16,
38 };
39
45};
46
51void
53
58getJson(LedgerFill const&);
59
63void
64copyFrom(json::Value& to, json::Value const& from);
65
66} // namespace xrpl
Represents a JSON value.
Definition json_value.h:117
std::optional< NetClock::time_point > getCloseTimeBySeq(LedgerIndex ledgerIndex)
A view into a ledger.
Definition ReadView.h:41
LedgerIndex seq() const
Returns the sequence number of the base ledger.
Definition ReadView.h:115
STL namespace.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
void addJson(json::Value &json, LedgerFill const &fill)
Given a Ledger and options, fill a json::Value with a description of the ledger.
json::Value getJson(LedgerFill const &fill)
Return a new json::Value representing the ledger with given options.
void copyFrom(json::Value &to, json::Value const &from)
Copy all the keys and values from one object into another.
rpc::Context const * context
std::vector< TxQ::TxDetails > txQueue
std::optional< NetClock::time_point > closeTime
ReadView const & ledger
LedgerFill(ReadView const &l, rpc::Context const *ctx, int o=0, std::vector< TxQ::TxDetails > q={})
The context of information needed to call an RPC.
Definition Context.h:27
LedgerMaster & ledgerMaster
Definition Context.h:32