Skip to content

depositCall

depositCall(options): OutputType

Defined in: packages/synapse-core/src/pay/deposit.ts:228

Create a call to the deposit function

This function is used to create a call to the deposit function for use with sendCalls, sendTransaction, multicall, estimateContractGas, or simulateContract.

ParameterTypeDescription
optionsOptionsTypedepositCall.OptionsType

OutputType

The call to the deposit function depositCall.OutputType

Errors depositCall.ErrorType

import { depositCall } from '@filoz/synapse-core/pay'
import { createWalletClient, http, parseUnits } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { simulateContract } from 'viem/actions'
import { calibration } from '@filoz/synapse-core/chains'
const account = privateKeyToAccount('0x...')
const client = createWalletClient({
account,
chain: calibration,
transport: http(),
})
// Use with simulateContract
const { request } = await simulateContract(client, depositCall({
chain: calibration,
to: account.address,
amount: parseUnits('100', 18),
}))
console.log(request)