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.
npm install hive-tx
pnpm and yarn work too.
Import
ESM:
import { Transaction, PrivateKey, callRPC } from 'hive-tx'
CommonJS:
const { Transaction, PrivateKey, callRPC } = require('hive-tx')
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>
Package contents
| File | Use |
|---|---|
dist/index.mjs | ESM for Node.js, browsers, workers, and serverless runtimes |
dist/index.cjs | CommonJS for Node.js and CommonJS bundlers |
dist/index.d.mts | TypeScript types for ESM |
dist/index.d.cts | TypeScript types for CommonJS |
The exports field in package.json picks the right file for your setup.