export type GetApiV1VaTransferBanksArgs = {currency?: string | undefined}; export type GetApiV1VaTransferBanksOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * List VA banks * * GET /v1/va/transfer/banks */ export const getApiV1VaTransferBanks = async (args: GetApiV1VaTransferBanksArgs, options?: GetApiV1VaTransferBanksOptions) => { const {baseUrl = "https://api.kyshi.co", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.currency != null) query.append("currency", String(args.currency)) if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/va/transfer/banks${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 };