3#include <xrpl/protocol/HashPrefix.h>
4#include <xrpl/protocol/PublicKey.h>
5#include <xrpl/protocol/SField.h>
6#include <xrpl/protocol/STAccount.h>
7#include <xrpl/protocol/STAmount.h>
8#include <xrpl/protocol/STArray.h>
9#include <xrpl/protocol/STBlob.h>
10#include <xrpl/protocol/STInteger.h>
11#include <xrpl/protocol/STObject.h>
12#include <xrpl/protocol/STTx.h>
13#include <xrpl/protocol/SecretKey.h>
14#include <xrpl/protocol/Serializer.h>
15#include <xrpl/protocol/TxFormats.h>
16#include <xrpl/protocol/jss.h>
24template <
typename Derived>
31 SF_UINT16::type::value_type transactionType,
32 SF_ACCOUNT::type::value_type account,
42 object_[sfTransactionType] = transactionType;
64 return static_cast<Derived&
>(*this);
76 return static_cast<Derived&
>(*this);
88 return static_cast<Derived&
>(*this);
101 object_[sfTicketSequence] = value;
102 return static_cast<Derived&
>(*this);
114 return static_cast<Derived&
>(*this);
126 return static_cast<Derived&
>(*this);
137 object_[sfLastLedgerSequence] = value;
138 return static_cast<Derived&
>(*this);
149 object_[sfAccountTxnID] = value;
150 return static_cast<Derived&
>(*this);
162 object_[sfPreviousTxnID] = value;
163 return static_cast<Derived&
>(*this);
174 object_[sfOperationLimit] = value;
175 return static_cast<Derived&
>(*this);
186 object_.setFieldArray(sfMemos, value);
187 return static_cast<Derived&
>(*this);
198 object_.setFieldArray(sfSigners, value);
199 return static_cast<Derived&
>(*this);
211 return static_cast<Derived&
>(*this);
223 return static_cast<Derived&
>(*this);
256 object_.addWithoutSigningFields(s);
260 object_.setFieldVL(sfTxnSignature, sig);
262 return static_cast<Derived&
>(*this);
Slice slice() const noexcept
Slice slice() const noexcept
Derived & setDelegate(AccountID const &value)
Set the delegate account for delegated transactions.
Derived & setFee(STAmount const &value)
Set the transaction fee.
Derived & setFlags(std::uint32_t const &value)
Set transaction flags.
Derived & setOperationLimit(std::uint32_t const &value)
Set the operation limit.
Derived & setPreviousTxnID(UInt256 const &value)
Set the previous transaction ID.
Derived & setTicketSequence(std::uint32_t const &value)
Set the ticket sequence to use for this transaction.
Derived & setNetworkID(std::uint32_t const &value)
Set the network ID.
Derived & setSigners(STArray const &value)
Set the signers array for multi-signing.
Derived & setSequence(std::uint32_t const &value)
Set the sequence number.
STObject const & getSTObject() const
Get the underlying STObject.
Derived & setAccount(AccountID const &value)
Set the account that is sending the transaction.
TransactionBuilderBase()=default
Derived & setLastLedgerSequence(std::uint32_t const &value)
Set the last ledger sequence.
Derived & setMemos(STArray const &value)
Set the memos array.
Derived & sign(PublicKey const &publicKey, SecretKey const &secretKey)
Sign the transaction with the given keys.
Derived & setAccountTxnID(UInt256 const &value)
Set the account transaction ID.
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 & setSourceTag(std::uint32_t const &value)
Set the source tag.
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
@ TxSign
inner transaction to sign
Buffer sign(PublicKey const &pk, SecretKey const &sk, Slice const &message)
Generate a signature for a message.