UNPKG

filecoin-pin

Version:

Bridge IPFS content to Filecoin Onchain Cloud using familiar tools

87 lines 3.77 kB
/** * Payment setup utilities and display functions * * This module provides UI utilities and display functions for payment setup, * building on the shared payment operations exposed from `src/core/payments`. */ /** * Parse storage allowance string * * Parses different storage allowance formats: * - "1TiB/month" or "500GiB/month" - Human-friendly storage units * - "0.0000565" - Direct USDFC per epoch (returns null, needs price lookup) * * @param input - Storage allowance string * @returns Parsed TiB per month or null if it's a direct USDFC amount */ export declare function parseStorageAllowance(input: string): number | null; /** * Display the payment status summary * * Shows three sections: Wallet, Filecoin Pay Deposit, and WarmStorage Service Permissions * * @param network - Network name * @param filBalance - FIL balance in wei * @param isCalibnet - Whether this is calibnet testnet * @param walletUsdfcBalance - USDFC balance in wei * @param filecoinPayBalance - Amount deposited in Filecoin Pay * @param rateAllowance - Maximum rate per epoch * @param lockupAllowance - Maximum lockup amount * @param pricePerTiBPerEpoch - Current storage price */ export declare function displayPaymentSummary(network: string, filBalance: bigint, isCalibnet: boolean, walletUsdfcBalance: bigint, filecoinPayBalance: bigint, rateAllowance: bigint, lockupAllowance: bigint, pricePerTiBPerEpoch: bigint): void; /** * Display account and balance information * * @param address - Wallet address * @param network - Network name (mainnet/calibration) * @param filBalance - FIL balance in wei * @param isCalibnet - Whether on calibration testnet * @param hasSufficientGas - Whether wallet has enough FIL for gas * @param walletUsdfcBalance - USDFC balance in wei * @param filecoinPayBalance - Amount deposited to Filecoin Pay */ export declare function displayAccountInfo(address: string, network: string, filBalance: bigint, isCalibnet: boolean, _hasSufficientGas: boolean, walletUsdfcBalance: bigint, filecoinPayBalance: bigint): void; /** * Display deposit warning if balance is too low for active storage * * Warns when the available deposit (total deposit minus locked amount) * is insufficient to maintain active storage operations. * * @param filecoinPayBalance - Current deposit balance * @param lockupUsed - Amount currently locked for active storage */ export declare function displayDepositWarning(filecoinPayBalance: bigint, lockupUsed: bigint): void; /** * Storage capacity information with deposit limitations */ export interface StorageCapacityInfo { actualGiB: number; potentialGiB: number; isDepositLimited: boolean; additionalDepositNeeded: bigint; } /** * Display capacity information based on deposit and limits * * @param capacity - Calculated capacity information */ export declare function displayCapacity(capacity: StorageCapacityInfo): void; /** * Display current pricing information * * @param pricePerGiBPerMonth - Price per GiB per month * @param pricePerTiBPerMonth - Price per TiB per month */ export declare function displayPricing(pricePerGiBPerMonth: bigint, pricePerTiBPerMonth: bigint): void; /** * Display WarmStorage service permissions with capacity information * * @param title - Section title to display * @param monthlyRate - Rate allowance in USDFC per month * @param lockupAmount - Lockup allowance amount * @param filecoinPayBalance - Total deposited amount * @param pricePerTiBPerEpoch - Current pricing per TiB per epoch */ export declare function displayServicePermissions(title: string, monthlyRate: bigint, lockupAmount: bigint, filecoinPayBalance: bigint, pricePerTiBPerEpoch: bigint, shouldFlush?: boolean): void; //# sourceMappingURL=setup.d.ts.map