3#include "data/BackendInterface.hpp"
4#include "rpc/common/SpecBackend.hpp"
5#include "rpc/common/Types.hpp"
7#include <boost/json/conversion.hpp>
8#include <boost/json/value.hpp>
9#include <rpcspec/handlers/account_mptokens/Types.hpp>
10#include <xrpl/protocol/STLedgerEntry.h>
26 :
public rpc::HandlerFor<rpc::spec::handlers::account_mptokens::Input> {
28 std::shared_ptr<BackendInterface> sharedPtrBackend_;
34 static constexpr auto kLimitMin = rpc::spec::handlers::account_mptokens::kLimitMin;
38 static constexpr auto kLimitMax = rpc::spec::handlers::account_mptokens::kLimitMax;
42 static constexpr auto kLimitDefault = rpc::spec::handlers::account_mptokens::kLimitDefault;
73 std::vector<MPTokenResponse>
mpts;
92 : sharedPtrBackend_(std::move(sharedPtrBackend))
108 addMPToken(std::vector<MPTokenResponse>& mpts, xrpl::SLE
const& sle);
118 tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Output
const& output);
127 tag_invoke(boost::json::value_from_tag, boost::json::value& jv, MPTokenResponse
const& mptoken);
HandlerReturnType< Output > Result
The result type of the command: the Output on success or an error Status.
Definition AccountMPTokens.hpp:84
AccountMPTokensHandler(std::shared_ptr< BackendInterface > sharedPtrBackend)
Construct a new AccountMPTokensHandler object.
Definition AccountMPTokens.hpp:91
Result process(Input const &input, Context const &ctx) const
Process the AccountMPTokens command.
Definition AccountMPTokens.cpp:82
static constexpr auto kLimitMax
Maximum accepted value for the limit request field.
Definition AccountMPTokens.hpp:38
friend void tag_invoke(boost::json::value_from_tag, boost::json::value &jv, Output const &output)
Convert the Output to a JSON object.
Definition AccountMPTokens.cpp:145
static constexpr auto kLimitMin
Minimum accepted value for the limit request field.
Definition AccountMPTokens.hpp:34
static constexpr auto kLimitDefault
Value of limit used when the request does not specify one.
Definition AccountMPTokens.hpp:42
This namespace contains all the RPC logic and handlers.
Definition AMMHelpers.cpp:17
std::expected< OutputType, Status > HandlerReturnType
Return type for each individual handler.
Definition Types.hpp:63
spec::HandlerFor< InputT, boost::json::value > HandlerFor
The spec-driven base every typed handler inherits.
Definition SpecBackend.hpp:24
A struct to hold data for one MPToken response.
Definition AccountMPTokens.hpp:47
std::string account
Account holding the MPToken.
Definition AccountMPTokens.hpp:49
std::optional< bool > mptAuthorized
Set if the issuer authorized the holder.
Definition AccountMPTokens.hpp:55
std::optional< std::string > confidentialBalanceSpending
Encrypted spending balance, hex.
Definition AccountMPTokens.hpp:61
std::optional< std::string > auditorEncryptedBalance
Balance encrypted for auditor, hex.
Definition AccountMPTokens.hpp:64
std::string mpTokenIssuanceId
ID of the MPTokenIssuance this token belongs to.
Definition AccountMPTokens.hpp:50
std::optional< uint32_t > confidentialBalanceVersion
Confidential balance version.
Definition AccountMPTokens.hpp:62
std::optional< bool > mptLocked
Set if the holder's MPToken is locked.
Definition AccountMPTokens.hpp:54
std::optional< std::string > confidentialBalanceInbox
Encrypted inbox balance, hex.
Definition AccountMPTokens.hpp:57
std::string mpTokenId
Ledger key of the MPToken object (hex).
Definition AccountMPTokens.hpp:48
std::optional< uint64_t > lockedAmount
Amount currently locked (e.g. escrowed).
Definition AccountMPTokens.hpp:52
std::optional< std::string > holderEncryptionKey
Holder encryption key, hex.
Definition AccountMPTokens.hpp:65
uint64_t mptAmount
Amount of the MPT held.
Definition AccountMPTokens.hpp:51
std::optional< std::string > issuerEncryptedBalance
Balance encrypted for issuer, hex.
Definition AccountMPTokens.hpp:63
A struct to hold the output data of the command.
Definition AccountMPTokens.hpp:71
std::optional< std::string > marker
Pagination marker to resume from, if more results.
Definition AccountMPTokens.hpp:77
bool validated
Whether the ledger is validated.
Definition AccountMPTokens.hpp:76
uint32_t limit
Maximum number of MPTokens requested.
Definition AccountMPTokens.hpp:78
uint32_t ledgerIndex
Sequence of the ledger used for the request.
Definition AccountMPTokens.hpp:75
std::vector< MPTokenResponse > mpts
MPTokens held by the account.
Definition AccountMPTokens.hpp:73
std::string ledgerHash
Hash of the ledger used for the request.
Definition AccountMPTokens.hpp:74
std::string account
The holder account that was queried.
Definition AccountMPTokens.hpp:72
Context of an RPC call.
Definition Types.hpp:102
Result type used to return responses or error statuses to the Webserver subsystem.
Definition Types.hpp:132