4#include <xrpl/protocol/STLedgerEntry.h>
5#include <xrpl/protocol/STParsedJSON.h>
6#include <xrpl/protocol/jss.h>
7#include <xrpl/protocol_autogen/LedgerEntryBase.h>
8#include <xrpl/protocol_autogen/LedgerEntryBuilderBase.h>
9#include <xrpl/json/json_value.h>
42 throw std::runtime_error(
"Invalid ledger entry type for MPToken");
53 SF_ACCOUNT::type::value_type
56 return this->
sle_->at(sfAccount);
64 SF_UINT192::type::value_type
67 return this->
sle_->at(sfMPTokenIssuanceID);
79 return this->
sle_->at(sfMPTAmount);
91 return this->
sle_->isFieldPresent(sfMPTAmount);
103 return this->
sle_->at(sfLockedAmount);
115 return this->
sle_->isFieldPresent(sfLockedAmount);
123 SF_UINT64::type::value_type
126 return this->
sle_->at(sfOwnerNode);
134 SF_UINT256::type::value_type
137 return this->
sle_->at(sfPreviousTxnID);
145 SF_UINT32::type::value_type
148 return this->
sle_->at(sfPreviousTxnLgrSeq);
160 return this->
sle_->at(sfConfidentialBalanceInbox);
172 return this->
sle_->isFieldPresent(sfConfidentialBalanceInbox);
184 return this->
sle_->at(sfConfidentialBalanceSpending);
196 return this->
sle_->isFieldPresent(sfConfidentialBalanceSpending);
208 return this->
sle_->at(sfConfidentialBalanceVersion);
220 return this->
sle_->isFieldPresent(sfConfidentialBalanceVersion);
232 return this->
sle_->at(sfIssuerEncryptedBalance);
244 return this->
sle_->isFieldPresent(sfIssuerEncryptedBalance);
256 return this->
sle_->at(sfAuditorEncryptedBalance);
268 return this->
sle_->isFieldPresent(sfAuditorEncryptedBalance);
280 return this->
sle_->at(sfIssuerKeyMirrorEpoch);
292 return this->
sle_->isFieldPresent(sfIssuerKeyMirrorEpoch);
304 return this->
sle_->at(sfAuditorKeyMirrorEpoch);
316 return this->
sle_->isFieldPresent(sfAuditorKeyMirrorEpoch);
328 return this->
sle_->at(sfIssuerMirrorEncryptionKey);
340 return this->
sle_->isFieldPresent(sfIssuerMirrorEncryptionKey);
352 return this->
sle_->at(sfHolderEncryptionKey);
364 return this->
sle_->isFieldPresent(sfHolderEncryptionKey);
376 return this->
sle_->at(sfRecoveryKey);
388 return this->
sle_->isFieldPresent(sfRecoveryKey);
427 if (sle->at(sfLedgerEntryType) != ltMPTOKEN)
456 object_[sfMPTokenIssuanceID] = value;
478 object_[sfLockedAmount] = value;
500 object_[sfPreviousTxnID] = value;
511 object_[sfPreviousTxnLgrSeq] = value;
522 object_[sfConfidentialBalanceInbox] = value;
533 object_[sfConfidentialBalanceSpending] = value;
544 object_[sfConfidentialBalanceVersion] = value;
555 object_[sfIssuerEncryptedBalance] = value;
566 object_[sfAuditorEncryptedBalance] = value;
577 object_[sfIssuerKeyMirrorEpoch] = value;
588 object_[sfAuditorKeyMirrorEpoch] = value;
599 object_[sfIssuerMirrorEncryptionKey] = value;
610 object_[sfHolderEncryptionKey] = value;
621 object_[sfRecoveryKey] = value;
std::shared_ptr< STLedgerEntry const > const_pointer
LedgerEntryBase(SLE::const_pointer sle)
Construct a ledger entry wrapper from an existing SLE object.
SLE::const_pointer sle_
The underlying serialized ledger entry being wrapped.
LedgerEntryBuilderBase()=default
Builder for MPToken ledger entries.
MPTokenBuilder(SLE::const_pointer sle)
Construct a MPTokenBuilder from an existing SLE object.
MPTokenBuilder & setConfidentialBalanceSpending(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfConfidentialBalanceSpending (SoeOptional).
MPTokenBuilder & setRecoveryKey(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfRecoveryKey (SoeOptional).
MPTokenBuilder & setIssuerMirrorEncryptionKey(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfIssuerMirrorEncryptionKey (SoeOptional).
MPTokenBuilder & setAuditorKeyMirrorEpoch(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfAuditorKeyMirrorEpoch (SoeOptional).
MPTokenBuilder & setPreviousTxnID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfPreviousTxnID (SoeRequired).
MPTokenBuilder & setAccount(std::decay_t< typename SF_ACCOUNT::type::value_type > const &value)
Ledger entry-specific field setters.
MPTokenBuilder & setPreviousTxnLgrSeq(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfPreviousTxnLgrSeq (SoeRequired).
MPTokenBuilder & setOwnerNode(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfOwnerNode (SoeRequired).
MPTokenBuilder & setMPTokenIssuanceID(std::decay_t< typename SF_UINT192::type::value_type > const &value)
Set sfMPTokenIssuanceID (SoeRequired).
MPTokenBuilder & setIssuerEncryptedBalance(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfIssuerEncryptedBalance (SoeOptional).
MPTokenBuilder & setIssuerKeyMirrorEpoch(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfIssuerKeyMirrorEpoch (SoeOptional).
MPTokenBuilder & setLockedAmount(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfLockedAmount (SoeOptional).
MPTokenBuilder & setConfidentialBalanceInbox(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfConfidentialBalanceInbox (SoeOptional).
MPTokenBuilder & setHolderEncryptionKey(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfHolderEncryptionKey (SoeOptional).
MPTokenBuilder(std::decay_t< typename SF_ACCOUNT::type::value_type > const &account, std::decay_t< typename SF_UINT192::type::value_type > const &mPTokenIssuanceID, std::decay_t< typename SF_UINT64::type::value_type > const &ownerNode, std::decay_t< typename SF_UINT256::type::value_type > const &previousTxnID, std::decay_t< typename SF_UINT32::type::value_type > const &previousTxnLgrSeq)
Construct a new MPTokenBuilder with required fields.
MPTokenBuilder & setMPTAmount(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfMPTAmount (SoeDefault).
MPTokenBuilder & setAuditorEncryptedBalance(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfAuditorEncryptedBalance (SoeOptional).
MPToken build(UInt256 const &index)
Build and return the completed MPToken wrapper.
MPTokenBuilder & setConfidentialBalanceVersion(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfConfidentialBalanceVersion (SoeDefault).
bool hasIssuerMirrorEncryptionKey() const
Check if sfIssuerMirrorEncryptionKey is present.
SF_UINT256::type::value_type getPreviousTxnID() const
Get sfPreviousTxnID (SoeRequired).
MPToken(SLE::const_pointer sle)
Construct a MPToken ledger entry wrapper from an existing SLE object.
bool hasHolderEncryptionKey() const
Check if sfHolderEncryptionKey is present.
protocol_autogen::Optional< SF_VL::type::value_type > getHolderEncryptionKey() const
Get sfHolderEncryptionKey (SoeOptional).
bool hasAuditorKeyMirrorEpoch() const
Check if sfAuditorKeyMirrorEpoch is present.
SF_UINT192::type::value_type getMPTokenIssuanceID() const
Get sfMPTokenIssuanceID (SoeRequired).
SF_ACCOUNT::type::value_type getAccount() const
Get sfAccount (SoeRequired).
static constexpr LedgerEntryType entryType
protocol_autogen::Optional< SF_VL::type::value_type > getIssuerMirrorEncryptionKey() const
Get sfIssuerMirrorEncryptionKey (SoeOptional).
protocol_autogen::Optional< SF_VL::type::value_type > getRecoveryKey() const
Get sfRecoveryKey (SoeOptional).
bool hasRecoveryKey() const
Check if sfRecoveryKey is present.
protocol_autogen::Optional< SF_UINT64::type::value_type > getMPTAmount() const
Get sfMPTAmount (SoeDefault).
protocol_autogen::Optional< SF_VL::type::value_type > getAuditorEncryptedBalance() const
Get sfAuditorEncryptedBalance (SoeOptional).
protocol_autogen::Optional< SF_UINT32::type::value_type > getIssuerKeyMirrorEpoch() const
Get sfIssuerKeyMirrorEpoch (SoeOptional).
bool hasMPTAmount() const
Check if sfMPTAmount is present.
SF_UINT32::type::value_type getPreviousTxnLgrSeq() const
Get sfPreviousTxnLgrSeq (SoeRequired).
bool hasConfidentialBalanceInbox() const
Check if sfConfidentialBalanceInbox is present.
SF_UINT64::type::value_type getOwnerNode() const
Get sfOwnerNode (SoeRequired).
bool hasConfidentialBalanceVersion() const
Check if sfConfidentialBalanceVersion is present.
bool hasConfidentialBalanceSpending() const
Check if sfConfidentialBalanceSpending is present.
bool hasLockedAmount() const
Check if sfLockedAmount is present.
protocol_autogen::Optional< SF_VL::type::value_type > getIssuerEncryptedBalance() const
Get sfIssuerEncryptedBalance (SoeOptional).
bool hasIssuerKeyMirrorEpoch() const
Check if sfIssuerKeyMirrorEpoch is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getAuditorKeyMirrorEpoch() const
Get sfAuditorKeyMirrorEpoch (SoeOptional).
bool hasIssuerEncryptedBalance() const
Check if sfIssuerEncryptedBalance is present.
protocol_autogen::Optional< SF_VL::type::value_type > getConfidentialBalanceInbox() const
Get sfConfidentialBalanceInbox (SoeOptional).
protocol_autogen::Optional< SF_VL::type::value_type > getConfidentialBalanceSpending() const
Get sfConfidentialBalanceSpending (SoeOptional).
bool hasAuditorEncryptedBalance() const
Check if sfAuditorEncryptedBalance is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getConfidentialBalanceVersion() const
Get sfConfidentialBalanceVersion (SoeDefault).
protocol_autogen::Optional< SF_UINT64::type::value_type > getLockedAmount() const
Get sfLockedAmount (SoeOptional).
std::conditional_t< std::is_reference_v< ValueType >, std::optional< std::reference_wrapper< std::remove_reference_t< ValueType > > >, std::optional< ValueType > > Optional
LedgerEntryType
Identifiers for on-ledger objects.