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/shared-types - Shared Type Definitions

πŸ”— Comprehensive shared types and validation library for the Smart Node ecosystem with Web3 entity management

Enterprise-grade shared types library providing robust interfaces, runtime validation models, and comprehensive support for Web3 entities, token gate authentication, utility tokens, and configuration options used across the HSuite distributed application architecture.


πŸ“š Table of Contents


✨ Quick Start

Installation

npm install @hsuite/shared-types

Basic Setup

NestJS Integration


πŸ—οΈ Architecture

Core Component Areas

🌐 Web3 Entity Management

  • Wallet Identification - Blockchain wallet address and public key management

  • Token Balance Tracking - Comprehensive token ownership and amount tracking

  • Multi-blockchain Support - Hedera Hashgraph, Ethereum, and other blockchain networks

  • Validation Models - Runtime validation with comprehensive error handling

πŸ” Token Gate Authentication

  • Access Control - Token-based authentication and authorization systems

  • Role Management - Role definitions with token ownership requirements

  • Metadata Management - Rich token metadata for enhanced access control

  • Configuration Options - Flexible token gate behavior configuration

βš™οΈ Configuration Management

  • Authentication Options - JWT, Redis, cookies, and Passport.js configuration

  • Network Settings - Hedera operator credentials and network configuration

  • Utility Tokens - Network utility token definitions and management

  • Application Configuration - Centralized application setting management

🧩 Shared Utilities

  • Type Validation - Runtime validation for all shared types

  • Error Handling - Comprehensive validation error reporting

  • Service Integration - NestJS dependency injection support

  • Documentation - Complete Swagger/OpenAPI integration

Module Structure


πŸ”§ API Reference

Core Interfaces

Web3 Entity Types

Web3Entity

  • Purpose: Represents a blockchain wallet entity with balance information

  • Properties: walletId, publicKey, balance

  • Usage: Wallet authentication and token balance tracking

ITokenGateEntity

  • Purpose: Token balance entry for access control

  • Properties: token_id, amount, serial_number (optional)

  • Usage: Token-based authentication and authorization

Configuration Types

_IUtility

  • Purpose: Network utility token interface

  • Properties: name, id, treasury, decimals

  • Usage: Utility token definitions and management

_IOptions

  • Purpose: Authentication configuration interface

  • Properties: redis, jwt, cookieOptions, operator, passport, appName

  • Usage: System-wide authentication configuration

Token Gate Types

_IRole - Role-based access control interface _IMetadata - Token metadata interface for enriched information _IProperties - Token properties for subscription plans and periodicity _ITokenGateOptions - Configuration options for token gate behavior

Runtime Models

All interfaces have corresponding model classes with validation:

  • Web3EntityModel - Implements Web3Entity with validation

  • TokenGateEntity - Implements ITokenGateEntity with metadata

  • _Utility - Implements _IUtility with runtime validation

  • Token Gate Models - Role, Metadata, Properties, and Options with validation


πŸ“– Guides

Web3 Entity Management Guide

Complete guide to managing blockchain wallet entities and token balances. Comprehensive guide covering Web3 entity creation, token balance management, wallet integration, blockchain interaction, and enterprise-grade Web3 entity management with validation and security features.

Token Gate Authentication Guide

Implement token-based access control and role management systems. Advanced implementation guide covering token gate configuration, role-based access control, permission management, subscription handling, and enterprise-grade token-based authentication systems.

Configuration Management Guide

Set up authentication, network, and application configuration options. Detailed configuration guide covering authentication settings, network configurations, application options, environment management, and enterprise-grade configuration management with validation and security.

Utility Token Guide

Manage network utility tokens and service definitions. Comprehensive guide for utility token management, service configuration, network utility handling, token economics, and enterprise-grade utility token systems with complete lifecycle management.


🎯 Examples

Web3 Entity Management

Token Gate Authentication

Configuration Management

Shared Types Service Integration


πŸ”— Integration

Required Dependencies

Module Integration

Documentation Generation

Integration with HSuite Ecosystem


πŸ”— Comprehensive Shared Types: Enterprise-grade type definitions with runtime validation for Web3 entities, token gates, and configuration management.

🌐 Multi-Blockchain Support: Full support for Hedera Hashgraph, Ethereum, and other blockchain networks with consistent type interfaces.

πŸ” Token-Based Authentication: Complete token gate system with role-based access control, metadata management, and subscription support.


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

Last updated