3#include <xrpl/basics/base_uint.h>
4#include <xrpl/protocol/AccountID.h>
20using Blob = std::vector<unsigned char>;
52struct TransactionAndMetadata {
58 TransactionAndMetadata() =
default;
111struct TransactionsCursor {
115 TransactionsCursor() =
default;
146 [[nodiscard]] std::tuple<std::uint32_t, std::uint32_t>
157 std::vector<TransactionAndMetadata>
txns;
158 std::optional<TransactionsCursor>
cursor;
184 xrpl::AccountID
const&
owner,
205 xrpl::AccountID
const&
owner,
296 :
name{std::forward<decltype(val)>(val)}
305 operator std::string
const&()
const;
312 operator std::string_view()
const;
319 operator xrpl::uint256()
const;
334 "0000000000000000000000000000000000000000000000000000000000000000"
340 "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
345constexpr xrpl::uint256
kHi192{
"0000000000000000000000000000000000000000000000001111111111111111"};
This namespace implements the data access layer and related components.
Definition AmendmentCenter.cpp:56
constexpr xrpl::uint256 kLastKey
The largest possible ledger object key; used as the end of the key space.
Definition Types.hpp:339
constexpr xrpl::uint256 kFirstKey
The smallest possible ledger object key; used as the start of the key space.
Definition Types.hpp:333
constexpr xrpl::uint256 kHi192
Key with the high 192 bits zero and the low 64 bits set to 0x1111111111111111.
Definition Types.hpp:345
std::vector< unsigned char > Blob
Raw serialized data, e.g. a ledger object, transaction or metadata.
Definition Types.hpp:20
auto operator<=>(AmendmentKey const &other) const =default
Comparison operators.
std::string name
Name of the amendment.
Definition Types.hpp:289
AmendmentKey(std::convertible_to< std::string > auto &&val)
Construct a new AmendmentKey.
Definition Types.hpp:295
Represents an amendment in the XRPL.
Definition Types.hpp:257
bool isRetired
Whether the amendment is retired.
Definition Types.hpp:262
std::string name
Name of the amendment.
Definition Types.hpp:258
bool operator==(Amendment const &other) const
Equality comparison operator.
Definition Types.hpp:279
bool isSupportedByClio
Whether Clio supports the amendment.
Definition Types.hpp:261
static xrpl::uint256 getAmendmentId(std::string_view const name)
Get the amendment Id from its name.
Definition AmendmentCenter.cpp:211
xrpl::uint256 feature
Amendment ID (hash of the name).
Definition Types.hpp:259
bool isSupportedByXRPL
Whether libxrpl knows and supports the amendment.
Definition Types.hpp:260
Represents a page of book offer objects.
Definition Types.hpp:44
std::optional< xrpl::uint256 > cursor
Unused; fetchBookOffers() never sets it.
Definition Types.hpp:46
std::vector< LedgerObject > offers
Offer objects in this page.
Definition Types.hpp:45
Represents an object in the ledger.
Definition Types.hpp:25
xrpl::uint256 key
Key (index) of the object in the ledger.
Definition Types.hpp:26
Blob blob
Serialized object data; empty if the object was deleted.
Definition Types.hpp:27
Represents a page of LedgerObjects.
Definition Types.hpp:36
std::optional< xrpl::uint256 > cursor
Key to continue from; nullopt if no more pages.
Definition Types.hpp:38
std::vector< LedgerObject > objects
Ledger objects in this page.
Definition Types.hpp:37
Stores a range of sequences as a min and max pair.
Definition Types.hpp:246
std::uint32_t minSequence
Lowest ledger sequence in the range (inclusive).
Definition Types.hpp:247
std::uint32_t maxSequence
Highest ledger sequence in the range (inclusive).
Definition Types.hpp:248
Represents an array of MPTokens.
Definition Types.hpp:238
std::optional< xrpl::AccountID > cursor
Holder to continue from; nullopt if no more pages.
Definition Types.hpp:240
std::vector< Blob > mptokens
Serialized MPToken ledger objects.
Definition Types.hpp:239
Represents a NFToken.
Definition Types.hpp:164
xrpl::uint256 tokenID
ID of the NFToken.
Definition Types.hpp:165
bool isBurned
Whether the token has been burned.
Definition Types.hpp:169
bool operator==(NFT const &other) const
Check if the NFT is the same as another.
Definition Types.hpp:221
xrpl::AccountID owner
Owner of the token.
Definition Types.hpp:167
std::uint32_t ledgerSequence
Ledger sequence at which this state of the token applies.
Definition Types.hpp:166
NFT(xrpl::uint256 const &tokenID, std::uint32_t ledgerSequence, xrpl::AccountID const &owner, bool isBurned)
Construct a new NFT object.
Definition Types.hpp:203
NFT(xrpl::uint256 const &tokenID, std::uint32_t ledgerSequence, xrpl::AccountID const &owner, Blob uri, bool isBurned)
Construct a new NFT object.
Definition Types.hpp:182
Blob uri
URI of the token; empty if not set.
Definition Types.hpp:168
Represents a bundle of NFTs with a cursor to the next page.
Definition Types.hpp:230
std::vector< NFT > nfts
NFTs in this page.
Definition Types.hpp:231
std::optional< xrpl::uint256 > cursor
Token ID to continue from; nullopt if no more pages.
Definition Types.hpp:232
Represests a bundle of transactions with metadata and a cursor to the next page.
Definition Types.hpp:156
std::vector< TransactionAndMetadata > txns
Transactions in this page.
Definition Types.hpp:157
std::optional< TransactionsCursor > cursor
Cursor to the next page, if any.
Definition Types.hpp:158
Represents a cursor into the transactions table.
Definition Types.hpp:111
std::uint32_t ledgerSequence
Ledger sequence to continue from.
Definition Types.hpp:112
TransactionsCursor(std::tuple< std::uint32_t, std::uint32_t > data)
Construct a new Transactions Cursor object.
Definition Types.hpp:133
std::uint32_t transactionIndex
Transaction index within that ledger to continue from.
Definition Types.hpp:113
TransactionsCursor(std::uint32_t ledgerSequence, std::uint32_t transactionIndex)
Construct a new Transactions Cursor object.
Definition Types.hpp:123
std::tuple< std::uint32_t, std::uint32_t > asTuple() const
Convert the cursor to a tuple of seq and index.
Definition Types.hpp:147