Add on chain fee suggestions
This commit is contained in:
parent
902a9bdc42
commit
d338e3889a
1 changed files with 18 additions and 3 deletions
|
|
@ -12,7 +12,7 @@
|
||||||
label="SWAP (LIGHTNING -> BTC)"
|
label="SWAP (LIGHTNING -> BTC)"
|
||||||
unelevated
|
unelevated
|
||||||
color="primary"
|
color="primary"
|
||||||
@click="swapLnToBtc.show = true; swapBtcToLn.show = false"
|
@click="showLnToBtcForm"
|
||||||
>
|
>
|
||||||
<q-tooltip class="bg-grey-8" anchor="bottom left" self="top left">
|
<q-tooltip class="bg-grey-8" anchor="bottom left" self="top left">
|
||||||
Send lightning btc and receive on-chain btc
|
Send lightning btc and receive on-chain btc
|
||||||
|
|
@ -60,7 +60,9 @@
|
||||||
label="On chain fee rate (sats/vbyte)"
|
label="On chain fee rate (sats/vbyte)"
|
||||||
min="1"
|
min="1"
|
||||||
type="number"
|
type="number"
|
||||||
></q-input>
|
:hint="swapLnToBtc.suggested_fees && `Economy Fee - ${swapLnToBtc.suggested_fees?.economyFee} | Half an hour fee - ${swapLnToBtc.suggested_fees?.halfHourFee} | Fastest fee - ${swapLnToBtc.suggested_fees?.fastestFee}`"
|
||||||
|
>
|
||||||
|
</q-input>
|
||||||
<q-btn
|
<q-btn
|
||||||
unelevated
|
unelevated
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
@ -202,8 +204,9 @@
|
||||||
show: false,
|
show: false,
|
||||||
showInvoice: false,
|
showInvoice: false,
|
||||||
data: {
|
data: {
|
||||||
onChainFees: 1
|
on_chain_sats_per_vbyte: 1
|
||||||
},
|
},
|
||||||
|
suggested_fees: null,
|
||||||
response: null,
|
response: null,
|
||||||
invoicePaid: false,
|
invoicePaid: false,
|
||||||
onchainTxId: null
|
onchainTxId: null
|
||||||
|
|
@ -217,6 +220,18 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
showLnToBtcForm() {
|
||||||
|
this.getSuggestedOnChainFees()
|
||||||
|
this.swapLnToBtc.show = true
|
||||||
|
},
|
||||||
|
getSuggestedOnChainFees() {
|
||||||
|
axios
|
||||||
|
.get('https://mempool.space/api/v1/fees/recommended')
|
||||||
|
.then(result => {
|
||||||
|
console.log(result.data)
|
||||||
|
this.swapLnToBtc.suggested_fees = result.data
|
||||||
|
})
|
||||||
|
},
|
||||||
checkIfInvoiceIsPaid() {
|
checkIfInvoiceIsPaid() {
|
||||||
if (this.swapLnToBtc.response && !this.swapLnToBtc.invoicePaid) {
|
if (this.swapLnToBtc.response && !this.swapLnToBtc.invoicePaid) {
|
||||||
var self = this
|
var self = this
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue