Skip to main content

Package manager installation

Install hive-tx using your preferred package manager:
npm install hive-tx --save

Requirements

hive-tx requires Node.js 20 or higher. Make sure your environment meets this requirement before installation.
The library is built with TypeScript 5.9 and provides full type safety for all operations and API methods.

Import patterns

The library supports both ES Modules (ESM) and CommonJS (CJS) import patterns. Your application will automatically pick the right build for your environment.

ES Modules (ESM)

import { Transaction, PrivateKey, callRPC } from 'hive-tx'

CommonJS (CJS)

const { Transaction, PrivateKey, callRPC } = require('hive-tx')

Direct build imports

You can also import either build directly:
import { Transaction, PrivateKey } from 'hive-tx/esm'

Browser usage

For browser environments, you can use the UMD build via CDN:
<script src="https://cdn.jsdelivr.net/npm/hive-tx@7/dist/browser/hive-tx.min.js"></script>
<script>
  // hiveTx is now available globally
  const tx = new hiveTx.Transaction()
  const key = hiveTx.PrivateKey.from('your-private-key')
</script>
The browser build is minified and gzipped to approximately 29KB, including all dependencies.

Verify installation

After installation, verify that hive-tx is working correctly:
import { callRPC } from 'hive-tx'

// Get blockchain properties
const props = await callRPC('condenser_api.get_dynamic_global_properties')
console.log('Current head block:', props.head_block_number)
console.log('Installation verified!')
If you see the current head block number, your installation is successful!

What’s included

The hive-tx package includes:
  • Transaction - Create, sign, and broadcast transactions
  • PrivateKey - Key generation and management
  • PublicKey - Public key operations and verification
  • Signature - Signature handling and verification
  • Memo - Encrypted memo support
  • callRPC - Make JSON-RPC API calls with automatic failover
  • callREST - Make REST API calls with full typing
  • callWithQuorum - Cross-check results across multiple nodes
  • config - Configure nodes, timeout, and retry settings
  • utils - Utility functions for common operations

Next steps

Quickstart

Get started with your first transaction in minutes

Configuration

Configure API nodes, timeout, and retry settings

Build docs developers (and LLMs) love