@rabbitio/ui-kit 1.0.0-beta.8 → 1.0.0-beta.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (398) hide show
  1. package/.gitlab-ci.yml +29 -0
  2. package/.husky/commit-msg +19 -0
  3. package/.husky/pre-push +1 -0
  4. package/CHANGELOG.md +0 -0
  5. package/README.md +27 -18
  6. package/coverage/base.css +224 -0
  7. package/coverage/block-navigation.js +87 -0
  8. package/coverage/clover.xml +16372 -0
  9. package/coverage/coverage-final.json +154 -0
  10. package/coverage/favicon.png +0 -0
  11. package/coverage/index.html +1151 -0
  12. package/coverage/prettify.css +1 -0
  13. package/coverage/prettify.js +2 -0
  14. package/coverage/sort-arrow-sprite.png +0 -0
  15. package/coverage/sorter.js +196 -0
  16. package/coverage/ui-kit/index.html +116 -0
  17. package/coverage/ui-kit/index.js.html +88 -0
  18. package/coverage/ui-kit/src/common-apis/adapters/axiosAdapter.js.html +190 -0
  19. package/coverage/ui-kit/src/common-apis/adapters/index.html +131 -0
  20. package/coverage/ui-kit/src/common-apis/adapters/qrUtils.js.html +139 -0
  21. package/coverage/ui-kit/src/common-apis/amountUtils.js.html +1162 -0
  22. package/coverage/ui-kit/src/common-apis/errorUtils.js.html +211 -0
  23. package/coverage/ui-kit/src/common-apis/external-apis/apiGroups.js.html +250 -0
  24. package/coverage/ui-kit/src/common-apis/external-apis/index.html +131 -0
  25. package/coverage/ui-kit/src/common-apis/external-apis/ipAddressProviders.js.html +352 -0
  26. package/coverage/ui-kit/src/common-apis/fiatCurrenciesService.js.html +544 -0
  27. package/coverage/ui-kit/src/common-apis/globalConstants.jsx.html +94 -0
  28. package/coverage/ui-kit/src/common-apis/index.html +161 -0
  29. package/coverage/ui-kit/src/common-apis/models/blockchain.js.html +115 -0
  30. package/coverage/ui-kit/src/common-apis/models/coin.js.html +544 -0
  31. package/coverage/ui-kit/src/common-apis/models/index.html +146 -0
  32. package/coverage/ui-kit/src/common-apis/models/protocol.js.html +100 -0
  33. package/coverage/ui-kit/src/common-apis/utils/cache.js.html +811 -0
  34. package/coverage/ui-kit/src/common-apis/utils/emailAPI.js.html +133 -0
  35. package/coverage/ui-kit/src/common-apis/utils/index.html +161 -0
  36. package/coverage/ui-kit/src/common-apis/utils/logging/index.html +131 -0
  37. package/coverage/ui-kit/src/common-apis/utils/logging/logger.js.html +208 -0
  38. package/coverage/ui-kit/src/common-apis/utils/logging/logsStorage.js.html +268 -0
  39. package/coverage/ui-kit/src/common-apis/utils/postponeExecution.js.html +118 -0
  40. package/coverage/ui-kit/src/common-apis/utils/safeStringify.js.html +235 -0
  41. package/coverage/ui-kit/src/index.html +116 -0
  42. package/coverage/ui-kit/src/index.js.html +337 -0
  43. package/coverage/ui-kit/src/robust-api-caller/cacheAndConcurrentRequestsResolver.js.html +1570 -0
  44. package/coverage/ui-kit/src/robust-api-caller/cachedRobustExternalApiCallerService.js.html +526 -0
  45. package/coverage/ui-kit/src/robust-api-caller/cancelProcessing.js.html +172 -0
  46. package/coverage/ui-kit/src/robust-api-caller/concurrentCalculationsMetadataHolder.js.html +310 -0
  47. package/coverage/ui-kit/src/robust-api-caller/externalApiProvider.js.html +553 -0
  48. package/coverage/ui-kit/src/robust-api-caller/externalServicesStatsCollector.js.html +319 -0
  49. package/coverage/ui-kit/src/robust-api-caller/index.html +206 -0
  50. package/coverage/ui-kit/src/robust-api-caller/robustExternalAPICallerService.js.html +997 -0
  51. package/coverage/ui-kit/src/swaps-lib/external-apis/index.html +146 -0
  52. package/coverage/ui-kit/src/swaps-lib/external-apis/letsExchangeSwapProvider.js.html +1513 -0
  53. package/coverage/ui-kit/src/swaps-lib/external-apis/swapProvider.js.html +1558 -0
  54. package/coverage/ui-kit/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +1735 -0
  55. package/coverage/ui-kit/src/swaps-lib/models/baseSwapCreationInfo.js.html +223 -0
  56. package/coverage/ui-kit/src/swaps-lib/models/existingSwap.js.html +304 -0
  57. package/coverage/ui-kit/src/swaps-lib/models/existingSwapWithFiatData.js.html +469 -0
  58. package/coverage/ui-kit/src/swaps-lib/models/index.html +146 -0
  59. package/coverage/ui-kit/src/swaps-lib/services/index.html +116 -0
  60. package/coverage/ui-kit/src/swaps-lib/services/publicSwapService.js.html +2098 -0
  61. package/coverage/ui-kit/src/swaps-lib/utils/index.html +116 -0
  62. package/coverage/ui-kit/src/swaps-lib/utils/swapUtils.js.html +670 -0
  63. package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/arrowIcon.jsx.html +124 -0
  64. package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/arrowTosca.jsx.html +127 -0
  65. package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/arrowWhite.jsx.html +127 -0
  66. package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/darkRectangle.jsx.html +106 -0
  67. package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/determinedError.jsx.html +439 -0
  68. package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/failedValidationIcon.jsx.html +202 -0
  69. package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/index.html +251 -0
  70. package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/infoIcon.jsx.html +133 -0
  71. package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/noticeQuestionIcon.jsx.html +247 -0
  72. package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx.html +163 -0
  73. package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/walletIcon.jsx.html +151 -0
  74. package/coverage/ui-kit/src/ui-kit/components/atoms/AssetIcon/AssetIcon.jsx.html +256 -0
  75. package/coverage/ui-kit/src/ui-kit/components/atoms/AssetIcon/index.html +116 -0
  76. package/coverage/ui-kit/src/ui-kit/components/atoms/AssetSelection/AssetSelection.jsx.html +289 -0
  77. package/coverage/ui-kit/src/ui-kit/components/atoms/AssetSelection/index.html +116 -0
  78. package/coverage/ui-kit/src/ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +187 -0
  79. package/coverage/ui-kit/src/ui-kit/components/atoms/BackgroundTitle/index.html +116 -0
  80. package/coverage/ui-kit/src/ui-kit/components/atoms/InformationMessage/InformationMessage.jsx.html +238 -0
  81. package/coverage/ui-kit/src/ui-kit/components/atoms/InformationMessage/index.html +116 -0
  82. package/coverage/ui-kit/src/ui-kit/components/atoms/Input/Input.jsx.html +634 -0
  83. package/coverage/ui-kit/src/ui-kit/components/atoms/Input/index.html +116 -0
  84. package/coverage/ui-kit/src/ui-kit/components/atoms/LoadingDots/LoadingDots.jsx.html +196 -0
  85. package/coverage/ui-kit/src/ui-kit/components/atoms/LoadingDots/index.html +116 -0
  86. package/coverage/ui-kit/src/ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx.html +277 -0
  87. package/coverage/ui-kit/src/ui-kit/components/atoms/NoticeIcon/index.html +116 -0
  88. package/coverage/ui-kit/src/ui-kit/components/atoms/QrCode/QrCode.jsx.html +235 -0
  89. package/coverage/ui-kit/src/ui-kit/components/atoms/QrCode/index.html +116 -0
  90. package/coverage/ui-kit/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx.html +175 -0
  91. package/coverage/ui-kit/src/ui-kit/components/atoms/RateSelector/index.html +116 -0
  92. package/coverage/ui-kit/src/ui-kit/components/atoms/SupportChat/SupportChat.jsx.html +217 -0
  93. package/coverage/ui-kit/src/ui-kit/components/atoms/SupportChat/index.html +116 -0
  94. package/coverage/ui-kit/src/ui-kit/components/atoms/Textarea/Textarea.jsx.html +529 -0
  95. package/coverage/ui-kit/src/ui-kit/components/atoms/Textarea/index.html +116 -0
  96. package/coverage/ui-kit/src/ui-kit/components/atoms/TitleBox/TitleBox.jsx.html +508 -0
  97. package/coverage/ui-kit/src/ui-kit/components/atoms/TitleBox/index.html +116 -0
  98. package/coverage/ui-kit/src/ui-kit/components/atoms/Tooltip/Tooltip.jsx.html +316 -0
  99. package/coverage/ui-kit/src/ui-kit/components/atoms/Tooltip/index.html +116 -0
  100. package/coverage/ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx.html +313 -0
  101. package/coverage/ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/index.html +116 -0
  102. package/coverage/ui-kit/src/ui-kit/components/atoms/Validation/Validation.jsx.html +208 -0
  103. package/coverage/ui-kit/src/ui-kit/components/atoms/Validation/index.html +116 -0
  104. package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/Button/Button.jsx.html +712 -0
  105. package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/Button/index.html +116 -0
  106. package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/Close/Close.jsx.html +259 -0
  107. package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/Close/index.html +116 -0
  108. package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx.html +421 -0
  109. package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/LinkButton/index.html +116 -0
  110. package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +415 -0
  111. package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/index.html +116 -0
  112. package/coverage/ui-kit/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx.html +1060 -0
  113. package/coverage/ui-kit/src/ui-kit/components/molecules/AmountInput/index.html +116 -0
  114. package/coverage/ui-kit/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx.html +1618 -0
  115. package/coverage/ui-kit/src/ui-kit/components/molecules/CoinPicker/index.html +116 -0
  116. package/coverage/ui-kit/src/ui-kit/components/molecules/LineWithIconLink/LineWithIconLink.jsx.html +190 -0
  117. package/coverage/ui-kit/src/ui-kit/components/molecules/LineWithIconLink/index.html +116 -0
  118. package/coverage/ui-kit/src/ui-kit/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx.html +181 -0
  119. package/coverage/ui-kit/src/ui-kit/components/molecules/TitledLineWithIconLink/index.html +116 -0
  120. package/coverage/ui-kit/src/ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +283 -0
  121. package/coverage/ui-kit/src/ui-kit/components/organisms/CoinPickerDialogStep/index.html +116 -0
  122. package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/Dialog.jsx.html +1567 -0
  123. package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +451 -0
  124. package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/index.html +116 -0
  125. package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +1699 -0
  126. package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/index.html +116 -0
  127. package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/index.html +116 -0
  128. package/coverage/ui-kit/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx.html +4075 -0
  129. package/coverage/ui-kit/src/ui-kit/components/organisms/SwapForm/index.html +116 -0
  130. package/coverage/ui-kit/src/ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx.html +316 -0
  131. package/coverage/ui-kit/src/ui-kit/components/templates/DeterminedErrorDialogStep/index.html +116 -0
  132. package/coverage/ui-kit/src/ui-kit/hooks/index.html +146 -0
  133. package/coverage/ui-kit/src/ui-kit/hooks/useCallHandlingErrors.js.html +151 -0
  134. package/coverage/ui-kit/src/ui-kit/hooks/useIsHydrated.js.html +121 -0
  135. package/coverage/ui-kit/src/ui-kit/hooks/useReferredState.js.html +157 -0
  136. package/coverage/ui-kit/src/ui-kit/utils/index.html +161 -0
  137. package/coverage/ui-kit/src/ui-kit/utils/inputValueProviders.js.html +235 -0
  138. package/coverage/ui-kit/src/ui-kit/utils/textUtils.js.html +139 -0
  139. package/coverage/ui-kit/src/ui-kit/utils/uiUtils.js.html +121 -0
  140. package/coverage/ui-kit/src/ui-kit/utils/urlQueryUtils.js.html +271 -0
  141. package/coverage/ui-kit/stories/atoms/BackgroundTitle.stories.jsx.html +202 -0
  142. package/coverage/ui-kit/stories/atoms/LinesOfText.stories.jsx.html +283 -0
  143. package/coverage/ui-kit/stories/atoms/LoadingDots.stories.jsx.html +226 -0
  144. package/coverage/ui-kit/stories/atoms/QrCode.stories.jsx.html +175 -0
  145. package/coverage/ui-kit/stories/atoms/RateSelector.stories.jsx.html +136 -0
  146. package/coverage/ui-kit/stories/atoms/Validation.stories.jsx.html +178 -0
  147. package/coverage/ui-kit/stories/atoms/buttons/Button.stories.jsx.html +883 -0
  148. package/coverage/ui-kit/stories/atoms/buttons/Close.stories.jsx.html +211 -0
  149. package/coverage/ui-kit/stories/atoms/buttons/LinkButton.stories.jsx.html +301 -0
  150. package/coverage/ui-kit/stories/atoms/buttons/index.html +146 -0
  151. package/coverage/ui-kit/stories/atoms/index.html +191 -0
  152. package/coverage/ui-kit/stories/molecules/LineWithIconLink.stories.jsx.html +154 -0
  153. package/coverage/ui-kit/stories/molecules/TitledLineWithIconLink.stories.jsx.html +160 -0
  154. package/coverage/ui-kit/stories/molecules/index.html +131 -0
  155. package/coverage/ui-kit/stories/organisms/Dialog/Dialog.stories.jsx.html +523 -0
  156. package/coverage/ui-kit/stories/organisms/Dialog/DialogButtons/DialogButtons.stories.jsx.html +328 -0
  157. package/coverage/ui-kit/stories/organisms/Dialog/DialogButtons/index.html +116 -0
  158. package/coverage/ui-kit/stories/organisms/Dialog/DialogStep/DialogStep.stories.jsx.html +337 -0
  159. package/coverage/ui-kit/stories/organisms/Dialog/DialogStep/index.html +116 -0
  160. package/coverage/ui-kit/stories/organisms/Dialog/index.html +116 -0
  161. package/coverage/ui-kit/stories/stubs/exampleContent.jsx.html +145 -0
  162. package/coverage/ui-kit/stories/stubs/index.html +116 -0
  163. package/coverage/ui-kit/stories/templates/DeterminedErrorDialogStep.stories.jsx.html +190 -0
  164. package/coverage/ui-kit/stories/templates/index.html +116 -0
  165. package/coverage/ui-kit/storybook-static/138.56b7edc4.iframe.bundle.js.html +85 -0
  166. package/coverage/ui-kit/storybook-static/312.6f62bbd9.iframe.bundle.js.html +85 -0
  167. package/coverage/ui-kit/storybook-static/341.57a15f57.iframe.bundle.js.html +85 -0
  168. package/coverage/ui-kit/storybook-static/595.2e40d981.iframe.bundle.js.html +85 -0
  169. package/coverage/ui-kit/storybook-static/607.3ea32459.iframe.bundle.js.html +85 -0
  170. package/coverage/ui-kit/storybook-static/609.949af3f6.iframe.bundle.js.html +85 -0
  171. package/coverage/ui-kit/storybook-static/693.1acf0184.iframe.bundle.js.html +85 -0
  172. package/coverage/ui-kit/storybook-static/797.c87cdf19.iframe.bundle.js.html +85 -0
  173. package/coverage/ui-kit/storybook-static/862.c15e3c9c.iframe.bundle.js.html +85 -0
  174. package/coverage/ui-kit/storybook-static/87.0a1bfeb1.iframe.bundle.js.html +85 -0
  175. package/coverage/ui-kit/storybook-static/893.e21210d8.iframe.bundle.js.html +85 -0
  176. package/coverage/ui-kit/storybook-static/996.10688684.iframe.bundle.js.html +85 -0
  177. package/coverage/ui-kit/storybook-static/atoms-BackgroundTitle-stories.1a5386a1.iframe.bundle.js.html +85 -0
  178. package/coverage/ui-kit/storybook-static/atoms-LinesOfText-stories.7043a48b.iframe.bundle.js.html +85 -0
  179. package/coverage/ui-kit/storybook-static/atoms-LoadingDots-stories.662d6a83.iframe.bundle.js.html +85 -0
  180. package/coverage/ui-kit/storybook-static/atoms-QrCode-stories.e10363b6.iframe.bundle.js.html +85 -0
  181. package/coverage/ui-kit/storybook-static/atoms-RateSelector-stories.da7b9f1f.iframe.bundle.js.html +85 -0
  182. package/coverage/ui-kit/storybook-static/atoms-Validation-stories.d561b311.iframe.bundle.js.html +85 -0
  183. package/coverage/ui-kit/storybook-static/atoms-buttons-Button-stories.d336c1a5.iframe.bundle.js.html +85 -0
  184. package/coverage/ui-kit/storybook-static/atoms-buttons-Close-stories.0a902a7c.iframe.bundle.js.html +85 -0
  185. package/coverage/ui-kit/storybook-static/atoms-buttons-LinkButton-stories.ca93ab6b.iframe.bundle.js.html +85 -0
  186. package/coverage/ui-kit/storybook-static/index.html +536 -0
  187. package/coverage/ui-kit/storybook-static/main.75ff1c31.iframe.bundle.js.html +85 -0
  188. package/coverage/ui-kit/storybook-static/molecules-LineWithIconLink-stories.2d2d5753.iframe.bundle.js.html +85 -0
  189. package/coverage/ui-kit/storybook-static/molecules-TitledLineWithIconLink-stories.1383fe3f.iframe.bundle.js.html +85 -0
  190. package/coverage/ui-kit/storybook-static/organisms-Dialog-Dialog-stories.4e6da717.iframe.bundle.js.html +85 -0
  191. package/coverage/ui-kit/storybook-static/organisms-Dialog-DialogButtons-DialogButtons-stories.b79c32a3.iframe.bundle.js.html +85 -0
  192. package/coverage/ui-kit/storybook-static/organisms-Dialog-DialogStep-DialogStep-stories.74896048.iframe.bundle.js.html +85 -0
  193. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/addon-backgrounds/dist/index.html +116 -0
  194. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/addon-backgrounds/dist/preview.js.html +118 -0
  195. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/components/dist/formatter-SWP5E3XI.mjs.html +118 -0
  196. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/components/dist/index.html +116 -0
  197. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/buffer/index.html +116 -0
  198. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/buffer/index.js.html +118 -0
  199. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/markdown-to-jsx/dist/index.html +116 -0
  200. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/markdown-to-jsx/dist/index.modern.js.html +118 -0
  201. package/coverage/ui-kit/storybook-static/runtime~main.b108a22d.iframe.bundle.js.html +85 -0
  202. package/coverage/ui-kit/storybook-static/sb-addons/actions-9/index.html +116 -0
  203. package/coverage/ui-kit/storybook-static/sb-addons/actions-9/manager-bundle.js.html +94 -0
  204. package/coverage/ui-kit/storybook-static/sb-addons/essentials-backgrounds-2/index.html +116 -0
  205. package/coverage/ui-kit/storybook-static/sb-addons/essentials-backgrounds-2/manager-bundle.js.html +121 -0
  206. package/coverage/ui-kit/storybook-static/sb-addons/essentials-controls-1/index.html +116 -0
  207. package/coverage/ui-kit/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js.html +274 -0
  208. package/coverage/ui-kit/storybook-static/sb-addons/essentials-measure-4/index.html +116 -0
  209. package/coverage/ui-kit/storybook-static/sb-addons/essentials-measure-4/manager-bundle.js.html +94 -0
  210. package/coverage/ui-kit/storybook-static/sb-addons/essentials-outline-5/index.html +116 -0
  211. package/coverage/ui-kit/storybook-static/sb-addons/essentials-outline-5/manager-bundle.js.html +94 -0
  212. package/coverage/ui-kit/storybook-static/sb-addons/essentials-toolbars-3/index.html +116 -0
  213. package/coverage/ui-kit/storybook-static/sb-addons/essentials-toolbars-3/manager-bundle.js.html +94 -0
  214. package/coverage/ui-kit/storybook-static/sb-addons/interactions-7/index.html +116 -0
  215. package/coverage/ui-kit/storybook-static/sb-addons/interactions-7/manager-bundle.js.html +121 -0
  216. package/coverage/ui-kit/storybook-static/sb-addons/links-0/index.html +116 -0
  217. package/coverage/ui-kit/storybook-static/sb-addons/links-0/manager-bundle.js.html +94 -0
  218. package/coverage/ui-kit/storybook-static/sb-addons/onboarding-6/index.html +116 -0
  219. package/coverage/ui-kit/storybook-static/sb-addons/onboarding-6/manager-bundle.js.html +1588 -0
  220. package/coverage/ui-kit/storybook-static/sb-addons/viewport-8/index.html +116 -0
  221. package/coverage/ui-kit/storybook-static/sb-addons/viewport-8/manager-bundle.js.html +94 -0
  222. package/coverage/ui-kit/storybook-static/sb-manager/WithTooltip-V3YHNWJZ-LVYLGZW2.js.html +88 -0
  223. package/coverage/ui-kit/storybook-static/sb-manager/chunk-2IXBUOFS.js.html +106 -0
  224. package/coverage/ui-kit/storybook-static/sb-manager/chunk-INSKDKQB.js.html +1129 -0
  225. package/coverage/ui-kit/storybook-static/sb-manager/chunk-NGTUFCUO.js.html +112 -0
  226. package/coverage/ui-kit/storybook-static/sb-manager/chunk-UUEAOBSN.js.html +1303 -0
  227. package/coverage/ui-kit/storybook-static/sb-manager/chunk-ZEU7PDD3.js.html +88 -0
  228. package/coverage/ui-kit/storybook-static/sb-manager/formatter-SWP5E3XI-7BGIK6BL.js.html +553 -0
  229. package/coverage/ui-kit/storybook-static/sb-manager/globals-module-info.js.html +88 -0
  230. package/coverage/ui-kit/storybook-static/sb-manager/globals.js.html +88 -0
  231. package/coverage/ui-kit/storybook-static/sb-manager/index.html +281 -0
  232. package/coverage/ui-kit/storybook-static/sb-manager/index.js.html +88 -0
  233. package/coverage/ui-kit/storybook-static/sb-manager/runtime.js.html +88 -0
  234. package/coverage/ui-kit/storybook-static/sb-manager/syntaxhighlighter-V7JZZA35-DXZCI2WR.js.html +88 -0
  235. package/coverage/ui-kit/storybook-static/sb-preview/globals.js.html +88 -0
  236. package/coverage/ui-kit/storybook-static/sb-preview/index.html +131 -0
  237. package/coverage/ui-kit/storybook-static/sb-preview/runtime.js.html +421 -0
  238. package/coverage/ui-kit/storybook-static/templates-DeterminedErrorDialogStep-stories.3cc14214.iframe.bundle.js.html +85 -0
  239. package/dist/global.css +197 -0
  240. package/dist/global.css.map +1 -0
  241. package/dist/index.cjs +10864 -21
  242. package/dist/index.cjs.map +1 -1
  243. package/dist/index.css +2212 -8491
  244. package/dist/index.css.map +1 -1
  245. package/dist/index.modern.js +8354 -22
  246. package/dist/index.modern.js.map +1 -1
  247. package/dist/index.module.js +10784 -23
  248. package/dist/index.module.js.map +1 -1
  249. package/dist/index.umd.js +10855 -25
  250. package/dist/index.umd.js.map +1 -1
  251. package/index.js +1 -1
  252. package/package.json +36 -9
  253. package/src/common-apis/adapters/axiosAdapter.js +35 -0
  254. package/src/common-apis/adapters/qrUtils.js +18 -0
  255. package/src/common-apis/amountUtils.js +359 -0
  256. package/src/common-apis/errorUtils.js +42 -0
  257. package/src/common-apis/external-apis/apiGroups.js +55 -0
  258. package/src/common-apis/external-apis/ipAddressProviders.js +89 -0
  259. package/src/common-apis/fiatCurrenciesService.js +153 -0
  260. package/src/common-apis/globalConstants.jsx +3 -0
  261. package/src/common-apis/models/blockchain.js +10 -0
  262. package/src/common-apis/models/coin.js +153 -0
  263. package/src/common-apis/models/protocol.js +5 -0
  264. package/src/common-apis/tests/amountUtils/composeRateText.test.js +152 -0
  265. package/src/common-apis/tests/integration/external-apis/ipAddressProviders/getClientIpAddress.test.js +12 -0
  266. package/src/common-apis/utils/cache.js +242 -0
  267. package/src/common-apis/utils/emailAPI.js +16 -0
  268. package/src/common-apis/utils/logging/logger.js +41 -0
  269. package/src/common-apis/utils/logging/logsStorage.js +61 -0
  270. package/src/common-apis/utils/postponeExecution.js +11 -0
  271. package/src/common-apis/utils/safeStringify.js +50 -0
  272. package/src/index.js +84 -0
  273. package/src/robust-api-caller/cacheAndConcurrentRequestsResolver.js +495 -0
  274. package/src/robust-api-caller/cachedRobustExternalApiCallerService.js +147 -0
  275. package/src/robust-api-caller/cancelProcessing.js +29 -0
  276. package/src/robust-api-caller/concurrentCalculationsMetadataHolder.js +75 -0
  277. package/src/robust-api-caller/externalApiProvider.js +156 -0
  278. package/src/robust-api-caller/externalServicesStatsCollector.js +78 -0
  279. package/src/robust-api-caller/robustExternalAPICallerService.js +304 -0
  280. package/src/robust-api-caller/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/_performCallAttempt.test.js +533 -0
  281. package/src/robust-api-caller/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/callExternalAPI.test.js +532 -0
  282. package/src/robust-api-caller/tests/robustExternalAPICallerService/robustExternalAPICallerService/constructor.test.js +19 -0
  283. package/src/swaps-lib/external-apis/letsExchangeSwapProvider.js +476 -0
  284. package/src/swaps-lib/external-apis/swapProvider.js +491 -0
  285. package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +550 -0
  286. package/src/swaps-lib/models/baseSwapCreationInfo.js +46 -0
  287. package/src/swaps-lib/models/existingSwap.js +73 -0
  288. package/src/swaps-lib/models/existingSwapWithFiatData.js +128 -0
  289. package/src/swaps-lib/services/publicSwapService.js +671 -0
  290. package/src/swaps-lib/test/external-apis/swapProvider/getAllSupportedCurrencies.test.js +63 -0
  291. package/src/swaps-lib/test/external-apis/swapProvider/getDepositCurrencies.test.js +73 -0
  292. package/src/swaps-lib/test/external-apis/swapProvider/getWithdrawalCurrencies.test.js +102 -0
  293. package/src/swaps-lib/test/external-apis/swapProvider/removeProtocolNameFromCoinName.test.js +152 -0
  294. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +538 -0
  295. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/createSwap.test.js +1249 -0
  296. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getSwapInfo.test.js +1700 -0
  297. package/src/swaps-lib/test/utils/swapUtils/safeHandleRequestsLimitExceeding.test.js +80 -0
  298. package/src/swaps-lib/utils/swapUtils.js +195 -0
  299. package/{styles → src/ui-kit/assets/styles}/_functions.scss +5 -0
  300. package/{styles → src/ui-kit/assets/styles}/_mixins.scss +2 -2
  301. package/{styles → src/ui-kit/assets/styles}/_placeholder.scss +3 -3
  302. package/{styles → src/ui-kit/assets/styles}/_variables.scss +17 -15
  303. package/src/ui-kit/assets/styles/fonts/NunitoSans-Bold.ttf +0 -0
  304. package/src/ui-kit/assets/styles/fonts/NunitoSans-ExtraBold.ttf +0 -0
  305. package/src/ui-kit/assets/styles/fonts/NunitoSans-Light.ttf +0 -0
  306. package/src/ui-kit/assets/styles/fonts/NunitoSans-Regular.ttf +0 -0
  307. package/src/ui-kit/assets/styles/fonts/NunitoSans-SemiBold.ttf +0 -0
  308. package/src/ui-kit/assets/styles/global.scss +165 -0
  309. package/src/ui-kit/assets/styles/index.scss +10 -0
  310. package/src/ui-kit/assets/wrappedImages/arrowIcon.jsx +13 -0
  311. package/src/ui-kit/assets/wrappedImages/arrowTosca.jsx +14 -0
  312. package/src/ui-kit/assets/wrappedImages/arrowWhite.jsx +14 -0
  313. package/src/ui-kit/assets/wrappedImages/darkRectangle.jsx +7 -0
  314. package/src/ui-kit/assets/wrappedImages/determinedError.jsx +118 -0
  315. package/src/ui-kit/assets/wrappedImages/failedValidationIcon.jsx +39 -0
  316. package/src/ui-kit/assets/wrappedImages/infoIcon.jsx +16 -0
  317. package/src/ui-kit/assets/wrappedImages/noticeQuestionIcon.jsx +54 -0
  318. package/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx +26 -0
  319. package/src/ui-kit/assets/wrappedImages/walletIcon.jsx +22 -0
  320. package/src/ui-kit/components/atoms/AssetIcon/AssetIcon.jsx +57 -0
  321. package/{stories → src/ui-kit/components}/atoms/AssetIcon/asset-icon.module.scss +1 -1
  322. package/src/ui-kit/components/atoms/AssetSelection/AssetSelection.jsx +68 -0
  323. package/src/ui-kit/components/atoms/AssetSelection/asset-selection.module.scss +56 -0
  324. package/src/ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx +34 -0
  325. package/src/ui-kit/components/atoms/BackgroundTitle/background-title.module.scss +52 -0
  326. package/src/ui-kit/components/atoms/InformationMessage/InformationMessage.jsx +51 -0
  327. package/src/ui-kit/components/atoms/InformationMessage/information-message.module.scss +38 -0
  328. package/src/ui-kit/components/atoms/Input/Input.jsx +183 -0
  329. package/src/ui-kit/components/atoms/Input/input.module.scss +107 -0
  330. package/{stories → src/ui-kit/components}/atoms/LoadingDots/LoadingDots.jsx +8 -28
  331. package/{stories → src/ui-kit/components}/atoms/LoadingDots/LoadingDots.module.scss +3 -2
  332. package/src/ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx +64 -0
  333. package/src/ui-kit/components/atoms/NoticeIcon/notice-icon.module.scss +14 -0
  334. package/src/ui-kit/components/atoms/QrCode/QrCode.jsx +50 -0
  335. package/src/ui-kit/components/atoms/QrCode/qr-code.module.scss +15 -0
  336. package/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx +30 -0
  337. package/src/ui-kit/components/atoms/RateSelector/rate-selector.module.scss +47 -0
  338. package/{stories → src/ui-kit/components}/atoms/SupportChat/SupportChat.jsx +5 -1
  339. package/src/ui-kit/components/atoms/Textarea/Textarea.jsx +148 -0
  340. package/src/ui-kit/components/atoms/Textarea/textarea.module.scss +71 -0
  341. package/src/ui-kit/components/atoms/TitleBox/TitleBox.jsx +141 -0
  342. package/src/ui-kit/components/atoms/TitleBox/title-box.module.scss +32 -0
  343. package/src/ui-kit/components/atoms/Tooltip/Tooltip.jsx +77 -0
  344. package/src/ui-kit/components/atoms/Tooltip/tooltip.module.scss +237 -0
  345. package/src/ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx +76 -0
  346. package/src/ui-kit/components/atoms/TwoLinesOfText/lines-of-text.module.scss +65 -0
  347. package/src/ui-kit/components/atoms/Validation/Validation.jsx +41 -0
  348. package/src/ui-kit/components/atoms/Validation/validation.module.scss +15 -0
  349. package/{stories → src/ui-kit/components}/atoms/buttons/Button/Button.jsx +24 -50
  350. package/{stories → src/ui-kit/components}/atoms/buttons/Button/Button.module.scss +1 -1
  351. package/src/ui-kit/components/atoms/buttons/Close/Close.jsx +58 -0
  352. package/src/ui-kit/components/atoms/buttons/Close/close.module.scss +75 -0
  353. package/src/ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx +112 -0
  354. package/src/ui-kit/components/atoms/buttons/LinkButton/link-button.module.scss +49 -0
  355. package/src/ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx +110 -0
  356. package/src/ui-kit/components/atoms/buttons/RadioButtonWithText/radio-button-with-text.module.scss +86 -0
  357. package/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx +325 -0
  358. package/src/ui-kit/components/molecules/AmountInput/amount-input.module.scss +199 -0
  359. package/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx +511 -0
  360. package/src/ui-kit/components/molecules/CoinPicker/coin-picker.module.scss +207 -0
  361. package/src/ui-kit/components/molecules/LineWithIconLink/LineWithIconLink.jsx +35 -0
  362. package/src/ui-kit/components/molecules/LineWithIconLink/line-with-icon-link.module.scss +25 -0
  363. package/src/ui-kit/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx +32 -0
  364. package/src/ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx +66 -0
  365. package/src/ui-kit/components/organisms/Dialog/Dialog.jsx +494 -0
  366. package/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx +122 -0
  367. package/src/ui-kit/components/organisms/Dialog/DialogButtons/dialog-buttons.module.scss +25 -0
  368. package/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx +538 -0
  369. package/src/ui-kit/components/organisms/Dialog/DialogStep/dialog-step.module.scss +381 -0
  370. package/src/ui-kit/components/organisms/Dialog/dialog.module.scss +226 -0
  371. package/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx +1330 -0
  372. package/src/ui-kit/components/organisms/SwapForm/swap-form.module.scss +134 -0
  373. package/src/ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx +77 -0
  374. package/src/ui-kit/hooks/useCallHandlingErrors.js +22 -0
  375. package/src/ui-kit/hooks/useIsHydrated.js +12 -0
  376. package/src/ui-kit/hooks/useReferredState.js +24 -0
  377. package/src/ui-kit/tests/utils/inputValueProviders/provideFormatOfFloatValueByInputString.test.js +132 -0
  378. package/src/ui-kit/tests/utils/urlQueryUtils/getQueryParameterValues.test.js +65 -0
  379. package/src/ui-kit/tests/utils/urlQueryUtils/saveQueryParameterAndValues.test.js +104 -0
  380. package/src/ui-kit/utils/inputValueProviders.js +50 -0
  381. package/src/ui-kit/utils/textUtils.js +18 -0
  382. package/src/ui-kit/utils/uiUtils.js +12 -0
  383. package/src/ui-kit/utils/urlQueryUtils.js +62 -0
  384. package/stories/stubs/exampleContent.jsx +20 -0
  385. package/stories/atoms/AssetIcon/AssetIcon.jsx +0 -55
  386. package/stories/index.js +0 -4
  387. package/styles/_global-classes.scss +0 -433
  388. package/styles/fonts/NunitoSans-Bold.ttf +0 -0
  389. package/styles/fonts/NunitoSans-ExtraBold.ttf +0 -0
  390. package/styles/fonts/NunitoSans-Light.ttf +0 -0
  391. package/styles/fonts/NunitoSans-Regular.ttf +0 -0
  392. package/styles/fonts/NunitoSans-SemiBold.ttf +0 -0
  393. package/styles/global-styles-index.scss +0 -74
  394. package/styles/index.scss +0 -33
  395. /package/{styles → src/ui-kit/assets/styles}/colors/_light-colors.scss +0 -0
  396. /package/{styles → src/ui-kit/assets/styles}/colors/_solid-colors.scss +0 -0
  397. /package/{styles → src/ui-kit/assets/styles}/size/_margin-size.scss +0 -0
  398. /package/{styles → src/ui-kit/assets/styles}/size/_padding-size.scss +0 -0
