Robust Steem blockchain RPC client for Node.js and browsers.
@noble/curves, @noble/hashes) — no native bindings, no node-gyp, no prebuilds to verifydsteem)npm install dsteem
Requires Node.js 22 LTS or newer. (v0.11.x supported older Node; v0.12 dropped the native secp256k1 build and the dead browser polyfills along with it.)
import {Client} from 'dsteem'
const client = new Client('https://api.steemit.com')
// or, if the primary is down:
// const client = new Client('https://api.moecki.online')
for await (const block of client.blockchain.getBlocks()) {
console.log(`New block, id: ${block.block_id}`)
}
const {Client, PrivateKey} = require('dsteem')
const client = new Client('https://api.steemit.com')
const key = PrivateKey.fromLogin('username', 'password', 'posting')
client.broadcast.vote({
voter: 'username',
author: 'almost-digital',
permlink: 'dsteem-is-the-best',
weight: 10000
}, key).then(({block_num}) => console.log('Included in block:', block_num))
<script src="https://unpkg.com/dsteem@^0.12/dist/dsteem.browser.global.js"></script>
<script>
const client = new dsteem.Client('https://api.steemit.com')
client.database.getDiscussions('trending', {tag: 'writing', limit: 1}).then(([post]) => {
document.body.innerHTML = `<h1>${post.title}</h1><h2>by ${post.author}</h2>`
})
</script>
The browser bundle inlines a Node Buffer polyfill (~20 KB) — consumers don't need to set anything up.
When using a bundler (webpack/vite/rollup), import {Client} from 'dsteem' resolves to the ESM build automatically.
Full API reference: https://blazeapps007.github.io/dsteem/
Public surface (everything v0.11.x exported is still exported the same way):
Client, PrivateKey, PublicKey, Signature, cryptoUtilsAsset, Price, Transaction, SignedTransaction, Operation, Types, all of the *Operation interfacesBlockchain, DatabaseAPI, BroadcastAPI, RCAPIutils namespace (including buildWitnessUpdateOp)New in v0.12.0 — additive only (no breaking changes): BroadcastAPI, CreateAccountOptions, and the resource-credit interfaces (RCAccount, RCParams, RCPool, Manabar, Resource, Pool, DynamicParam, PriceCurveParam) are now directly importable from the package root, so TypeScript consumers can write import type {Manabar} from 'dsteem' instead of digging the type out of a class signature.
Default RPC for code samples is https://api.steemit.com. A community-maintained fallback is https://api.moecki.online. Set the URL when constructing Client.
secp256k1 (high-severity CVE in 3.x) + Node:crypto.createHash → pure-JS @noble/curves + @noble/hashes. Public API unchanged; signatures are still canonical (isCanonicalSignature) and accepted by Steem nodes. Old on-chain signatures still verify with the new backend.tsup (esbuild). Browser bundle dropped from 782 KB → 351 KB.core-js@2, regenerator-runtime, whatwg-fetch, node-fetch — all removed. Modern browsers and Node 22+ provide everything natively.exports map; no more lib/ directory or build-time version.js rewrite.strictNullChecks, noImplicitAny, noImplicitThis).tslint (deprecated) → ESLint 9 flat config + typescript-eslint 8.nyc → c8 (70 % coverage gate). Karma + Sauce Labs browser tests → Playwright (Chromium/Firefox/WebKit headless).dist/ contents:
| File | Purpose |
|---|---|
dist/index.mjs |
ESM entry (Node) |
dist/index.cjs |
CommonJS entry (Node) |
dist/index.d.ts |
TypeScript declarations |
dist/dsteem.browser.global.js |
Browser IIFE (global dsteem), inlines all deps + Buffer polyfill |
BSD-3-Clause — see LICENSE.
Share and Enjoy!