export type DeleteApiV1WorkspacesWorkspaceAgentsAgentIdWalletArgs = {workspace: string, agent_id: string}; export type DeleteApiV1WorkspacesWorkspaceAgentsAgentIdWalletOptions = {baseUrl: string, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Wallet * * DELETE /v1/workspaces/{workspace}/agents/{agent_id}/wallet */ export const deleteApiV1WorkspacesWorkspaceAgentsAgentIdWallet = async (args: DeleteApiV1WorkspacesWorkspaceAgentsAgentIdWalletArgs, options: DeleteApiV1WorkspacesWorkspaceAgentsAgentIdWalletOptions) => { const {baseUrl, fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/workspaces/${encodeURIComponent(String(args.workspace))}/agents/${encodeURIComponent(String(args.agent_id))}/wallet${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 };