import { type CCIPExecution, type CCIPRequest, type CCIPVerifications, type Chain, type Lane, type TokenInfo, type TokenUIMultiplier, ChainFamily } from '@chainlink/ccip-sdk/src/index.ts'; import type { PickDeep } from 'type-fest'; import type { Ctx } from './types.ts'; /** * Prompts user to select a CCIP request from a list. * @param requests - List of CCIP requests to choose from. * @param promptSuffix - Optional suffix for the prompt message. * @param hints - Optional hints for pre-filtering requests. * @returns Selected CCIP request. */ export declare function selectRequest(requests: readonly CCIPRequest[], promptSuffix?: string, hints?: { logIndex?: number; interactive?: boolean; }): Promise; /** * Converts a Unix timestamp to a Date object. * @param obj - Object with timestamp property. * @returns Object with Date timestamp. */ export declare function withDateTimestamp(obj: T): Omit & { timestamp: Date; }; /** * Prints lane information in a human-readable format. * @param lane - Lane configuration. */ export declare function prettyLane(this: Ctx, lane: Lane): void; /** * Format an address for display using chain-specific formatting. * @param address - Address string * @param family - Chain family for formatting * @returns Formatted address for display */ export declare function formatDisplayAddress(address: string, family: ChainFamily): string; /** * Format a transaction hash for display using chain-specific formatting. * @param hash - Transaction hash string * @param family - Chain family for formatting * @returns Formatted hash for display */ export declare function formatDisplayTxHash(hash: string, family: ChainFamily): string; /** * Recursively formats a record for pretty printing: values under known * address/tx-hash keys go through {@link formatDisplayAddress}/ * {@link formatDisplayTxHash}, so TON (and future) user-facing formats are * always friendly addresses and bare tx hashes in pretty output. * * `sameFamily` formats values owned by the printing chain. `familyFor` * overrides the family for specific keys holding *remote*-chain values — e.g. * an EVM OffRampConfig's `onRamps` list, which contains source-chain * addresses and must be formatted with the source family. Only affects pretty * output: json/log formats must keep raw values. */ export declare function prettyFormat(value: unknown, sameFamily: ChainFamily, familyFor?: Readonly>): unknown; /** * Formats a token amount for display, with its symbol and decimals when they resolve. * @internal */ export declare function formatToken(source: Chain | undefined, ta: { amount: bigint; } & ({ token: string; } | { sourceTokenAddress?: string; sourcePoolAddress: string; extraData?: string; }), family?: ChainFamily): Promise; /** * Formats an array into a record with indexed keys. * @param name - Base name for the keys. * @param values - Array values to format. * @returns Record with indexed keys. */ export declare function formatArray(name: string, values: readonly T[], edges?: string): Record; /** * Formats an ERC-8056 UI multiplier for display, e.g. `2x`, with a scheduled change, e.g. * `2x (3x from 2026-12-07 14:30:00)`. * @param multiplier - The token's UI multiplier. * @returns The formatted multiplier. */ export declare function formatUIMultiplier({ uiMultiplier, next }: TokenUIMultiplier): string; /** * Formats a raw token amount with its symbol and, for an ERC-8056 token, its UI amount at the * current multiplier, e.g. `1.5 TSLA (3 UI @ 2x)`. * @param amount - Raw amount. * @param info - The token's info. * @returns The formatted amount. */ export declare function formatTokenAmount(amount: bigint, info: TokenInfo): string; /** * Formats duration in seconds to human-readable string. * @param secs - Duration in seconds. * @returns Formatted duration string (e.g., "2d 1h30m"). */ export declare function formatDuration(secs: number): string; /** * Omit specified keys from an object and return a new object. */ export declare function omit, K extends string>(obj: T, ...keys: K[]): Omit; /** * Prints a CCIP request in a human-readable format. * @param request - CCIP request to print. * @param source - Source chain instance. */ export declare function prettyRequest(this: Ctx, request: CCIPRequest, source?: Chain): Promise; /** * Prints CCIP Verifications in a human-readable format. * @param dest - Destination chain instance. * @param verifications - CCIP verifications to print. * @param request - CCIP request for timestamp comparison. */ export declare function prettyVerifications(this: Ctx, dest: Chain, verifications: CCIPVerifications, request: PickDeep): Promise; /** * Prints a formatted table of key-value pairs. * @param args - Key-value pairs to print. * @param opts - Formatting options. */ export declare function prettyTable(this: Ctx, args: Record, opts?: { spcount: number; }): void; /** * Prints a CCIP execution receipt in a human-readable format. * @param receipt - CCIP execution receipt to print. * @param request - CCIP request for timestamp comparison. * @param origin - Optional transaction origin address. */ export declare function prettyReceipt(this: Ctx, receipt: CCIPExecution, request: PickDeep, origin?: string): void; /** * Format a CCIPError with recovery hints for user-friendly display. * @param err - Error to format. * @param verbose - If true, include stack trace for debugging. * @returns Formatted error string if CCIPError, null otherwise. */ export declare function formatCCIPError(err: unknown, verbose?: boolean): string | null; /** * Logs a parsed error message if the error can be decoded. * @param err - Error to parse and log. * @returns True if error was successfully parsed and logged. */ export declare function logParsedError(this: Ctx, err: unknown): boolean; /** * Parse `--transfer-tokens token1=amount1 token2=amount2 ...` into `{ token, amount }[]`. * * Decimals resolve internally, with the standard fallback chain (see `resolveTokenDecimals`): * the token's own on-chain `decimals()` view, else its pool's declared decimals * (`TokenPoolConfig.decimals`, pool v1.5.1+ — the authoritative source, since the pool uses * exactly these decimals for its own conversion). The family default does NOT apply here: * these decimals determine the actual transfer amount, so a lookup failure must surface * rather than silently parse the amount at a guessed precision. **/ export declare function parseTokenAmounts(source: Chain, transferTokens: readonly string[], router?: string): Promise<{ token: string; amount: bigint; }[]>; /** * Yield resolved promises (like Promise.all), but as they resolve. * Throws as soon as any promise rejects. * * @param promises - Promises to resolve (can be an array or a generator) * @returns Resolved values as they resolve **/ export declare function yieldResolved(promises: Iterable>): AsyncGenerator; /** * Create context for command execution. * * Output architecture (following Vercel CLI / gws / gh patterns): * - `output.write/table` → stdout (data only) * - `logger.info/warn/error/debug` → stderr (status/diagnostics) * * @param argv - yargs argv containing verbose flag * @returns context object with abort signal, output, and logger */ export declare function getCtx(argv: { verbose?: boolean; }): [ctx: Ctx, destroy: (reason?: unknown) => void]; //# sourceMappingURL=utils.d.ts.map