My Javascript implemtation on BTC, BCH, ETH, LTC, and XMR wallets. These wallets are designed only to spend funds. You must source your own blockchain API, such as fetching utxos/broadcasting txs.
This is not a package. This is a practical implemtation for a NodeJS Crypto wallet.
HD Wallet. Extended Public and Private key needed. Exodus wallet does not currently support viewing your extended private key(xprv)
Extended Keys are used to generate children addresses. This wallet is programmed to search your children addresses for funds. All change is returned to the first child address.
var wallet = new BitcoinHDWallet("xpub", "xprv");
// Sends ~$45 to the recipient address (+$6 fee)
var txid = await wallet.send("recipientAddress", 0.001, 0.00015);
// view your transaction on the mainnet
console.log("https://blockchair.com/bitcoin/transaction/" + txid);
HD Wallet
var wallet = new BitcoinCashHDWallet("xpub", "xprv");
// Sends ~$45 to the recipient address (+6 cent fee)
var txid = await wallet.send("recipientAddress", 0.045, 0.00006);
// view your transaction on the mainnet
console.log("https://blockchair.com/bitcoin-cash/transaction/" + txid);
Wallet. Private key needed.
var wallet = new EthereumWallet("address", "privateKey");
// Sends ~$45 to the recipient address (+$13 fee)
var txid = await wallet.send("recipientAddress", 0.012, 0.003);
// view your transaction on the mainnet
console.log("https://etherscan.io/tx/" + txid);
HD Wallert
var wallet = new LitecoinHDWallet("xpub", "xprv");
// Sends ~$45 to the recipient address (+1 cent fee)
var txid = await wallet.send("recipientAddress", 0.17, 0.00004);
// view your transaction on the mainnet
console.log("https://blockchair.com/litecoin/transaction/" + txid);
Wallet
Package | Purpose | Required For |
---|---|---|
bitcore-lib | Pure JS solution for creating and signing txs | BTC, BCH, LTC |
bitcore-lib-cash | Creating and signing Bitcoin-Cash txs | BCH |
litecore-lib-v5 | Creating and signing litecoin txs | LTC |
ethereumjs-tx | Creating and signing ethereum txs | ETH |
monerolib | Creating and signing Monero txs | XMR |
multicoin-address-validator | Validates generated addresses | All |
Bitcore-explorers is now a defunct library. The Insights server, managed by Bitpay, is no longer usable. I recommend switching over to NOWNodes.io for your blockchain api.
monerolib is not currently finished. Therefore, the Monero wallet is haulted until then.
Exodus Wallet has no method to view your xprvs (extended private keys) You need to use a website like this: https://iancoleman.io/bip39/ (google "bip39 online" for alternatives)
- Enter your secret phrase in BIP39 Mnemonic textbox (make sure you audit the source first!!)
- xprv is in the Account Extended Private Key textbox
For Bitcoin Cash and Litecoin, scroll back up to Coin and select BCH or LTC. Also uncheck the Uncheck Prefixes, so it's in 'xprv...' form.
Feel free to open PRs and issues. If are you unsure of anything, don't hesitate to ask.