#!/usr/bin/env node var _ = require('lodash'); var program = require('commander'); var Client = require('../lib/client'); var common = require('./common'); program .version('0.0.1') .option('-c,--config [file]', 'Wallet config filename') .option('-v,--verbose', 'be verbose') .usage('[options] [reason]') .parse(process.argv); var args = program.args; if (!args[0]) program.help(); var txpid = args[0]; var reason = args[1] || ''; var cli = new Client({ filename: program.config }); cli.getTxProposals({}, function(err, txps) { common.die(err); if (program.verbose) console.log('* Raw Server Response:\n', txps); //TODO var txp = common.findOneTxProposal(txps, txpid); cli.rejectTxProposal(txp, reason, function(err, tx) { common.die(err); if (program.verbose) console.log('* Raw Server Response:\n', tx); //TODO console.log('Transaction rejected.'); }); });