Skip to main content

Class: BatchCall

contract.BatchCall

A batch of function calls to be sent as a single transaction through a wallet.

Hierarchy

  • BaseContractInteraction

    BatchCall

Constructors

constructor

new BatchCall(wallet, calls): BatchCall

Parameters

NameType
walletWallet
callsFunctionCall[]

Returns

BatchCall

Overrides

BaseContractInteraction.constructor

Properties

calls

Protected calls: FunctionCall[]


log

Protected log: Logger

Inherited from

BaseContractInteraction.log


tx

Protected Optional tx: Tx

Inherited from

BaseContractInteraction.tx


txRequest

Protected Optional txRequest: TxExecutionRequest

Inherited from

BaseContractInteraction.txRequest


wallet

Protected wallet: Wallet

Inherited from

BaseContractInteraction.wallet

Methods

create

create(opts?): Promise<TxExecutionRequest>

Create a transaction execution request that represents this batch, encoded and authenticated by the user's wallet, ready to be simulated.

Parameters

NameTypeDescription
opts?SendMethodOptionsAn optional object containing additional configuration for the transaction.

Returns

Promise<TxExecutionRequest>

A Promise that resolves to a transaction instance.

Overrides

BaseContractInteraction.create


estimateGas

estimateGas(opts?): Promise<Pick<GasSettings, "gasLimits" | "teardownGasLimits">>

Estimates gas for a given tx request and returns gas limits for it.

Parameters

NameTypeDescription
opts?Omit<SendMethodOptions, "estimateGas" | "skipPublicSimulation">Options.

Returns

Promise<Pick<GasSettings, "gasLimits" | "teardownGasLimits">>

Gas limits.

Inherited from

BaseContractInteraction.estimateGas


getFeeOptionsFromEstimatedGas

getFeeOptionsFromEstimatedGas(request): Promise<undefined | { gasSettings: GasSettings ; paymentMethod: FeePaymentMethod }>

Helper method to return fee options based on the user opts, estimating tx gas if needed.

Parameters

NameTypeDescription
requestExecutionRequestInitRequest to execute for this interaction.

Returns

Promise<undefined | { gasSettings: GasSettings ; paymentMethod: FeePaymentMethod }>

Fee options for the actual transaction.

Inherited from

BaseContractInteraction.getFeeOptionsFromEstimatedGas


prove

prove(options?): Promise<Tx>

Proves a transaction execution request and returns a tx object ready to be sent.

Parameters

NameTypeDescription
optionsSendMethodOptionsoptional arguments to be used in the creation of the transaction

Returns

Promise<Tx>

The resulting transaction

Inherited from

BaseContractInteraction.prove


send

send(options?): SentTx

Sends a transaction to the contract function with the specified options. This function throws an error if called on an unconstrained function. It creates and signs the transaction if necessary, and returns a SentTx instance, which can be used to track the transaction status, receipt, and events.

Parameters

NameTypeDescription
optionsSendMethodOptionsAn optional object containing 'from' property representing the AztecAddress of the sender. If not provided, the default address is used.

Returns

SentTx

A SentTx instance for tracking the transaction status and information.

Inherited from

BaseContractInteraction.send


simulate

simulate(options?): Promise<any>

Simulate a transaction and get its return values Differs from prove in a few important ways:

  1. It returns the values of the function execution
  2. It supports unconstrained, private and public functions

Parameters

NameTypeDescription
optionsSimulateMethodOptionsAn optional object containing additional configuration for the transaction.

Returns

Promise<any>

The result of the transaction as returned by the contract function.