You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
872 B

10 years ago
#!/usr/bin/env node
var _ = require('lodash');
var fs = require('fs');
var moment = require('moment');
var program = require('commander');
var Utils = require('./cli-utils');
program = Utils.configureCommander(program);
program
.parse(process.argv);
var args = program.args;
var client = Utils.getClient(program);
var txData;
client.getTxHistory({}, function (err, txs) {
if (_.isEmpty(txs))
return;
console.log("* TX History:")
_.each(txs, function(tx) {
var time = moment().fromNow(tx.time);
10 years ago
var amount = Utils.renderAmount(tx.amount);
10 years ago
switch (tx.action) {
case 'received':
10 years ago
console.log("\t%s: <= %s", time, amount);
10 years ago
break;
case 'sent':
10 years ago
console.log("\t%s: %s => %s", time, amount, tx.addressTo);
10 years ago
break;
case 'moved':
10 years ago
console.log("\t%s: == %s", time, amount);
10 years ago
break;
}
});
});