@ozdao/prometheus-framework 0.2.132 → 0.2.134
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/_virtual/alignment-pattern.cjs +1 -0
- package/dist/_virtual/alignment-pattern.js +4 -0
- package/dist/_virtual/browser.cjs +1 -0
- package/dist/_virtual/browser.js +4 -0
- package/dist/_virtual/canvas.cjs +1 -0
- package/dist/_virtual/canvas.js +4 -0
- package/dist/_virtual/dijkstra.cjs +1 -0
- package/dist/_virtual/dijkstra.js +4 -0
- package/dist/_virtual/error-correction-code.cjs +1 -0
- package/dist/_virtual/error-correction-code.js +4 -0
- package/dist/_virtual/error-correction-level.cjs +1 -0
- package/dist/_virtual/error-correction-level.js +4 -0
- package/dist/_virtual/finder-pattern.cjs +1 -0
- package/dist/_virtual/finder-pattern.js +4 -0
- package/dist/_virtual/format-info.cjs +1 -0
- package/dist/_virtual/format-info.js +4 -0
- package/dist/_virtual/galois-field.cjs +1 -0
- package/dist/_virtual/galois-field.js +4 -0
- package/dist/_virtual/mask-pattern.cjs +1 -0
- package/dist/_virtual/mask-pattern.js +4 -0
- package/dist/_virtual/mode.cjs +1 -0
- package/dist/_virtual/mode.js +4 -0
- package/dist/_virtual/polynomial.cjs +1 -0
- package/dist/_virtual/polynomial.js +4 -0
- package/dist/_virtual/qrcode.cjs +1 -0
- package/dist/_virtual/qrcode.js +4 -0
- package/dist/_virtual/regex.cjs +1 -0
- package/dist/_virtual/regex.js +4 -0
- package/dist/_virtual/segments.cjs +1 -0
- package/dist/_virtual/segments.js +4 -0
- package/dist/_virtual/svg-tag.cjs +1 -0
- package/dist/_virtual/svg-tag.js +4 -0
- package/dist/_virtual/utils.cjs +1 -0
- package/dist/_virtual/utils.js +4 -0
- package/dist/_virtual/utils2.cjs +1 -0
- package/dist/_virtual/utils2.js +4 -0
- package/dist/_virtual/version-check.cjs +1 -0
- package/dist/_virtual/version-check.js +4 -0
- package/dist/_virtual/version.cjs +1 -0
- package/dist/_virtual/version.js +4 -0
- package/dist/auth.server.js +1 -1
- package/dist/auth.server.mjs +1 -1
- package/dist/community.server.js +1 -1
- package/dist/community.server.mjs +1 -1
- package/dist/events.server.js +1 -1
- package/dist/events.server.mjs +1 -1
- package/dist/files.server.js +1 -1
- package/dist/files.server.mjs +1 -1
- package/dist/gallery.server.js +1 -1
- package/dist/gallery.server.mjs +1 -1
- package/dist/index-C-8xOJnM.mjs +244 -0
- package/dist/index-CDbtWkBj.js +243 -0
- package/dist/main-5IrI2IOV.js +92 -0
- package/dist/main-BY2OvGB9.mjs +14509 -0
- package/dist/main.css +1 -1
- package/dist/middlewares.server.js +1 -1
- package/dist/middlewares.server.mjs +1 -1
- package/dist/node_modules/dijkstrajs/dijkstra.cjs +1 -0
- package/dist/node_modules/dijkstrajs/dijkstra.js +70 -0
- package/dist/node_modules/encode-utf8/index.cjs +1 -0
- package/dist/node_modules/encode-utf8/index.js +30 -0
- package/dist/node_modules/qrcode/lib/browser.cjs +1 -0
- package/dist/node_modules/qrcode/lib/browser.js +45 -0
- package/dist/node_modules/qrcode/lib/can-promise.cjs +1 -0
- package/dist/node_modules/qrcode/lib/can-promise.js +6 -0
- package/dist/node_modules/qrcode/lib/core/alignment-pattern.cjs +1 -0
- package/dist/node_modules/qrcode/lib/core/alignment-pattern.js +21 -0
- package/dist/node_modules/qrcode/lib/core/alphanumeric-data.cjs +1 -0
- package/dist/node_modules/qrcode/lib/core/alphanumeric-data.js +73 -0
- package/dist/node_modules/qrcode/lib/core/bit-buffer.cjs +1 -0
- package/dist/node_modules/qrcode/lib/core/bit-buffer.js +24 -0
- package/dist/node_modules/qrcode/lib/core/bit-matrix.cjs +1 -0
- package/dist/node_modules/qrcode/lib/core/bit-matrix.js +22 -0
- package/dist/node_modules/qrcode/lib/core/byte-data.cjs +1 -0
- package/dist/node_modules/qrcode/lib/core/byte-data.js +24 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-code.cjs +1 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-code.js +359 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-level.cjs +1 -0
- package/dist/node_modules/qrcode/lib/core/error-correction-level.js +35 -0
- package/dist/node_modules/qrcode/lib/core/finder-pattern.cjs +1 -0
- package/dist/node_modules/qrcode/lib/core/finder-pattern.js +18 -0
- package/dist/node_modules/qrcode/lib/core/format-info.cjs +1 -0
- package/dist/node_modules/qrcode/lib/core/format-info.js +14 -0
- package/dist/node_modules/qrcode/lib/core/galois-field.cjs +1 -0
- package/dist/node_modules/qrcode/lib/core/galois-field.js +22 -0
- package/dist/node_modules/qrcode/lib/core/kanji-data.cjs +2 -0
- package/dist/node_modules/qrcode/lib/core/kanji-data.js +37 -0
- package/dist/node_modules/qrcode/lib/core/mask-pattern.cjs +1 -0
- package/dist/node_modules/qrcode/lib/core/mask-pattern.js +96 -0
- package/dist/node_modules/qrcode/lib/core/mode.cjs +1 -0
- package/dist/node_modules/qrcode/lib/core/mode.js +64 -0
- package/dist/node_modules/qrcode/lib/core/numeric-data.cjs +1 -0
- package/dist/node_modules/qrcode/lib/core/numeric-data.js +26 -0
- package/dist/node_modules/qrcode/lib/core/polynomial.cjs +1 -0
- package/dist/node_modules/qrcode/lib/core/polynomial.js +29 -0
- package/dist/node_modules/qrcode/lib/core/qrcode.cjs +4 -0
- package/dist/node_modules/qrcode/lib/core/qrcode.js +159 -0
- package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.cjs +1 -0
- package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.js +25 -0
- package/dist/node_modules/qrcode/lib/core/regex.cjs +2 -0
- package/dist/node_modules/qrcode/lib/core/regex.js +24 -0
- package/dist/node_modules/qrcode/lib/core/segments.cjs +2 -0
- package/dist/node_modules/qrcode/lib/core/segments.js +143 -0
- package/dist/node_modules/qrcode/lib/core/utils.cjs +1 -0
- package/dist/node_modules/qrcode/lib/core/utils.js +74 -0
- package/dist/node_modules/qrcode/lib/core/version-check.cjs +1 -0
- package/dist/node_modules/qrcode/lib/core/version-check.js +7 -0
- package/dist/node_modules/qrcode/lib/core/version.cjs +1 -0
- package/dist/node_modules/qrcode/lib/core/version.js +74 -0
- package/dist/node_modules/qrcode/lib/renderer/canvas.cjs +1 -0
- package/dist/node_modules/qrcode/lib/renderer/canvas.js +27 -0
- package/dist/node_modules/qrcode/lib/renderer/svg-tag.cjs +2 -0
- package/dist/node_modules/qrcode/lib/renderer/svg-tag.js +28 -0
- package/dist/node_modules/qrcode/lib/renderer/utils.cjs +1 -0
- package/dist/node_modules/qrcode/lib/renderer/utils.js +52 -0
- package/dist/orders.server.js +1 -1
- package/dist/orders.server.mjs +1 -1
- package/dist/organizations.server.js +1 -1
- package/dist/organizations.server.mjs +1 -1
- package/dist/products.server.js +1 -1
- package/dist/products.server.mjs +1 -1
- package/dist/prometheus-framework/src/components/Chips/Chips.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Chips/Chips.vue.js +12 -13
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +14 -15
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +19 -20
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +4 -4
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +77 -0
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +14 -14
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +15 -15
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +11 -11
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +34 -34
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +27 -27
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Blog.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Blog.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +22 -22
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +13 -13
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +9 -9
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +19 -19
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +7 -7
- package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.js +8 -8
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +8 -8
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +4 -4
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +9 -9
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +13 -13
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +17 -17
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +6 -6
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +10 -10
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +17 -17
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +30 -30
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +9 -9
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +7 -7
- package/dist/prometheus-framework/src/modules/wallet/components/blocks/CardDeposite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/blocks/CardDeposite.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/blocks/CryptoDeposite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/blocks/CryptoDeposite.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue.js +34 -0
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +42 -0
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CashDeposit.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CashDeposit.vue.js +26 -0
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +76 -0
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue.js +105 -0
- package/dist/prometheus-framework/src/modules/wallet/views/components/elements/ConnectMetamask.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/wallet/views/components/elements/ConnectMetamask.vue.js +106 -0
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +137 -122
- package/dist/prometheus-framework/src/modules/wallet/views/localization/wallet.json.cjs +1 -0
- package/dist/prometheus-framework/src/modules/wallet/views/localization/wallet.json.js +41 -0
- package/dist/prometheus-framework/src/modules/wallet/views/store/wallet.store.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/store/wallet.store.js +98 -22
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/reports.server.js +1 -1
- package/dist/reports.server.mjs +1 -1
- package/dist/style.css +1 -1
- package/dist/wallet.server.js +103 -13
- package/dist/wallet.server.mjs +103 -13
- package/dist/web-5eyiz9L7.mjs +54 -0
- package/dist/web-C04IcLk4.js +1 -0
- package/package.json +1 -1
- package/src/components/Field/Field.vue +1 -1
- package/src/modules/community/components/pages/Blog.vue +1 -1
- package/src/modules/globals/components/partials/Header.vue +2 -2
- package/src/modules/globals/localization/vue-i18n.js +5 -5
- package/src/modules/landing/components/sections/HowToBuyWDR.vue +2 -3
- package/src/modules/landing/components/sections/SectionEarn.vue +1 -6
- package/src/modules/middlewares/server/authSecret.js +22 -0
- package/src/modules/middlewares/server/index.js +7 -5
- package/src/modules/wallet/controllers/factories/rewards.factory.js +87 -2
- package/src/modules/wallet/controllers/routes/rewards.routes.js +27 -3
- package/src/modules/wallet/models/wallet.model.js +5 -5
- package/src/modules/wallet/{components → views/components}/blocks/CardBalanceReplenished.vue +17 -7
- package/src/modules/wallet/{components/blocks/CardDeposite.vue → views/components/blocks/CardDeposit.vue} +4 -4
- package/src/modules/wallet/views/components/blocks/CryptoDeposit.vue +98 -0
- package/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue +144 -0
- package/src/modules/wallet/views/components/elements/ConnectMetamask.vue +131 -0
- package/src/modules/wallet/views/components/pages/Wallet.vue +95 -68
- package/src/modules/wallet/views/localization/wallet.json +37 -0
- package/src/modules/wallet/views/store/wallet.store.js +145 -28
- package/src/modules/wallet/wallet.server.js +2 -2
- package/src/modules/wallet/components/blocks/CryptoDeposite.vue +0 -55
- package/src/modules/wallet/controllers/factories/rewards.factory.aggr.js +0 -181
- package/src/modules/wallet/controllers/factories/rewards.factory.population.js +0 -213
- package/src/modules/wallet/localization/Wallet.json +0 -22
- /package/src/modules/wallet/{components/blocks/CashDeposite.vue → views/components/blocks/CashDeposit.vue} +0 -0
@@ -0,0 +1,98 @@
|
|
1
|
+
<template>
|
2
|
+
<h3 class="mn-b-small t-center t-bold">{{ t('wallet.depositWithCrypto') }}</h3>
|
3
|
+
|
4
|
+
<Field
|
5
|
+
v-if="state.config"
|
6
|
+
v-model:field="amount"
|
7
|
+
:placeholder="t('wallet.enterAmount')"
|
8
|
+
class="mn-b-thin bg-white w-100 br-solid br-1px br-black-transp-5 pd-small radius-small"
|
9
|
+
>
|
10
|
+
<Select
|
11
|
+
:options="depositOptions"
|
12
|
+
v-model:select="state.chosenNetwork"
|
13
|
+
class="bg-light t-nowrap pd-r-thin pd-l-thin pd-t-nano pd-b-nano radius-thin"
|
14
|
+
/>
|
15
|
+
</Field>
|
16
|
+
|
17
|
+
<p class="t-semi">You will receive: {{ receiveAmount }} {{t('wallet.token')}}</p>
|
18
|
+
|
19
|
+
<button
|
20
|
+
class="uppercase w-100 bg-main t-black pd-thin radius-medium t-center br-solid br-2px br-black-transp-10 mn-t-small"
|
21
|
+
@click="actions.requestCryptoDeposit(amount).then(() => switchMenu(5))"
|
22
|
+
:disabled="state.depositRequestIsActive || !state.config"
|
23
|
+
>
|
24
|
+
{{ t('wallet.pay') }}
|
25
|
+
</button>
|
26
|
+
|
27
|
+
<button
|
28
|
+
class="uppercase w-100 t-center mn-t-small"
|
29
|
+
@click="backSelection"
|
30
|
+
>
|
31
|
+
{{ t('wallet.backToSelection') }}
|
32
|
+
</button>
|
33
|
+
</template>
|
34
|
+
|
35
|
+
<script setup>
|
36
|
+
import { useI18n } from 'vue-i18n'
|
37
|
+
import { ref, onMounted, computed } from 'vue';
|
38
|
+
import { BigNumber } from 'bignumber.js';
|
39
|
+
|
40
|
+
import { state, actions } from '@pf/src/modules/wallet/views/store/wallet.store';
|
41
|
+
import text from '@pf/src/modules/wallet/views/localization/wallet.json'
|
42
|
+
import Field from '@pf/src/components/Field/Field.vue'
|
43
|
+
import Select from '@pf/src/components/Select/Select.vue'
|
44
|
+
|
45
|
+
BigNumber.config({
|
46
|
+
EXPONENTIAL_AT: [-1000, 20000]
|
47
|
+
});
|
48
|
+
|
49
|
+
const amount = ref(1);
|
50
|
+
const emits = defineEmits(['back-selection', 'switch-menu'])
|
51
|
+
|
52
|
+
// Localization
|
53
|
+
const { t } = useI18n({
|
54
|
+
useScope: 'global',
|
55
|
+
...text
|
56
|
+
})
|
57
|
+
|
58
|
+
const receiveAmount = computed(() =>
|
59
|
+
new BigNumber(amount.value)
|
60
|
+
.dividedBy(process.env.TOKEN_EXCHANGE_RATE)
|
61
|
+
.toString()
|
62
|
+
)
|
63
|
+
|
64
|
+
const depositOptions = computed(() => {
|
65
|
+
const options = [];
|
66
|
+
|
67
|
+
const networks = Object.keys(state.config || {});
|
68
|
+
|
69
|
+
for (const network of networks) {
|
70
|
+
for (const token of Object.keys(state.config[network].tokens)) {
|
71
|
+
options.push({
|
72
|
+
name: `${network}-${token}`,
|
73
|
+
value: {
|
74
|
+
token: state.config[network].tokens[token],
|
75
|
+
network: network
|
76
|
+
}
|
77
|
+
});
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
return options;
|
82
|
+
});
|
83
|
+
|
84
|
+
onMounted(() => {
|
85
|
+
actions.loadConfig();
|
86
|
+
})
|
87
|
+
|
88
|
+
function backSelection() {
|
89
|
+
emits("back-selection")
|
90
|
+
}
|
91
|
+
|
92
|
+
function switchMenu(screen = 0) {
|
93
|
+
emits("switch-menu", screen)
|
94
|
+
}
|
95
|
+
</script>
|
96
|
+
|
97
|
+
<style scoped>
|
98
|
+
</style>
|
@@ -0,0 +1,144 @@
|
|
1
|
+
<template>
|
2
|
+
<h2 class="mn-b-small t-center t-bold">{{ t('wallet.depositWithCrypto') }}</h2>
|
3
|
+
|
4
|
+
<div class="flex flex-justify-between">
|
5
|
+
<h3 class="t-semi">Amount: {{ amount }} {{ state.chosenNetwork.name.toUpperCase() }}</h3>
|
6
|
+
<button
|
7
|
+
class="uppercase t-main cursor-pointer"
|
8
|
+
@click="() => copy(amount)"
|
9
|
+
>
|
10
|
+
copy
|
11
|
+
</button>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<div class="flex flex-justify-between">
|
15
|
+
<h3 class="t-semi t-truncate address">Wallet: {{ state.depositInfo.to }}</h3>
|
16
|
+
<button
|
17
|
+
class="uppercase t-main cursor-pointer"
|
18
|
+
@click="() => copy(state.depositInfo.to)"
|
19
|
+
>
|
20
|
+
copy
|
21
|
+
</button>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div class="flex flex-justify-around radius-big br-solid br-2px br-black-transp-10">
|
25
|
+
<canvas id="qrcode_address_deposit"></canvas>
|
26
|
+
</div>
|
27
|
+
|
28
|
+
<div class="flex flex-justify-between">
|
29
|
+
<h3 class="t-semi">You will receive:</h3>
|
30
|
+
<h3 class="t-semi">{{ receive }} WDT</h3>
|
31
|
+
</div>
|
32
|
+
<div v-if="state.depositInfo.status === 'TRANSFER_STATUS_WAITING_FOR_TX'" class="flex flex-justify-between">
|
33
|
+
<h3 class="t-semi">Times left:</h3>
|
34
|
+
<h3 class="t-semi">{{ remainingTime }}</h3>
|
35
|
+
</div>
|
36
|
+
<div class="flex flex-justify-between">
|
37
|
+
<h3 class="t-semi">Status:</h3>
|
38
|
+
<h3 class="t-semi">{{ status }}</h3>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<button
|
42
|
+
v-if="state.depositInfo.status === 'TRANSFER_STATUS_WAITING_FOR_TX'"
|
43
|
+
class="uppercase w-100 bg-main t-black pd-thin radius-medium t-center br-solid br-2px br-black-transp-10 mn-t-small"
|
44
|
+
@click="actions.cancelDeposit().then(() => backSelection())"
|
45
|
+
>
|
46
|
+
{{ t('wallet.cancel') }}
|
47
|
+
</button>
|
48
|
+
</template>
|
49
|
+
|
50
|
+
<script setup>
|
51
|
+
import QRCode from 'qrcode';
|
52
|
+
import { useI18n } from 'vue-i18n';
|
53
|
+
import { watch, computed, onMounted } from 'vue';
|
54
|
+
import { BigNumber } from 'bignumber.js';
|
55
|
+
|
56
|
+
import text from '@pf/src/modules/wallet/views/localization/wallet.json';
|
57
|
+
import { state, actions, timer } from '@pf/src/modules/wallet/views/store/wallet.store';
|
58
|
+
|
59
|
+
BigNumber.config({
|
60
|
+
EXPONENTIAL_AT: [-1000, 20000]
|
61
|
+
});
|
62
|
+
|
63
|
+
const emits = defineEmits(['back-selection', 'switch-menu']);
|
64
|
+
|
65
|
+
// Localization
|
66
|
+
const { t } = useI18n({
|
67
|
+
useScope: 'global',
|
68
|
+
...text
|
69
|
+
});
|
70
|
+
|
71
|
+
const remainingTime = computed(() => {
|
72
|
+
const mins = Math.floor(timer.remaining / 60);
|
73
|
+
const secs = Math.floor(timer.remaining % 60);
|
74
|
+
|
75
|
+
return `${mins}:${secs < 10 ? `0${secs}` : secs}`;
|
76
|
+
});
|
77
|
+
|
78
|
+
const amount = computed(() =>
|
79
|
+
new BigNumber(state.depositInfo.amount)
|
80
|
+
.shiftedBy(-8)
|
81
|
+
.toString()
|
82
|
+
);
|
83
|
+
|
84
|
+
const receive = computed(() =>
|
85
|
+
new BigNumber(amount.value)
|
86
|
+
.dividedBy(process.env.TOKEN_EXCHANGE_RATE)
|
87
|
+
.toString()
|
88
|
+
)
|
89
|
+
|
90
|
+
const status = computed(() => {
|
91
|
+
switch (state.depositInfo.status) {
|
92
|
+
case 'TRANSFER_STATUS_WAITING_FOR_TX':
|
93
|
+
return 'Waiting for payment';
|
94
|
+
case 'TRANSFER_STATUS_SENT':
|
95
|
+
const confirmations = `${state.depositInfo.confirmations || 0} / ${state.config[state.chosenNetwork.value.network].confirmations}`;
|
96
|
+
return `Confirming (${confirmations})`;
|
97
|
+
default:
|
98
|
+
return 'Superposition.';
|
99
|
+
}
|
100
|
+
});
|
101
|
+
|
102
|
+
function backSelection() {
|
103
|
+
emits("back-selection");
|
104
|
+
}
|
105
|
+
|
106
|
+
function switchMenu(screen = 0) {
|
107
|
+
emits("switch-menu", screen);
|
108
|
+
}
|
109
|
+
|
110
|
+
function copy(text) {
|
111
|
+
navigator.clipboard.writeText(text);
|
112
|
+
}
|
113
|
+
|
114
|
+
onMounted(() => {
|
115
|
+
QRCode.toCanvas(
|
116
|
+
document.getElementById('qrcode_address_deposit'),
|
117
|
+
state.depositInfo.to,
|
118
|
+
{ width: 300 },
|
119
|
+
(error) => { if (error) { console.error(error); } }
|
120
|
+
)
|
121
|
+
})
|
122
|
+
|
123
|
+
watch(
|
124
|
+
state,
|
125
|
+
async () => {
|
126
|
+
if (state.depositInfo.status === 'TRANSFER_STATUS_SENT') {
|
127
|
+
actions.stopTimer();
|
128
|
+
}
|
129
|
+
|
130
|
+
if (state.depositInfo.status === 'TRANSFER_STATUS_COMPLETED') {
|
131
|
+
actions.disconnectWebSocket();
|
132
|
+
switchMenu(3);
|
133
|
+
}
|
134
|
+
},
|
135
|
+
{ deep: true },
|
136
|
+
)
|
137
|
+
</script>
|
138
|
+
|
139
|
+
<style scoped>
|
140
|
+
.address {
|
141
|
+
text-wrap: nowrap;
|
142
|
+
display: block;
|
143
|
+
}
|
144
|
+
</style>
|
@@ -0,0 +1,131 @@
|
|
1
|
+
<template>
|
2
|
+
<div>
|
3
|
+
<!-- Connect Metamask -->
|
4
|
+
<button
|
5
|
+
v-if="!isMetaMaskInstalled"
|
6
|
+
@click="connectMetaMask"
|
7
|
+
class="transition-ease-in-out cursor-pointer bg-black radius-big flex-v-center flex-nowrap flex t-left uppercase w-100 pd-small t-white"
|
8
|
+
>
|
9
|
+
<img :src="'/icons/metamask.svg'" class="mn-r-small i-big" >
|
10
|
+
<span class="h4 uppercase w-100">{{ t('wallet.connectMetaMask') }}</span>
|
11
|
+
<IconAdd class="t-transp" fill="rgb(var(--white))"/>
|
12
|
+
</button>
|
13
|
+
|
14
|
+
<template v-else>
|
15
|
+
<!-- Switch to Polygon -->
|
16
|
+
<button
|
17
|
+
v-if="!isPolygon"
|
18
|
+
@click="switchToPolygon"
|
19
|
+
class="transition-ease-in-out cursor-pointer hover-bg-white hover-t-black bg-black t-white radius-big flex-v-center flex-nowrap flex t-left uppercase w-100 pd-small "
|
20
|
+
>
|
21
|
+
<img :src="'/icons/metamask.svg'" class="mn-r-small i-big" >
|
22
|
+
<span class="h4 uppercase w-100">{{ t('wallet.switchToPolygon') }}</span>
|
23
|
+
<IconAdd class="t-transp" fill="rgb(var(--white))" />
|
24
|
+
</button>
|
25
|
+
<!-- Add WDT to metamask -->
|
26
|
+
<button
|
27
|
+
v-if="isPolygon"
|
28
|
+
@click="addWDT"
|
29
|
+
class="transition-ease-in-out cursor-pointer hover-bg-white hover-t-black bg-black radius-big flex-v-center flex-nowrap flex t-left uppercase w-100 pd-small t-white"
|
30
|
+
>
|
31
|
+
<img :src="'/icons/metamask.svg'" class="mn-r-small i-big" >
|
32
|
+
<span class="h4 uppercase w-100">{{ t('wallet.addToken') }}</span>
|
33
|
+
<IconAdd class="hover-fill-black fill-white t-transp"/>
|
34
|
+
</button>
|
35
|
+
</template>
|
36
|
+
|
37
|
+
<!-- <p class="mn-t-small" v-if="error">{{ error }}</p> -->
|
38
|
+
|
39
|
+
</div>
|
40
|
+
</template>
|
41
|
+
|
42
|
+
<script setup>
|
43
|
+
import { ref, onMounted, computed } from 'vue';
|
44
|
+
import { useI18n } from 'vue-i18n';
|
45
|
+
|
46
|
+
import text from '@pf/src/modules/wallet/views/localization/wallet.json'
|
47
|
+
|
48
|
+
import IconAdd from '@pf/src/modules/icons/navigation/IconAdd.vue'
|
49
|
+
|
50
|
+
const isMetaMaskInstalled = ref(false);
|
51
|
+
const isPolygon = ref(false);
|
52
|
+
const loading = ref(false);
|
53
|
+
const error = ref(null);
|
54
|
+
const buttonStyle = ref({});
|
55
|
+
|
56
|
+
const tokenAddress = '0xE11702CF04621D395E75680C29d3dbF81484e875';
|
57
|
+
const tokenSymbol = 'WDT';
|
58
|
+
const tokenDecimals = 8;
|
59
|
+
const tokenImage = 'https://weeder.delivery/logo-token.png';
|
60
|
+
|
61
|
+
const connectMetaMask = async () => {
|
62
|
+
if (typeof window.ethereum !== 'undefined') {
|
63
|
+
try {
|
64
|
+
await window.ethereum.request({ method: 'eth_requestAccounts' });
|
65
|
+
checkMetaMask();
|
66
|
+
} catch (error) {
|
67
|
+
console.error('Ошибка при подключении MetaMask:', error);
|
68
|
+
}
|
69
|
+
} else {
|
70
|
+
window.open('https://metamask.io/', '_blank');
|
71
|
+
}
|
72
|
+
};
|
73
|
+
|
74
|
+
const checkMetaMask = async () => {
|
75
|
+
if (typeof window.ethereum !== 'undefined') {
|
76
|
+
isMetaMaskInstalled.value = true;
|
77
|
+
const chainId = await window.ethereum.request({ method: 'eth_chainId' });
|
78
|
+
isPolygon.value = chainId === '0x89' || chainId === '0x13881';
|
79
|
+
} else {
|
80
|
+
isMetaMaskInstalled.value = false;
|
81
|
+
}
|
82
|
+
};
|
83
|
+
|
84
|
+
const switchToPolygon = async () => {
|
85
|
+
try {
|
86
|
+
await window.ethereum.request({
|
87
|
+
method: 'wallet_switchEthereumChain',
|
88
|
+
params: [{ chainId: '0x89' }],
|
89
|
+
});
|
90
|
+
checkMetaMask();
|
91
|
+
} catch (error) {
|
92
|
+
console.error('Ошибка при переключении на Polygon:', error);
|
93
|
+
}
|
94
|
+
};
|
95
|
+
|
96
|
+
const addWDT = async () => {
|
97
|
+
buttonStyle.value['pointer-events'] = 'none';
|
98
|
+
error.value = null;
|
99
|
+
loading.value = true;
|
100
|
+
|
101
|
+
try {
|
102
|
+
await ethereum.request({
|
103
|
+
method: 'wallet_watchAsset',
|
104
|
+
params: {
|
105
|
+
type: 'ERC20',
|
106
|
+
options: {
|
107
|
+
address: tokenAddress,
|
108
|
+
symbol: tokenSymbol,
|
109
|
+
decimals: tokenDecimals,
|
110
|
+
image: tokenImage,
|
111
|
+
},
|
112
|
+
},
|
113
|
+
});
|
114
|
+
|
115
|
+
buttonStyle.value['background-color'] = '#009911';
|
116
|
+
loading.value = false;
|
117
|
+
} catch (err) {
|
118
|
+
error.value = err.toString();
|
119
|
+
}
|
120
|
+
};
|
121
|
+
|
122
|
+
const { t } = useI18n({
|
123
|
+
useScope: 'global',
|
124
|
+
...text
|
125
|
+
})
|
126
|
+
|
127
|
+
onMounted(() => {
|
128
|
+
checkMetaMask();
|
129
|
+
});
|
130
|
+
|
131
|
+
</script>
|
@@ -1,11 +1,10 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
|
2
|
+
<div class="pd-thin">
|
4
3
|
<section class="bg-black t-white mn-b-thin radius-big pd-big">
|
5
|
-
<h1 class="mn-b-medium
|
4
|
+
<h1 class="mn-b-medium">{{ t('wallet.title') }}</h1>
|
6
5
|
|
7
6
|
<p class="mn-b-semi t-transp p-big">
|
8
|
-
|
7
|
+
{{ t('wallet.subtitle') }}
|
9
8
|
</p>
|
10
9
|
|
11
10
|
<div
|
@@ -14,13 +13,22 @@
|
|
14
13
|
>
|
15
14
|
<div class="flex-v-center flex-nowrap flex mn-r-auto">
|
16
15
|
<!-- <img src="/logo/wdt.svg" class="mn-r-thin i-big"> -->
|
17
|
-
<h2>{{state.tokenBalance}}
|
16
|
+
<h2>{{state.tokenBalance}} {{ t('wallet.token') }}</h2>
|
18
17
|
</div>
|
19
18
|
|
20
|
-
<button @click="openGetMorePopup" class="w-max bg-main t-medium button">Get More</button>
|
21
|
-
|
19
|
+
<button @click="openGetMorePopup" class="t-nowrap w-max bg-main t-medium button">Get More</button>
|
20
|
+
|
21
|
+
|
22
|
+
<Button
|
23
|
+
:submit="actions.collectRewards"
|
24
|
+
class="w-max bg-white t-black t-medium button"
|
25
|
+
>
|
26
|
+
Withdraw
|
27
|
+
</Button>
|
22
28
|
</div>
|
23
29
|
|
30
|
+
<ConnectMetamask class="mn-b-thin radius-extra br-solid br-white-transp-10 br-1px w-100" />
|
31
|
+
|
24
32
|
<div
|
25
33
|
v-if="state.account"
|
26
34
|
class="w-100 mn-b-semi flex-column flex pd-big radius-big bg-main t-black"
|
@@ -123,77 +131,96 @@
|
|
123
131
|
</div>
|
124
132
|
</div>
|
125
133
|
</section>
|
126
|
-
</section>
|
127
|
-
|
128
|
-
<Popup
|
129
|
-
title="Добавить участника"
|
130
|
-
@close-popup="closeGetMorePopup"
|
131
|
-
:isPopupOpen="isGetMorePopup"
|
132
|
-
class="w-m-33r t-left pd-big bg-white radius-big"
|
133
|
-
>
|
134
|
-
<div
|
135
|
-
v-if="currentMenuPopup === 0"
|
136
|
-
>
|
137
|
-
<h2 class="mn-b-small t-center t-bold">Choose the way of deposit</h2>
|
138
134
|
|
139
|
-
|
140
|
-
|
141
|
-
|
135
|
+
<Popup
|
136
|
+
@close-popup="closeGetMorePopup"
|
137
|
+
:isPopupOpen="isGetMorePopup"
|
138
|
+
class="w-m-50r t-left pd-big bg-white radius-big"
|
139
|
+
>
|
140
|
+
<div
|
141
|
+
v-if="currentMenuPopup === 0"
|
142
142
|
>
|
143
|
-
|
144
|
-
</button>
|
143
|
+
<h2 class="mn-b-small t-center t-bold">Choose the way of deposit</h2>
|
145
144
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
145
|
+
<button
|
146
|
+
class="w-100 bg-white t-black pd-thin radius-medium h3 t-center br-solid br-2px br-black-transp-10 mn-t-small"
|
147
|
+
@click="switchGetMoreMenu(1)"
|
148
|
+
>
|
149
|
+
CASH
|
150
|
+
</button>
|
152
151
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
152
|
+
<button
|
153
|
+
class="w-100 bg-white t-black pd-thin radius-medium h3 t-center br-solid br-2px br-black-transp-10 mn-t-small"
|
154
|
+
@click="switchGetMoreMenu(2)"
|
155
|
+
>
|
156
|
+
CARD
|
157
|
+
</button>
|
158
|
+
|
159
|
+
<button
|
160
|
+
class="w-100 bg-white t-black pd-thin radius-medium h3 t-center br-solid br-2px br-black-transp-10 mn-t-small"
|
161
|
+
@click="switchGetMoreMenu(4)"
|
162
|
+
>
|
163
|
+
CRYPTO
|
164
|
+
</button>
|
165
|
+
</div>
|
160
166
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
167
|
+
<CashDepositMenu
|
168
|
+
v-if="currentMenuPopup === 1"
|
169
|
+
@back-selection="switchGetMoreMenu(0)"
|
170
|
+
/>
|
171
|
+
|
172
|
+
<CardDepositMenu
|
173
|
+
v-if="currentMenuPopup === 2"
|
174
|
+
@back-selection="switchGetMoreMenu(0)"
|
175
|
+
@switch-menu="switchGetMoreMenu"
|
176
|
+
/>
|
177
|
+
|
178
|
+
<CardBalanceReplenished
|
179
|
+
v-if="currentMenuPopup === 3"
|
180
|
+
@close="closeGetMorePopup"
|
181
|
+
/>
|
182
|
+
|
183
|
+
<CryptoDepositMenu
|
184
|
+
v-if="currentMenuPopup === 4"
|
185
|
+
@back-selection="switchGetMoreMenu(0)"
|
186
|
+
@switch-menu="switchGetMoreMenu"
|
187
|
+
/>
|
188
|
+
|
189
|
+
<CryptoDepositProcessing
|
190
|
+
v-if="currentMenuPopup === 5"
|
191
|
+
@back-selection="switchGetMoreMenu(0)"
|
192
|
+
@switch-menu="switchGetMoreMenu"
|
193
|
+
/>
|
194
|
+
</Popup>
|
195
|
+
</div>
|
183
196
|
</template>
|
184
197
|
|
185
198
|
<script setup>
|
186
199
|
import { onMounted, ref } from 'vue';
|
200
|
+
import { useI18n } from 'vue-i18n'
|
201
|
+
import Web3 from "web3";
|
202
|
+
|
187
203
|
import { state, actions } from '@pf/src/modules/wallet/views/store/wallet.store';
|
188
204
|
|
189
|
-
import
|
205
|
+
import text from '@pf/src/modules/wallet/views/localization/wallet.json'
|
206
|
+
|
207
|
+
const { t } = useI18n({
|
208
|
+
useScope: 'global',
|
209
|
+
...text
|
210
|
+
})
|
211
|
+
|
212
|
+
import Popup from '@pf/src/components/Popup/Popup.vue';
|
213
|
+
import Button from '@pf/src/components/Button/Button.vue';
|
214
|
+
|
215
|
+
import CardBlogpost from '@pf/src/modules/community/components/blocks/CardBlogpost.vue';
|
216
|
+
|
217
|
+
import ConnectMetamask from '@pf/src/modules/wallet/views/components/elements/ConnectMetamask.vue';
|
190
218
|
|
191
|
-
import
|
192
|
-
import
|
193
|
-
import
|
194
|
-
import
|
195
|
-
import
|
196
|
-
import CardBalanceReplenished from '@pf/src/modules/wallet/components/blocks/CardBalanceReplenished.vue'
|
219
|
+
import CashDepositMenu from '@pf/src/modules/wallet/views/components/blocks/CashDeposit.vue';
|
220
|
+
import CardDepositMenu from '@pf/src/modules/wallet/views/components/blocks/CardDeposit.vue';
|
221
|
+
import CryptoDepositMenu from '@pf/src/modules/wallet/views/components/blocks/CryptoDeposit.vue';
|
222
|
+
import CardBalanceReplenished from '@pf/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue';
|
223
|
+
import CryptoDepositProcessing from '@pf/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue';
|
197
224
|
|
198
225
|
// User has disconnected metamask from extension
|
199
226
|
window.ethereum.on('accountsChanged', (accounts) => {
|
@@ -205,8 +232,6 @@
|
|
205
232
|
state.web3 = new Web3(window.ethereum || 'http://localhost:8080');
|
206
233
|
|
207
234
|
onMounted(() => {
|
208
|
-
// Load list with the latest rewards and try to reconnect metamask,
|
209
|
-
// if a user is already connected to it before
|
210
235
|
actions.listRewards();
|
211
236
|
actions.tryReconnectWallet();
|
212
237
|
});
|
@@ -227,5 +252,7 @@
|
|
227
252
|
function closeGetMorePopup() {
|
228
253
|
isGetMorePopup.value = false;
|
229
254
|
currentMenuPopup.value = 0;
|
255
|
+
actions.stopTimer();
|
256
|
+
actions.disconnectWebSocket();
|
230
257
|
}
|
231
258
|
</script>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
{
|
2
|
+
"messages": {
|
3
|
+
"en-default": {
|
4
|
+
"wallet": {
|
5
|
+
"title": "Your Wallet",
|
6
|
+
"subtitle": "Earn WDT by purchasing our weed or contributing to the community.",
|
7
|
+
"token": "WDT",
|
8
|
+
"connectMetaMask": "Connect MetaMask",
|
9
|
+
"switchToPolygon": "Switch to Polygon",
|
10
|
+
"addToken": "Add WDT to MetaMask",
|
11
|
+
"pay": "pay",
|
12
|
+
"youReceived": "you received",
|
13
|
+
"enterAmount": "enter amount to top up",
|
14
|
+
"backToWallet": "back to wallet",
|
15
|
+
"backToSelection": "back to selection",
|
16
|
+
"balanceReplenished": "balance replenished",
|
17
|
+
"depositWithCrypto": "deposit with crypto"
|
18
|
+
}
|
19
|
+
},
|
20
|
+
"ru-default": {
|
21
|
+
"wallet": {
|
22
|
+
"title": "Ваш Кошелек",
|
23
|
+
"subtitle": "Зарабатывайте WDT, покупая товары или внося вклад в сообщество.",
|
24
|
+
"connectMetaMask": "Подключить MetaMask",
|
25
|
+
"switchToPolygon": "Переподключиться на Polygon",
|
26
|
+
"addToken": "Добавить WDT в Metamask",
|
27
|
+
"pay": "купить",
|
28
|
+
"youReceived": "вы пополнили на сумму",
|
29
|
+
"enterAmount": "введите сумму для пополнения",
|
30
|
+
"backToWallet": "назад к кошельку",
|
31
|
+
"backToSelection": "назад к списку",
|
32
|
+
"balanceReplenished": "баланс пополнен",
|
33
|
+
"depositWithCrypto": "пополнение криптовалютой"
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|