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 VerifiedTokens from '../../../internal/VerifiedTokens.js'; import * as FxOracle from '../FxOracle.js'; /** Zod schemas owned by the valuation handlers. */ export declare namespace schema { /** A holding's nominal value in the requested denomination. */ const Value: z.ZodMiniObject<{ amount: z.ZodMiniString; currency: z.ZodMiniString; }, z.core.$strip>; /** Rate provenance for a converted valuation. */ const Pricing: z.ZodMiniObject<{ asOf: z.ZodMiniISODateTime; basis: z.ZodMiniLiteral<"nominal">; source: z.ZodMiniString; }, z.core.$strip>; /** Schemas for the getAddressValuation operation. */ namespace getAddressValuation { /** Path parameters for address valuation requests. */ const Params: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; }, z.core.$strip>; /** Query parameters for address valuation requests. */ const Query: z.ZodMiniObject<{ chainId: z.ZodMiniOptional, z.ZodMiniTransform<4217 | 42431, "mainnet" | "testnet">>, z.ZodMiniPipe, z.ZodMiniTransform>]>, z.ZodMiniNumber>>; currency: z.ZodMiniOptional, z.ZodMiniTransform>>; }, z.core.$strict>; /** The nominal valuation of an account's verified holdings. */ const Response: z.ZodMiniObject<{ address: z.ZodMiniPipe, z.ZodMiniTransform<`0x${string}`, `0x${string}`>>; amount: z.ZodMiniString; currency: z.ZodMiniString; id: z.ZodMiniString; pricing: z.ZodMiniNullable; source: z.ZodMiniString; }, z.core.$strip>>; unpriced: z.ZodMiniArray>; }, z.core.$strip>; } } /** * Creates address-scoped valuation handlers, mounted under the `/addresses` * composer. Exposes `GET /:address/valuation`, the holdings valuation. */ export declare function addresses(options?: addresses.Options): import("hono/hono-base").HonoBase; export declare namespace addresses { /** Options for the address-scoped valuation handlers. */ type Options = { /** FX configuration backing currency conversion. */ fx?: Fx | undefined; }; /** FX configuration for valuation handlers. */ type Fx = { /** FX rate oracle. Defaults to `FxOracle.ecb()`. */ oracle?: FxOracle.Oracle | undefined; }; } /** Loads the oracle's rate set through the request's store cache. */ export declare function rateSet(c: Context, oracle: FxOracle.Oracle): Promise; /** * Loads rates best-effort to validate the denomination and value a page. * Returns `undefined` when unavailable or unnecessary; a known unsupported denomination still throws. */ export declare function ratesFor(c: Context, options: ratesFor.Options): Promise; export declare namespace ratesFor { /** Options for loading a page's valuation rates. */ type Options = { /** Display currencies of the curated holdings appearing on the page. */ currencies: Iterable; /** Currency values are denominated in (uppercase). */ denomination: string; /** FX rate oracle backing currency conversion. */ oracle: FxOracle.Oracle; }; } /** Builds the `pricing` provenance block for a consulted rate set. */ export declare function pricing(rates: FxOracle.RateSet, oracle: FxOracle.Oracle): { asOf: string; basis: 'nominal'; source: string; }; /** * Values one holding in the requested denomination via its curated display * currency. Returns `null` when the token is unverified, its currency has no * rate, or the rate set is unavailable. */ export declare function valuationFor(options: valuationFor.Options): { amount: string; currency: string; } | null; export declare namespace valuationFor { /** Options for valuing one holding. */ type Options = { /** Holding amount in the token's base units. */ amount: bigint; /** Currency the value is denominated in (uppercase). */ denomination: string; /** Oracle rate set, when loaded. */ rates: FxOracle.RateSet | undefined; /** Display currency and decimal scale backing the holding, when known. */ token: Pick | undefined; }; } /** Thrown when the requested denomination is not priced by the FX oracle. */ export declare class UnsupportedDenominationError extends Error { name: string; constructor(denomination: string, oracle: string); } //# sourceMappingURL=valuation.d.ts.map