hive-tx v7
GitHub npm

Install

Install hive-tx

Add hive-tx to a Node.js project or load the ESM file in a browser.

Node.js

Node.js 20 or later is required.

  1. Open a terminal in the project directory.
  2. Install the package.
npm install hive-tx --save

You can use pnpm or yarn. The package name is hive-tx.

Import the library

Use an ESM import:

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

Use a CommonJS require:

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

Use hive-tx 7.2.1 or later for CommonJS. Version 7.2.0 CommonJS is not valid.

Browser

Load the ESM build from a CDN:

<script type="module">
  import { Transaction, PrivateKey } from
    'https://cdn.jsdelivr.net/npm/hive-tx@7/dist/index.mjs'
</script>

What the package contains

FileUse
dist/index.mjsESM for Node.js, browsers, workers, and serverless runtimes
dist/index.cjsCommonJS for Node.js and CommonJS bundlers
dist/index.d.mtsTypeScript types for ESM
dist/index.d.ctsTypeScript types for CommonJS

The application selects the correct file through the exports field in package.json.