HbarSuite Docs
  • Welcome to HbarSuite
  • HbarSuite Developer Documentation
    • HbarSuite Smart Engine Applications
      • @hsuite/cross-chain-exchange
      • @hsuite/dao
      • @hsuite/exchange
      • @hsuite/launchpad
      • @hsuite/multisig
      • @hsuite/nft-exchange
    • HSuite Libraries
      • @hsuite/api-key
      • @hsuite/auth-types
      • @hsuite/auth
      • @hsuite/client-types
      • @hsuite/client
      • @hsuite/dkg-types
      • @hsuite/hashgraph-types
      • @hsuite/health
      • @hsuite/helpers
      • @hsuite/ipfs
      • @hsuite/smart-config
      • @hsuite/smart-network-types
      • @hsuite/smart-transaction-types
      • @hsuite/smartnode-sdk
      • @hsuite/snapshots
      • @hsuite/subscriptions-types
      • @hsuite/subscriptions
      • @hsuite/throttler-types
      • @hsuite/throttler
      • @hsuite/users-types
      • @hsuite/users
      • @hsuite/validators-types
  • General Documentation
    • Tokenomics
      • Tokenomics v1
      • Tokenomics V2
    • Smart Apps and Interaction
      • Subscription-Based Model
      • Token-Gate Model
    • The Smart Node Network
      • security-layer
        • Security Layer Integration
        • Setting Up Secure Clusters
        • Generating and Sharing Keys Collaboratively
        • Protecting Secrets with Shamir's Method
        • Managing Cluster Membership
        • Handling Node Expulsion and Replacement
        • Automating Responses to Network Changes & Key Rotation
        • Ensuring Continuous Operation and Recovery
      • Understanding Validators in Our System
        • Type of Validators Explained
    • What is a Smart Node?
  • Restful APIs Documentation
Powered by GitBook
On this page
  • Overview
  • Installation
  • Dependencies
  • Peer Dependencies
  • Dependencies
  • Features
  • Subscription Plans
  • Billing Periods
  • Subscription Statuses
  • Namespaces
  • Usage
  • Documentation
  • Version
  • License
  1. HbarSuite Developer Documentation
  2. HSuite Libraries

@hsuite/subscriptions-types

A comprehensive TypeScript library that provides type definitions and interfaces for managing subscription-related functionality in the HSuite ecosystem.

Overview

The @hsuite/subscriptions-types package is a core library that defines the type system for subscription management. It includes interfaces, enums, and models for handling subscription plans, billing periods, statuses, and related functionality, with specific support for Web3 and configuration management.

Installation

npm install @hsuite/subscriptions-types

Dependencies

Peer Dependencies

  • @nestjs/common: ^10.4.2

  • @nestjs/core: ^10.4.2

Dependencies

  • @hsuite/nestjs-swagger: 2.0.0

  • @hsuite/smart-network-types: 2.0.0

Features

Subscription Plans

The library provides a standardized enumeration of subscription tiers:

  • BASIC: Entry-level plan with core features

  • PREMIUM: Mid-tier plan with enhanced capabilities

  • ENTERPRISE: Top-tier plan with complete feature access and dedicated support

Billing Periods

Supported billing cycles include:

  • MONTHLY: Monthly billing and renewal

  • YEARLY: Yearly billing and renewal

Subscription Statuses

Comprehensive status tracking for the entire subscription lifecycle:

  • PENDING: Awaiting processing or confirmation

  • PROCESSING: Currently being processed

  • MINTED: Subscription token minted on blockchain

  • DELIVERED: Successfully delivered to user

  • ACTIVE: Currently active and in use

  • CANCELLED: Terminated by user or system

  • EXPIRED: Reached end date

  • FAILED: Processing or activation failed

Namespaces

ISubscription

The main namespace that encapsulates all subscription-related functionality:

  • Type definitions for subscription management

  • Enums for plans, periodicities, and statuses

  • Integration with Web3 and configuration subsystems

Web3 Integration

Dedicated namespace for blockchain-related subscription features:

  • Web3 subscription entities

  • Payment processing structures

  • Analytics tracking

Configuration Management

Specialized namespace for subscription system configuration:

  • Plan configurations

  • System settings

  • Entity configurations

Usage

import { ISubscription } from '@hsuite/subscriptions-types';

// Using subscription plans
const plan = ISubscription.IPlan.PREMIUM;

// Working with billing periods
const period = ISubscription.IPeriodicity.MONTHLY;

// Managing subscription status
const status = ISubscription.IStatus.ACTIVE;

// Web3 subscription handling
const web3Sub = new Subscription.Web3.Entity();

// Configuration management
const config = new Subscription.Config.Entity();

Documentation

Detailed documentation can be generated using Compodoc:

npm run compodoc

For documentation with coverage testing:

npm run compodoc:coverage

Version

Current version: 2.0.0

License

This package is part of the HSuite ecosystem. All rights reserved.


Built with ❤️ by the HbarSuite Team Copyright © 2024 HbarSuite. All rights reserved.

Previous@hsuite/snapshotsNext@hsuite/subscriptions

Last updated 3 months ago