rippled
Loading...
Searching...
No Matches
xrpld
app
ledger
LedgerToJson.h
1
#pragma once
2
3
#include <xrpld/app/ledger/Ledger.h>
4
#include <xrpld/app/ledger/LedgerMaster.h>
5
#include <xrpld/app/misc/TxQ.h>
6
#include <xrpld/rpc/Context.h>
7
8
#include <xrpl/basics/chrono.h>
9
#include <xrpl/protocol/serialize.h>
10
11
namespace
xrpl
{
12
13
struct
LedgerFill
14
{
15
LedgerFill
(
ReadView
const
& l,
RPC::Context
const
* ctx,
int
o = 0,
std::vector<TxQ::TxDetails>
q = {})
16
:
ledger
(l),
options
(o),
txQueue
(
std
::move(q)),
context
(ctx)
17
{
18
if
(
context
)
19
closeTime
=
context
->
ledgerMaster
.
getCloseTimeBySeq
(
ledger
.
seq
());
20
}
21
22
enum
Options
{
dumpTxrp
= 1,
dumpState
= 2,
expand
= 4,
full
= 8,
binary
= 16,
ownerFunds
= 32,
dumpQueue
= 64 };
23
24
ReadView
const
&
ledger
;
25
int
options
;
26
std::vector<TxQ::TxDetails>
txQueue
;
27
RPC::Context
const
*
context
;
28
std::optional<NetClock::time_point>
closeTime
;
29
};
30
34
void
35
addJson
(
Json::Value
&,
LedgerFill
const
&);
36
38
Json::Value
39
getJson
(
LedgerFill
const
&);
40
42
void
43
copyFrom
(
Json::Value
& to,
Json::Value
const
& from);
44
45
}
// 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:1485
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::getJson
Json::Value getJson(LedgerFill const &fill)
Return a new Json::Value representing the ledger with given options.
Definition
LedgerToJson.cpp:299
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:307
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:289
std::optional
xrpl::LedgerFill
Definition
LedgerToJson.h:14
xrpl::LedgerFill::options
int options
Definition
LedgerToJson.h:25
xrpl::LedgerFill::Options
Options
Definition
LedgerToJson.h:22
xrpl::LedgerFill::dumpState
@ dumpState
Definition
LedgerToJson.h:22
xrpl::LedgerFill::binary
@ binary
Definition
LedgerToJson.h:22
xrpl::LedgerFill::expand
@ expand
Definition
LedgerToJson.h:22
xrpl::LedgerFill::dumpTxrp
@ dumpTxrp
Definition
LedgerToJson.h:22
xrpl::LedgerFill::ownerFunds
@ ownerFunds
Definition
LedgerToJson.h:22
xrpl::LedgerFill::full
@ full
Definition
LedgerToJson.h:22
xrpl::LedgerFill::dumpQueue
@ dumpQueue
Definition
LedgerToJson.h:22
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:27
xrpl::LedgerFill::txQueue
std::vector< TxQ::TxDetails > txQueue
Definition
LedgerToJson.h:26
xrpl::LedgerFill::closeTime
std::optional< NetClock::time_point > closeTime
Definition
LedgerToJson.h:28
xrpl::LedgerFill::ledger
ReadView const & ledger
Definition
LedgerToJson.h:24
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.9.8