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) { _.each(txs, function(tx) {
var time = moment(tx.time * 1000).fromNow(); var time = moment(tx.time * 1000).fromNow();
var amount = Utils.renderAmount(tx.amount); var amount = Utils.renderAmount(tx.amount);
var confirmations = tx.confirmations || 0;
switch (tx.action) { switch (tx.action) {
case 'received': case 'received':
console.log("\t%s: <= %s", time, amount); direction = '<=';
break;
case 'sent':
console.log("\t%s: %s => %s", time, amount, tx.addressTo);
break; break;
case 'moved': case 'moved':
console.log("\t%s: == %s", time, amount); direction = '==';
break;
case 'sent':
direction = '=>';
break; break;
} }
console.log("\t%s: %s %s %s (%s confirmations)", time, direction, tx.action, amount, confirmations);
}); });
}); });

Loading…
Cancel
Save