UNPKG

web3-error-helper

Version:

> 🛠️ Turn confusing Web3 errors into clear, human-friendly messages for developers and users alike.

74 lines (73 loc) 1.71 kB
/** * Chain statistics and aggregation * * This module provides comprehensive statistical analysis and reporting capabilities * for blockchain networks. It aggregates data from both built-in and custom chains, * generates usage summaries, and provides insights into chain distribution and * configuration patterns. Focuses on data aggregation and reporting without side effects. */ /** * Get comprehensive chain statistics * * @returns Object with detailed chain statistics * * @example * ```typescript * const stats = getChainStats(); * console.log(stats); * // { * // total: 10, * // builtIn: 8, * // custom: 2, * // chains: ['ethereum', 'polygon', 'my-custom-chain', ...] * // } * ``` */ export declare function getChainStats(): { total: number; builtIn: number; custom: number; chains: string[]; }; /** * Get chain distribution statistics * * @returns Object with chain type distribution * * @example * ```typescript * const distribution = getChainDistribution(); * console.log(distribution); * // { * // builtInPercentage: 80, * // customPercentage: 20, * // ratio: '4:1' * // } * ``` */ export declare function getChainDistribution(): { builtInPercentage: number; customPercentage: number; ratio: string; }; /** * Get chain usage summary * * @returns Object with chain usage information * * @example * ```typescript * const summary = getChainUsageSummary(); * console.log(summary); * // { * // mostUsed: 'ethereum', * // leastUsed: 'fantom', * // averageUsage: 12.5 * // } * ``` */ export declare function getChainUsageSummary(): { mostUsed: string; leastUsed: string; averageUsage: number; };