@rabbitio/ui-kit 1.0.0-beta.11 → 1.0.0-beta.111

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 (381) hide show
  1. package/.env.example +1 -0
  2. package/.gitlab-ci.yml +29 -0
  3. package/.husky/commit-msg +19 -0
  4. package/.husky/pre-push +1 -0
  5. package/README.md +14 -4
  6. package/coverage/base.css +224 -0
  7. package/coverage/block-navigation.js +87 -0
  8. package/coverage/clover.xml +17666 -0
  9. package/coverage/coverage-final.json +119 -0
  10. package/coverage/favicon.png +0 -0
  11. package/coverage/index.html +1001 -0
  12. package/coverage/prettify.css +1 -0
  13. package/coverage/prettify.js +2 -0
  14. package/coverage/rabbit-ui-kit/index.html +116 -0
  15. package/coverage/rabbit-ui-kit/index.js.html +88 -0
  16. package/coverage/rabbit-ui-kit/src/common-apis/adapters/analyticsAdapters/googleAnalyticsAdapter.js.html +151 -0
  17. package/coverage/rabbit-ui-kit/src/common-apis/adapters/analyticsAdapters/index.html +146 -0
  18. package/coverage/rabbit-ui-kit/src/common-apis/adapters/analyticsAdapters/metrikaAdapter.js.html +172 -0
  19. package/coverage/rabbit-ui-kit/src/common-apis/adapters/analyticsAdapters/mixpanelAdapter.js.html +199 -0
  20. package/coverage/rabbit-ui-kit/src/common-apis/adapters/axiosAdapter.js.html +190 -0
  21. package/coverage/rabbit-ui-kit/src/common-apis/adapters/index.html +131 -0
  22. package/coverage/rabbit-ui-kit/src/common-apis/adapters/qrUtils.js.html +139 -0
  23. package/coverage/rabbit-ui-kit/src/common-apis/external-apis/apiGroups.js.html +253 -0
  24. package/coverage/rabbit-ui-kit/src/common-apis/external-apis/emailAPI.js.html +133 -0
  25. package/coverage/rabbit-ui-kit/src/common-apis/external-apis/index.html +146 -0
  26. package/coverage/rabbit-ui-kit/src/common-apis/external-apis/ipAddressProviders.js.html +391 -0
  27. package/coverage/rabbit-ui-kit/src/common-apis/globalConstants.jsx.html +94 -0
  28. package/coverage/rabbit-ui-kit/src/common-apis/index.html +116 -0
  29. package/coverage/rabbit-ui-kit/src/common-apis/models/blockchain.js.html +115 -0
  30. package/coverage/rabbit-ui-kit/src/common-apis/models/coin.js.html +829 -0
  31. package/coverage/rabbit-ui-kit/src/common-apis/models/index.html +146 -0
  32. package/coverage/rabbit-ui-kit/src/common-apis/models/protocol.js.html +100 -0
  33. package/coverage/rabbit-ui-kit/src/common-apis/services/fiatCurrenciesService.js.html +544 -0
  34. package/coverage/rabbit-ui-kit/src/common-apis/services/index.html +116 -0
  35. package/coverage/rabbit-ui-kit/src/common-apis/utils/amountUtils.js.html +1234 -0
  36. package/coverage/rabbit-ui-kit/src/common-apis/utils/cache.js.html +811 -0
  37. package/coverage/rabbit-ui-kit/src/common-apis/utils/errorUtils.js.html +211 -0
  38. package/coverage/rabbit-ui-kit/src/common-apis/utils/index.html +191 -0
  39. package/coverage/rabbit-ui-kit/src/common-apis/utils/logging/index.html +131 -0
  40. package/coverage/rabbit-ui-kit/src/common-apis/utils/logging/logger.js.html +211 -0
  41. package/coverage/rabbit-ui-kit/src/common-apis/utils/logging/logsStorage.js.html +268 -0
  42. package/coverage/rabbit-ui-kit/src/common-apis/utils/postponeExecution.js.html +118 -0
  43. package/coverage/rabbit-ui-kit/src/common-apis/utils/rabbitTicker.js.html +157 -0
  44. package/coverage/rabbit-ui-kit/src/common-apis/utils/safeStringify.js.html +235 -0
  45. package/coverage/rabbit-ui-kit/src/index.html +116 -0
  46. package/coverage/rabbit-ui-kit/src/index.js.html +382 -0
  47. package/coverage/rabbit-ui-kit/src/robust-api-caller/cacheAndConcurrentRequestsResolver.js.html +1660 -0
  48. package/coverage/rabbit-ui-kit/src/robust-api-caller/cachedRobustExternalApiCallerService.js.html +526 -0
  49. package/coverage/rabbit-ui-kit/src/robust-api-caller/cancelProcessing.js.html +172 -0
  50. package/coverage/rabbit-ui-kit/src/robust-api-caller/concurrentCalculationsMetadataHolder.js.html +310 -0
  51. package/coverage/rabbit-ui-kit/src/robust-api-caller/externalApiProvider.js.html +553 -0
  52. package/coverage/rabbit-ui-kit/src/robust-api-caller/externalServicesStatsCollector.js.html +319 -0
  53. package/coverage/rabbit-ui-kit/src/robust-api-caller/index.html +206 -0
  54. package/coverage/rabbit-ui-kit/src/robust-api-caller/robustExternalAPICallerService.js.html +997 -0
  55. package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/exolixSwapProvider.js.html +1891 -0
  56. package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/goexmeSwapProvider.js.html +2077 -0
  57. package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/index.html +191 -0
  58. package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/letsExchangeSwapProvider.js.html +1633 -0
  59. package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapProvider.js.html +1825 -0
  60. package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +1924 -0
  61. package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/utils.js.html +163 -0
  62. package/coverage/rabbit-ui-kit/src/swaps-lib/models/baseSwapCreationInfo.js.html +319 -0
  63. package/coverage/rabbit-ui-kit/src/swaps-lib/models/existingSwap.js.html +514 -0
  64. package/coverage/rabbit-ui-kit/src/swaps-lib/models/existingSwapWithFiatData.js.html +529 -0
  65. package/coverage/rabbit-ui-kit/src/swaps-lib/models/index.html +176 -0
  66. package/coverage/rabbit-ui-kit/src/swaps-lib/models/partner.js.html +166 -0
  67. package/coverage/rabbit-ui-kit/src/swaps-lib/models/swapProviderCoinInfo.js.html +331 -0
  68. package/coverage/rabbit-ui-kit/src/swaps-lib/services/index.html +116 -0
  69. package/coverage/rabbit-ui-kit/src/swaps-lib/services/publicSwapService.js.html +1570 -0
  70. package/coverage/rabbit-ui-kit/src/swaps-lib/utils/index.html +116 -0
  71. package/coverage/rabbit-ui-kit/src/swaps-lib/utils/swapUtils.js.html +706 -0
  72. package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/arrowIcon.jsx.html +124 -0
  73. package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/arrowTosca.jsx.html +127 -0
  74. package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/arrowWhite.jsx.html +127 -0
  75. package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/darkRectangle.jsx.html +106 -0
  76. package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/determinedError.jsx.html +439 -0
  77. package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/failedValidationIcon.jsx.html +202 -0
  78. package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/index.html +281 -0
  79. package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/infoIcon.jsx.html +133 -0
  80. package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/messageIcon.jsx.html +346 -0
  81. package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/noticeQuestionIcon.jsx.html +247 -0
  82. package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx.html +163 -0
  83. package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/supportDialogImage.jsx.html +268 -0
  84. package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/walletIcon.jsx.html +151 -0
  85. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetIcon/AssetIcon.jsx.html +256 -0
  86. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetIcon/index.html +116 -0
  87. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetSelection/AssetSelection.jsx.html +289 -0
  88. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetSelection/index.html +116 -0
  89. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +187 -0
  90. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/BackgroundTitle/index.html +116 -0
  91. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/InformationMessage/InformationMessage.jsx.html +238 -0
  92. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/InformationMessage/index.html +116 -0
  93. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Input/Input.jsx.html +634 -0
  94. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Input/index.html +116 -0
  95. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/LoadingDots/LoadingDots.jsx.html +196 -0
  96. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/LoadingDots/index.html +116 -0
  97. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx.html +277 -0
  98. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/NoticeIcon/index.html +116 -0
  99. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/QrCode/QrCode.jsx.html +199 -0
  100. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/QrCode/index.html +116 -0
  101. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx.html +175 -0
  102. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/RateSelector/index.html +116 -0
  103. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/SupportChat/SupportChat.jsx.html +217 -0
  104. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/SupportChat/index.html +116 -0
  105. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Textarea/Textarea.jsx.html +529 -0
  106. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Textarea/index.html +116 -0
  107. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TitleBox/TitleBox.jsx.html +508 -0
  108. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TitleBox/index.html +116 -0
  109. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Tooltip/Tooltip.jsx.html +316 -0
  110. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Tooltip/index.html +116 -0
  111. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx.html +313 -0
  112. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/index.html +116 -0
  113. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Validation/Validation.jsx.html +202 -0
  114. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Validation/index.html +116 -0
  115. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Button/Button.jsx.html +733 -0
  116. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Button/index.html +116 -0
  117. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Close/Close.jsx.html +259 -0
  118. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Close/index.html +116 -0
  119. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx.html +433 -0
  120. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/LinkButton/index.html +116 -0
  121. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +415 -0
  122. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/index.html +116 -0
  123. package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx.html +1429 -0
  124. package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/AmountInput/index.html +116 -0
  125. package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx.html +1474 -0
  126. package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/CoinPicker/index.html +116 -0
  127. package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/ColoredNotice/ColoredNotice.jsx.html +241 -0
  128. package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/ColoredNotice/index.html +116 -0
  129. package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/LineWithIconLink/LineWithIconLink.jsx.html +190 -0
  130. package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/LineWithIconLink/index.html +116 -0
  131. package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/LogoCarousel/LogoCarousel.jsx.html +307 -0
  132. package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/LogoCarousel/index.html +116 -0
  133. package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/SearchableCoinsList/SearchableCoinsList.jsx.html +427 -0
  134. package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/SearchableCoinsList/index.html +116 -0
  135. package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx.html +181 -0
  136. package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/TitledLineWithIconLink/index.html +116 -0
  137. package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +283 -0
  138. package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/CoinPickerDialogStep/index.html +116 -0
  139. package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/Dialog.jsx.html +1567 -0
  140. package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +481 -0
  141. package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/index.html +116 -0
  142. package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +1747 -0
  143. package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/index.html +116 -0
  144. package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/index.html +116 -0
  145. package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx.html +4228 -0
  146. package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/SwapForm/index.html +116 -0
  147. package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/WaitlistSubscription/WaitlistSubscription.jsx.html +559 -0
  148. package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/WaitlistSubscription/index.html +116 -0
  149. package/coverage/rabbit-ui-kit/src/ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx.html +316 -0
  150. package/coverage/rabbit-ui-kit/src/ui-kit/components/templates/DeterminedErrorDialogStep/index.html +116 -0
  151. package/coverage/rabbit-ui-kit/src/ui-kit/hooks/index.html +146 -0
  152. package/coverage/rabbit-ui-kit/src/ui-kit/hooks/useCallHandlingErrors.js.html +166 -0
  153. package/coverage/rabbit-ui-kit/src/ui-kit/hooks/useIsHydrated.js.html +121 -0
  154. package/coverage/rabbit-ui-kit/src/ui-kit/hooks/useReferredState.js.html +157 -0
  155. package/coverage/rabbit-ui-kit/src/ui-kit/utils/index.html +176 -0
  156. package/coverage/rabbit-ui-kit/src/ui-kit/utils/inputValueProviders.js.html +235 -0
  157. package/coverage/rabbit-ui-kit/src/ui-kit/utils/searchCoins.js.html +259 -0
  158. package/coverage/rabbit-ui-kit/src/ui-kit/utils/textUtils.js.html +139 -0
  159. package/coverage/rabbit-ui-kit/src/ui-kit/utils/uiUtils.js.html +121 -0
  160. package/coverage/rabbit-ui-kit/src/ui-kit/utils/urlQueryUtils.js.html +271 -0
  161. package/coverage/rabbit-ui-kit/stories/atoms/BackgroundTitle.stories.jsx.html +202 -0
  162. package/coverage/rabbit-ui-kit/stories/atoms/LinesOfText.stories.jsx.html +283 -0
  163. package/coverage/rabbit-ui-kit/stories/atoms/LoadingDots.stories.jsx.html +226 -0
  164. package/coverage/rabbit-ui-kit/stories/atoms/QrCode.stories.jsx.html +175 -0
  165. package/coverage/rabbit-ui-kit/stories/atoms/RateSelector.stories.jsx.html +136 -0
  166. package/coverage/rabbit-ui-kit/stories/atoms/Validation.stories.jsx.html +178 -0
  167. package/coverage/rabbit-ui-kit/stories/atoms/buttons/Button.stories.jsx.html +883 -0
  168. package/coverage/rabbit-ui-kit/stories/atoms/buttons/Close.stories.jsx.html +211 -0
  169. package/coverage/rabbit-ui-kit/stories/atoms/buttons/LinkButton.stories.jsx.html +301 -0
  170. package/coverage/rabbit-ui-kit/stories/atoms/buttons/index.html +146 -0
  171. package/coverage/rabbit-ui-kit/stories/atoms/index.html +191 -0
  172. package/coverage/rabbit-ui-kit/stories/molecules/AmountInput.stories.jsx.html +289 -0
  173. package/coverage/rabbit-ui-kit/stories/molecules/CoinPicker.stories.jsx.html +322 -0
  174. package/coverage/rabbit-ui-kit/stories/molecules/ColoredNotice.stories.jsx.html +178 -0
  175. package/coverage/rabbit-ui-kit/stories/molecules/LineWithIconLink.stories.jsx.html +154 -0
  176. package/coverage/rabbit-ui-kit/stories/molecules/LogoCarousel.stories.jsx.html +235 -0
  177. package/coverage/rabbit-ui-kit/stories/molecules/TitledLineWithIconLink.stories.jsx.html +160 -0
  178. package/coverage/rabbit-ui-kit/stories/molecules/index.html +191 -0
  179. package/coverage/rabbit-ui-kit/stories/organisms/Dialog/Dialog.stories.jsx.html +523 -0
  180. package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogButtons/DialogButtons.stories.jsx.html +328 -0
  181. package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogButtons/index.html +116 -0
  182. package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogStep/DialogStep.stories.jsx.html +337 -0
  183. package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogStep/index.html +116 -0
  184. package/coverage/rabbit-ui-kit/stories/organisms/Dialog/index.html +116 -0
  185. package/coverage/rabbit-ui-kit/stories/organisms/WaitlistSubscription.stories.jsx.html +151 -0
  186. package/coverage/rabbit-ui-kit/stories/organisms/index.html +116 -0
  187. package/coverage/rabbit-ui-kit/stories/stubs/coins.jsx.html +6880 -0
  188. package/coverage/rabbit-ui-kit/stories/stubs/exampleContent.jsx.html +145 -0
  189. package/coverage/rabbit-ui-kit/stories/stubs/index.html +131 -0
  190. package/coverage/rabbit-ui-kit/stories/templates/DeterminedErrorDialogStep.stories.jsx.html +190 -0
  191. package/coverage/rabbit-ui-kit/stories/templates/index.html +116 -0
  192. package/coverage/sort-arrow-sprite.png +0 -0
  193. package/coverage/sorter.js +196 -0
  194. package/dist/global.css +197 -0
  195. package/dist/global.css.map +1 -0
  196. package/dist/index.cjs +13003 -1052
  197. package/dist/index.cjs.map +1 -1
  198. package/dist/index.css +2350 -8491
  199. package/dist/index.css.map +1 -1
  200. package/dist/index.modern.js +9951 -847
  201. package/dist/index.modern.js.map +1 -1
  202. package/dist/index.module.js +12930 -1066
  203. package/dist/index.module.js.map +1 -1
  204. package/dist/index.umd.js +12994 -1055
  205. package/dist/index.umd.js.map +1 -1
  206. package/package.json +35 -9
  207. package/raw +1000 -0
  208. package/src/common-apis/adapters/analyticsAdapters/googleAnalyticsAdapter.js +22 -0
  209. package/src/common-apis/adapters/analyticsAdapters/metrikaAdapter.js +29 -0
  210. package/src/common-apis/adapters/analyticsAdapters/mixpanelAdapter.js +38 -0
  211. package/src/common-apis/adapters/axiosAdapter.js +35 -0
  212. package/src/common-apis/adapters/qrUtils.js +18 -0
  213. package/src/common-apis/external-apis/apiGroups.js +56 -0
  214. package/src/common-apis/external-apis/emailAPI.js +16 -0
  215. package/src/common-apis/external-apis/ipAddressProviders.js +102 -0
  216. package/src/common-apis/globalConstants.jsx +3 -0
  217. package/src/{common → common-apis}/models/coin.js +98 -7
  218. package/src/{common → common-apis/services}/fiatCurrenciesService.js +4 -12
  219. package/src/common-apis/tests/integration/external-apis/ipAddressProviders/getClientIpAddress.test.js +18 -0
  220. package/src/common-apis/tests/units/utils/amountUtils/composeRateText.test.js +152 -0
  221. package/src/{common → common-apis/utils}/amountUtils.js +100 -140
  222. package/src/{common → common-apis}/utils/cache.js +15 -41
  223. package/src/{common → common-apis/utils}/errorUtils.js +15 -0
  224. package/src/{common → common-apis}/utils/logging/logger.js +7 -13
  225. package/src/common-apis/utils/postponeExecution.js +11 -0
  226. package/src/common-apis/utils/rabbitTicker.js +24 -0
  227. package/src/index.js +90 -14
  228. package/src/robust-api-caller/cacheAndConcurrentRequestsResolver.js +525 -0
  229. package/src/robust-api-caller/cachedRobustExternalApiCallerService.js +147 -0
  230. package/src/robust-api-caller/cancelProcessing.js +29 -0
  231. package/src/robust-api-caller/concurrentCalculationsMetadataHolder.js +75 -0
  232. package/src/robust-api-caller/externalApiProvider.js +156 -0
  233. package/src/robust-api-caller/externalServicesStatsCollector.js +78 -0
  234. package/src/robust-api-caller/robustExternalAPICallerService.js +304 -0
  235. package/src/robust-api-caller/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/_performCallAttempt.test.js +533 -0
  236. package/src/robust-api-caller/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/callExternalAPI.test.js +532 -0
  237. package/src/robust-api-caller/tests/robustExternalAPICallerService/robustExternalAPICallerService/constructor.test.js +19 -0
  238. package/src/swaps-lib/external-apis/exolixSwapProvider.js +602 -0
  239. package/src/swaps-lib/external-apis/goexmeSwapProvider.js +664 -0
  240. package/src/swaps-lib/external-apis/letsExchangeSwapProvider.js +516 -0
  241. package/src/swaps-lib/external-apis/swapProvider.js +435 -24
  242. package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +613 -0
  243. package/src/swaps-lib/external-apis/utils.js +26 -0
  244. package/src/swaps-lib/models/baseSwapCreationInfo.js +78 -0
  245. package/src/swaps-lib/models/existingSwap.js +101 -16
  246. package/src/swaps-lib/models/existingSwapWithFiatData.js +148 -0
  247. package/src/swaps-lib/models/partner.js +27 -0
  248. package/src/swaps-lib/models/swapProviderCoinInfo.js +82 -0
  249. package/src/swaps-lib/services/publicSwapService.js +495 -0
  250. package/src/swaps-lib/test/external-apis/exolixSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +34 -0
  251. package/src/swaps-lib/test/external-apis/exolixSwapProvider/createSwap.test.js +1043 -0
  252. package/src/swaps-lib/test/external-apis/exolixSwapProvider/getSwapInfo.test.js +611 -0
  253. package/src/swaps-lib/test/external-apis/goexmeSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +148 -0
  254. package/src/swaps-lib/test/external-apis/goexmeSwapProvider/createSwap.test.js +115 -0
  255. package/src/swaps-lib/test/external-apis/goexmeSwapProvider/getSwapInfo.test.js +149 -0
  256. package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/PairSupport.int.test.js +97 -0
  257. package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/_fetchSupportedCurrenciesIfNeeded.int.test.js +171 -0
  258. package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/createSwap.int.test.js +239 -0
  259. package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/getSwapInfo.int.test.js +141 -0
  260. package/src/swaps-lib/test/external-apis/swapProvider/getAllSupportedCurrencies.test.js +63 -0
  261. package/src/swaps-lib/test/external-apis/swapProvider/getDepositCurrencies.test.js +73 -0
  262. package/src/swaps-lib/test/external-apis/swapProvider/getWithdrawalCurrencies.test.js +102 -0
  263. package/src/swaps-lib/test/external-apis/swapProvider/removeProtocolNameFromCoinName.test.js +152 -0
  264. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +536 -0
  265. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/createSwap.test.js +1214 -0
  266. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getSwapInfo.test.js +1743 -0
  267. package/src/swaps-lib/test/utils/swapUtils/safeHandleRequestsLimitExceeding.test.js +80 -0
  268. package/src/swaps-lib/utils/swapUtils.js +207 -0
  269. package/{styles → src/ui-kit/assets/styles}/_functions.scss +5 -0
  270. package/{styles → src/ui-kit/assets/styles}/_mixins.scss +2 -2
  271. package/{styles → src/ui-kit/assets/styles}/_placeholder.scss +3 -3
  272. package/{styles → src/ui-kit/assets/styles}/_variables.scss +17 -15
  273. package/src/ui-kit/assets/styles/fonts/NunitoSans-Bold.ttf +0 -0
  274. package/src/ui-kit/assets/styles/fonts/NunitoSans-ExtraBold.ttf +0 -0
  275. package/src/ui-kit/assets/styles/fonts/NunitoSans-Light.ttf +0 -0
  276. package/src/ui-kit/assets/styles/fonts/NunitoSans-Regular.ttf +0 -0
  277. package/src/ui-kit/assets/styles/fonts/NunitoSans-SemiBold.ttf +0 -0
  278. package/src/ui-kit/assets/styles/global.scss +171 -0
  279. package/src/ui-kit/assets/styles/index.scss +10 -0
  280. package/src/ui-kit/assets/wrappedImages/arrowIcon.jsx +13 -0
  281. package/src/ui-kit/assets/wrappedImages/arrowTosca.jsx +14 -0
  282. package/src/ui-kit/assets/wrappedImages/arrowWhite.jsx +14 -0
  283. package/src/ui-kit/assets/wrappedImages/darkRectangle.jsx +7 -0
  284. package/src/ui-kit/assets/wrappedImages/determinedError.jsx +118 -0
  285. package/src/ui-kit/assets/wrappedImages/failedValidationIcon.jsx +39 -0
  286. package/src/ui-kit/assets/wrappedImages/infoIcon.jsx +16 -0
  287. package/src/ui-kit/assets/wrappedImages/messageIcon.jsx +87 -0
  288. package/src/ui-kit/assets/wrappedImages/noticeQuestionIcon.jsx +54 -0
  289. package/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx +26 -0
  290. package/src/ui-kit/assets/wrappedImages/supportDialogImage.jsx +61 -0
  291. package/src/ui-kit/assets/wrappedImages/walletIcon.jsx +22 -0
  292. package/src/{components → ui-kit/components}/atoms/AssetIcon/AssetIcon.jsx +16 -14
  293. package/src/{components → ui-kit/components}/atoms/AssetIcon/asset-icon.module.scss +1 -1
  294. package/src/ui-kit/components/atoms/AssetSelection/AssetSelection.jsx +68 -0
  295. package/src/ui-kit/components/atoms/AssetSelection/asset-selection.module.scss +56 -0
  296. package/src/ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx +34 -0
  297. package/src/ui-kit/components/atoms/BackgroundTitle/background-title.module.scss +52 -0
  298. package/src/ui-kit/components/atoms/InformationMessage/InformationMessage.jsx +51 -0
  299. package/src/ui-kit/components/atoms/InformationMessage/information-message.module.scss +38 -0
  300. package/src/ui-kit/components/atoms/Input/Input.jsx +183 -0
  301. package/src/ui-kit/components/atoms/Input/input.module.scss +107 -0
  302. package/src/{components → ui-kit/components}/atoms/LoadingDots/LoadingDots.jsx +8 -28
  303. package/src/{components → ui-kit/components}/atoms/LoadingDots/LoadingDots.module.scss +3 -2
  304. package/src/ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx +64 -0
  305. package/src/ui-kit/components/atoms/NoticeIcon/notice-icon.module.scss +14 -0
  306. package/src/ui-kit/components/atoms/QrCode/QrCode.jsx +38 -0
  307. package/src/ui-kit/components/atoms/QrCode/qr-code.module.scss +8 -0
  308. package/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx +30 -0
  309. package/src/ui-kit/components/atoms/RateSelector/rate-selector.module.scss +47 -0
  310. package/src/{components → ui-kit/components}/atoms/SupportChat/SupportChat.jsx +5 -1
  311. package/src/ui-kit/components/atoms/Textarea/Textarea.jsx +148 -0
  312. package/src/ui-kit/components/atoms/Textarea/textarea.module.scss +71 -0
  313. package/src/ui-kit/components/atoms/TitleBox/TitleBox.jsx +141 -0
  314. package/src/ui-kit/components/atoms/TitleBox/title-box.module.scss +32 -0
  315. package/src/ui-kit/components/atoms/Tooltip/Tooltip.jsx +77 -0
  316. package/src/ui-kit/components/atoms/Tooltip/tooltip.module.scss +237 -0
  317. package/src/ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx +76 -0
  318. package/src/ui-kit/components/atoms/TwoLinesOfText/lines-of-text.module.scss +65 -0
  319. package/src/ui-kit/components/atoms/Validation/Validation.jsx +39 -0
  320. package/src/ui-kit/components/atoms/Validation/validation.module.scss +19 -0
  321. package/src/{components → ui-kit/components}/atoms/buttons/Button/Button.jsx +26 -45
  322. package/src/{components → ui-kit/components}/atoms/buttons/Button/Button.module.scss +1 -1
  323. package/src/ui-kit/components/atoms/buttons/Close/Close.jsx +58 -0
  324. package/src/ui-kit/components/atoms/buttons/Close/close.module.scss +75 -0
  325. package/src/ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx +116 -0
  326. package/src/ui-kit/components/atoms/buttons/LinkButton/link-button.module.scss +53 -0
  327. package/src/ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx +110 -0
  328. package/src/ui-kit/components/atoms/buttons/RadioButtonWithText/radio-button-with-text.module.scss +86 -0
  329. package/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx +448 -0
  330. package/src/ui-kit/components/molecules/AmountInput/amount-input.module.scss +233 -0
  331. package/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx +463 -0
  332. package/src/ui-kit/components/molecules/CoinPicker/coin-picker.module.scss +207 -0
  333. package/src/ui-kit/components/molecules/ColoredNotice/ColoredNotice.jsx +52 -0
  334. package/src/ui-kit/components/molecules/ColoredNotice/colored-notice.module.scss +36 -0
  335. package/src/ui-kit/components/molecules/LineWithIconLink/LineWithIconLink.jsx +35 -0
  336. package/src/ui-kit/components/molecules/LineWithIconLink/line-with-icon-link.module.scss +25 -0
  337. package/src/ui-kit/components/molecules/LogoCarousel/LogoCarousel.jsx +74 -0
  338. package/src/ui-kit/components/molecules/LogoCarousel/logo-carousel.module.scss +106 -0
  339. package/src/ui-kit/components/molecules/SearchableCoinsList/SearchableCoinsList.jsx +114 -0
  340. package/src/ui-kit/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx +32 -0
  341. package/src/ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx +66 -0
  342. package/src/ui-kit/components/organisms/Dialog/Dialog.jsx +494 -0
  343. package/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx +132 -0
  344. package/src/ui-kit/components/organisms/Dialog/DialogButtons/dialog-buttons.module.scss +25 -0
  345. package/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx +554 -0
  346. package/src/ui-kit/components/organisms/Dialog/DialogStep/dialog-step.module.scss +382 -0
  347. package/src/ui-kit/components/organisms/Dialog/dialog.module.scss +226 -0
  348. package/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx +1381 -0
  349. package/src/ui-kit/components/organisms/SwapForm/swap-form.module.scss +134 -0
  350. package/src/ui-kit/components/organisms/WaitlistSubscription/WaitlistSubscription.jsx +158 -0
  351. package/src/ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx +77 -0
  352. package/src/ui-kit/hooks/useCallHandlingErrors.js +27 -0
  353. package/src/ui-kit/hooks/useIsHydrated.js +12 -0
  354. package/src/ui-kit/hooks/useReferredState.js +24 -0
  355. package/src/ui-kit/tests/utils/inputValueProviders/provideFormatOfFloatValueByInputString.test.js +146 -0
  356. package/src/ui-kit/tests/utils/urlQueryUtils/getQueryParameterValues.test.js +65 -0
  357. package/src/ui-kit/tests/utils/urlQueryUtils/saveQueryParameterAndValues.test.js +104 -0
  358. package/src/ui-kit/utils/inputValueProviders.js +50 -0
  359. package/src/ui-kit/utils/searchCoins.js +58 -0
  360. package/src/ui-kit/utils/textUtils.js +18 -0
  361. package/src/ui-kit/utils/uiUtils.js +12 -0
  362. package/src/ui-kit/utils/urlQueryUtils.js +62 -0
  363. package/stories/font.scss +40 -0
  364. package/stories/stubs/coins.jsx +2266 -0
  365. package/stories/stubs/exampleContent.jsx +20 -0
  366. package/styles/_global-classes.scss +0 -433
  367. package/styles/fonts/NunitoSans-Bold.ttf +0 -0
  368. package/styles/fonts/NunitoSans-ExtraBold.ttf +0 -0
  369. package/styles/fonts/NunitoSans-Light.ttf +0 -0
  370. package/styles/fonts/NunitoSans-Regular.ttf +0 -0
  371. package/styles/fonts/NunitoSans-SemiBold.ttf +0 -0
  372. package/styles/global-styles-index.scss +0 -74
  373. package/styles/index.scss +0 -33
  374. /package/src/{common → common-apis}/models/blockchain.js +0 -0
  375. /package/src/{common → common-apis}/models/protocol.js +0 -0
  376. /package/src/{common → common-apis}/utils/logging/logsStorage.js +0 -0
  377. /package/src/{common → common-apis}/utils/safeStringify.js +0 -0
  378. /package/{styles → src/ui-kit/assets/styles}/colors/_light-colors.scss +0 -0
  379. /package/{styles → src/ui-kit/assets/styles}/colors/_solid-colors.scss +0 -0
  380. /package/{styles → src/ui-kit/assets/styles}/size/_margin-size.scss +0 -0
  381. /package/{styles → src/ui-kit/assets/styles}/size/_padding-size.scss +0 -0
