import { Chain, ChainConfig } from './Chain'; type ChainCtor = (new (config: ChainConfig) => Chain) & { defaults: Partial; }; /** * 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) * - `[default.provider] privateRpc / rpc` (legacy single-chain fallback) * * Chains without a config override are returned unchanged. */ export declare function configuredChains(): Promise; /** * Return the configured default chainId from root config. * * Checks `[default] defaultChainId`, then `[default.provider] 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` / `[default.provider] chainId`, * else Polygon mainnet. Falls back to the raw `[default.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]`). Prefers a configured * privateRpc over the chain's public RPC. */ export declare function providerConfigFor(chain: ChainConfig): ChainConfig; export {}; //# sourceMappingURL=registry.d.ts.map