2.0.3 • Published 5 months ago

@hsuite/smart-network-types v2.0.3

Weekly downloads
-
License
-
Repository
github
Last release
5 months ago

@hsuite/smart-network-types

A comprehensive TypeScript type definitions library for the Smart Network ecosystem, providing interfaces and models for network operations, membership management, operator controls, and smart node functionality.

Overview

The @hsuite/smart-network-types package serves as the foundational type system for the Smart Network module, offering a robust set of TypeScript interfaces and models. It provides type safety and consistent data structures across the Smart Network ecosystem.

Installation

npm install @hsuite/smart-network-types

Requirements

Peer Dependencies

  • @nestjs/common: ^10.4.2
  • @nestjs/core: ^10.4.2

Dependencies

  • @hsuite/nestjs-swagger: 1.0.3
  • @hsuite/did-sdk-js: ^1.0.3
  • @hsuite/vc-sl-sdk-js: ^1.0.3

Core Components

The library is organized into four main domains:

1. Network

Provides types and interfaces for network configuration and management:

  • Network configuration
  • Protocol settings
  • Chain management
  • Network state tracking

2. Membership

Defines structures for managing network participants:

  • Membership lifecycle
  • Stake management
  • Rewards tracking
  • Status updates

3. Operator

Contains types for operator management:

  • Operator roles
  • Permissions
  • Activity tracking
  • Performance metrics

4. Smart Node

Encompasses definitions for node operations:

  • Node operations
  • Performance monitoring
  • Resource management
  • System diagnostics

Usage

import { ISmartNetwork, SmartNetwork } from '@hsuite/smart-network-types';

// Using Network Interface
const network: ISmartNetwork.INetwork = {
  id: "net_123",
  name: "MainNet",
  status: "ACTIVE",
  config: {
    protocol: "v2",
    chainId: 1,
    consensus: "PoS"
  }
};

// Using Membership Interface
const membership: ISmartNetwork.IMembership = {
  id: "mem_456",
  type: "VALIDATOR",
  status: "ACTIVE",
  details: {
    stake: "100000",
    rewards: "5000"
  }
};

Documentation

The library uses Compodoc for documentation. To generate and view the documentation:

npm run compodoc

To check documentation coverage:

npm run compodoc:coverage

Project Structure

src/
├── interfaces/              # Type definitions and interfaces
│   ├── membership/         # Membership-related interfaces
│   ├── network/           # Network configuration interfaces
│   ├── operator/          # Operator management interfaces
│   └── smart-node/        # Smart node interfaces
├── models/                 # Concrete implementations
│   ├── membership/         # Membership models
│   ├── network/           # Network models
│   ├── operator/          # Operator models
│   └── smart-node/        # Smart node models
└── index.ts               # Main entry point and exports

Version

Current version: 2.0.0

License

This package is part of the HSuite Enterprise ecosystem.


2.0.3

5 months ago

2.0.2

5 months ago

2.0.1

5 months ago

2.0.0

6 months ago