Browse Source

sign/reject with args (if only one txp)

activeAddress
Matias Alejo Garcia 10 years ago
parent
commit
7c1860117e
  1. 32
      bit-wallet/bit-broadcast
  2. 4
      bit-wallet/bit-reject
  3. 5
      bit-wallet/bit-sign
  4. 2
      lib/model/txproposal.js
  5. 3
      lib/server.js

32
bit-wallet/bit-broadcast

@ -3,28 +3,28 @@
var _ = require('lodash');
var program = require('commander');
var Client = require('../lib/client');
var utils = require('./cli-utils');
var utils = require('./cli-utils');
program
.version('0.0.1')
.option('-c,--config [file]', 'Wallet config filename')
.option('-v,--verbose', 'be verbose')
.usage('[options] <txpid>')
.parse(process.argv);
.version('0.0.1')
.option('-c,--config [file]', 'Wallet config filename')
.option('-v,--verbose', 'be verbose')
.usage('[options] <txpid>')
.parse(process.argv);
var args = program.args;
if (!args[0])
program.help();
var txpid = args[0];
var client = utils.getClient(program);
var txpid = args[0];
var client = utils.getClient(program);
client.getTxProposals({}, function(err, txps) {
utils.die(err);
client.getTxProposals({}, function(err, txps) {
utils.die(err);
var txp = utils.findOneTxProposal(txps, txpid);
client.broadcastTxProposal(txp, function(err, txid) {
utils.die(err);
console.log('TX Broadcasted: ',txid);
});
});
var txp = utils.findOneTxProposal(txps, txpid);
client.broadcastTxProposal(txp, function(err, txid) {
utils.die(err);
console.log('TX Broadcasted: ', txid);
});
});

4
bit-wallet/bit-reject

@ -13,9 +13,7 @@ program
.parse(process.argv);
var args = program.args;
if (!args[0])
program.help();
var txpid = args[0];
var txpid = args[0] || '';
var reason = args[1] || '';
var client = utils.getClient(program);

5
bit-wallet/bit-sign

@ -12,10 +12,7 @@ program
.parse(process.argv);
var args = program.args;
if (!args[0])
program.help();
var txpid = args[0];
var txpid = args[0] || '';
var client = utils.getClient(program);
client.getTxProposals({}, function(err, txps) {

2
lib/model/txproposal.js

@ -105,7 +105,7 @@ TxProposal.prototype._getBitcoreTx = function() {
};
TxProposal.prototype.getNetworkName = function() {
return Bitcore.Address(this.toAddress).toObject().networkName;
return Bitcore.Address(this.toAddress).toObject().network;
};
TxProposal.prototype.getRawTx = function() {

3
lib/server.js

@ -317,6 +317,7 @@ CopayServer.prototype._getBlockExplorer = function(provider, network) {
url = 'https://test-insight.bitpay.com:443'
break;
}
console.log('[server.js.320:url:]',url); //TODO
return new Explorers.Insight(url, network);
break;
}
@ -698,7 +699,7 @@ CopayServer.prototype.broadcastTx = function(opts, cb) {
txid: txid
});
return cb(null, txp);
return cb(null, txid);
});
});
});

Loading…
Cancel
Save