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.
27 lines
677 B
27 lines
677 B
#!/usr/bin/env node
|
|
|
|
var _ = require('lodash');
|
|
var program = require('commander');
|
|
var utils = require('./cli-utils');
|
|
program = utils.configureCommander(program);
|
|
|
|
program
|
|
.usage('[options] <txpid>')
|
|
.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, tx) {
|
|
utils.die(err);
|
|
if (tx.status == 'broadcasted')
|
|
console.log('Transaction Broadcasted: TXID: ' + tx.txid);
|
|
else
|
|
console.log('Transaction signed by you.');
|
|
});
|
|
});
|
|
|