Skip to main content
The WAX TypeScript SDK provides a complete toolkit for building Hive blockchain applications in JavaScript and TypeScript environments. It runs in browsers, Node.js, and modern frameworks through WebAssembly (WASM).

Key features

The SDK offers two main entry points based on your use case:
  • Offline operations - Use createWaxFoundation() for transaction building, signing, and cryptographic operations without network access
  • Online operations - Use createHiveChain() for full blockchain interaction including API calls, transaction broadcasting, and account queries

Architecture

WAX uses WebAssembly to compile the core Hive protocol code (written in C++) directly into your JavaScript application. This provides:
  • Performance - Near-native speed for cryptographic operations and transaction serialization
  • Accuracy - Identical behavior to the Hive blockchain nodes
  • Type safety - Full TypeScript definitions for all operations and API calls
  • Small bundle size - Optimized WASM modules with tree-shaking support

Core concepts

Transactions

You build transactions by pushing operations into a transaction object:

Operations

Operations are the building blocks of transactions. The SDK provides:
  • Simple operations - Direct protocol operations as inline objects
  • Complex operations - High-level factories for multi-operation scenarios (blog posts, recurrent transfers, etc.)
  • Hive Apps operations - Specialized operations for communities, follows, and resource credits

Assets

Assets use NAI (Numerical Asset Identifier) format:

Formatters

Use template literals with waxify for readable output:

Package structure

The main package @hiveio/wax includes:
  • Core WASM module
  • TypeScript interfaces and types
  • API caller implementations
  • Transaction builders
  • Cryptographic utilities
Extension packages provide signing capabilities:
  • @hiveio/wax-signers-beekeeper - Beekeeper wallet integration
  • @hiveio/wax-signers-keychain - Hive Keychain browser extension
  • @hiveio/wax-signers-metamask - MetaMask Snaps integration
  • @hiveio/wax-signers-peakvault - PeakVault mobile wallet
  • @hiveio/wax-signers-hb-auth - HiveAuth protocol support

Use cases

Offline applications

Build transactions without network access:

Online applications

Interact with the Hive network:

Framework integration

WAX works seamlessly with:
  • React (Create React App, Vite)
  • Next.js (App Router, Pages Router)
  • Vue (Vite, Webpack)
  • Nuxt
  • Node.js applications
  • Plain HTML/JavaScript

Next steps

Explore the SDK capabilities: