import { TokenMetadata, WarpRouteDeployConfigMailboxRequired } from '../token/types.js'; /** * Lossless scale representation using bigint. * On-chain values and internal comparisons always use this form. */ export type NormalizedScale = { numerator: bigint; denominator: bigint; }; /** * Any scale variant the Zod schema can produce: * - `number` (e.g. `scale: 1000`) * - `{numerator: number, denominator: number}` * - `{numerator: bigint, denominator: bigint}` */ export type ScaleInput = TokenMetadata['scale']; export declare const DEFAULT_SCALE: NormalizedScale; export type ScaleAlignment = { localAmount: bigint; messageAmount: bigint; }; /** * Converts any accepted scale variant to NormalizedScale (bigint). */ export declare function normalizeScale(scale: ScaleInput | undefined): NormalizedScale; export declare function messageAmountFromLocal(localAmount: bigint, scale: ScaleInput | undefined): bigint; export declare function localAmountFromMessage(messageAmount: bigint, scale: ScaleInput | undefined): bigint; export declare function minLocalAmountForMessage(messageAmount: bigint, scale: ScaleInput | undefined): bigint; export declare function alignLocalAmountToMessage(localAmount: bigint, scale: ScaleInput | undefined): ScaleAlignment; /** * Compares two scale values for equality without precision loss. * Accepts any scale variant (number, {number,number}, {bigint,bigint}, undefined). * Uses cross-multiplication: a/b === c/d iff a*d === b*c */ export declare function scalesEqual(a: ScaleInput | undefined, b: ScaleInput | undefined): boolean; /** * Verifies that scale configs across chains are mutually consistent. * * A warp route may use either convention: * - Scale-up: 6-decimal chains carry scale > 1, max-decimal chain carries no scale * - Scale-down: max-decimal chain carries scale < 1 ({num:1, den:N}), others carry no scale * * Both are valid as long as the effective message amount is identical for every chain: * scale_A / scale_B == 10^(dec_B - dec_A) for any pair (A, B) * * Equivalently (avoiding floating point): for a fixed reference chain R, * scale_A.num * 10^dec_A * scale_R.den == scale_R.num * 10^dec_R * scale_A.den * * This accepts precision loss from scale-down (e.g., BSC 18-decimal USDT * scaled to 6-decimal message encoding loses 12 digits of sub-unit precision). */ export declare function verifyScale(configMap: Map | WarpRouteDeployConfigMailboxRequired): boolean; //# sourceMappingURL=decimals.d.ts.map