@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.
Files changed (228) hide show
  1. package/dist/_virtual/alignment-pattern.cjs +1 -0
  2. package/dist/_virtual/alignment-pattern.js +4 -0
  3. package/dist/_virtual/browser.cjs +1 -0
  4. package/dist/_virtual/browser.js +4 -0
  5. package/dist/_virtual/canvas.cjs +1 -0
  6. package/dist/_virtual/canvas.js +4 -0
  7. package/dist/_virtual/dijkstra.cjs +1 -0
  8. package/dist/_virtual/dijkstra.js +4 -0
  9. package/dist/_virtual/error-correction-code.cjs +1 -0
  10. package/dist/_virtual/error-correction-code.js +4 -0
  11. package/dist/_virtual/error-correction-level.cjs +1 -0
  12. package/dist/_virtual/error-correction-level.js +4 -0
  13. package/dist/_virtual/finder-pattern.cjs +1 -0
  14. package/dist/_virtual/finder-pattern.js +4 -0
  15. package/dist/_virtual/format-info.cjs +1 -0
  16. package/dist/_virtual/format-info.js +4 -0
  17. package/dist/_virtual/galois-field.cjs +1 -0
  18. package/dist/_virtual/galois-field.js +4 -0
  19. package/dist/_virtual/mask-pattern.cjs +1 -0
  20. package/dist/_virtual/mask-pattern.js +4 -0
  21. package/dist/_virtual/mode.cjs +1 -0
  22. package/dist/_virtual/mode.js +4 -0
  23. package/dist/_virtual/polynomial.cjs +1 -0
  24. package/dist/_virtual/polynomial.js +4 -0
  25. package/dist/_virtual/qrcode.cjs +1 -0
  26. package/dist/_virtual/qrcode.js +4 -0
  27. package/dist/_virtual/regex.cjs +1 -0
  28. package/dist/_virtual/regex.js +4 -0
  29. package/dist/_virtual/segments.cjs +1 -0
  30. package/dist/_virtual/segments.js +4 -0
  31. package/dist/_virtual/svg-tag.cjs +1 -0
  32. package/dist/_virtual/svg-tag.js +4 -0
  33. package/dist/_virtual/utils.cjs +1 -0
  34. package/dist/_virtual/utils.js +4 -0
  35. package/dist/_virtual/utils2.cjs +1 -0
  36. package/dist/_virtual/utils2.js +4 -0
  37. package/dist/_virtual/version-check.cjs +1 -0
  38. package/dist/_virtual/version-check.js +4 -0
  39. package/dist/_virtual/version.cjs +1 -0
  40. package/dist/_virtual/version.js +4 -0
  41. package/dist/auth.server.js +1 -1
  42. package/dist/auth.server.mjs +1 -1
  43. package/dist/community.server.js +1 -1
  44. package/dist/community.server.mjs +1 -1
  45. package/dist/events.server.js +1 -1
  46. package/dist/events.server.mjs +1 -1
  47. package/dist/files.server.js +1 -1
  48. package/dist/files.server.mjs +1 -1
  49. package/dist/gallery.server.js +1 -1
  50. package/dist/gallery.server.mjs +1 -1
  51. package/dist/index-C-8xOJnM.mjs +244 -0
  52. package/dist/index-CDbtWkBj.js +243 -0
  53. package/dist/main-5IrI2IOV.js +92 -0
  54. package/dist/main-BY2OvGB9.mjs +14509 -0
  55. package/dist/main.css +1 -1
  56. package/dist/middlewares.server.js +1 -1
  57. package/dist/middlewares.server.mjs +1 -1
  58. package/dist/node_modules/dijkstrajs/dijkstra.cjs +1 -0
  59. package/dist/node_modules/dijkstrajs/dijkstra.js +70 -0
  60. package/dist/node_modules/encode-utf8/index.cjs +1 -0
  61. package/dist/node_modules/encode-utf8/index.js +30 -0
  62. package/dist/node_modules/qrcode/lib/browser.cjs +1 -0
  63. package/dist/node_modules/qrcode/lib/browser.js +45 -0
  64. package/dist/node_modules/qrcode/lib/can-promise.cjs +1 -0
  65. package/dist/node_modules/qrcode/lib/can-promise.js +6 -0
  66. package/dist/node_modules/qrcode/lib/core/alignment-pattern.cjs +1 -0
  67. package/dist/node_modules/qrcode/lib/core/alignment-pattern.js +21 -0
  68. package/dist/node_modules/qrcode/lib/core/alphanumeric-data.cjs +1 -0
  69. package/dist/node_modules/qrcode/lib/core/alphanumeric-data.js +73 -0
  70. package/dist/node_modules/qrcode/lib/core/bit-buffer.cjs +1 -0
  71. package/dist/node_modules/qrcode/lib/core/bit-buffer.js +24 -0
  72. package/dist/node_modules/qrcode/lib/core/bit-matrix.cjs +1 -0
  73. package/dist/node_modules/qrcode/lib/core/bit-matrix.js +22 -0
  74. package/dist/node_modules/qrcode/lib/core/byte-data.cjs +1 -0
  75. package/dist/node_modules/qrcode/lib/core/byte-data.js +24 -0
  76. package/dist/node_modules/qrcode/lib/core/error-correction-code.cjs +1 -0
  77. package/dist/node_modules/qrcode/lib/core/error-correction-code.js +359 -0
  78. package/dist/node_modules/qrcode/lib/core/error-correction-level.cjs +1 -0
  79. package/dist/node_modules/qrcode/lib/core/error-correction-level.js +35 -0
  80. package/dist/node_modules/qrcode/lib/core/finder-pattern.cjs +1 -0
  81. package/dist/node_modules/qrcode/lib/core/finder-pattern.js +18 -0
  82. package/dist/node_modules/qrcode/lib/core/format-info.cjs +1 -0
  83. package/dist/node_modules/qrcode/lib/core/format-info.js +14 -0
  84. package/dist/node_modules/qrcode/lib/core/galois-field.cjs +1 -0
  85. package/dist/node_modules/qrcode/lib/core/galois-field.js +22 -0
  86. package/dist/node_modules/qrcode/lib/core/kanji-data.cjs +2 -0
  87. package/dist/node_modules/qrcode/lib/core/kanji-data.js +37 -0
  88. package/dist/node_modules/qrcode/lib/core/mask-pattern.cjs +1 -0
  89. package/dist/node_modules/qrcode/lib/core/mask-pattern.js +96 -0
  90. package/dist/node_modules/qrcode/lib/core/mode.cjs +1 -0
  91. package/dist/node_modules/qrcode/lib/core/mode.js +64 -0
  92. package/dist/node_modules/qrcode/lib/core/numeric-data.cjs +1 -0
  93. package/dist/node_modules/qrcode/lib/core/numeric-data.js +26 -0
  94. package/dist/node_modules/qrcode/lib/core/polynomial.cjs +1 -0
  95. package/dist/node_modules/qrcode/lib/core/polynomial.js +29 -0
  96. package/dist/node_modules/qrcode/lib/core/qrcode.cjs +4 -0
  97. package/dist/node_modules/qrcode/lib/core/qrcode.js +159 -0
  98. package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.cjs +1 -0
  99. package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.js +25 -0
  100. package/dist/node_modules/qrcode/lib/core/regex.cjs +2 -0
  101. package/dist/node_modules/qrcode/lib/core/regex.js +24 -0
  102. package/dist/node_modules/qrcode/lib/core/segments.cjs +2 -0
  103. package/dist/node_modules/qrcode/lib/core/segments.js +143 -0
  104. package/dist/node_modules/qrcode/lib/core/utils.cjs +1 -0
  105. package/dist/node_modules/qrcode/lib/core/utils.js +74 -0
  106. package/dist/node_modules/qrcode/lib/core/version-check.cjs +1 -0
  107. package/dist/node_modules/qrcode/lib/core/version-check.js +7 -0
  108. package/dist/node_modules/qrcode/lib/core/version.cjs +1 -0
  109. package/dist/node_modules/qrcode/lib/core/version.js +74 -0
  110. package/dist/node_modules/qrcode/lib/renderer/canvas.cjs +1 -0
  111. package/dist/node_modules/qrcode/lib/renderer/canvas.js +27 -0
  112. package/dist/node_modules/qrcode/lib/renderer/svg-tag.cjs +2 -0
  113. package/dist/node_modules/qrcode/lib/renderer/svg-tag.js +28 -0
  114. package/dist/node_modules/qrcode/lib/renderer/utils.cjs +1 -0
  115. package/dist/node_modules/qrcode/lib/renderer/utils.js +52 -0
  116. package/dist/orders.server.js +1 -1
  117. package/dist/orders.server.mjs +1 -1
  118. package/dist/organizations.server.js +1 -1
  119. package/dist/organizations.server.mjs +1 -1
  120. package/dist/products.server.js +1 -1
  121. package/dist/products.server.mjs +1 -1
  122. package/dist/prometheus-framework/src/components/Chips/Chips.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/components/Chips/Chips.vue.js +12 -13
  124. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.cjs +1 -1
  125. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue.js +14 -15
  126. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  127. package/dist/prometheus-framework/src/components/Field/Field.vue.js +19 -20
  128. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +4 -4
  129. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -0
  130. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +77 -0
  131. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +14 -14
  132. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +15 -15
  133. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +11 -11
  134. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +34 -34
  135. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +27 -27
  136. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  138. package/dist/prometheus-framework/src/modules/community/components/pages/Blog.vue.cjs +1 -1
  139. package/dist/prometheus-framework/src/modules/community/components/pages/Blog.vue.js +1 -1
  140. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  141. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
  142. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +22 -22
  143. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +13 -13
  144. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +9 -9
  145. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +19 -19
  146. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +7 -7
  147. package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.cjs +1 -1
  148. package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.js +8 -8
  149. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  150. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  151. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +3 -3
  152. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +8 -8
  153. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  154. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +1 -1
  155. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  156. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  157. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +1 -1
  158. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
  159. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +4 -4
  160. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +9 -9
  161. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +13 -13
  162. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +17 -17
  163. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +6 -6
  164. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +10 -10
  165. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +17 -17
  166. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +30 -30
  167. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +9 -9
  168. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
  169. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  170. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
  171. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +7 -7
  172. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CardDeposite.vue.cjs +1 -1
  173. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CardDeposite.vue.js +1 -1
  174. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CryptoDeposite.vue.cjs +1 -1
  175. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CryptoDeposite.vue.js +1 -1
  176. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue.cjs +1 -0
  177. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue.js +34 -0
  178. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.cjs +1 -0
  179. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +42 -0
  180. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CashDeposit.vue.cjs +1 -0
  181. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CashDeposit.vue.js +26 -0
  182. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.cjs +1 -0
  183. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +76 -0
  184. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue.cjs +1 -0
  185. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue.js +105 -0
  186. package/dist/prometheus-framework/src/modules/wallet/views/components/elements/ConnectMetamask.vue.cjs +1 -0
  187. package/dist/prometheus-framework/src/modules/wallet/views/components/elements/ConnectMetamask.vue.js +106 -0
  188. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  189. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +137 -122
  190. package/dist/prometheus-framework/src/modules/wallet/views/localization/wallet.json.cjs +1 -0
  191. package/dist/prometheus-framework/src/modules/wallet/views/localization/wallet.json.js +41 -0
  192. package/dist/prometheus-framework/src/modules/wallet/views/store/wallet.store.cjs +1 -1
  193. package/dist/prometheus-framework/src/modules/wallet/views/store/wallet.store.js +98 -22
  194. package/dist/prometheus-framework.cjs.js +1 -1
  195. package/dist/prometheus-framework.es.js +1 -1
  196. package/dist/reports.server.js +1 -1
  197. package/dist/reports.server.mjs +1 -1
  198. package/dist/style.css +1 -1
  199. package/dist/wallet.server.js +103 -13
  200. package/dist/wallet.server.mjs +103 -13
  201. package/dist/web-5eyiz9L7.mjs +54 -0
  202. package/dist/web-C04IcLk4.js +1 -0
  203. package/package.json +1 -1
  204. package/src/components/Field/Field.vue +1 -1
  205. package/src/modules/community/components/pages/Blog.vue +1 -1
  206. package/src/modules/globals/components/partials/Header.vue +2 -2
  207. package/src/modules/globals/localization/vue-i18n.js +5 -5
  208. package/src/modules/landing/components/sections/HowToBuyWDR.vue +2 -3
  209. package/src/modules/landing/components/sections/SectionEarn.vue +1 -6
  210. package/src/modules/middlewares/server/authSecret.js +22 -0
  211. package/src/modules/middlewares/server/index.js +7 -5
  212. package/src/modules/wallet/controllers/factories/rewards.factory.js +87 -2
  213. package/src/modules/wallet/controllers/routes/rewards.routes.js +27 -3
  214. package/src/modules/wallet/models/wallet.model.js +5 -5
  215. package/src/modules/wallet/{components → views/components}/blocks/CardBalanceReplenished.vue +17 -7
  216. package/src/modules/wallet/{components/blocks/CardDeposite.vue → views/components/blocks/CardDeposit.vue} +4 -4
  217. package/src/modules/wallet/views/components/blocks/CryptoDeposit.vue +98 -0
  218. package/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue +144 -0
  219. package/src/modules/wallet/views/components/elements/ConnectMetamask.vue +131 -0
  220. package/src/modules/wallet/views/components/pages/Wallet.vue +95 -68
  221. package/src/modules/wallet/views/localization/wallet.json +37 -0
  222. package/src/modules/wallet/views/store/wallet.store.js +145 -28
  223. package/src/modules/wallet/wallet.server.js +2 -2
  224. package/src/modules/wallet/components/blocks/CryptoDeposite.vue +0 -55
  225. package/src/modules/wallet/controllers/factories/rewards.factory.aggr.js +0 -181
  226. package/src/modules/wallet/controllers/factories/rewards.factory.population.js +0 -213
  227. package/src/modules/wallet/localization/Wallet.json +0 -22
  228. /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