@@ -0,0 +1,80 @@
1
+ import sinon from "sinon";
2
+ import should from "should";
3
+
4
+ import { beforeEach, afterEach, describe, it } from "vitest";
5
+ import { Logger } from "../../../../common-apis/utils/logging/logger.js";
6
+ import { EmailsApi } from "../../../../common-apis/utils/emailAPI.js";
7
+ import { SwapUtils } from "../../../utils/swapUtils.js";
8
+
9
+ describe("SwapUtils", function () {
10
+ let sendEmailStub;
11
+
12
+ beforeEach(function () {
13
+ sendEmailStub = sinon.stub(EmailsApi, "sendEmail").resolves();
14
+ });
15
+
16
+ afterEach(function () {
17
+ sendEmailStub.restore();
18
+ });
19
+
20
+ describe("safeHandleRequestsLimitExceeding", function () {
21
+ it("Should ensure that sendEmail is called when safeHandleRequestsLimitExceeding is invoked", function () {
22
+ SwapUtils.safeHandleRequestsLimitExceeding();
23
+
24
+ sendEmailStub.called.should.be.true();
25
+ });
26
+
27
+ it("Should verify that sendEmail is called once", function () {
28
+ SwapUtils.safeHandleRequestsLimitExceeding();
29
+
30
+ sendEmailStub.callCount.should.equal(1);
31
+ });
32
+
33
+ it('Should ensure that sendEmail is called with the correct subject: "AUTOMATIC EMAIL - SWAPSPACE REQUESTS LIMIT EXCEEDED"', function () {
34
+ SwapUtils.safeHandleRequestsLimitExceeding();
35
+
36
+ sendEmailStub.calledWith("AUTOMATIC EMAIL - SWAPSPACE REQUESTS LIMIT EXCEEDED").should.be.true();
37
+ });
38
+
39
+ it('Should ensure that sendEmail is called with the correct body: "Requests limit exceeded. Urgently ask swapspace support for limit increasing"', function () {
40
+ SwapUtils.safeHandleRequestsLimitExceeding();
41
+
42
+ sendEmailStub
43
+ .calledWith(
44
+ sinon.match.any,
45
+ "Requests limit exceeded. Urgently ask swaps provider support for limit increasing"
46
+ )
47
+ .should.be.true();
48
+ });
49
+
50
+ it("Should handle an error thrown by the sendEmail function without crashing", function (done) {
51
+ sendEmailStub.rejects(new Error("Fake error for testing purposes"));
52
+
53
+ let error;
54
+ try {
55
+ SwapUtils.safeHandleRequestsLimitExceeding();
56
+ } catch (e) {
57
+ error = e;
58
+ }
59
+ (error === undefined).should.be.true();
60
+ });
61
+
62
+ it("Should ensure that safeHandleRequestsLimitExceeding does not return a value", function () {
63
+ const result = SwapUtils.safeHandleRequestsLimitExceeding();
64
+
65
+ (!result).should.be.true();
66
+ });
67
+
68
+ it("Should log a descriptive error message when a failure occurs", function (done) {
69
+ sendEmailStub.rejects(new Error("Fake error for testing purposes"));
70
+ const logStub = sinon.stub(Logger, "log");
71
+
72
+ SwapUtils.safeHandleRequestsLimitExceeding();
73
+
74
+ setTimeout(() => {
75
+ logStub.calledWithMatch(sinon.match("Failed to handle limit exceeding")).should.be.true();
76
+ logStub.restore();
77
+ }, 10);
78
+ });
79
+ });
80
+ });
@@ -0,0 +1,195 @@
1
+ import { BigNumber } from "bignumber.js";
2
+
3
+ import { AmountUtils } from "../../common-apis/amountUtils.js";
4
+ import { FiatCurrenciesService } from "../../common-apis/fiatCurrenciesService.js";
5
+ import { improveAndRethrow } from "../../common-apis/errorUtils.js";
6
+ import { ExistingSwapWithFiatData } from "../models/existingSwapWithFiatData.js";
7
+ import { EmailsApi } from "../../common-apis/utils/emailAPI.js";
8
+ import { SwapProvider } from "../external-apis/swapProvider.js";
9
+ import { Logger } from "../../common-apis/utils/logging/logger.js";
10
+ import { safeStringify } from "../../common-apis/utils/safeStringify.js";
11
+
12
+ export class SwapUtils {
13
+ /**
14
+ * Retrieves min and max limits for swapping giving currencies.
15
+ * Returns also conversion rate if possible with predefined amount logic.
16
+ * Rate is how many "to" coins does 1 "from" coin contain.
17
+ *
18
+ * In case of errors returns one of reasons
19
+ * - SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED
20
+ * - one of SwapProvider.COMMON_ERRORS.*
21
+ *
22
+ * @param swapProvider {SwapProvider}
23
+ * @param fromCoin {Coin} enabled coin (to swap amount from)
24
+ * @param toCoin {Coin}
25
+ * @param coinToCurrentFiatRate {string|null}
26
+ * @param fiatCurrencyDecimals {number|null}
27
+ * @return {Promise<{
28
+ * result: true,
29
+ * min: string,
30
+ * fiatMin: (number|null),
31
+ * max: string,
32
+ * fiatMax: (number|null),
33
+ * rate: (string|null),
34
+ * }|{
35
+ * result: false,
36
+ * reason: string
37
+ * }>}
38
+ */
39
+ static async getInitialSwapData(
40
+ swapProvider,
41
+ fromCoin,
42
+ toCoin,
43
+ coinToCurrentFiatRate = null,
44
+ fiatCurrencyDecimals = null
45
+ ) {
46
+ const loggerSource = "getInitialSwapData";
47
+ try {
48
+ /* We use some amount here that should fit at least some of the limits of the swap providers.
49
+ * So we are going to get some rate to be used as the default for the on-flight calculations before we get
50
+ * the exact rate (that should be retrieved by getSwapCreationInfo method) for a specific amount.
51
+ */
52
+ const defaultAmountUsd = BigNumber("300");
53
+ const coinUsdRate = await swapProvider.getCoinToUSDTRate(fromCoin);
54
+ const coinAmountForDefaultUsdAmount = AmountUtils.trim(
55
+ coinUsdRate.result ? defaultAmountUsd.div(coinUsdRate?.rate) : defaultAmountUsd,
56
+ fromCoin.digits
57
+ );
58
+ Logger.log(`Init: ${coinAmountForDefaultUsdAmount} ${fromCoin.ticker}->${toCoin.ticker}`, loggerSource);
59
+ const details = await swapProvider.getSwapInfo(fromCoin, toCoin, coinAmountForDefaultUsdAmount);
60
+ if (!details) {
61
+ throw new Error("The details are empty: " + safeStringify(details));
62
+ }
63
+ if (!details.result) {
64
+ Logger.log(`Failed with reason: ${details.reason}. ${fromCoin.ticker}->${toCoin.ticker}`, loggerSource);
65
+ if (
66
+ details?.reason === SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED ||
67
+ details?.reason === SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
68
+ ) {
69
+ return { result: false, reason: details.reason };
70
+ } else {
71
+ throw new Error("Unhandled error case: " + details?.reason);
72
+ }
73
+ }
74
+ let fiatMin = null;
75
+ let fiatMax = null;
76
+ const fiatRate = coinToCurrentFiatRate ?? coinUsdRate?.rate;
77
+ const fiatDecimals = fiatCurrencyDecimals ?? FiatCurrenciesService.getCurrencyDecimalCountByCode("USD");
78
+ if (fiatRate != null) {
79
+ fiatMin = BigNumber(details?.smallestMin).times(fiatRate).toFixed(fiatDecimals);
80
+ fiatMax = BigNumber(details?.greatestMax).times(fiatRate).toFixed(fiatDecimals);
81
+ }
82
+
83
+ const result = {
84
+ result: true,
85
+ min: details?.smallestMin,
86
+ fiatMin: fiatMin,
87
+ max: details?.greatestMax,
88
+ fiatMax: fiatMax,
89
+ rate: AmountUtils.trim(details.rate, 30),
90
+ };
91
+ Logger.log(`Returning: ${safeStringify(result)}`, loggerSource);
92
+ return result;
93
+ } catch (e) {
94
+ Logger.logError(e, loggerSource, `Failed to init swap: ${safeStringify(e)}`);
95
+ improveAndRethrow(e, loggerSource);
96
+ }
97
+ }
98
+
99
+ static safeHandleRequestsLimitExceeding() {
100
+ (async () => {
101
+ try {
102
+ await EmailsApi.sendEmail(
103
+ "AUTOMATIC EMAIL - SWAPSPACE REQUESTS LIMIT EXCEEDED",
104
+ "Requests limit exceeded. Urgently ask swaps provider support for limit increasing"
105
+ );
106
+ } catch (e) {
107
+ Logger.log(`Failed to handle limit exceeding ${safeStringify(e)}`, "_safeHandleRequestsLimitExceeding");
108
+ }
109
+ })();
110
+ }
111
+
112
+ /**
113
+ * If some swap is not found by id then there is no item in return list.
114
+ *
115
+ * @param swapProviders {SwapProvider[]} - Array of swap providers
116
+ * @param swapIds {string[]} - Array of swap IDs
117
+ * @return {Promise<{
118
+ * result: true,
119
+ * swaps: ExistingSwapWithFiatData[]
120
+ * }|{
121
+ * result: false,
122
+ * reason: string
123
+ * }>}
124
+ */
125
+ static async getExistingSwapsDetailsWithFiatAmounts(swapProviders, swapIds) {
126
+ try {
127
+ let allSwaps = [];
128
+ let remainingSwapIds = new Set(swapIds);
129
+ const failResults = [];
130
+ for (let provider of swapProviders) {
131
+ const result = await provider.getExistingSwapsDetailsAndStatus([...remainingSwapIds]);
132
+ if (result.result) {
133
+ const extendedSwaps = [];
134
+ for (let swap of result.swaps) {
135
+ if (swap.status === SwapProvider.SWAP_STATUSES.REFUNDED) {
136
+ const rate = await provider.getCoinToUSDTRate(swap.fromCoin);
137
+ extendedSwaps.push(
138
+ ExistingSwapWithFiatData.fromExistingSwap(
139
+ swap,
140
+ rate?.rate != null ? BigNumber(swap.fromAmount).times(rate.rate).toNumber() : null,
141
+ rate?.rate != null ? BigNumber(swap.toAmount).times(rate.rate).toNumber() : null,
142
+ "USD",
143
+ FiatCurrenciesService.getCurrencyDecimalCountByCode("USD")
144
+ )
145
+ );
146
+ } else {
147
+ const [fromCoinFiatRate, toCoinFiatRate] = await Promise.all([
148
+ provider.getCoinToUSDTRate(swap.fromCoin),
149
+ provider.getCoinToUSDTRate(swap.toCoin),
150
+ ]);
151
+ extendedSwaps.push(
152
+ ExistingSwapWithFiatData.fromExistingSwap(
153
+ swap,
154
+ fromCoinFiatRate?.rate != null
155
+ ? BigNumber(swap.fromAmount).times(fromCoinFiatRate.rate).toNumber()
156
+ : null,
157
+ toCoinFiatRate?.rate != null
158
+ ? BigNumber(swap.toAmount).times(toCoinFiatRate.rate).toNumber()
159
+ : null,
160
+ "USD",
161
+ FiatCurrenciesService.getCurrencyDecimalCountByCode("USD")
162
+ )
163
+ );
164
+ }
165
+ remainingSwapIds.delete(swap.id);
166
+ }
167
+ allSwaps = allSwaps.concat(extendedSwaps);
168
+
169
+ // Stop if we have retrieved all swaps
170
+ if (allSwaps.length >= swapIds.length) {
171
+ break;
172
+ }
173
+ } else {
174
+ failResults.push(result);
175
+ }
176
+ }
177
+
178
+ if (swapIds.length > 0 && allSwaps.length === 0 && failResults.length > 0) {
179
+ const failReasons = failResults.map(r => r.reason);
180
+ return {
181
+ result: false,
182
+ reason: failReasons.find(r => r !== SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED)
183
+ ? failReasons.join("\n")
184
+ : SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED,
185
+ };
186
+ }
187
+ return {
188
+ result: true,
189
+ swaps: allSwaps,
190
+ };
191
+ } catch (e) {
192
+ improveAndRethrow(e, "getExistingSwapsDetailsWithFiatAmounts");
193
+ }
194
+ }
195
+ }
@@ -1,3 +1,8 @@
1
+ @use "size/margin-size" as *;
2
+ @use "size/padding-size" as *;
3
+ @use "colors/solid-colors" as *;
4
+ @use "colors/light-colors" as *;
5
+
1
6
  @function SolidColor($color) {
2
7
  @return map_get($solidColor, $color);
3
8
  }
