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: stringaction: stringargs: any[]account?: stringgasRatio?: numbergasLimit?: number
Return Type
mutate(params, options?) => voidmutateAsync(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,
})