bitcore-wallet-service/bit-wallet/bit-rm

38 lines
753 B
Plaintext
Raw Normal View History

2015-02-14 07:54:00 -08:00
#!/usr/bin/env node
var _ = require('lodash');
var program = require('commander');
2015-02-15 07:46:38 -08:00
var Client = require('../lib/client');
2015-02-19 18:43:35 -08:00
var utils = require('./cli-utils');
2015-02-21 06:59:33 -08:00
var utils = require('./cli-utils');
program = utils.configureCommander(program);
2015-02-14 07:54:00 -08:00
program
.usage('[options] <txpid>')
.parse(process.argv);
var args = program.args;
if (!args[0])
program.help();
var txpid = args[0];
2015-02-15 07:46:38 -08:00
var cli = new Client({
2015-02-14 07:54:00 -08:00
filename: program.config
});
2015-02-15 08:03:48 -08:00
cli.getTxProposals({}, function(err, txps) {
2015-02-19 18:43:35 -08:00
utils.die(err);
2015-02-14 07:54:00 -08:00
if (program.verbose)
2015-02-15 08:03:48 -08:00
console.log('* Raw Server Response:\n', txps); //TODO
2015-02-14 07:54:00 -08:00
2015-02-19 18:43:35 -08:00
var txp = utils.findOneTxProposal(txps, txpid);
2015-02-14 07:54:00 -08:00
2015-02-15 08:03:48 -08:00
cli.removeTxProposal(txp, function(err) {
2015-02-19 18:43:35 -08:00
utils.die(err);
2015-02-14 07:54:00 -08:00
2015-02-15 08:03:48 -08:00
console.log('Transaction removed.');
2015-02-14 07:54:00 -08:00
});
});