import { type Context } from 'hono'; import * as z from 'zod/mini'; import type * as App from '../../../App.js'; import * as Response from '../../../internal/Response.js'; import * as Schema from '../../../internal/Schema.js'; import * as Valuation from './valuation.js'; /** Zod schemas owned by the exchange handlers. */ export declare namespace schema { /** * A token in a trading pair: its contract address, plus the trimmed token * reference spread in when requested via `include=tokens`. Reference fields * are absent on the base (no-`include`) response and best-effort when * requested (a token whose metadata is unavailable keeps just `address`). */ const PairToken: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; /** Schemas for creating an executable exchange quote. */ namespace createQuote { /** Positive token amount accepted by exchange providers. */ const Amount: z.ZodMiniString; /** Optional token fields that require sources beyond RPC metadata. */ const Include: z.ZodMiniEnum<{ "token.logoUri": "token.logoUri"; "token.verified": "token.verified"; }>; /** Parses comma-separated optional token fields. */ const includeQuery: z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; /** Query parameters selecting the Tempo chain and optional token fields. */ const Query: z.ZodMiniObject<{ chainId: z.ZodMiniOptional, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniPipe, z.ZodMiniTransform>]>, z.ZodMiniNumber>>; include: z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; 'valuation.currency': z.ZodMiniOptional, z.ZodMiniTransform>>; }, z.core.$strict>; /** Quote request with one pinned side and caller-selected slippage. */ const Request: z.ZodMiniObject<{ account: z.ZodMiniOptional, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>; amount: z.ZodMiniString; destinationToken: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; mode: z.ZodMiniEnum<{ exactDestination: "exactDestination"; exactSource: "exactSource"; }>; slippageBps: z.ZodMiniNumber; sourceToken: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strict>; /** One call in the unsigned Tempo transaction plan. */ const Call: z.ZodMiniObject<{ data: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, string>>; to: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; value: z.ZodMiniTemplateLiteral<`0x${string}`>; }, z.core.$strip>; const Transaction: z.ZodMiniObject<{ calls: z.ZodMiniArray, z.ZodMiniTransform<`0x${string}`, string>>; to: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; value: z.ZodMiniTemplateLiteral<`0x${string}`>; }, z.core.$strip>>; chainId: z.ZodMiniPipe, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniPipe, z.ZodMiniTransform>]>, z.ZodMiniNumber>; }, z.core.$strip>; /** Response-level valuation rate provenance. */ const Meta: z.ZodMiniObject<{ valuation: z.ZodMiniOptional; source: z.ZodMiniString; }, z.core.$strip>>; }, z.core.$strip>; /** Provider-neutral EIP-712 payload to sign before finalizing a quote. */ const TypedData: z.ZodMiniObject<{ domain: z.ZodMiniRecord, z.ZodMiniUnknown>; message: z.ZodMiniRecord, z.ZodMiniUnknown>; primaryType: z.ZodMiniString; types: z.ZodMiniRecord, z.ZodMiniArray; type: z.ZodMiniString; }, z.core.$strict>>>; }, z.core.$strip>; /** Provider-neutral quote and the action needed to execute it. */ const Response: z.ZodMiniUnion; provider: z.ZodMiniString; approval: z.ZodMiniObject<{ calls: z.ZodMiniArray, z.ZodMiniTransform<`0x${string}`, string>>; to: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; value: z.ZodMiniTemplateLiteral<`0x${string}`>; }, z.core.$strip>>; }, z.core.$strip>; status: z.ZodMiniLiteral<"approvalRequired">; destinationAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; destinationAmountMin: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; destinationToken: z.ZodMiniObject<{ currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; meta: z.ZodMiniOptional; source: z.ZodMiniString; }, z.core.$strip>>; }, z.core.$strip>>; mode: z.ZodMiniLiteral<"exactSource">; sourceAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; sourceToken: z.ZodMiniObject<{ currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; }, z.core.$strip>, z.ZodMiniObject<{ gasEstimate: z.ZodMiniString; provider: z.ZodMiniString; status: z.ZodMiniLiteral<"ready">; transaction: z.ZodMiniObject<{ calls: z.ZodMiniArray, z.ZodMiniTransform<`0x${string}`, string>>; to: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; value: z.ZodMiniTemplateLiteral<`0x${string}`>; }, z.core.$strip>>; chainId: z.ZodMiniPipe, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniPipe, z.ZodMiniTransform>]>, z.ZodMiniNumber>; }, z.core.$strip>; destinationAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; destinationAmountMin: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; destinationToken: z.ZodMiniObject<{ currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; meta: z.ZodMiniOptional; source: z.ZodMiniString; }, z.core.$strip>>; }, z.core.$strip>>; mode: z.ZodMiniLiteral<"exactSource">; sourceAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; sourceToken: z.ZodMiniObject<{ currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; }, z.core.$strip>, z.ZodMiniObject<{ gasEstimate: z.ZodMiniString; provider: z.ZodMiniString; continuation: z.ZodMiniString; status: z.ZodMiniLiteral<"signatureRequired">; typedData: z.ZodMiniObject<{ domain: z.ZodMiniRecord, z.ZodMiniUnknown>; message: z.ZodMiniRecord, z.ZodMiniUnknown>; primaryType: z.ZodMiniString; types: z.ZodMiniRecord, z.ZodMiniArray; type: z.ZodMiniString; }, z.core.$strict>>>; }, z.core.$strip>; destinationAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; destinationAmountMin: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; destinationToken: z.ZodMiniObject<{ currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; meta: z.ZodMiniOptional; source: z.ZodMiniString; }, z.core.$strip>>; }, z.core.$strip>>; mode: z.ZodMiniLiteral<"exactSource">; sourceAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; sourceToken: z.ZodMiniObject<{ currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; }, z.core.$strip>, z.ZodMiniObject<{ gasEstimate: z.ZodMiniString; provider: z.ZodMiniString; approval: z.ZodMiniObject<{ calls: z.ZodMiniArray, z.ZodMiniTransform<`0x${string}`, string>>; to: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; value: z.ZodMiniTemplateLiteral<`0x${string}`>; }, z.core.$strip>>; }, z.core.$strip>; status: z.ZodMiniLiteral<"approvalRequired">; destinationAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; destinationToken: z.ZodMiniObject<{ currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; meta: z.ZodMiniOptional; source: z.ZodMiniString; }, z.core.$strip>>; }, z.core.$strip>>; mode: z.ZodMiniLiteral<"exactDestination">; sourceAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; sourceAmountMax: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; sourceToken: z.ZodMiniObject<{ currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; }, z.core.$strip>, z.ZodMiniObject<{ gasEstimate: z.ZodMiniString; provider: z.ZodMiniString; status: z.ZodMiniLiteral<"ready">; transaction: z.ZodMiniObject<{ calls: z.ZodMiniArray, z.ZodMiniTransform<`0x${string}`, string>>; to: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; value: z.ZodMiniTemplateLiteral<`0x${string}`>; }, z.core.$strip>>; chainId: z.ZodMiniPipe, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniPipe, z.ZodMiniTransform>]>, z.ZodMiniNumber>; }, z.core.$strip>; destinationAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; destinationToken: z.ZodMiniObject<{ currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; meta: z.ZodMiniOptional; source: z.ZodMiniString; }, z.core.$strip>>; }, z.core.$strip>>; mode: z.ZodMiniLiteral<"exactDestination">; sourceAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; sourceAmountMax: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; sourceToken: z.ZodMiniObject<{ currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; }, z.core.$strip>, z.ZodMiniObject<{ gasEstimate: z.ZodMiniString; provider: z.ZodMiniString; continuation: z.ZodMiniString; status: z.ZodMiniLiteral<"signatureRequired">; typedData: z.ZodMiniObject<{ domain: z.ZodMiniRecord, z.ZodMiniUnknown>; message: z.ZodMiniRecord, z.ZodMiniUnknown>; primaryType: z.ZodMiniString; types: z.ZodMiniRecord, z.ZodMiniArray; type: z.ZodMiniString; }, z.core.$strict>>>; }, z.core.$strip>; destinationAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; destinationToken: z.ZodMiniObject<{ currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; meta: z.ZodMiniOptional; source: z.ZodMiniString; }, z.core.$strip>>; }, z.core.$strip>>; mode: z.ZodMiniLiteral<"exactDestination">; sourceAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; sourceAmountMax: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; sourceToken: z.ZodMiniObject<{ currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; }, z.core.$strip>]>; } /** Schemas for finishing a quote after a provider-requested signature. */ namespace executeQuote { /** Signed continuation request. */ const Request: z.ZodMiniObject<{ account: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; continuation: z.ZodMiniString; provider: z.ZodMiniString; signature: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, string>>; }, z.core.$strict>; /** Final transaction plan. */ const Response: z.ZodMiniObject<{ provider: z.ZodMiniString; transaction: z.ZodMiniObject<{ calls: z.ZodMiniArray, z.ZodMiniTransform<`0x${string}`, string>>; to: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; value: z.ZodMiniTemplateLiteral<`0x${string}`>; }, z.core.$strip>>; chainId: z.ZodMiniPipe, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniPipe, z.ZodMiniTransform>]>, z.ZodMiniNumber>; }, z.core.$strip>; }, z.core.$strip>; } /** Schemas for the getPairs operation. */ namespace getPairs { /** * Optional resources for the pair list: the per-row `tokens` embed plus the * response-wide capped `totalCount`. The detail route keeps its own * `tokens`-only {@link getPair.Include}. */ const Include: z.ZodMiniEnum<{ tokens: "tokens"; totalCount: "totalCount"; }>; /** * Parses a comma-separated `include` query value into a list of optional * resources to embed. Extra lookups (e.g. token metadata) only run when * explicitly requested, keeping the base pair page fast. */ const includeQuery: z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; /** Query parameters for trading pair list requests. */ const Query: z.ZodMiniObject<{ chainId: z.ZodMiniOptional, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniPipe, z.ZodMiniTransform>]>, z.ZodMiniNumber>>; cursor: z.ZodMiniOptional>; include: z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; limit: z.ZodMiniDefault, z.ZodMiniTransform>>; order: z.ZodMiniDefault>; page: z.ZodMiniOptional>; sort: z.ZodMiniDefault>; }, z.core.$strict>; /** A single trading pair on the stablecoin DEX. */ const Pair: z.ZodMiniObject<{ base: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; blockNumber: z.ZodMiniNumber; id: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; key: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; liquidity: z.ZodMiniOptional>; quote: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; timestamp: z.ZodMiniISODateTime; transactionHash: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; /** Response metadata requested through `include`, such as capped counts. */ const Meta: z.ZodMiniObject<{ totalCountCapped: z.ZodMiniBoolean; totalCount: z.ZodMiniNumber; }, z.core.$strip>; /** Page of trading pairs on the stablecoin DEX, ordered by creation. */ const Response: z.ZodMiniObject<{ data: z.ZodMiniArray, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; blockNumber: z.ZodMiniNumber; id: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; key: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; liquidity: z.ZodMiniOptional>; quote: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; timestamp: z.ZodMiniISODateTime; transactionHash: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>>; meta: z.ZodMiniOptional; totalCount: z.ZodMiniNumber; }, z.core.$strip>>; nextCursor: z.ZodMiniNullable>; }, z.core.$strip>; } /** Schemas for the getPair operation (single trading pair detail). */ namespace getPair { /** * Path parameter for pair detail requests. On-chain, a pair's quote is * intrinsic to its base token (the precompile resolves it from the TIP-20's * `quote_token()`), so the base address alone identifies the pair. */ const Params: z.ZodMiniObject<{ base: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; /** Optional related resource that callers opt into via `include`. */ const Include: z.ZodMiniEnum<{ tokens: "tokens"; }>; /** * Parses a comma-separated `include` query value into a list of optional * resources to embed. */ const includeQuery: z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; /** Query parameters for pair detail requests. */ const Query: z.ZodMiniObject<{ chainId: z.ZodMiniOptional, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniPipe, z.ZodMiniTransform>]>, z.ZodMiniNumber>>; include: z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; }, z.core.$strict>; /** A single trading pair, identical in shape to `GET /exchange/pairs` rows. */ const Response: z.ZodMiniObject<{ base: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; blockNumber: z.ZodMiniNumber; id: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; key: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; liquidity: z.ZodMiniOptional>; quote: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; timestamp: z.ZodMiniISODateTime; transactionHash: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; } /** Schemas for the getSwaps operation (the swap feed, optionally pair-scoped). */ namespace getSwaps { /** Optional token fields that require sources beyond RPC metadata. */ const Include: z.ZodMiniEnum<{ "token.logoUri": "token.logoUri"; "token.verified": "token.verified"; }>; /** Parses comma-separated optional token fields. */ const includeQuery: z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; /** Query parameters for swap feed requests. */ const Query: z.ZodMiniObject<{ 'blockNumber.from': z.ZodMiniOptional>; 'blockNumber.to': z.ZodMiniOptional>; chainId: z.ZodMiniOptional, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniPipe, z.ZodMiniTransform>]>, z.ZodMiniNumber>>; cursor: z.ZodMiniOptional>; include: z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; limit: z.ZodMiniDefault, z.ZodMiniTransform>>; maker: z.ZodMiniOptional, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>; order: z.ZodMiniDefault>; participant: z.ZodMiniOptional, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>; taker: z.ZodMiniOptional, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>; 'timestamp.from': z.ZodMiniOptional>>; 'timestamp.to': z.ZodMiniOptional>>; transactionHash: z.ZodMiniOptional, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>; 'valuation.currency': z.ZodMiniOptional, z.ZodMiniTransform>>; }, z.core.$strict>; /** One swap-side token with RPC metadata and optional curated fields. */ const SwapSide: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; }, z.core.$strip>; /** A single maker-order fill within a swap, framed from the taker's perspective. */ const Fill: z.ZodMiniObject<{ destinationAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; destinationToken: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; }, z.core.$strip>; logIndex: z.ZodMiniNumber; maker: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; orderId: z.ZodMiniString; partialFill: z.ZodMiniBoolean; price: z.ZodMiniString; sourceAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; sourceToken: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; }, z.core.$strip>; }, z.core.$strip>; /** * A single logical taker swap on the stablecoin DEX: every maker-order * fill one taker's swap produced in one transaction, assembled into a * source → destination row. Multi-hop swaps (routed through an * intermediate token, e.g. pathUSD) are one row; the intermediate hops * are visible via `route` and `fills`. */ const Swap: z.ZodMiniObject<{ blockNumber: z.ZodMiniNumber; destinationAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; destinationToken: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; }, z.core.$strip>; filledAt: z.ZodMiniISODateTime; fills: z.ZodMiniArray; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; destinationToken: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; }, z.core.$strip>; logIndex: z.ZodMiniNumber; maker: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; orderId: z.ZodMiniString; partialFill: z.ZodMiniBoolean; price: z.ZodMiniString; sourceAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; sourceToken: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; }, z.core.$strip>; }, z.core.$strip>>; id: z.ZodMiniString; logIndex: z.ZodMiniNumber; mode: z.ZodMiniNullable>; rate: z.ZodMiniString; route: z.ZodMiniArray, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>; sourceAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; sourceToken: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; }, z.core.$strip>; taker: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; transactionHash: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; /** * Page of swaps. A row is one logical taker swap — the fills of one * `(transaction, taker)` group chained source → destination — so the * unscoped and token-filtered feeds share one shape. `limit` caps the * rows per page; a transaction batching several unrelated swaps by one * taker may have its rows split across consecutive pages. */ /** Page-level resources: valuation rate provenance. */ const Meta: z.ZodMiniObject<{ valuation: z.ZodMiniOptional; source: z.ZodMiniString; }, z.core.$strip>>; }, z.core.$strip>; const Response: z.ZodMiniObject<{ data: z.ZodMiniArray; destinationAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; destinationToken: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; }, z.core.$strip>; filledAt: z.ZodMiniISODateTime; fills: z.ZodMiniArray; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; destinationToken: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; }, z.core.$strip>; logIndex: z.ZodMiniNumber; maker: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; orderId: z.ZodMiniString; partialFill: z.ZodMiniBoolean; price: z.ZodMiniString; sourceAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; sourceToken: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; }, z.core.$strip>; }, z.core.$strip>>; id: z.ZodMiniString; logIndex: z.ZodMiniNumber; mode: z.ZodMiniNullable>; rate: z.ZodMiniString; route: z.ZodMiniArray, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>; sourceAmount: z.ZodMiniObject<{ baseUnits: z.ZodMiniString; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; formatted: z.ZodMiniString; valuation: z.ZodMiniOptional; currency: z.ZodMiniString; }, z.core.$strip>>>; }, z.core.$strip>; sourceToken: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniString; decimals: z.ZodMiniNumber; logoUri: z.ZodMiniOptional>>; name: z.ZodMiniString; symbol: z.ZodMiniString; verified: z.ZodMiniOptional>; }, z.core.$strip>; taker: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; transactionHash: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>>; meta: z.ZodMiniOptional; source: z.ZodMiniString; }, z.core.$strip>>; }, z.core.$strip>>; nextCursor: z.ZodMiniNullable>; }, z.core.$strip>; } /** Schemas for the getPairOhlc operation (candlestick aggregations). */ namespace getPairOhlc { /** * Path parameter mirrors `getPair.Params`: the base address alone * identifies the pair (its quote is intrinsic to the base token on-chain). */ const Params: z.ZodMiniObject<{ base: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; /** Bucket size for the candlestick aggregation. */ const Interval: z.ZodMiniEnum<{ "15m": "15m"; "1d": "1d"; "1h": "1h"; "1m": "1m"; "4h": "4h"; "5m": "5m"; }>; /** Rolling lookback window for the candlestick aggregation. */ const Window: z.ZodMiniEnum<{ "1h": "1h"; "24h": "24h"; "30d": "30d"; "7d": "7d"; }>; /** * Optional related resource that callers opt into via `include`. Currently * only `tokens` (embeds metadata onto `base`/`quote` instead of returning * just the addresses). */ const Include: z.ZodMiniEnum<{ tokens: "tokens"; }>; /** * Parses a comma-separated `include` query value into a list of optional * resources to embed. */ const includeQuery: z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; /** Query parameters for pair OHLC requests. */ const Query: z.ZodMiniObject<{ chainId: z.ZodMiniOptional, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniPipe, z.ZodMiniTransform>]>, z.ZodMiniNumber>>; include: z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; interval: z.ZodMiniDefault>; window: z.ZodMiniDefault>; }, z.core.$strict>; /** * A single candlestick bucket. Open/close are picked from the earliest * and latest fill in the bucket (ordered by `(block_num, log_idx)`); high * and low are the extrema across all fills in the bucket. Volumes are * the sum of per-fill base- and quote-side amounts in base units. */ const Bucket: z.ZodMiniObject<{ close: z.ZodMiniString; fillCount: z.ZodMiniNumber; high: z.ZodMiniString; id: z.ZodMiniString; low: z.ZodMiniString; open: z.ZodMiniString; timestamp: z.ZodMiniISODateTime; volume: z.ZodMiniObject<{ base: z.ZodMiniString; quote: z.ZodMiniString; }, z.core.$strip>; }, z.core.$strip>; /** Page of candlestick buckets for a single trading pair. */ const Response: z.ZodMiniObject<{ base: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; data: z.ZodMiniArray; fillCount: z.ZodMiniNumber; high: z.ZodMiniString; id: z.ZodMiniString; low: z.ZodMiniString; open: z.ZodMiniString; timestamp: z.ZodMiniISODateTime; volume: z.ZodMiniObject<{ base: z.ZodMiniString; quote: z.ZodMiniString; }, z.core.$strip>; }, z.core.$strip>>; interval: z.ZodMiniEnum<{ "15m": "15m"; "1d": "1d"; "1h": "1h"; "1m": "1m"; "4h": "4h"; "5m": "5m"; }>; quote: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; truncated: z.ZodMiniBoolean; window: z.ZodMiniEnum<{ "1h": "1h"; "24h": "24h"; "30d": "30d"; "7d": "7d"; }>; }, z.core.$strip>; } /** Schemas shared by the order detail and order fills handlers. */ namespace order { /** Path parameters for any single-order route (`/orders/:orderId`). */ const Params: z.ZodMiniObject<{ orderId: z.ZodMiniString; }, z.core.$strip>; /** The pair the order is placed against. */ const Pair: z.ZodMiniObject<{ base: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; key: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; quote: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; }, z.core.$strip>; } /** Schemas for the getOrder operation. */ namespace getOrder { /** Path parameters for single-order requests. */ const Params: z.ZodMiniObject<{ orderId: z.ZodMiniString; }, z.core.$strip>; /** * Optional related resource that callers opt into via `include`. Currently * only `tokens` (embeds metadata for both pair tokens on `pair.base` and * `pair.quote`). */ const Include: z.ZodMiniEnum<{ tokens: "tokens"; }>; /** * Parses a comma-separated `include` query value into a list of optional * resources to embed. Extra lookups (e.g. pair-token metadata) only run * when explicitly requested, keeping the base order response fast. */ const includeQuery: z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; /** Query parameters for single-order requests. */ const Query: z.ZodMiniObject<{ chainId: z.ZodMiniOptional, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniPipe, z.ZodMiniTransform>]>, z.ZodMiniNumber>>; include: z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; }, z.core.$strict>; /** * A single DEX order. Placement parameters and current state are sourced * directly from the on-chain `dex.getOrder` view, so `remaining` reflects * live state (not indexer lag) and the response is a single fast RPC. * * Fills are paginated separately under * `GET /exchange/orders/{orderId}/fills`; the per-order fills feed grows * over time and would otherwise force this resource to revalidate on * every new fill. */ const Response: z.ZodMiniObject<{ amount: z.ZodMiniString; flipTick: z.ZodMiniNumber; id: z.ZodMiniString; isBid: z.ZodMiniBoolean; isFlipOrder: z.ZodMiniBoolean; maker: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; mode: z.ZodMiniEnum<{ exactDestination: "exactDestination"; exactSource: "exactSource"; }>; orderId: z.ZodMiniString; pair: z.ZodMiniObject<{ base: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; key: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; quote: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; }, z.core.$strip>; price: z.ZodMiniString; rate: z.ZodMiniString; remaining: z.ZodMiniString; tick: z.ZodMiniNumber; }, z.core.$strip>; } /** Schemas for the getOrders operation (the resting-order feed, optionally pair-scoped). */ namespace getOrders { /** * Optional resources for the order feed: the per-row `tokens` embed plus * the response-wide capped `totalCount` (the number of matching resting * orders, a lower bound when `truncated`). */ const Include: z.ZodMiniEnum<{ tokens: "tokens"; totalCount: "totalCount"; }>; /** * Parses a comma-separated `include` query value into a list of optional * resources to embed. */ const includeQuery: z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; /** Query parameters for resting-order feed requests. */ const Query: z.ZodMiniObject<{ base: z.ZodMiniOptional, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>; chainId: z.ZodMiniOptional, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniPipe, z.ZodMiniTransform>]>, z.ZodMiniNumber>>; cursor: z.ZodMiniOptional>; include: z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; limit: z.ZodMiniDefault, z.ZodMiniTransform>>; maker: z.ZodMiniOptional, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>>; order: z.ZodMiniDefault>; page: z.ZodMiniOptional>; side: z.ZodMiniOptional>; sort: z.ZodMiniDefault>; }, z.core.$strict>; /** * A single resting maker order, sans its pair (rows are shaped here and * then annotated with their pair). `amount` is the originally-placed base * amount and `remaining` is what's still on the book (`amount` minus the * sum of `OrderFilled.amountFilled` over all fills for this order). * Orders for which `remaining <= 0` or that have an `OrderCancelled` * event are excluded from the response. */ const RestingOrder: z.ZodMiniObject<{ amount: z.ZodMiniString; blockNumber: z.ZodMiniNumber; id: z.ZodMiniString; logIndex: z.ZodMiniNumber; maker: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; orderId: z.ZodMiniString; placedAt: z.ZodMiniISODateTime; price: z.ZodMiniString; rate: z.ZodMiniString; remaining: z.ZodMiniString; side: z.ZodMiniEnum<{ ask: "ask"; bid: "bid"; }>; tick: z.ZodMiniNumber; transactionHash: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; /** A resting maker order annotated with the trading pair it belongs to. */ const Order: z.ZodMiniObject<{ amount: z.ZodMiniString; blockNumber: z.ZodMiniNumber; id: z.ZodMiniString; logIndex: z.ZodMiniNumber; maker: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; orderId: z.ZodMiniString; placedAt: z.ZodMiniISODateTime; price: z.ZodMiniString; rate: z.ZodMiniString; remaining: z.ZodMiniString; side: z.ZodMiniEnum<{ ask: "ask"; bid: "bid"; }>; tick: z.ZodMiniNumber; transactionHash: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; pair: z.ZodMiniObject<{ base: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; key: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; quote: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; }, z.core.$strip>; }, z.core.$strip>; /** Response metadata requested through `include`, such as capped counts. */ const Meta: z.ZodMiniObject<{ totalCountCapped: z.ZodMiniBoolean; totalCount: z.ZodMiniNumber; }, z.core.$strip>; /** Page of resting maker orders, each annotated with its trading pair. */ const Response: z.ZodMiniObject<{ data: z.ZodMiniArray; blockNumber: z.ZodMiniNumber; id: z.ZodMiniString; logIndex: z.ZodMiniNumber; maker: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; orderId: z.ZodMiniString; placedAt: z.ZodMiniISODateTime; price: z.ZodMiniString; rate: z.ZodMiniString; remaining: z.ZodMiniString; side: z.ZodMiniEnum<{ ask: "ask"; bid: "bid"; }>; tick: z.ZodMiniNumber; transactionHash: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; pair: z.ZodMiniObject<{ base: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; key: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; quote: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; }, z.core.$strip>; }, z.core.$strip>>; meta: z.ZodMiniOptional; totalCount: z.ZodMiniNumber; }, z.core.$strip>>; nextCursor: z.ZodMiniNullable>; truncated: z.ZodMiniBoolean; }, z.core.$strip>; } /** Schemas for the getOrderFills operation. */ namespace getOrderFills { /** Path parameters: inherits the canonical `/orders/:orderId` shape. */ const Params: z.ZodMiniObject<{ orderId: z.ZodMiniString; }, z.core.$strip>; /** Query parameters for paginated order-fill requests. */ const Query: z.ZodMiniObject<{ chainId: z.ZodMiniOptional, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniPipe, z.ZodMiniTransform>]>, z.ZodMiniNumber>>; cursor: z.ZodMiniOptional>; include: z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; limit: z.ZodMiniDefault, z.ZodMiniTransform>>; order: z.ZodMiniDefault>; page: z.ZodMiniOptional>; }, z.core.$strict>; /** * A single fill against the order. The order's pair, maker, side, and * rate are constant across all fills, so they live on the `Order` * resource rather than being repeated per row. */ const Fill: z.ZodMiniObject<{ amountFilled: z.ZodMiniString; blockNumber: z.ZodMiniNumber; filledAt: z.ZodMiniISODateTime; id: z.ZodMiniString; logIndex: z.ZodMiniNumber; orderId: z.ZodMiniString; partialFill: z.ZodMiniBoolean; taker: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; transactionHash: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; /** Response metadata requested through `include`, such as capped counts. */ const Meta: z.ZodMiniObject<{ totalCountCapped: z.ZodMiniBoolean; totalCount: z.ZodMiniNumber; }, z.core.$strip>; /** Paginated page of fills for one order. */ const Response: z.ZodMiniObject<{ data: z.ZodMiniArray; blockNumber: z.ZodMiniNumber; filledAt: z.ZodMiniISODateTime; id: z.ZodMiniString; logIndex: z.ZodMiniNumber; orderId: z.ZodMiniString; partialFill: z.ZodMiniBoolean; taker: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; transactionHash: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>>; meta: z.ZodMiniOptional; totalCount: z.ZodMiniNumber; }, z.core.$strip>>; nextCursor: z.ZodMiniNullable>; }, z.core.$strip>; } /** Schemas for the getPairDepth operation (orderbook depth aggregation). */ namespace getPairDepth { /** * Path parameter mirrors `getPair.Params`: the base address alone * identifies the pair (its quote is intrinsic to the base token on-chain). */ const Params: z.ZodMiniObject<{ base: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; /** * Optional related resource that callers opt into via `include`. Currently * only `tokens` (embeds metadata onto `base`/`quote` instead of returning * just the addresses). */ const Include: z.ZodMiniEnum<{ tokens: "tokens"; }>; /** * Parses a comma-separated `include` query value into a list of optional * resources to embed. */ const includeQuery: z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; /** Query parameters for pair depth requests. */ const Query: z.ZodMiniObject<{ chainId: z.ZodMiniOptional, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniPipe, z.ZodMiniTransform>]>, z.ZodMiniNumber>>; include: z.ZodMiniPipe, z.ZodMiniTransform>, z.ZodMiniArray>>; levels: z.ZodMiniDefault>; }, z.core.$strict>; /** * A single price-level entry in the orderbook depth. `size` is the raw * `totalLiquidity` reported by the DEX precompile for the level (resting * base-token amount); `cumulativeSize` is the running sum across the same * side, starting from the best (peg-adjacent) populated tick and walking * outward. */ const Level: z.ZodMiniObject<{ cumulativeSize: z.ZodMiniString; id: z.ZodMiniString; price: z.ZodMiniString; size: z.ZodMiniString; tick: z.ZodMiniNumber; }, z.core.$strip>; /** Orderbook depth (cumulative size per tick) for a single trading pair. */ const Response: z.ZodMiniObject<{ asks: z.ZodMiniArray; id: z.ZodMiniString; price: z.ZodMiniString; size: z.ZodMiniString; tick: z.ZodMiniNumber; }, z.core.$strip>>; base: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; bids: z.ZodMiniArray; id: z.ZodMiniString; price: z.ZodMiniString; size: z.ZodMiniString; tick: z.ZodMiniNumber; }, z.core.$strip>>; quote: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; currency: z.ZodMiniOptional>; decimals: z.ZodMiniOptional>; logoUri: z.ZodMiniOptional>; name: z.ZodMiniOptional>; symbol: z.ZodMiniOptional>; verified: z.ZodMiniOptional>; }, z.core.$strip>; }, z.core.$strip>; } } /** * Creates exchange handlers. The first endpoint is `GET /pairs`, which lists * trading pairs on the stablecoin DEX precompile by replaying its `PairCreated` * events through the indexer. * * Two sort orders are supported: * - `sort=created` (default): order by pair creation `(block_num, log_idx)`. * - `sort=liquidity`: rank by the DEX precompile's escrow balance of the pair's * base token, a per-pair liquidity proxy. Each base address participates in * exactly one pair (the on-chain DEX keys orderbooks by base, so the same * base never appears in two pairs), which lets a single * `token_balances_snapshot` row attribute cleanly to one pair. Pairs whose * DEX-escrow balance is zero are excluded from the liquidity ranking. */ export declare function exchanges(options?: exchanges.Options): import("hono/hono-base").HonoBase; export declare namespace exchanges { /** Options for the exchange handlers. */ type Options = { /** FX configuration backing amount valuation. */ fx?: Valuation.addresses.Fx | undefined; /** Whether to try Tempo's native stablecoin DEX first. Enabled by default. */ nativeDex?: boolean | undefined; }; } /** * Resolves the point-in-time order-state streams for a set of `orderId`s * from the raw `OrderPlaced`/`OrderFlipped` logs. * * A T5+ flip order keeps its `orderId` while `(isBid, tick)` swap sides on * every flip, so a fill's state is the latest event *before* the fill — not * the original `OrderPlaced`. One query returns, per order, its pre-page * history compressed to the latest event (`argMax`, sentinel position * `(-1, -1)` so it sorts first) plus every raw in-page event, so an order * that flips between two of its page fills resolves each fill correctly. * The same query attaches each book's indexed quote token, avoiding a second * TIDX request; callers retain an RPC fallback for books absent from the index. * `logs` is sorted by `(address, selector, block_num, log_idx)` with a * `topic1` bloom index, so both halves are pruned range reads. Returned * per-order event lists are position-sorted. */ export declare function resolveOrderStates(c: Context, options: resolveOrderStates.Options): Promise>; declare namespace resolveOrderStates { /** Options for the order-state stream query. */ type Options = { chainId: z.output; /** Highest block of the page (inclusive in-span bound). */ maxBlock: number; /** Lowest block of the page (baseline/in-span split point). */ minBlock: number; /** Decimal order ids to resolve. */ orderIds: readonly string[]; }; /** Order state effective from `(blockNumber, logIndex)` onward. */ type State = { /** Event block, or `-1` for the compressed pre-page baseline. */ blockNumber: number; /** Maker side at this state: `true` = bid (taker sells base into it). */ isBid: boolean; /** Event log index, or `-1` for the baseline. */ logIndex: number; /** Indexed quote token for the state's book, when available. */ quoteToken?: z.output | undefined; /** Signed price tick at this state. */ tick: number; /** Book base token (lowercase address). */ token: string; }; } /** * Resolves the quote token of order books missing from the `dex_pairs` index * (books created without a `PairCreated` event, e.g. genesis system books) * by reading the base token's on-chain `quoteToken()` — the quote is * intrinsic and immutable for a TIP-20, so results memoize long. `undefined` * from the RPC means the default quote (pathUSD). Best-effort: a base whose * quote cannot be resolved is absent from the returned map, and its fills * are dropped downstream. */ export declare function resolveBookQuotes(c: Context, options: resolveBookQuotes.Options): Promise>>; declare namespace resolveBookQuotes { /** Options for the book-quote fallback resolution. */ type Options = { /** Book base addresses missing from the pair index (lowercase). */ bases: readonly string[]; chainId: z.output; }; } /** * Computes per-book resting-order reserves for a set of base tokens, mirroring * the legacy `/gecko` adapter's pool-liquidity semantics: scan `OrderPlaced` * scoped to the given bases, subtract fills, drop cancelled orders, then * aggregate each order's `remaining` by side — asks into the base reserve, bids * into the quote reserve. * * The bid leg is added in its placed (base-denominated) units **without** tick * conversion, matching the legacy adapter exactly so GeckoTerminal's per-pool * `reserve_in_usd` stays consistent with the figures it has indexed historically. * (The on-chain `balanceOf` of the DEX settlement account — what the adapter * used previously — is a single shared pool across every book sharing a quote * token, so it cannot express per-book liquidity.) * * Reserves are keyed by **base** token (a book's identity), so two books sharing * a quote token report distinct reserves. The `OrderPlaced` scan uses a fair * per-token cap (`LIMIT ... BY token`) so one active book can't starve the * others' newest placements under a shared budget; `truncated` is set when any * book hits the cap. Like {@link loadRestingOrders}, this reads only * `OrderPlaced` (`dex_orders`), so flip orders (which mutate side/tick via * `OrderFlipped` without a new placement) are not reflected — acceptable for * legacy parity, but not an exact economic TVL. */ export declare function resolveBookReserves(c: Context, options: resolveBookReserves.Options): Promise; export declare namespace resolveBookReserves { type Options = { /** Book base tokens to compute reserves for (case-insensitive). */ bases: readonly string[]; chainId: z.output; /** Newest-placement scan window per base; defaults to {@link orderScanCap}. */ scanCap?: number | undefined; }; /** Per-book resting liquidity, in each token's smallest unit. */ type Reserve = { /** Ask-side resting liquidity (base token units). */ base: bigint; /** Bid-side resting liquidity (base-denominated, legacy-compatible). */ quote: bigint; }; type Result = { /** Reserves keyed by lowercase base token. */ reserves: Map; /** Set when any book hit `scanCap` (older placements may be missing). */ truncated: boolean; }; } export {}; //# sourceMappingURL=exchanges.d.ts.map