Skip to content
On this page

mine

Mine a specified number of blocks.

Import

ts
import { mine } from 'viem/test'

Usage

ts
import { mine } from 'viem/test'
import { testClient } from '.'
 
await mine(testClient, { 
  blocks: 1
})

Parameters

blocks

  • Type: number

Number of blocks to mine.

ts
await mine(testClient, {
  blocks: 1 
})

interval (optional)

  • Type: number
  • Default: 1

Interval between each block in seconds.

ts
await mine(testClient, {
  blocks: 10,
  interval: 4 
})

Released under the MIT License.