UNPKG

@shogun-sdk/money-legos

Version:

Shogun Money Legos: clients and types for quotes, memes, prices, balances, fees, validations, etc.

38 lines 2.27 kB
export declare const formatNetworkName: (network: string) => string; export declare const toUpperCase: (stringInput: string) => string; export declare const formatNumber: (number: number, decPlaces?: number) => string; export declare const capitalizeFirstLetter: (str: string) => string; export declare const formatEthUiBalance: (balance: string, symbol?: string) => string; export declare const formatPriceInEth: (price: string) => string; export declare const formatMaxBuyNativeAmount: (amount: number) => string; export declare function formatNumberWithThreeDecimalPlaces(num: number): string; export declare const subscriptDigit: (digit: number) => string; export declare const formatSupplyPercentageOwned: (tokenSupplyOwned: number) => string; export declare const convertNumbThousand: (x?: number) => string; export declare function lowercase(input: string): string; export declare const formatPnl: (pnl: string) => string; export declare const formatChangeXH: (change: number, h: string) => string; export declare const formatAvgEntry: (avgEntry: string) => string; export declare const formatTimeAgo: (timestamp: number) => string; /** * Normalizes a decimal number string by limiting the number of decimal places. * This helper prevents numeric overflow/underflow errors when dealing with high-precision decimals. * * @param value - The decimal number as a string (e.g., "0.15947712418300652") * @returns A string with the normalized decimal number * * Examples: * normalizeDecimals("0.15947712418300652") => "0.15947712" * normalizeDecimals("1.23", 4) => "1.23" * normalizeDecimals("123") => "123" * normalizeDecimals("0.1234", 2) => "0.12" * */ export declare function normalizeDecimals(value: string, decimals?: number): string; export declare function bigIntReplacer<T>(_key: string, value: T): T; export declare function getFormattedObject(object: object): string; export declare function formatUSD(amount: string | number): string; export declare function getUserIdLog(userId: number | string): string; export declare function getFormattedCurrentMethod(userId: number | string, methodName: string, instance?: object): string; export declare function formatTokenAmount(amount: string | number): string; //# sourceMappingURL=formatter.d.ts.map