@hsuite/validators-types v2.0.2
@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-typesFeatures
- 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 interfacesIToken: Token operation interfacesIConsensus: Consensus service interfacesIDAO: DAO governance interfacesIConditions: Validation rule interfacesIHelper: Utility interfacesIConfig: Configuration interfacesIEntity: Core entity interfaces
Validators Namespace
Implementation models and types for validation operations:
Account: Account validation modelsToken: Token operation modelsConsensus: Consensus service modelsDAO: DAO governance modelsConditions: Validation rule modelsHelper: 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: 1.0.3@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 compodocTo check documentation coverage:
npm run compodoc:coverageVersion
Current version: 2.0.0
License
This package is part of the HSuite Enterprise ecosystem.