π@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-typesBasic 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 validationTokenGateEntity- Implements ITokenGateEntity with metadata_Utility- Implements _IUtility with runtime validationToken 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