export type GetApiApiQuoteV20GetpairsArgs = {version: string, Authorization: string}; export type GetApiApiQuoteV20GetpairsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Check Supported Pairs * * GET /api/quote/v2.0/getpairs */ export const getApiApiQuoteV20Getpairs = async (args: GetApiApiQuoteV20GetpairsArgs, options?: GetApiApiQuoteV20GetpairsOptions) => { const {baseUrl = "https://sandbox-api-baasic.transfero.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/api/quote/v2.0/getpairs${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 (await res.json()) as unknown };