Comparing version 0.0.5 to 0.0.6
@@ -20,2 +20,4 @@ /// <reference types="node" /> | ||
Buffer: BufferConstructor; | ||
private _ls; | ||
private _es; | ||
private _handshakeState; | ||
@@ -22,0 +24,0 @@ private _decryptedMsgs$; |
@@ -25,2 +25,4 @@ import { BehaviorSubject, firstValueFrom, Subject, timer } from 'rxjs'; | ||
Buffer; | ||
_ls; | ||
_es; | ||
_handshakeState; | ||
@@ -37,11 +39,11 @@ _decryptedMsgs$; | ||
const { remoteNodePublicKey, wsProxy, privateKey, ip, port = 9735, logger } = options; | ||
const ls = Buffer.from(privateKey || createRandomPrivateKey(), 'hex'); | ||
const es = Buffer.from(createRandomPrivateKey(), 'hex'); | ||
this._ls = Buffer.from(privateKey || createRandomPrivateKey(), 'hex'); | ||
this._es = Buffer.from(createRandomPrivateKey(), 'hex'); | ||
this.noise = new NoiseState({ | ||
ls, | ||
es | ||
ls: this._ls, | ||
es: this._es | ||
}); | ||
this.remoteNodePublicKey = remoteNodePublicKey; | ||
this.publicKey = this.noise.lpk.toString('hex'); | ||
this.privateKey = ls.toString('hex'); | ||
this.privateKey = this._ls.toString('hex'); | ||
this.wsUrl = wsProxy ? `${wsProxy}/${ip}:${port}` : `wss://${remoteNodePublicKey}@${ip}:${port}`; | ||
@@ -100,2 +102,7 @@ this.connected$ = new BehaviorSubject(false); | ||
this._log('info', 'Manually disconnecting from WebSocket'); | ||
// reset noise state | ||
this.noise = new NoiseState({ | ||
ls: this._ls, | ||
es: this._es | ||
}); | ||
this._disconnected = true; | ||
@@ -102,0 +109,0 @@ this.socket && this.socket.close(); |
{ | ||
"name": "lnmessage", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Talk to Lightning nodes from your browser", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
234978
4089