mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2024-11-20 10:39:59 +01:00
feat: hide panels after transaction is broadcast
This commit is contained in:
parent
63424d1ca4
commit
f102928812
@ -563,8 +563,6 @@ new Vue({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
broadcastTransaction: async function () {
|
broadcastTransaction: async function () {
|
||||||
console.log('### broadcastTransaction', this.payment.signedTxHex)
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const wallet = this.g.user.wallets[0]
|
const wallet = this.g.user.wallets[0]
|
||||||
const {data} = await LNbits.api.request(
|
const {data} = await LNbits.api.request(
|
||||||
@ -574,12 +572,21 @@ new Vue({
|
|||||||
{tx_hex: this.payment.signedTxHex}
|
{tx_hex: this.payment.signedTxHex}
|
||||||
)
|
)
|
||||||
this.payment.sentTxId = data
|
this.payment.sentTxId = data
|
||||||
|
|
||||||
this.$q.notify({
|
this.$q.notify({
|
||||||
type: 'positive',
|
type: 'positive',
|
||||||
message: 'Transaction broadcasted!',
|
message: 'Transaction broadcasted!',
|
||||||
caption: `${data}`,
|
caption: `${data}`,
|
||||||
timeout: 10000
|
timeout: 10000
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this.hww.psbtSent = false
|
||||||
|
this.payment.psbtBase64Signed = null
|
||||||
|
this.payment.signedTxHex = null
|
||||||
|
this.payment.signedTx = null
|
||||||
|
this.payment.psbtBase64 = null
|
||||||
|
|
||||||
|
await this.scanAddressWithAmount()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.payment.sentTxId = null
|
this.payment.sentTxId = null
|
||||||
this.$q.notify({
|
this.$q.notify({
|
||||||
|
@ -1116,12 +1116,11 @@
|
|||||||
class="q-mb-md"
|
class="q-mb-md"
|
||||||
></q-separator>
|
></q-separator>
|
||||||
<div
|
<div
|
||||||
v-if="payment.psbtBase64 && payment.signMode === 'serial-port'"
|
v-if="serial.selectedPort && payment.psbtBase64 && payment.signMode === 'serial-port'"
|
||||||
class="row items-center no-wrap q-mb-md q-mt-lg"
|
class="row items-center no-wrap q-mb-md q-mt-lg"
|
||||||
>
|
>
|
||||||
<div class="col-3 q-pr-lg">
|
<div class="col-3 q-pr-lg">
|
||||||
<q-btn-dropdown
|
<q-btn-dropdown
|
||||||
v-if="serial.selectedPort"
|
|
||||||
split
|
split
|
||||||
class="btn-full"
|
class="btn-full"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
@ -1224,7 +1223,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<q-toggle
|
<q-toggle
|
||||||
v-if="serial.selectedPort"
|
|
||||||
label="Show Console"
|
label="Show Console"
|
||||||
color="secodary float-left"
|
color="secodary float-left"
|
||||||
v-model="hww.showConsole"
|
v-model="hww.showConsole"
|
||||||
@ -1258,12 +1256,11 @@
|
|||||||
class="q-mb-md"
|
class="q-mb-md"
|
||||||
></q-separator>
|
></q-separator>
|
||||||
<div
|
<div
|
||||||
v-if="hww.authenticated"
|
v-if="hww.authenticated && hww.psbtSent"
|
||||||
class="row items-center no-wrap q-mb-md"
|
class="row items-center no-wrap q-mb-md"
|
||||||
>
|
>
|
||||||
<div class="col-3 q-pr-lg">
|
<div class="col-3 q-pr-lg">
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="hww.psbtSent"
|
|
||||||
@click="hwwSignPsbt()"
|
@click="hwwSignPsbt()"
|
||||||
unelevated
|
unelevated
|
||||||
color="green"
|
color="green"
|
||||||
@ -1273,8 +1270,7 @@
|
|||||||
v-if="hww.signingPsbt == true"
|
v-if="hww.signingPsbt == true"
|
||||||
color="primary"
|
color="primary"
|
||||||
></q-spinner>
|
></q-spinner>
|
||||||
</q-btn
|
</q-btn>
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<q-toggle
|
<q-toggle
|
||||||
@ -1286,7 +1282,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<q-badge
|
<q-badge
|
||||||
v-if="hww.psbtSent"
|
|
||||||
color="yellow"
|
color="yellow"
|
||||||
text-color="black"
|
text-color="black"
|
||||||
multi-line
|
multi-line
|
||||||
@ -1374,6 +1369,9 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<q-separator
|
<q-separator
|
||||||
v-if="payment.sentTxId"
|
v-if="payment.sentTxId"
|
||||||
class="q-mb-lg"
|
class="q-mb-lg"
|
||||||
@ -1382,10 +1380,15 @@
|
|||||||
v-if="payment.sentTxId"
|
v-if="payment.sentTxId"
|
||||||
class="row items-center no-wrap q-mb-sm"
|
class="row items-center no-wrap q-mb-sm"
|
||||||
>
|
>
|
||||||
<div class="col-12">
|
<div class="col-3">Transaction Id</div>
|
||||||
<q-input v-model="payment.sentTxId" filled readonly />
|
<div class="col-9">
|
||||||
</div>
|
<a
|
||||||
</div>
|
style="color: unset"
|
||||||
|
:href="config.data.mempool_endpoint + '/tx/' + payment.sentTxId"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
{{payment.sentTxId}}</a
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
|
@ -320,13 +320,12 @@ async def api_tx_broadcast(
|
|||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Cannot broadcast transaction. Mempool endpoint not defined!"
|
"Cannot broadcast transaction. Mempool endpoint not defined!"
|
||||||
)
|
)
|
||||||
x = bytes.fromhex(data.tx_hex)
|
|
||||||
|
|
||||||
# async with httpx.AsyncClient() as client:
|
async with httpx.AsyncClient() as client:
|
||||||
# r = await client.post(config.mempool_endpoint + "/api/tx", data=data.tx_hex)
|
r = await client.post(config.mempool_endpoint + "/api/tx", data=data.tx_hex)
|
||||||
# tx_id = r.text
|
tx_id = r.text
|
||||||
# return tx_id
|
return tx_id
|
||||||
return "0f0f0f0f0f0f0f0f0f0f0f00f0f0f0f0f0f0f0f0f0f00f0f0f0f0f0f0.mock.transaction.id"
|
# return "0f0f0f0f0f0f0f0f0f0f0f00f0f0f0f0f0f0f0f0f0f00f0f0f0f0f0f0.mock.transaction.id"
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise HTTPException(status_code=HTTPStatus.BAD_REQUEST, detail=str(e))
|
raise HTTPException(status_code=HTTPStatus.BAD_REQUEST, detail=str(e))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user