node-wallet-generator
A plug-and-play module for generating keypair for multiple cryptocurrencies.
Documentation
- Examples and usage are listed below
Installation
npm install @nodeberry/node-wallet-generator
Examples
- Usage
- Generate a mnemonic
- Generate ethereum wallet from mnemonic
- Generate MAINNET bitcoin wallet from mnemonic
- Generate TESTNET bitcoin wallet from mnemonic
- Generate Litecoin wallet
- Generate Dogecoin wallet
Usage
const wallet = require('@nodeberry/node-wallet-generator')
Generate a mnemonic
let mnemonic
const getMnemonic = ()=>{
mnemonic = wallet.generateMnemonic()
console.log(mnemonic)
}
getMnemonic()
Generate ethereum wallet from mnemonic
let ethereum
const getEthereum = async()=>{
ethereum = await wallet.getEthWalletFromMnemonic(mnemonic)
console.log(ethereum)
}
getEthereum()
Generate MAINNET bitcoin wallet from mnemonic
let bitcoin
const getBitcoin = async()=>{
bitcoin = await wallet.getBtcWalletFromMnemonic(mnemonic,'MAINNET')
console.log(bitcoin)
}
getBitcoin()
Generate TESTNET bitcoin wallet from mnemonic
let bitcoin
const getBitcoin = async()=>{
bitcoin = await wallet.getBtcWalletFromMnemonic(mnemonic,'TESTNET')
console.log(bitcoin)
}
getBitcoin()
Generate Litecoin wallet
let litecoin
const getLitecoin = async()=>{
litecoin = await wallet.getLtcWalletFromMnemonic(mnemonic)
console.log(litecoin)
}
getLitecoin()
Generate Dogecoin wallet
let dogecoin
const getDogecoin = async()=>{
dogecoin = await wallet.getDogeWalletFromMnemonic(mnemonic)
console.log(dogecoin)
}
getDogecoin()
Running test suite
npm test
npx jest --coverage