export type CreateApiV024AgentsSuspendArgs = {body: {id: string, subAccount?: string | undefined}}; export type CreateApiV024AgentsSuspendOptions = {baseUrl?: string | undefined, apiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Suspend an agent account * * POST /v0.2.4/agents/suspend */ export const createApiV024AgentsSuspend = async (args: CreateApiV024AgentsSuspendArgs, options?: CreateApiV024AgentsSuspendOptions) => { const {baseUrl = "https://api.chimoney.io", fetch: fetchFn = fetch, apiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (apiKeyAuth !== undefined) headers.set("X-API-KEY", apiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v0.2.4/agents/suspend${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };