Skip to content

setOperatorApprovalCall

setOperatorApprovalCall(options): OutputType

Defined in: packages/synapse-core/src/pay/set-operator-approval.ts:226

Create a call to the setOperatorApproval function

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

Parameter Type Description
options OptionsType setOperatorApprovalCall.OptionsType

OutputType

The call to the setOperatorApproval function setOperatorApprovalCall.OutputType

Errors setOperatorApprovalCall.ErrorType

import { setOperatorApprovalCall } from '@filoz/synapse-core/pay'
import { createWalletClient, http } 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, setOperatorApprovalCall({
  chain: calibration,
  approve: true,
}))

console.log(request)