/** * Which field-naming schema a deployed August vault subgraph uses: * - `'old'` — snake_case fields (`block_number`, `timestamp_`, `transactionHash_`). * - `'new'` — camelCase fields (`blockNumber`, `blockTimestamp`, `transactionHash`). * * The two templates are otherwise equivalent; the SDK aliases new-schema fields * back to the old internal names when querying, so the rest of the code only ever * sees the old (snake_case) shape. */ export type SubgraphSchema = 'old' | 'new'; /** * True when a GraphQL error array reports an unknown field on the queried type * (message contains "has no field") — the signature of a schema mismatch. * * @param errors - GraphQL `errors` array from a subgraph response (may be undefined). * @returns `true` if any error message indicates an unknown field, else `false`. */ export declare function isSubgraphSchemaFieldError(errors: { message?: string; }[] | undefined): boolean; /** * Detects whether a deployed subgraph uses the old or new field schema by probing * a single field (`blockTimestamp`) that exists only on the new template, on * `withdrawalRequesteds`, or on `transfers` for a receipt-token subgraph that * has no `withdrawalRequesteds` entity. * * This replaces the previous heuristic — "vault symbol present in the deprecated * `SUBGRAPH_VAULT_URLS` map ⇒ old schema, else new" — which mis-guessed any * newly-added vault whose subgraph shipped on the old template (e.g. * `august-citrea-earn-ctusd`). A wrong guess made every subgraph read query * non-existent field names, so the subgraph returned GraphQL errors with no * `data` and the SDK silently returned empty sets — emptying the Pending * Withdrawals and History tabs for that vault. * * Because the schema is immutable for a fixed subgraph deployment, the result is * cached per URL ({@link SCHEMA_TTL_MS}); across a page's positions/history/ * withdrawals reads this amounts to a single extra lightweight query per subgraph. * * Side effects: at most two HTTP POSTs to the subgraph per URL per TTL window * (the second only for a subgraph without `withdrawalRequesteds`). * * @param goldskyUrl - Fully-qualified subgraph GraphQL endpoint. * @param apiKey - Optional Goldsky API key sent as a Bearer token. * @returns `'old'` or `'new'`. Defaults to `'new'` when the URL is empty or the * probe is inconclusive (network error / unexpected response) — the schema the * majority of current vaults use. */ export declare function resolveSubgraphSchema(goldskyUrl: string, apiKey?: string): Promise;