@ozdao/prometheus-framework 0.2.133 → 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/Feed/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +1 -1
- 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.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +5 -5
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +16 -16
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +16 -16
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +13 -13
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +36 -36
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +29 -29
- package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.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 +3 -3
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +23 -23
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +14 -14
- package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +12 -12
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +21 -21
- package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +5 -5
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +7 -7
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
- 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 +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +4 -4
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +5 -5
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +8 -8
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +4 -4
- 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/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +8 -8
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +12 -12
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +16 -16
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +6 -6
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +19 -19
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +7 -7
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +13 -13
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +18 -18
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +32 -32
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +10 -10
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +5 -5
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +1 -1
- 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 +3 -3
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +9 -9
- 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 +140 -125
- 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,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
|
+
}
|
@@ -2,6 +2,8 @@ import axios from 'axios';
|
|
2
2
|
import { reactive } from 'vue';
|
3
3
|
import { BigNumber } from 'bignumber.js';
|
4
4
|
|
5
|
+
import { setError } from "@pf/src/modules/globals/store/globals";
|
6
|
+
|
5
7
|
const API_CRYPTO_PATH = '/api/crypto';
|
6
8
|
const WDT_SUPPLY = 20_000_000;
|
7
9
|
|
@@ -13,46 +15,161 @@ const state = reactive({
|
|
13
15
|
share: '0',
|
14
16
|
account: null,
|
15
17
|
web3: null,
|
18
|
+
depositInfo: null,
|
19
|
+
depositRequestIsActive: false,
|
20
|
+
websocket: null,
|
21
|
+
config: null,
|
22
|
+
chosenNetwork: null,
|
16
23
|
});
|
17
24
|
|
25
|
+
const timer = reactive({ remaining: 0, interval: null });
|
26
|
+
|
18
27
|
const actions = {
|
19
|
-
|
20
|
-
|
21
|
-
|
28
|
+
loadConfig: async () => {
|
29
|
+
await $axios
|
30
|
+
.get(`${API_CRYPTO_PATH}/deposit/config`)
|
31
|
+
.then((r) => {
|
32
|
+
state.config = r.data;
|
33
|
+
state.chosenNetwork = {
|
34
|
+
name: `polygon-WDT`,
|
35
|
+
value: {
|
36
|
+
token: state.config.polygon.tokens.WDT,
|
37
|
+
network: 'polygon'
|
38
|
+
}
|
39
|
+
}
|
40
|
+
})
|
41
|
+
.catch((e) => console.error(e));
|
42
|
+
},
|
43
|
+
|
44
|
+
connectWebSocket: () => {
|
45
|
+
state.websocket = new WebSocket(process.env.WSS_URL);
|
46
|
+
|
47
|
+
state.websocket.onmessage = (event) => {
|
48
|
+
const message = JSON.parse(event.data);
|
49
|
+
|
50
|
+
if (message.id === state.depositInfo.id) {
|
51
|
+
const confirmations = state.depositInfo.confirmations;
|
52
|
+
|
53
|
+
state.depositInfo = message;
|
54
|
+
state.depositInfo.confirmations = confirmations;
|
55
|
+
}
|
56
|
+
|
57
|
+
if (message.hash === state.depositInfo.tx.hash) {
|
58
|
+
state.depositInfo.confirmations = message.confirmations;
|
59
|
+
}
|
60
|
+
};
|
61
|
+
|
62
|
+
state.websocket.onerror = (err) => console.error(err);
|
63
|
+
},
|
64
|
+
|
65
|
+
disconnectWebSocket: () => {
|
66
|
+
if (state.websocket) {
|
67
|
+
state.websocket.close();
|
68
|
+
state.websocket = null;
|
69
|
+
}
|
70
|
+
},
|
71
|
+
|
72
|
+
listRewards: async () => {
|
73
|
+
try {
|
74
|
+
const r = await $axios.get(`${API_CRYPTO_PATH}/rewards`);
|
75
|
+
|
22
76
|
state.rewards = r.data;
|
23
77
|
state.tokenBalance = r.data
|
24
78
|
.reduce((acc, v) => acc.plus(v.amount), new BigNumber('0'))
|
25
79
|
.toString();
|
80
|
+
|
26
81
|
state.share = new BigNumber(state.tokenBalance)
|
27
82
|
.div(WDT_SUPPLY)
|
28
83
|
.multipliedBy(100)
|
29
84
|
.toFormat(6);
|
30
|
-
})
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
85
|
+
} catch (e) {
|
86
|
+
console.error(e);
|
87
|
+
}
|
88
|
+
},
|
89
|
+
|
90
|
+
collectRewards: async () => {
|
91
|
+
try {
|
92
|
+
await $axios.post(`${API_CRYPTO_PATH}/collect`, { recipient: state.account });
|
93
|
+
await actions.listRewards();
|
94
|
+
} catch (e) {
|
95
|
+
console.error(e);
|
96
|
+
}
|
97
|
+
},
|
98
|
+
|
99
|
+
disconnectWallet: async () => {
|
100
|
+
try {
|
101
|
+
await window.ethereum.request({ method: "wallet_revokePermissions", params: [{ "eth_accounts": {} }] });
|
102
|
+
state.account = null;
|
103
|
+
} catch (e) {
|
104
|
+
console.error(e);
|
105
|
+
}
|
106
|
+
},
|
107
|
+
|
108
|
+
connectWallet: async () => {
|
109
|
+
try {
|
110
|
+
const accounts = await state.web3.eth.requestAccounts();
|
111
|
+
state.account = accounts[0];
|
112
|
+
} catch (e) {
|
113
|
+
console.error(e);
|
114
|
+
}
|
115
|
+
},
|
116
|
+
|
117
|
+
tryReconnectWallet: async () => {
|
118
|
+
try {
|
119
|
+
const a = await state.web3.eth.getAccounts();
|
51
120
|
if (a.length > 0) {
|
52
|
-
|
121
|
+
await actions.connectWallet();
|
53
122
|
}
|
54
|
-
})
|
55
|
-
|
123
|
+
} catch (e) {
|
124
|
+
console.error(e);
|
125
|
+
}
|
126
|
+
},
|
127
|
+
|
128
|
+
requestCryptoDeposit: async (amount) => {
|
129
|
+
state.depositRequestIsActive = true;
|
130
|
+
|
131
|
+
await $axios
|
132
|
+
.post(`${API_CRYPTO_PATH}/deposit`, {
|
133
|
+
network: state.chosenNetwork.value.network,
|
134
|
+
amount: new BigNumber(amount).shiftedBy(8).toString(),
|
135
|
+
token: state.chosenNetwork.value.token
|
136
|
+
})
|
137
|
+
.then((r) => {
|
138
|
+
state.depositInfo = r.data;
|
139
|
+
|
140
|
+
const createTimestamp = new Date(r.data.createdAt).getTime();
|
141
|
+
const dead = createTimestamp + state.config[state.chosenNetwork.value.network].waitingTime;
|
142
|
+
timer.remaining = Math.floor((dead - Date.now()) / 1000);
|
143
|
+
|
144
|
+
timer.interval = setInterval(
|
145
|
+
() => {
|
146
|
+
timer.remaining -= 1;
|
147
|
+
|
148
|
+
if (timer.remaining === 0) {
|
149
|
+
clearInterval(timer.interval);
|
150
|
+
}
|
151
|
+
},
|
152
|
+
1000
|
153
|
+
);
|
154
|
+
})
|
155
|
+
.catch((e) => console.error(e));
|
156
|
+
|
157
|
+
state.depositRequestIsActive = false;
|
158
|
+
|
159
|
+
actions.connectWebSocket();
|
160
|
+
},
|
161
|
+
|
162
|
+
stopTimer: () => {
|
163
|
+
clearInterval(timer.interval);
|
164
|
+
},
|
165
|
+
|
166
|
+
cancelDeposit: async () => {
|
167
|
+
await $axios
|
168
|
+
.post(`${API_CRYPTO_PATH}/deposit/cancel`, { id: state.depositInfo.id })
|
169
|
+
.then(() => actions.stopTimer())
|
170
|
+
.then(() => actions.disconnectWebSocket())
|
171
|
+
.catch((e) => console.error(e));
|
172
|
+
}
|
56
173
|
};
|
57
174
|
|
58
|
-
export { state, actions };
|
175
|
+
export { state, actions, timer };
|
@@ -8,7 +8,7 @@ const RoutesRewards = require('./controllers/routes/rewards.routes.js');
|
|
8
8
|
const FactoryPayments = require('./controllers/factories/payments.factory.js');
|
9
9
|
|
10
10
|
// Initialization function for setting up the module within the application
|
11
|
-
function initializePayments(app, db, wdmClient, origins, publicPath) {
|
11
|
+
function initializePayments(app, db, wss, wdmClient, origins, publicPath) {
|
12
12
|
// Setup models in the database object
|
13
13
|
db.wallet = ModelWallet(db);
|
14
14
|
db.payment = ModelPayment(db);
|
@@ -17,7 +17,7 @@ function initializePayments(app, db, wdmClient, origins, publicPath) {
|
|
17
17
|
// Setup routes if the app object is provided
|
18
18
|
if (app) {
|
19
19
|
RoutesPayments(app, db, origins, publicPath)
|
20
|
-
RoutesRewards(app, db, wdmClient, origins)
|
20
|
+
RoutesRewards(app, db, wss, wdmClient, origins)
|
21
21
|
}
|
22
22
|
}
|
23
23
|
|
@@ -1,55 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<h2 class="mn-b-small t-center t-bold">{{ t('depositeWithCrypto') }}</h2>
|
3
|
-
|
4
|
-
<div class="bg-grey radius-big mn-t-semi mn-b-semi flex flex-justify-between">
|
5
|
-
<Field
|
6
|
-
:placeholder="t('enterAmount')"
|
7
|
-
class="pd-medium radius-small"
|
8
|
-
/>
|
9
|
-
|
10
|
-
<div class="uppercase flex flex-justify-center flex-items-center mn-r-semi t-semi">
|
11
|
-
POLY USDT
|
12
|
-
</div>
|
13
|
-
</div>
|
14
|
-
|
15
|
-
<h3 class="t-semi">You will receieve: 0 WDT</h3>
|
16
|
-
|
17
|
-
<button
|
18
|
-
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"
|
19
|
-
@click="switchMenu(3)"
|
20
|
-
>
|
21
|
-
{{ t('pay') }}
|
22
|
-
</button>
|
23
|
-
|
24
|
-
<button
|
25
|
-
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"
|
26
|
-
@click="backSelection"
|
27
|
-
>
|
28
|
-
{{ t('backToSelection') }}
|
29
|
-
</button>
|
30
|
-
</template>
|
31
|
-
|
32
|
-
<script setup>
|
33
|
-
import text from '@pf/src/modules/wallet/localization/Wallet.json'
|
34
|
-
import Field from '@pf/src/components/Field/Field.vue'
|
35
|
-
import { useI18n } from 'vue-i18n'
|
36
|
-
|
37
|
-
const emits = defineEmits(['back-selection', 'switch-menu'])
|
38
|
-
|
39
|
-
// Localization
|
40
|
-
const { t } = useI18n({
|
41
|
-
useScope: 'global',
|
42
|
-
...text
|
43
|
-
})
|
44
|
-
|
45
|
-
function backSelection() {
|
46
|
-
emits("back-selection")
|
47
|
-
}
|
48
|
-
|
49
|
-
function switchMenu(screen = 0) {
|
50
|
-
emits("switch-menu", screen)
|
51
|
-
}
|
52
|
-
</script>
|
53
|
-
|
54
|
-
<style scoped>
|
55
|
-
</style>
|