@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.

Last updated