xrpld
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
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 (hasImmutableFlags())
267 return this->sle_->at(sfImmutableFlags);
268 return std::nullopt;
269 }
270
275 [[nodiscard]]
276 bool
278 {
279 return this->sle_->isFieldPresent(sfImmutableFlags);
280 }
281
286 [[nodiscard]]
289 {
291 return this->sle_->at(sfReferenceHolding);
292 return std::nullopt;
293 }
294
299 [[nodiscard]]
300 bool
302 {
303 return this->sle_->isFieldPresent(sfReferenceHolding);
304 }
305
310 [[nodiscard]]
313 {
315 return this->sle_->at(sfIssuerEncryptionKey);
316 return std::nullopt;
317 }
318
323 [[nodiscard]]
324 bool
326 {
327 return this->sle_->isFieldPresent(sfIssuerEncryptionKey);
328 }
329
334 [[nodiscard]]
337 {
339 return this->sle_->at(sfAuditorEncryptionKey);
340 return std::nullopt;
341 }
342
347 [[nodiscard]]
348 bool
350 {
351 return this->sle_->isFieldPresent(sfAuditorEncryptionKey);
352 }
353
358 [[nodiscard]]
361 {
362 if (hasIssuerKeyEpoch())
363 return this->sle_->at(sfIssuerKeyEpoch);
364 return std::nullopt;
365 }
366
371 [[nodiscard]]
372 bool
374 {
375 return this->sle_->isFieldPresent(sfIssuerKeyEpoch);
376 }
377
382 [[nodiscard]]
385 {
386 if (hasAuditorKeyEpoch())
387 return this->sle_->at(sfAuditorKeyEpoch);
388 return std::nullopt;
389 }
390
395 [[nodiscard]]
396 bool
398 {
399 return this->sle_->isFieldPresent(sfAuditorKeyEpoch);
400 }
401
406 [[nodiscard]]
409 {
411 return this->sle_->at(sfConfidentialOutstandingAmount);
412 return std::nullopt;
413 }
414
419 [[nodiscard]]
420 bool
422 {
423 return this->sle_->isFieldPresent(sfConfidentialOutstandingAmount);
424 }
425};
426
434class MPTokenIssuanceBuilder : public LedgerEntryBuilderBase<MPTokenIssuanceBuilder>
435{
436public:
456
463 {
464 if (sle->at(sfLedgerEntryType) != ltMPTOKEN_ISSUANCE)
465 {
466 throw std::runtime_error("Invalid ledger entry type for MPTokenIssuance");
467 }
468 object_ = *sle;
469 }
470
474
481 {
482 object_[sfIssuer] = value;
483 return *this;
484 }
485
492 {
493 object_[sfSequence] = value;
494 return *this;
495 }
496
503 {
504 object_[sfTransferFee] = value;
505 return *this;
506 }
507
514 {
515 object_[sfOwnerNode] = value;
516 return *this;
517 }
518
525 {
526 object_[sfAssetScale] = value;
527 return *this;
528 }
529
536 {
537 object_[sfMaximumAmount] = value;
538 return *this;
539 }
540
547 {
548 object_[sfOutstandingAmount] = value;
549 return *this;
550 }
551
558 {
559 object_[sfLockedAmount] = value;
560 return *this;
561 }
562
569 {
570 object_[sfMPTokenMetadata] = value;
571 return *this;
572 }
573
580 {
581 object_[sfPreviousTxnID] = value;
582 return *this;
583 }
584
591 {
592 object_[sfPreviousTxnLgrSeq] = value;
593 return *this;
594 }
595
602 {
603 object_[sfDomainID] = value;
604 return *this;
605 }
606
613 {
614 object_[sfImmutableFlags] = value;
615 return *this;
616 }
617
624 {
625 object_[sfReferenceHolding] = value;
626 return *this;
627 }
628
635 {
636 object_[sfIssuerEncryptionKey] = value;
637 return *this;
638 }
639
646 {
647 object_[sfAuditorEncryptionKey] = value;
648 return *this;
649 }
650
657 {
658 object_[sfIssuerKeyEpoch] = value;
659 return *this;
660 }
661
668 {
669 object_[sfAuditorKeyEpoch] = value;
670 return *this;
671 }
672
679 {
680 object_[sfConfidentialOutstandingAmount] = value;
681 return *this;
682 }
683
690 build(UInt256 const& index)
691 {
692 return MPTokenIssuance{std::make_shared<SLE>(std::move(object_), index)};
693 }
694};
695
696} // namespace xrpl::ledger_entries
std::shared_ptr< STLedgerEntry const > const_pointer
LedgerEntryBase(SLE::const_pointer sle)
Construct a ledger entry wrapper from an existing SLE object.
SLE::const_pointer sle_
The underlying serialized ledger entry being wrapped.
Builder for MPTokenIssuance ledger entries.
MPTokenIssuanceBuilder & setImmutableFlags(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfImmutableFlags (SoeDefault).
MPTokenIssuanceBuilder & setIssuerEncryptionKey(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfIssuerEncryptionKey (SoeOptional).
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 & setAuditorEncryptionKey(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfAuditorEncryptionKey (SoeOptional).
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 & setConfidentialOutstandingAmount(std::decay_t< typename SF_UINT64::type::value_type > const &value)
Set sfConfidentialOutstandingAmount (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 & setIssuerKeyEpoch(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfIssuerKeyEpoch (SoeOptional).
MPTokenIssuanceBuilder & setAuditorKeyEpoch(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfAuditorKeyEpoch (SoeOptional).
MPTokenIssuanceBuilder & setReferenceHolding(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfReferenceHolding (SoeOptional).
MPTokenIssuance build(UInt256 const &index)
Build and return the completed MPTokenIssuance wrapper.
MPTokenIssuanceBuilder(SLE::const_pointer sle)
Construct a MPTokenIssuanceBuilder from an existing SLE object.
MPTokenIssuanceBuilder & setPreviousTxnID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfPreviousTxnID (SoeRequired).
MPTokenIssuanceBuilder & setSequence(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfSequence (SoeRequired).
Ledger Entry: MPTokenIssuance.
bool hasIssuerKeyEpoch() const
Check if sfIssuerKeyEpoch is present.
protocol_autogen::Optional< SF_UINT64::type::value_type > getMaximumAmount() const
Get sfMaximumAmount (SoeOptional).
bool hasConfidentialOutstandingAmount() const
Check if sfConfidentialOutstandingAmount is present.
SF_UINT64::type::value_type getOutstandingAmount() const
Get sfOutstandingAmount (SoeRequired).
protocol_autogen::Optional< SF_UINT8::type::value_type > getAssetScale() const
Get sfAssetScale (SoeDefault).
protocol_autogen::Optional< SF_UINT32::type::value_type > getAuditorKeyEpoch() const
Get sfAuditorKeyEpoch (SoeOptional).
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.
bool hasReferenceHolding() const
Check if sfReferenceHolding is present.
SF_ACCOUNT::type::value_type getIssuer() const
Get sfIssuer (SoeRequired).
bool hasImmutableFlags() const
Check if sfImmutableFlags is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getImmutableFlags() const
Get sfImmutableFlags (SoeDefault).
protocol_autogen::Optional< SF_VL::type::value_type > getAuditorEncryptionKey() const
Get sfAuditorEncryptionKey (SoeOptional).
SF_UINT32::type::value_type getSequence() const
Get sfSequence (SoeRequired).
protocol_autogen::Optional< SF_UINT256::type::value_type > getReferenceHolding() const
Get sfReferenceHolding (SoeOptional).
SF_UINT256::type::value_type getPreviousTxnID() const
Get sfPreviousTxnID (SoeRequired).
SF_UINT64::type::value_type getOwnerNode() const
Get sfOwnerNode (SoeRequired).
protocol_autogen::Optional< SF_UINT32::type::value_type > getIssuerKeyEpoch() const
Get sfIssuerKeyEpoch (SoeOptional).
bool hasMPTokenMetadata() const
Check if sfMPTokenMetadata is present.
bool hasMaximumAmount() const
Check if sfMaximumAmount is present.
protocol_autogen::Optional< SF_VL::type::value_type > getIssuerEncryptionKey() const
Get sfIssuerEncryptionKey (SoeOptional).
bool hasLockedAmount() const
Check if sfLockedAmount is present.
protocol_autogen::Optional< SF_UINT64::type::value_type > getConfidentialOutstandingAmount() const
Get sfConfidentialOutstandingAmount (SoeDefault).
MPTokenIssuance(SLE::const_pointer sle)
Construct a MPTokenIssuance ledger entry wrapper from an existing SLE object.
protocol_autogen::Optional< SF_VL::type::value_type > getMPTokenMetadata() const
Get sfMPTokenMetadata (SoeOptional).
bool hasIssuerEncryptionKey() const
Check if sfIssuerEncryptionKey is present.
bool hasAuditorEncryptionKey() const
Check if sfAuditorEncryptionKey is present.
protocol_autogen::Optional< SF_UINT16::type::value_type > getTransferFee() const
Get sfTransferFee (SoeDefault).
bool hasAuditorKeyEpoch() const
Check if sfAuditorKeyEpoch is present.
SF_UINT32::type::value_type getPreviousTxnLgrSeq() const
Get sfPreviousTxnLgrSeq (SoeRequired).
static constexpr LedgerEntryType entryType
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
BaseUInt< 256 > UInt256
Definition base_uint.h:580
LedgerEntryType
Identifiers for on-ledger objects.