/** * Chain-ID validation for public SDK entry points. * * Two distinct failure modes are covered here, and they are deliberately kept * separate because they have different remediations: * * 1. **Unknown chain ID** — the caller passed an ID the SDK has no concept of * (a typo, a stale constant, an off-by-one on a non-EVM synthetic ID). No * configuration can make this work; the call site is wrong. * 2. **Known EVM chain, no RPC configured** — the ID is valid but the SDK was * constructed without a provider for it. Remediated by passing an RPC URL. * * Both used to be logged-and-ignored, letting execution continue with an * `undefined` RPC URL. That produced a cascade of misleading downstream * failures (`connect ECONNREFUSED 127.0.0.1:8545` from ethers' localhost * default, `missing revert data` from `decimals()` reads issued against the * wrong chain, and `TypeError: Cannot read properties of undefined`). Failing * fast at the boundary replaces that cascade with one actionable error. * * @module core/helpers/chain-support */ /** * Whether `chainId` is an EVM chain the SDK knows about (i.e. has an entry in * {@link NETWORKS}). * * @param chainId - Numeric chain ID to test. * @returns `true` for supported EVM chains, `false` for non-EVM synthetic IDs * (Solana, Stellar, Sui) and for anything unrecognised. */ export declare function isEvmChainId(chainId: number): boolean; /** * Whether `chainId` is recognised by the SDK at all — either a supported EVM * chain or one of the non-EVM chain IDs in {@link NON_EVM_CHAIN_IDS}. * * @param chainId - Numeric chain ID to test. * @returns `true` when the ID maps to a chain the SDK can route to. */ export declare function isKnownChainId(chainId: number): boolean; /** * Throw when `chainId` is not a chain the SDK recognises. * * Called at public vault entry points so an unroutable ID surfaces as one * typed error instead of an opaque downstream RPC failure. * * @param chainId - Chain ID supplied by the caller. `undefined` is a no-op — * omitting the chain is valid and falls back to the SDK's active network. * @param providers - The SDK's configured `chainId → RPC URL` map. A chain * with a caller-configured provider is routable even if it is missing from * {@link NETWORKS} (the SDK ships fallback RPCs/oracles for some EVM chains * ahead of adding them to `NETWORKS`), so it is accepted here too. * @param method - Public method name, used to make the message actionable. * @throws {@link AugustValidationError} with code `INVALID_CHAIN` when the ID * is not in {@link NETWORKS} or {@link NON_EVM_CHAIN_IDS}, and has no * caller-configured provider. * @example * ```ts * assertKnownChainId(-2, undefined, 'getVault'); * // AugustValidationError: getVault: unknown chainId -2. * ``` */ export declare function assertKnownChainId(chainId: number | undefined, providers: Partial> | undefined, method: string): void; /** * Throw when a known EVM `chainId` has no RPC URL configured on the SDK. * * Non-EVM chain IDs are exempt: Solana, Stellar and Sui vaults route through * their adapters and never read from the `providers` map, so a missing entry * is expected rather than a misconfiguration. * * @param chainId - Chain ID supplied by the caller. `undefined` is a no-op. * @param providers - The SDK's configured `chainId → RPC URL` map. * @param method - Public method name, used to make the message actionable. * @throws {@link AugustValidationError} with code `INVALID_CHAIN` when * `chainId` is an EVM chain with no configured provider. * @example * ```ts * assertEvmProviderConfigured(143, {}, 'getVault'); * // AugustValidationError: getVault: no RPC URL configured for chainId 143 (Monad). * ``` */ export declare function assertEvmProviderConfigured(chainId: number | undefined, providers: Partial> | undefined, method: string): void;