package/src/index.js CHANGED
@@ -1,23 +1,99 @@
1
1
  // UI-KIT components
2
- export { Button } from "./components/atoms/buttons/Button/Button.jsx";
3
- export { LoadingDots } from "./components/atoms/LoadingDots/LoadingDots.jsx";
4
- export { SupportChat } from "./components/atoms/SupportChat/SupportChat.jsx";
5
- export { AssetIcon } from "./components/atoms/AssetIcon/AssetIcon.jsx";
2
+ export { Button } from "./ui-kit/components/atoms/buttons/Button/Button.jsx";
3
+ export { LoadingDots } from "./ui-kit/components/atoms/LoadingDots/LoadingDots.jsx";
4
+ export { SupportChat } from "./ui-kit/components/atoms/SupportChat/SupportChat.jsx";
5
+ export { AssetIcon } from "./ui-kit/components/atoms/AssetIcon/AssetIcon.jsx";
6
+ export { LinkButton, ICON_ROTATE_OPTIONS } from "./ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx";
7
+ export { DialogButtons } from "./ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx";
8
+ export { BackgroundTitle } from "./ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx";
9
+ export { Close, CLOSE_COLORS } from "./ui-kit/components/atoms/buttons/Close/Close.jsx";
10
+ export { Validation } from "./ui-kit/components/atoms/Validation/Validation.jsx";
11
+ export { Dialog, DIALOG_SIZES, DIALOG_TRANSITION_STEP_DURATION } from "./ui-kit/components/organisms/Dialog/Dialog.jsx";
12
+ export { DialogStep, DIALOG_STEP_CLASS } from "./ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx";
13
+ export { AssetSelection } from "./ui-kit/components/atoms/AssetSelection/AssetSelection.jsx";
14
+ export { Tooltip, TOOLTIP_POSITIONS } from "./ui-kit/components/atoms/Tooltip/Tooltip.jsx";
15
+ export { NoticeIcon } from "./ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx";
16
+ export { TitleBox } from "./ui-kit/components/atoms/TitleBox/TitleBox.jsx";
17
+ export { AmountInput } from "./ui-kit/components/molecules/AmountInput/AmountInput.jsx";
18
+ export { SwapForm } from "./ui-kit/components/organisms/SwapForm/SwapForm.jsx";
19
+ export { Textarea } from "./ui-kit/components/atoms/Textarea/Textarea.jsx";
20
+ export { QrCode } from "./ui-kit/components/atoms/QrCode/QrCode.jsx";
21
+ export { LinesOfText } from "./ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx";
22
+ export { LineWithIconLink } from "./ui-kit/components/molecules/LineWithIconLink/LineWithIconLink.jsx";
23
+ export { DeterminedErrorDialogStep } from "./ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx";
24
+ export { TitledLineWithIconLink } from "./ui-kit/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx";
25
+ export { RadioButtonWithText } from "./ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx";
26
+ export { InformationMessage } from "./ui-kit/components/atoms/InformationMessage/InformationMessage.jsx";
27
+ export { Input } from "./ui-kit/components/atoms/Input/Input.jsx";
28
+ export { COIN_PICKER_MODES, CoinPicker } from "./ui-kit/components/molecules/CoinPicker/CoinPicker.jsx";
29
+ export { CoinPickerDialogStep } from "./ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx";
30
+ export { SearchableCoinsList } from "./ui-kit/components/molecules/SearchableCoinsList/SearchableCoinsList.jsx";
31
+ export { ColoredNotice, COLORED_NOTICE_COLORS } from "./ui-kit/components/molecules/ColoredNotice/ColoredNotice.jsx";
32
+ export { WaitlistSubscription } from "./ui-kit/components/organisms/WaitlistSubscription/WaitlistSubscription.jsx";
33
+ export { LogoCarousel } from "./ui-kit/components/molecules/LogoCarousel/LogoCarousel.jsx";
34
+
35
+ // UI-KIT constants
36
+ export { FALLBACK_ASSET_ICON_URL, DEFAULT_CRYPTO_DECIMAL_COUNT } from "./common-apis/globalConstants.jsx";
37
+
38
+ export { useCallHandlingErrors } from "./ui-kit/hooks/useCallHandlingErrors.js";
39
+ export { useReferredState } from "./ui-kit/hooks/useReferredState.js";
40
+ export { handleClickOutside } from "./ui-kit/utils/uiUtils.js";
41
+ export { InputValuesProviders } from "./ui-kit/utils/inputValueProviders.js";
42
+ export { copyBrowserTextToClipboard } from "./ui-kit/utils/textUtils.js";
43
+ export { useIsHydrated } from "./ui-kit/hooks/useIsHydrated.js";
44
+
45
+ export { saveQueryParameterAndValues } from "./ui-kit/utils/urlQueryUtils.js";
46
+ export { removeQueryParameterAndValues } from "./ui-kit/utils/urlQueryUtils.js";
47
+ export { getQueryParameterSingleValue } from "./ui-kit/utils/urlQueryUtils.js";
48
+ export { getQueryParameterValues } from "./ui-kit/utils/urlQueryUtils.js";
6
49
 
7
50
  // Common code lib (to be extracted later to dedicated lib)
8
- export { improveAndRethrow } from "./common/errorUtils.js";
9
- export { FiatCurrenciesService } from "./common/fiatCurrenciesService.js";
10
- export { AmountUtils } from "./common/amountUtils.js";
51
+ export { improveAndRethrow } from "./common-apis/utils/errorUtils.js";
52
+ export { logErrorOrOutputToConsole } from "./common-apis/utils/errorUtils.js";
53
+ export { FiatCurrenciesService } from "./common-apis/services/fiatCurrenciesService.js";
54
+ export { AmountUtils } from "./common-apis/utils/amountUtils.js";
55
+ export { toRabbitTicker } from "./common-apis/utils/rabbitTicker.js";
56
+ export { searchCoins } from "./ui-kit/utils/searchCoins.js";
57
+
58
+ export { Blockchain } from "./common-apis/models/blockchain.js";
59
+ export { Protocol } from "./common-apis/models/protocol.js";
60
+ export { Coin } from "./common-apis/models/coin.js";
61
+
62
+ export { Cache } from "./common-apis/utils/cache.js";
63
+ export { safeStringify } from "./common-apis/utils/safeStringify.js";
64
+ export { LogsStorage } from "./common-apis/utils/logging/logsStorage.js";
65
+ export { Logger } from "./common-apis/utils/logging/logger.js";
66
+ export { postponeExecution } from "./common-apis/utils/postponeExecution.js";
67
+ export { AxiosAdapter } from "./common-apis/adapters/axiosAdapter.js";
68
+
69
+ export { EmailsApi } from "./common-apis/external-apis/emailAPI.js";
70
+ export { IpAddressProvider } from "./common-apis/external-apis/ipAddressProviders.js";
71
+
72
+ export { GoogleAnalyticsAdapter } from "./common-apis/adapters/analyticsAdapters/googleAnalyticsAdapter.js";
73
+ export { MixpanelAdapter } from "./common-apis/adapters/analyticsAdapters/mixpanelAdapter.js";
74
+ export { MetrikaAdapter } from "./common-apis/adapters/analyticsAdapters/metrikaAdapter.js";
11
75
 
