export type CreateApiApiAgentDeepSignalSolanaArgs = {body: {signature: string}}; export type CreateApiApiAgentDeepSignalSolanaOptions = {baseUrl?: string | undefined, creditPackKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Redeem a Solana USDC payment for deep-signal credits * * POST /api/agent/deep-signal/solana */ export const createApiApiAgentDeepSignalSolana = async (args: CreateApiApiAgentDeepSignalSolanaArgs, options?: CreateApiApiAgentDeepSignalSolanaOptions) => { const {baseUrl = "https://signals.gitdealflow.com", fetch: fetchFn = fetch, creditPackKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (creditPackKey !== undefined) headers.set('authorization', `Bearer ${creditPackKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/agent/deep-signal/solana${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 };