#!/usr/bin/env node var _ = require('lodash'); var program = require('commander'); var ClientLib = require('../lib/clientlib.js'); var common = require('./common'); program .version('0.0.1') .option('-c,--config [file]', 'Wallet config filename') .option('-v,--verbose', 'be verbose') .usage('[options] ') .parse(process.argv); var args = program.args; if (!args[0]) program.help(); var txpid = args[0]; var cli = new ClientLib({ filename: program.config }); cli.txProposals({}, function(err, x) { common.die(err); if (program.verbose) console.log('* Raw Server Response:\n', x); //TODO var txps = _.filter(x, function(x) { return _.endsWith(common.shortID(x.id), txpid); }); if (!txps.length) common.die('Could not find TX Proposal:' + txpid); if (txps.length > 1) common.die('More than one TX Proposals match:' + txpid + ' : ' + _.map(txps, function(x) { return x.id; }).join(' '));; var txp = txps[0]; cli.reject(txp, function(err, x) { common.die(err); if (program.verbose) console.log('* Raw Server Response:\n', x); //TODO console.log('Transaction rejected.'); }); });