import { DataResponse } from "./response.js"; import { z } from "zod/v4"; //#region src/model/response.schema.d.ts /** * Runtime schemas for {@link ./response.js}, see the note in * `primitives.schema.ts` on why they are written by hand. * * `responseSchema(payloadSchema)` validates a successful backend 2xx body. * HTTP and transport errors never pass through it. **/ /** * {@link DataSource} **/ export declare const dataSourceSchema: z.ZodEnum<{ offchain: "offchain"; onchain: "onchain"; }>; /** * {@link ChainSucceeded} * * `source` may be omitted by the backend and decodes to `"offchain"`. The block * has no such default: a success that omits it fails validation. **/ export declare const chainSucceededSchema: z.ZodObject<{ chainId: z.ZodNumber; status: z.ZodLiteral<"success">; source: z.ZodDefault>; blockNumber: z.ZodNumber; timestamp: z.ZodNumber; }, z.core.$strip>; /** * {@link ChainFailed} * * `error` is a `string` in a JSON body. The schema accepts `unknown` so the * same codec also validates a locally produced envelope carrying an `Error`. **/ export declare const chainFailedSchema: z.ZodObject<{ chainId: z.ZodNumber; status: z.ZodLiteral<"error">; source: z.ZodOptional>; error: z.ZodOptional; }, z.core.$strip>; /** * {@link ChainMetadata} **/ export declare const chainMetadataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ chainId: z.ZodNumber; status: z.ZodLiteral<"success">; source: z.ZodDefault>; blockNumber: z.ZodNumber; timestamp: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ chainId: z.ZodNumber; status: z.ZodLiteral<"error">; source: z.ZodOptional>; error: z.ZodOptional; }, z.core.$strip>], "status">; /** * {@link ResponseMetadata} **/ export declare const responseMetadataSchema: z.ZodObject<{ chains: z.ZodArray; source: z.ZodDefault>; blockNumber: z.ZodNumber; timestamp: z.ZodNumber; }, z.core.$strip>, z.ZodObject<{ chainId: z.ZodNumber; status: z.ZodLiteral<"error">; source: z.ZodOptional>; error: z.ZodOptional; }, z.core.$strip>], "status">>; }, z.core.$strip>; /** * {@link DataResponse} parameterized by the payload schema. **/ export declare function responseSchema(payloadSchema: S): z.ZodType>>; //#endregion