HbarSuite Docs
  • Welcome to HbarSuite
  • HbarSuite Developer Documentation
    • HbarSuite Smart Engine Applications
      • @hsuite/cross-chain-exchange
      • @hsuite/dao
      • @hsuite/exchange
      • @hsuite/launchpad
      • @hsuite/multisig
      • @hsuite/nft-exchange
    • HSuite Libraries
      • @hsuite/api-key
      • @hsuite/auth-types
      • @hsuite/auth
      • @hsuite/client-types
      • @hsuite/client
      • @hsuite/dkg-types
      • @hsuite/hashgraph-types
      • @hsuite/health
      • @hsuite/helpers
      • @hsuite/ipfs
      • @hsuite/smart-config
      • @hsuite/smart-network-types
      • @hsuite/smart-transaction-types
      • @hsuite/smartnode-sdk
      • @hsuite/snapshots
      • @hsuite/subscriptions-types
      • @hsuite/subscriptions
      • @hsuite/throttler-types
      • @hsuite/throttler
      • @hsuite/users-types
      • @hsuite/users
      • @hsuite/validators-types
  • General Documentation
    • Tokenomics
      • Tokenomics v1
      • Tokenomics V2
    • Smart Apps and Interaction
      • Subscription-Based Model
      • Token-Gate Model
    • The Smart Node Network
      • security-layer
        • Security Layer Integration
        • Setting Up Secure Clusters
        • Generating and Sharing Keys Collaboratively
        • Protecting Secrets with Shamir's Method
        • Managing Cluster Membership
        • Handling Node Expulsion and Replacement
        • Automating Responses to Network Changes & Key Rotation
        • Ensuring Continuous Operation and Recovery
      • Understanding Validators in Our System
        • Type of Validators Explained
    • What is a Smart Node?
  • Restful APIs Documentation
Powered by GitBook
On this page
  • Installation
  • Features
  • Dependencies
  • Peer Dependencies
  • Dependencies
  • Usage
  • Basic Configuration
  • API Documentation
  • IClient Namespace
  • Client Namespace
  • Development
  • Documentation Generation
  • Version
  • License
  1. HbarSuite Developer Documentation
  2. HSuite Libraries

@hsuite/client-types

A comprehensive type system and validation library for Smart Node client operations. This library provides type definitions, interfaces, and runtime validation for client configuration and operations within the Smart Node ecosystem.

Installation

npm install @hsuite/client-types

Features

  • Type-safe client configuration interfaces

  • Runtime validation for client options

  • Swagger/OpenAPI documentation support

  • Comprehensive API documentation

  • Proper error handling for invalid configurations

Dependencies

Peer Dependencies

  • @nestjs/common: ^10.4.2

  • @nestjs/core: ^10.4.2

Dependencies

  • @hsuite/hashgraph-types: 2.0.0

  • @hsuite/nestjs-swagger: 2.0.0

Usage

Basic Configuration

import { IClient, Client } from '@hsuite/client-types';

// Using interfaces for type safety
const options: IClient.IOptions = {
  enabled: true,
  environment: LedgerId.TESTNET,
  operator: {
    accountId: "0.0.123456",
    privateKey: "302e020100300506032b657004220420..."
  },
  baseUrl: "https://api.smartnode.example.com"
};

// Using models for runtime validation
const clientOptions = new Client.Options(
  options.environment,
  options.operator,
  options.baseUrl
);

API Documentation

IClient Namespace

The IClient namespace provides interfaces and types for client operations:

  • IOptions: Configuration interface for client setup

    • enabled: Client enablement flag

    • environment: Network environment selection

    • operator: Operator credentials

    • baseUrl: API endpoint configuration

Client Namespace

The Client namespace provides concrete implementations with runtime validation:

  • Options: Class extending _Options with runtime validation

    • Validates all configuration parameters

    • Provides type-safe instantiation

    • Includes Swagger/OpenAPI documentation

Development

Documentation Generation

Generate documentation using Compodoc:

npm run compodoc

Check documentation coverage:

npm run compodoc:coverage

Version

Current version: 2.0.0

License

This package is part of the HSuite Enterprise ecosystem.


Built with ❤️ by the HbarSuite Team Copyright © 2024 HbarSuite. All rights reserved.

Previous@hsuite/authNext@hsuite/client

Last updated 3 months ago