rippled
Loading...
Searching...
No Matches
xrpld
app
ledger
LedgerToJson.h
1
#ifndef XRPL_APP_LEDGER_LEDGERTOJSON_H_INCLUDED
2
#define XRPL_APP_LEDGER_LEDGERTOJSON_H_INCLUDED
3
4
#include <xrpld/app/ledger/Ledger.h>
5
#include <xrpld/app/ledger/LedgerMaster.h>
6
#include <xrpld/app/misc/TxQ.h>
7
#include <xrpld/rpc/Context.h>
8
9
#include <xrpl/basics/chrono.h>
10
#include <xrpl/json/Object.h>
11
#include <xrpl/protocol/serialize.h>
12
13
namespace
ripple
{
14
15
struct
LedgerFill
16
{
17
LedgerFill
(
18
ReadView
const
& l,
19
RPC::Context
* ctx,
20
int
o = 0,
21
std::vector<TxQ::TxDetails>
q = {})
22
:
ledger
(l),
options
(o),
txQueue
(
std
::move(q)),
context
(ctx)
23
{
24
if
(
context
)
25
closeTime
=
context
->
ledgerMaster
.
getCloseTimeBySeq
(
ledger
.
seq
());
26
}
27
28
enum
Options
{
29
dumpTxrp
= 1,
30
dumpState
= 2,
31
expand
= 4,
32
full
= 8,
33
binary
= 16,
34
ownerFunds
= 32,
35
dumpQueue
= 64
36
};
37
38
ReadView
const
&
ledger
;
39
int
options
;
40
std::vector<TxQ::TxDetails>
txQueue
;
41
RPC::Context
*
context
;
42
std::optional<NetClock::time_point>
closeTime
;
43
};
44
49
void
50
addJson
(
Json::Value
&,
LedgerFill
const
&);
51
53
Json::Value
54
getJson
(
LedgerFill
const
&);
55
56
}
// namespace ripple
57
58
#endif
Json::Value
Represents a JSON value.
Definition
json_value.h:130
ripple::LedgerMaster::getCloseTimeBySeq
std::optional< NetClock::time_point > getCloseTimeBySeq(LedgerIndex ledgerIndex)
Definition
LedgerMaster.cpp:1581
ripple::ReadView
A view into a ledger.
Definition
ReadView.h:32
ripple::ReadView::seq
LedgerIndex seq() const
Returns the sequence number of the base ledger.
Definition
ReadView.h:99
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:6
ripple::addJson
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.
Definition
LedgerToJson.cpp:328
ripple::getJson
Json::Value getJson(LedgerFill const &fill)
Return a new Json::Value representing the ledger with given options.
Definition
LedgerToJson.cpp:338
std
STL namespace.
std::optional
ripple::LedgerFill
Definition
LedgerToJson.h:16
ripple::LedgerFill::ledger
ReadView const & ledger
Definition
LedgerToJson.h:38
ripple::LedgerFill::txQueue
std::vector< TxQ::TxDetails > txQueue
Definition
LedgerToJson.h:40
ripple::LedgerFill::options
int options
Definition
LedgerToJson.h:39
ripple::LedgerFill::LedgerFill
LedgerFill(ReadView const &l, RPC::Context *ctx, int o=0, std::vector< TxQ::TxDetails > q={})
Definition
LedgerToJson.h:17
ripple::LedgerFill::Options
Options
Definition
LedgerToJson.h:28
ripple::LedgerFill::full
@ full
Definition
LedgerToJson.h:32
ripple::LedgerFill::dumpState
@ dumpState
Definition
LedgerToJson.h:30
ripple::LedgerFill::binary
@ binary
Definition
LedgerToJson.h:33
ripple::LedgerFill::ownerFunds
@ ownerFunds
Definition
LedgerToJson.h:34
ripple::LedgerFill::expand
@ expand
Definition
LedgerToJson.h:31
ripple::LedgerFill::dumpQueue
@ dumpQueue
Definition
LedgerToJson.h:35
ripple::LedgerFill::dumpTxrp
@ dumpTxrp
Definition
LedgerToJson.h:29
ripple::LedgerFill::context
RPC::Context * context
Definition
LedgerToJson.h:41
ripple::LedgerFill::closeTime
std::optional< NetClock::time_point > closeTime
Definition
LedgerToJson.h:42
ripple::RPC::Context
The context of information needed to call an RPC.
Definition
Context.h:20
ripple::RPC::Context::ledgerMaster
LedgerMaster & ledgerMaster
Definition
Context.h:25
std::vector
Generated by
1.9.8