ZigZag

Chain Data Model

The shape of chain objects in @zig-zag/chains.

Chain Interface

Every chain export conforms to the Chain interface:

interface Chain {
  // Required
  id: number;
  name: string;
  network: string;
  genesisHash: HexString;
  ss58Format: number;
  nativeCurrency: Currency;
  rpcUrls: Record<string, string> & { default: string };

  // Optional
  paraId?: number;
  relay?: boolean;
  testnet?: boolean;
  ethereum?: boolean;
  relayChain?: string;
  signType?: "sr25519" | "ed25519" | "secp256k1";
  httpUrls?: Record<string, string>;
  lightClientUrls?: Record<string, string> & { default: string };
  website?: string;
  chainIconUrl?: string;
  blockExplorers?: Record<string, BlockExplorer> & { default: BlockExplorer };
  subscan?: SubscanConfig;
}

interface Currency {
  name: string;
  symbol: string;
  decimals: number;
}

interface BlockExplorer {
  name: string;
  url: string;
}

interface SubscanConfig {
  url: string;
  api: string;
}

type HexString = `0x${string}`;

Required Fields

FieldTypeDescription
idnumberUnique numeric identifier
namestringHuman-readable chain name
networkstringURL-safe slug (e.g. "polkadot", "kusama-asset-hub")
genesisHash`0x${string}`Genesis block hash
ss58FormatnumberSS58 address encoding prefix
nativeCurrencyCurrencyToken name, symbol (2-6 chars), and decimals
rpcUrlsRecord<string, string>Named WebSocket RPC providers with a required default key

Optional Fields

FieldTypeDescription
paraIdnumberParachain ID on the relay chain
relaybooleanWhether this is a relay chain
testnetbooleanWhether this is a test network
ethereumbooleanWhether this chain is EVM-compatible
relayChainstringParent relay chain slug (for parachains)
signType"sr25519" | "ed25519" | "secp256k1"Default signing curve
httpUrlsRecord<string, string>Named HTTP RPC endpoints
lightClientUrlsRecord<string, string>Substrate Connect light client URLs
websitestringProject website URL
chainIconUrlstringChain logo URL or data URI
blockExplorersRecord<string, BlockExplorer>Named block explorers with a default key
subscanSubscanConfigSubscan web URL (url) and API URL (api)

Supported Chains

Relay chains, system parachains, popular parachains, and testnets across Polkadot, Kusama, and Westend.

On this page