ThirdwebTransaction Static Methods
The ThirdwebTransaction
class includes several static methods that provide functionality to estimate costs, simulate, send and poll transactions and user operations.
These methods are crucial for advanced transaction management and execution in blockchain applications.
Estimate the gas costs of a transaction.
An instance of ThirdwebTransaction
. The transaction for which you are estimating the gas costs.
Returns the estimated gas costs as TotalCosts
, including costs in both ether
and wei
.
Calculate the total costs of a transaction, combining the gas costs and transaction value.
An instance of ThirdwebTransaction
. The transaction for which you are calculating total costs.
Returns the total costs of the transaction as TotalCosts
, encompassing both the gas costs and the transaction value in ether
and wei
.
Estimate the gas limit of a transaction or user operation.
An instance of ThirdwebTransaction
. The transaction for which you are estimating the gas limit.
Returns the estimated gas limit as a BigInteger
.
Estimate the gas price for a transaction, optionally adjusting the estimate by a bump ratio.
An instance of ThirdwebTransaction
. The transaction for which you are estimating the gas price.
A Boolean indicating whether to adjust the estimated gas price by a factor to account for network conditions. Defaults to true
.
Returns the estimated gas price as a BigInteger
.
Simulate the execution of a transaction and return raw data.
An instance of ThirdwebTransaction
. The transaction you are simulating.
Returns the raw data of the simulated transaction as a string
.
Sign a raw transaction and returns the signed transaction data or the signed user operation json.
An instance of ThirdwebTransaction
. The transaction you are signing.
Returns the signed transaction data as a string
or the signed user operation json if using Account Abstraction.
Send a transaction to the blockchain without waiting for confirmation.
An instance of ThirdwebTransaction
. The transaction you want to send to the blockchain.
Returns the hash of the transaction as a string
.
Send a transaction and wait for its receipt.
An instance of ThirdwebTransaction
. The transaction you are sending and waiting for a receipt.
Returns the transaction receipt as a TransactionReceipt
, which includes details of the transaction execution result.
Wait for a transaction receipt to be available. Throws if reverted explicitly or silently and attempts to decode the revert reason.
An instance of ThirdwebClient
.
The chain ID of the blockchain network where the transaction was sent. Must be a BigInteger
.
The hash of the transaction you are waiting for. Must be a hexadecimal string
.
A CancellationToken
to cancel the operation.
Returns the transaction receipt as a TransactionReceipt
, which includes details of the transaction execution result.