@tevm/actions
v1.0.0-next.127
Published
A typesafe library for writing forge scripts in typescript
Downloads
1,771
Maintainers
Readme
@tevm/actions
Actions add functionality to the base client
Installation
Action handlers can be imported from tevm/actions
or @tevm/actions
npm install tevm
or
npm install @tevm/actions
Usage
Action handlers take a client and return an tevm action handler function
import {createTevmNode} from 'tevm/node'
import {callHandler} from 'tevm/actions'
/**
* Most action handlers wrap the base client
*/
const client = createTevmNode()
/**
* To use the action first instanciate it with the base client
* @type {import('tevm/actions').CallHandler}
*/
const call = callHandler(client)
/**
* @type{import('tevm/actions').CallHandlerResult}
*/
const callResult = await call({
to: `0x${'01'.repeat(20)}`,
value: 1n,
})