declare const DEFAULT_ENV_ID = "paseo-next-v2"; interface PopSelfServeConfig { /** The label users select in the sudo.personhood.dev env dropdown — e.g. "Next V2". */ sudoEnvLabel: string; /** Faucet URL for funding the service account on this env. Omit on envs with no public faucet (accounts funded by ops). */ faucetUrl?: string; /** Personhood recognition flow URL on the sudo app. */ personhoodFaucetUrl: string; /** Asset-Hub alias-binding flow URL on the sudo app. */ dotnsBootstrapUrl: string; /** * Whether state-aware remediation messages (not-bound / bound-likely-stale / wrong-context) * can be offered for this env. Requires the reprove tooling to know the env and the user * to have access to the dotns-bootstrap UI. Defaults to false; opt in per-env. */ stateAwareGuidance?: boolean; } interface Environment { id: string; name: string; network: "testnet" | "mainnet"; description?: string; badge?: string; backend?: string; ipfs?: string; /** * Host serving the browser SPA that resolves DotNS names for this env * (issue #142). Defaults to "dot.li" when omitted — set this only when an * env's names are NOT resolvable via the default gateway (e.g. devnet-family * envs, which are served by "dev-dot.li"). */ webGateway?: string; /** * DotNS TLD for names registered on this environment (e.g. "paseo" on * paseo-next-v2 following its redeploy; "dot" on previewnet). Defaults to * "dot" (DEFAULT_TLD in src/dotns.ts) when omitted — set this only when an * env's DotNS deployment uses a non-default suffix. */ tld?: string; uptimeUrl?: string; autoAccountMapping?: boolean; nativeToEthRatio?: number; registerStorageDeposit?: number; contracts?: Record; popSelfServe?: PopSelfServeConfig; bulletinAutoAuthorize?: boolean; bulletinAuthorizer?: string; } interface ChainEndpoint { wss: string | string[]; parachainId?: number; uptimeUrl?: string; } interface Chain { id: string; name: string; endpoints: Record; } interface EnvironmentsDoc { environments: Environment[]; chains: Chain[]; } type EnvironmentsSource = "bundled" | "hardcoded-fallback" | "file"; interface LoadResult { doc: EnvironmentsDoc; source: EnvironmentsSource; } interface LoadOptions { bundledPath?: string; /** Explicit path to a user-supplied environments JSON file (deep-merged over bundled). */ userFilePath?: string; warn?: (msg: string) => void; capture?: (err: unknown) => void; } interface ResolvedEndpoints { bulletin: string[]; assetHub: string[]; network: "testnet" | "mainnet"; envName: string; ipfs?: string; webGateway?: string; /** Undefined when the env doesn't declare one — callers fall back to DEFAULT_TLD ("dot") at the point of use, same convention as webGateway. */ tld?: string; autoAccountMapping: boolean; contracts: Record; nativeToEthRatio: bigint; registerStorageDeposit?: bigint; bulletinAutoAuthorize: boolean; bulletinAuthorizer?: string; } declare function defaultBundledPath(): string; /** * Returns true for a well-formed, non-zero EVM address: * - 0x-prefixed, exactly 42 characters (0x + 40 hex digits) * - not the all-zeros address * * Does NOT require EIP-55 checksum — addresses in environments.json may be * stored in any casing and the validation goal is structural correctness. */ declare function isValidContractAddress(addr: unknown): boolean; /** * Validates all contract addresses in the given contracts map. * * Throws a clear error for the first invalid address found. * Does NOT throw when the map is empty or a key is absent — the map is sparse * by design (not all environments have contracts configured). * * @param contracts The `contracts` record from an environment entry. * @param envId The environment ID, used in the error message. */ declare function validateContractAddresses(contracts: Record, envId: string): void; /** * Deep-merges a user-supplied partial EnvironmentsDoc over a base doc. * * - `environments` and `chains` arrays are merged by `id`: a user entry with a * matching id is recursively merged into the base entry; unmatched user entries * are appended. * - Within each entry, nested plain objects (e.g. `contracts`, `endpoints`) are * merged key-by-key; scalars and arrays (e.g. `wss`) replace wholesale. * - Top-level fields not present in the user doc are kept from base. */ declare function deepMergeEnvironments(base: EnvironmentsDoc, override: Partial): EnvironmentsDoc; declare function loadEnvironments(opts?: LoadOptions): Promise; declare function resolveEndpoints(doc: EnvironmentsDoc, envId: string): ResolvedEndpoints; declare function getPopSelfServeConfig(doc: EnvironmentsDoc, envId: string): PopSelfServeConfig | null; interface EnvironmentListing { id: string; name: string; network: string; hasBulletin: boolean; description: string; } declare function listEnvironments(doc: EnvironmentsDoc): EnvironmentListing[]; declare function formatEnvironmentTable(rows: EnvironmentListing[]): string; export { type Chain, type ChainEndpoint, DEFAULT_ENV_ID, type Environment, type EnvironmentListing, type EnvironmentsDoc, type EnvironmentsSource, type LoadOptions, type LoadResult, type PopSelfServeConfig, type ResolvedEndpoints, deepMergeEnvironments, defaultBundledPath, formatEnvironmentTable, getPopSelfServeConfig, isValidContractAddress, listEnvironments, loadEnvironments, resolveEndpoints, validateContractAddresses };