All the APIs that mutate the state of the blockchain have an overload that accepts a transaction hash as a single argument. This overload allows for resuming interrupted calls with a consistent return type.

In addition, the normal overloads of these APIs accept a TransactionOptions arg with options related to nonce and the transaction hash.

Hierarchy

  • TransactionOptions

Properties

nonce?: BN

The purpose of these nonce parameters are to allow the client to reattempt sending the transaction. Specifically this can be used to handle re-requesting a wallet to sign a transaction. When the nonce parameter is not specified, then the SDK will use the next available nonce for the transaction based on the transaction count for the EOA or safe (as the case may be).

gasPrice?: BN
gasLimit?: BN
onNonce?: ((nonce: BN) => void)

Type declaration

    • (nonce: BN): void
    • The onNonce callback will return the next available nonce (which is the nonce included in the signing request for the wallet). If the caller wishes to re-attempt sending the same transaction, the caller can specify the nonce to use when re-signing the transaction based on the nonce that was provided from the original onNonce callback. This will prevent the scenarios where the nonce will be increased on when the caller wants to force the wallet to resign the transaction. Care should be take though not to reuse a nonce value associated with a completed transaction. Such a situation could lead to the transaction being rejected because the nonce value is too low, or because the txn hash is identical to an already mined transaction.

      Parameters

      • nonce: BN

      Returns void

onTxnHash?: ((txnHash: string) => unknown)

Type declaration

    • (txnHash: string): unknown
    • The promise returned by all the API's that mutate the state of the blockchain will resolve after the transaction has been mined with a transaction receipt. In order for callers of the SDK to obtain the transaction hash (for purposes of tracking the transaction) before the transaction has been mined, all API's that mutate the state of the blockchain will also contain a callback onTxnHash that callers can use to obtain the transaction hash as soon as it is available.

      Parameters

      • txnHash: string

      Returns unknown

Generated using TypeDoc