Browse Source

better output

activeAddress
Ivan Socolsky 10 years ago
parent
commit
63ac70b50f
  1. 13
      bit-wallet/bit-history

13
bit-wallet/bit-history

@ -24,16 +24,19 @@ client.getTxHistory({}, function (err, txs) {
_.each(txs, function(tx) {
var time = moment(tx.time * 1000).fromNow();
var amount = Utils.renderAmount(tx.amount);
var confirmations = tx.confirmations || 0;
switch (tx.action) {
case 'received':
console.log("\t%s: <= %s", time, amount);
break;
case 'sent':
console.log("\t%s: %s => %s", time, amount, tx.addressTo);
direction = '<=';
break;
case 'moved':
console.log("\t%s: == %s", time, amount);
direction = '==';
break;
case 'sent':
direction = '=>';
break;
}
console.log("\t%s: %s %s %s (%s confirmations)", time, direction, tx.action, amount, confirmations);
});
});

Loading…
Cancel
Save