12
- export { Blockchain } from "./common/models/blockchain.js";
13
- export { Protocol } from "./common/models/protocol.js";
14
- export { Coin } from "./common/models/coin.js";
76
+ // Robust data retriever service and related APIs (to be extracted later to dedicated lib)
77
+ export { CacheAndConcurrentRequestsResolver } from "./robust-api-caller/cacheAndConcurrentRequestsResolver.js";
78
+ export { CachedRobustExternalApiCallerService } from "./robust-api-caller/cachedRobustExternalApiCallerService.js";
79
+ export { CancelProcessing } from "./robust-api-caller/cancelProcessing.js";
80
+ export { ExternalApiProvider } from "./robust-api-caller/externalApiProvider.js";
81
+ export { RobustExternalAPICallerService } from "./robust-api-caller/robustExternalAPICallerService.js";
82
+ export { ConcurrentCalculationsMetadataHolder } from "./robust-api-caller/concurrentCalculationsMetadataHolder.js";
15
83
 
16
- export { Cache } from "./common/utils/cache.js";
17
- export { safeStringify } from "./common/utils/safeStringify.js";
18
- export { LogsStorage } from "./common/utils/logging/logsStorage.js";
19
- export { Logger } from "./common/utils/logging/logger.js";
84
+ export { ApiGroups } from "./common-apis/external-apis/apiGroups.js";
85
+ export { ApiGroup } from "./common-apis/external-apis/apiGroups.js";
20
86
 
