import { Hex as core_Hex } from 'ox'; import * as z from 'zod/mini'; /** * Attaches an OpenAPI description to an object/array schema that is later * derived from via `z.partial`/`z.extend`. `zod/mini` exposes descriptions only * through `.check(z.describe(...))`, but that adds a refinement which those * derivations reject. Cloning and registering the description directly (as * classic zod's `.describe()` does) keeps the schema refinement-free. Plain * fields use `.check(z.describe(...))` directly. */ export declare function describe(schema: schema, description: string): schema; /** Lowercase 0x-prefixed 20-byte account address. */ export declare const Address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; /** * Builds an `Address`-shaped schema with the given OpenAPI example. Use when a * path or query parameter needs a more specific address example. */ export declare function address(example: core_Hex.Hex): z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; /** * Lowercase 0x-prefixed 20-byte TIP-20 token contract address. The OpenAPI * example must be attached to the inner pre-transform schema (path/query * params read examples from the pipe input), so callers that need a different * example per field build a fresh `TokenAddress` via `tokenAddress(example)` * instead of overriding via an outer `.check(z.meta(...))`. */ export declare const TokenAddress: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; /** * Builds a `TokenAddress`-shaped schema with the given OpenAPI example. Use * when a path/query param wants a different example than the shared * `TokenAddress` default (e.g. the two sides of a trading pair). * * The example must be a TIP-20 token address (`0x20c` prefix); a non-TIP-20 * example in the docs would be misleading because the route validates the * value as a TIP-20 token contract at runtime. */ export declare function tokenAddress(example: core_Hex.Hex): z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; /** Maps caller-facing chain aliases to their current Tempo chain id. */ export declare const chainIdAlias: { readonly 1424310001: 1424310003; readonly mainnet: 4217; readonly testnet: 42431; }; /** Resolves a numeric chain id through the caller-facing alias map. */ export declare function resolveChainId(chainId: number): number; /** * Tempo chain id. Accepts a chain alias (`mainnet`/`testnet`) or any positive * integer chain id (a number or numeric string), normalizing all forms to a * numeric chain id. Arbitrary ids are allowed so a self-hosted deployment can * serve a localnet (e.g. `31337`); the deployment must configure an `rpc`/`tidx` * upstream for any chain beyond the built-in public defaults. */ export declare const ChainId: z.ZodMiniPipe, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniPipe, z.ZodMiniTransform>]>, z.ZodMiniNumber>; /** * Optional `chainId` query parameter shared across endpoints. Accepts a chain * alias (`mainnet`/`testnet`) or a numeric chain id, normalizing both to a * numeric {@link ChainId}. */ export declare const ChainIdQuery: z.ZodMiniOptional, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniPipe, z.ZodMiniTransform>]>, z.ZodMiniNumber>>; declare const booleanQueryBase: z.ZodMiniPipe, z.ZodMiniTransform>; /** * Boolean query parameter. Query values arrive as the literal strings * `"true"`/`"false"`, validated strictly and transformed to a real boolean. * `z.boolean()` would reject the incoming string outright and * `z.coerce.boolean()` is unsafe (`Boolean("false") === true`). * * The generated JSON Schema is overridden to a plain `boolean` so the parameter * renders as a boolean — not a string — in the OpenAPI docs (and the generated * CLI coerces it), while the wire format and strict `"true"`/`"false"` * validation stay unchanged. The string `enum` that `z.enum` would emit is * dropped (`enum: undefined`): left in place it makes consumers — e.g. the * generated CLI — build a literal-`boolean` enum that then rejects the incoming * string. Wrap with `z.optional(...)` / `z._default(..., value)` and describe * with `.check(z.describe('…'))` at the call site — the override survives both. * Returns a fresh clone per call so each call site is a distinct schema. */ export declare function booleanQuery(): typeof booleanQueryBase; /** One public API error detail. */ export declare const ErrorDetail: z.ZodMiniObject<{ message: z.ZodMiniString; path: z.ZodMiniOptional, z.ZodMiniNumber]>>>; }, z.core.$strip>; /** * Builds the global error envelope, optionally enumerating `error.code` to a * fixed set of machine-readable codes. Pass the codes a given status can return * (e.g. `['token_not_found']` for a 404) so the reference and generated clients * narrow the code to a literal union instead of an open `string`. Omit `codes` * for the open-coded envelope. */ export declare function errorResponse(codes?: readonly [string, ...string[]]): z.ZodMiniObject<{ error: z.ZodMiniObject<{ code: z.ZodMiniEnum<{ [x: string]: string; }> | z.ZodMiniString; details: z.ZodMiniOptional; path: z.ZodMiniOptional, z.ZodMiniNumber]>>>; }, z.core.$strip>>>; message: z.ZodMiniString; }, z.core.$strip>; requestId: z.ZodMiniString; }, z.core.$strip>; /** Global error envelope with an open-coded `error.code`. */ export declare const ErrorResponse: z.ZodMiniObject<{ error: z.ZodMiniObject<{ code: z.ZodMiniEnum<{ [x: string]: string; }> | z.ZodMiniString; details: z.ZodMiniOptional; path: z.ZodMiniOptional, z.ZodMiniNumber]>>>; }, z.core.$strip>>>; message: z.ZodMiniString; }, z.core.$strip>; requestId: z.ZodMiniString; }, z.core.$strip>; /** * Lowercase 0x-prefixed 32-byte hash. The OpenAPI example is attached to the * inner pre-transform schema (path/query params read examples from the pipe * input), so every hash path param surfaces one without per-route overrides. * Callers that need a different example per field build a fresh schema via * `hash(example)` instead of overriding through an outer `.check(z.meta(...))`. */ export declare const Hash: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; /** * Builds a {@link Hash}-shaped schema with the given OpenAPI example. Use when * a path/query param wants a different example than the shared {@link Hash} * default (e.g. a route that documents a specific real transaction). * * The example must be attached to the inner pre-transform schema because * path/query params read examples from the pipe input. */ export declare function hash(example: core_Hex.Hex): z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; /** Lowercase 0x-prefixed hex byte data (may be empty, `0x`). */ export declare const Hex: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, string>>; /** Hex-encoded integer quantity (a `0x`-prefixed integer, e.g. `0x1a`). */ export declare const Quantity: z.ZodMiniTemplateLiteral<`0x${string}`>; /** Non-negative integer as a decimal string (preserves uint256 precision). */ export declare const DecimalString: z.ZodMiniString; /** A self-contained token quantity in base units and human-readable form. */ export declare const TokenAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; }, z.core.$strip>; /** * Minimum page size accepted across list endpoints. Floored at 5 because the * indexer rejects signature-decoded `Transfer` queries with `LIMIT < 5` * (HTTP 422); applying it globally keeps pagination uniform and removes the need * for per-endpoint clamping. */ export declare const minLimit = 5; /** Maximum number of rows returned per page. Larger requests are clamped to this value. */ export declare const maxLimit = 50; /** Page-size query parameter shared across list endpoints. */ export declare const Limit: z.ZodMiniDefault, z.ZodMiniTransform>>; /** Valuation currency query parameter shared across valuation-bearing endpoints. */ export declare const Denomination: z.ZodMiniOptional, z.ZodMiniTransform>>; /** Opaque keyset-pagination cursor query parameter shared across list endpoints. */ export declare const Cursor: z.ZodMiniOptional>; /** * Maximum page window (`page × limit` rows) accepted by positional pagination. * Stays below the indexer's own 10k row ceiling so large offsets do not reach * the indexer. Deeper traversal must use cursors. */ export declare const maxPageWindow = 500; /** * Page-number query parameter (1-indexed) shared by list endpoints that * support shallow positional pagination alongside keyset cursors. Cursors * remain the canonical deep-traversal mode; the page lane exists for * page-numbered UIs that need random access into the head of a feed. */ export declare const Page: z.ZodMiniOptional>; /** * Cross-field checks for list query schemas that accept both `cursor` and * `page`: the two are mutually exclusive, and the page window is bounded by * {@link maxPageWindow}. Spread into the query object's `.check(...)`. */ export declare function pageChecks(): readonly [z.core.$ZodCheck<{ cursor?: string | undefined; limit: number; page?: number | undefined; }>, z.core.$ZodCheck<{ cursor?: string | undefined; limit: number; page?: number | undefined; }>]; /** Opaque next-page cursor response field shared across list endpoints. */ export declare const NextCursor: z.ZodMiniNullable>; /** * Upper bound on the matched-row count surfaced by `include=totalCount`. The * count is computed by a capped subquery (`… LIMIT countCap`) so it can't blow * the indexer's execution budget on the 10⁹-plus row tables; when the bound is * hit the count is a lower bound, signalled by `Meta.totalCountCapped`. Mirrors the * indexer's own 10k row ceiling and the capped-count conventions of comparable * APIs (Stripe Search's 10k `total_count`, * Elasticsearch `track_total_hits`, Shopify's `Count.precision`). */ export declare const countCap = 10000; /** * Total matched-row count response field for list endpoints that support * `include=totalCount`. Exact when {@link TotalCountCapped} is `false`; a lower * bound ("at least this many") when `true`. Independent of pagination — * `nextCursor` remains the only end-of-list signal. */ export declare const TotalCount: z.ZodMiniNumber; /** * Whether {@link TotalCount} hit the {@link countCap} bound. `true` means the * count is a lower bound ("at least `totalCount` rows match"); `false` means it * is exact. */ export declare const TotalCountCapped: z.ZodMiniBoolean; /** * Resource environment (`production`/`sandbox`) query parameter shared across * environment-scoped endpoints. Defaults to `production`. */ export declare const Environment: z.ZodMiniDefault>; /** Sort-direction (`asc`/`desc`) query parameter shared across list endpoints. */ export declare const Order: z.ZodMiniDefault>; /** * Optional inclusive block-number bound query parameter (`blockNumber.from` / * `blockNumber.to`). `noun` is the resource being listed (e.g. `transfers`) so * the description reads naturally across endpoints. */ export declare function blockNumberBound(noun: string, bound: 'from' | 'to'): z.ZodMiniOptional>; /** * Optional inclusive ISO-8601 timestamp bound query parameter (`timestamp.from` * / `timestamp.to`), normalized to UTC. `noun` is the listed resource. */ export declare function timestampBound(noun: string, bound: 'from' | 'to'): z.ZodMiniOptional>>; /** * Builds the schema for a comma-separated opt-in query parameter (e.g. * `?include=token,totalCount`), parsed into a validated array of the given enum's * members. Absent or empty values yield `[]`. Centralizes the splitting, * trimming, and OpenAPI array-enum metadata that every list endpoint otherwise * repeats. * * A repeated parameter (`?include=token&include=totalCount`) arrives from the * validator as a `string[]`, so the input accepts both forms and each entry is * still comma-split, so the two styles compose freely. * * Pass the endpoint's local `Include` enum so its members drive the parsed type * and documentation, plus the parameter description. */ export declare function includeQuery>>(member: z.ZodMiniEnum, description: string): z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; /** * Ready-made `include` query parameter for list endpoints whose only optional * resource is the capped total count (`?include=totalCount`). Endpoints that * embed additional resources define their own enum that also lists `totalCount` * (e.g. transfers' `memo,token,totalCount`). */ export declare const totalCountInclude: z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; /** * Response-wide `meta` object for list endpoints whose only embeddable resource * is the capped total count. Present only when `include=totalCount` was * requested; omitted otherwise. Endpoints that embed additional response-wide * resources alongside the count define their own `Meta` that also carries * {@link TotalCount}/{@link TotalCountCapped}. */ export declare const CountMeta: z.ZodMiniObject<{ totalCountCapped: z.ZodMiniBoolean; totalCount: z.ZodMiniNumber; }, z.core.$strip>; export {}; //# sourceMappingURL=Schema.d.ts.map