Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (err){
console.log(err);
}
if (choice != choices.saveAndQuit){
this.displayAccountMenu();
}
}
switch(choice){
case choices.initiateWithdraw:
this.initiateWithdraw(done);
break;
case choices.completeWithdraw:
this.completeWithdraw(done);
break;
case choices.showBalace:
console.log("Balance in bits: " + unit.fromSatoshis(this.wallet.balance).bits.toLocaleString());
this.displayAccountMenu();
break;
case choices.showXpub:
console.log(this.wallet.selectedAccount.xpub);
this.displayAccountMenu();
break;
case choices.saveAndQuit:
this.saveAndQuit(done);
break;
case choices.backToMain:
this.displayMainMenu();
break;
case choices.update:
console.log('Updating Wallet...');
this.wallet.update((err,wallet) => done(err));
break;
if (err) {
console.log(err);
}
if (choice != choices.saveAndQuit) {
this.displayAccountMenu();
}
};
switch (choice) {
case choices.initiateWithdraw:
this.initiateWithdraw(done);
break;
case choices.completeWithdraw:
this.completeWithdraw(done);
break;
case choices.showBalace:
console.log("Balance in bits: " + unit.fromSatoshis(this.wallet.balance).bits.toLocaleString());
this.displayAccountMenu();
break;
case choices.showXpub:
console.log(this.wallet.selectedAccount.xpub);
this.displayAccountMenu();
break;
case choices.saveAndQuit:
this.saveAndQuit(done);
break;
case choices.backToMain:
this.displayMainMenu();
break;
case choices.update:
console.log('Updating Wallet...');
this.wallet.update((err, wallet) => done(err));
break;
verifyTransaction(transaction:TransactionInfo, fee:number, callback:(err:any) => void){
console.log('Please verify this transaction');
for(let address in transaction.outputTotals){
console.log('Send: ' + unit.fromSatoshis(transaction.outputTotals[address]).bits.toLocaleString() + ' bits');
console.log('To: ' + address);
}
console.log('Fee: ' + unit.fromSatoshis(fee).bits.toLocaleString() + ' bits');
inquirer.prompt({
name:'complete',
type:'confirm',
message:'answer y/n',
})
.then((answers:any) => {
let complete:boolean = answers['complete'];
if(complete){
return callback(null);
}
else {
return callback('Fix issues and try again');
}
});
}
verifyTransaction(transaction, fee, callback) {
console.log('Please verify this transaction');
for (let address in transaction.outputTotals) {
console.log('Send: ' + unit.fromSatoshis(transaction.outputTotals[address]).bits.toLocaleString() + ' bits');
console.log('To: ' + address);
}
console.log('Fee: ' + unit.fromSatoshis(fee).bits.toLocaleString() + ' bits');
inquirer.prompt({
name: 'complete',
type: 'confirm',
message: 'answer y/n',
})
.then((answers) => {
let complete = answers['complete'];
if (complete) {
return callback(null);
}
else {
return callback('Fix issues and try again');
}
verifyTransaction(transaction, fee, callback) {
console.log('Please verify this transaction');
for (let address in transaction.outputTotals) {
console.log('Send: ' + unit.fromSatoshis(transaction.outputTotals[address]).bits.toLocaleString() + ' bits');
console.log('To: ' + address);
}
console.log('Fee: ' + unit.fromSatoshis(fee).bits.toLocaleString() + ' bits');
inquirer.prompt({
name: 'complete',
type: 'confirm',
message: 'answer y/n',
})
.then((answers) => {
let complete = answers['complete'];
if (complete) {
return callback(null);
}
else {
return callback('Fix issues and try again');
}
});
}
sign(fee, callback) {
verifyTransaction(transaction:TransactionInfo, fee:number, callback:(err:any) => void){
console.log('Please verify this transaction');
for(let address in transaction.outputTotals){
console.log('Send: ' + unit.fromSatoshis(transaction.outputTotals[address]).bits.toLocaleString() + ' bits');
console.log('To: ' + address);
}
console.log('Fee: ' + unit.fromSatoshis(fee).bits.toLocaleString() + ' bits');
inquirer.prompt({
name:'complete',
type:'confirm',
message:'answer y/n',
})
.then((answers:any) => {
let complete:boolean = answers['complete'];
if(complete){
return callback(null);
}
else {