From 32bb59255d09e5c1890738d22b0850a4795338c9 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Mon, 15 Aug 2022 15:59:49 +0300 Subject: [PATCH] feat: restore takes both the `password` and the `seed` as args --- .../static/components/serial-signer/serial-signer.js | 10 ++++++---- lnbits/extensions/watchonly/static/js/utils.js | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) 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 867345b24..3a0933e9c 100644 --- a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js @@ -631,8 +631,10 @@ async function serialSigner(path) { }, hwwRestore: async function () { try { - await this.sendCommandSecure(COMMAND_RESTORE, [this.hww.mnemonic]) - await this.sendCommandSecure(COMMAND_PASSWORD, [this.hww.password]) + await this.sendCommandSecure(COMMAND_RESTORE, [ + this.hww.password, + this.hww.mnemonic + ]) } catch (error) { this.$q.notify({ type: 'warning', @@ -721,10 +723,10 @@ async function serialSigner(path) { encryptMessage: async function (key, iv, message) { while (message.length % 16 !== 0) message += ' ' const encodedMessage = asciiToUint8Array(message) - + const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv) const encryptedBytes = aesCbc.encrypt(encodedMessage) - + return encryptedBytes }, decryptMessage: async function (key, iv, encryptedBytes) { diff --git a/lnbits/extensions/watchonly/static/js/utils.js b/lnbits/extensions/watchonly/static/js/utils.js index adfd24225..36c9b218f 100644 --- a/lnbits/extensions/watchonly/static/js/utils.js +++ b/lnbits/extensions/watchonly/static/js/utils.js @@ -191,4 +191,3 @@ function asciiToUint8Array(str) { } return new Uint8Array(chars) } -