@parity/api
Version:
The Parity Promise-based API library for interfacing with Ethereum over RPC
77 lines (76 loc) • 2.84 kB
JavaScript
;
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
var Shh = /** @class */ (function () {
function Shh(transport) {
this._transport = transport;
}
Shh.prototype.info = function () {
return this._transport
.execute('shh_info');
};
Shh.prototype.newKeyPair = function () {
return this._transport
.execute('shh_newKeyPair');
};
Shh.prototype.addPrivateKey = function (privKey) {
return this._transport
.execute('shh_addPrivateKey', privKey);
};
Shh.prototype.newSymKey = function () {
return this._transport
.execute('shh_newSymKey');
};
Shh.prototype.getPublicKey = function (identity) {
return this._transport
.execute('shh_getPublicKey', identity);
};
Shh.prototype.getPrivateKey = function (identity) {
return this._transport
.execute('shh_getPrivateKey', identity);
};
Shh.prototype.getSymKey = function (identity) {
return this._transport
.execute('shh_getSymKey', identity);
};
Shh.prototype.deleteKey = function (identity) {
return this._transport
.execute('shh_deleteKey', identity);
};
Shh.prototype.post = function (messageObj) {
return this._transport
.execute('shh_post', messageObj);
};
Shh.prototype.newMessageFilter = function (filterObj) {
return this._transport
.execute('shh_newMessageFilter', filterObj);
};
Shh.prototype.getFilterMessages = function (filterId) {
return this._transport
.execute('shh_getFilterMessages', filterId);
};
Shh.prototype.deleteMessageFilter = function (filterId) {
return this._transport
.execute('shh_deleteMessageFilter', filterId);
};
Shh.prototype.subscribe = function (filterObj, callback) {
return this._transport
.subscribe('shh', callback, filterObj);
};
Shh.prototype.unsubscribe = function (subscriptionId) {
return this._transport
.unsubscribe(subscriptionId);
};
return Shh;
}());
module.exports = Shh;