import type { NetworkType } from "./chain/chains.js"; import { type PythOptions, type RedstoneOptions } from "./market/pricefeeds/updates/index.js"; import { type AttachOptions, type ClientOptions, type HydrateOptions, OnchainSDK } from "./OnchainSDK.js"; import type { PluginFactoriesMap, PluginsMap } from "./plugins/index.js"; import type { ILogger, MultichainState, MultichainStateHuman } from "./types/index.js"; /** * Per-chain configuration for {@link MultichainSDK}. **/ export interface ChainConfig { /** * Gas limit for read-only `eth_call` requests. `null` disables, `undefined` uses default. **/ gasLimit?: bigint | null; } /** * Options for creating a {@link MultichainSDK} instance. * * @typeParam Plugins - Map of plugin names to plugin instances. **/ export interface MultichainSDKOptions { /** * Per-chain client and configuration. **/ chains: Partial>; /** * Plugin factories — called once per chain to produce independent instances. **/ plugins?: PluginFactoriesMap; /** * Shared default logger **/ logger?: ILogger; /** * When `true`, throw on unrecognised contract types instead of falling back to a generic contract wrapper. **/ strictContractTypes?: boolean; /** * Default gas limit for read-only `eth_call` requests on all chains. `null` disables, `undefined` uses default. **/ gasLimit?: bigint | null; } /** * Options for {@link MultichainSDK.attach}. **/ export interface MultichainAttachOptions { /** * Per-chain attach options. **/ perChain?: Partial>; /** * Options for Redstone price-feed updates (shared cache across chains). **/ redstone?: RedstoneOptions; /** * Options for Pyth price-feed updates (shared cache across chains). **/ pyth?: PythOptions; } /** * Options for {@link MultichainSDK.hydrate}. **/ export interface MultichainHydrateOptions { /** * Per-chain hydrate options. **/ perChain?: Partial>; /** * Options for Redstone price-feed updates (shared cache across chains). **/ redstone?: RedstoneOptions; /** * Options for Pyth price-feed updates (shared cache across chains). **/ pyth?: PythOptions; /** * When `true`, chains missing from the serialised state are silently skipped * instead of throwing {@link SdkMissingChainStateError}. * * Useful when a deprecated chain is no longer included in cached state snapshots * but users still need it in legacy mode to exit existing positions. **/ allowMissingChains?: boolean; } /** * Options for {@link MultichainSDK.syncState}. **/ export interface MultichainSyncStateOptions { /** * When `true`, skip refreshing updatable price feeds. **/ ignoreUpdateablePrices?: boolean; } /** * Thin wrapper around multiple {@link OnchainSDK} instances, one per chain. * * @typeParam Plugins - Map of plugin names to plugin instances. **/ export declare class MultichainSDK { #private; constructor(options: MultichainSDKOptions); /** * Attach all configured chains in parallel. * * @param options - Shared and per-chain attach options. */ attach(options?: MultichainAttachOptions): Promise; /** * Hydrate all configured chains from serialised state. * * @param state - Multichain serialised state. * @param options - Shared and per-chain hydrate options. * @throws {@link SdkStateVersionMismatchError} if version doesn't match. * @throws {@link SdkMissingChainStateError} if a configured chain has no * state and `allowMissingChains` is not set. */ hydrate(state: MultichainState, options?: MultichainHydrateOptions): void; /** * Returns the {@link OnchainSDK} for a given network or chain ID. * * @param networkOrChainId - Network type string or numeric chain ID. * @throws If the network/chain is not configured. */ chain(networkOrChainId: NetworkType | number): OnchainSDK; /** * Read-only map of all configured chains. **/ get chains(): ReadonlyMap>; /** * Sync state for all chains in parallel. * * @param opts - Sync options. * @throws {@link SdkSyncFailedError} if any chain fails. */ syncState(opts?: MultichainSyncStateOptions): Promise; /** * Serialisable snapshot of all chains' state. **/ get state(): MultichainState; /** * Human-readable snapshot of all chains' state. * @param raw - When `true`, include raw numeric values. */ stateHuman(raw?: boolean): MultichainStateHuman; }