diff --git a/lib/server.js b/lib/server.js index c3474e8..5d6c383 100644 --- a/lib/server.js +++ b/lib/server.js @@ -707,7 +707,7 @@ CopayServer.prototype.getPendingTxs = function(opts, cb) { * @param {Object} opts.minTs (defaults to 0) * @param {Object} opts.maxTs (defaults to now) * @param {Object} opts.limit - * @returns {TxProposal[]} Transaction proposal. + * @returns {TxProposal[]} Transaction proposals, first newer */ CopayServer.prototype.getTxs = function(opts, cb) { var self = this; @@ -718,6 +718,24 @@ CopayServer.prototype.getTxs = function(opts, cb) { }; +/** + * Retrieves notifications in the range (maxTs-minTs). + * @param {Object} opts.minTs (defaults to 0) + * @param {Object} opts.maxTs (defaults to now) + * @param {Object} opts.limit + * @returns {Notification[]} Notifications, first newer + */ +CopayServer.prototype.getNotifications = function(opts, cb) { + var self = this; + self.storage.fetchNotifications(self.walletId, opts, function(err, notifications) { + if (err) return cb(err); + return cb(null, notifications); + }); +}; + + + + module.exports = CopayServer;