xrpld
Loading...
Searching...
No Matches
protocol_autogen/transactions/MPTokenIssuanceSet.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 = ttMPTOKEN_ISSUANCE_SET;
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 MPTokenIssuanceSet");
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 {
95 if (hasDomainID())
96 {
97 return this->tx_->at(sfDomainID);
98 }
99 return std::nullopt;
100 }
101
106 [[nodiscard]]
107 bool
109 {
110 return this->tx_->isFieldPresent(sfDomainID);
111 }
112
117 [[nodiscard]]
120 {
121 if (hasMPTokenMetadata())
122 {
123 return this->tx_->at(sfMPTokenMetadata);
124 }
125 return std::nullopt;
126 }
127
132 [[nodiscard]]
133 bool
135 {
136 return this->tx_->isFieldPresent(sfMPTokenMetadata);
137 }
138
143 [[nodiscard]]
146 {
147 if (hasTransferFee())
148 {
149 return this->tx_->at(sfTransferFee);
150 }
151 return std::nullopt;
152 }
153
158 [[nodiscard]]
159 bool
161 {
162 return this->tx_->isFieldPresent(sfTransferFee);
163 }
164
169 [[nodiscard]]
172 {
173 if (hasMutableFlags())
174 {
175 return this->tx_->at(sfMutableFlags);
176 }
177 return std::nullopt;
178 }
179
184 [[nodiscard]]
185 bool
187 {
188 return this->tx_->isFieldPresent(sfMutableFlags);
189 }
190
195 [[nodiscard]]
198 {
200 {
201 return this->tx_->at(sfIssuerEncryptionKey);
202 }
203 return std::nullopt;
204 }
205
210 [[nodiscard]]
211 bool
213 {
214 return this->tx_->isFieldPresent(sfIssuerEncryptionKey);
215 }
216
221 [[nodiscard]]
224 {
226 {
227 return this->tx_->at(sfAuditorEncryptionKey);
228 }
229 return std::nullopt;
230 }
231
236 [[nodiscard]]
237 bool
239 {
240 return this->tx_->isFieldPresent(sfAuditorEncryptionKey);
241 }
242};
243
251class MPTokenIssuanceSetBuilder : public TransactionBuilderBase<MPTokenIssuanceSetBuilder>
252{
253public:
261 MPTokenIssuanceSetBuilder(SF_ACCOUNT::type::value_type account,
264)
265 : TransactionBuilderBase<MPTokenIssuanceSetBuilder>(ttMPTOKEN_ISSUANCE_SET, account, sequence, fee)
266 {
267 setMPTokenIssuanceID(mPTokenIssuanceID);
268 }
269
276 {
277 if (tx->getTxnType() != ttMPTOKEN_ISSUANCE_SET)
278 {
279 throw std::runtime_error("Invalid transaction type for MPTokenIssuanceSetBuilder");
280 }
281 object_ = *tx;
282 }
283
285
292 {
293 object_[sfMPTokenIssuanceID] = value;
294 return *this;
295 }
296
303 {
304 object_[sfHolder] = value;
305 return *this;
306 }
307
314 {
315 object_[sfDomainID] = value;
316 return *this;
317 }
318
325 {
326 object_[sfMPTokenMetadata] = value;
327 return *this;
328 }
329
336 {
337 object_[sfTransferFee] = value;
338 return *this;
339 }
340
347 {
348 object_[sfMutableFlags] = value;
349 return *this;
350 }
351
358 {
359 object_[sfIssuerEncryptionKey] = value;
360 return *this;
361 }
362
369 {
370 object_[sfAuditorEncryptionKey] = value;
371 return *this;
372 }
373
381 build(PublicKey const& publicKey, SecretKey const& secretKey)
382 {
383 sign(publicKey, secretKey);
385 }
386};
387
388} // namespace xrpl::transactions
A public key.
Definition PublicKey.h:42
A secret key.
Definition SecretKey.h:18
MPTokenIssuanceSetBuilder & setIssuerEncryptionKey(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfIssuerEncryptionKey (SoeOptional).
MPTokenIssuanceSetBuilder(std::shared_ptr< STTx const > tx)
Construct a MPTokenIssuanceSetBuilder from an existing STTx object.
MPTokenIssuanceSetBuilder & setMPTokenMetadata(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfMPTokenMetadata (SoeOptional).
MPTokenIssuanceSetBuilder & setMutableFlags(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfMutableFlags (SoeOptional).
MPTokenIssuanceSetBuilder & setAuditorEncryptionKey(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfAuditorEncryptionKey (SoeOptional).
MPTokenIssuanceSetBuilder & setHolder(std::decay_t< typename SF_ACCOUNT::type::value_type > const &value)
Set sfHolder (SoeOptional).
MPTokenIssuanceSet build(PublicKey const &publicKey, SecretKey const &secretKey)
Build and return the MPTokenIssuanceSet wrapper.
MPTokenIssuanceSetBuilder & setMPTokenIssuanceID(std::decay_t< typename SF_UINT192::type::value_type > const &value)
Transaction-specific field setters.
MPTokenIssuanceSetBuilder & setTransferFee(std::decay_t< typename SF_UINT16::type::value_type > const &value)
Set sfTransferFee (SoeOptional).
MPTokenIssuanceSetBuilder(SF_ACCOUNT::type::value_type account, std::decay_t< typename SF_UINT192::type::value_type > const &mPTokenIssuanceID, std::optional< SF_UINT32::type::value_type > sequence=std::nullopt, std::optional< SF_AMOUNT::type::value_type > fee=std::nullopt)
Construct a new MPTokenIssuanceSetBuilder with required fields.
MPTokenIssuanceSetBuilder & setDomainID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfDomainID (SoeOptional).
SF_UINT192::type::value_type getMPTokenIssuanceID() const
Get sfMPTokenIssuanceID (SoeRequired).
bool hasAuditorEncryptionKey() const
Check if sfAuditorEncryptionKey is present.
bool hasMPTokenMetadata() const
Check if sfMPTokenMetadata is present.
MPTokenIssuanceSet(std::shared_ptr< STTx const > tx)
Construct a MPTokenIssuanceSet transaction wrapper from an existing STTx object.
protocol_autogen::Optional< SF_ACCOUNT::type::value_type > getHolder() const
Get sfHolder (SoeOptional).
protocol_autogen::Optional< SF_UINT256::type::value_type > getDomainID() const
Get sfDomainID (SoeOptional).
bool hasIssuerEncryptionKey() const
Check if sfIssuerEncryptionKey is present.
protocol_autogen::Optional< SF_VL::type::value_type > getIssuerEncryptionKey() const
Get sfIssuerEncryptionKey (SoeOptional).
protocol_autogen::Optional< SF_UINT32::type::value_type > getMutableFlags() const
Get sfMutableFlags (SoeOptional).
bool hasMutableFlags() const
Check if sfMutableFlags is present.
protocol_autogen::Optional< SF_VL::type::value_type > getMPTokenMetadata() const
Get sfMPTokenMetadata (SoeOptional).
protocol_autogen::Optional< SF_VL::type::value_type > getAuditorEncryptionKey() const
Get sfAuditorEncryptionKey (SoeOptional).
bool hasTransferFee() const
Check if sfTransferFee is present.
protocol_autogen::Optional< SF_UINT16::type::value_type > getTransferFee() const
Get sfTransferFee (SoeOptional).
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.
MPTokenIssuanceSetBuilder & 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