filecoin-pin
Version:
Bridge IPFS content to Filecoin Onchain Cloud using familiar tools
35 lines • 1.49 kB
TypeScript
import type { StorageRunwaySummary } from '../payments/index.js';
/**
* Format USDFC amount for display
*
* @param amount - Amount in wei (18 decimals)
* @param decimals - Number of decimal places to show
* @returns Formatted string
*/
export declare function formatUSDFC(amount: bigint, decimals?: number): string;
/**
* Format FIL amount for display
*
* @param amount - Amount in wei (18 decimals)
* @param isTestnet - Whether this is a testnet (shows tFIL)
* @param decimals - Number of decimal places to show
* @returns Formatted string
*/
export declare function formatFIL(amount: bigint, isTestnet: boolean, decimals?: number): string;
/**
* Format a runway duration for human-readable CLI output.
*
* - For small values (< 60 days): include days and hours
* - For medium values (< 365 days): include months and days (30-day months)
* - For large values (>= 365 days): include years, months and days (365-day years, 30-day months)
*
* @param days - Whole days of runway (non-negative)
* @param hoursRemainder - Hours remainder (0-23). Ignored when days >= 60
* @returns A formatted string, e.g., "5 day(s) 12 hour(s)" or "1 year(s) 2 month(s) 3 day(s)"
*/
export declare function formatRunwayDuration(days: number, hoursRemainder?: number): string;
/**
* Convert a storage runway summary into a human-readable string for CLI/action output.
*/
export declare function formatRunwaySummary(runway: StorageRunwaySummary): string;
//# sourceMappingURL=format.d.ts.map