2022-07-26 20:06:07 +03:00
|
|
|
<div>
|
|
|
|
<q-btn-dropdown
|
|
|
|
split
|
|
|
|
unelevated
|
|
|
|
color="primary"
|
|
|
|
icon="usb"
|
2022-07-27 11:37:29 +03:00
|
|
|
:text-color="selectedPort ? hww.authenticated ? 'green' : 'orange' : 'white'"
|
2022-08-04 10:11:06 +03:00
|
|
|
@click="openSerialPortDialog"
|
2022-07-26 20:06:07 +03:00
|
|
|
>
|
|
|
|
<q-list>
|
|
|
|
<q-item
|
2022-07-27 09:27:51 +03:00
|
|
|
v-if="selectedPort && !hww.authenticated"
|
2022-07-26 20:06:07 +03:00
|
|
|
clickable
|
|
|
|
v-close-popup
|
|
|
|
@click="hwwShowPasswordDialog()"
|
|
|
|
>
|
2022-07-27 09:27:51 +03:00
|
|
|
<q-item-section>
|
2022-07-26 20:06:07 +03:00
|
|
|
<q-item-label>Login</q-item-label>
|
|
|
|
<q-item-label caption
|
|
|
|
>Enter password for Hardware Wallet.</q-item-label
|
|
|
|
>
|
|
|
|
</q-item-section>
|
|
|
|
</q-item>
|
|
|
|
|
|
|
|
<q-item
|
|
|
|
v-if="hww.authenticated"
|
|
|
|
clickable
|
|
|
|
v-close-popup
|
|
|
|
@click="hwwLogout()"
|
|
|
|
>
|
|
|
|
<q-item-section>
|
|
|
|
<q-item-label>Logout</q-item-label>
|
|
|
|
<q-item-label caption>Clear password for HWW.</q-item-label>
|
|
|
|
</q-item-section>
|
|
|
|
</q-item>
|
2022-07-27 15:08:39 +03:00
|
|
|
<q-item
|
|
|
|
v-if="!selectedPort"
|
|
|
|
clickable
|
|
|
|
v-close-popup
|
2022-08-04 10:11:06 +03:00
|
|
|
@click="openSerialPortConfig"
|
2022-07-27 15:08:39 +03:00
|
|
|
>
|
|
|
|
<q-item-section>
|
|
|
|
<q-item-label>Connect</q-item-label>
|
2022-08-04 10:11:06 +03:00
|
|
|
<q-item-label caption
|
|
|
|
>Set the Serial Port communication parameters.</q-item-label
|
|
|
|
>
|
2022-07-27 15:08:39 +03:00
|
|
|
</q-item-section>
|
|
|
|
</q-item>
|
2022-07-27 09:27:51 +03:00
|
|
|
<q-item
|
|
|
|
v-if="selectedPort"
|
|
|
|
clickable
|
|
|
|
v-close-popup
|
|
|
|
@click="closeSerialPort()"
|
|
|
|
>
|
|
|
|
<q-item-section>
|
|
|
|
<q-item-label>Disconnect</q-item-label>
|
|
|
|
<q-item-label caption>Disconnect from Serial Port.</q-item-label>
|
|
|
|
</q-item-section>
|
|
|
|
</q-item>
|
2022-07-26 20:06:07 +03:00
|
|
|
|
|
|
|
<q-item
|
|
|
|
v-if="selectedPort"
|
|
|
|
clickable
|
|
|
|
v-close-popup
|
|
|
|
@click="hwwShowRestoreDialog()"
|
|
|
|
>
|
|
|
|
<q-item-section>
|
|
|
|
<q-item-label>Restore</q-item-label>
|
|
|
|
<q-item-label caption
|
|
|
|
>Restore wallet from existing word list.</q-item-label
|
|
|
|
>
|
|
|
|
</q-item-section>
|
|
|
|
</q-item>
|
|
|
|
<q-item
|
|
|
|
v-if="hww.authenticated"
|
|
|
|
clickable
|
|
|
|
v-close-popup
|
|
|
|
@click="hwwShowSeed()"
|
|
|
|
>
|
|
|
|
<q-item-section>
|
|
|
|
<q-item-label>Show Seed</q-item-label>
|
|
|
|
<q-item-label caption
|
|
|
|
>Show seed on the Hardware Wallet display.</q-item-label
|
|
|
|
>
|
|
|
|
</q-item-section>
|
|
|
|
</q-item>
|
|
|
|
<q-item
|
|
|
|
v-if="selectedPort"
|
|
|
|
@click="hwwShowWipeDialog()"
|
|
|
|
clickable
|
|
|
|
v-close-popup
|
|
|
|
>
|
|
|
|
<q-item-section>
|
|
|
|
<q-item-label>Wipe</q-item-label>
|
|
|
|
<q-item-label caption
|
|
|
|
>Clean-up the wallet. New random seed.</q-item-label
|
|
|
|
>
|
|
|
|
</q-item-section>
|
|
|
|
</q-item>
|
|
|
|
<q-item v-if="selectedPort" @click="hwwHelp()" clickable v-close-popup>
|
|
|
|
<q-item-section>
|
|
|
|
<q-item-label>Help</q-item-label>
|
|
|
|
<q-item-label caption>View available comands.</q-item-label>
|
|
|
|
</q-item-section>
|
|
|
|
</q-item>
|
2022-07-27 12:26:07 +03:00
|
|
|
<q-item
|
|
|
|
v-if="selectedPort"
|
|
|
|
@click="showConsole = true"
|
|
|
|
clickable
|
|
|
|
v-close-popup
|
|
|
|
>
|
2022-07-26 20:06:07 +03:00
|
|
|
<q-item-section>
|
|
|
|
<q-item-label>Console</q-item-label>
|
|
|
|
<q-item-label caption
|
|
|
|
>Show the serial port communication messages</q-item-label
|
|
|
|
>
|
|
|
|
</q-item-section>
|
|
|
|
</q-item>
|
|
|
|
</q-list>
|
|
|
|
</q-btn-dropdown>
|
2022-08-04 10:11:06 +03:00
|
|
|
|
|
|
|
<q-dialog v-model="hww.showConfigDialog" position="top">
|
|
|
|
<q-card class="q-pa-lg q-pt-xl lnbits__dialog-card">
|
|
|
|
<q-form @submit="hwwConfigAndConnect" class="q-gutter-md">
|
|
|
|
<span>Enter Config</span>
|
|
|
|
|
|
|
|
<serial-port-config
|
|
|
|
ref="serialPortConfig"
|
|
|
|
:config="hww.config"
|
|
|
|
></serial-port-config>
|
|
|
|
|
|
|
|
<div class="row q-mt-lg">
|
|
|
|
<q-btn unelevated color="primary" type="submit">Connect</q-btn>
|
|
|
|
<q-btn v-close-popup flat color="grey" class="q-ml-auto"
|
|
|
|
>Cancel</q-btn
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
</q-form>
|
|
|
|
</q-card>
|
|
|
|
</q-dialog>
|
|
|
|
|
2022-07-26 20:06:07 +03:00
|
|
|
<q-dialog v-model="hww.showPasswordDialog" position="top">
|
|
|
|
<q-card class="q-pa-lg q-pt-xl lnbits__dialog-card">
|
|
|
|
<q-form @submit="hwwLogin" class="q-gutter-md">
|
|
|
|
<span>Enter password for Hardware Wallet (8 numbers/letters)</span>
|
|
|
|
<q-input
|
|
|
|
filled
|
|
|
|
dense
|
|
|
|
v-model.trim="hww.password"
|
|
|
|
type="password"
|
|
|
|
label="Password"
|
|
|
|
></q-input>
|
|
|
|
|
|
|
|
<div class="row q-mt-lg">
|
|
|
|
<q-btn
|
|
|
|
unelevated
|
|
|
|
color="primary"
|
|
|
|
:disable="!selectedPort"
|
|
|
|
type="submit"
|
|
|
|
>Login</q-btn
|
|
|
|
>
|
|
|
|
<q-btn v-close-popup flat color="grey" class="q-ml-auto"
|
|
|
|
>Cancel</q-btn
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
</q-form>
|
|
|
|
</q-card>
|
|
|
|
</q-dialog>
|
2022-07-27 11:32:03 +03:00
|
|
|
|
2022-07-28 12:39:06 +03:00
|
|
|
<q-dialog v-model="hww.showConfirmationDialog" position="top">
|
2022-07-27 11:32:03 +03:00
|
|
|
<q-card class="q-pa-lg q-pt-xl lnbits__dialog-card">
|
|
|
|
<q-form @submit="hwwSignPsbt" class="q-gutter-md">
|
2022-07-28 12:39:06 +03:00
|
|
|
<div v-if="tx">
|
|
|
|
<div v-if="!hww.confirm.showFee" class="row q-mt-lg">
|
|
|
|
<div class="col-12">
|
|
|
|
<span class="text-subtitle2"
|
|
|
|
>Output {{hww.confirm.outputIndex}}</span
|
|
|
|
>
|
2022-07-28 17:15:04 +03:00
|
|
|
<q-badge
|
|
|
|
v-if="tx.outputs[hww.confirm.outputIndex].branch_index === 1"
|
|
|
|
color="orange"
|
|
|
|
text-color="black"
|
|
|
|
>
|
|
|
|
<span>change</span>
|
|
|
|
</q-badge>
|
2022-07-28 12:39:06 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="!hww.confirm.showFee" class="row q-mt-lg">
|
|
|
|
<div class="col-3">
|
|
|
|
<span>Address:</span>
|
|
|
|
</div>
|
|
|
|
<div class="col-9">
|
|
|
|
<span>{{tx.outputs[hww.confirm.outputIndex].address}}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="!hww.confirm.showFee" class="row q-mt-lg">
|
|
|
|
<div class="col-3">
|
|
|
|
<span>Amount:</span>
|
|
|
|
</div>
|
|
|
|
<div class="col-9">
|
|
|
|
<span
|
|
|
|
>{{satBtc(tx.outputs[hww.confirm.outputIndex].amount)}}</span
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="hww.confirm.showFee" class="row q-mt-lg">
|
|
|
|
<div class="col-3">
|
|
|
|
<span>Fee: </span>
|
|
|
|
</div>
|
|
|
|
<div class="col-9">
|
|
|
|
<span>{{satBtc(tx.feeValue)}}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-if="hww.confirm.showFee" class="row q-mt-lg">
|
|
|
|
<div class="col-3">
|
|
|
|
<span>Fee Rate:</span>
|
|
|
|
</div>
|
|
|
|
<div class="col-9">
|
|
|
|
<span>{{tx.feeRate}} sats/vbyte</span>
|
|
|
|
</div>
|
2022-07-27 11:32:03 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-07-29 17:22:49 +03:00
|
|
|
<div class="row q-mt-lg">
|
|
|
|
<div class="col-12">
|
|
|
|
<q-badge class="text-subtitle2" color="yellow" text-color="black">
|
|
|
|
<span>Check data on the display of the hardware device.</span>
|
|
|
|
</q-badge>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-07-27 11:32:03 +03:00
|
|
|
<div class="row q-mt-lg">
|
2022-07-28 12:39:06 +03:00
|
|
|
<div class="col-6">
|
|
|
|
<q-btn
|
2022-07-28 17:15:04 +03:00
|
|
|
v-if="hww.confirm.showFee"
|
2022-07-28 12:39:06 +03:00
|
|
|
unelevated
|
|
|
|
color="green"
|
|
|
|
:disable="!selectedPort"
|
|
|
|
type="submit"
|
|
|
|
class="float-left"
|
|
|
|
label="Confirm"
|
|
|
|
>
|
|
|
|
<q-spinner v-if="hww.signingPsbt" color="primary"></q-spinner>
|
|
|
|
</q-btn>
|
|
|
|
</div>
|
|
|
|
<div class="col-3">
|
|
|
|
<q-btn
|
|
|
|
unelevated
|
|
|
|
color="secondary"
|
|
|
|
label="Next"
|
|
|
|
class="float-left"
|
2022-07-28 17:15:04 +03:00
|
|
|
v-if="!hww.confirm.showFee"
|
2022-07-28 12:39:06 +03:00
|
|
|
@click="hwwConfirmNext"
|
|
|
|
>
|
|
|
|
</q-btn>
|
|
|
|
</div>
|
|
|
|
<div class="col-3">
|
2022-07-28 15:02:17 +03:00
|
|
|
<q-btn
|
|
|
|
@click="cancelOperation"
|
|
|
|
v-close-popup
|
|
|
|
flat
|
|
|
|
color="grey"
|
|
|
|
class="float-right"
|
2022-07-28 12:39:06 +03:00
|
|
|
>Cancel</q-btn
|
|
|
|
>
|
|
|
|
</div>
|
2022-07-27 11:32:03 +03:00
|
|
|
</div>
|
|
|
|
</q-form>
|
|
|
|
</q-card>
|
|
|
|
</q-dialog>
|
|
|
|
|
2022-07-26 20:06:07 +03:00
|
|
|
<q-dialog v-model="hww.showWipeDialog" position="top">
|
|
|
|
<q-card class="q-pa-lg q-pt-xl lnbits__dialog-card">
|
|
|
|
<q-form @submit="hwwWipe" class="q-gutter-md">
|
|
|
|
<q-badge color="pink" text-color="black">
|
|
|
|
This action will remove all data from the Hardware Wallet. Please
|
|
|
|
create a back-up for the seed!
|
|
|
|
</q-badge>
|
|
|
|
<span>Enter new password for Hardware Wallet (8 numbers/letters)</span>
|
|
|
|
<q-input
|
|
|
|
filled
|
|
|
|
dense
|
|
|
|
v-model.trim="hww.password"
|
|
|
|
type="password"
|
|
|
|
label="Password"
|
|
|
|
></q-input>
|
2022-08-02 17:02:42 +03:00
|
|
|
|
|
|
|
<q-input
|
|
|
|
filled
|
|
|
|
dense
|
|
|
|
v-model.trim="hww.confirmedPassword"
|
|
|
|
type="password"
|
|
|
|
label="Confirm Password"
|
|
|
|
></q-input>
|
2022-07-26 20:06:07 +03:00
|
|
|
<q-badge color="pink" text-color="black">
|
|
|
|
This action cannot be reversed!
|
|
|
|
</q-badge>
|
|
|
|
|
|
|
|
<div class="row q-mt-lg">
|
|
|
|
<q-btn
|
|
|
|
unelevated
|
|
|
|
color="primary"
|
2022-08-02 17:02:42 +03:00
|
|
|
:disable="!hww.password || hww.password.length < 8 || (hww.password !== hww.confirmedPassword)"
|
2022-07-26 20:06:07 +03:00
|
|
|
type="submit"
|
|
|
|
>Wipe</q-btn
|
|
|
|
>
|
|
|
|
<q-btn v-close-popup flat color="grey" class="q-ml-auto"
|
|
|
|
>Cancel</q-btn
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
</q-form>
|
|
|
|
</q-card>
|
|
|
|
</q-dialog>
|
2022-07-27 12:26:07 +03:00
|
|
|
|
|
|
|
<q-dialog v-model="showConsole" position="top">
|
|
|
|
<q-card class="q-pa-lg q-pt-xl">
|
|
|
|
<q-input
|
|
|
|
filled
|
|
|
|
dense
|
|
|
|
for="serial-port-console"
|
|
|
|
v-model.trim="receivedData"
|
|
|
|
type="textarea"
|
|
|
|
rows="25"
|
|
|
|
cols="200"
|
|
|
|
label="Console"
|
|
|
|
></q-input>
|
|
|
|
|
|
|
|
<div class="row q-mt-lg">
|
|
|
|
<q-btn v-close-popup flat color="grey" class="q-ml-auto">Close</q-btn>
|
|
|
|
</div>
|
|
|
|
</q-card>
|
|
|
|
</q-dialog>
|
|
|
|
|
2022-08-02 16:42:06 +03:00
|
|
|
<q-dialog v-model="hww.showSeedDialog" position="top">
|
|
|
|
<q-card class="q-pa-lg q-pt-xl">
|
|
|
|
<span>Check word at position {{hww.seedWordPosition}} on display</span>
|
|
|
|
|
|
|
|
<div class="row q-mt-lg">
|
|
|
|
<div class="col-4">
|
|
|
|
<q-btn
|
|
|
|
v-if="hww.seedWordPosition!== 1"
|
|
|
|
unelevated
|
|
|
|
color="primary"
|
|
|
|
@click="showPrevSeedWord"
|
|
|
|
>Prev</q-btn
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
<div class="col-4">
|
|
|
|
<q-btn
|
|
|
|
v-if="hww.seedWordPosition!== 24"
|
|
|
|
unelevated
|
|
|
|
color="primary"
|
|
|
|
@click="showNextSeedWord"
|
|
|
|
>Next</q-btn
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
<div class="col-4">
|
|
|
|
<q-btn v-close-popup flat color="grey" class="q-ml-auto">Close</q-btn>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</q-card>
|
|
|
|
</q-dialog>
|
|
|
|
|
2022-07-26 20:06:07 +03:00
|
|
|
<q-dialog v-model="hww.showRestoreDialog" position="top">
|
|
|
|
<q-card class="q-pa-lg q-pt-xl lnbits__dialog-card">
|
|
|
|
<q-form @submit="hwwRestore" class="q-gutter-md">
|
|
|
|
<q-badge
|
|
|
|
color="pink"
|
|
|
|
text-color="black"
|
|
|
|
class="text-subtitle2"
|
|
|
|
multi-line
|
|
|
|
>
|
|
|
|
For test purposes only. Do not enter word list with real funds!!!
|
|
|
|
</q-badge>
|
|
|
|
<br /><br /><br />
|
|
|
|
<span>Enter new word list separated by space</span>
|
|
|
|
<q-input
|
|
|
|
v-model.trim="hww.mnemonic"
|
|
|
|
filled
|
|
|
|
:type="hww.showMnemonic ? 'text' : 'password'"
|
|
|
|
filled
|
|
|
|
dense
|
2022-08-02 17:02:42 +03:00
|
|
|
label="Word List"
|
2022-07-26 20:06:07 +03:00
|
|
|
>
|
|
|
|
<template v-slot:append>
|
|
|
|
<q-icon
|
|
|
|
:name="hww.showMnemonic ? 'visibility' : 'visibility_off'"
|
|
|
|
class="cursor-pointer"
|
|
|
|
@click="hww.showMnemonic = !hww.showMnemonic"
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</q-input>
|
|
|
|
<br />
|
|
|
|
<span>Enter new password (8 numbers/letters)</span>
|
|
|
|
<q-input
|
|
|
|
v-model.trim="hww.password"
|
|
|
|
filled
|
|
|
|
:type="hww.showPassword ? 'text' : 'password'"
|
|
|
|
filled
|
|
|
|
dense
|
2022-08-02 17:02:42 +03:00
|
|
|
label="New Password"
|
2022-07-26 20:06:07 +03:00
|
|
|
>
|
|
|
|
<template v-slot:append>
|
|
|
|
<q-icon
|
|
|
|
:name="hww.showPassword ? 'visibility' : 'visibility_off'"
|
|
|
|
class="cursor-pointer"
|
|
|
|
@click="hww.showPassword = !hww.showPassword"
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</q-input>
|
2022-08-02 17:02:42 +03:00
|
|
|
|
|
|
|
<q-input
|
|
|
|
filled
|
|
|
|
dense
|
|
|
|
v-model.trim="hww.confirmedPassword"
|
|
|
|
type="password"
|
|
|
|
label="Confirm Password"
|
|
|
|
></q-input>
|
2022-07-26 20:06:07 +03:00
|
|
|
<br /><br />
|
|
|
|
<q-badge
|
|
|
|
color="pink"
|
|
|
|
text-color="black"
|
|
|
|
class="text-subtitle2"
|
|
|
|
multi-line
|
|
|
|
>
|
2022-08-02 17:02:42 +03:00
|
|
|
For test purposes only. Do not enter word list with real funds!!!
|
|
|
|
</q-badge>
|
|
|
|
<q-separator></q-separator>
|
|
|
|
<q-badge
|
|
|
|
color="pink"
|
|
|
|
text-color="black"
|
|
|
|
class="text-subtitle2"
|
|
|
|
multi-line
|
|
|
|
>
|
|
|
|
ALL existing data on the Hardware Device will be lost.
|
2022-07-26 20:06:07 +03:00
|
|
|
</q-badge>
|
|
|
|
|
|
|
|
<div class="row q-mt-lg">
|
|
|
|
<q-btn
|
|
|
|
unelevated
|
|
|
|
color="primary"
|
2022-08-02 17:02:42 +03:00
|
|
|
:disable="!hww.mnemonic || !hww.password || hww.password.length < 8 || (hww.password !== hww.confirmedPassword)"
|
2022-07-26 20:06:07 +03:00
|
|
|
type="submit"
|
|
|
|
>Restore</q-btn
|
|
|
|
>
|
|
|
|
<q-btn v-close-popup flat color="grey" class="q-ml-auto"
|
|
|
|
>Cancel</q-btn
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
</q-form>
|
|
|
|
</q-card>
|
|
|
|
</q-dialog>
|
|
|
|
</div>
|