Skip to content
On this page

snapshot

Snapshot the state of the blockchain at the current block.

Usage

ts
import { testClient } from './client'

const id = await testClient.snapshot() 
ts
import { createTestClient, http } from 'viem'
import { foundry } from 'viem/chains'

export const testClient = createTestClient({
  chain: foundry,
  mode: 'anvil',
  transport: http(), 
})

Returns

ID of the snapshot that was created.

Released under the MIT License.