21
87
  // Swaps lib (to be extracted later to dedicated lib)
22
88
  export { ExistingSwap } from "./swaps-lib/models/existingSwap.js";
89
+ export { ExistingSwapWithFiatData } from "./swaps-lib/models/existingSwapWithFiatData.js";
90
+ export { BaseSwapCreationInfo } from "./swaps-lib/models/baseSwapCreationInfo.js";
91
+ export { SwapProviderCoinInfo } from "./swaps-lib/models/swapProviderCoinInfo.js";
23
92
  export { SwapProvider } from "./swaps-lib/external-apis/swapProvider.js";
93
+ export { SwapspaceSwapProvider } from "./swaps-lib/external-apis/swapspaceSwapProvider.js";
94
+ export { LetsExchangeSwapProvider } from "./swaps-lib/external-apis/letsExchangeSwapProvider.js";
95
+ export { ExolixSwapProvider } from "./swaps-lib/external-apis/exolixSwapProvider.js";
96
+ export { GoexmeSwapProvider } from "./swaps-lib/external-apis/goexmeSwapProvider.js";
97
+ export { SwapUtils } from "./swaps-lib/utils/swapUtils.js";
98
+ export { PublicSwapService } from "./swaps-lib/services/publicSwapService.js";
99
+ export { Partner, KYC_LEVELS } from "./swaps-lib/models/partner.js";
@@ -0,0 +1,525 @@
1
+ import { v4 } from "uuid";
2
+
3
+ import { improveAndRethrow } from "../common-apis/utils/errorUtils.js";
4
+ import { Logger } from "../common-apis/utils/logging/logger.js";
5
+
6
+ /**
7
+ * This util helps to avoid duplicated calls to a shared resource.
8
+ * It tracks is there currently active calculation for the specific cache id and make all other requests
9
+ * with the same cache id waiting for this active calculation to be finished. When the calculation ends
10
+ * the resolver allows all the waiting requesters to get the data from cache and start their own calculations.
11
+ *
12
+ * This class should be instantiated inside some other service where you need to request some resource concurrently.
13
+ * Rules:
14
+ * 1. When you need to make a request inside your main service call 'getCachedOrWaitForCachedOrAcquireLock'
15
+ * on the instance of this class and await for the result. If the flag allowing to start calculation is true
16
+ * then you can request data inside your main service. Otherwise you should use the cached data as an another
17
+ * requester just finished the most resent requesting and there is actual data in the cache that
18
+ * is returned to you here.
19
+ * 1.1 Also you can acquire a lock directly if you don't want to get cached data. Use the corresponding method 'acquireLock'.
20
+ *
21
+ * 2. If you start requesting (when you successfully acquired the lock) then after receiving the result of your
22
+ * requesting you should call the 'saveCachedData' so the retrieved data will appear in the cache.
23
+ *
24
+ * 3. If you successfully acquired the lock then you should after calling the 'saveCachedData' call
25
+ * the 'releaseLock' - this is mandatory to release the lock and allow other requesters to perform their requests.
26
+ * WARNING: If for any reason you forget to call this method then this class instance will wait perpetually for
27
+ * the lock releasing and all your attempts to request the data will constantly fail. So usually call it
28
+ * inside the 'finally' block.
29
+ *
30
+ * TODO: [tests, critical++] add unit tests - massively used logic and can produce sophisticated concurrency bugs
31
+ */
32
+ export class CacheAndConcurrentRequestsResolver {
33
+ /**
34
+ * @param bio {string} unique identifier for the exact service
35
+ * @param cache {Cache} cache
36
+ * @param cacheTtl {number|null} time to live for cache ms. 0 or null means the cache cannot expire
37
+ * @param [maxCallAttemptsToWaitForAlreadyRunningRequest=100] {number} number of request allowed to do waiting for
38
+ * result before we fail the original request. Use custom value only if you need to make the attempts count
39
+ * and polling interval changes.
40
+ * @param [timeoutBetweenAttemptsToCheckWhetherAlreadyRunningRequestFinished=1000] {number}
41
+ * timeout ms for polling for a result. if you change maxCallAttemptsToWaitForAlreadyRunningRequest
42
+ * then this parameter maybe also require the custom value.
43
+ * @param [removeExpiredCacheAutomatically=true] {boolean}
44
+ */
45
+ constructor(
46
+ bio,
47
+ cache,
48
+ cacheTtl,
49
+ removeExpiredCacheAutomatically = true,
50
+ maxCallAttemptsToWaitForAlreadyRunningRequest = 100,
51
+ timeoutBetweenAttemptsToCheckWhetherAlreadyRunningRequestFinished = 1000
52
+ ) {
53
+ if (cacheTtl != null && cacheTtl < timeoutBetweenAttemptsToCheckWhetherAlreadyRunningRequestFinished * 2) {
54
+ /*
55
+ * During the lifetime of this service e.g. if the data is being retrieved slowly we can get
56
+ * RACE CONDITION when we constantly retrieve data and during retrieval it is expired, so we are trying
57
+ * to retrieve it again and again.
58
+ * We have a protection mechanism that we will wait no more than
59
+ * maxCallAttemptsToWaitForAlreadyRunningRequest * timeoutBetweenAttemptsToCheckWhetherAlreadyRunningRequestFinished
60
+ * but this additional check is aimed to reduce potential loading time for some requests.
61
+ */
62
+ throw new Error(
63
+ `DEV: Wrong parameters passed to construct ${bio} - TTL ${cacheTtl} should be 2 times greater than ${timeoutBetweenAttemptsToCheckWhetherAlreadyRunningRequestFinished}`
64
+ );
65
+ }
66
+ this._bio = bio;
67
+ this._cache = cache;
68
+ this._cacheTtlMs = cacheTtl != null ? cacheTtl : null;
69
+ this._maxExecutionTimeMs =
70
+ maxCallAttemptsToWaitForAlreadyRunningRequest *
71
+ timeoutBetweenAttemptsToCheckWhetherAlreadyRunningRequestFinished;
72
+ this._removeExpiredCacheAutomatically = removeExpiredCacheAutomatically;
73
+ this._requestsManager = new ManagerOfRequestsToTheSameResource(
74
+ bio,
75
+ maxCallAttemptsToWaitForAlreadyRunningRequest,
76
+ timeoutBetweenAttemptsToCheckWhetherAlreadyRunningRequestFinished
77
+ );
78
+ }
79
+
80
+ /**
81
+ * Method to easily wrap external requests into cached ones. Uses the existing
82
+ * cache logic under the hood, but simplifies its implementation. The response
83
+ * will either be the previously cached result, if a request with the same key
84
+ * was executed, otherwise an external request will be executed and returned.
85
+ *
86
+ * @param requestFunction {function} The loading function the result of which should be cached
87
+ * @param cacheKey {string} Cache key for the method, which has to be unique for each variation of the request
88
+ * @return {Promise<Object>}
89
+ */
90
+ async callFunctionWithCacheAndConcurrentRequestsResolver(requestFunction, cacheKey) {
91
+ let cacheResolvingResult;
92
+ let response;
93
+
94
+ try {
95
+ cacheResolvingResult = await this.getCachedOrWaitForCachedOrAcquireLock(cacheKey);
96
+ if (!cacheResolvingResult?.canStartDataRetrieval) {
97
+ response = cacheResolvingResult?.cachedData;
98
+ } else {
99
+ response = await requestFunction();
100
+ this.saveCachedData(cacheKey, cacheResolvingResult?.lockId, response);
101
+ }
102
+ return response;
103
+ } catch (e) {
104
+ improveAndRethrow(e, "cachedRequestWrapper");
105
+ } finally {
106
+ this.releaseLock(cacheKey, cacheResolvingResult?.lockId);
107
+ }
108
+ }
109
+
110
+ /**
111
+ * When using this service this is the major method you should call to get data by cache id.
112
+ * This method checks is there cached data and ether
113
+ * - returns you flag that you can start requesting data from the shared resource
114
+ * - or if there is already started calculation waits until it is finished (removed from this service)
115
+ * and returns you the retrieved data
116
+ * - or just returns you the cached data
117
+ *
118
+ * 'canStartDataRetrieval' equal true means that the lock was acquired, and you should manually call 'saveCachedData'
119
+ * if needed and then 'releaseLock' to mark this calculation as finished so other
120
+ * requesters can take their share of the resource.
121
+ *
122
+ * @param cacheId {string}
123
+ * @return {Promise<({
124
+ * canStartDataRetrieval: true,
125
+ * cachedData: any,
126
+ * lockId: string
127
+ * }|{
128
+ * canStartDataRetrieval: false,
129
+ * cachedData: any
130
+ * })>}
131
+ */
132
+ async getCachedOrWaitForCachedOrAcquireLock(cacheId) {
133
+ try {
134
+ const startedAtTimestamp = Date.now();
135
+ let cached = this._cache.get(cacheId);
136
+ let cachedDataBackupIsPresentButExpired = null;
137
+ if (cached != null && !this._removeExpiredCacheAutomatically) {
138
+ const lastUpdateTimestamp = this._cache.getLastUpdateTimestamp(cacheId);
139
+ if ((lastUpdateTimestamp ?? 0) + this._cacheTtlMs < Date.now()) {
140
+ /*
141
+ * Here we are manually clearing 'cached' value retrieved from cache to force the data loading.
142
+ * But we save its value first to the backup variable to be able to return this value if ongoing
143
+ * requesting fails.
144
+ */
145
+ cachedDataBackupIsPresentButExpired = cached;
146
+ cached = null;
147
+ }
148
+ }
149
+ let calculationId = null;
150
+ let isRetrievedCacheExpired = true;
151
+ let isWaitingForActiveCalculationSucceeded;
152
+ let weStillHaveSomeTimeToProceedExecution = true;
153
+ while (
154
+ calculationId == null &&
155
+ cached == null &&
156
+ isRetrievedCacheExpired &&
157
+ weStillHaveSomeTimeToProceedExecution
158
+ ) {
159
+ const result = await this._requestsManager.startCalculationOrWaitForActiveToFinish(cacheId);
160
+ calculationId = typeof result === "string" ? result : null;
161
+ isWaitingForActiveCalculationSucceeded = typeof result === "boolean" ? result : null;
162
+ cached = this._cache.get(cacheId);
163
+ isRetrievedCacheExpired = isWaitingForActiveCalculationSucceeded && cached == null;
164
+ weStillHaveSomeTimeToProceedExecution = Date.now() - startedAtTimestamp < this._maxExecutionTimeMs;
165
+ }
166
+ if (calculationId) {
167
+ return {
168
+ canStartDataRetrieval: true,
169
+ cachedData: cached ?? cachedDataBackupIsPresentButExpired,
170
+ lockId: calculationId,
171
+ };
172
+ }
173
+
174
+ return {
175
+ canStartDataRetrieval: false,
176
+ cachedData: cached ?? cachedDataBackupIsPresentButExpired,
177
+ };
178
+ } catch (e) {
179
+ improveAndRethrow(e, `${this._bio}.getCachedOrWaitForCachedOrAcquireLock`);
180
+ }
181
+ }
182
+
183
+ /**
184
+ * Returns just the current cache value for the given id.
185
+ * Doesn't wait for the active calculation, doesn't acquire lock, just retrieves the current cache as it is.
186
+ *
187
+ * @param cacheId {string}
188
+ * @return {any}
189
+ */
190
+ getCached(cacheId) {
191
+ try {
192
+ return this._cache.get(cacheId);
193
+ } catch (e) {
194
+ improveAndRethrow(e, "getCached");
195
+ }
196
+ }
197
+
198
+ _getTtl() {
199
+ return this._removeExpiredCacheAutomatically ? this._cacheTtlMs : null;
200
+ }
201
+
202
+ /**
203
+ * Directly acquires the lock despite on cached data availability.
204
+ * So if this method returns result === true you can start the data retrieval.
205
+ *
206
+ * @param cacheId {string}
207
+ * @return {Promise<{ result: true, lockId: string }|{ result: false }>}
208
+ */
209
+ async acquireLock(cacheId) {
210
+ try {
211
+ return await this._requestsManager.acquireLock(cacheId);
212
+ } catch (e) {
213
+ improveAndRethrow(e, "acquireLock");
214
+ }
215
+ }
216
+
217
+ /**
218
+ * This method should be called only if you acquired a lock successfully.
219
+ *
220
+ * If the current lock id is not equal to the passed one the passed data will be ignored.
221
+ * Or you can do the synchronous data merging on your side and pass the
222
+ * wasDataMergedSynchronouslyWithMostRecentCacheState=true so your data will be stored
223
+ * despite on the lockId.
224
+ * WARNING: you should do this only if you are sure you perform the synchronous update.
225
+ *
226
+ * @param cacheId {string}
227
+ * @param lockId {string}
228
+ * @param data {any}
229
+ * @param [sessionDependentData=true] {boolean}
230
+ * @param [wasDataMergedSynchronouslyWithMostRecentCacheState=false]
231
+ */
232
+ saveCachedData(
233
+ cacheId,
234
+ lockId,
235
+ data,
236
+ sessionDependentData = true,
237
+ wasDataMergedSynchronouslyWithMostRecentCacheState = false
238
+ ) {
239
+ try {
240
+ if (
241
+ wasDataMergedSynchronouslyWithMostRecentCacheState ||
242
+ this._requestsManager.isTheLockActiveOne(cacheId, lockId)
243
+ ) {
244
+ /* We save passed data only if the <caller> has the currently acquired lockId.
245
+ * If the passed lockId is not the active one it means that other code cleared/stopped the lock
246
+ * acquired by the <caller> recently due to some urgent/more prior changes.
247
+ *
248
+ * But we allow user to pass the 'wasDataMergedSynchronouslyWithMostRecentCacheState' flag
249
+ * that tells us that the user had taken the most recent cache value and merged his new data
250
+ * with that cached value (AFTER possibly performing async data retrieval). This means that we
251
+ * can ignore the fact that his lockId is no more relevant and save the passed data
252
+ * as it is synchronously merged with the most recent cached data. (Synchronously merged means that
253
+ * the lost update cannot occur during the merge time as JS execute the synchronous functions\
254
+ * till the end).
255
+ */
256
+ if (sessionDependentData) {
257
+ this._cache.putSessionDependentData(cacheId, data, this._getTtl());
258
+ } else {
259
+ this._cache.put(cacheId, data, this._getTtl());
260
+ }
261
+ }
262
+ } catch (e) {
263
+ improveAndRethrow(e, `${this._bio}.saveCachedData`);
264
+ }
265
+ }
266
+
267
+ /**
268
+ * Should be called then and only then if you successfully acquired a lock with the lock id.
269
+ *
270
+ * @param cacheId {string}
271
+ * @param lockId {string}
272
+ */
273
+ releaseLock(cacheId, lockId) {
274
+ try {
275
+ if (this._requestsManager.isTheLockActiveOne(cacheId, lockId)) {
276
+ this._requestsManager.finishActiveCalculation(cacheId);
277
+ }
278
+ } catch (e) {
279
+ improveAndRethrow(e, `${this._bio}.releaseLock`);
280
+ }
281
+ }
282
+
283
+ /**
284
+ * Actualized currently present cached data by key. Applies the provided function to the cached data.
285
+ *
286
+ * @param cacheId {string} id of cache entry
287
+ * @param synchronousCurrentCacheProcessor (function|null} synchronous function accepting cache entry. Should return
288
+ * an object in following format:
289
+ * {
290
+ * isModified: boolean,
291
+ * data: any
292
+ * }
293
+ * the flag signals whether data was changed during the processing or not
294
+ * @param [sessionDependent=true] {boolean} whether to mark the cache entry as session-dependent
295
+ */
296
+ actualizeCachedData(cacheId, synchronousCurrentCacheProcessor, sessionDependent = true) {
297
+ try {
298
+ const cached = this._cache.get(cacheId);
299
+ const result = synchronousCurrentCacheProcessor(cached);
300
+ if (result?.isModified && result?.data != null) {
301
+ if (sessionDependent) {
302
+ this._cache.putSessionDependentData(cacheId, result?.data, this._getTtl());
303
+ } else {
304
+ this._cache.put(cacheId, result?.data, this._getTtl());
305
+ }
306
+
307
+ /* Here we call the lock releasing to ensure the currently active calculation will be ignored.
308
+ * This is needed to ensure no 'lost update'.
309
+ * Lost update can occur if we change data in this method and after that some calculation finishes
310
+ * having the earlier data as its base to calculate its data set result. And the earlier data
311
+ * has no changes applied inside this method, so we will lose them.
312
+ *
313
+ * This is not so good solution: ideally, we should acquire lock before performing any data updating.
314
+ * But the goal of this method is to provide an instant ability to update the cached data.
315
+ * And if we start acquiring the lock here the data update can be postponed significantly.
316
+ * And this kills the desired nature of this method.
317
+ * So we better lose some data retrieval (means abusing the resource a bit) than lose
318
+ * the instant update expected after this method execution.
319
+ */
320
+ this._requestsManager.finishActiveCalculation(cacheId);
321
+ }
322
+ } catch (e) {
323
+ improveAndRethrow(e, `${this._bio}.actualizeCachedData`);
324
+ }
325
+ }
326
+
327
+ invalidate(key) {
328
+ this._cache.invalidate(key);
329
+ this._requestsManager.finishActiveCalculation(key);
330
+ }
331
+
332
+ invalidateContaining(keyPart) {
333
+ this._cache.invalidateContaining(keyPart);
334
+ this._requestsManager.finishAllActiveCalculations(keyPart);
335
+ }
336
+
337
+ markAsExpiredButDontRemove(key) {
338
+ if (this._removeExpiredCacheAutomatically) {
339
+ this._cache.markCacheItemAsExpiredButDontRemove(key, this._cacheTtlMs);
340
+ } else {
341
+ this._cache.setLastUpdateTimestamp(key, Date.now() - this._cacheTtlMs - 1);
342
+ }
343
+ this._requestsManager.finishAllActiveCalculations(key);
344
+ }
345
+ }
346
+
347
+ /**
348
+ * Util class to control access to a resource when it can be called in parallel for the same result.
349
+ * (E.g. getting today coins-fiat rates from some API).
350
+ */
351
+ class ManagerOfRequestsToTheSameResource {
352
+ /**
353
+ * @param bio {string} resource-related identifier for logging
354
+ * @param [maxPollsCount=100] {number} max number of attempts to wait when waiting for a lock acquisition
355
+ * @param [timeoutDuration=1000] {number} timeout between the polls for a lock acquisition
356
+ */
357
+ constructor(bio, maxPollsCount = 100, timeoutDuration = 1000) {
358
+ this.bio = bio;
359
+ this.maxPollsCount = maxPollsCount;
360
+ this.timeoutDuration = timeoutDuration;
361
+ this._activeCalculationsIds = new Map();
362
+ this._nextCalculationIds = new Map();
363
+ }
364
+
365
+ /**
366
+ * If there is no active calculation just creates uuid and returns it.
367
+ * If there is active calculation waits until it removed from the active calculation uuid variable.
368
+ *
369
+ * @param requestHash {string}
370
+ * @return {Promise<string|boolean>} returns uuid of new active calculation or true if waiting for active
371
+ * calculation succeed or false if max attempts count exceeded
372
+ */
373
+ async startCalculationOrWaitForActiveToFinish(requestHash) {
374
+ try {
375
+ const activeCalculationIdForHash = this._activeCalculationsIds.get(requestHash);
376
+ if (activeCalculationIdForHash == null) {
377
+ const id = v4();
378
+ this._activeCalculationsIds.set(requestHash, id);
379
+ return id;
380
+ }
381
+
382
+ return await this._waitForCalculationIdToFinish(requestHash, activeCalculationIdForHash, 0);
383
+ } catch (e) {
384
+ Logger.logError(e, `startCalculationOrWaitForActiveToFinish_${this.bio}`);
385
+ }
386
+
387
+ return null;
388
+ }
389
+
390
+ /**
391
+ * Acquires lock to the resource by the provided hash.
392
+ *
393
+ * @param requestHash {string}
394
+ * @return {Promise<{ result: true, lockId: string }|{ result: false }>} result is true if the lock is successfully
395
+ * acquired, false if the max allowed time to wait for acquisition expired or any unexpected error occurs
396
+ * during the waiting.
397
+ */
398
+ async acquireLock(requestHash) {
399
+ try {
400
+ const activeId = this._activeCalculationsIds.get(requestHash);
401
+ const nextId = v4();
402
+ if (activeId == null) {
403
+ this._activeCalculationsIds.set(requestHash, nextId);
404
+ return { result: true, lockId: nextId };
405
+ }
406
+
407
+ const currentNext = this._nextCalculationIds.get(requestHash) ?? [];
408
+ currentNext.push(nextId);
409
+ this._nextCalculationIds.set(requestHash, currentNext);
410
+
411
+ const waitingResult = await this._waitForCalculationIdToFinish(requestHash, activeId, 0, nextId);
412
+ return {
413
+ result: waitingResult,
414
+ lockId: waitingResult ? nextId : undefined,
415
+ };
416
+ } catch (e) {
417
+ improveAndRethrow(e, "acquireLock");
418
+ }
419
+ }
420
+
421
+ /**
422
+ * Clears active calculation id.
423
+ * WARNING: if you forget to call this method the start* one will perform maxPollsCount attempts before finishing
424
+ * @param requestHash {string} hash of request. Helps to distinct the request for the same resource but
425
+ * having different request parameters and hold a dedicated calculation id per this hash
426
+ */
427
+ finishActiveCalculation(requestHash = "default") {
428
+ try {
429
+ this._activeCalculationsIds.delete(requestHash);
430
+ const next = this._nextCalculationIds.get(requestHash) ?? [];
431
+ if (next.length) {
432
+ this._activeCalculationsIds.set(requestHash, next[0]);
433
+ this._nextCalculationIds.set(requestHash, next.slice(1));
434
+ }
435
+ } catch (e) {
436
+ improveAndRethrow(e, "finishActiveCalculation");
437
+ }
438
+ }
439
+
440
+ finishAllActiveCalculations(keyPart = "") {
441
+ try {
442
+ Array.from(this._activeCalculationsIds.keys()).forEach(hash => {
443
+ if (typeof hash === "string" && new RegExp(keyPart).test(hash)) {
444
+ this.finishActiveCalculation(hash);
445
+ }
446
+ });
447
+ } catch (e) {
448
+ improveAndRethrow(e, "finishAllActiveCalculations");
449
+ }
450
+ }
451
+
452
+ /**
453
+ * @param requestHash {string}
454
+ * @param lockId {string}
455
+ * @return {boolean}
456
+ */
457
+ isTheLockActiveOne(requestHash, lockId) {
458
+ try {
459
+ return this._activeCalculationsIds.get(requestHash) === lockId;
460
+ } catch (e) {
461
+ improveAndRethrow(e, "isTheLockActiveOne");
462
+ }
463
+ }
464
+
465
+ /**
466
+ * @param requestHash {string}
467
+ * @param activeCalculationId {string|null}
468
+ * @param [attemptIndex=0] {number}
469
+ * @param waitForCalculationId {string|null} if you want to wait for an exact id to appear as active then pass this parameter
470
+ * @return {Promise<boolean>} true
471
+ * - if the given calculation id is no more an active one
472
+ * - or it is equal to waitForCalculationId
473
+ * false
474
+ * - if waiting period exceeds the max allowed waiting time or unexpected error occurs
475
+ * @private
476
+ */
477
+ async _waitForCalculationIdToFinish(
478
+ requestHash,
479
+ activeCalculationId,
480
+ attemptIndex = 0,
481
+ waitForCalculationId = null
482
+ ) {
483
+ try {
484
+ if (attemptIndex + 1 > this.maxPollsCount) {
485
+ // Max number of polls for active calculation id change is achieved. So we return false.
486
+ return false;
487
+ }
488
+
489
+ const currentId = this._activeCalculationsIds.get(requestHash);
490
+ if (waitForCalculationId == null ? currentId !== activeCalculationId : currentId === waitForCalculationId) {
491
+ /* We return true depending on the usage of this function:
492
+ * 1. if there is calculation id that we should wait for to become an active then we return true only
493
+ * if this id becomes the active one.
494
+ *
495
+ * Theoretically we can fail to wait for the desired calculation id. This can be caused by wrong use of
496
+ * this service or by any other mistakes/errors. But this waiting function will return false anyway if
497
+ * the number of polls done exceeds the max allowed.
498
+ *
499
+ * 2. if we just wait for the currently active calculation id to be finished then we return true
500
+ * when we notice that the current active id differs from the original passed into this function.
501
+ */
502
+ return true;
503
+ } else {
504
+ /* The original calculation id is still the active one, so we are scheduling a new attempt to check
505
+ * whether the active calculation id changed or not in timeoutDuration milliseconds.
506
+ */
507
+ const it = this;
508
+ return new Promise((resolve, reject) => {
509
+ setTimeout(function () {
510
+ try {
511
+ resolve(
512
+ it._waitForCalculationIdToFinish(requestHash, activeCalculationId, attemptIndex + 1)
513
+ );
514
+ } catch (e) {
515
+ reject(e);
516
+ }
517
+ }, this.timeoutDuration);
518
+ });
519
+ }
520
+ } catch (e) {
521
+ Logger.logError(e, "_waitForCalculationIdToFinish", "Failed to wait for active calculation id change.");
522
+ return false;
523
+ }
524
+ }
525
+ }