createContract
createContract<
TName
,THumanReadableAbi
>(__namedParameters
):Contract
<TName
,THumanReadableAbi
>
Creates a tevm Contract instance from human readable abi
Type parameters
▪ TName extends string
▪ THumanReadableAbi extends readonly string
[]
Parameters
▪ __namedParameters: CreateContractParams
<TName
, THumanReadableAbi
>
Returns
Example
import { type Contract, createContract} from 'tevm/contract'
const contract: Contract = createContract({ name: 'MyContract', abi: [ ... ],})
To use a json abi first pass it into formatAbi
to turn it into human readable
Example
import { type Contract, createContract} from 'tevm/contract'
const contract = createContract({ name: 'MyContract', abi: [ ... ],})
Source
packages/contract/src/createContract.js:35
Generated using typedoc-plugin-markdown and TypeDoc