Overview
The Js-wallet-sdk is a versatile TypeScript/JavaScript-based wallet solution that supports multiple blockchain cryptographic algorithms and essential functionalities. This SDK enables developers to generate private keys, create addresses, assemble transactions, and perform signatures across various blockchain networks.
Supported Platforms
Compatible with all modern browsers and JavaScript environments, this SDK seamlessly integrates into:
- Web applications
- Mobile apps
- Desktop software
Installation and Setup
NPM Installation
Install the latest version via npm:
npm install @okxweb3/js-wallet-sdkThe SDK offers two package types:
- Public packages (all currencies)
- Single-coin modules (individual blockchain implementations)
Example Integrations
- ETH Integration:
npm install @okxweb3/coin-ethereum - BTC Integration:
npm install @okxweb3/coin-bitcoin
Local Build Instructions
Clone the repository:
git clone https://github.com/okx/js-wallet-sdk.gitRun build script:
npm run build
Core Features
| Module | Description |
|---|---|
crypto-lib | Implements security algorithms (BIP32, BIP39, ECDSA, Ed25519) |
coin-base | Provides universal blockchain interfaces |
coin-* | Coin-specific transaction builders (e.g., coin-ethereum, coin-bitcoin) |
Package Ecosystem
๐ Explore all available packages
| Package | Description | Documentation |
|---|---|---|
@okxweb3/coin-base | Universal blockchain interfaces | GitHub |
@okxweb3/crypto-lib | Cryptographic functions | GitHub |
@okxweb3/coin-ethereum | EVM chain support | GitHub |
@okxweb3/coin-solana | Solana integration | GitHub |
Key Functionality
Universal Methods (coin-base)
interface WalletSDK {
getRandomPrivateKey(): string;
getDerivedPrivateKey(params: DerivePriKeyParams): string;
signTransaction(rawTx: RawTransaction): SignedTransaction;
// ...+15 other methods
}Blockchain-Specific Features
Ethereum:
- Supports ERC-20/721 tokens
- Hardware wallet integration
Bitcoin:
- SegWit/Native SegWit addresses
- Multi-chain support (LTC, DOGE, etc.)
Cosmos:
- IBC token transfers
- 15+ supported chains (ATOM, OSMO, etc.)
Supported Blockchains
| Chain Family | Example Networks | Derivation Path |
|---|---|---|
| EVM | ETH, Polygon | m/44'/60'/0'/0/0 |
| UTXO | BTC, LTC | m/44'/0'/0'/0/0 |
| Cosmos | ATOM, OSMO | m/44'/118'/0'/0/0 |
FAQ
Q: How do I handle gas estimation?
const fee = await sdk.estimateFee(txParams);Q: Can I use this with hardware wallets?
Yes! Supports:
- Ledger
- Trezor
- AirGap Vault
Q: What's the difference between coin-base and individual packages?
coin-base: Universal interfaces- Individual packages: Chain-specific optimizations
Q: How are mnemonic phrases generated?
import { bip39 } from '@okxweb3/crypto-lib';
const mnemonic = bip39.generateMnemonic();Best Practices
Security:
- Always store private keys encrypted
- Use hardware wallets for high-value transactions
Performance:
- Batch transaction signing
- Cache frequently used addresses
Maintenance:
- Regularly update SDK versions
- Monitor chain-specific updates
Conclusion
This JavaScript Signing SDK provides a robust toolkit for Web3 wallet development, offering:
- โ๏ธ Multi-chain support
- โ๏ธ Enterprise-grade security
- โ๏ธ Simplified transaction flows
- โ๏ธ Continuous ecosystem expansion
For implementation examples and advanced usage, visit our developer portal.