/** * Chain definitions for Lux Exchange. * * Source of truth: ~/work/lux/genesis/configs/inventory/brand-l1-2026-06-05-reset.json * * 18 endpoints — 5 brand L1s (hanzo, zoo, pars, spc, osage) × 3 envs * (mainnet, testnet, devnet) + Lux primary C-Chain × 3 envs. * * Brand L1s share Lux primary-network validators (network IDs 1/2/3) and * each carries its own EVM chainId per env. RPC pattern: * https://api.lux.network/ext/bc//rpc (mainnet) * https://api.lux-test.network/ext/bc//rpc (testnet) * https://api.lux-dev.network/ext/bc//rpc (devnet) * * NEVER conflate primary networkId (1/2/3/1337) with EVM chainId (per-subnet, * per-env). See user CLAUDE.md "Network ID vs EVM Chain ID — NEVER CONFLATE". */ import { defineChain } from 'viem' // ─── RPC base URLs (per env) ───────────────────────────────────────── const RPC_MAINNET = 'https://api.lux.network' const RPC_TESTNET = 'https://api.lux-test.network' const RPC_DEVNET = 'https://api.lux-dev.network' const EXPLORE_MAINNET = 'https://explore.lux.network' const EXPLORE_TESTNET = 'https://explore.lux-test.network' const EXPLORE_DEVNET = 'https://explore.lux-dev.network' // Standard multicall3 deployed across every Lux-derived chain. const MULTICALL3 = '0xd25F88CBdAe3c2CCA3Bb75FC4E723b44C0Ea362F' as const // ─── Lux Primary C-Chain (each env) ────────────────────────────────── export const luxMainnet = defineChain({ id: 96369, name: 'Lux Mainnet', nativeCurrency: { name: 'LUX', symbol: 'LUX', decimals: 18 }, rpcUrls: { default: { http: [`${RPC_MAINNET}/ext/bc/C/rpc`] }, public: { http: [`${RPC_MAINNET}/ext/bc/C/rpc`] }, }, blockExplorers: { default: { name: 'Lux Explorer', url: EXPLORE_MAINNET }, }, contracts: { multicall3: { address: MULTICALL3 } }, }) export const luxTestnet = defineChain({ id: 96368, name: 'Lux Testnet', nativeCurrency: { name: 'LUX', symbol: 'LUX', decimals: 18 }, rpcUrls: { default: { http: [`${RPC_TESTNET}/ext/bc/C/rpc`] }, public: { http: [`${RPC_TESTNET}/ext/bc/C/rpc`] }, }, blockExplorers: { default: { name: 'Lux Testnet Explorer', url: EXPLORE_TESTNET }, }, contracts: { multicall3: { address: MULTICALL3 } }, testnet: true, }) export const luxDevnet = defineChain({ id: 96367, name: 'Lux Devnet', nativeCurrency: { name: 'LUX', symbol: 'LUX', decimals: 18 }, rpcUrls: { default: { http: [`${RPC_DEVNET}/ext/bc/C/rpc`] }, public: { http: [`${RPC_DEVNET}/ext/bc/C/rpc`] }, }, blockExplorers: { default: { name: 'Lux Devnet Explorer', url: EXPLORE_DEVNET }, }, contracts: { multicall3: { address: MULTICALL3 } }, testnet: true, }) // ─── Hanzo Brand L1 (per env) — Hanzo AI ───────────────────────────── export const hanzoMainnet = defineChain({ id: 36963, name: 'Hanzo Mainnet', nativeCurrency: { name: 'HANZO', symbol: 'HANZO', decimals: 18 }, rpcUrls: { default: { http: [`${RPC_MAINNET}/ext/bc/hanzo/rpc`] }, public: { http: [`${RPC_MAINNET}/ext/bc/hanzo/rpc`] }, }, blockExplorers: { default: { name: 'Hanzo Explorer', url: `${EXPLORE_MAINNET}/hanzo` }, }, }) export const hanzoTestnet = defineChain({ id: 36964, name: 'Hanzo Testnet', nativeCurrency: { name: 'HANZO', symbol: 'HANZO', decimals: 18 }, rpcUrls: { default: { http: [`${RPC_TESTNET}/ext/bc/hanzo/rpc`] }, public: { http: [`${RPC_TESTNET}/ext/bc/hanzo/rpc`] }, }, blockExplorers: { default: { name: 'Hanzo Testnet Explorer', url: `${EXPLORE_TESTNET}/hanzo` }, }, testnet: true, }) export const hanzoDevnet = defineChain({ id: 36964, name: 'Hanzo Devnet', nativeCurrency: { name: 'HANZO', symbol: 'HANZO', decimals: 18 }, rpcUrls: { default: { http: [`${RPC_DEVNET}/ext/bc/hanzo/rpc`] }, public: { http: [`${RPC_DEVNET}/ext/bc/hanzo/rpc`] }, }, blockExplorers: { default: { name: 'Hanzo Devnet Explorer', url: `${EXPLORE_DEVNET}/hanzo` }, }, testnet: true, }) // ─── Zoo Brand L1 (per env) — Zoo Labs Foundation ──────────────────── export const zooMainnet = defineChain({ id: 200200, name: 'Zoo Network', nativeCurrency: { name: 'ZOO', symbol: 'ZOO', decimals: 18 }, rpcUrls: { default: { http: [`${RPC_MAINNET}/ext/bc/zoo/rpc`] }, public: { http: [`${RPC_MAINNET}/ext/bc/zoo/rpc`] }, }, blockExplorers: { default: { name: 'Zoo Explorer', url: 'https://explore.zoo.network' }, }, }) export const zooTestnet = defineChain({ id: 200201, name: 'Zoo Testnet', nativeCurrency: { name: 'ZOO', symbol: 'ZOO', decimals: 18 }, rpcUrls: { default: { http: [`${RPC_TESTNET}/ext/bc/zoo/rpc`] }, public: { http: [`${RPC_TESTNET}/ext/bc/zoo/rpc`] }, }, blockExplorers: { default: { name: 'Zoo Testnet Explorer', url: 'https://explore.zoo-test.network' }, }, testnet: true, }) export const zooDevnet = defineChain({ id: 200202, name: 'Zoo Devnet', nativeCurrency: { name: 'ZOO', symbol: 'ZOO', decimals: 18 }, rpcUrls: { default: { http: [`${RPC_DEVNET}/ext/bc/zoo/rpc`] }, public: { http: [`${RPC_DEVNET}/ext/bc/zoo/rpc`] }, }, blockExplorers: { default: { name: 'Zoo Devnet Explorer', url: 'https://explore.zoo-dev.network' }, }, testnet: true, }) // ─── Pars Brand L1 (per env) — Pars DAO (Persian/Iranian community) ── export const parsMainnet = defineChain({ id: 7070, name: 'Pars Mainnet', nativeCurrency: { name: 'PARS', symbol: 'PARS', decimals: 18 }, rpcUrls: { default: { http: [`${RPC_MAINNET}/ext/bc/pars/rpc`] }, public: { http: [`${RPC_MAINNET}/ext/bc/pars/rpc`] }, }, blockExplorers: { default: { name: 'Pars Explorer', url: `${EXPLORE_MAINNET}/pars` }, }, }) export const parsTestnet = defineChain({ id: 494950, name: 'Pars Testnet', nativeCurrency: { name: 'PARS', symbol: 'PARS', decimals: 18 }, rpcUrls: { default: { http: [`${RPC_TESTNET}/ext/bc/pars/rpc`] }, public: { http: [`${RPC_TESTNET}/ext/bc/pars/rpc`] }, }, blockExplorers: { default: { name: 'Pars Testnet Explorer', url: `${EXPLORE_TESTNET}/pars` }, }, testnet: true, }) export const parsDevnet = defineChain({ id: 494951, name: 'Pars Devnet', nativeCurrency: { name: 'PARS', symbol: 'PARS', decimals: 18 }, rpcUrls: { default: { http: [`${RPC_DEVNET}/ext/bc/pars/rpc`] }, public: { http: [`${RPC_DEVNET}/ext/bc/pars/rpc`] }, }, blockExplorers: { default: { name: 'Pars Devnet Explorer', url: `${EXPLORE_DEVNET}/pars` }, }, testnet: true, }) // ─── SPC Brand L1 (per env) ────────────────────────────────────────── export const spcMainnet = defineChain({ id: 36911, name: 'SPC Mainnet', nativeCurrency: { name: 'SPC', symbol: 'SPC', decimals: 18 }, rpcUrls: { default: { http: [`${RPC_MAINNET}/ext/bc/spc/rpc`] }, public: { http: [`${RPC_MAINNET}/ext/bc/spc/rpc`] }, }, blockExplorers: { default: { name: 'SPC Explorer', url: `${EXPLORE_MAINNET}/spc` }, }, }) export const spcTestnet = defineChain({ id: 36910, name: 'SPC Testnet', nativeCurrency: { name: 'SPC', symbol: 'SPC', decimals: 18 }, rpcUrls: { default: { http: [`${RPC_TESTNET}/ext/bc/spc/rpc`] }, public: { http: [`${RPC_TESTNET}/ext/bc/spc/rpc`] }, }, blockExplorers: { default: { name: 'SPC Testnet Explorer', url: `${EXPLORE_TESTNET}/spc` }, }, testnet: true, }) export const spcDevnet = defineChain({ id: 36912, name: 'SPC Devnet', nativeCurrency: { name: 'SPC', symbol: 'SPC', decimals: 18 }, rpcUrls: { default: { http: [`${RPC_DEVNET}/ext/bc/spc/rpc`] }, public: { http: [`${RPC_DEVNET}/ext/bc/spc/rpc`] }, }, blockExplorers: { default: { name: 'SPC Devnet Explorer', url: `${EXPLORE_DEVNET}/spc` }, }, testnet: true, }) // ─── Osage Brand L1 (per env) — Osage Nation ───────────────────────── export const osageMainnet = defineChain({ id: 1872, name: 'Osage Mainnet', nativeCurrency: { name: 'OSAGE', symbol: 'OSAGE', decimals: 18 }, rpcUrls: { default: { http: [`${RPC_MAINNET}/ext/bc/osage/rpc`] }, public: { http: [`${RPC_MAINNET}/ext/bc/osage/rpc`] }, }, blockExplorers: { default: { name: 'Osage Explorer', url: `${EXPLORE_MAINNET}/osage` }, }, }) export const osageTestnet = defineChain({ id: 1871, name: 'Osage Testnet', nativeCurrency: { name: 'OSAGE', symbol: 'OSAGE', decimals: 18 }, rpcUrls: { default: { http: [`${RPC_TESTNET}/ext/bc/osage/rpc`] }, public: { http: [`${RPC_TESTNET}/ext/bc/osage/rpc`] }, }, blockExplorers: { default: { name: 'Osage Testnet Explorer', url: `${EXPLORE_TESTNET}/osage` }, }, testnet: true, }) export const osageDevnet = defineChain({ id: 1873, name: 'Osage Devnet', nativeCurrency: { name: 'OSAGE', symbol: 'OSAGE', decimals: 18 }, rpcUrls: { default: { http: [`${RPC_DEVNET}/ext/bc/osage/rpc`] }, public: { http: [`${RPC_DEVNET}/ext/bc/osage/rpc`] }, }, blockExplorers: { default: { name: 'Osage Devnet Explorer', url: `${EXPLORE_DEVNET}/osage` }, }, testnet: true, }) // ─── Lux Dev (local --dev node) ────────────────────────────────────── export const luxDev = defineChain({ id: 1337, name: 'Lux Dev', nativeCurrency: { name: 'LUX', symbol: 'LUX', decimals: 18 }, rpcUrls: { default: { http: ['http://localhost:8545/ext/bc/C/rpc'] }, public: { http: ['http://localhost:8545/ext/bc/C/rpc'] }, }, blockExplorers: { default: { name: 'Dev', url: 'http://localhost:8545' }, }, testnet: false, }) // ─── Chain ID exports ──────────────────────────────────────────────── // Lux primary C-Chain per env export const LUX_MAINNET_ID = 96369 export const LUX_TESTNET_ID = 96368 export const LUX_DEVNET_ID = 96367 export const LUX_DEV_ID = 1337 // Hanzo brand L1 per env export const HANZO_MAINNET_ID = 36963 export const HANZO_TESTNET_ID = 36964 export const HANZO_DEVNET_ID = 36964 // Zoo brand L1 per env export const ZOO_MAINNET_ID = 200200 export const ZOO_TESTNET_ID = 200201 export const ZOO_DEVNET_ID = 200202 // Pars brand L1 per env export const PARS_MAINNET_ID = 7070 export const PARS_TESTNET_ID = 494950 export const PARS_DEVNET_ID = 494951 // SPC brand L1 per env export const SPC_MAINNET_ID = 36911 export const SPC_TESTNET_ID = 36910 export const SPC_DEVNET_ID = 36912 // Osage brand L1 per env export const OSAGE_MAINNET_ID = 1872 export const OSAGE_TESTNET_ID = 1871 export const OSAGE_DEVNET_ID = 1873 // ─── Chain groupings ───────────────────────────────────────────────── /** All Lux-network chains across all envs (3 envs × 6 chains = 18). */ export const allLuxChains = [ // mainnet luxMainnet, hanzoMainnet, zooMainnet, parsMainnet, spcMainnet, osageMainnet, // testnet luxTestnet, hanzoTestnet, zooTestnet, parsTestnet, spcTestnet, osageTestnet, // devnet luxDevnet, hanzoDevnet, zooDevnet, parsDevnet, spcDevnet, osageDevnet, ] as const /** Mainnet-only chains (6). */ export const mainnetChains = [ luxMainnet, hanzoMainnet, zooMainnet, parsMainnet, spcMainnet, osageMainnet, ] as const /** Testnet-only chains (6). */ export const testnetChains = [ luxTestnet, hanzoTestnet, zooTestnet, parsTestnet, spcTestnet, osageTestnet, ] as const /** Devnet-only chains (6). */ export const devnetChains = [ luxDevnet, hanzoDevnet, zooDevnet, parsDevnet, spcDevnet, osageDevnet, ] as const /** * Default exchange-supported chains. * * NOTE: This is a back-compat alias for the previous (lux+zoo only) set. New * code should import allLuxChains / mainnetChains / testnetChains / * devnetChains depending on the env, or use canonicalChains for the full set. */ export const supportedChains = [ luxMainnet, luxTestnet, zooMainnet, zooTestnet, luxDev, ] as const /** * canonicalChains — every Lux-network chain (5 brand L1s × 3 envs + Lux * primary C × 3 envs) + the local dev chain. White-label exchanges narrow * this to their brand by filtering on chain.id. */ export const canonicalChains = [...allLuxChains, luxDev] as const export type SupportedChainId = (typeof supportedChains)[number]['id'] export type CanonicalChainId = (typeof canonicalChains)[number]['id']