- <section class="pd-thin">
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 ">Your Wallet</h1>
4
+ <h1 class="mn-b-medium">{{ t('wallet.title') }}</h1>
6
5
 
7
6
  <p class="mn-b-semi t-transp p-big">
8
- Earn Weeder Tokens by purchasing our weed or contributing to the community.
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}} WDT</h2>
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
- <button class="w-max bg-white t-black t-medium button" @click="actions.collectRewards">Withdraw</button>
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
- <button
140
- 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"
141
- @click="switchGetMoreMenu(1)"
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
- CASH
144
- </button>
143
+ <h2 class="mn-b-small t-center t-bold">Choose the way of deposit</h2>
145
144
 
146
- <button
147
- 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"
148
- @click="switchGetMoreMenu(2)"
149
- >
150
- CARD
151
- </button>
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
- <button
154
- 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"
155
- @click="switchGetMoreMenu(4)"
156
- >
157
- CRYPTO
158
- </button>
159
- </div>
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
- <CashDepositeMenu
162
- v-if="currentMenuPopup === 1"
163
- @back-selection="switchGetMoreMenu(0)"
164
- />
165
-
166
- <CardDepositeMenu
167
- v-if="currentMenuPopup === 2"
168
- @back-selection="switchGetMoreMenu(0)"
169
- @switch-menu="switchGetMoreMenu"
170
- />
171
-
172
- <CardBalanceReplenished
173
- v-if="currentMenuPopup === 3"
174
- @close="closeGetMorePopup"
175
- />
176
-
177
- <CryptoDepositeMenu
178
- v-if="currentMenuPopup === 4"
179
- @back-selection="switchGetMoreMenu(0)"
180
- @switch-menu="switchGetMoreMenu"
181
- />
182
- </Popup>
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 Web3 from "web3";
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 CardBlogpost from '@pf/src/modules/community/components/blocks/CardBlogpost.vue'
192
- import Popup from '@pf/src/components/Popup/Popup.vue'
193
- import CashDepositeMenu from '@pf/src/modules/wallet/components/blocks/CashDeposite.vue'
194
- import CardDepositeMenu from '@pf/src/modules/wallet/components/blocks/CardDeposite.vue'
195
- import CryptoDepositeMenu from '@pf/src/modules/wallet/components/blocks/CryptoDeposite.vue'
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
+ }