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/ledger/Ledger.h>
9
#include <xrpl/protocol/serialize.h>
10
11
namespace
xrpl
{
12
13
struct
LedgerFill
14
{
15
LedgerFill
(
16
ReadView
const
& l,
17
RPC::Context
const
* ctx,
18
int
o = 0,
19
std::vector<TxQ::TxDetails>
q = {})
20
:
ledger
(l),
options
(o),
txQueue
(
std
::move(q)),
context
(ctx)
21
{
22
if
(
context
!=
nullptr
)
23
closeTime
=
context
->
ledgerMaster
.
getCloseTimeBySeq
(
ledger
.
seq
());
24
}
25
26
enum class
Options
{
27
DumpTxrp
= 1,
28
DumpState
= 2,
29
Expand
= 4,
30
Full
= 8,
31
Binary
= 16,
32
OwnerFunds
= 32,
33
DumpQueue
= 64
34
};
35
36
ReadView
const
&
ledger
;
37
int
options
;
38
std::vector<TxQ::TxDetails>
txQueue
;
39
RPC::Context
const
*
context
;
40
std::optional<NetClock::time_point>
closeTime
;
41
};
42
46
void
47
addJson
(
json::Value
&,
LedgerFill
const
&);
48
50
json::Value
51
getJson
(
LedgerFill
const
&);
52
54
void
55
copyFrom
(
json::Value
& to,
json::Value
const
& from);
56
57
}
// namespace xrpl
json::Value
Represents a JSON value.
Definition
json_value.h:130
xrpl::LedgerMaster::getCloseTimeBySeq
std::optional< NetClock::time_point > getCloseTimeBySeq(LedgerIndex ledgerIndex)
Definition
LedgerMaster.cpp:1580
xrpl::ReadView
A view into a ledger.
Definition
ReadView.h:31
xrpl::ReadView::seq
LedgerIndex seq() const
Returns the sequence number of the base ledger.
Definition
ReadView.h:97
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
std::optional
xrpl::LedgerFill
Definition
LedgerToJson.h:14
xrpl::LedgerFill::options
int options
Definition
LedgerToJson.h:37
xrpl::LedgerFill::Options
Options
Definition
LedgerToJson.h:26
xrpl::LedgerFill::Options::DumpState
@ DumpState
Definition
LedgerToJson.h:28
xrpl::LedgerFill::Options::Binary
@ Binary
Definition
LedgerToJson.h:31
xrpl::LedgerFill::Options::Expand
@ Expand
Definition
LedgerToJson.h:29
xrpl::LedgerFill::Options::DumpQueue
@ DumpQueue
Definition
LedgerToJson.h:33
xrpl::LedgerFill::Options::Full
@ Full
Definition
LedgerToJson.h:30
xrpl::LedgerFill::Options::OwnerFunds
@ OwnerFunds
Definition
LedgerToJson.h:32
xrpl::LedgerFill::Options::DumpTxrp
@ DumpTxrp
Definition
LedgerToJson.h:27
xrpl::LedgerFill::LedgerFill
LedgerFill(ReadView const &l, RPC::Context const *ctx, int o=0, std::vector< TxQ::TxDetails > q={})
Definition
LedgerToJson.h:15
xrpl::LedgerFill::context
RPC::Context const * context
Definition
LedgerToJson.h:39
xrpl::LedgerFill::txQueue
std::vector< TxQ::TxDetails > txQueue
Definition
LedgerToJson.h:38
xrpl::LedgerFill::closeTime
std::optional< NetClock::time_point > closeTime
Definition
LedgerToJson.h:40
xrpl::LedgerFill::ledger
ReadView const & ledger
Definition
LedgerToJson.h:36
xrpl::RPC::Context
The context of information needed to call an RPC.
Definition
Context.h:19
xrpl::RPC::Context::ledgerMaster
LedgerMaster & ledgerMaster
Definition
Context.h:24
std::vector
Generated by
1.16.1