xrpld
Loading...
Searching...
No Matches
xrpld
app
ledger
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
15
namespace
xrpl
{
16
17
struct
LedgerFill
18
{
19
LedgerFill
(
20
ReadView
const
& l,
21
rpc::Context
const
* ctx,
22
int
o = 0,
23
std::vector<TxQ::TxDetails>
q = {})
24
:
ledger
(l),
options
(o),
txQueue
(
std
::move(q)),
context
(ctx)
25
{
26
if
(
context
!=
nullptr
)
27
closeTime
=
context
->
ledgerMaster
.
getCloseTimeBySeq
(
ledger
.
seq
());
28
}
29
30
enum class
Options
{
31
DumpTxrp
= 1,
32
DumpState
= 2,
33
Expand
= 4,
34
Full
= 8,
35
Binary
= 16,
36
OwnerFunds
= 32,
37
DumpQueue
= 64
38
};
39
40
ReadView
const
&
ledger
;
41
int
options
;
42
std::vector<TxQ::TxDetails>
txQueue
;
43
rpc::Context
const
*
context
;
44
std::optional<NetClock::time_point>
closeTime
;
45
};
46
51
void
52
addJson
(
json::Value
&,
LedgerFill
const
&);
53
57
json::Value
58
getJson
(
LedgerFill
const
&);
59
63
void
64
copyFrom
(
json::Value
& to,
json::Value
const
& from);
65
66
}
// namespace xrpl
json::Value
Represents a JSON value.
Definition
json_value.h:117
xrpl::LedgerMaster::getCloseTimeBySeq
std::optional< NetClock::time_point > getCloseTimeBySeq(LedgerIndex ledgerIndex)
Definition
LedgerMaster.cpp:1586
xrpl::ReadView
A view into a ledger.
Definition
ReadView.h:41
xrpl::ReadView::seq
LedgerIndex seq() const
Returns the sequence number of the base ledger.
Definition
ReadView.h:115
std
STL namespace.
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::addJson
void addJson(json::Value &json, LedgerFill const &fill)
Given a Ledger and options, fill a json::Value with a description of the ledger.
Definition
LedgerToJson.cpp:353
xrpl::getJson
json::Value getJson(LedgerFill const &fill)
Return a new json::Value representing the ledger with given options.
Definition
LedgerToJson.cpp:366
xrpl::copyFrom
void copyFrom(json::Value &to, json::Value const &from)
Copy all the keys and values from one object into another.
Definition
LedgerToJson.cpp:374
optional
xrpl::LedgerFill
Definition
LedgerToJson.h:18
xrpl::LedgerFill::options
int options
Definition
LedgerToJson.h:41
xrpl::LedgerFill::Options
Options
Definition
LedgerToJson.h:30
xrpl::LedgerFill::Options::DumpState
@ DumpState
Definition
LedgerToJson.h:32
xrpl::LedgerFill::Options::Binary
@ Binary
Definition
LedgerToJson.h:35
xrpl::LedgerFill::Options::Expand
@ Expand
Definition
LedgerToJson.h:33
xrpl::LedgerFill::Options::DumpQueue
@ DumpQueue
Definition
LedgerToJson.h:37
xrpl::LedgerFill::Options::Full
@ Full
Definition
LedgerToJson.h:34
xrpl::LedgerFill::Options::OwnerFunds
@ OwnerFunds
Definition
LedgerToJson.h:36
xrpl::LedgerFill::Options::DumpTxrp
@ DumpTxrp
Definition
LedgerToJson.h:31
xrpl::LedgerFill::context
rpc::Context const * context
Definition
LedgerToJson.h:43
xrpl::LedgerFill::txQueue
std::vector< TxQ::TxDetails > txQueue
Definition
LedgerToJson.h:42
xrpl::LedgerFill::closeTime
std::optional< NetClock::time_point > closeTime
Definition
LedgerToJson.h:44
xrpl::LedgerFill::ledger
ReadView const & ledger
Definition
LedgerToJson.h:40
xrpl::LedgerFill::LedgerFill
LedgerFill(ReadView const &l, rpc::Context const *ctx, int o=0, std::vector< TxQ::TxDetails > q={})
Definition
LedgerToJson.h:19
xrpl::rpc::Context
The context of information needed to call an RPC.
Definition
Context.h:27
xrpl::rpc::Context::ledgerMaster
LedgerMaster & ledgerMaster
Definition
Context.h:32
utility
vector
Generated by
1.16.1