Overview
The JavaScript Wallet SDK (js-wallet-sdk
) is a TypeScript/JavaScript-based solution for blockchain wallet operations. It provides cryptographic algorithms and essential functionalities for creating private keys, generating addresses, constructing transactions, and signing operations offline. This SDK supports multiple major blockchains, with dedicated modules for each cryptocurrency. Future updates will expand this support further.
Supported Platforms
As a JavaScript SDK, it's compatible with:
- Web browsers
- Mobile applications
- Desktop environments
Installation and Setup
NPM Installation
Install the latest version via npm:
npm install js-wallet-sdk
Package Types:
- Core Package: Supports all cryptocurrencies
- Single-Coin Modules: For individual blockchain integration (e.g., ETH, BTC)
Local Build
To build locally:
- Clone the repository
- Run the build script
Core Features
Key Modules:
- crypto-lib: Cryptographic algorithms (BIP32, BIP39, ECDSA, Ed25519)
- coin-base: Base interface for all cryptocurrencies
- coin-*: Blockchain-specific implementations (e.g.,
coin-ethereum
,coin-bitcoin
)
Package Details
coin-base
Base module providing universal methods:
- Private key generation
- Address derivation
- Transaction signing
npm install @okx/coin-base
Function | Description |
---|---|
getRandomPrivateKey | Generates random private key |
getDerivedPrivateKey | Derives private key from parameters |
getNewAddress | Generates address from private key |
crypto-lib
Cryptographic library supporting:
- BIP32/BIP39 operations
- Hash functions
- Signature algorithms
npm install @okx/crypto-lib
Blockchain-Specific Modules
Blockchain | Package | Key Features |
---|---|---|
Ethereum | coin-ethereum | EVM chain support |
Bitcoin | coin-bitcoin | BTC, LTC, Doge support |
Solana | coin-solana | High-performance chain |
Polkadot | coin-polkadot | Multi-chain support |
👉 Explore all supported blockchains
Supported Cryptocurrencies
Blockchain | Derivatives | Path Format |
---|---|---|
Bitcoin | BTC, LTC | m/44'/0'/0'/0 |
Ethereum | ETH, Polygon | m/44'/60'/0'/0 |
Cosmos | ATOM, OSMO | m/44'/118'/0'/0 |
Testing
Test cases are available in each package's tests
directory on GitHub, demonstrating SDK usage patterns.
FAQs
What browsers support this SDK?
All modern browsers with JavaScript support, including Chrome, Firefox, and Edge.
How do I handle multi-chain addresses?
Each coin module provides specific derivation paths. Refer to the respective package documentation.
Can I use this for hardware wallet integration?
Yes, modules include functions like getHardWareRawTransaction
for hardware wallet support.
👉 Learn more about advanced features
Is Node.js supported?
Absolutely. The SDK works in any JavaScript environment including Node.js.
Conclusion
The JavaScript Wallet SDK offers comprehensive tools for Web3 development across multiple blockchains. With its modular design and extensive documentation, developers can easily integrate wallet functionalities into their applications.
For implementation examples and advanced usage, visit the official GitHub repository.