Skip to content

tevmViemExtension

tevmViemExtension(): ViemTevmClientDecorator

Decorates a viem public client with the tevm api

Returns

ViemTevmClientDecorator

Example

import { createClient, parseEth } from 'viem'
import { tevmViemExtension } from '@tevm/viem-extension'
const client = createClient('https://mainnet.optimism.io')
.extend(tevmViemExtension())
await client.tevm.account({
address: `0x${'12'.repeat(20)}`,
balance: parseEth('420'),
})

See

@tevm/server for documentation on creating a tevm backend

Source

extensions/viem/src/tevmViemExtension.js:36