/** Selection is fixed at server startup / browser build, never learned from an untrusted RPC. */ export type NetworkProfile = 'testnet' | 'mainnet' | 'pilot'; export function networkProfile(value: string | undefined): NetworkProfile { const profile = value ?? 'testnet'; if (profile !== 'testnet' && profile !== 'mainnet' && profile !== 'pilot') { throw new Error('WIKIDECK_NETWORK must be testnet, mainnet, or pilot'); } return profile; } export const PROFILE = networkProfile(typeof process !== 'undefined' && process.versions?.node ? process.env.WIKIDECK_NETWORK : import.meta.env?.VITE_WIKIDECK_NETWORK); export const IS_MAINNET = PROFILE === 'mainnet'; export const IS_PILOT = PROFILE === 'pilot'; export const NETWORK = IS_MAINNET ? 'wikideck-randomx-mainnet-1' as const : IS_PILOT ? 'wikideck-randomx-pilot-1' as const : 'wikideck-randomx-testnet-6' as const; // Candidate mainnet genesis: 2027-01-01 00:00 UTC. NOT a commitment to a launch date. export const NETWORK_GENESIS_TIME = IS_MAINNET ? 1_798_761_600 : IS_PILOT ? 1_792_627_200 : 1_792_411_200; export const NETWORK_LABEL = IS_MAINNET ? 'MAINNET CANDIDATE' : IS_PILOT ? 'PRIVATE PILOT' : 'TESTNET';