Class ThirdwebTransaction
- Namespace
- Thirdweb
- Assembly
- Thirdweb.dll
Represents a Thirdweb transaction.
public class ThirdwebTransaction- Inheritance
- 
      
      ThirdwebTransaction
- Inherited Members
- Extension Methods
Properties
Input
public ThirdwebTransactionInput Input { get; set; }Property Value
Methods
ConvertToZkSyncTransaction(ThirdwebTransaction)
Converts the transaction to a zkSync transaction.
public static Task<ZkSyncAATransaction> ConvertToZkSyncTransaction(ThirdwebTransaction transaction)Parameters
- transactionThirdwebTransaction
- The transaction. 
Returns
- Task<ZkSyncAATransaction>
- The zkSync transaction. 
Create(IThirdwebWallet, ThirdwebTransactionInput)
Creates a new Thirdweb transaction.
public static Task<ThirdwebTransaction> Create(IThirdwebWallet wallet, ThirdwebTransactionInput txInput)Parameters
- walletIThirdwebWallet
- The wallet to use for the transaction. 
- txInputThirdwebTransactionInput
- The transaction input. 
Returns
- Task<ThirdwebTransaction>
- A new Thirdweb transaction. 
EstimateGasCosts(ThirdwebTransaction)
Estimates the gas costs for the transaction.
public static Task<TotalCosts> EstimateGasCosts(ThirdwebTransaction transaction)Parameters
- transactionThirdwebTransaction
- The transaction. 
Returns
- Task<TotalCosts>
- The estimated gas costs. 
EstimateGasFees(ThirdwebTransaction, bool)
Estimates the gas fees for the transaction.
public static Task<(BigInteger maxFeePerGas, BigInteger maxPriorityFeePerGas)> EstimateGasFees(ThirdwebTransaction transaction, bool withBump = true)Parameters
- transactionThirdwebTransaction
- The transaction. 
- withBumpbool
- Whether to include a bump in the gas fees. 
Returns
- Task<(BigInteger maxFeePerGas, BigInteger maxPriorityFeePerGas)>
- The estimated maximum fee per gas and maximum priority fee per gas. 
EstimateGasLimit(ThirdwebTransaction)
Estimates the gas limit for the transaction.
public static Task<BigInteger> EstimateGasLimit(ThirdwebTransaction transaction)Parameters
- transactionThirdwebTransaction
- The transaction. 
Returns
- Task<BigInteger>
- The estimated gas limit. 
EstimateGasPrice(ThirdwebTransaction, bool)
Estimates the gas price for the transaction.
public static Task<BigInteger> EstimateGasPrice(ThirdwebTransaction transaction, bool withBump = true)Parameters
- transactionThirdwebTransaction
- The transaction. 
- withBumpbool
- Whether to include a bump in the gas price. 
Returns
- Task<BigInteger>
- The estimated gas price. 
EstimateTotalCosts(ThirdwebTransaction)
Estimates the total costs for the transaction.
public static Task<TotalCosts> EstimateTotalCosts(ThirdwebTransaction transaction)Parameters
- transactionThirdwebTransaction
- The transaction. 
Returns
- Task<TotalCosts>
- The estimated total costs. 
GetNonce(ThirdwebTransaction)
Gets the nonce for the transaction.
public static Task<BigInteger> GetNonce(ThirdwebTransaction transaction)Parameters
- transactionThirdwebTransaction
- The transaction. 
Returns
- Task<BigInteger>
- The nonce. 
Prepare(ThirdwebTransaction)
Populates the transaction and prepares it for sending.
public static Task<ThirdwebTransaction> Prepare(ThirdwebTransaction transaction)Parameters
- transactionThirdwebTransaction
- The transaction. 
Returns
- Task<ThirdwebTransaction>
- The populated transaction. 
Exceptions
Send(ThirdwebTransaction)
Sends the transaction.
public static Task<string> Send(ThirdwebTransaction transaction)Parameters
- transactionThirdwebTransaction
- The transaction. 
Returns
SendAndWaitForTransactionReceipt(ThirdwebTransaction)
Sends the transaction and waits for the transaction receipt.
public static Task<ThirdwebTransactionReceipt> SendAndWaitForTransactionReceipt(ThirdwebTransaction transaction)Parameters
- transactionThirdwebTransaction
- The transaction. 
Returns
- Task<ThirdwebTransactionReceipt>
- The transaction receipt. 
SetChainId(BigInteger)
Sets the chain ID for the transaction.
public ThirdwebTransaction SetChainId(BigInteger chainId)Parameters
- chainIdBigInteger
- The chain ID. 
Returns
- ThirdwebTransaction
- The updated transaction. 
SetData(string)
Sets the data for the transaction.
public ThirdwebTransaction SetData(string data)Parameters
- datastring
- The data. 
Returns
- ThirdwebTransaction
- The updated transaction. 
SetGasLimit(BigInteger)
Sets the gas limit for the transaction.
public ThirdwebTransaction SetGasLimit(BigInteger gas)Parameters
- gasBigInteger
- The gas limit. 
Returns
- ThirdwebTransaction
- The updated transaction. 
SetGasPrice(BigInteger)
Sets the gas price for the transaction.
public ThirdwebTransaction SetGasPrice(BigInteger gasPrice)Parameters
- gasPriceBigInteger
- The gas price. 
Returns
- ThirdwebTransaction
- The updated transaction. 
SetMaxFeePerGas(BigInteger)
Sets the maximum fee per gas for the transaction.
public ThirdwebTransaction SetMaxFeePerGas(BigInteger maxFeePerGas)Parameters
- maxFeePerGasBigInteger
- The maximum fee per gas. 
Returns
- ThirdwebTransaction
- The updated transaction. 
SetMaxPriorityFeePerGas(BigInteger)
Sets the maximum priority fee per gas for the transaction.
public ThirdwebTransaction SetMaxPriorityFeePerGas(BigInteger maxPriorityFeePerGas)Parameters
- maxPriorityFeePerGasBigInteger
- The maximum priority fee per gas. 
Returns
- ThirdwebTransaction
- The updated transaction. 
SetNonce(BigInteger)
Sets the nonce for the transaction.
public ThirdwebTransaction SetNonce(BigInteger nonce)Parameters
- nonceBigInteger
- The nonce. 
Returns
- ThirdwebTransaction
- The updated transaction. 
SetTo(string)
Sets the recipient address of the transaction.
public ThirdwebTransaction SetTo(string to)Parameters
- tostring
- The recipient address. 
Returns
- ThirdwebTransaction
- The updated transaction. 
SetValue(BigInteger)
Sets the value to be transferred in the transaction.
public ThirdwebTransaction SetValue(BigInteger weiValue)Parameters
- weiValueBigInteger
- The value in wei. 
Returns
- ThirdwebTransaction
- The updated transaction. 
SetZkSyncOptions(ZkSyncOptions)
Sets the zkSync options for the transaction.
public ThirdwebTransaction SetZkSyncOptions(ZkSyncOptions zkSyncOptions)Parameters
- zkSyncOptionsZkSyncOptions
- The zkSync options. 
Returns
- ThirdwebTransaction
- The updated transaction. 
Sign(ThirdwebTransaction)
Signs the transaction.
public static Task<string> Sign(ThirdwebTransaction transaction)Parameters
- transactionThirdwebTransaction
- The transaction. 
Returns
Simulate(ThirdwebTransaction)
Simulates the transaction.
public static Task<string> Simulate(ThirdwebTransaction transaction)Parameters
- transactionThirdwebTransaction
- The transaction. 
Returns
ToString()
Converts the transaction input to a JSON string.
public override string ToString()Returns
- string
- A JSON string representation of the transaction input. 
WaitForTransactionHash(ThirdwebClient, string, CancellationToken)
Waits for the transaction hash given a thirdweb transaction id. Use WaitForTransactionReceipt if you have a transaction hash.
public static Task<string> WaitForTransactionHash(ThirdwebClient client, string txId, CancellationToken cancellationToken = default)Parameters
- clientThirdwebClient
- The Thirdweb client. 
- txIdstring
- The thirdweb transaction id. 
- cancellationTokenCancellationToken
- The cancellation token. 
Returns
WaitForTransactionReceipt(ThirdwebClient, BigInteger, string, CancellationToken)
Waits for the transaction receipt.
public static Task<ThirdwebTransactionReceipt> WaitForTransactionReceipt(ThirdwebClient client, BigInteger chainId, string txHash, CancellationToken cancellationToken = default)Parameters
- clientThirdwebClient
- The Thirdweb client. 
- chainIdBigInteger
- The chain ID. 
- txHashstring
- The transaction hash. 
- cancellationTokenCancellationToken
- The cancellation token. 
Returns
- Task<ThirdwebTransactionReceipt>
- The transaction receipt.