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

writeContract

Environment Imports

import { writeContract } from '@ivem/kit'
import { useWriteContract } from '@ivem/kit-react'
import { useWriteContract } from '@ivem/kit-vue'

Usage

import { writeContract } from '@ivem/kit'
 
const result = await writeContract(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[]
  • gasRatio?: number
  • gasLimit?: number
  • approves?: Array<{ token: string; amount: string }>
  • }

Return Type

  • Promise<{ hash: string }>

Examples

const { hash } = await writeContract(config, {
  contract: 'token.iost',
  action: 'balanceOf',
  args: ['iost', 'alice'],
})

Related