npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@hsuite/smart-config

v2.1.3

Published

A powerful and flexible configuration management module for Hashgraph network applications, built on top of NestJS.

Readme

@hsuite/smart-config

A powerful and flexible configuration management module for Hashgraph network applications, built on top of NestJS.

npm version License: MIT

Overview

The Smart Config module provides a centralized configuration management system for Hashgraph network operations. It handles various aspects of configuration including network environments, node management, service discovery, and fee structures.

Features

  • Network Environment Management

    • Support for testnet and mainnet environments
    • Public and private network configurations
    • Custom network settings
    • Local development environment support
  • Node Configuration

    • Dynamic node discovery and management
    • Consensus threshold calculation
    • Network entity configuration
    • Node health monitoring
  • Service Integration

    • Mirror node configuration
    • HTTP service integration
    • Utility service discovery
    • Fee structure management
  • Operator Management

    • Operator credentials handling
    • Access permission management
    • Operation parameter configuration

Installation

npm install @hsuite/smart-config

Peer Dependencies

{
  "@nestjs/common": "^10.4.2",
  "@nestjs/core": "^10.4.2"
}

Dependencies

{
  "@hsuite/hashgraph-types": "^2.0.0",
  "@hsuite/smart-network-types": "^2.0.0",
  "@hashgraph/sdk": "^2.62.0",
}

Usage

Module Registration

The Smart Config module can be registered asynchronously in your NestJS application:

import { Module } from '@nestjs/common';
import { SmartConfigModule } from '@hsuite/smart-config';

@Module({
  imports: [
    SmartConfigModule.forRootAsync({
      useFactory: () => ({
        environment: 'testnet',
        network: 'public',
        client_environment: 'testnet',
        // Additional configuration options
      }),
    }),
  ],
})
export class AppModule {}

Using the Service

Inject and use the SmartConfigService in your application:

import { Injectable } from '@nestjs/common';
import { SmartConfigService } from '@hsuite/smart-config';

@Injectable()
export class YourService {
  constructor(private readonly configService: SmartConfigService) {}

  async getNetworkNodes() {
    const nodes = await this.configService.getNodes();
    return nodes;
  }

  async getNetworkFees() {
    const fees = await this.configService.getFees();
    return fees;
  }
}

Configuration Options

Network Configuration

The module supports various network configurations through the SmartConfigOptionsFactory interface:

interface SmartConfigOptionsFactory {
  createSmartConfigOptions(): Promise<ISmartNetwork.INetwork.IConfig.IOptions> | ISmartNetwork.INetwork.IConfig.IOptions;
}

Async Configuration

Multiple configuration strategies are available:

  1. Factory Function
SmartConfigModule.forRootAsync({
  useFactory: (configService: ConfigService) => ({
    environment: configService.get('NETWORK_ENVIRONMENT'),
    network: configService.get('NETWORK_TYPE'),
    client_environment: configService.get('CLIENT_ENVIRONMENT'),
  }),
  inject: [ConfigService],
})
  1. Existing Factory
SmartConfigModule.forRootAsync({
  useExisting: [YourExistingConfigFactory],
})
  1. Class Factory
SmartConfigModule.forRootAsync({
  useClass: YourConfigFactory,
})

API Reference

SmartConfigService

Network Operations

  • getEnvironment(): Get current network environment
  • getClientEnvironment(): Get client environment as LedgerId
  • getNodes(): Retrieve network node configurations
  • getUtilities(): Get network utility services
  • getFees(): Retrieve network fee structure

Configuration Management

  • getIssuer(): Get Hashgraph network issuer configuration
  • getOperator(): Get client operator configuration
  • getMirrorNode(): Get mirror node settings
  • getThreshold(): Calculate network consensus threshold

Development

Documentation

Generate documentation using Compodoc:

npm run compodoc

Check documentation coverage:

npm run compodoc:coverage