Skip to content
On this page

setNextBlockTimestamp

Sets the next block's timestamp.

Usage

ts
import { testClient } from './client'
 
await testClient.setNextBlockTimestamp({ 
  timestamp: 1671744314n
})
ts
import { createTestClient, http } from 'viem'
import { foundry } from 'viem/chains'

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

Parameters

timestamp

  • Type: bigint
ts
await testClient.setNextBlockTimestamp({
  timestamp: 1671744314n 
})

Notes

  • The next Block timestamp cannot be lesser than the current Block timestamp.

Released under the MIT License.