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

38 lines
753 B
JavaScript
Executable File

#!/usr/bin/env node
var _ = require('lodash');
var program = require('commander');
var Client = require('../lib/client');
var utils = require('./cli-utils');
var utils = require('./cli-utils');
program = utils.configureCommander(program);
program
.usage('[options] <txpid>')
.parse(process.argv);
var args = program.args;
if (!args[0])
program.help();
var txpid = args[0];
var cli = new Client({
filename: program.config
});
cli.getTxProposals({}, function(err, txps) {
utils.die(err);
if (program.verbose)
console.log('* Raw Server Response:\n', txps); //TODO
var txp = utils.findOneTxProposal(txps, txpid);
cli.removeTxProposal(txp, function(err) {
utils.die(err);
console.log('Transaction removed.');
});
});