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/protocol/serialize.h>
11
12
namespace
xrpl
{
13
14
struct
LedgerFill
15
{
16
LedgerFill
(
17
ReadView
const
& l,
18
RPC::Context
const
* ctx,
19
int
o = 0,
20
std::vector<TxQ::TxDetails>
q = {})
21
:
ledger
(l),
options
(o),
txQueue
(
std
::move(q)),
context
(ctx)
22
{
23
if
(
context
)
24
closeTime
=
context
->
ledgerMaster
.
getCloseTimeBySeq
(
ledger
.
seq
());
25
}
26
27
enum
Options
{
28
dumpTxrp
= 1,
29
dumpState
= 2,
30
expand
= 4,
31
full
= 8,
32
binary
= 16,
33
ownerFunds
= 32,
34
dumpQueue
= 64
35
};
36
37
ReadView
const
&
ledger
;
38
int
options
;
39
std::vector<TxQ::TxDetails>
txQueue
;
40
RPC::Context
const
*
context
;
41
std::optional<NetClock::time_point>
closeTime
;
42
};
43
47
void
48
addJson
(
Json::Value
&,
LedgerFill
const
&);
49
51
Json::Value
52
getJson
(
LedgerFill
const
&);
53
55
void
56
copyFrom
(
Json::Value
& to,
Json::Value
const
& from);
57
58
}
// namespace xrpl
59
60
#endif
Json::Value
Represents a JSON value.
Definition
json_value.h:131
xrpl::LedgerMaster::getCloseTimeBySeq
std::optional< NetClock::time_point > getCloseTimeBySeq(LedgerIndex ledgerIndex)
Definition
LedgerMaster.cpp:1582
xrpl::ReadView
A view into a ledger.
Definition
ReadView.h:32
xrpl::ReadView::seq
LedgerIndex seq() const
Returns the sequence number of the base ledger.
Definition
ReadView.h:99
std
STL namespace.
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:6
xrpl::getJson
Json::Value getJson(LedgerFill const &fill)
Return a new Json::Value representing the ledger with given options.
Definition
LedgerToJson.cpp:332
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:340
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:322
std::optional
xrpl::LedgerFill
Definition
LedgerToJson.h:15
xrpl::LedgerFill::options
int options
Definition
LedgerToJson.h:38
xrpl::LedgerFill::Options
Options
Definition
LedgerToJson.h:27
xrpl::LedgerFill::dumpState
@ dumpState
Definition
LedgerToJson.h:29
xrpl::LedgerFill::binary
@ binary
Definition
LedgerToJson.h:32
xrpl::LedgerFill::expand
@ expand
Definition
LedgerToJson.h:30
xrpl::LedgerFill::dumpTxrp
@ dumpTxrp
Definition
LedgerToJson.h:28
xrpl::LedgerFill::ownerFunds
@ ownerFunds
Definition
LedgerToJson.h:33
xrpl::LedgerFill::full
@ full
Definition
LedgerToJson.h:31
xrpl::LedgerFill::dumpQueue
@ dumpQueue
Definition
LedgerToJson.h:34
xrpl::LedgerFill::LedgerFill
LedgerFill(ReadView const &l, RPC::Context const *ctx, int o=0, std::vector< TxQ::TxDetails > q={})
Definition
LedgerToJson.h:16
xrpl::LedgerFill::context
RPC::Context const * context
Definition
LedgerToJson.h:40
xrpl::LedgerFill::txQueue
std::vector< TxQ::TxDetails > txQueue
Definition
LedgerToJson.h:39
xrpl::LedgerFill::closeTime
std::optional< NetClock::time_point > closeTime
Definition
LedgerToJson.h:41
xrpl::LedgerFill::ledger
ReadView const & ledger
Definition
LedgerToJson.h:37
xrpl::RPC::Context
The context of information needed to call an RPC.
Definition
Context.h:20
xrpl::RPC::Context::ledgerMaster
LedgerMaster & ledgerMaster
Definition
Context.h:25
std::vector
Generated by
1.9.8