Chains
The following Viem chains are implemented on the OP Stack:
ts
import {
base,
baseGoerli,
baseSepolia,
optimism,
optimismGoerli,
optimismSepolia,
zora,
zoraSepolia,
zoraTestnet,
} from 'viem/chains'
import {
base,
baseGoerli,
baseSepolia,
optimism,
optimismGoerli,
optimismSepolia,
zora,
zoraSepolia,
zoraTestnet,
} from 'viem/chains'
Configuration
Viem exports OP Stack's chain formatters & serializers via chainConfig
. This is useful if you need to define another chain which is implemented on the OP Stack.
ts
import { defineChain } from 'viem'
import { chainConfig } from 'viem/op-stack'
export const opStackExample = defineChain({
...chainConfig,
name: 'OP Stack Example',
// ...
})
import { defineChain } from 'viem'
import { chainConfig } from 'viem/op-stack'
export const opStackExample = defineChain({
...chainConfig,
name: 'OP Stack Example',
// ...
})