import { ORPCError } from "@orpc/client"; import type { DapiErrorId, DapiPublicError } from "./dapi-errors.js"; interface DalpOrpcErrorJson { readonly defined: true; readonly code: string; readonly status: number; readonly message: string; readonly data: { readonly id: string; readonly category: string; readonly retryable: boolean; readonly why: string; readonly fix: string; readonly requestId?: string; readonly retryAfterSeconds?: unknown; readonly [key: string]: unknown; }; } export interface DalpSdkErrorOptions { code?: string; id?: DapiErrorId; category: string; status?: number; retryable: boolean; message: string; why: string; fix: string; details?: Record; dapiError?: DapiPublicError; /** Full ORPC `data` from the wire, including typed route/contract fields. */ orpcData?: Record; /** * Seconds the server asks the client to wait before retrying, decoded from a * `Retry-After`-bearing error (e.g. `INDEXER_REINDEXING`). Present only when * the error carried the value; never a default. */ retryAfterSeconds?: number; cause?: unknown; } export interface DalpSdkConfigurationErrorInput { message: string; why: string; fix: string; cause?: unknown; } export type DalpSdkErrorJson = ReturnType["toJSON"]> & { id?: DapiErrorId; category: string; retryable: boolean; why: string; fix: string; details?: Record; retryAfterSeconds?: number; }; export declare class DalpSdkError extends ORPCError { readonly id?: DapiErrorId; readonly category: string; readonly retryable: boolean; readonly why: string; readonly fix: string; readonly details?: Record; readonly dapiError?: DapiPublicError; readonly retryAfterSeconds?: number; constructor(options: DalpSdkErrorOptions); toJSON(): DalpSdkErrorJson; } export declare function createDalpSdkConfigurationError(input: DalpSdkConfigurationErrorInput): DalpSdkError; export declare function createDalpSdkErrorFromOrpcJson(parsed: DalpOrpcErrorJson, cause?: unknown, retryAfterSeconds?: number): DalpSdkError; export declare function createDalpSdkErrorFromDapiPublicError(error: DapiPublicError, cause?: unknown, retryAfterSeconds?: number): DalpSdkError; export declare function decodeDapiErrorResponseBody(body: unknown): DalpSdkError | null; export declare function getDapiPublicErrorFromResponseBody(body: unknown): DapiPublicError | undefined; export declare function isDapiPublicError(value: unknown): value is DapiPublicError; export {}; //# sourceMappingURL=sdk-error.d.ts.map