3#include <xrpl/protocol/SField.h>
4#include <xrpl/protocol/STAccount.h>
5#include <xrpl/protocol/STArray.h>
6#include <xrpl/protocol/STObject.h>
7#include <xrpl/protocol/STTx.h>
8#include <xrpl/protocol/TxFormats.h>
9#include <xrpl/protocol_autogen/STObjectValidation.h>
10#include <xrpl/protocol_autogen/Utils.h>
47 reason =
"Transaction failed schema validation";
68 return tx_->getTxnType();
81 return tx_->at(sfAccount);
94 return tx_->at(sfSequence);
107 return tx_->at(sfFee);
120 return tx_->getFieldVL(sfSigningPubKey);
133 if (
tx_->isFieldPresent(sfFlags))
134 return tx_->at(sfFlags);
146 return tx_->isFieldPresent(sfFlags);
159 if (
tx_->isFieldPresent(sfSourceTag))
160 return tx_->at(sfSourceTag);
172 return tx_->isFieldPresent(sfSourceTag);
185 if (
tx_->isFieldPresent(sfPreviousTxnID))
186 return tx_->at(sfPreviousTxnID);
198 return tx_->isFieldPresent(sfPreviousTxnID);
212 if (
tx_->isFieldPresent(sfLastLedgerSequence))
213 return tx_->at(sfLastLedgerSequence);
225 return tx_->isFieldPresent(sfLastLedgerSequence);
238 if (
tx_->isFieldPresent(sfAccountTxnID))
239 return tx_->at(sfAccountTxnID);
251 return tx_->isFieldPresent(sfAccountTxnID);
264 if (
tx_->isFieldPresent(sfOperationLimit))
265 return tx_->at(sfOperationLimit);
277 return tx_->isFieldPresent(sfOperationLimit);
291 if (
tx_->isFieldPresent(sfMemos))
292 return tx_->getFieldArray(sfMemos);
304 return tx_->isFieldPresent(sfMemos);
317 if (
tx_->isFieldPresent(sfTicketSequence))
318 return tx_->at(sfTicketSequence);
330 return tx_->isFieldPresent(sfTicketSequence);
343 if (
tx_->isFieldPresent(sfTxnSignature))
344 return tx_->getFieldVL(sfTxnSignature);
356 return tx_->isFieldPresent(sfTxnSignature);
370 if (
tx_->isFieldPresent(sfSigners))
371 return tx_->getFieldArray(sfSigners);
383 return tx_->isFieldPresent(sfSigners);
396 if (
tx_->isFieldPresent(sfNetworkID))
397 return tx_->at(sfNetworkID);
409 return tx_->isFieldPresent(sfNetworkID);
422 if (
tx_->isFieldPresent(sfDelegate))
423 return tx_->at(sfDelegate);
435 return tx_->isFieldPresent(sfDelegate);
Base class for all transaction wrapper types.
std::optional< uint256 > getPreviousTxnID() const
Get the previous transaction ID (sfPreviousTxnID).
std::optional< std::reference_wrapper< STArray const > > getMemos() const
Get the memos array (sfMemos).
std::shared_ptr< STTx const > tx_
The underlying transaction object being wrapped.
bool hasMemos() const
Check if the transaction has memos.
bool hasNetworkID() const
Check if the transaction has a network ID.
bool hasPreviousTxnID() const
Check if the transaction has a previous transaction ID.
std::shared_ptr< STTx const > getSTTx() const
Get the underlying STTx object.
std::optional< uint256 > getAccountTxnID() const
Get the account transaction ID (sfAccountTxnID).
std::optional< AccountID > getDelegate() const
Get the delegate account (sfDelegate).
bool validate(std::string &reason) const
Validate the transaction.
xrpl::TxType getTransactionType() const
Get the transaction type.
bool hasTicketSequence() const
Check if the transaction has a ticket sequence.
std::optional< uint32_t > getLastLedgerSequence() const
Get the last ledger sequence (sfLastLedgerSequence).
TransactionBase(std::shared_ptr< STTx const > tx)
Construct a transaction wrapper from an existing STTx object.
std::uint32_t getSequence() const
Get the sequence number of the transaction (sfSequence).
bool hasSourceTag() const
Check if the transaction has a source tag.
bool hasAccountTxnID() const
Check if the transaction has an account transaction ID.
bool hasDelegate() const
Check if the transaction has a delegate account.
AccountID getAccount() const
Get the account initiating the transaction (sfAccount).
bool hasOperationLimit() const
Check if the transaction has an operation limit.
std::optional< uint32_t > getOperationLimit() const
Get the operation limit (sfOperationLimit).
bool hasFlags() const
Check if the transaction has flags set.
std::optional< uint32_t > getFlags() const
Get the transaction flags (sfFlags).
std::optional< std::reference_wrapper< STArray const > > getSigners() const
Get the signers array (sfSigners).
std::optional< uint32_t > getTicketSequence() const
Get the ticket sequence (sfTicketSequence).
bool hasSigners() const
Check if the transaction has signers.
bool hasTxnSignature() const
Check if the transaction has a transaction signature.
std::optional< uint32_t > getSourceTag() const
Get the source tag (sfSourceTag).
bool hasLastLedgerSequence() const
Check if the transaction has a last ledger sequence.
std::optional< Blob > getTxnSignature() const
Get the transaction signature (sfTxnSignature).
Blob getSigningPubKey() const
Get the signing public key (sfSigningPubKey).
STAmount getFee() const
Get the transaction fee (sfFee).
std::optional< uint32_t > getNetworkID() const
Get the network ID (sfNetworkID).
bool validateSTObject(STObject const &obj, SOTemplate const &format)
TxType
Transaction type identifiers.
bool passesLocalChecks(STObject const &st, std::string &)
bool isPseudoTx(STObject const &tx)
Check whether a transaction is a pseudo-transaction.