Table of Contents

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

ThirdwebTransactionInput

Methods

ConvertToZkSyncTransaction(ThirdwebTransaction)

Converts the transaction to a zkSync transaction.

public static Task<ZkSyncAATransaction> ConvertToZkSyncTransaction(ThirdwebTransaction transaction)

Parameters

transaction ThirdwebTransaction

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

wallet IThirdwebWallet

The wallet to use for the transaction.

txInput ThirdwebTransactionInput

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

transaction ThirdwebTransaction

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

transaction ThirdwebTransaction

The transaction.

withBump bool

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

transaction ThirdwebTransaction

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

transaction ThirdwebTransaction

The transaction.

withBump bool

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

transaction ThirdwebTransaction

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

transaction ThirdwebTransaction

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

transaction ThirdwebTransaction

The transaction.

Returns

Task<ThirdwebTransaction>

The populated transaction.

Exceptions

InvalidOperationException

Send(ThirdwebTransaction)

Sends the transaction.

public static Task<string> Send(ThirdwebTransaction transaction)

Parameters

transaction ThirdwebTransaction

The transaction.

Returns

Task<string>

The transaction hash.

SendAndWaitForTransactionReceipt(ThirdwebTransaction)

Sends the transaction and waits for the transaction receipt.

public static Task<ThirdwebTransactionReceipt> SendAndWaitForTransactionReceipt(ThirdwebTransaction transaction)

Parameters

transaction ThirdwebTransaction

The transaction.

Returns

Task<ThirdwebTransactionReceipt>

The transaction receipt.

SetChainId(BigInteger)

Sets the chain ID for the transaction.

public ThirdwebTransaction SetChainId(BigInteger chainId)

Parameters

chainId BigInteger

The chain ID.

Returns

ThirdwebTransaction

The updated transaction.

SetData(string)

Sets the data for the transaction.

public ThirdwebTransaction SetData(string data)

Parameters

data string

The data.

Returns

ThirdwebTransaction

The updated transaction.

SetGasLimit(BigInteger)

Sets the gas limit for the transaction.

public ThirdwebTransaction SetGasLimit(BigInteger gas)

Parameters

gas BigInteger

The gas limit.

Returns

ThirdwebTransaction

The updated transaction.

SetGasPrice(BigInteger)

Sets the gas price for the transaction.

public ThirdwebTransaction SetGasPrice(BigInteger gasPrice)

Parameters

gasPrice BigInteger

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

maxFeePerGas BigInteger

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

maxPriorityFeePerGas BigInteger

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

nonce BigInteger

The nonce.

Returns

ThirdwebTransaction

The updated transaction.

SetTo(string)

Sets the recipient address of the transaction.

public ThirdwebTransaction SetTo(string to)

Parameters

to string

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

weiValue BigInteger

The value in wei.

Returns

ThirdwebTransaction

The updated transaction.

SetZkSyncOptions(ZkSyncOptions)

Sets the zkSync options for the transaction.

public ThirdwebTransaction SetZkSyncOptions(ZkSyncOptions zkSyncOptions)

Parameters

zkSyncOptions ZkSyncOptions

The zkSync options.

Returns

ThirdwebTransaction

The updated transaction.

Sign(ThirdwebTransaction)

Signs the transaction.

public static Task<string> Sign(ThirdwebTransaction transaction)

Parameters

transaction ThirdwebTransaction

The transaction.

Returns

Task<string>

The signed transaction.

Simulate(ThirdwebTransaction)

Simulates the transaction.

public static Task<string> Simulate(ThirdwebTransaction transaction)

Parameters

transaction ThirdwebTransaction

The transaction.

Returns

Task<string>

The result of the simulation.

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 ThirdwebClient

The Thirdweb client.

chainId BigInteger

The chain ID.

txHash string

The transaction hash.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<ThirdwebTransactionReceipt>

The transaction receipt.