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
transactionThirdwebTransactionThe 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
walletIThirdwebWalletThe wallet to use for the transaction.
txInputThirdwebTransactionInputThe 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
transactionThirdwebTransactionThe 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
transactionThirdwebTransactionThe transaction.
withBumpboolWhether 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
transactionThirdwebTransactionThe 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
transactionThirdwebTransactionThe transaction.
withBumpboolWhether 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
transactionThirdwebTransactionThe transaction.
Returns
- Task<TotalCosts>
The estimated total costs.
GetNonce(ThirdwebTransaction)
Gets the nonce for the transaction.
public static Task<BigInteger> GetNonce(ThirdwebTransaction transaction)
Parameters
transactionThirdwebTransactionThe transaction.
Returns
- Task<BigInteger>
The nonce.
Prepare(ThirdwebTransaction)
Populates the transaction and prepares it for sending.
public static Task<ThirdwebTransaction> Prepare(ThirdwebTransaction transaction)
Parameters
transactionThirdwebTransactionThe transaction.
Returns
- Task<ThirdwebTransaction>
The populated transaction.
Exceptions
Send(ThirdwebTransaction)
Sends the transaction.
public static Task<string> Send(ThirdwebTransaction transaction)
Parameters
transactionThirdwebTransactionThe transaction.
Returns
SendAndWaitForTransactionReceipt(ThirdwebTransaction)
Sends the transaction and waits for the transaction receipt.
public static Task<ThirdwebTransactionReceipt> SendAndWaitForTransactionReceipt(ThirdwebTransaction transaction)
Parameters
transactionThirdwebTransactionThe transaction.
Returns
- Task<ThirdwebTransactionReceipt>
The transaction receipt.
SetChainId(BigInteger)
Sets the chain ID for the transaction.
public ThirdwebTransaction SetChainId(BigInteger chainId)
Parameters
chainIdBigIntegerThe chain ID.
Returns
- ThirdwebTransaction
The updated transaction.
SetData(string)
Sets the data for the transaction.
public ThirdwebTransaction SetData(string data)
Parameters
datastringThe data.
Returns
- ThirdwebTransaction
The updated transaction.
SetGasLimit(BigInteger)
Sets the gas limit for the transaction.
public ThirdwebTransaction SetGasLimit(BigInteger gas)
Parameters
gasBigIntegerThe gas limit.
Returns
- ThirdwebTransaction
The updated transaction.
SetGasPrice(BigInteger)
Sets the gas price for the transaction.
public ThirdwebTransaction SetGasPrice(BigInteger gasPrice)
Parameters
gasPriceBigIntegerThe gas price.
Returns
- ThirdwebTransaction
The updated transaction.
SetMaxFeePerGas(BigInteger)
Sets the maximum fee per gas for the transaction.
public ThirdwebTransaction SetMaxFeePerGas(BigInteger maxFeePerGas)
Parameters
maxFeePerGasBigIntegerThe 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
maxPriorityFeePerGasBigIntegerThe maximum priority fee per gas.
Returns
- ThirdwebTransaction
The updated transaction.
SetNonce(BigInteger)
Sets the nonce for the transaction.
public ThirdwebTransaction SetNonce(BigInteger nonce)
Parameters
nonceBigIntegerThe nonce.
Returns
- ThirdwebTransaction
The updated transaction.
SetTo(string)
Sets the recipient address of the transaction.
public ThirdwebTransaction SetTo(string to)
Parameters
tostringThe recipient address.
Returns
- ThirdwebTransaction
The updated transaction.
SetValue(BigInteger)
Sets the value to be transferred in the transaction.
public ThirdwebTransaction SetValue(BigInteger weiValue)
Parameters
weiValueBigIntegerThe value in wei.
Returns
- ThirdwebTransaction
The updated transaction.
SetZkSyncOptions(ZkSyncOptions)
Sets the zkSync options for the transaction.
public ThirdwebTransaction SetZkSyncOptions(ZkSyncOptions zkSyncOptions)
Parameters
zkSyncOptionsZkSyncOptionsThe zkSync options.
Returns
- ThirdwebTransaction
The updated transaction.
Sign(ThirdwebTransaction)
Signs the transaction.
public static Task<string> Sign(ThirdwebTransaction transaction)
Parameters
transactionThirdwebTransactionThe transaction.
Returns
Simulate(ThirdwebTransaction)
Simulates the transaction.
public static Task<string> Simulate(ThirdwebTransaction transaction)
Parameters
transactionThirdwebTransactionThe 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
clientThirdwebClientThe Thirdweb client.
txIdstringThe thirdweb transaction id.
cancellationTokenCancellationTokenThe 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
clientThirdwebClientThe Thirdweb client.
chainIdBigIntegerThe chain ID.
txHashstringThe transaction hash.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<ThirdwebTransactionReceipt>
The transaction receipt.