import type { GeoClientContext } from './context.js'; export type GraphQlResponse = { data?: T; errors?: unknown; }; /** * Sends a GraphQL request to the Geo API configured on the provided context. * * This low-level helper returns the full GraphQL envelope. Use * {@link graphqlData} when GraphQL `errors` or missing `data` should throw. * * @example * ```ts * const response = await geo.api.graphql<{ * entity: { id: string; name: string | null } | null; * }>(` * query { * entity(id: "3af3e22d21694a078681516710b7ecf1") { * id * name * } * } * `); * * if (response.errors) { * console.error(response.errors); * } * ``` * * @param context Client context containing the API origin and fetch implementation. * @param query GraphQL query string to send. * @returns The parsed GraphQL response envelope. * @throws When fetch fails, the HTTP response is not successful, or the response is not JSON. */ export declare function graphqlRequest(context: GeoClientContext, query: string): Promise>; /** * Sends a GraphQL request and returns only the `data` payload. * * This is the preferred helper for SDK workflows that need graph context. It * treats GraphQL `errors` and missing `data` as failures so callers do not * accidentally continue with empty successful results. * * @example * ```ts * const data = await graphqlData<{ entity: { id: string } | null }>( * context, * `query { entity(id: "3af3e22d21694a078681516710b7ecf1") { id } }`, * ); * ``` * * @param context Client context containing the API origin and fetch implementation. * @param query GraphQL query string to send. * @returns The typed GraphQL `data` payload. * @throws When the request fails, GraphQL returns errors, or no data is present. */ export declare function graphqlData(context: GeoClientContext, query: string): Promise; /** * Requests transaction calldata for a published edit from the configured Geo API. * * This is useful when calldata must be generated by an API service rather than * locally. For personal-space publish calldata, prefer * `geo.personalSpaces.publishEdit(...)`. * * @example * ```ts * const { to, data } = await geo.api.getEditCalldata({ * spaceId, * cid: 'ipfs://bafkreihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku', * }); * * await walletClient.sendTransaction({ to, data }); * ``` * * @param context Client context containing the API origin and fetch implementation. * @param params Space ID and edit CID to submit to the API. * @returns Target address and calldata returned by the API. * @throws When the request fails or the API response is malformed. */ export declare function getEditCalldata(context: GeoClientContext, params: { spaceId: string; cid: string; }): Promise<{ to: `0x${string}`; data: `0x${string}`; }>; //# sourceMappingURL=api.d.ts.map