export type DeleteApiConnectionsWcIdArgs = {'X-End-User-Wallet-Id'?: string | undefined, id: string}; export type DeleteApiConnectionsWcIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove an existing Web3 connection. * * DELETE /connections/wc/{id} */ export const deleteApiConnectionsWcId = async (args: DeleteApiConnectionsWcIdArgs, options?: DeleteApiConnectionsWcIdOptions) => { const {baseUrl = "https://api.fireblocks.io/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-End-User-Wallet-Id'] != null) headers.set("X-End-User-Wallet-Id", String(args['X-End-User-Wallet-Id'])) const url = `${baseUrl.replace(/\/+$/, '')}/connections/wc/${encodeURIComponent(String(args.id))}${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 };