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 ed06cf5a..7966eea3 100644 --- a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js @@ -209,6 +209,16 @@ async function serialSigner(path) { this.handleDhExchangeResponse(commandData) return } + switch (command) { + case COMMAND_DH_EXCHANGE: + this.handleDhExchangeResponse(commandData) + return + case COMMAND_LOG: + + console.log(` %c${commandData}`, 'background: #222; color: #bada55') + + return + } if (this.dheKey) { try { console.log('### value', value) @@ -231,6 +241,9 @@ async function serialSigner(path) { nobleSecp256k1.utils.bytesToHex(decrypted1) ) console.log('### decrypted text 1', new TextDecoder().decode(decrypted1)) + + var decryptedText = aesjs.utils.utf8.fromBytes(decrypted1); + console.log('### decrypted text utf8 1',decryptedText); } catch (error) { console.log('### error 2', error) } diff --git a/lnbits/extensions/watchonly/static/js/utils.js b/lnbits/extensions/watchonly/static/js/utils.js index 23a945fe..d6c5393d 100644 --- a/lnbits/extensions/watchonly/static/js/utils.js +++ b/lnbits/extensions/watchonly/static/js/utils.js @@ -11,6 +11,7 @@ const COMMAND_CONFIRM_NEXT = '/confirm-next' const COMMAND_CANCEL = '/cancel' const COMMAND_XPUB = '/xpub' const COMMAND_DH_EXCHANGE = '/dh-exchange' +const COMMAND_LOG = '/log' const DEFAULT_RECEIVE_GAP_LIMIT = 20