NOTE: this is still a draft, so it's subject to changes. This alert will be removed as soon as final version will be available

βœ…@hsuite/validators-types - Validation Type Definitions

A comprehensive TypeScript library providing type-safe validation for Hedera Hashgraph network operations, smart app interactions, and DAO governance.

Quick Start

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

// Initialize helper
const helper = new Validators.Helper(
  smartConfigService,
  clientService,
  smartLedgersService,
  validatorOptions
);

// Create validators
const accountValidator = new Validators.Account.Create(helper, config);
const tokenValidator = new Validators.Token.Create(helper, config);

// Validate transactions
const result = await accountValidator.validate(transaction, { params });

Documentation

Complete Developer Guide

Comprehensive documentation covering all aspects of the library including:

  • Quick Start Guide - Get up and running in 5 minutes

  • Architecture Overview - Understand the dual-namespace design

  • Domain-Specific Guides - Deep dive into account, token, and consensus validation

  • API Reference - Complete interface and model documentation

  • Usage Examples - Real-world implementation examples

  • Configuration - Advanced setup and customization

  • Testing Patterns - Unit and integration testing approaches

  • Best Practices - Recommended patterns and practices

Quick Access Guides

Quick Start

5-minute setup guide with practical examples for each validation domain.

Architecture Overview

System design principles, dual-namespace architecture, and extension points.

Account Validation

Account operations, security features, token gates, and multi-signature support.

Token Validation (HTS)

Token lifecycle, custom fees, compliance controls, and economic features.

Consensus Validation (HCS)

Topic management, message validation, access control, and security enforcement.

API Reference

  • Interfaces - TypeScript interface definitions and contracts

  • Models - Implementation models and concrete validators

  • Enums - Transaction types and enumeration definitions

Key Features

Dual Namespace Architecture

  • Interfaces (IValidators) - Type contracts and definitions

  • Models (Validators) - Concrete implementations and runtime logic

  • Clean separation of concerns with full TypeScript support

Comprehensive Validation

  • Account Operations - Creation, updates, transfers, allowances

  • Token Operations - HTS lifecycle, supply, compliance, fees

  • Consensus Operations - HCS topics, messages, access control

  • Security Enforcement - Multi-level security controls

Advanced Features

  • Token Gates - Access control based on token ownership

  • Custom Fees - Fixed, fractional, and royalty fee structures

  • Smart Node Security - Multi-level security enforcement

  • Network Integration - Real-time network queries and validation

Developer Experience

  • Type Safety - Full TypeScript support with strict typing

  • Extensible - Plugin architecture for custom validators

  • Testable - Comprehensive testing patterns and utilities

  • NestJS Integration - First-class framework support

Supported Operations

Domain
Operations
Features

Account

Create, Update, Delete, Transfer, Allowances

Token gates, Multi-sig, Security levels

Token (HTS)

Create, Mint, Burn, Transfer, Freeze, KYC

Custom fees, Compliance, Supply management

Consensus (HCS)

Topic CRUD, Message submit

Access control, Size validation, Security

Installation & Setup

Prerequisites

  • Node.js 18+

  • TypeScript 5.3+

  • Hedera SDK (compatible version)

Installation

NestJS Integration

Usage Examples

Account Creation with Token Gates

Token Creation with Custom Fees

Consensus Message Validation

Testing

Library Statistics

  • Interfaces: 50+ TypeScript interface definitions

  • Models: 30+ concrete validator implementations

  • Enums: 15+ transaction type enumerations

  • Test Coverage: 95%+ code coverage

  • Documentation: Comprehensive guides and examples

Support & Contributing

License

MIT License - see LICENSE file for details.


Version: 2.0.2 Compatibility: Node.js 18+, TypeScript 5.3+ Framework Support: NestJS 10.4+


Built with ❀️ by the HSuite Team Copyright © 2025 HSuite. All rights reserved.

Last updated