UNPKG

@daimo/pay

Version:

Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.

17 lines (16 loc) 596 B
/** * Returns true if the value is a valid number. * @param value The value to validate. * @param maxDecimals The maximum number of decimal places. * @returns True if the value is a valid number, false otherwise. */ export declare function isValidNumber(value: string, maxDecimals?: number): boolean; /** * Sanitize a number input. * - Remove all non-numeric and non-decimal characters * - If the value is empty, return "0" * - Parse into a number * @param value The value to sanitize. * @returns The sanitized value. */ export declare function sanitizeNumber(value: string): string;