4#include <xrpl/protocol/STTx.h>
5#include <xrpl/protocol/STParsedJSON.h>
6#include <xrpl/protocol/jss.h>
7#include <xrpl/protocol_autogen/TransactionBase.h>
8#include <xrpl/protocol_autogen/TransactionBuilderBase.h>
9#include <xrpl/json/json_value.h>
44 throw std::runtime_error(
"Invalid transaction type for ConfidentialMPTSend");
55 SF_UINT192::type::value_type
58 return this->
tx_->at(sfMPTokenIssuanceID);
66 SF_ACCOUNT::type::value_type
69 return this->
tx_->at(sfDestination);
82 return this->
tx_->at(sfDestinationTag);
95 return this->
tx_->isFieldPresent(sfDestinationTag);
103 SF_VL::type::value_type
106 return this->
tx_->at(sfSenderEncryptedAmount);
114 SF_VL::type::value_type
117 return this->
tx_->at(sfDestinationEncryptedAmount);
125 SF_VL::type::value_type
128 return this->
tx_->at(sfIssuerEncryptedAmount);
141 return this->
tx_->at(sfAuditorEncryptedAmount);
154 return this->
tx_->isFieldPresent(sfAuditorEncryptedAmount);
162 SF_VL::type::value_type
165 return this->
tx_->at(sfZKProof);
173 SF_VL::type::value_type
176 return this->
tx_->at(sfAmountCommitment);
184 SF_VL::type::value_type
187 return this->
tx_->at(sfBalanceCommitment);
200 return this->
tx_->at(sfCredentialIDs);
213 return this->
tx_->isFieldPresent(sfCredentialIDs);
264 if (tx->getTxnType() != ttCONFIDENTIAL_MPT_SEND)
280 object_[sfMPTokenIssuanceID] = value;
291 object_[sfDestination] = value;
302 object_[sfDestinationTag] = value;
313 object_[sfSenderEncryptedAmount] = value;
324 object_[sfDestinationEncryptedAmount] = value;
335 object_[sfIssuerEncryptedAmount] = value;
346 object_[sfAuditorEncryptedAmount] = value;
368 object_[sfAmountCommitment] = value;
379 object_[sfBalanceCommitment] = value;
390 object_[sfCredentialIDs] = value;
403 sign(publicKey, secretKey);
Builder for ConfidentialMPTSend transactions.
ConfidentialMPTSendBuilder & setAmountCommitment(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfAmountCommitment (SoeRequired).
ConfidentialMPTSendBuilder & setDestinationEncryptedAmount(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfDestinationEncryptedAmount (SoeRequired).
ConfidentialMPTSendBuilder & setSenderEncryptedAmount(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfSenderEncryptedAmount (SoeRequired).
ConfidentialMPTSendBuilder & setBalanceCommitment(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfBalanceCommitment (SoeRequired).
ConfidentialMPTSendBuilder & setDestination(std::decay_t< typename SF_ACCOUNT::type::value_type > const &value)
Set sfDestination (SoeRequired).
ConfidentialMPTSendBuilder & setZKProof(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfZKProof (SoeRequired).
ConfidentialMPTSendBuilder & setCredentialIDs(std::decay_t< typename SF_VECTOR256::type::value_type > const &value)
Set sfCredentialIDs (SoeOptional).
ConfidentialMPTSend build(PublicKey const &publicKey, SecretKey const &secretKey)
Build and return the ConfidentialMPTSend wrapper.
ConfidentialMPTSendBuilder & setMPTokenIssuanceID(std::decay_t< typename SF_UINT192::type::value_type > const &value)
Transaction-specific field setters.
ConfidentialMPTSendBuilder & setAuditorEncryptedAmount(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfAuditorEncryptedAmount (SoeOptional).
ConfidentialMPTSendBuilder(std::shared_ptr< STTx const > tx)
Construct a ConfidentialMPTSendBuilder from an existing STTx object.
ConfidentialMPTSendBuilder & setIssuerEncryptedAmount(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfIssuerEncryptedAmount (SoeRequired).
ConfidentialMPTSendBuilder & setDestinationTag(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfDestinationTag (SoeOptional).
ConfidentialMPTSendBuilder(SF_ACCOUNT::type::value_type account, std::decay_t< typename SF_UINT192::type::value_type > const &mPTokenIssuanceID, std::decay_t< typename SF_ACCOUNT::type::value_type > const &destination, std::decay_t< typename SF_VL::type::value_type > const &senderEncryptedAmount, std::decay_t< typename SF_VL::type::value_type > const &destinationEncryptedAmount, std::decay_t< typename SF_VL::type::value_type > const &issuerEncryptedAmount, std::decay_t< typename SF_VL::type::value_type > const &zKProof, std::decay_t< typename SF_VL::type::value_type > const &amountCommitment, std::decay_t< typename SF_VL::type::value_type > const &balanceCommitment, std::optional< SF_UINT32::type::value_type > sequence=std::nullopt, std::optional< SF_AMOUNT::type::value_type > fee=std::nullopt)
Construct a new ConfidentialMPTSendBuilder with required fields.
Transaction: ConfidentialMPTSend.
static constexpr xrpl::TxType txType
SF_VL::type::value_type getIssuerEncryptedAmount() const
Get sfIssuerEncryptedAmount (SoeRequired).
bool hasCredentialIDs() const
Check if sfCredentialIDs is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getDestinationTag() const
Get sfDestinationTag (SoeOptional).
bool hasAuditorEncryptedAmount() const
Check if sfAuditorEncryptedAmount is present.
protocol_autogen::Optional< SF_VL::type::value_type > getAuditorEncryptedAmount() const
Get sfAuditorEncryptedAmount (SoeOptional).
SF_VL::type::value_type getZKProof() const
Get sfZKProof (SoeRequired).
SF_VL::type::value_type getDestinationEncryptedAmount() const
Get sfDestinationEncryptedAmount (SoeRequired).
SF_VL::type::value_type getAmountCommitment() const
Get sfAmountCommitment (SoeRequired).
protocol_autogen::Optional< SF_VECTOR256::type::value_type > getCredentialIDs() const
Get sfCredentialIDs (SoeOptional).
SF_VL::type::value_type getSenderEncryptedAmount() const
Get sfSenderEncryptedAmount (SoeRequired).
SF_VL::type::value_type getBalanceCommitment() const
Get sfBalanceCommitment (SoeRequired).
SF_UINT192::type::value_type getMPTokenIssuanceID() const
Get sfMPTokenIssuanceID (SoeRequired).
SF_ACCOUNT::type::value_type getDestination() const
Get sfDestination (SoeRequired).
ConfidentialMPTSend(std::shared_ptr< STTx const > tx)
Construct a ConfidentialMPTSend transaction wrapper from an existing STTx object.
bool hasDestinationTag() const
Check if sfDestinationTag is present.
std::shared_ptr< STTx const > tx_
The underlying transaction object being wrapped.
TransactionBase(std::shared_ptr< STTx const > tx)
Construct a transaction wrapper from an existing STTx object.
TransactionBuilderBase()=default
ConfidentialMPTSendBuilder & sign(PublicKey const &publicKey, SecretKey const &secretKey)
std::conditional_t< std::is_reference_v< ValueType >, std::optional< std::reference_wrapper< std::remove_reference_t< ValueType > > >, std::optional< ValueType > > Optional
TxType
Transaction type identifiers.