#!/usr/bin/env node var _ = require('lodash'); var program = require('commander'); var utils = require('./cli-utils'); program .version('0.0.1') .option('-c,--config [file]', 'Wallet config filename') .option('-v,--verbose', 'be verbose') .option('-h, --host [host]', 'Bitcore Wallet Service URL (eg: http://localhost:3001/copay/api') .usage('[options] ') .parse(process.argv); var args = program.args; var txpid = args[0] || ''; var client = utils.getClient(program); client.getTxProposals({}, function(err, txps) { utils.die(err); var txp = utils.findOneTxProposal(txps, txpid); client.signTxProposal(txp, function(err, x) { utils.die(err); if (x.status == 'broadcasted') console.log('Transaction Broadcasted: TXID: ' + x.txid); else console.log('Transaction signed by you.'); }); });