diff --git a/lnbits/extensions/watchonly/static/components/address-list/address-list.js b/lnbits/extensions/watchonly/static/components/address-list/address-list.js index 09475bad..80280589 100644 --- a/lnbits/extensions/watchonly/static/components/address-list/address-list.js +++ b/lnbits/extensions/watchonly/static/components/address-list/address-list.js @@ -9,7 +9,7 @@ async function addressList(path) { 'accounts', 'mempool_endpoint', 'inkey', - 'sats_denominated' + 'sats-denominated' ], watch: { immediate: true, @@ -90,7 +90,7 @@ async function addressList(path) { methods: { satBtc(val, showUnit = true) { - return satOrBtc(val, showUnit, this['sats_denominated']) + return satOrBtc(val, showUnit, this.satsDenominated) }, getWalletName: function (walletId) { const wallet = (this.accounts || []).find(wl => wl.id === walletId) diff --git a/lnbits/extensions/watchonly/static/components/fee-rate/fee-rate.js b/lnbits/extensions/watchonly/static/components/fee-rate/fee-rate.js index 62136fb1..be06c00f 100644 --- a/lnbits/extensions/watchonly/static/components/fee-rate/fee-rate.js +++ b/lnbits/extensions/watchonly/static/components/fee-rate/fee-rate.js @@ -4,7 +4,7 @@ async function feeRate(path) { name: 'fee-rate', template, - props: ['rate', 'fee-value', 'sats_denominated'], + props: ['rate', 'fee-value', 'sats-denominated'], computed: { feeRate: { @@ -31,7 +31,7 @@ async function feeRate(path) { methods: { satBtc(val, showUnit = true) { - return satOrBtc(val, showUnit, this['sats_denominated']) + return satOrBtc(val, showUnit, this.satsDenominated) }, refreshRecommendedFees: async function () { diff --git a/lnbits/extensions/watchonly/static/components/history/history.js b/lnbits/extensions/watchonly/static/components/history/history.js index 503169ee..d3146536 100644 --- a/lnbits/extensions/watchonly/static/components/history/history.js +++ b/lnbits/extensions/watchonly/static/components/history/history.js @@ -4,7 +4,7 @@ async function history(path) { name: 'history', template, - props: ['history', 'mempool_endpoint', 'sats_denominated'], + props: ['history', 'mempool_endpoint', 'sats-denominated'], data: function () { return { historyTable: { @@ -73,7 +73,7 @@ async function history(path) { methods: { satBtc(val, showUnit = true) { - return satOrBtc(val, showUnit, this['sats_denominated']) + return satOrBtc(val, showUnit, this.satsDenominated) }, getFilteredAddressesHistory: function () { return this.history.filter(a => (!a.isChange || a.sent) && !a.isSubItem) diff --git a/lnbits/extensions/watchonly/static/components/payment/payment.html b/lnbits/extensions/watchonly/static/components/payment/payment.html index 6a1bf36b..7c7d0354 100644 --- a/lnbits/extensions/watchonly/static/components/payment/payment.html +++ b/lnbits/extensions/watchonly/static/components/payment/payment.html @@ -7,7 +7,7 @@ :fee-rate="feeRate" :tx-size="txSizeNoChange" :selected-amount="selectedAmount" - :sats-denominated="sats_denominated" + :sats-denominated="satsDenominated" @update:outputs="handleOutputsChange" > @@ -79,7 +79,7 @@ :selectable="true" :payed-amount="totalPayedAmount" :mempool_endpoint="mempool_endpoint" - :sats-denominated="sats_denominated" + :sats-denominated="satsDenominated" > @@ -160,7 +160,7 @@ - +
- Check transaction on your hardware device + Check data on your hardware device. +
+
+
+
+
+ Output {{hww.confirm.outputIndex}} +
+
+
+
+ Address: +
+
+ {{tx.outputs[hww.confirm.outputIndex].address}} +
+
+
+
+ Amount: +
+
+ {{satBtc(tx.outputs[hww.confirm.outputIndex].amount)}} +
+
+
+
+ Fee: +
+
+ {{satBtc(tx.feeValue)}} +
+
+
+
+ Fee Rate: +
+
+ {{tx.feeRate}} sats/vbyte +
-
- - - - - Cancel +
+ + + +
+
+ + +
+
+ Cancel +
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 22fc595f..482c5708 100644 --- a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js @@ -28,14 +28,23 @@ async function serialSigner(path) { showSignedPsbt: false, sendingPsbt: false, signingPsbt: false, - psbtSent: false, - psbtSentResolve: null + psbtSentResolve: null, + confirm: { + outputIndex: 0, + showFee: false, + confirmed: false + } }, + tx: null, // todo: move to hww + showConsole: false } }, methods: { + satBtc(val, showUnit = true) { + return satOrBtc(val, showUnit, this.satsDenominated) + }, openSerialPort: async function () { if (!this.checkSerialPortSupported()) return false if (this.selectedPort) return true @@ -219,6 +228,17 @@ async function serialSigner(path) { }) } }, + hwwConfirmNext: async function () { + if (this.hww.confirm.showFee === true) { + this.hww.confirm.confirmed = true + return + } + this.hww.confirm.outputIndex += 1 + if (this.hww.confirm.outputIndex >= this.tx.outputs.length) { + this.hww.confirm.showFee = true + } + await this.writer.write(COMMAND_CONFIRM_NEXT + '\n') + }, hwwLogin: async function () { try { await this.writer.write( @@ -275,8 +295,10 @@ async function serialSigner(path) { }) } }, - hwwSendPsbt: async function (psbtBase64) { + hwwSendPsbt: async function (psbtBase64, tx) { try { + console.log('### hwwSendPsbt tx', tx) + this.tx = tx this.hww.sendingPsbt = true await this.writer.write(COMMAND_SEND_PSBT + ' ' + psbtBase64 + '\n') this.$q.notify({ @@ -295,13 +317,19 @@ async function serialSigner(path) { } }, handleSendPsbtResponse: function (res = '') { - this.hww.psbtSent = true + this.hww.confirm.outputIndex = 0 + this.hww.showConfirmationDialog = true + this.hww.confirm = { + outputIndex: 0, + showFee: false, + confirmed: false + } this.hww.sendingPsbt = false this.psbtSentResolve() }, hwwSignPsbt: async function () { try { - this.hww.psbtSent = false + this.hww.showConfirmationDialog = false this.hww.signingPsbt = true await this.writer.write(COMMAND_SIGN_PSBT + '\n') } catch (error) { diff --git a/lnbits/extensions/watchonly/static/components/utxo-list/utxo-list.js b/lnbits/extensions/watchonly/static/components/utxo-list/utxo-list.js index 95c3af09..f3e7eb4f 100644 --- a/lnbits/extensions/watchonly/static/components/utxo-list/utxo-list.js +++ b/lnbits/extensions/watchonly/static/components/utxo-list/utxo-list.js @@ -9,7 +9,7 @@ async function utxoList(path) { 'accounts', 'selectable', 'payed-amount', - 'sats_denominated', + 'sats-denominated', 'mempool_endpoint' ], @@ -90,7 +90,7 @@ async function utxoList(path) { methods: { satBtc(val, showUnit = true) { - return satOrBtc(val, showUnit, this['sats_denominated']) + return satOrBtc(val, showUnit, this.satsDenominated) }, getWalletName: function (walletId) { const wallet = (this.accounts || []).find(wl => wl.id === walletId) diff --git a/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.js b/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.js index 2184e4fc..8d4fa8e4 100644 --- a/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.js +++ b/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.js @@ -50,7 +50,7 @@ async function walletList(path) { methods: { satBtc(val, showUnit = true) { - return satOrBtc(val, showUnit, this['sats_denominated']) + return satOrBtc(val, showUnit, this.satsDenominated) }, addWalletAccount: async function () { diff --git a/lnbits/extensions/watchonly/static/js/utils.js b/lnbits/extensions/watchonly/static/js/utils.js index 65ac8a0a..d1dfd7f6 100644 --- a/lnbits/extensions/watchonly/static/js/utils.js +++ b/lnbits/extensions/watchonly/static/js/utils.js @@ -7,6 +7,7 @@ const COMMAND_HELP = '/help' const COMMAND_WIPE = '/wipe' const COMMAND_SEED = '/seed' const COMMAND_RESTORE = '/restore' +const COMMAND_CONFIRM_NEXT = '/confirm-next' const DEFAULT_RECEIVE_GAP_LIMIT = 20