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_mptoken_issuances/Types.hpp>
10#include <xrpl/protocol/AccountID.h>
11#include <xrpl/protocol/STLedgerEntry.h>
27 :
public rpc::HandlerFor<rpc::spec::handlers::account_mptoken_issuances::Input> {
29 std::shared_ptr<BackendInterface> sharedPtrBackend_;
35 static constexpr auto kLimitMin = rpc::spec::handlers::account_mptoken_issuances::kLimitMin;
39 static constexpr auto kLimitMax = rpc::spec::handlers::account_mptoken_issuances::kLimitMax;
44 rpc::spec::handlers::account_mptoken_issuances::kLimitDefault;
120 : sharedPtrBackend_(std::move(sharedPtrBackend))
137 std::vector<MPTokenIssuanceResponse>& issuances,
138 xrpl::SLE
const& sle,
139 xrpl::AccountID
const& account
150 tag_invoke(boost::json::value_from_tag, boost::json::value& jv, Output
const& output);
160 boost::json::value_from_tag,
161 boost::json::value& jv,
162 MPTokenIssuanceResponse
const& issuance
static constexpr auto kLimitMin
Minimum accepted value for the limit request field.
Definition AccountMPTokenIssuances.hpp:35
static constexpr auto kLimitDefault
Value of limit used when the request does not specify one.
Definition AccountMPTokenIssuances.hpp:43
HandlerReturnType< Output > Result
The result type of the command: the Output on success or an error Status.
Definition AccountMPTokenIssuances.hpp:112
AccountMPTokenIssuancesHandler(std::shared_ptr< BackendInterface > sharedPtrBackend)
Construct a new AccountMPTokenIssuancesHandler object.
Definition AccountMPTokenIssuances.hpp:119
static constexpr auto kLimitMax
Maximum accepted value for the limit request field.
Definition AccountMPTokenIssuances.hpp:39
Result process(Input const &input, Context const &ctx) const
Process the AccountMPTokenIssuances command.
Definition AccountMPTokenIssuances.cpp:118
friend void tag_invoke(boost::json::value_from_tag, boost::json::value &jv, Output const &output)
Convert the Output to a JSON object.
Definition AccountMPTokenIssuances.cpp:181
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 MPTokenIssuance response.
Definition AccountMPTokenIssuances.hpp:49
std::optional< uint16_t > transferFee
Fee charged on transfers, if set.
Definition AccountMPTokenIssuances.hpp:54
std::optional< bool > mptImmutableRequireAuth
Set if the require-auth flag is immutable.
Definition AccountMPTokenIssuances.hpp:72
std::optional< bool > mptCanHoldConfidentialBalance
Set if confidential balances are allowed.
Definition AccountMPTokenIssuances.hpp:87
std::optional< std::uint64_t > confidentialOutstandingAmount
Confidential outstanding amount.
Definition AccountMPTokenIssuances.hpp:91
std::optional< std::string > issuerEncryptionKey
Issuer encryption key, hex-encoded.
Definition AccountMPTokenIssuances.hpp:92
std::optional< std::string > auditorEncryptionKey
Auditor encryption key, hex-encoded.
Definition AccountMPTokenIssuances.hpp:93
std::optional< std::uint64_t > outstandingAmount
Amount currently held by holders.
Definition AccountMPTokenIssuances.hpp:58
std::optional< bool > mptRequireAuth
Set if holders need issuer authorization.
Definition AccountMPTokenIssuances.hpp:65
std::optional< bool > mptImmutableCanTrade
Set if the can-trade flag is immutable.
Definition AccountMPTokenIssuances.hpp:74
std::optional< bool > mptImmutableCanEscrow
Set if the can-escrow flag is immutable.
Definition AccountMPTokenIssuances.hpp:73
std::string mpTokenIssuanceId
ID of the MPTokenIssuance.
Definition AccountMPTokenIssuances.hpp:50
std::optional< std::string > mptokenMetadata
Arbitrary metadata, hex-encoded.
Definition AccountMPTokenIssuances.hpp:60
std::optional< uint8_t > assetScale
Decimal scale of the MPT, if set.
Definition AccountMPTokenIssuances.hpp:55
std::optional< bool > mptLocked
Set if the issuance is locked.
Definition AccountMPTokenIssuances.hpp:63
std::string issuer
Account that issued the MPT.
Definition AccountMPTokenIssuances.hpp:51
uint32_t sequence
Sequence number used to create the issuance.
Definition AccountMPTokenIssuances.hpp:52
std::optional< bool > mptCanLock
Set if the issuer can lock the MPT.
Definition AccountMPTokenIssuances.hpp:64
std::optional< bool > mptCanTrade
Set if the MPT can be traded on the DEX.
Definition AccountMPTokenIssuances.hpp:67
std::optional< bool > mptImmutableCanTransfer
Set if the can-transfer flag is immutable.
Definition AccountMPTokenIssuances.hpp:75
std::optional< std::uint64_t > maximumAmount
Maximum amount that can be issued.
Definition AccountMPTokenIssuances.hpp:57
std::optional< bool > mptCanClawback
Set if the issuer can claw back the MPT.
Definition AccountMPTokenIssuances.hpp:69
std::optional< bool > mptCanTransfer
Set if the MPT can be transferred between holders.
Definition AccountMPTokenIssuances.hpp:68
std::optional< std::uint64_t > lockedAmount
Amount currently locked (e.g. escrowed).
Definition AccountMPTokenIssuances.hpp:59
std::optional< bool > mptImmutableCanHoldConfidentialBalance
Set if the can-hold-confidential-balance flag is immutable.
Definition AccountMPTokenIssuances.hpp:80
std::optional< bool > mptImmutableTransferFee
Set if the transfer fee is immutable.
Definition AccountMPTokenIssuances.hpp:82
std::optional< bool > mptImmutableCanClawback
Set if the can-clawback flag is immutable.
Definition AccountMPTokenIssuances.hpp:76
std::optional< bool > mptImmutableCanLock
Set if the can-lock flag is immutable.
Definition AccountMPTokenIssuances.hpp:71
std::optional< bool > mptCanEscrow
Set if the MPT can be escrowed.
Definition AccountMPTokenIssuances.hpp:66
std::optional< std::string > domainID
Permissioned domain ID, hex-encoded.
Definition AccountMPTokenIssuances.hpp:61
std::optional< bool > mptImmutableMetadata
Set if the metadata is immutable.
Definition AccountMPTokenIssuances.hpp:81
A struct to hold the output data of the command.
Definition AccountMPTokenIssuances.hpp:99
uint32_t limit
Maximum number of issuances requested.
Definition AccountMPTokenIssuances.hpp:106
uint32_t ledgerIndex
Sequence of the ledger used for the request.
Definition AccountMPTokenIssuances.hpp:103
std::optional< std::string > marker
Pagination marker to resume from, if more results.
Definition AccountMPTokenIssuances.hpp:105
std::string account
The issuer account that was queried.
Definition AccountMPTokenIssuances.hpp:100
std::string ledgerHash
Hash of the ledger used for the request.
Definition AccountMPTokenIssuances.hpp:102
std::vector< MPTokenIssuanceResponse > issuances
Issuances created by the account.
Definition AccountMPTokenIssuances.hpp:101
bool validated
Whether the ledger is validated.
Definition AccountMPTokenIssuances.hpp:104
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