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
  • Overview
  • Installation
  • Features
  • Architecture
  • IValidators Namespace
  • Validators Namespace
  • Usage
  • Dependencies
  • Peer Dependencies
  • Dependencies
  • Documentation
  • Version
  • License
  1. HbarSuite Developer Documentation
  2. HSuite Libraries

@hsuite/validators-types

A comprehensive TypeScript library providing type definitions, interfaces, and models for validating Hedera Hashgraph network operations and smart app interactions.

Overview

The @hsuite/validators-types package is a core component of the HSuite ecosystem, offering a robust type system for validating various blockchain operations including accounts, tokens, consensus services, and DAO governance. It provides type safety and standardization across the HSuite platform.

Installation

npm install @hsuite/validators-types

Features

  • Account Validation Types: Comprehensive type definitions for account creation, updates, and management operations

  • Token Service Types: Type definitions for HTS (Hedera Token Service) operations including creation, transfers, and management

  • Consensus Service Types: Types for HCS (Hedera Consensus Service) topic creation and message submission

  • DAO Governance Types: Type definitions for DAO creation, proposals, and voting mechanisms

  • Condition-based Validation: Flexible type system for defining and composing validation rules

  • Helper Utilities: Common type definitions for utility functions and shared operations

Architecture

The library is organized into several key namespaces:

IValidators Namespace

The root namespace containing all validator interfaces and types:

  • IAccount: Account validation interfaces

  • IToken: Token operation interfaces

  • IConsensus: Consensus service interfaces

  • IDAO: DAO governance interfaces

  • IConditions: Validation rule interfaces

  • IHelper: Utility interfaces

  • IConfig: Configuration interfaces

  • IEntity: Core entity interfaces

Validators Namespace

Implementation models and types for validation operations:

  • Account: Account validation models

  • Token: Token operation models

  • Consensus: Consensus service models

  • DAO: DAO governance models

  • Conditions: Validation rule models

  • Helper: Utility models

Usage

import { IValidators, Validators } from '@hsuite/validators-types';

// Using interfaces
class CustomTokenValidator implements IValidators.IToken {
  // Implementation
}

// Using models
const accountValidator = new Validators.Account.Create();
const tokenValidator = new Validators.Token.Create();

Dependencies

Peer Dependencies

  • @nestjs/common: ^10.4.2

  • @nestjs/core: ^10.4.2

Dependencies

  • @hsuite/nestjs-swagger: 2.0.0

  • @hsuite/did-sdk-js: ^1.0.3

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

Documentation

Comprehensive documentation is available using Compodoc. To generate and view the documentation:

npm run compodoc

To 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/usersNextGeneral Documentation

Last updated 3 months ago