Docs

ThirdwebTransaction Instance Methods

The ThirdwebTransaction class provides a set of instance methods to set various properties of your transaction's input data and gas settings.

Do note that in most cases those are autopolulated by the SDK and you don't need to set them manually.

ThirdwebTransaction.SetTo

Set the target address or contract of the transaction.

ThirdwebTransaction transaction = transaction.SetTo("0xToAddress");

ThirdwebTransaction.SetData

Set the raw encoded data payload (potentially overriding previous data if the transaction was created using ThirdwebContract.Prepare).

ThirdwebTransaction transaction = transaction.SetData("0x");

ThirdwebTransaction.SetValue

Set the value of the payable transaction in Wei.

ThirdwebTransaction transaction = transaction.SetValue(1000000000000000000);

ThirdwebTransaction.SetGasLimit

Set the gas limit of the transaction.

ThirdwebTransaction transaction = transaction.SetGasLimit(21000);

ThirdwebTransaction.SetGasPrice

Set the gas price of the transaction.

ThirdwebTransaction transaction = transaction.SetGasPrice(1000000000);

ThirdwebTransaction.SetNonce

Set the nonce of the transaction.

ThirdwebTransaction transaction = transaction.SetNonce(1);