export type CreateApiApiV1AgentsAgentIdUnlocksSocialActionArgs = {agentId: string, body: {action: 'x_follow', proof?: {[key: string]: unknown} | undefined}}; export type CreateApiApiV1AgentsAgentIdUnlocksSocialActionOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Submit social action proof (x_follow) for quota boost review * * POST /api/v1/agents/{agentId}/unlocks/social-action */ export const createApiApiV1AgentsAgentIdUnlocksSocialAction = async (args: CreateApiApiV1AgentsAgentIdUnlocksSocialActionArgs, options: CreateApiApiV1AgentsAgentIdUnlocksSocialActionOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/agents/${encodeURIComponent(String(args.agentId))}/unlocks/social-action${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 };