Skip to content
LogoLogo

Get Zone Info

zone.getZoneInfo

Returns metadata about the current zone.

Usage

import {  } from './zones.config'
 
const  = await ..()
 
.('Zone ID:', .)
.('Chain ID:', .)
.('Sequencers:', .)
.('Tempo block number:', .)
Zone ID: 7
Chain ID: 1337
Sequencers: ['0x742d35Cc6634C0532925a3b844Bc9e7595f0bEbb']
Tempo block number: 1234n

Recipes

Confirm a Token Is Enabled in the Zone

Check zoneTokens before bridging funds with zone.deposit, so you only submit deposits the zone can credit.

import {  } from './zones.config'
 
const  = '0x20c0000000000000000000000000000000000001'
 
const  = await ..()
 
if (!..())
  throw new (`Token ${} is not enabled in zone ${.}.`)

Alert When the Zone Falls Behind Tempo

Compare tempoBlockNumber with the Mainnet block number from block.getNumber to monitor import lag before it delays deposit settlement.

import {  as  } from './viem.config'
import {  } from './zones.config'
 
const [, ] = await .([
  ..(),
  ..(),
])
 
const  =  - .
if ( > 10n) .(`Zone import lag: ${} blocks`)

Return Value

type ReturnType = {
  /** Zone chain ID. */
  chainId: number
  /** Active sequencer addresses. */
  sequencers: readonly Address[]
  /** Latest Tempo block imported by the zone. */
  tempoBlockNumber: bigint
  /** Zone ID. */
  zoneId: number
  /** Tokens registered in the zone. */
  zoneTokens: readonly Address[]
}

The zone metadata.