export type DeleteApiLedgerOfframpAccountsOfframpAccountIdArgs = {offrampAccountId: string}; export type DeleteApiLedgerOfframpAccountsOfframpAccountIdOptions = {baseUrl?: string | undefined, HMACAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete offramp account * * DELETE /ledger/offramp-accounts/{offrampAccountId} */ export const deleteApiLedgerOfframpAccountsOfframpAccountId = async (args: DeleteApiLedgerOfframpAccountsOfframpAccountIdArgs, options?: DeleteApiLedgerOfframpAccountsOfframpAccountIdOptions) => { const {baseUrl = "https://external.dev.onboardpay.co", fetch: fetchFn = fetch, HMACAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (HMACAuth !== undefined) headers.set("x-api-key", HMACAuth) const url = `${baseUrl.replace(/\/+$/, '')}/ledger/offramp-accounts/${encodeURIComponent(String(args.offrampAccountId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };