rippled
Loading...
Searching...
No Matches
MPTokenIssuance.h
1// This file is auto-generated. Do not edit.
2#pragma once
3
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>
10
11#include <stdexcept>
12#include <optional>
13
14namespace xrpl::ledger_entries {
15
16class MPTokenIssuanceBuilder;
17
28{
29public:
30 static constexpr LedgerEntryType entryType = ltMPTOKEN_ISSUANCE;
31
37 : LedgerEntryBase(std::move(sle))
38 {
39 // Verify ledger entry type
40 if (sle_->getType() != entryType)
41 {
42 throw std::runtime_error("Invalid ledger entry type for MPTokenIssuance");
43 }
44 }
45
46 // Ledger entry-specific field getters
47
52 [[nodiscard]]
53 SF_ACCOUNT::type::value_type
54 getIssuer() const
55 {
56 return this->sle_->at(sfIssuer);
57 }
58
63 [[nodiscard]]
64 SF_UINT32::type::value_type
66 {
67 return this->sle_->at(sfSequence);
68 }
69
74 [[nodiscard]]
77 {
78 if (hasTransferFee())
79 return this->sle_->at(sfTransferFee);
80 return std::nullopt;
81 }
82
87 [[nodiscard]]
88 bool
90 {
91 return this->sle_->isFieldPresent(sfTransferFee);
92 }
93
98 [[nodiscard]]
99 SF_UINT64::type::value_type
101 {
102 return this->sle_->at(sfOwnerNode);
103 }
104
109 [[nodiscard]]
112 {
113 if (hasAssetScale())
114 return this->sle_->at(sfAssetScale);
115 return std::nullopt;
116 }
117
122 [[nodiscard]]
123 bool
125 {
126 return this->sle_->isFieldPresent(sfAssetScale);
127 }
128
133 [[nodiscard]]
136 {
137 if (hasMaximumAmount())
138 return this->sle_->at(sfMaximumAmount);
139 return std::nullopt;
140 }
141
146 [[nodiscard]]
147 bool
149 {
150 return this->sle_->isFieldPresent(sfMaximumAmount);
151 }
152
157 [[nodiscard]]
158 SF_UINT64::type::value_type
160 {
161 return this->sle_->at(sfOutstandingAmount);
162 }
163
168 [[nodiscard]]
171 {
172 if (hasLockedAmount())
173 return this->sle_->at(sfLockedAmount);
174 return std::nullopt;
175 }
176
181 [[nodiscard]]
182 bool
184 {
185 return this->sle_->isFieldPresent(sfLockedAmount);
186 }
187
192 [[nodiscard]]
195 {
196 if (hasMPTokenMetadata())
197 return this->sle_->at(sfMPTokenMetadata);
198 return std::nullopt;
199 }
200
205 [[nodiscard]]
206 bool
208 {
209 return this->sle_->isFieldPresent(sfMPTokenMetadata);
210 }
211
216 [[nodiscard]]
217 SF_UINT256::type::value_type
219 {
220 return this->sle_->at(sfPreviousTxnID);
221 }
222
227 [[nodiscard]]
228 SF_UINT32::type::value_type
230 {
231 return this->sle_->at(sfPreviousTxnLgrSeq);
232 }
233
238 [[nodiscard]]
241 {
242 if (hasDomainID())
243 return this->sle_->at(sfDomainID);
244 return std::nullopt;
245 }
246
251 [[nodiscard]]
252 bool
254 {
255 return this->sle_->isFieldPresent(sfDomainID);
256 }
257
262 [[nodiscard]]
265 {
266 if (hasMutableFlags())
267 return this->sle_->at(sfMutableFlags);
268 return std::nullopt;
269 }
270
275 [[nodiscard]]
276 bool
278 {
279 return this->sle_->isFieldPresent(sfMutableFlags);
280 }
281};
282
290class MPTokenIssuanceBuilder : public LedgerEntryBuilderBase<MPTokenIssuanceBuilder>
291{
292public:
312
319 {
320 if (sle->at(sfLedgerEntryType) != ltMPTOKEN_ISSUANCE)
321 {
322 throw std::runtime_error("Invalid ledger entry type for MPTokenIssuance");
323 }
324 object_ = *sle;
325 }
326
335 {
336 object_[sfIssuer] = value;
337 return *this;
338 }
339
346 {
347 object_[sfSequence] = value;
348 return *this;
349 }
350
357 {
358 object_[sfTransferFee] = value;
359 return *this;
360 }
361
368 {
369 object_[sfOwnerNode] = value;
370 return *this;
371 }
372
379 {
380 object_[sfAssetScale] = value;
381 return *this;
382 }
383
390 {
391 object_[sfMaximumAmount] = value;
392 return *this;
393 }
394
401 {
402 object_[sfOutstandingAmount] = value;
403 return *this;
404 }
405
412 {
413 object_[sfLockedAmount] = value;
414 return *this;
415 }
416
423 {
424 object_[sfMPTokenMetadata] = value;
425 return *this;
426 }
427
434 {
435 object_[sfPreviousTxnID] = value;
436 return *this;
437 }
438
445 {
446 object_[sfPreviousTxnLgrSeq] = value;
447 return *this;
448 }
449
456 {
457 object_[sfDomainID] = value;
458 return *this;
459 }
460
467 {
468 object_[sfMutableFlags] = value;
469 return *this;
470 }
471
478 build(uint256 const& index)
479 {
480 return MPTokenIssuance{std::make_shared<SLE>(std::move(object_), index)};
481 }
482};
483
484} // namespace xrpl::ledger_entries
Base class for type-safe ledger entry wrappers.
std::shared_ptr< SLE const > sle_
The underlying serialized ledger entry being wrapped.
Base class for all ledger entry builders.
Builder for MPTokenIssuance ledger entries.
MPTokenIssuanceBuilder(std::decay_t< typename SF_ACCOUNT::type::value_type > const &issuer, std::decay_t< typename SF_UINT32::type::value_type > const &sequence, std::decay_t< typename SF_UINT64::type::value_type > const &ownerNode, std::decay_t< typename SF_UINT64::type::value_type > const &outstandingAmount, 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 MPTokenIssuanceBuilder with required fields.
MPTokenIssuanceBuilder & setLockedAmount(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfLockedAmount (soeOPTIONAL)
MPTokenIssuanceBuilder & setMaximumAmount(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfMaximumAmount (soeOPTIONAL)
MPTokenIssuanceBuilder & setPreviousTxnLgrSeq(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfPreviousTxnLgrSeq (soeREQUIRED)
MPTokenIssuanceBuilder & setDomainID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfDomainID (soeOPTIONAL)
MPTokenIssuanceBuilder & setOwnerNode(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfOwnerNode (soeREQUIRED)
MPTokenIssuanceBuilder & setOutstandingAmount(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfOutstandingAmount (soeREQUIRED)
MPTokenIssuanceBuilder & setTransferFee(std::decay_t< typename SF_UINT16::type::value_type > const &value)
Set sfTransferFee (soeDEFAULT)
MPTokenIssuanceBuilder & setIssuer(std::decay_t< typename SF_ACCOUNT::type::value_type > const &value)
Ledger entry-specific field setters.
MPTokenIssuanceBuilder & setMPTokenMetadata(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfMPTokenMetadata (soeOPTIONAL)
MPTokenIssuanceBuilder & setAssetScale(std::decay_t< typename SF_UINT8::type::value_type > const &value)
Set sfAssetScale (soeDEFAULT)
MPTokenIssuanceBuilder & setMutableFlags(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfMutableFlags (soeDEFAULT)
MPTokenIssuanceBuilder & setPreviousTxnID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfPreviousTxnID (soeREQUIRED)
MPTokenIssuance build(uint256 const &index)
Build and return the completed MPTokenIssuance wrapper.
MPTokenIssuanceBuilder(std::shared_ptr< SLE const > sle)
Construct a MPTokenIssuanceBuilder from an existing SLE object.
MPTokenIssuanceBuilder & setSequence(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfSequence (soeREQUIRED)
Ledger Entry: MPTokenIssuance.
MPTokenIssuance(std::shared_ptr< SLE const > sle)
Construct a MPTokenIssuance ledger entry wrapper from an existing SLE object.
protocol_autogen::Optional< SF_UINT64::type::value_type > getMaximumAmount() const
Get sfMaximumAmount (soeOPTIONAL)
SF_UINT64::type::value_type getOutstandingAmount() const
Get sfOutstandingAmount (soeREQUIRED)
protocol_autogen::Optional< SF_UINT8::type::value_type > getAssetScale() const
Get sfAssetScale (soeDEFAULT)
bool hasDomainID() const
Check if sfDomainID is present.
protocol_autogen::Optional< SF_UINT64::type::value_type > getLockedAmount() const
Get sfLockedAmount (soeOPTIONAL)
protocol_autogen::Optional< SF_UINT256::type::value_type > getDomainID() const
Get sfDomainID (soeOPTIONAL)
bool hasAssetScale() const
Check if sfAssetScale is present.
bool hasTransferFee() const
Check if sfTransferFee is present.
SF_ACCOUNT::type::value_type getIssuer() const
Get sfIssuer (soeREQUIRED)
SF_UINT32::type::value_type getSequence() const
Get sfSequence (soeREQUIRED)
SF_UINT256::type::value_type getPreviousTxnID() const
Get sfPreviousTxnID (soeREQUIRED)
SF_UINT64::type::value_type getOwnerNode() const
Get sfOwnerNode (soeREQUIRED)
bool hasMPTokenMetadata() const
Check if sfMPTokenMetadata is present.
bool hasMaximumAmount() const
Check if sfMaximumAmount is present.
bool hasLockedAmount() const
Check if sfLockedAmount is present.
protocol_autogen::Optional< SF_VL::type::value_type > getMPTokenMetadata() const
Get sfMPTokenMetadata (soeOPTIONAL)
protocol_autogen::Optional< SF_UINT32::type::value_type > getMutableFlags() const
Get sfMutableFlags (soeDEFAULT)
protocol_autogen::Optional< SF_UINT16::type::value_type > getTransferFee() const
Get sfTransferFee (soeDEFAULT)
SF_UINT32::type::value_type getPreviousTxnLgrSeq() const
Get sfPreviousTxnLgrSeq (soeREQUIRED)
bool hasMutableFlags() const
Check if sfMutableFlags is present.
static constexpr LedgerEntryType entryType
T is_same_v
STL namespace.
LedgerEntryType
Identifiers for on-ledger objects.