/**
 * Utility functions for formatting values in the swap module
 */
/**
 * Formats a token balance for display
 */
export function formatTokenBalance(balance, decimals) {
    const balanceNum = Number(balance) / 10 ** decimals;
    return balanceNum.toLocaleString("en-US", {
        minimumFractionDigits: 0,
        maximumFractionDigits: 6,
    });
}
/**
 * Formats a wallet address for display (truncated)
 */
export function formatWalletAddress(address) {
    if (!address)
        return "";
    return `${address.slice(0, 6)}...${address.slice(-6)}`;
}
/**
 * Formats estimated fill time in seconds to a readable string
 */
export function formatEstimatedTime(seconds) {
    if (seconds < 60) {
        return `${seconds} min`;
    }
    const minutes = Math.floor(seconds / 60);
    return `${minutes} min`;
}
/**
 * Formats a token amount for display
 */
export function formatTokenAmount(amount, decimals) {
    const amountNum = Number(amount) / 10 ** decimals;
    return amountNum.toLocaleString("en-US", {
        minimumFractionDigits: 0,
        maximumFractionDigits: 6,
    });
}
/**
 * Validates if a string is a valid numeric input
 */
export function isValidNumericInput(value) {
    return !value || /^[0-9]*[.]?[0-9]*$/.test(value);
}
//# sourceMappingURL=formatters.js.map
