rippled
Loading...
Searching...
No Matches
AccountRoot.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
15
17
28{
29public:
30 static constexpr LedgerEntryType entryType = ltACCOUNT_ROOT;
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 AccountRoot");
43 }
44 }
45
46 // Ledger entry-specific field getters
47
52 [[nodiscard]]
53 SF_ACCOUNT::type::value_type
54 getAccount() const
55 {
56 return this->sle_->at(sfAccount);
57 }
58
63 [[nodiscard]]
64 SF_UINT32::type::value_type
66 {
67 return this->sle_->at(sfSequence);
68 }
69
74 [[nodiscard]]
75 SF_AMOUNT::type::value_type
76 getBalance() const
77 {
78 return this->sle_->at(sfBalance);
79 }
80
85 [[nodiscard]]
86 SF_UINT32::type::value_type
88 {
89 return this->sle_->at(sfOwnerCount);
90 }
91
96 [[nodiscard]]
97 SF_UINT256::type::value_type
99 {
100 return this->sle_->at(sfPreviousTxnID);
101 }
102
107 [[nodiscard]]
108 SF_UINT32::type::value_type
110 {
111 return this->sle_->at(sfPreviousTxnLgrSeq);
112 }
113
118 [[nodiscard]]
121 {
122 if (hasAccountTxnID())
123 return this->sle_->at(sfAccountTxnID);
124 return std::nullopt;
125 }
126
131 [[nodiscard]]
132 bool
134 {
135 return this->sle_->isFieldPresent(sfAccountTxnID);
136 }
137
142 [[nodiscard]]
145 {
146 if (hasRegularKey())
147 return this->sle_->at(sfRegularKey);
148 return std::nullopt;
149 }
150
155 [[nodiscard]]
156 bool
158 {
159 return this->sle_->isFieldPresent(sfRegularKey);
160 }
161
166 [[nodiscard]]
169 {
170 if (hasEmailHash())
171 return this->sle_->at(sfEmailHash);
172 return std::nullopt;
173 }
174
179 [[nodiscard]]
180 bool
182 {
183 return this->sle_->isFieldPresent(sfEmailHash);
184 }
185
190 [[nodiscard]]
193 {
194 if (hasWalletLocator())
195 return this->sle_->at(sfWalletLocator);
196 return std::nullopt;
197 }
198
203 [[nodiscard]]
204 bool
206 {
207 return this->sle_->isFieldPresent(sfWalletLocator);
208 }
209
214 [[nodiscard]]
217 {
218 if (hasWalletSize())
219 return this->sle_->at(sfWalletSize);
220 return std::nullopt;
221 }
222
227 [[nodiscard]]
228 bool
230 {
231 return this->sle_->isFieldPresent(sfWalletSize);
232 }
233
238 [[nodiscard]]
241 {
242 if (hasMessageKey())
243 return this->sle_->at(sfMessageKey);
244 return std::nullopt;
245 }
246
251 [[nodiscard]]
252 bool
254 {
255 return this->sle_->isFieldPresent(sfMessageKey);
256 }
257
262 [[nodiscard]]
265 {
266 if (hasTransferRate())
267 return this->sle_->at(sfTransferRate);
268 return std::nullopt;
269 }
270
275 [[nodiscard]]
276 bool
278 {
279 return this->sle_->isFieldPresent(sfTransferRate);
280 }
281
286 [[nodiscard]]
288 getDomain() const
289 {
290 if (hasDomain())
291 return this->sle_->at(sfDomain);
292 return std::nullopt;
293 }
294
299 [[nodiscard]]
300 bool
301 hasDomain() const
302 {
303 return this->sle_->isFieldPresent(sfDomain);
304 }
305
310 [[nodiscard]]
313 {
314 if (hasTickSize())
315 return this->sle_->at(sfTickSize);
316 return std::nullopt;
317 }
318
323 [[nodiscard]]
324 bool
326 {
327 return this->sle_->isFieldPresent(sfTickSize);
328 }
329
334 [[nodiscard]]
337 {
338 if (hasTicketCount())
339 return this->sle_->at(sfTicketCount);
340 return std::nullopt;
341 }
342
347 [[nodiscard]]
348 bool
350 {
351 return this->sle_->isFieldPresent(sfTicketCount);
352 }
353
358 [[nodiscard]]
361 {
362 if (hasNFTokenMinter())
363 return this->sle_->at(sfNFTokenMinter);
364 return std::nullopt;
365 }
366
371 [[nodiscard]]
372 bool
374 {
375 return this->sle_->isFieldPresent(sfNFTokenMinter);
376 }
377
382 [[nodiscard]]
385 {
386 if (hasMintedNFTokens())
387 return this->sle_->at(sfMintedNFTokens);
388 return std::nullopt;
389 }
390
395 [[nodiscard]]
396 bool
398 {
399 return this->sle_->isFieldPresent(sfMintedNFTokens);
400 }
401
406 [[nodiscard]]
409 {
410 if (hasBurnedNFTokens())
411 return this->sle_->at(sfBurnedNFTokens);
412 return std::nullopt;
413 }
414
419 [[nodiscard]]
420 bool
422 {
423 return this->sle_->isFieldPresent(sfBurnedNFTokens);
424 }
425
430 [[nodiscard]]
433 {
435 return this->sle_->at(sfFirstNFTokenSequence);
436 return std::nullopt;
437 }
438
443 [[nodiscard]]
444 bool
446 {
447 return this->sle_->isFieldPresent(sfFirstNFTokenSequence);
448 }
449
454 [[nodiscard]]
456 getAMMID() const
457 {
458 if (hasAMMID())
459 return this->sle_->at(sfAMMID);
460 return std::nullopt;
461 }
462
467 [[nodiscard]]
468 bool
469 hasAMMID() const
470 {
471 return this->sle_->isFieldPresent(sfAMMID);
472 }
473
478 [[nodiscard]]
481 {
482 if (hasVaultID())
483 return this->sle_->at(sfVaultID);
484 return std::nullopt;
485 }
486
491 [[nodiscard]]
492 bool
494 {
495 return this->sle_->isFieldPresent(sfVaultID);
496 }
497
502 [[nodiscard]]
505 {
506 if (hasLoanBrokerID())
507 return this->sle_->at(sfLoanBrokerID);
508 return std::nullopt;
509 }
510
515 [[nodiscard]]
516 bool
518 {
519 return this->sle_->isFieldPresent(sfLoanBrokerID);
520 }
521};
522
530class AccountRootBuilder : public LedgerEntryBuilderBase<AccountRootBuilder>
531{
532public:
552
559 {
560 if (sle->at(sfLedgerEntryType) != ltACCOUNT_ROOT)
561 {
562 throw std::runtime_error("Invalid ledger entry type for AccountRoot");
563 }
564 object_ = *sle;
565 }
566
575 {
576 object_[sfAccount] = value;
577 return *this;
578 }
579
586 {
587 object_[sfSequence] = value;
588 return *this;
589 }
590
597 {
598 object_[sfBalance] = value;
599 return *this;
600 }
601
608 {
609 object_[sfOwnerCount] = value;
610 return *this;
611 }
612
619 {
620 object_[sfPreviousTxnID] = value;
621 return *this;
622 }
623
630 {
631 object_[sfPreviousTxnLgrSeq] = value;
632 return *this;
633 }
634
641 {
642 object_[sfAccountTxnID] = value;
643 return *this;
644 }
645
652 {
653 object_[sfRegularKey] = value;
654 return *this;
655 }
656
663 {
664 object_[sfEmailHash] = value;
665 return *this;
666 }
667
674 {
675 object_[sfWalletLocator] = value;
676 return *this;
677 }
678
685 {
686 object_[sfWalletSize] = value;
687 return *this;
688 }
689
696 {
697 object_[sfMessageKey] = value;
698 return *this;
699 }
700
707 {
708 object_[sfTransferRate] = value;
709 return *this;
710 }
711
718 {
719 object_[sfDomain] = value;
720 return *this;
721 }
722
729 {
730 object_[sfTickSize] = value;
731 return *this;
732 }
733
740 {
741 object_[sfTicketCount] = value;
742 return *this;
743 }
744
751 {
752 object_[sfNFTokenMinter] = value;
753 return *this;
754 }
755
762 {
763 object_[sfMintedNFTokens] = value;
764 return *this;
765 }
766
773 {
774 object_[sfBurnedNFTokens] = value;
775 return *this;
776 }
777
784 {
785 object_[sfFirstNFTokenSequence] = value;
786 return *this;
787 }
788
795 {
796 object_[sfAMMID] = value;
797 return *this;
798 }
799
806 {
807 object_[sfVaultID] = value;
808 return *this;
809 }
810
817 {
818 object_[sfLoanBrokerID] = value;
819 return *this;
820 }
821
828 build(uint256 const& index)
829 {
830 return AccountRoot{std::make_shared<SLE>(std::move(object_), index)};
831 }
832};
833
834} // namespace xrpl::ledger_entries
Builder for AccountRoot ledger entries.
AccountRootBuilder & setMintedNFTokens(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfMintedNFTokens (soeDEFAULT)
AccountRootBuilder & setAccountTxnID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfAccountTxnID (soeOPTIONAL)
AccountRootBuilder & setNFTokenMinter(std::decay_t< typename SF_ACCOUNT::type::value_type > const &value)
Set sfNFTokenMinter (soeOPTIONAL)
AccountRootBuilder & setMessageKey(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfMessageKey (soeOPTIONAL)
AccountRootBuilder & setTickSize(std::decay_t< typename SF_UINT8::type::value_type > const &value)
Set sfTickSize (soeOPTIONAL)
AccountRootBuilder & setBurnedNFTokens(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfBurnedNFTokens (soeDEFAULT)
AccountRootBuilder(std::shared_ptr< SLE const > sle)
Construct a AccountRootBuilder from an existing SLE object.
AccountRootBuilder & setTransferRate(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfTransferRate (soeOPTIONAL)
AccountRootBuilder & setAccount(std::decay_t< typename SF_ACCOUNT::type::value_type > const &value)
Ledger entry-specific field setters.
AccountRootBuilder & setFirstNFTokenSequence(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfFirstNFTokenSequence (soeOPTIONAL)
AccountRootBuilder & setRegularKey(std::decay_t< typename SF_ACCOUNT::type::value_type > const &value)
Set sfRegularKey (soeOPTIONAL)
AccountRootBuilder & setPreviousTxnID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfPreviousTxnID (soeREQUIRED)
AccountRootBuilder & setWalletSize(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfWalletSize (soeOPTIONAL)
AccountRootBuilder & setAMMID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfAMMID (soeOPTIONAL)
AccountRoot build(uint256 const &index)
Build and return the completed AccountRoot wrapper.
AccountRootBuilder & setLoanBrokerID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfLoanBrokerID (soeOPTIONAL)
AccountRootBuilder & setSequence(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfSequence (soeREQUIRED)
AccountRootBuilder(std::decay_t< typename SF_ACCOUNT::type::value_type > const &account, std::decay_t< typename SF_UINT32::type::value_type > const &sequence, std::decay_t< typename SF_AMOUNT::type::value_type > const &balance, std::decay_t< typename SF_UINT32::type::value_type > const &ownerCount, 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 AccountRootBuilder with required fields.
AccountRootBuilder & setEmailHash(std::decay_t< typename SF_UINT128::type::value_type > const &value)
Set sfEmailHash (soeOPTIONAL)
AccountRootBuilder & setTicketCount(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfTicketCount (soeOPTIONAL)
AccountRootBuilder & setPreviousTxnLgrSeq(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfPreviousTxnLgrSeq (soeREQUIRED)
AccountRootBuilder & setDomain(std::decay_t< typename SF_VL::type::value_type > const &value)
Set sfDomain (soeOPTIONAL)
AccountRootBuilder & setVaultID(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfVaultID (soeOPTIONAL)
AccountRootBuilder & setBalance(std::decay_t< typename SF_AMOUNT::type::value_type > const &value)
Set sfBalance (soeREQUIRED)
AccountRootBuilder & setWalletLocator(std::decay_t< typename SF_UINT256::type::value_type > const &value)
Set sfWalletLocator (soeOPTIONAL)
AccountRootBuilder & setOwnerCount(std::decay_t< typename SF_UINT32::type::value_type > const &value)
Set sfOwnerCount (soeREQUIRED)
Ledger Entry: AccountRoot.
Definition AccountRoot.h:28
bool hasAMMID() const
Check if sfAMMID is present.
SF_AMOUNT::type::value_type getBalance() const
Get sfBalance (soeREQUIRED)
Definition AccountRoot.h:76
protocol_autogen::Optional< SF_ACCOUNT::type::value_type > getRegularKey() const
Get sfRegularKey (soeOPTIONAL)
protocol_autogen::Optional< SF_ACCOUNT::type::value_type > getNFTokenMinter() const
Get sfNFTokenMinter (soeOPTIONAL)
bool hasTickSize() const
Check if sfTickSize is present.
protocol_autogen::Optional< SF_UINT256::type::value_type > getAccountTxnID() const
Get sfAccountTxnID (soeOPTIONAL)
SF_UINT32::type::value_type getSequence() const
Get sfSequence (soeREQUIRED)
Definition AccountRoot.h:65
bool hasBurnedNFTokens() const
Check if sfBurnedNFTokens is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getWalletSize() const
Get sfWalletSize (soeOPTIONAL)
SF_UINT256::type::value_type getPreviousTxnID() const
Get sfPreviousTxnID (soeREQUIRED)
Definition AccountRoot.h:98
protocol_autogen::Optional< SF_UINT8::type::value_type > getTickSize() const
Get sfTickSize (soeOPTIONAL)
protocol_autogen::Optional< SF_VL::type::value_type > getDomain() const
Get sfDomain (soeOPTIONAL)
bool hasWalletLocator() const
Check if sfWalletLocator is present.
bool hasMintedNFTokens() const
Check if sfMintedNFTokens is present.
static constexpr LedgerEntryType entryType
Definition AccountRoot.h:30
protocol_autogen::Optional< SF_UINT256::type::value_type > getAMMID() const
Get sfAMMID (soeOPTIONAL)
bool hasAccountTxnID() const
Check if sfAccountTxnID is present.
bool hasTicketCount() const
Check if sfTicketCount is present.
bool hasDomain() const
Check if sfDomain is present.
bool hasEmailHash() const
Check if sfEmailHash is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getTicketCount() const
Get sfTicketCount (soeOPTIONAL)
protocol_autogen::Optional< SF_UINT32::type::value_type > getBurnedNFTokens() const
Get sfBurnedNFTokens (soeDEFAULT)
SF_ACCOUNT::type::value_type getAccount() const
Get sfAccount (soeREQUIRED)
Definition AccountRoot.h:54
SF_UINT32::type::value_type getPreviousTxnLgrSeq() const
Get sfPreviousTxnLgrSeq (soeREQUIRED)
protocol_autogen::Optional< SF_UINT32::type::value_type > getFirstNFTokenSequence() const
Get sfFirstNFTokenSequence (soeOPTIONAL)
bool hasWalletSize() const
Check if sfWalletSize is present.
protocol_autogen::Optional< SF_UINT256::type::value_type > getLoanBrokerID() const
Get sfLoanBrokerID (soeOPTIONAL)
bool hasRegularKey() const
Check if sfRegularKey is present.
bool hasLoanBrokerID() const
Check if sfLoanBrokerID is present.
protocol_autogen::Optional< SF_UINT256::type::value_type > getVaultID() const
Get sfVaultID (soeOPTIONAL)
protocol_autogen::Optional< SF_UINT32::type::value_type > getTransferRate() const
Get sfTransferRate (soeOPTIONAL)
bool hasFirstNFTokenSequence() const
Check if sfFirstNFTokenSequence is present.
AccountRoot(std::shared_ptr< SLE const > sle)
Construct a AccountRoot ledger entry wrapper from an existing SLE object.
Definition AccountRoot.h:36
bool hasMessageKey() const
Check if sfMessageKey is present.
bool hasTransferRate() const
Check if sfTransferRate is present.
protocol_autogen::Optional< SF_UINT128::type::value_type > getEmailHash() const
Get sfEmailHash (soeOPTIONAL)
bool hasNFTokenMinter() const
Check if sfNFTokenMinter is present.
SF_UINT32::type::value_type getOwnerCount() const
Get sfOwnerCount (soeREQUIRED)
Definition AccountRoot.h:87
protocol_autogen::Optional< SF_VL::type::value_type > getMessageKey() const
Get sfMessageKey (soeOPTIONAL)
bool hasVaultID() const
Check if sfVaultID is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getMintedNFTokens() const
Get sfMintedNFTokens (soeDEFAULT)
protocol_autogen::Optional< SF_UINT256::type::value_type > getWalletLocator() const
Get sfWalletLocator (soeOPTIONAL)
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.
T is_same_v
STL namespace.
LedgerEntryType
Identifiers for on-ledger objects.