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.

39 lines
982 B

10 years ago
#!/usr/bin/env node
10 years ago
var _ = require('lodash');
10 years ago
var program = require('commander');
10 years ago
10 years ago
var ClientLib = require('../lib/clientlib.js');
10 years ago
var common = require('./common');
program
.version('0.0.1')
.option('-c, --config [file]', 'Wallet config filename')
.option('-v, --verbose', 'be verbose')
10 years ago
.parse(process.argv);
var args = program.args;
10 years ago
var cli = new ClientLib({
filename: program.config
});
10 years ago
10 years ago
cli.status(function(err, res) {
10 years ago
common.die(err);
10 years ago
var x = res.wallet;
console.log('* Wallet %s [%s]: %d-%d %s ', x.name, x.isTestnet ? 'testnet' : 'livenet', x.m, x.n, x.status);
10 years ago
10 years ago
var x = res.balance;
console.log('* Balance %d (Locked: %d)', x.totalAmount, x.lockedAmount);
10 years ago
10 years ago
if (! _.isEmpty(res.pendingTxps)) {
console.log("* TX Proposals:")
_.each(res.pendingTxps, function(x){
console.log("\t[%s] %d => %s", common.shortID(x.id),x.amount, x.toAddress);
});
}
10 years ago
10 years ago
if (program.verbose)
console.log('* Raw Server Response:\n', res); //TODO
10 years ago
});