steemit/steem-js
Tentang
Steem.js adalah pustaka JavaScript resmi untuk blockchain Steem.
Bisnis dan keuanganYang dapat Anda lakukan
- ๐ Correct RPC routing - Legacy read APIs use condenser_api; chain/validation APIs use database_api (v1.0.16+, aligned with steem)
- ๐ Type Safety - Full TypeScript support with complete type definitions
- โก Modern - ES modules, async/await, modern cryptography libraries
- ๐ Universal - Works in Node.js, browsers, and bundlers
Pertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- 0
- dalam 15 hari
- 0
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
AsliSteem.js
A modern JavaScript/TypeScript library for interacting with the Steem blockchain. Complete refactoring with TypeScript, modern tooling, and improved security.
๐ Documentation
๐ Complete API Documentation - Comprehensive guide with all methods, examples, and usage patterns
API routing (condenser_api vs database_api) - How RPC namespaces map to current Steem nodes (v1.0.16+)
๐ Changelog - Version history and breaking changes
๐ง Refactoring Details - Technical details about the 2025 modernization
๐ Quick Start
Requirements
- Node.js: >= 22.23.4 (LTS recommended)
- Browser: Modern browsers with Web Crypto API support
Installation
# npm
npm install @steemit/steem-js
# pnpm (recommended)
pnpm install @steemit/steem-js
# yarn
yarn add @steemit/steem-js
Basic Usage
import { steem } from '@steemit/steem-js';
// Configure API endpoint
steem.config.set({
nodes: ['https://api.steemit.com'],
address_prefix: 'STM'
});
// Get account information
const accounts = await steem.api.getAccountsAsync(['username']);
console.log(accounts[0]);
// Vote on a post
const postingWif = steem.auth.toWif('username', 'password', 'posting');
await steem.broadcast.voteAsync(postingWif, 'voter', 'author', 'permlink', 10000);
Browser Usage
<script src="https://cdn.jsdelivr.net/npm/@steemit/steem-js/dist/index.umd.min.js"></script>
<script>
steem.config.set({ nodes: ['https://api.steemit.com'] });
steem.api.getAccountsAsync(['username']).then(console.log);
</script>
โจ Key Features
- ๐ Correct RPC routing - Legacy read APIs use
condenser_api; chain/validation APIs usedatabase_api(v1.0.16+, aligned with steem) - ๐ Type Safety - Full TypeScript support with complete type definitions
- โก Modern - ES modules, async/await, modern cryptography libraries
- ๐ Universal - Works in Node.js, browsers, and bundlers
- ๐ Secure - Proper cryptographic implementations, no key exposure
- ๐ Well Documented - Comprehensive API documentation with examples
๐๏ธ Development
# Install dependencies
pnpm install
# Build the library
pnpm build
# Run tests
pnpm test
# Type checking
pnpm typecheck
๐ฆ What's New in 2025
This is a complete modernization of the original steem-js library:
- โ TypeScript Migration - Full type safety and better developer experience
- โ
Modern Dependencies - Replaced outdated crypto libraries (
bigiโbn.js,ecurveโelliptic) - โ Modern Crypto - Using @noble/hashes and @noble/ciphers for universal browser/Node.js compatibility
- โ Build System - Migrated from Webpack to Rollup for better output
- โ Testing - Migrated from Mocha to Vitest with 95.8% test coverage
- โ Security - Fixed insecure random number generation and crypto implementations
๐ Project Structure
src/
โโโ api/ # Blockchain API client (HTTP; methods.ts โ condenser_api / database_api / โฆ)
โโโ auth/ # Authentication and key management
โโโ broadcast/ # Transaction broadcasting
โโโ crypto/ # Cryptographic utilities
โโโ formatter/ # Data formatting helpers
โโโ memo/ # Encrypted memo handling
โโโ operations/ # Operation type definitions
โโโ serializer/ # Transaction serialization
โโโ utils/ # Utility functions
๐ Links
- ๐ API Documentation - Complete method reference
- ๐ง Refactoring History - Technical modernization details
- ๐ฆ NPM Package - Published package
- ๐ Issues - Bug reports and feature requests
๐ License
MIT - see LICENSE file for details.
๐ก Need help? Check the complete documentation for detailed examples and API reference.
Jelajahi proyek terkait
Memuatโฆ