xrpld
Loading...
Searching...
No Matches
protocol_autogen/transactions/ConfidentialMPTMirrorUpdate.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_MIRROR_UPDATE;
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 ConfidentialMPTMirrorUpdate");
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]]
67 getHolder() const
68 {
69 if (hasHolder())
70 {
71 return this->tx_->at(sfHolder);
72 }
73 return std::nullopt;
74 }
75
80 [[nodiscard]]
81 bool
82 hasHolder() const
83 {
84 return this->tx_->isFieldPresent(sfHolder);
85 }
86
91 [[nodiscard]]
94 {
96 {
97 return this->tx_->at(sfIssuerEncryptedAmount);
98 }
99 return std::nullopt;
100 }
101
106 [[nodiscard]]
107 bool
109 {
110 return this->tx_->isFieldPresent(sfIssuerEncryptedAmount);
111 }
112
117 [[nodiscard]]
120 {
122 {
123 return this->tx_->at(sfAuditorEncryptedAmount);
124 }
125 return std::nullopt;
126 }
127
132 [[nodiscard]]
133 bool
135 {
136 return this->tx_->isFieldPresent(sfAuditorEncryptedAmount);
137 }
138
143 [[nodiscard]]
144 SF_VL::type::value_type
146 {
147 return this->tx_->at(sfZKProof);
148 }
149};
150
158class ConfidentialMPTMirrorUpdateBuilder : public TransactionBuilderBase<ConfidentialMPTMirrorUpdateBuilder>
159{
160public:
169 ConfidentialMPTMirrorUpdateBuilder(SF_ACCOUNT::type::value_type account,
172)
173 : TransactionBuilderBase<ConfidentialMPTMirrorUpdateBuilder>(ttCONFIDENTIAL_MPT_MIRROR_UPDATE, account, sequence, fee)
174 {
175 setMPTokenIssuanceID(mPTokenIssuanceID);
176 setZKProof(zKProof);
177 }
178
185 {
186 if (tx->getTxnType() != ttCONFIDENTIAL_MPT_MIRROR_UPDATE)
187 {
188 throw std::runtime_error("Invalid transaction type for ConfidentialMPTMirrorUpdateBuilder");
189 }
190 object_ = *tx;
191 }
192
196
203 {
204 object_[sfMPTokenIssuanceID] = value;
205 return *this;
206 }
207
214 {
215 object_[sfHolder] = value;
216 return *this;
217 }
218
225 {
226 object_[sfIssuerEncryptedAmount] = value;
227 return *this;
228 }
229
236 {
237 object_[sfAuditorEncryptedAmount] = value;
238 return *this;
239 }
240
247 {
248 object_[sfZKProof] = value;
249 return *this;
250 }
251
259 build(PublicKey const& publicKey, SecretKey const& secretKey)
260 {
261 sign(publicKey, secretKey);
263 }
264};
265
266} // namespace xrpl::transactions
A public key.
Definition PublicKey.h:53
A secret key.
Definition SecretKey.h:24
ConfidentialMPTMirrorUpdate build(PublicKey const &publicKey, SecretKey const &secretKey)
Build and return the ConfidentialMPTMirrorUpdate wrapper.
ConfidentialMPTMirrorUpdateBuilder(SF_ACCOUNT::type::value_type account, std::decay_t< typename SF_UINT192::type::value_type > const &mPTokenIssuanceID, std::decay_t< typename SF_VL::type::value_type > const &zKProof, std::optional< SF_UINT32::type::value_type > sequence=std::nullopt, std::optional< SF_AMOUNT::type::value_type > fee=std::nullopt)
Construct a new ConfidentialMPTMirrorUpdateBuilder with required fields.
ConfidentialMPTMirrorUpdateBuilder & setAuditorEncryptedAmount(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfAuditorEncryptedAmount (SoeOptional).
ConfidentialMPTMirrorUpdateBuilder & setMPTokenIssuanceID(std::decay_t< typename SF_UINT192::type::value_type > const &value)
Transaction-specific field setters.
ConfidentialMPTMirrorUpdateBuilder & setZKProof(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfZKProof (SoeRequired).
ConfidentialMPTMirrorUpdateBuilder & setIssuerEncryptedAmount(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfIssuerEncryptedAmount (SoeOptional).
ConfidentialMPTMirrorUpdateBuilder(std::shared_ptr< STTx const > tx)
Construct a ConfidentialMPTMirrorUpdateBuilder from an existing STTx object.
ConfidentialMPTMirrorUpdateBuilder & setHolder(std::decay_t< typename SF_ACCOUNT::type::value_type > const &value)
Set sfHolder (SoeOptional).
bool hasIssuerEncryptedAmount() const
Check if sfIssuerEncryptedAmount is present.
protocol_autogen::Optional< SF_VL::type::value_type > getAuditorEncryptedAmount() const
Get sfAuditorEncryptedAmount (SoeOptional).
ConfidentialMPTMirrorUpdate(std::shared_ptr< STTx const > tx)
Construct a ConfidentialMPTMirrorUpdate transaction wrapper from an existing STTx object.
protocol_autogen::Optional< SF_ACCOUNT::type::value_type > getHolder() const
Get sfHolder (SoeOptional).
protocol_autogen::Optional< SF_VL::type::value_type > getIssuerEncryptedAmount() const
Get sfIssuerEncryptedAmount (SoeOptional).
bool hasAuditorEncryptedAmount() const
Check if sfAuditorEncryptedAmount is present.
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.
ConfidentialMPTMirrorUpdateBuilder & 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:45