import type { GraphQLFormattedError } from 'graphql'; /** * Base class for all errors raised by the indexer public data provider. * Consumers can catch any indexer error with a single `instanceof IndexerError` check. */ export declare abstract class IndexerError extends Error { } /** * Raised when a GraphQL response includes one or more `GraphQLFormattedError` * entries. Aggregates all server-side errors into a single numbered message * and exposes the original array via {@link errors}. * * The field is named `errors` (not `cause`) because the standard ES2022 * `Error.cause` slot is contractually a single underlying error, not a * peer collection. Reusing `cause` would confuse Node's `util.inspect` * causal chain, Sentry, and other structured loggers. * * Transport-level and other Apollo failures are reported via {@link IndexerQueryError}. */ export declare class IndexerFormattedError extends IndexerError { readonly errors: readonly GraphQLFormattedError[]; /** * @param errors The GraphQL errors reported by the server. */ constructor(errors: readonly GraphQLFormattedError[]); } /** * An error raised when an Apollo query or fetch fails at the transport layer * (network failure, malformed response, Apollo client error) — distinct from * the case where the server returns a well-formed response containing * `GraphQLFormattedError` entries, which is reported via * {@link IndexerFormattedError}. * * Preserves the original Apollo error via `Error.cause` so consumers can * inspect network details and the original stack. */ export declare class IndexerQueryError extends IndexerError { constructor(message: string, options?: ErrorOptions); } /** * Discriminated context describing the specific way indexer-returned data * failed to satisfy the provider's expectations. The `kind` tag lets * consumers branch on the failure mode without parsing the error message. */ export type IndexerDataErrorContext = { kind: 'unknown-status'; value: string; } | { kind: 'missing-contract-action'; contractAddress: string; } | { kind: 'missing-identifier'; contractAddress: string; actionIndex: number; identifiersLength: number; }; /** * An error raised when indexer-returned data is structurally inconsistent * with the provider's expectations: unknown enum values, broken referential * integrity between related rows, or missing relations the schema implies * should be present. * * Distinct from: * - {@link IndexerSubscriptionDataError} — missing top-level field on a * subscription payload (server returned `null`/`undefined` for a field). * - {@link IndexerFormattedError} — errors the server explicitly returned * as `GraphQLFormattedError` entries. * - {@link IndexerQueryError} — transport / Apollo failure before data is * parsed. * * Construct via the static factory methods to ensure the message and * {@link context} stay in sync. */ export declare class IndexerDataError extends IndexerError { readonly context: IndexerDataErrorContext; constructor(context: IndexerDataErrorContext); static unknownStatus(value: string): IndexerDataError; static missingContractAction(contractAddress: string): IndexerDataError; static missingIdentifier(contractAddress: string, actionIndex: number, identifiersLength: number): IndexerDataError; private static formatMessage; } /** * Subscription payload fields the indexer provider depends on. * Narrowing this to a literal union prevents typos at throw sites and * documents the exhaustive set of fields the provider currently reads. */ export type IndexerSubscriptionField = 'blocks' | 'contractActions'; /** * An error raised when an indexer subscription payload is missing a field * the provider relies on. Carries the missing field name for diagnostics. */ export declare class IndexerSubscriptionDataError extends IndexerError { readonly missingField: IndexerSubscriptionField; constructor(missingField: IndexerSubscriptionField); } /** * An error raised when the consumer passes a configuration that the indexer * provider does not support (e.g. an observable mode that cannot be served * by the indexer's query surface). Signals API misuse, not server-side * issues — separate semantic category from {@link IndexerDataError}. */ export declare class IndexerProviderConfigError extends IndexerError { constructor(message: string); } //# sourceMappingURL=errors.d.ts.map