import type { OrderWire, OrderRequest } from './types.js'; /** * Round price to 5 significant figures and appropriate decimals * Perps: max 6 decimals, Spot: max 8 decimals */ export declare function roundPrice(price: number, szDecimals: number, isSpot?: boolean): string; /** * Round size to asset's szDecimals */ export declare function roundSize(size: number, szDecimals: number): string; /** * Calculate slippage-adjusted price for market orders */ export declare function getSlippagePrice(midPrice: number, isBuy: boolean, slippageBps: number): number; /** * Convert order request to wire format */ export declare function orderToWire(order: OrderRequest, assetIndex: number, szDecimals: number): OrderWire; /** * Get current timestamp in milliseconds */ export declare function getTimestampMs(): number; /** * Format USD amount for display */ export declare function formatUsd(amount: number | string): string; /** * Format percentage for display */ export declare function formatPercent(value: number | string, decimals?: number): string; /** * Format funding rate (hourly to annualized) */ export declare function annualizeFundingRate(hourlyRate: number | string): number; /** * Parse CLI arguments into key-value pairs */ export declare function parseArgs(args: string[]): Record; /** * Normalize a coin name: uppercase the asset, keep dex prefix lowercase. * "eth" → "ETH", "xyz:cl" → "xyz:CL", "xyz:CL" → "xyz:CL" */ export declare function normalizeCoin(coin: string): string; /** * Sleep for specified milliseconds */ export declare function sleep(ms: number): Promise; /** Hyperliquid rejects orders below this notional (waived for reduce-only). */ export declare const MIN_ORDER_NOTIONAL_USD = 10; export type ParsedOrderStatus = { kind: 'resting'; oid: number; } | { kind: 'filled'; totalSz: number; avgPx: number; oid: number; } /** normalTpsl children behind an unfilled parent — success states, not errors. */ | { kind: 'waiting'; state: 'waitingForFill' | 'waitingForTrigger'; } | { kind: 'error'; error: string; } | { kind: 'unknown'; raw: unknown; }; /** * Parse a single entry of an order response's `statuses` array. Handles the * plain-string success states ("waitingForFill" / "waitingForTrigger") that * Hyperliquid returns for normalTpsl children armed behind an unfilled parent, * alongside the usual resting/filled/error objects. */ export declare function parseOrderStatus(status: unknown): ParsedOrderStatus; /** * Generate a random client order ID */ export declare function generateCloid(): string; /** * Check if builder fee is approved and print warning if not * Returns true if approved, false if not */ export declare function checkBuilderFeeApproval(client: { getMaxBuilderFee: () => Promise; builderAddress: string; isTestnet: boolean; }): Promise; //# sourceMappingURL=utils.d.ts.map