xrpld
Loading...
Searching...
No Matches
protocol_autogen/transactions/ConfidentialMPTConvertBack.h
1// This file is auto-generated. Do not edit.
2#pragma once
3
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>
10
11#include <stdexcept>
12#include <optional>
13
14namespace xrpl::transactions {
15
17
30{
31public:
32 static constexpr xrpl::TxType txType = ttCONFIDENTIAL_MPT_CONVERT_BACK;
33
39 : TransactionBase(std::move(tx))
40 {
41 // Verify transaction type
42 if (tx_->getTxnType() != txType)
43 {
44 throw std::runtime_error("Invalid transaction type for ConfidentialMPTConvertBack");
45 }
46 }
47
48 // Transaction-specific field getters
49
54 [[nodiscard]]
55 SF_UINT192::type::value_type
57 {
58 return this->tx_->at(sfMPTokenIssuanceID);
59 }
60
65 [[nodiscard]]
66 SF_UINT64::type::value_type
68 {
69 return this->tx_->at(sfMPTAmount);
70 }
71
76 [[nodiscard]]
77 SF_VL::type::value_type
79 {
80 return this->tx_->at(sfHolderEncryptedAmount);
81 }
82
87 [[nodiscard]]
88 SF_VL::type::value_type
90 {
91 return this->tx_->at(sfIssuerEncryptedAmount);
92 }
93
98 [[nodiscard]]
101 {
103 {
104 return this->tx_->at(sfAuditorEncryptedAmount);
105 }
106 return std::nullopt;
107 }
108
113 [[nodiscard]]
114 bool
116 {
117 return this->tx_->isFieldPresent(sfAuditorEncryptedAmount);
118 }
119
124 [[nodiscard]]
125 SF_UINT256::type::value_type
127 {
128 return this->tx_->at(sfBlindingFactor);
129 }
130
135 [[nodiscard]]
136 SF_VL::type::value_type
138 {
139 return this->tx_->at(sfZKProof);
140 }
141
146 [[nodiscard]]
147 SF_VL::type::value_type
149 {
150 return this->tx_->at(sfBalanceCommitment);
151 }
152};
153
161class ConfidentialMPTConvertBackBuilder : public TransactionBuilderBase<ConfidentialMPTConvertBackBuilder>
162{
163public:
177 ConfidentialMPTConvertBackBuilder(SF_ACCOUNT::type::value_type account,
180)
181 : TransactionBuilderBase<ConfidentialMPTConvertBackBuilder>(ttCONFIDENTIAL_MPT_CONVERT_BACK, account, sequence, fee)
182 {
183 setMPTokenIssuanceID(mPTokenIssuanceID);
184 setMPTAmount(mPTAmount);
185 setHolderEncryptedAmount(holderEncryptedAmount);
186 setIssuerEncryptedAmount(issuerEncryptedAmount);
187 setBlindingFactor(blindingFactor);
188 setZKProof(zKProof);
189 setBalanceCommitment(balanceCommitment);
190 }
191
198 {
199 if (tx->getTxnType() != ttCONFIDENTIAL_MPT_CONVERT_BACK)
200 {
201 throw std::runtime_error("Invalid transaction type for ConfidentialMPTConvertBackBuilder");
202 }
203 object_ = *tx;
204 }
205
207
214 {
215 object_[sfMPTokenIssuanceID] = value;
216 return *this;
217 }
218
225 {
226 object_[sfMPTAmount] = value;
227 return *this;
228 }
229
236 {
237 object_[sfHolderEncryptedAmount] = value;
238 return *this;
239 }
240
247 {
248 object_[sfIssuerEncryptedAmount] = value;
249 return *this;
250 }
251
258 {
259 object_[sfAuditorEncryptedAmount] = value;
260 return *this;
261 }
262
269 {
270 object_[sfBlindingFactor] = value;
271 return *this;
272 }
273
280 {
281 object_[sfZKProof] = value;
282 return *this;
283 }
284
291 {
292 object_[sfBalanceCommitment] = value;
293 return *this;
294 }
295
303 build(PublicKey const& publicKey, SecretKey const& secretKey)
304 {
305 sign(publicKey, secretKey);
307 }
308};
309
310} // namespace xrpl::transactions
A public key.
Definition PublicKey.h:42
A secret key.
Definition SecretKey.h:18
ConfidentialMPTConvertBackBuilder & setHolderEncryptedAmount(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfHolderEncryptedAmount (SoeRequired).
ConfidentialMPTConvertBackBuilder & setBalanceCommitment(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfBalanceCommitment (SoeRequired).
ConfidentialMPTConvertBackBuilder & setMPTokenIssuanceID(std::decay_t< typename SF_UINT192::type::value_type > const &value)
Transaction-specific field setters.
ConfidentialMPTConvertBackBuilder(SF_ACCOUNT::type::value_type account, std::decay_t< typename SF_UINT192::type::value_type > const &mPTokenIssuanceID, std::decay_t< typename SF_UINT64::type::value_type > const &mPTAmount, std::decay_t< typename SF_VL::type::value_type > const &holderEncryptedAmount, std::decay_t< typename SF_VL::type::value_type > const &issuerEncryptedAmount, std::decay_t< typename SF_UINT256::type::value_type > const &blindingFactor, std::decay_t< typename SF_VL::type::value_type > const &zKProof, 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 ConfidentialMPTConvertBackBuilder with required fields.
ConfidentialMPTConvertBackBuilder & setIssuerEncryptedAmount(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfIssuerEncryptedAmount (SoeRequired).
ConfidentialMPTConvertBackBuilder & setMPTAmount(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfMPTAmount (SoeRequired).
ConfidentialMPTConvertBackBuilder & setAuditorEncryptedAmount(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfAuditorEncryptedAmount (SoeOptional).
ConfidentialMPTConvertBackBuilder & setZKProof(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfZKProof (SoeRequired).
ConfidentialMPTConvertBackBuilder(std::shared_ptr< STTx const > tx)
Construct a ConfidentialMPTConvertBackBuilder from an existing STTx object.
ConfidentialMPTConvertBackBuilder & setBlindingFactor(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfBlindingFactor (SoeRequired).
ConfidentialMPTConvertBack build(PublicKey const &publicKey, SecretKey const &secretKey)
Build and return the ConfidentialMPTConvertBack wrapper.
SF_UINT64::type::value_type getMPTAmount() const
Get sfMPTAmount (SoeRequired).
SF_UINT256::type::value_type getBlindingFactor() const
Get sfBlindingFactor (SoeRequired).
SF_VL::type::value_type getIssuerEncryptedAmount() const
Get sfIssuerEncryptedAmount (SoeRequired).
protocol_autogen::Optional< SF_VL::type::value_type > getAuditorEncryptedAmount() const
Get sfAuditorEncryptedAmount (SoeOptional).
bool hasAuditorEncryptedAmount() const
Check if sfAuditorEncryptedAmount is present.
SF_VL::type::value_type getZKProof() const
Get sfZKProof (SoeRequired).
SF_VL::type::value_type getHolderEncryptedAmount() const
Get sfHolderEncryptedAmount (SoeRequired).
SF_VL::type::value_type getBalanceCommitment() const
Get sfBalanceCommitment (SoeRequired).
ConfidentialMPTConvertBack(std::shared_ptr< STTx const > tx)
Construct a ConfidentialMPTConvertBack transaction wrapper from an existing STTx object.
SF_UINT192::type::value_type getMPTokenIssuanceID() const
Get sfMPTokenIssuanceID (SoeRequired).
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.
ConfidentialMPTConvertBackBuilder & sign(PublicKey const &publicKey, SecretKey const &secretKey)
T make_shared(T... args)
STL namespace.
std::conditional_t< std::is_reference_v< ValueType >, std::optional< std::reference_wrapper< std::remove_reference_t< ValueType > > >, std::optional< ValueType > > Optional
Definition Utils.h:9
TxType
Transaction type identifiers.
Definition TxFormats.h:41