From 63ac70b50f4ba406fbded01d71a113a356158500 Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Mon, 23 Feb 2015 12:37:37 -0300 Subject: [PATCH] better output --- bit-wallet/bit-history | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bit-wallet/bit-history b/bit-wallet/bit-history index 0680b99..e372cf9 100755 --- a/bit-wallet/bit-history +++ b/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); }); });