export type GetApiV1StablecoinMarketCapCurrencyCodeTotalAmountArgs = {currencyCode: string}; export type GetApiV1StablecoinMarketCapCurrencyCodeTotalAmountOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get total supply amount * * GET /v1/stablecoin/market-cap/{currencyCode}/total/amount */ export const getApiV1StablecoinMarketCapCurrencyCodeTotalAmount = async (args: GetApiV1StablecoinMarketCapCurrencyCodeTotalAmountArgs, options?: GetApiV1StablecoinMarketCapCurrencyCodeTotalAmountOptions) => { 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))}/total/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() };