import type { Address, Chain } from "viem"; import { z } from "zod/v4"; /** * Known curator names that manage Gearbox markets. * **/ export type Curator = "Chaos Labs" | "K3" | "cp0x" | "Re7" | "Invariant Group" | "Tulipa" | "M11 Credit" | "KPK" | "Hyperithm" | "UltraYield" | "TelosC" | "Gami Labs" | "Securitize"; /** * Extended viem {@link Chain} with Gearbox-specific metadata. * * Every supported network is represented by a `GearboxChain` instance in * the {@link chains} record. **/ export interface GearboxChain extends Chain { /** * Gearbox network type label (e.g. `"Mainnet"`, `"Arbitrum"`). **/ network: NetworkType; /** * Market configurator addresses operated by known curators on this chain. **/ defaultMarketConfigurators: Record; /** * Known RWA factory addresses on this chain */ rwaFactories: Address[]; /** * Market configurators used in test/staging environments. **/ testMarketConfigurators?: Record; /** * Whether this chain is production-ready **/ isPublic: boolean; /** * A well-known ERC-20 token that uniquely identifies this chain. * * Used by {@link detectNetwork} to determine which chain an arbitrary * RPC endpoint is connected to. **/ wellKnownToken: { address: Address; symbol: string; }; /** * Block number when the Gearbox address provider was deployed. **/ firstBlock?: bigint; /** * Default read-only calls gas limit for this chain. */ gasLimit: bigint; } /** * Tuple of all network labels the SDK can work with. **/ export declare const SUPPORTED_NETWORKS: readonly ["Mainnet", "Arbitrum", "Optimism", "Base", "Sonic", "MegaETH", "Monad", "Berachain", "Avalanche", "BNB", "WorldChain", "Etherlink", "Hemi", "Lisk", "Plasma", "Somnia"]; /** * Zod schema for validating/parsing network type strings. **/ export declare const NetworkType: z.ZodEnum<{ Mainnet: "Mainnet"; Arbitrum: "Arbitrum"; Optimism: "Optimism"; Base: "Base"; Sonic: "Sonic"; MegaETH: "MegaETH"; Monad: "Monad"; Berachain: "Berachain"; Avalanche: "Avalanche"; BNB: "BNB"; WorldChain: "WorldChain"; Etherlink: "Etherlink"; Hemi: "Hemi"; Lisk: "Lisk"; Plasma: "Plasma"; Somnia: "Somnia"; }>; /** * All supported Gearbox network labels **/ export type NetworkType = z.infer; /** * Pre-configured {@link GearboxChain} instances for every supported network. **/ export declare const chains: Record; /** * Returns the {@link GearboxChain} for a given chain ID or network type label. * * @param chainIdOrNetworkType - Numeric chain ID, bigint chain ID, or a {@link NetworkType} string. * @throws If the chain ID / network type is not supported. **/ export declare function getChain(chainIdOrNetworkType: number | bigint | NetworkType): GearboxChain; /** * Resolves a numeric chain ID to its {@link NetworkType} label. * * @param chainId - Numeric or bigint chain ID. * @throws If the chain ID does not correspond to a supported network. **/ export declare function getNetworkType(chainId: number | bigint): NetworkType; /** * Type guard that checks whether a chain ID belongs to a supported Gearbox network. * * @param chainId - Numeric chain ID, or `undefined`. **/ export declare function isSupportedNetwork(chainId: number | undefined): chainId is number; /** * Returns `true` if the given network or chain ID has a publicly deployed Gearbox instance. * * @param networkOrChainId - {@link NetworkType} string or numeric chain ID. **/ export declare function isPublicNetwork(networkOrChainId: NetworkType | number | bigint): boolean; /** * Looks up the {@link Curator} name for a market configurator address. * * Searches default and test market configurators across all chains, or * a single network if provided. * * @param marketConfigurator - On-chain market configurator address. * @param network - Optional network to restrict the search to. * @returns The curator name, or `undefined` if not found. **/ export declare function getCuratorName(marketConfigurator: Address, network?: NetworkType): Curator | undefined; /** * Finds the market configurator address for a given curator on a network. * * @param curator - Curator name to search for. * @param network - Network to search in. * @returns The market configurator address, or `undefined` if the curator * has no configurator on this network. **/ export declare function findCuratorMarketConfigurator(curator: Curator, network: NetworkType): Address | undefined;