bigblocks
Version:
Complete Bitcoin UI component library - authentication, social, wallet, market, inscriptions, and blockchain interactions for React
52 lines • 1.71 kB
TypeScript
export type Currency = "BSV" | "USD" | "EUR" | "GBP" | "JPY";
export interface ExchangeRates {
BSV: number;
USD: number;
EUR: number;
GBP: number;
JPY: number;
}
/**
* Format satoshis as BSV with appropriate decimal places
*/
export declare function formatBSV(satoshis: number, decimals?: number): string;
/**
* Format satoshis as the specified currency
*/
export declare function formatCurrency(value: number, currency?: Currency, exchangeRate?: number): string;
/**
* Format token amounts with proper decimal places
*/
export declare function formatTokenAmount(amount: string | number, decimals?: number): string;
/**
* Parse token amount from display format to token units
*/
export declare function parseTokenAmount(amount: string, decimals?: number): string;
/**
* Convert between different currencies
*/
export declare function convertCurrency(amount: number, fromCurrency: Currency, toCurrency: Currency, exchangeRates: Partial<ExchangeRates>): number;
/**
* Calculate percentage change
*/
export declare function calculatePercentageChange(oldValue: number, newValue: number): number;
/**
* Format percentage with appropriate color coding
*/
export declare function formatPercentage(percentage: number): {
text: string;
color: "green" | "red" | "gray";
};
/**
* Abbreviate large numbers (e.g., 1000 -> 1K, 1000000 -> 1M)
*/
export declare function abbreviateNumber(num: number): string;
/**
* Validate if a string is a valid numeric amount
*/
export declare function isValidAmount(amount: string): boolean;
/**
* Get currency symbol for display
*/
export declare function getCurrencySymbol(currency: Currency): string;
//# sourceMappingURL=currency.d.ts.map