How to use the bitcore-lib.Unit.fromSatoshis function in bitcore-lib

To help you get started, we’ve selected a few bitcore-lib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bijeebuss / icewallet / src / CommandLine / IceWalletPublic.ts View on Github external
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;
github bijeebuss / icewallet / bin / src / CommandLine / IceWalletPublic.js View on Github external
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;
github bijeebuss / icewallet / src / CommandLine / IceWalletPrivate.ts View on Github external
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');
      }
    });
  }
github bijeebuss / icewallet / bin / src / CommandLine / IceWalletPrivate.js View on Github external
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');
            }
github bijeebuss / icewallet / bin / src / CommandLine / IceWalletPrivate.js View on Github external
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) {
github bijeebuss / icewallet / src / CommandLine / IceWalletPrivate.ts View on Github external
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 {