Overview
The Js-wallet-sdk is a TypeScript/JavaScript-based wallet solution that provides comprehensive blockchain integration capabilities. This SDK includes various cryptographic algorithms and essential functionalities for multiple public blockchains, enabling offline private key generation, address creation, transaction assembly, and digital signatures.
Key features:
- Multi-chain support for mainstream blockchains
- Offline wallet operations
- Modular architecture for easy integration
- TypeScript/JavaScript compatibility
Supported Platforms
As a JavaScript SDK, it seamlessly integrates with:
- Web applications
- Mobile apps (React Native, Ionic, etc.)
- Desktop applications (Electron, etc.)
- Node.js environments
Installation and Setup
NPM Installation
Install the latest version via npm:
npm install @okx/js-wallet-sdkFor individual blockchain modules:
# Ethereum
npm install @okx/coin-ethereum
# Bitcoin
npm install @okx/coin-bitcoinLocal Build
To build from source:
Clone the repository:
git clone https://github.com/okx/js-wallet-sdk.gitRun build script:
npm run build
Core Functionalities
The SDK is organized into specialized modules:
| Module | Description |
|---|---|
crypto-lib | Provides cryptographic algorithms (BIP32, BIP39, ECDSA, Ed25519) |
coin-base | Base package with common interfaces for all coins |
coin-* | Blockchain-specific implementations (e.g., coin-ethereum, coin-bitcoin) |
๐ Explore full module documentation
Package Details
coin-base
Base package providing universal interfaces:
import { getRandomPrivateKey } from '@okx/coin-base';Supported functions:
| Function | Description |
|---|---|
getRandomPrivateKey() | Generates cryptographically secure private key |
getDerivedPrivateKey() | Derives private key from parameters |
signTransaction() | Signs raw transactions |
verifyMessage() | Validates signed messages |
crypto-lib
Essential cryptography utilities:
import { bip39 } from '@okx/crypto-lib';
const mnemonic = bip39.generateMnemonic();Features:
- BIP32/BIP39 implementations
- SHA256/RIPEMD160 hashing
- Base58/Hex encoding
Blockchain-Specific Modules
Ethereum (coin-ethereum)
import Ethereum from '@okx/coin-ethereum';
const tx = await Ethereum.signTransaction(rawTx);Supported EVM chains:
- Ethereum Mainnet
- Polygon
- BSC
- Arbitrum
- Optimism
Bitcoin (coin-bitcoin)
import Bitcoin from '@okx/coin-bitcoin';
const address = Bitcoin.getNewAddress(privateKey);Supported variants:
- BTC (Legacy/SegWit)
- BCH
- LTC
- DOGE
Cosmos (coin-cosmos)
import Cosmos from '@okx/coin-cosmos';
const signed = await Cosmos.signTransaction(txData);Supported chains:
- ATOM
- OSMO
- KAVA
- SEI
๐ Compare blockchain features
Supported Blockchains
| Blockchain | Path Derivation | Example Coins |
|---|---|---|
| Bitcoin | m/44'/0'/0' | BTC, LTC |
| Ethereum | m/44'/60'/0' | ETH, MATIC |
| Cosmos | m/44'/118'/0' | ATOM, OSMO |
| Solana | m/44'/501'/0' | SOL |
| TRON | m/44'/195'/0' | TRX |
FAQ
Q: Is this SDK suitable for enterprise applications?
A: Yes, the SDK is production-ready with comprehensive test coverage and active maintenance.
Q: How do I handle private key security?
A: The SDK includes secure key generation and storage methods, but always follow security best practices for key management.
Q: Can I use this for mobile wallet development?
A: Absolutely. The SDK works with React Native, Cordova, and other mobile frameworks.
Q: Are hardware wallets supported?
A: Yes, through the hardware wallet interface functions in relevant modules.
Q: How frequently are new blockchains added?
A: We regularly update supported chains based on community demand and blockchain adoption trends.
Conclusion
The JavaScript Wallet SDK provides a robust toolkit for Web3 developers, offering:
- Multi-chain support
- Secure cryptographic operations
- Simplified transaction handling
- Comprehensive documentation
๐ Get started with Web3 development today
For implementation examples and advanced usage, refer to the GitHub repository's test cases and documentation.