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 (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
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 {
363 return this->sle_->at(sfConfidentialOutstandingAmount);
364 return std::nullopt;
365 }
366
371 [[nodiscard]]
372 bool
374 {
375 return this->sle_->isFieldPresent(sfConfidentialOutstandingAmount);
376 }
377};
378
386class MPTokenIssuanceBuilder : public LedgerEntryBuilderBase<MPTokenIssuanceBuilder>
387{
388public:
408
415 {
416 if (sle->at(sfLedgerEntryType) != ltMPTOKEN_ISSUANCE)
417 {
418 throw std::runtime_error("Invalid ledger entry type for MPTokenIssuance");
419 }
420 object_ = *sle;
421 }
422
424
431 {
432 object_[sfIssuer] = value;
433 return *this;
434 }
435
442 {
443 object_[sfSequence] = value;
444 return *this;
445 }
446
453 {
454 object_[sfTransferFee] = value;
455 return *this;
456 }
457
464 {
465 object_[sfOwnerNode] = value;
466 return *this;
467 }
468
475 {
476 object_[sfAssetScale] = value;
477 return *this;
478 }
479
486 {
487 object_[sfMaximumAmount] = value;
488 return *this;
489 }
490
497 {
498 object_[sfOutstandingAmount] = value;
499 return *this;
500 }
501
508 {
509 object_[sfLockedAmount] = value;
510 return *this;
511 }
512
519 {
520 object_[sfMPTokenMetadata] = value;
521 return *this;
522 }
523
530 {
531 object_[sfPreviousTxnID] = value;
532 return *this;
533 }
534
541 {
542 object_[sfPreviousTxnLgrSeq] = value;
543 return *this;
544 }
545
552 {
553 object_[sfDomainID] = value;
554 return *this;
555 }
556
563 {
564 object_[sfMutableFlags] = value;
565 return *this;
566 }
567
574 {
575 object_[sfReferenceHolding] = value;
576 return *this;
577 }
578
585 {
586 object_[sfIssuerEncryptionKey] = value;
587 return *this;
588 }
589
596 {
597 object_[sfAuditorEncryptionKey] = value;
598 return *this;
599 }
600
607 {
608 object_[sfConfidentialOutstandingAmount] = value;
609 return *this;
610 }
611
618 build(uint256 const& index)
619 {
620 return MPTokenIssuance{std::make_shared<SLE>(std::move(object_), index)};
621 }
622};
623
624} // 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 & 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 & setReferenceHolding(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfReferenceHolding (SoeOptional).
MPTokenIssuanceBuilder(SLE::const_pointer sle)
Construct a MPTokenIssuanceBuilder from an existing SLE object.
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 & setSequence(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfSequence (SoeRequired).
Ledger Entry: MPTokenIssuance.
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).
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).
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).
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).
protocol_autogen::Optional< SF_UINT32::type::value_type > getMutableFlags() const
Get sfMutableFlags (SoeDefault).
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).
SF_UINT32::type::value_type getPreviousTxnLgrSeq() const
Get sfPreviousTxnLgrSeq (SoeRequired).
bool hasMutableFlags() const
Check if sfMutableFlags is present.
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
LedgerEntryType
Identifiers for on-ledger objects.
BaseUInt< 256 > uint256
Definition base_uint.h:562