src/util.js
function saveWallet(filename, walletData) {
  return new Promise((resolve, reject) => {
    fs.writeFile(filename, JSON.stringify(walletData, null, 2), function(err) {
      if (err) return reject(console.error(err))

      //console.log(`${name}.json written successfully.`)
      return resolve()
    })
  })
}
function saveWallet(filename, walletData) {
  return new Promise((resolve, reject) => {
    fs.writeFile(filename, JSON.stringify(walletData, null, 2), function(err) {
      if (err) return reject(console.error(err))

      //console.log(`${name}.json written successfully.`)
      return resolve()
    })
  })
}
Save a wallet to a file.