rippled
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
xrpl::transactions::TransactionBuilderBase< Derived > Class Template Reference

Base class for all transaction builders. More...

#include <TransactionBuilderBase.h>

Collaboration diagram for xrpl::transactions::TransactionBuilderBase< Derived >:
Collaboration graph
[legend]

Public Member Functions

 TransactionBuilderBase ()=default
 
 TransactionBuilderBase (SF_UINT16::type::value_type transactionType, SF_ACCOUNT::type::value_type account, std::optional< SF_UINT32::type::value_type > sequence, std::optional< SF_AMOUNT::type::value_type > fee)
 
Derived & setAccount (AccountID const &value)
 Set the account that is sending the transaction.
 
Derived & setFee (STAmount const &value)
 Set the transaction fee.
 
Derived & setSequence (std::uint32_t const &value)
 Set the sequence number.
 
Derived & setTicketSequence (std::uint32_t const &value)
 Set the ticket sequence to use for this transaction.
 
Derived & setFlags (std::uint32_t const &value)
 Set transaction flags.
 
Derived & setSourceTag (std::uint32_t const &value)
 Set the source tag.
 
Derived & setLastLedgerSequence (std::uint32_t const &value)
 Set the last ledger sequence.
 
Derived & setAccountTxnID (uint256 const &value)
 Set the account transaction ID.
 
Derived & setPreviousTxnID (uint256 const &value)
 Set the previous transaction ID.
 
Derived & setOperationLimit (std::uint32_t const &value)
 Set the operation limit.
 
Derived & setMemos (STArray const &value)
 Set the memos array.
 
Derived & setSigners (STArray const &value)
 Set the signers array for multi-signing.
 
Derived & setNetworkID (std::uint32_t const &value)
 Set the network ID.
 
Derived & setDelegate (AccountID const &value)
 Set the delegate account for delegated transactions.
 
STObject const & getSTObject () const
 Get the underlying STObject.
 

Protected Member Functions

Derived & sign (PublicKey const &publicKey, SecretKey const &secretKey)
 Sign the transaction with the given keys.
 

Protected Attributes

STObject object_ {sfTransaction}
 

Detailed Description

template<typename Derived>
class xrpl::transactions::TransactionBuilderBase< Derived >

Base class for all transaction builders.

Provides common field setters that are available for all transaction types.

Definition at line 26 of file TransactionBuilderBase.h.

Constructor & Destructor Documentation

◆ TransactionBuilderBase() [1/2]

template<typename Derived >
xrpl::transactions::TransactionBuilderBase< Derived >::TransactionBuilderBase ( )
default

◆ TransactionBuilderBase() [2/2]

template<typename Derived >
xrpl::transactions::TransactionBuilderBase< Derived >::TransactionBuilderBase ( SF_UINT16::type::value_type  transactionType,
SF_ACCOUNT::type::value_type  account,
std::optional< SF_UINT32::type::value_type >  sequence,
std::optional< SF_AMOUNT::type::value_type >  fee 
)

Definition at line 31 of file TransactionBuilderBase.h.

Member Function Documentation

◆ setAccount()

template<typename Derived >
Derived & xrpl::transactions::TransactionBuilderBase< Derived >::setAccount ( AccountID const &  value)

Set the account that is sending the transaction.

Parameters
valueAccount address (typically as a string)
Returns
Reference to the derived builder for method chaining.

Definition at line 62 of file TransactionBuilderBase.h.

◆ setFee()

template<typename Derived >
Derived & xrpl::transactions::TransactionBuilderBase< Derived >::setFee ( STAmount const &  value)

Set the transaction fee.

Parameters
valueFee in drops (typically as a string or number)
Returns
Reference to the derived builder for method chaining.

Definition at line 74 of file TransactionBuilderBase.h.

◆ setSequence()

template<typename Derived >
Derived & xrpl::transactions::TransactionBuilderBase< Derived >::setSequence ( std::uint32_t const &  value)

Set the sequence number.

Parameters
valueSequence number
Returns
Reference to the derived builder for method chaining.

Definition at line 86 of file TransactionBuilderBase.h.

◆ setTicketSequence()

template<typename Derived >
Derived & xrpl::transactions::TransactionBuilderBase< Derived >::setTicketSequence ( std::uint32_t const &  value)

Set the ticket sequence to use for this transaction.

When using a ticket, the regular sequence number is set to 0.

Parameters
valueTicket sequence number
Returns
Reference to the derived builder for method chaining.

Definition at line 99 of file TransactionBuilderBase.h.

