import { Chain, ChainConfig } from './Chain'; type ChainCtor = (new (config: ChainConfig) => Chain) & { defaults: Partial; }; /** * The ONE place the root config's provider block is read. A multi-domain root * keeps it at `[default.provider]` (epistery-host); a single-domain root at * `[provider]` — the same thing, the provider a domain uses when its own * config names none. Undefined when the root names neither. */ export declare function rootProvider(rootData: any): ChainConfig | undefined; /** * Register a Chain subclass for a given chainId. Overwrites any existing * entry — last write wins, so a downstream app can override a built-in if it * wants different fee policy. */ export declare function registerChain(chainId: number, ctor: ChainCtor): void; /** * Get a Chain instance for the given provider config. The caller's config * is merged ON TOP of the subclass's built-in defaults, so only chainId is * strictly required — everything else (name, rpc, currency) comes from the * chain class if not explicitly overridden. * * This means a host installation only needs to set `privateRpc` in * `~/.epistery/config.ini` for chains where the public RPC is insufficient; * all other details live in the chain class. * * If no subclass is registered for the chainId, returns a generic Chain — * which uses pure EIP-1559 with no floors and the standard estimateGas. */ export declare function chainFor(config: ChainConfig): Chain; /** * Return the built-in chain list — one entry per registered chain, using * each subclass's defaults. This is the authoritative network list for * UI dropdowns. No root config needed. */ export declare function registeredChains(): ChainConfig[]; /** * Return the chain list with `privateRpc` overlaid from root config. * * Looks in `~/.epistery/config.ini` for: * - `[default.rpc.] privateRpc = ...` (per-chain override) * - the root provider block (`rootProvider`), for its own chain * * Chains without a config override are returned unchanged. */ export declare function configuredChains(): Promise; /** * How a chain's ATTESTATION reads are answered — the owned nodes, and how many of * them must assert an answer (EpisteryChainReads, Proposal A). Root config (the * Authority's, where the process has one): * * [chains.polygon] * attest[] = https://node1.example/ * attest[] = https://node2.example/ * attest[] = https://node3.example/ * quorum = 2 ; k of n, like a multisig — unset: a majority of the nodes * * The section is named by any selector findChain accepts (alias, name, chainId). * Each host sets its own strictness. No node configured is a misconfiguration: it * throws — an attestation read never falls through to a public or foreign endpoint. */ export declare function attestationConfig(chainId: number | string): Promise<{ rpcs: string[]; quorum: number | null; }>; /** * Return the configured default chainId from root config. * * Checks `[default] defaultChainId`, then the root provider block's chainId, * falling back to Polygon mainnet (137). */ export declare function defaultChainId(): Promise; /** Visible for tests / debug. Returns true if a chainId has a registered subclass. */ export declare function hasRegisteredChain(chainId: number): boolean; /** Visible for tests / debug. Returns the list of registered chainIds. */ export declare function registeredChainIds(): number[]; /** * Resolve a user-supplied chain selector to a chain config. * * Accepts a chainId (`137`), one of the chain's aliases (`polygon`, `pol`), * or its name (`"Polygon Mainnet"`, `polygon-mainnet`) — matching is * case-insensitive and ignores spaces, dashes and underscores. A name may be * abbreviated as long as exactly one chain matches; an ambiguous * abbreviation throws with the candidates. * * Returns the *configured* chain (privateRpc overlaid from root config), or * null when nothing matches, so callers can print the available list. */ export declare function findChain(selector: string | number): Promise; /** * Resolve the chain a new wallet should use when the caller didn't name one: * root config's `[default] defaultChainId` / the root provider's chainId, * else Polygon mainnet. Falls back to the raw root provider block when that * chainId has no registered subclass, so a hand-configured chain keeps * working. */ export declare function defaultChain(): Promise; /** * Set the chain used by default for new wallets, in root config. Writes both * `[default] defaultChainId` and the `[default.provider]` block so consumers * that read either one agree. Returns the chain that was set. */ export declare function setDefaultChain(selector: string | number): Promise; /** * Flatten a chain into the `provider` block shape stored in config.ini * (domain configs and root `[default.provider]`). The stored `rpc` is the * one the server sends through (serverRpcOf). */ export declare function providerConfigFor(chain: ChainConfig): ChainConfig; export {}; //# sourceMappingURL=registry.d.ts.map