Build
Frontend Tutorials
toolkit
Function.evmdepositandcall

@zetachain/toolkit / evmDepositAndCall

evmDepositAndCall(this, args): Promise<ContractTransaction>

this: ZetaChainClient

The instance of the ZetaChain client that contains the signer information.

args

The function arguments.

args.amount: string

The amount of ERC20 tokens or native currency to deposit.

args.erc20?: string

The address of the ERC20 token contract. If depositing native currency (e.g., ETH), this can be left empty or undefined.

args.gatewayEvm?: string

The address of the ZetaChain gateway contract on the EVM-compatible blockchain.

args.receiver: string

The address of the receiver contract or account where the function call will be executed.

args.revertOptions: RevertOptions

Options to handle call reversion, including revert address, message, and gas limit for the revert scenario.

args.txOptions: TxOptions

Transaction options, including gasLimit, gasPrice, etc.

args.types: string[]

JSON string representing the types of the function parameters (e.g., ["uint256", "address"]).

args.values: ParseAbiValuesReturnType

The values to be passed to the function (should match the types).

Promise<ContractTransaction>

  • Returns the transaction object.

evmDepositAndCall

Deposits a specified amount of ERC-20 or native gas tokens and calls a universal app contract on ZetaChain.

evmDepositAndCall.ts:33 (opens in a new tab)