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.