Class ThirdwebTransaction
- Namespace
- Thirdweb
- Assembly
- Thirdweb.dll
Represents a Thirdweb transaction.
public class ThirdwebTransaction
- Inheritance
-
ThirdwebTransaction
- Inherited Members
Properties
Input
public ThirdwebTransactionInput Input { get; }
Property Value
Methods
ConvertToZkSyncTransaction(ThirdwebTransaction)
Converts the transaction to a zkSync transaction.
public static Task<ZkSyncAATransaction> ConvertToZkSyncTransaction(ThirdwebTransaction transaction)
Parameters
transaction
ThirdwebTransactionThe 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
wallet
IThirdwebWalletThe wallet to use for the transaction.
txInput
ThirdwebTransactionInputThe 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
transaction
ThirdwebTransactionThe 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
transaction
ThirdwebTransactionThe transaction.
withBump
boolWhether 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
transaction
ThirdwebTransactionThe 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
transaction
ThirdwebTransactionThe transaction.
withBump
boolWhether 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
transaction
ThirdwebTransactionThe transaction.
Returns
- Task<TotalCosts>
The estimated total costs.
GetNonce(ThirdwebTransaction)
Gets the nonce for the transaction.
public static Task<BigInteger> GetNonce(ThirdwebTransaction transaction)
Parameters
transaction
ThirdwebTransactionThe transaction.
Returns
- Task<BigInteger>
The nonce.
Prepare(ThirdwebTransaction)
Populates the transaction and prepares it for sending.
public static Task<ThirdwebTransaction> Prepare(ThirdwebTransaction transaction)
Parameters
transaction
ThirdwebTransactionThe transaction.
Returns
- Task<ThirdwebTransaction>
The populated transaction.
Exceptions
Send(ThirdwebTransaction)
Sends the transaction.
public static Task<string> Send(ThirdwebTransaction transaction)
Parameters
transaction
ThirdwebTransactionThe transaction.
Returns
SendAndWaitForTransactionReceipt(ThirdwebTransaction)
Sends the transaction and waits for the transaction receipt.
public static Task<ThirdwebTransactionReceipt> SendAndWaitForTransactionReceipt(ThirdwebTransaction transaction)
Parameters
transaction
ThirdwebTransactionThe transaction.
Returns
- Task<ThirdwebTransactionReceipt>
The transaction receipt.
SetChainId(BigInteger)
Sets the chain ID for the transaction.
public ThirdwebTransaction SetChainId(BigInteger chainId)
Parameters
chainId
BigIntegerThe chain ID.
Returns
- ThirdwebTransaction
The updated transaction.
SetData(string)
Sets the data for the transaction.
public ThirdwebTransaction SetData(string data)
Parameters
data
stringThe data.
Returns
- ThirdwebTransaction
The updated transaction.
SetGasLimit(BigInteger)
Sets the gas limit for the transaction.
public ThirdwebTransaction SetGasLimit(BigInteger gas)
Parameters
gas
BigIntegerThe gas limit.
Returns
- ThirdwebTransaction
The updated transaction.
SetGasPrice(BigInteger)
Sets the gas price for the transaction.
public ThirdwebTransaction SetGasPrice(BigInteger gasPrice)
Parameters
gasPrice
BigIntegerThe gas price.
Returns
- ThirdwebTransaction
The updated transaction.
SetMaxFeePerGas(BigInteger)
Sets the maximum fee per gas for the transaction.
public ThirdwebTransaction SetMaxFeePerGas(BigInteger maxFeePerGas)
Parameters
maxFeePerGas
BigIntegerThe 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
maxPriorityFeePerGas
BigIntegerThe maximum priority fee per gas.
Returns
- ThirdwebTransaction
The updated transaction.
SetNonce(BigInteger)
Sets the nonce for the transaction.
public ThirdwebTransaction SetNonce(BigInteger nonce)
Parameters
nonce
BigIntegerThe nonce.
Returns
- ThirdwebTransaction
The updated transaction.
SetTo(string)
Sets the recipient address of the transaction.
public ThirdwebTransaction SetTo(string to)
Parameters
to
stringThe recipient address.
Returns
- ThirdwebTransaction
The updated transaction.
SetValue(BigInteger)
Sets the value to be transferred in the transaction.
public ThirdwebTransaction SetValue(BigInteger weiValue)
Parameters
weiValue
BigIntegerThe value in wei.
Returns
- ThirdwebTransaction
The updated transaction.
SetZkSyncOptions(ZkSyncOptions)
Sets the zkSync options for the transaction.
public ThirdwebTransaction SetZkSyncOptions(ZkSyncOptions zkSyncOptions)
Parameters
zkSyncOptions
ZkSyncOptionsThe zkSync options.
Returns
- ThirdwebTransaction
The updated transaction.
Sign(ThirdwebTransaction)
Signs the transaction.
public static Task<string> Sign(ThirdwebTransaction transaction)
Parameters
transaction
ThirdwebTransactionThe transaction.
Returns
Simulate(ThirdwebTransaction)
Simulates the transaction.
public static Task<string> Simulate(ThirdwebTransaction transaction)
Parameters
transaction
ThirdwebTransactionThe 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.
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
client
ThirdwebClientThe Thirdweb client.
chainId
BigIntegerThe chain ID.
txHash
stringThe transaction hash.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task<ThirdwebTransactionReceipt>
The transaction receipt.