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.

31 lines
845 B

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