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

callContract

Compatibility alias. Prefer writeContract.

Environment Imports

import { callContract } from '@ivem/kit'
import { useCallContract } from '@ivem/kit-react'
import { useCallContract } from '@ivem/kit-vue'

Usage

import { callContract } from '@ivem/kit'
 
const result = await callContract(config, {
  contract: 'token.iost',
  action: 'transfer',
  args: ['iost', 'alice', 'bob', '1.00000000', 'memo'],
  gasRatio: 1,
  gasLimit: 2000000,
})

Parameters

  • config: Config
  • parameters: {
  • contract: string
  • action: string
  • args: any[]
  • account?: string
  • gasRatio?: number
  • gasLimit?: number
  • }

Return Type

  • Promise<{ hash: string }>

Examples

const { hash } = await callContract(config, {
  contract: 'token.iost',
  action: 'transfer',
  args: ['iost', 'alice', 'bob', '1.00000000', 'memo'],
})

Related