@substeem/steem-sdk: A Modern TypeScript SDK for Steem
Every JavaScript project on Steem is still carrying around eight-year-old dependencies. If you try dropping dsteem or steem-js into a fresh Vite or Next.js app today, your console vomits a wall of polyfill warnings for buffer, crypto, stream, and events. Half the default RPC nodes hardcoded into those libraries have been dead since 2021, and the moment a node drops a socket, the whole client falls over because the error handling was written around Node 8 callbacks.
We got tired of maintaining bundler hacks and patching unmaintained forks just to sign a simple transaction.
So we built @substeem/steem-sdk.
It's a clean, zero-dependency TypeScript SDK for Steem that runs natively in modern browsers, Node.js, and background workers without any legacy shims. The code is public on GitHub and published on npm under the MIT license.
What Actually Changed
Instead of wrapping older C++ bindings or dragging Node core polyfills into the browser, the whole SDK runs on native fetch and pure JavaScript cryptographic primitives.
The unpacked size is 488 KB, and the minified production bundle sits under 185 KB. It ships dual ESM and CommonJS builds with full TypeScript declarations generated at build time.
A few practical choices we baked in:
- Automatic RPC failover: Pass a list of nodes to the client. If the primary node times out, hits a rate limit, or returns a 502, the request immediately retries against the next healthy node in the pool.
- Quorum calls: When you need rock-solid confidence before executing a state change, query multiple nodes simultaneously and verify that they return identical results.
- Full 43-operation binary serialization: Every single Steem operation has been implemented and verified against raw protocol binary vectors. Custom JSON, witness updates, escrow, and account creation all serialize byte-for-byte with the blockchain daemon.
- Live mana calculations: Functions like
utils.getVotingManaandutils.getRCManacalculate actual live mana by accounting for elapsed seconds and regeneration curves, instead of returning stale snapshots from an account's last on-chain action. - Lockout prevention for authority updates: Updating
account_authson Steem requires strict alphabetical sorting by username. Get the order wrong, and the chain rejects the transaction. ThegrantAccountAuthorityandrevokeAccountAuthorityhelpers sort authorities automatically and enforce lockout prevention so you can't accidentally strip the last active key from an account. - Native memo encryption & signatures: Full support for AES-CBC memo encoding via ECDH shared secrets, plus login signature verification (
signMessageandverifyMessage).
Installation
npm install @substeem/steem-sdk
Or with pnpm:
pnpm add @substeem/steem-sdk
Quick Code Examples
Broadcasting a Transfer with Node Failover
import { Client, PrivateKey } from '@substeem/steem-sdk'
// The client automatically cycles through nodes if one hangs or fails
const client = new Client([
'https://api.steemit.com',
'https://api.moecki.online',
'https://steemapi.boylikegirl.club'
])
async function sendSteem() {
const activeKey = PrivateKey.fromString('5K...')
const operation = [
'transfer',
{
from: 'alice',
to: 'bob',
amount: '5.000 STEEM',
memo: 'Dev grant payout'
}
]
const confirmation = await client.broadcast.sendOperations([operation], activeKey)
console.log('Included in block:', confirmation.block_num)
console.log('Tx ID:', confirmation.id)
}
sendSteem().catch(console.error)
Checking Live Voting Power and Resource Credits
import { Client, utils } from '@substeem/steem-sdk'
const client = new Client(['https://api.steemit.com'])
async function inspectAccount(name: string) {
// Resolves on-chain and calculates actual regenerated percentages
const currentVP = await utils.getVotingMana(name)
const currentRC = await utils.getRCMana(name)
console.log(`${name} Voting Power: ${currentVP.percentage.toFixed(2)}%`)
console.log(`${name} Resource Credits: ${currentRC.percentage.toFixed(2)}%`)
}
inspectAccount('steemit')
Encrypting Memos
import { Memo, PrivateKey } from '@substeem/steem-sdk'
async function encryptPrivateMemo() {
const senderMemoKey = PrivateKey.fromString('5K...')
// Resolves the recipient memo public key on-chain and encrypts
const encrypted = await Memo.encodeForAccount(
senderMemoKey,
'bob',
'#Private coordination details'
)
console.log('Encrypted payload:', encrypted)
}
Test Coverage
Every serializer and helper has automated test coverage:
- All 43 operations verified against Graphene test digests.
- Base58 and WIF key derivation vectors verified against standard test suites.
- Multi-node failover and quorum response aggregation tested under simulated connection dropouts.
- Async block streaming verified against live block production.
Links
- GitHub: https://github.com/substeem/steem-sdk
- npm: https://www.npmjs.com/package/@substeem/steem-sdk
If you run into bugs or edge cases in your apps, open an issue or send a PR on GitHub.