sign/reject with args (if only one txp)
This commit is contained in:
parent
1a8eaf0c7f
commit
7c1860117e
|
@ -3,28 +3,28 @@
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
var program = require('commander');
|
var program = require('commander');
|
||||||
var Client = require('../lib/client');
|
var Client = require('../lib/client');
|
||||||
var utils = require('./cli-utils');
|
var utils = require('./cli-utils');
|
||||||
|
|
||||||
program
|
program
|
||||||
.version('0.0.1')
|
.version('0.0.1')
|
||||||
.option('-c,--config [file]', 'Wallet config filename')
|
.option('-c,--config [file]', 'Wallet config filename')
|
||||||
.option('-v,--verbose', 'be verbose')
|
.option('-v,--verbose', 'be verbose')
|
||||||
.usage('[options] <txpid>')
|
.usage('[options] <txpid>')
|
||||||
.parse(process.argv);
|
.parse(process.argv);
|
||||||
|
|
||||||
var args = program.args;
|
var args = program.args;
|
||||||
if (!args[0])
|
if (!args[0])
|
||||||
program.help();
|
program.help();
|
||||||
|
|
||||||
var txpid = args[0];
|
var txpid = args[0];
|
||||||
var client = utils.getClient(program);
|
var client = utils.getClient(program);
|
||||||
|
|
||||||
client.getTxProposals({}, function(err, txps) {
|
client.getTxProposals({}, function(err, txps) {
|
||||||
utils.die(err);
|
utils.die(err);
|
||||||
|
|
||||||
var txp = utils.findOneTxProposal(txps, txpid);
|
var txp = utils.findOneTxProposal(txps, txpid);
|
||||||
client.broadcastTxProposal(txp, function(err, txid) {
|
client.broadcastTxProposal(txp, function(err, txid) {
|
||||||
utils.die(err);
|
utils.die(err);
|
||||||
console.log('TX Broadcasted: ',txid);
|
console.log('TX Broadcasted: ', txid);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -13,9 +13,7 @@ program
|
||||||
.parse(process.argv);
|
.parse(process.argv);
|
||||||
|
|
||||||
var args = program.args;
|
var args = program.args;
|
||||||
if (!args[0])
|
var txpid = args[0] || '';
|
||||||
program.help();
|
|
||||||
var txpid = args[0];
|
|
||||||
var reason = args[1] || '';
|
var reason = args[1] || '';
|
||||||
var client = utils.getClient(program);
|
var client = utils.getClient(program);
|
||||||
|
|
||||||
|
|
|
@ -12,10 +12,7 @@ program
|
||||||
.parse(process.argv);
|
.parse(process.argv);
|
||||||
|
|
||||||
var args = program.args;
|
var args = program.args;
|
||||||
if (!args[0])
|
var txpid = args[0] || '';
|
||||||
program.help();
|
|
||||||
|
|
||||||
var txpid = args[0];
|
|
||||||
|
|
||||||
var client = utils.getClient(program);
|
var client = utils.getClient(program);
|
||||||
client.getTxProposals({}, function(err, txps) {
|
client.getTxProposals({}, function(err, txps) {
|
||||||
|
|
|
@ -105,7 +105,7 @@ TxProposal.prototype._getBitcoreTx = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
TxProposal.prototype.getNetworkName = function() {
|
TxProposal.prototype.getNetworkName = function() {
|
||||||
return Bitcore.Address(this.toAddress).toObject().networkName;
|
return Bitcore.Address(this.toAddress).toObject().network;
|
||||||
};
|
};
|
||||||
|
|
||||||
TxProposal.prototype.getRawTx = function() {
|
TxProposal.prototype.getRawTx = function() {
|
||||||
|
|
|
@ -317,6 +317,7 @@ CopayServer.prototype._getBlockExplorer = function(provider, network) {
|
||||||
url = 'https://test-insight.bitpay.com:443'
|
url = 'https://test-insight.bitpay.com:443'
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
console.log('[server.js.320:url:]',url); //TODO
|
||||||
return new Explorers.Insight(url, network);
|
return new Explorers.Insight(url, network);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -698,7 +699,7 @@ CopayServer.prototype.broadcastTx = function(opts, cb) {
|
||||||
txid: txid
|
txid: txid
|
||||||
});
|
});
|
||||||
|
|
||||||
return cb(null, txp);
|
return cb(null, txid);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue