Transaction Builder
By default, all transactions initiated using the SDK perform every step of the process for a transaction; From preparing and building the transaction all the way to waiting until it has been mined, and the data is available to be read from the blockchain.
To gain more granular control over the transaction process, all Contract objects come with a Prepare function that returns a Transaction object, which can be used to build, fine-tune, and execute the transaction.
Please be advised that in most cases you do not need to use these functions, as the SDK will handle the transaction process for you. However, if you need more granular control over the transaction process, these functions can be used to fine-tune the transaction.
Waits for a transaction to be mined, returning a transaction receipt.
Set the maximum priority fee per gas for the transaction (EIP-1559)
Set the maximum fee per gas for the transaction (EIP-1559)
Override the data for the transaction.
Set the value for the transaction.
Override the sender address for the transaction.
Set the gas limit for the transaction. Good if you want to avoid pre-estimation/simulation.
Override the to address for the transaction.
Override the transaction type for the transaction. This will most likely be inferred automatically.
Set the gas price for the transaction (Legacy Transaction Type).
Override the chain id for the transaction. This will most likely be inferred automatically.
Override the nonce for the transaction. This will most likely be inferred automatically.
Override the arguments for the transaction. This may affect calldata.
Get the gas price (for legacy transactions).
Get the max fee per gas and max priority fee per gas (for EIP-1559 transactions).
Estimate the gas limit for the transaction.
Roughly estimates the gas costs for this transaction.
Estimate the gas limit for the transaction and set it.
Attempts to simulate the transaction to find out if it will succeed in its current state.
Signs the transaction asynchronously, if the wallet supports it. Useful for smart wallet user op delayed broadcasting through thirdweb Engine. Otherwise not recommended.
Populates the transaction with the necessary data to be sent. This is called automatically by the SDK when sending a transaction, but can be called manually if needed.
There is no guarantee the gas and nonce values will be preserved when using Account Abstraction.
Sends the transaction without waiting for it to be mined. Returns a transaction hash instead of the typical transaction receipt object.
Sends the transaction and waits for it to be mined, returning a transaction receipt.