◆ setFlags()

template<typename Derived >
Derived & xrpl::transactions::TransactionBuilderBase< Derived >::setFlags ( std::uint32_t const &  value)

Set transaction flags.

Parameters
valueFlags value
Returns
Reference to the derived builder for method chaining.

Definition at line 112 of file TransactionBuilderBase.h.

◆ setSourceTag()

template<typename Derived >
Derived & xrpl::transactions::TransactionBuilderBase< Derived >::setSourceTag ( std::uint32_t const &  value)

Set the source tag.

Parameters
valueSource tag
Returns
Reference to the derived builder for method chaining.

Definition at line 124 of file TransactionBuilderBase.h.

◆ setLastLedgerSequence()

template<typename Derived >
Derived & xrpl::transactions::TransactionBuilderBase< Derived >::setLastLedgerSequence ( std::uint32_t const &  value)

Set the last ledger sequence.

Parameters
valueLast ledger sequence number
Returns
Reference to the derived builder for method chaining.

Definition at line 136 of file TransactionBuilderBase.h.

◆ setAccountTxnID()

template<typename Derived >
Derived & xrpl::transactions::TransactionBuilderBase< Derived >::setAccountTxnID ( uint256 const &  value)

Set the account transaction ID.

Parameters
valueAccount transaction ID (typically as a hex string)
Returns
Reference to the derived builder for method chaining.

Definition at line 148 of file TransactionBuilderBase.h.

◆ setPreviousTxnID()

template<typename Derived >
Derived & xrpl::transactions::TransactionBuilderBase< Derived >::setPreviousTxnID ( uint256 const &  value)

Set the previous transaction ID.

Used for emulate027 compatibility.

Parameters
valuePrevious transaction ID
Returns
Reference to the derived builder for method chaining.

Definition at line 161 of file TransactionBuilderBase.h.

◆ setOperationLimit()

template<typename Derived >
Derived & xrpl::transactions::TransactionBuilderBase< Derived >::setOperationLimit ( std::uint32_t const &  value)

Set the operation limit.

Parameters
valueOperation limit
Returns
Reference to the derived builder for method chaining.

Definition at line 173 of file TransactionBuilderBase.h.

◆ setMemos()

template<typename Derived >
Derived & xrpl::transactions::TransactionBuilderBase< Derived >::setMemos ( STArray const &  value)

Set the memos array.

Parameters
valueArray of memo objects
Returns
Reference to the derived builder for method chaining.

Definition at line 185 of file TransactionBuilderBase.h.

◆ setSigners()

template<typename Derived >
Derived & xrpl::transactions::TransactionBuilderBase< Derived >::setSigners ( STArray const &  value)

Set the signers array for multi-signing.

Parameters
valueArray of signer objects
Returns
Reference to the derived builder for method chaining.

Definition at line 197 of file TransactionBuilderBase.h.

◆ setNetworkID()

template<typename Derived >
Derived & xrpl::transactions::TransactionBuilderBase< Derived >::setNetworkID ( std::uint32_t const &  value)

Set the network ID.

Parameters
valueNetwork ID
Returns
Reference to the derived builder for method chaining.

Definition at line 209 of file TransactionBuilderBase.h.

◆ setDelegate()

template<typename Derived >
Derived & xrpl::transactions::TransactionBuilderBase< Derived >::setDelegate ( AccountID const &  value)

Set the delegate account for delegated transactions.

Parameters
valueDelegate account ID
Returns
Reference to the derived builder for method chaining.

Definition at line 221 of file TransactionBuilderBase.h.

◆ getSTObject()

template<typename Derived >
STObject const & xrpl::transactions::TransactionBuilderBase< Derived >::getSTObject ( ) const

Get the underlying STObject.

Returns
The STObject

Definition at line 232 of file TransactionBuilderBase.h.

◆ sign()

template<typename Derived >
Derived & xrpl::transactions::TransactionBuilderBase< Derived >::sign ( PublicKey const &  publicKey,
SecretKey const &  secretKey 
)
protected

Sign the transaction with the given keys.

This sets the SigningPubKey field and computes the TxnSignature.

Parameters
publicKeyThe public key for signing
secretKeyThe secret key for signing
Returns
Reference to the derived builder for method chaining.

Definition at line 248 of file TransactionBuilderBase.h.

Member Data Documentation

◆ object_

template<typename Derived >
STObject xrpl::transactions::TransactionBuilderBase< Derived >::object_ {sfTransaction}
protected

Definition at line 266 of file TransactionBuilderBase.h.