#!/usr/bin/env node var _ = require('lodash'); 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); client.getStatus(function(err, res) { utils.die(err); var x = res.wallet; console.log('* Wallet %s [%s]: %d-%d %s ', x.name, x.network, x.m, x.n, x.status); if (x.status != 'complete') console.log(' Missing copayers:', x.n - x.copayers.length); console.log('* Copayers:', _.pluck(x.copayers,'name').join(', ')); var x = res.balance; console.log('* Balance %dSAT (Locked: %dSAT)', x.totalAmount, x.lockedAmount); if (!_.isEmpty(res.pendingTxps)) { console.log("* TX Proposals:") _.each(res.pendingTxps, function(x) { missingSignatures = x.requiredSignatures - _.filter(_.values(x.actions), function (a) { return a.type == 'accept'; }).length; console.log("\t%s [\"%s\" by %s] %dSAT => %s", utils.shortID(x.id), x.message, x.creatorName, x.amount, x.toAddress); if (!_.isEmpty(x.actions)) { console.log('\t\tActions: ', _.map(x.actions, function(a) { return a.copayerName + ' ' + (a.type == 'accept' ? '✓' : '✗') + (a.comment ? ' (' + a.comment + ')' : ''); }).join('. ')); } console.log('\t\tMissing signatures: ' + missingSignatures); }); } });