bch-encrypt-lib
Version:
An npm library for encrypting messages using the Bitcoin protocol.
24 lines (19 loc) • 519 B
JavaScript
/*
An example app for creating a wallet using this library.
*/
const BchWallet = require('../index')
async function createWallet () {
try {
// Instantiate the wallet library.
const bchWallet = new BchWallet()
// Wait for the wallet to be created.
await bchWallet.walletInfoPromise
// Print out the wallet information.
console.log(
`Wallet information: ${JSON.stringify(bchWallet.walletInfo, null, 2)}`
)
} catch (err) {
console.error('Error: ', err)
}
}
createWallet()