add REST endpoint
This commit is contained in:
parent
8df8327395
commit
da6e61b7e7
|
@ -711,6 +711,28 @@ ExpressApp.prototype.start = function(opts, cb) {
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
router.post('/v1/txconfirmations/', function(req, res) {
|
||||
getServerWithAuth(req, res, function(server) {
|
||||
server.txConfirmationSubscribe(req.body, function(err, response) {
|
||||
if (err) return returnError(err, res, req);
|
||||
res.json(response);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
router.delete('/v1/txconfirmations/:txid', function(req, res) {
|
||||
var opts = {
|
||||
txid: req.params['txid'],
|
||||
};
|
||||
getServerWithAuth(req, res, function(server) {
|
||||
server.txConfirmationUnsubscribe(opts, function(err, response) {
|
||||
if (err) return returnError(err, res, req);
|
||||
res.json(response);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.app.use(opts.basePath || '/bws/api', router);
|
||||
|
||||
WalletService.initialize(opts, cb);
|
||||
|
|
Loading…
Reference in New Issue