minimal-ecash-wallet
Version:
A minimalist eCash (XEC) wallet npm library, for use in a web apps.
24 lines (19 loc) • 529 B
JavaScript
/*
An example app for creating a wallet using this library.
*/
const ECashWallet = require('../index')
async function createWallet () {
try {
// Instantiate the wallet library.
const eCashWallet = new ECashWallet()
// Wait for the wallet to be created.
await eCashWallet.walletInfoPromise
// Print out the wallet information.
console.log(
`Wallet information: ${JSON.stringify(eCashWallet.walletInfo, null, 2)}`
)
} catch (err) {
console.error('Error: ', err)
}
}
createWallet()