npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@hsuite/hashgraph-types

v2.0.6

Published

Type definitions and interfaces for the HbarSuite Hedera Hashgraph integration.

Readme

@hsuite/hashgraph-types

Type definitions and interfaces for the HbarSuite Hedera Hashgraph integration.

Description

The @hsuite/hashgraph-types package provides a comprehensive set of TypeScript type definitions, interfaces, models, and namespaces for interacting with the Hedera Hashgraph network. It serves as the foundational type system for the HbarSuite ecosystem, ensuring type safety and providing clear contracts for Hedera network operations.

Core Features

  • 🏗️ Comprehensive Type System

    • Complete TypeScript definitions for all Hedera operations
    • Strongly typed interfaces for network interactions
    • Extensive model implementations with decorators
  • 🌐 Transaction Management

    • Detailed transaction type definitions
    • Transaction identity and authentication structures
    • Status tracking and result handling
  • 💰 Account & Token Operations

    • Account balance tracking
    • Token balance management (fungible and non-fungible)
    • Multi-token support
  • 🔐 Identity & Security

    • Private key management
    • DID (Decentralized Identifier) support
    • Multi-signature capabilities
  • 📡 Network Integration

    • Mirror node interaction types
    • Operator account definitions
    • Network configuration interfaces
  • 🛠️ Utility & Commons

    • Shared utility types
    • Common constants and helpers
    • RESTful API interfaces

Installation

npm install @hsuite/hashgraph-types

Usage

Basic Usage

import { IHashgraph, Hashgraph } from '@hsuite/hashgraph-types';

// Using interfaces
const operatorConfig: IHashgraph.IOperator = {
  accountId: "0.0.123456",
  privateKey: "302e020100300506032b657004220420..."
};

// Using models
const operator = new Hashgraph.Operator(operatorConfig);

Transaction Management

// Transaction details
const txDetails = new Hashgraph.TransactionDetails({
  transactionId: "[email protected]",
  status: "SUCCESS",
  consensusTimestamp: "2023-01-01T00:00:00.000Z"
});

// Transaction identity
const txIdentity = new Hashgraph.TransactionIdEntity({
  signerPublicKey: "302a300506032b6570032100...",
  signature: "signed_transaction_bytes"
});

Account & Token Operations

// Account balance management
const accountBalance = new Hashgraph.AccountBalance({
  hbarBalance: 100,
  tokens: new Map([["0.0.123456", 1000]])
});

// Token balance tracking
const tokenBalance = new Hashgraph.TokenBalance({
  tokenId: "0.0.123456",
  balance: 1000,
  decimals: 8
});

Network Operations

// Mirror node configuration
const mirrorNode = new Hashgraph.MirrorNode({
  endpoint: "api.mirrornode.hedera.com",
  apiKey: "your-api-key"
});

// Network options
const options = new Hashgraph.Options({
  maxTransactionFee: 1000000,
  transactionValidDuration: 120
});

Architecture

The library is organized into several key namespaces:

  • IHashgraph: Root namespace for interfaces
  • Hashgraph: Root namespace for model implementations
  • Hashgraph.DID: DID-related functionality
  • Hashgraph.Restful: RESTful API interactions
  • Hashgraph.Commons: Shared utilities and constants
  • Hashgraph.Ledger: Ledger operations

Each namespace provides a clean and intuitive API for its specific domain while maintaining strong type safety.

Documentation

API Documentation

To generate and view the detailed API documentation:

yarn compodoc

To include coverage information:

yarn compodoc:coverage

Type Documentation

All types and interfaces are extensively documented with JSDoc comments, providing:

  • Detailed descriptions
  • Usage examples
  • Parameter descriptions
  • Return type information

License

This package is part of the HbarSuite ecosystem and is covered by its license terms.