UNPKG

@wasserstoff/tribes-sdk

Version:

SDK for integrating with Tribes by Astrix platform on any EVM compatible chain

33 lines (32 loc) 1.25 kB
/** * Format a token amount to a human-readable string * @param amount Amount in wei * @param decimals Number of decimals * @param symbol Token symbol */ export declare function formatTokenAmount(amount: bigint, decimals?: number, symbol?: string): string; /** * Format an address with truncation * @param address Address to format * @param prefixLength Number of characters to keep at the beginning * @param suffixLength Number of characters to keep at the end */ export declare function formatAddress(address: string, prefixLength?: number, suffixLength?: number): string; /** * Format a date to ISO string or custom format * @param timestamp Timestamp in seconds * @param format Format string (currently only supports 'iso') */ export declare function formatDate(timestamp: number, format?: 'iso' | 'relative'): string; /** * Format a number with thousand separators * @param value Number to format * @param decimals Number of decimal places */ export declare function formatNumber(value: number, decimals?: number): string; /** * Format a percentage * @param value Percentage value (0-100) * @param decimals Number of decimal places */ export declare function formatPercentage(value: number, decimals?: number): string;