export type GetApiGetFactoryAPYsBlockchainIdVersionArgs = {blockchainId: 'bsc' | 'kava' | 'zkevm' | 'zksync' | 'x-layer' | 'mantle', version: 'stable' | 'crypto'}; export type GetApiGetFactoryAPYsBlockchainIdVersionOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Returns *inaccurate* volume and base APY data for Curve pools on chains that aren’t indexed by either the [Curve Prices API](https://prices.curve.fi/feeds-docs) or the [Curve subgraphs](https://github.com/curvefi/volume-subgraphs). * * GET /getFactoryAPYs/{blockchainId}/{version} */ export const getApiGetFactoryAPYsBlockchainIdVersion = async (args: GetApiGetFactoryAPYsBlockchainIdVersionArgs, options?: GetApiGetFactoryAPYsBlockchainIdVersionOptions) => { const {baseUrl = "https://api.curve.finance/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/getFactoryAPYs/${encodeURIComponent(String(args.blockchainId))}/${encodeURIComponent(String(args.version))}${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 };