3#include <xrpl/basics/base_uint.h>
4#include <xrpl/protocol/AccountID.h>
17using Blob = std::vector<unsigned char>;
34 std::vector<LedgerObject> objects;
35 std::optional<ripple::uint256> cursor;
42 std::vector<LedgerObject> offers;
43 std::optional<ripple::uint256> cursor;
49struct TransactionAndMetadata {
52 std::uint32_t ledgerSequence = 0;
53 std::uint32_t date = 0;
55 TransactionAndMetadata() =
default;
68 std::uint32_t ledgerSequence,
71 : transaction{std::move(transaction)}
72 , metadata{std::move(metadata)}
73 , ledgerSequence{ledgerSequence}
84 : transaction{std::get<0>(
data)}
85 , metadata{std::get<1>(
data)}
86 , ledgerSequence{std::get<2>(
data)}
87 , date{std::get<3>(
data)}
100 return transaction == other.transaction && metadata == other.metadata &&
101 ledgerSequence == other.ledgerSequence && date == other.date;
108struct TransactionsCursor {
109 std::uint32_t ledgerSequence = 0;
110 std::uint32_t transactionIndex = 0;
112 TransactionsCursor() =
default;
121 : ledgerSequence{ledgerSequence}, transactionIndex{transactionIndex}
131 : ledgerSequence{std::get<0>(
data)}, transactionIndex{std::get<1>(
data)}
143 [[nodiscard]] std::tuple<std::uint32_t, std::uint32_t>
146 return std::make_tuple(ledgerSequence, transactionIndex);
154 std::vector<TransactionAndMetadata> txns;
155 std::optional<TransactionsCursor> cursor;
162 ripple::uint256 tokenID;
163 std::uint32_t ledgerSequence{};
164 ripple::AccountID owner;
179 NFT(ripple::uint256
const& tokenID,
180 std::uint32_t ledgerSequence,
181 ripple::AccountID
const& owner,
185 , ledgerSequence{ledgerSequence}
187 , uri{std::move(uri)}
200 NFT(ripple::uint256
const& tokenID,
201 std::uint32_t ledgerSequence,
202 ripple::AccountID
const& owner,
204 : NFT(tokenID, ledgerSequence, owner, {}, isBurned)
220 return tokenID == other.tokenID && ledgerSequence == other.ledgerSequence;
228 std::vector<NFT> nfts;
229 std::optional<ripple::uint256> cursor;
236 std::vector<Blob> mptokens;
237 std::optional<ripple::AccountID> cursor;
244 std::uint32_t minSequence = 0;
245 std::uint32_t maxSequence = 0;
256 ripple::uint256 feature;
257 bool isSupportedByXRPL =
false;
258 bool isSupportedByClio =
false;
259 bool isRetired =
false;
267 static ripple::uint256
278 return name == other.name;
293 : name{std::forward<decltype(val)>(val)}
298 operator std::string
const&()
const;
301 operator std::string_view()
const;
304 operator ripple::uint256()
const;
315constexpr ripple::uint256 kFIRST_KEY{
316 "0000000000000000000000000000000000000000000000000000000000000000"
318constexpr ripple::uint256 kLAST_KEY{
319 "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
321constexpr ripple::uint256 kHI192{
322 "0000000000000000000000000000000000000000000000001111111111111111"
This namespace implements the data access layer and related components.
Definition AmendmentCenter.cpp:56
auto operator<=>(AmendmentKey const &other) const =default
Comparison operators.
AmendmentKey(std::convertible_to< std::string > auto &&val)
Construct a new AmendmentKey.
Definition Types.hpp:292
Represents an amendment in the XRPL.
Definition Types.hpp:254
bool operator==(Amendment const &other) const
Equality comparison operator.
Definition Types.hpp:276
static ripple::uint256 getAmendmentId(std::string_view const name)
Get the amendment Id from its name.
Definition AmendmentCenter.cpp:211
Represents a page of book offer objects.
Definition Types.hpp:41
Represents an object in the ledger.
Definition Types.hpp:22
Represents a page of LedgerObjects.
Definition Types.hpp:33
Stores a range of sequences as a min and max pair.
Definition Types.hpp:243
Represents an array of MPTokens.
Definition Types.hpp:235
NFT(ripple::uint256 const &tokenID, std::uint32_t ledgerSequence, ripple::AccountID const &owner, Blob uri, bool isBurned)
Construct a new NFT object.
Definition Types.hpp:179
bool operator==(NFT const &other) const
Check if the NFT is the same as another.
Definition Types.hpp:218
NFT(ripple::uint256 const &tokenID, std::uint32_t ledgerSequence, ripple::AccountID const &owner, bool isBurned)
Construct a new NFT object.
Definition Types.hpp:200
Represents a bundle of NFTs with a cursor to the next page.
Definition Types.hpp:227
Represests a bundle of transactions with metadata and a cursor to the next page.
Definition Types.hpp:153
Represents a cursor into the transactions table.
Definition Types.hpp:108
TransactionsCursor(std::tuple< std::uint32_t, std::uint32_t > data)
Construct a new Transactions Cursor object.
Definition Types.hpp:130
TransactionsCursor(std::uint32_t ledgerSequence, std::uint32_t transactionIndex)
Construct a new Transactions Cursor object.
Definition Types.hpp:120
std::tuple< std::uint32_t, std::uint32_t > asTuple() const
Convert the cursor to a tuple of seq and index.
Definition Types.hpp:144