diff --git a/lnbits/extensions/watchonly/static/components/payment/payment.html b/lnbits/extensions/watchonly/static/components/payment/payment.html
index 7c7d0354..4f291005 100644
--- a/lnbits/extensions/watchonly/static/components/payment/payment.html
+++ b/lnbits/extensions/watchonly/static/components/payment/payment.html
@@ -1,5 +1,5 @@
-
+
-
+
Share PSBT
+
+
+
+
+
+ Close
+
+
+
diff --git a/lnbits/extensions/watchonly/static/components/payment/payment.js b/lnbits/extensions/watchonly/static/components/payment/payment.js
index 02ce538a..be584e37 100644
--- a/lnbits/extensions/watchonly/static/components/payment/payment.js
+++ b/lnbits/extensions/watchonly/static/components/payment/payment.js
@@ -39,6 +39,7 @@ async function payment(path) {
showCoinSelect: false,
showChecking: false,
showChange: false,
+ showPsbt: false,
feeRate: 1
}
},
@@ -103,13 +104,11 @@ async function payment(path) {
await this.serialSignerRef.hwwSendPsbt(this.psbtBase64, txData)
await this.serialSignerRef.isSendingPsbt()
}
-
- console.log('### hwwSendPsbt')
} catch (error) {
- console.error(error)
this.$q.notify({
type: 'warning',
message: 'Cannot check and sign PSBT!',
+ caption: `${error}`,
timeout: 10000
})
} finally {
@@ -117,6 +116,24 @@ async function payment(path) {
this.psbtBase64 = null
}
},
+ showPsbtDialog: async function () {
+ try {
+ const valid = await this.$refs.paymentFormRef.validate()
+ if (!valid) return
+
+ const data = await this.createPsbt()
+ if (data) {
+ this.showPsbt = true
+ }
+ } catch (error) {
+ this.$q.notify({
+ type: 'warning',
+ message: 'Failed to create PSBT!',
+ caption: `${error}`,
+ timeout: 10000
+ })
+ }
+ },
createPsbt: async function () {
try {
console.log('### this.createPsbt')
@@ -136,6 +153,7 @@ async function payment(path) {
)
this.psbtBase64 = data
+ return data
} catch (err) {
LNbits.utils.notifyApiError(err)
}