export type GetApiV1StablecoinMarketCapCurrencyCodeCirculatingAmountArgs = {currencyCode: string}; export type GetApiV1StablecoinMarketCapCurrencyCodeCirculatingAmountOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get circulating supply amount * * GET /v1/stablecoin/market-cap/{currencyCode}/circulating/amount */ export const getApiV1StablecoinMarketCapCurrencyCodeCirculatingAmount = async (args: GetApiV1StablecoinMarketCapCurrencyCodeCirculatingAmountArgs, options?: GetApiV1StablecoinMarketCapCurrencyCodeCirculatingAmountOptions) => { const {baseUrl = "https://api.ripple.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/plain") const url = `${baseUrl.replace(/\/+$/, '')}/v1/stablecoin/market-cap/${encodeURIComponent(String(args.currencyCode))}/circulating/amount${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 res.text() };