Skip to content

ZoneId.fromChainId

Derives a zone ID from a zone chain ID.

Zone chain IDs use the base assigned to their Tempo source chain. Zones of other Tempo chains (such as devnets) encode the source chain ID in the high 32 bits and the zone ID in the low 32 bits, so the zone ID is read from the chain ID alone.

Imports

Named
import { ZoneId } from 'ox/tempo'

Examples

import { ZoneId } from 'ox/tempo'
 
const zoneId = ZoneId.fromChainId(421_700_001)
1

Definition

function fromChainId(
  chainId: number,
  sourceId?: SourceId,
): number

Source: src/tempo/ZoneId.ts

Parameters

chainId

  • Type: number

The zone chain ID.

sourceId

The Tempo source chain ID. Defaults to 4217 (Presto).

Return Type

The zone ID.

number