export type GetApiGetPoolsBlockchainIdRegistryIdArgs = {blockchainId: 'ethereum' | 'arbitrum' | 'aurora' | 'avalanche' | 'base' | 'bsc' | 'celo' | 'fantom' | 'fraxtal' | 'harmony' | 'hyperliquid' | 'kava' | 'mantle' | 'moonbeam' | 'optimism' | 'polygon' | 'sonic' | 'x-layer' | 'xdai' | 'zkevm' | 'zksync', registryId: 'factory' | 'main' | 'crypto' | 'factory-crypto' | 'factory-crvusd' | 'factory-twocrypto' | 'factory-tricrypto' | 'factory-eywa' | 'factory-stable-ng'}; export type GetApiGetPoolsBlockchainIdRegistryIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Returns information on all pools, in a specific registry, on a specific chain. * * GET /getPools/{blockchainId}/{registryId} */ export const getApiGetPoolsBlockchainIdRegistryId = async (args: GetApiGetPoolsBlockchainIdRegistryIdArgs, options?: GetApiGetPoolsBlockchainIdRegistryIdOptions) => { const {baseUrl = "https://api.curve.finance/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/getPools/${encodeURIComponent(String(args.blockchainId))}/${encodeURIComponent(String(args.registryId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };