From d965457b92bda74f39471f347a9ecf7e6d1b5af7 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Fri, 9 Sep 2022 17:47:12 +0300 Subject: [PATCH] feat: show seed word in browser (for devices with no display) --- .../serial-signer/serial-signer.html | 18 ++++++++++++++++-- .../components/serial-signer/serial-signer.js | 9 ++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.html b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.html index b256ea601..64848ddac 100644 --- a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.html +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.html @@ -393,9 +393,23 @@ - + - Check word at position {{hww.seedWordPosition}} on display + Check word at position {{hww.seedWordPosition}} on device +
+
+ +
+
+
+
+ +
+
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 cc4aaa06c..47089f082 100644 --- a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js @@ -38,6 +38,8 @@ async function serialSigner(path) { psbtSentResolve: null, xpubResolve: null, seedWordPosition: 1, + seedWord: null, + showSeedWord: false, showSeedDialog: false, // config: null, @@ -374,6 +376,10 @@ async function serialSigner(path) { }) } }, + closeSeedDialog: function () { + this.hww.seedWord = null + this.hww.showSeedWord = false + }, hwwConfirmNext: async function () { this.hww.confirm.outputIndex += 1 if (this.hww.confirm.outputIndex >= this.tx.outputs.length) { @@ -817,7 +823,8 @@ async function serialSigner(path) { await this.sendCommandSecure(COMMAND_SEED, [this.hww.seedWordPosition]) }, handleShowSeedResponse: function (res = '') { - const args = res.trim().split(' ') + const [pos, word] = res.trim().split(' ') + this.hww.seedWord = `${pos}. ${word}` }, hwwRestore: async function () { try {