Operation Helper Class

Description

A helper class to create Operation objects which can be executed or batched.

Constructors

  • Parameters

    • txn: Promise<PopulatedTransaction>
    • type: OperationType
    • Optional forwarderPopulatedPromise: Promise<PopulatedTransaction>

    Returns Operation

Properties

exec: ((signer, gasLimitMultiplier?) => Promise<TransactionResponse>)

Executes the operation via the provided signer.

Type declaration

    • (signer, gasLimitMultiplier?): Promise<TransactionResponse>
    • Executes the operation via the provided signer.

      Parameters

      • signer: Signer

        The signer of the transaction

      • Optional gasLimitMultiplier: number

        A multiplier to provide gasLimit buffer on top of the estimated gas limit (1.2x is the default)

      Returns Promise<TransactionResponse>

      A TransactionResponse object which can be awaited

      Description

      Populates all fields of the transaction, signs it and sends it to the network.

Description

Populates all fields of the transaction, signs it and sends it to the network.

Param: signer

The signer of the transaction

Param: gasLimitMultiplier

A multiplier to provide gasLimit buffer on top of the estimated gas limit (1.2x is the default)

Returns

A TransactionResponse object which can be awaited

forwarderPopulatedPromise?: Promise<PopulatedTransaction>
getPopulatedTransactionRequest: ((providerOrSigner, gasLimitMultiplier?) => Promise<PopulatedTransaction>)

Get the populated transaction by awaiting populateTransactionPromise. providerOrSigner is used for gas estimation if necessary. NOTE: we use the forwarder populated promise if this exists

Type declaration

    • (providerOrSigner, gasLimitMultiplier?): Promise<PopulatedTransaction>
    • Get the populated transaction by awaiting populateTransactionPromise. providerOrSigner is used for gas estimation if necessary. NOTE: we use the forwarder populated promise if this exists

      Parameters

      • providerOrSigner: Signer | Provider
      • Optional gasLimitMultiplier: number

      Returns Promise<PopulatedTransaction>

getSignedTransaction: ((signer, gasLimitMultiplier?) => Promise<string>)

Signs the populated transaction via the provided signer (what you intend on sending to the network).

Type declaration

    • (signer, gasLimitMultiplier?): Promise<string>
    • Signs the populated transaction via the provided signer (what you intend on sending to the network).

      Parameters

      • signer: Signer

        The signer of the transaction

      • Optional gasLimitMultiplier: number

      Returns Promise<string>

      Fully serialized, signed transaction

Param: signer

The signer of the transaction

Returns

Fully serialized, signed transaction

getTransactionHash: ((signer) => Promise<string>)

Gets the transaction hash of the transaction.

Type declaration

    • (signer): Promise<string>
    • Gets the transaction hash of the transaction.

      Parameters

      • signer: Signer

        The signer of the transaction

      Returns Promise<string>

      The transaction hash of the transaction

      Description

      Calculates this by getting the keccak256 hash of the signedTxn.

Description

Calculates this by getting the keccak256 hash of the signedTxn.

Param: signer

The signer of the transaction

Returns

The transaction hash of the transaction

populateTransactionPromise: Promise<PopulatedTransaction>
toOperationStruct: ((index) => Promise<OperationStruct>)

Gets the OperationStruct object.

Type declaration

    • (index): Promise<OperationStruct>
    • Gets the OperationStruct object.

      Parameters

      • index: number

        the index of the Operation in the batchCall

      Returns Promise<OperationStruct>

      OperationStruct object for batchCall

Param: operation

an Operation object

Param: index

the index of the Operation in the batchCall

Returns

OperationStruct object for batchCall

Generated using TypeDoc