export type GetApiGetFactoryV2PoolsBlockchainIdArgs = {blockchainId: 'ethereum' | 'arbitrum' | 'aurora' | 'avalanche' | 'base' | 'bsc' | 'celo' | 'fantom' | 'fraxtal' | 'harmony' | 'hyperliquid' | 'kava' | 'mantle' | 'moonbeam' | 'optimism' | 'polygon' | 'sonic' | 'x-layer' | 'xdai' | 'zkevm' | 'zksync'}; export type GetApiGetFactoryV2PoolsBlockchainIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deprecated: please use `getPools/{blockchainId}/factory` instead * * GET /getFactoryV2Pools/{blockchainId} */ export const getApiGetFactoryV2PoolsBlockchainId = async (args: GetApiGetFactoryV2PoolsBlockchainIdArgs, options?: GetApiGetFactoryV2PoolsBlockchainIdOptions) => { const {baseUrl = "https://api.curve.finance/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/getFactoryV2Pools/${encodeURIComponent(String(args.blockchainId))}${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 };