You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-desktop/js/modules/loki_p2p_api.js

25 lines
412 B
JavaScript

class LokiP2pAPI {
constructor() {
this.contactP2pDetails = {};
}
addContactP2pDetails(pubKey, address, port) {
this.contactP2pDetails[pubKey] = {
address,
port,
};
}
getContactP2pDetails(pubKey) {
return this.contactP2pDetails[pubKey] || null;
}
removeContactP2pDetails(pubKey) {
delete this.contactP2pDetails[pubKey];
}
}
module.exports = {
LokiP2pAPI,
};