Client
To use the OP Stack functionality of Viem, you must extend your existing (or new) Viem Client with OP Stack Actions.
Usage
ts
import { createPublicClient, http } from 'viem'
import { base } from 'viem/chains'
import { opStackPublicActions } from 'viem/op-stack'
const client = createPublicClient({
chain: base,
transport: http(),
}).extend(opStackPublicActions())
const l1Gas = await client.estimateL1Gas({/* ... */})
import { createPublicClient, http } from 'viem'
import { base } from 'viem/chains'
import { opStackPublicActions } from 'viem/op-stack'
const client = createPublicClient({
chain: base,
transport: http(),
}).extend(opStackPublicActions())
const l1Gas = await client.estimateL1Gas({/* ... */})
Decorators
opStackPublicActions
A suite of Public Actions for the OP Stack.
ts
import { opStackPublicActions } from 'viem/op-stack'
import { opStackPublicActions } from 'viem/op-stack'