export type DeleteApiExternalWalletsWalletIdAssetIdArgs = {walletId: string, assetId: string}; export type DeleteApiExternalWalletsWalletIdAssetIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an asset from an external wallet * * DELETE /external_wallets/{walletId}/{assetId} */ export const deleteApiExternalWalletsWalletIdAssetId = async (args: DeleteApiExternalWalletsWalletIdAssetIdArgs, options?: DeleteApiExternalWalletsWalletIdAssetIdOptions) => { const {baseUrl = "https://api.fireblocks.io/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/external_wallets/${encodeURIComponent(String(args.walletId))}/${encodeURIComponent(String(args.assetId))}${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 };