UNPKG

solask-sdk

Version:

Lightweight SDK to interact with Solana via REST

23 lines (17 loc) 593 B
import { apiClient } from "./client"; export async function ask(query: string): Promise<string> { try { const res = await apiClient.post("/ask", { query }); return res.data.answer; } catch (err: any) { throw new Error(err?.response?.data?.error || "Failed to fetch response"); } } export async function getSNS(query: string): Promise<string> { try { const res = await apiClient.post("/getSNS", { query }); return res.data.answer; } catch (err: any) { throw new Error(err?.response?.data?.error || "Failed to fetch SNS data"); } }