diff --git a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js index 41dc81ec2..2902f9eb1 100644 --- a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js @@ -571,8 +571,6 @@ async function serialSigner(path) { // noting to do here yet break } - - }, hwwPair: async function () { try { @@ -637,30 +635,36 @@ async function serialSigner(path) { .getSharedSecret(this.decryptionKey, hwwPublicKey) .slice(1, 33) - const sharedSecretHex = nobleSecp256k1.utils.bytesToHex(this.sharedSecret) - const sharedSecredHash = await nobleSecp256k1.utils.sha256(asciiToUint8Array(sharedSecretHex)) - const fingerprint = nobleSecp256k1.utils.bytesToHex(sharedSecredHash).substring(0, 5).toUpperCase() + const sharedSecretHex = nobleSecp256k1.utils.bytesToHex( + this.sharedSecret + ) + const sharedSecredHash = await nobleSecp256k1.utils.sha256( + asciiToUint8Array(sharedSecretHex) + ) + const fingerprint = nobleSecp256k1.utils + .bytesToHex(sharedSecredHash) + .substring(0, 5) + .toUpperCase() console.log('### fingerprint', fingerprint) - // + // LNbits.utils - .confirmDialog('Confirm code from display: '+fingerprint) - .onOk(() => { - this.addPairedDevice( - this.deviceId, - nobleSecp256k1.utils.bytesToHex(this.sharedSecret) - ) - - - this.$q.notify({ - type: 'positive', - message: 'Paired with device!', - timeout: 5000 - }) - }).onCancel(() => { - this.closeSerialPort() - }) + .confirmDialog('Confirm code from display: ' + fingerprint) + .onOk(() => { + this.addPairedDevice( + this.deviceId, + nobleSecp256k1.utils.bytesToHex(this.sharedSecret) + ) + this.$q.notify({ + type: 'positive', + message: 'Paired with device!', + timeout: 5000 + }) + }) + .onCancel(() => { + this.closeSerialPort() + }) }, hwwHelp: async function () { try { diff --git a/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.html b/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.html index 7b5270365..748d650df 100644 --- a/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.html +++ b/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.html @@ -1,7 +1,6 @@