Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

useCallContract

Compatibility alias. Prefer useWriteContract.

Usage

import { useCallContract } from '@ivem/kit-vue'
 
const callContract = useCallContract()
await callContract.mutateAsync({
  contract: 'token.iost',
  action: 'transfer',
  args: ['iost', 'alice', 'bob', '1.00000000', 'memo'],
})

Parameters

Call params:

  • contract: string
  • action: string
  • args: any[]
  • account?: string
  • gasRatio?: number
  • gasLimit?: number

Return Type

  • mutate(params, options?) => void
  • mutateAsync(params) => Promise<{ hash: string }>
  • isPending: Ref<boolean>
  • error: Ref<Error | null>
  • data: Ref<{ hash: string } | null>

Examples

const tx = await callContract.mutateAsync({
  contract: 'token.iost',
  action: 'transfer',
  args: ['iost', 'alice', 'bob', '1.00000000', 'memo'],
  gasRatio: 1,
  gasLimit: 2000000,
})

Related