Overview
The Js-wallet-sdk is a versatile TypeScript/JavaScript-based wallet solution designed to support multiple blockchain networks. It encompasses various cryptographic algorithms and essential functionalities, enabling developers to generate private keys, create addresses, assemble transactions, and perform signatures seamlessly. This guide provides a detailed walkthrough of the SDK's capabilities, currently supporting mainstream blockchains with plans for continuous expansion.
Supported Platforms
Compatible with browsers and JavaScript environments, this SDK integrates effortlessly into:
- Web applications
- Mobile applications
- Desktop applications
Installation and Setup
NPM Installation
To install the latest version via npm:
npm install @okxweb3/js-wallet-sdkFor individual coin modules (e.g., ETH or BTC):
Ethereum Integration:
npm install @okxweb3/coin-ethereumBitcoin Integration:
npm install @okxweb3/coin-bitcoinLocal Building Instructions
Clone the repository:
git clone https://github.com/okx/js-wallet-sdk.gitRun the build script:
npm run build
Core Features
- Crypto-lib: Implements security algorithms (BIP32, BIP39, ECDSA, Ed25519).
- Coin-base: Standardized interfaces for multi-chain operations.
- Coin-specific modules: Transaction builders and signers for individual blockchains (e.g.,
coin-ethereum,coin-bitcoin).
Module Packages
| Package | Description | GitHub Link |
|---|---|---|
@okxweb3/coin-base | Core interfaces for blockchain operations | Details |
@okxweb3/crypto-lib | Cryptographic utilities (BIP39, ECDSA) | Details |
@okxweb3/coin-ethereum | Ethereum/EVM-compatible chains | Details |
@okxweb3/coin-bitcoin | Bitcoin and derivatives (LTC, DOGE) | Details |
👉 Explore all supported blockchains
Key Functions
| Function | Description | Supported Chains |
|---|---|---|
getRandomPrivateKey() | Generates cryptographically secure keys | All |
signTransaction() | Signs raw transactions | ETH, BTC, etc. |
validateAddress() | Verifies address formats | Multi-chain |
Supported Blockchains
| Blockchain | Derivation Path | Example Tokens |
|---|---|---|
| Bitcoin | m/44'/0'/0'/0 | BTC, TBTC |
| Ethereum | m/44'/60'/0'/0 | ETH, Arbitrum |
| Cosmos | m/44'/118'/0'/0 | ATOM, OSMO |
FAQs
How do I integrate the SDK into a React app?
Install the desired coin module via npm and import the functions directly into your components.
Can I use this SDK for hardware wallet interactions?
Yes, functions like getHardWareRawTransaction() support Ledger and Trezor devices.
What’s the difference between coin-base and individual coin modules?
coin-base provides universal interfaces, while coin-specific modules (e.g., coin-ethereum) implement chain-logic.
👉 Need further assistance? Contact support
Conclusion
This SDK simplifies blockchain integration with robust TypeScript/JavaScript tools. For advanced use cases, refer to the official GitHub repository or explore our developer portal.