diff --git a/src/components/BalanceView.vue b/src/components/BalanceView.vue index e325bf02..68230c60 100644 --- a/src/components/BalanceView.vue +++ b/src/components/BalanceView.vue @@ -3,7 +3,7 @@ -->
- +
- + {{ formatCurrency( (getTotalBalance / 100 / bitcoinPrice) * 100000000, diff --git a/src/components/P2PKDialog.vue b/src/components/P2PKDialog.vue index 297dc098..5570495d 100644 --- a/src/components/P2PKDialog.vue +++ b/src/components/P2PKDialog.vue @@ -18,31 +18,15 @@
- P2PK Lock
-
- - - - -
Warning: You have already used this lock before.Warning: You have already used this lock before
@@ -50,11 +34,23 @@ caption class="text-weight-light text-white" style="font-size: 14px" - >You can receive ecash locked to this key.Receive ecash locked to this key
+ + + Generate new key
diff --git a/src/components/ReceiveTokenDialog.vue b/src/components/ReceiveTokenDialog.vue index 305278d4..c743506b 100644 --- a/src/components/ReceiveTokenDialog.vue +++ b/src/components/ReceiveTokenDialog.vue @@ -11,6 +11,18 @@
Receive Ecash
+ + + +
+
+ +
+ > + +
Paste + Paste + > + + Scan + Close @@ -97,6 +122,7 @@ import { useTokensStore } from "src/stores/tokens"; import { useCameraStore } from "src/stores/camera"; import { useP2PKStore } from "src/stores/p2pk"; import token from "src/js/token"; +import P2PKDialog from "./P2PKDialog.vue"; import { mapActions, mapState, mapWritableState } from "pinia"; // import ChooseMint from "components/ChooseMint.vue"; @@ -107,10 +133,13 @@ export default defineComponent({ mixins: [windowMixin], components: { TokenInformation, + P2PKDialog, }, props: {}, data: function () { - return {}; + return { + showP2PKDialog: false, + }; }, computed: { ...mapWritableState(useReceiveTokensStore, [ @@ -125,6 +154,7 @@ export default defineComponent({ ]), ...mapWritableState(useMintsStore, ["addMintData", "showAddMintDialog"]), ...mapState(useCameraStore, ["hasCamera"]), + ...mapState(useP2PKStore, ["p2pkKeys"]), canPasteFromClipboard: function () { return ( window.isSecureContext && @@ -144,7 +174,11 @@ export default defineComponent({ ...mapActions(useWalletStore, ["redeem"]), ...mapActions(useCameraStore, ["closeCamera", "showCamera"]), ...mapActions(useTokensStore, ["addPendingToken"]), - ...mapActions(useP2PKStore, ["getPrivateKeyForP2PKEncodedToken"]), + ...mapActions(useP2PKStore, [ + "getPrivateKeyForP2PKEncodedToken", + "generateKeypair", + "showLastKey", + ]), knowThisMintOfTokenJson: function (tokenJson) { const mintStore = useMintsStore(); // check if we have all mints @@ -212,6 +246,13 @@ export default defineComponent({ getMint: function (decoded_token) { return token.getMint(decoded_token); }, + handleLockBtn: function () { + this.showP2PKDialog = !this.showP2PKDialog; + if (!this.p2pkKeys.length || !this.showP2PKDialog) { + this.generateKeypair(); + } + this.showLastKey(); + }, receveIfDecodes: function () { try { const decodedToken = this.decodeToken(this.receiveData.tokensBase64); diff --git a/src/components/ToggleUnit.vue b/src/components/ToggleUnit.vue index 0c66f126..410e2817 100644 --- a/src/components/ToggleUnit.vue +++ b/src/components/ToggleUnit.vue @@ -4,7 +4,7 @@ outline color="primary" @click="toggleUnit()" - :label="activeUnitLabel" + :label="activeUnitLabelAdopted" />