@@ -1,5 +1,5 @@
1
- @import "variables";
2
- @import "functions";
1
+ @use "variables" as *;
2
+ @use "functions" as *;
3
3
 
4
4
  @mixin typograpy($tag) {
5
5
  @if ($tag == "h1") {
@@ -1,5 +1,5 @@
1
- @import "variables";
2
- @import "functions";
1
+ @use "variables" as *;
2
+ @use "functions" as *;
3
3
 
4
4
  %container-padding {
5
5
  padding: Padding("50");
@@ -10,7 +10,7 @@
10
10
  }
11
11
 
12
12
  %font {
13
- font-family: NunitoSans;
13
+ // font-family: NunitoSans;
14
14
  }
15
15
 
16
16
  %text-very-bold {
@@ -1,29 +1,28 @@
1
- @import "colors/solid-colors";
2
- @import "colors/light-colors";
3
- @import "size/margin-size";
4
- @import "size/padding-size";
1
+ @use "colors/solid-colors" as *;
2
+ @use "colors/light-colors" as *;
3
+ @use "size/margin-size" as *;
4
+ @use "size/padding-size" as *;
5
+ @use "functions" as *;
5
6
 
6
7
  $borderRadius: 16px;
7
- $background: linear-gradient(
8
- 39deg,
9
- #6fdfa0 0%,
10
- #405db0 81%,
11
- #405db0 81%,
12
- #3b5bb6 81%
13
- );
8
+ $background: linear-gradient(39deg, #6fdfa0 0%, #405db0 81%, #405db0 81%, #3b5bb6 81%);
14
9
  $white: #ffffff;
15
10
 
16
11
  $separatorBorder: 0.5px solid SolidColor("smoke");
17
12
  $buttonBorder: 2px solid SolidColor("tosca");
18
13
  $buttonBorderWhite: 2px solid $white;
19
14
 
20
- $shadowOutlineStatic: 0px 0px 0px 1px rgba(0, 0, 0, 0) inset,
15
+ $shadowOutlineStatic:
16
+ 0px 0px 0px 1px rgba(0, 0, 0, 0) inset,
21
17
  0px 0px 3px 0px rgba(0, 0, 0, 0);
22
- $shadowOutlineHover: 0px 0px 0px 1px LightColor("dark-20") inset,
18
+ $shadowOutlineHover:
19
+ 0px 0px 0px 1px LightColor("dark-20") inset,
23
20
  0px 0px 3px 0px rgba(0, 0, 0, 0);
24
- $shadowOutlineActive: 0px 0px 0px 1px #16cdd6 inset,
21
+ $shadowOutlineActive:
22
+ 0px 0px 0px 1px #16cdd6 inset,
25
23
  0px 0px 3px 0px rgba(22, 205, 214, 0.3);
26
- $shadowOutlineError: 0px 0px 0px 1px #ee6a7d inset,
24
+ $shadowOutlineError:
25
+ 0px 0px 0px 1px #ee6a7d inset,
27
26
  0px 0px 3px 0px rgba(#ee6a7d, 0.3);
28
27
 
29
28
  $transitionEaseOut: cubic-bezier(0.22, 0.61, 0.36, 1);
@@ -44,3 +43,6 @@ $medium: 400;
44
43
  $regular: 300;
45
44
 
46
45
  $letterSpacing: 0.5px;
46
+
47
+ // SSR landings width
48
+ $landingMaxWidth: 1172px;
@@ -0,0 +1,165 @@
1
+ @use "mixins" as *;
2
+ @use "functions" as *;
3
+ @use "placeholder" as *;
4
+ @use "variables" as *;
5
+
6
+ // Global classes
7
+
8
+ .container {
9
+ max-width: 1260px;
10
+ margin: 0 auto;
11
+ @extend %container-padding;
12
+ }
13
+
14
+ .background-shine {
15
+ position: absolute;
16
+ left: -165px;
17
+ top: -300px;
18
+ z-index: -1;
19
+
20
+ @media (max-width: $phone-width) {
21
+ left: -165px;
22
+ top: -103px;
23
+ width: 648px;
24
+ }
25
+ }
26
+
27
+ .path {
28
+ width: 100%;
29
+ height: 1px;
30
+ background: LightColor("white-20");
31
+ }
32
+
33
+ .line {
34
+ width: 100%;
35
+ height: 1px;
36
+ border-bottom: 0.5px solid SolidColor("smoke");
37
+ }
38
+
39
+ .skeleton {
40
+ background: SolidColor("lightsmoke");
41
+ animation: skeleton-animate 1s 1s infinite ease-in-out;
42
+ }
43
+
44
+ .skeleton-dark {
45
+ background: LightColor("dark-20");
46
+ animation: skeleton-dark-animate 1s 1s infinite ease-in-out;
47
+ }
48
+
49
+ .skeleton-transparent {
50
+ background: rgba($white, 0.2);
51
+ animation: skeleton-transparent-animate 1s 1s infinite ease-in-out;
52
+ }
53
+
54
+ .semi-transparent {
55
+ opacity: 0.5;
56
+ }
57
+
58
+ @keyframes skeleton-animate {
59
+ 0% {
60
+ background: #eaeaea;
61
+ }
62
+ 50% {
63
+ background: SolidColor("lightsmoke");
64
+ }
65
+ 100% {
66
+ background: #eaeaea;
67
+ }
68
+ }
69
+
70
+ @keyframes skeleton-dark-animate {
71
+ 0% {
72
+ background: LightColor("dark-20");
73
+ }
74
+ 50% {
75
+ background: LightColor("grey-20");
76
+ }
77
+ 100% {
78
+ background: LightColor("dark-20");
79
+ }
80
+ }
81
+
82
+ @keyframes skeleton-transparent-animate {
83
+ 0% {
84
+ background: rgba($white, 0.2);
85
+ }
86
+ 50% {
87
+ background: rgba($white, 0.1);
88
+ }
89
+ 100% {
90
+ background: rgba($white, 0.2);
91
+ }
92
+ }
93
+
94
+ // Tag-level rules
95
+
96
+ a {
97
+ text-decoration: none;
98
+ }
99
+
100
+ td {
101
+ padding: 0;
102
+ }
103
+
104
+ /* Chrome, Safari, Edge, Opera */
105
+ input::-webkit-outer-spin-button,
106
+ input::-webkit-inner-spin-button {
107
+ -webkit-appearance: none;
108
+ margin: 0;
109
+ }
110
+
111
+ /* Firefox */
112
+ input[type="number"] {
113
+ -moz-appearance: textfield;
114
+ }
115
+
116
+ textarea {
117
+ -webkit-appearance: none;
118
+ -moz-appearance: none;
119
+ appearance: none;
120
+ }
121
+
122
+ * {
123
+ outline: none !important;
124
+ box-sizing: border-box;
125
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
126
+ }
127
+
128
+ html {
129
+ background-color: SolidColor("dark");
130
+ }
131
+
132
+ body {
133
+ margin: 0;
134
+ width: 100%;
135
+ overflow-x: hidden;
136
+ overflow-y: auto;
137
+ }
138
+
139
+ h1 {
140
+ @include typograpy("h1");
141
+ }
142
+
143
+ h2 {
144
+ @include typograpy("h2");
145
+ }
146
+
147
+ h3 {
148
+ @include typograpy("h3");
149
+ }
150
+
151
+ h4 {
152
+ @include typograpy("h4");
153
+ }
154
+
155
+ h5 {
156
+ @include typograpy("h5");
157
+ }
158
+
159
+ h6 {
160
+ @include typograpy("h6");
161
+ }
162
+
163
+ p {
164
+ @include typograpy("p");
165
+ }
@@ -0,0 +1,10 @@
1
+ @forward "colors/solid-colors";
2
+ @forward "colors/light-colors";
3
+
4
+ @forward "size/margin-size";
5
+ @forward "size/padding-size";
6
+
7
+ @forward "variables";
8
+ @forward "placeholder";
9
+ @forward "mixins";
10
+ @forward "functions";
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+
3
+ export default () => (
4
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
5
+ <path
6
+ d="M12.2431 6L8.00045 10.2426L3.75781 6"
7
+ stroke="#232d42"
8
+ stroke-width="2"
9
+ stroke-linecap="round"
10
+ stroke-linejoin="round"
11
+ />
12
+ </svg>
13
+ );
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+
3
+ // Originally: arrow-tosca.svg
4
+ export default () => (
5
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
6
+ <path
7
+ d="M12.2431 6L8.00045 10.2426L3.75781 6"
8
+ stroke="#16CDD6"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ />
13
+ </svg>
14
+ );
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+
3
+ // Originally: arrow-white.svg
4
+ export default () => (
5
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
6
+ <path
7
+ d="M12.2431 6L8.00045 10.2426L3.75781 6"
8
+ stroke="#fff"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ />
13
+ </svg>
14
+ );
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+
3
+ export default () => (
4
+ <svg width="25" height="13" viewBox="0 0 25 13" fill="none" xmlns="http://www.w3.org/2000/svg">
5
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12.5 13L25 0H0L12.5 13Z" fill="#232D42" />
6
+ </svg>
7
+ );