@funkit/connect
Version:
Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.
26 lines (25 loc) • 1.05 kB
TypeScript
/**
* Retrieves the maximum checkout amount in USD and formats the limit text.
*
* @description
* This hook uses a Statsig dynamic config to determine the maximum checkout amount.
* If the amount is negative (e.g. -1), it returns 'no' as the limit text (no limit).
* Otherwise, it formats the amount as a currency string with specific formatting options.
*
* @returns {Object} An object containing:
* - `value`: The maximum checkout amount in USD (number). Defaults to Number.MAX_VALUE (no limit).
* - `limitLabel`: A formatted string representing the checkout limit
* - Returns 'no' if the limit is negative (no limit, e.g. -1)
* - Otherwise, returns a formatted currency string (e.g., '$1k')
*
* @example
* // Example usage in a component
* const { value, limitLabel } = useFunkitMaxCheckoutUsdInfo();
* console.log(value); // e.g., 1000
* console.log(limitLabel); // e.g., '$1k'
* console.log(limitLabel); // e.g., 'no'
*/
export declare const useFunkitMaxCheckoutUsdInfo: () => {
value: number;
limitLabel: string;
};