TxOptions constructor

TxOptions({
  1. @Default(10) int feeIncrementPercentage,
  2. @Default(false) bool useNonceSequence,
  3. BigInt? customNonceKey,
  4. required bool withRetry,
})

Constructs a TxOptions instance.

  • feeIncrementPercentage: If a transaction needs to be retried, this parameter dictates how much more expensive the retry should be, in terms of gas. Note: The protocol generally mandates that the new gas price should be at least 10% higher than the previous to ensure a retry gets picked up by miners.

  • useNonceSequence: This flag indicates whether a transaction should be sent in parallel. This maintains the security and order of transactions (like preventing replay attacks) while giving users more control over how their transactions are processed and organized. This is particularly useful for complex accounts, like smart contract wallets, which might need to manage different types of transactions in different ways.

  • customNonceKey: This parameter is used to specify a custom nonce key for a user operation. This is useful for smart contract wallets that need to manage multiple transactions in parallel.

  • withRetry: This flag indicates whether a transaction should be reattempted if it fails initially. If set to true, the transaction fee (or gas price) will be increased by the feeIncrementPercentage before the retry.

Implementation

factory TxOptions({
  @Default(10) int feeIncrementPercentage,
  @Default(false) bool useNonceSequence,
  BigInt? customNonceKey,
  required bool withRetry,
}) = _TxOptions;