@rabbitio/ui-kit 1.0.0-beta.70 → 1.0.0-beta.72

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 (329) hide show
  1. package/coverage/clover.xml +7803 -7729
  2. package/coverage/coverage-final.json +91 -95
  3. package/coverage/index.html +182 -272
  4. package/coverage/rabbit-ui-kit/index.html +1 -1
  5. package/coverage/rabbit-ui-kit/index.js.html +1 -1
  6. package/coverage/rabbit-ui-kit/src/{common → common-apis}/adapters/axiosAdapter.js.html +3 -3
  7. package/coverage/rabbit-ui-kit/src/{common → common-apis}/adapters/index.html +3 -3
  8. package/coverage/rabbit-ui-kit/src/{common → common-apis}/adapters/qrUtils.js.html +3 -3
  9. package/coverage/rabbit-ui-kit/src/{common → common-apis}/amountUtils.js.html +3 -3
  10. package/coverage/rabbit-ui-kit/src/{common → common-apis}/errorUtils.js.html +3 -3
  11. package/coverage/rabbit-ui-kit/src/{common → common-apis}/external-apis/apiGroups.js.html +3 -3
  12. package/coverage/rabbit-ui-kit/src/{common → common-apis}/external-apis/index.html +3 -3
  13. package/coverage/rabbit-ui-kit/src/{common → common-apis}/external-apis/ipAddressProviders.js.html +5 -5
  14. package/coverage/rabbit-ui-kit/src/{common → common-apis}/fiatCurrenciesService.js.html +3 -3
  15. package/coverage/rabbit-ui-kit/src/{constants → common-apis}/globalConstants.jsx.html +3 -3
  16. package/coverage/rabbit-ui-kit/src/{common → common-apis}/index.html +22 -7
  17. package/coverage/rabbit-ui-kit/src/{common → common-apis}/models/blockchain.js.html +3 -3
  18. package/coverage/rabbit-ui-kit/src/{common → common-apis}/models/coin.js.html +3 -3
  19. package/coverage/rabbit-ui-kit/src/{common → common-apis}/models/index.html +3 -3
  20. package/coverage/rabbit-ui-kit/src/{common → common-apis}/models/protocol.js.html +3 -3
  21. package/coverage/rabbit-ui-kit/src/{common → common-apis}/utils/cache.js.html +8 -8
  22. package/coverage/rabbit-ui-kit/src/{common → common-apis}/utils/emailAPI.js.html +3 -3
  23. package/coverage/rabbit-ui-kit/src/{common → common-apis}/utils/index.html +3 -3
  24. package/coverage/rabbit-ui-kit/src/{common → common-apis}/utils/logging/index.html +3 -3
  25. package/coverage/rabbit-ui-kit/src/{common → common-apis}/utils/logging/logger.js.html +6 -6
  26. package/coverage/rabbit-ui-kit/src/{common → common-apis}/utils/logging/logsStorage.js.html +5 -5
  27. package/coverage/rabbit-ui-kit/src/{common → common-apis}/utils/postponeExecution.js.html +3 -3
  28. package/coverage/rabbit-ui-kit/src/{common → common-apis}/utils/safeStringify.js.html +29 -29
  29. package/coverage/rabbit-ui-kit/src/index.html +5 -5
  30. package/coverage/rabbit-ui-kit/src/index.js.html +66 -78
  31. package/coverage/rabbit-ui-kit/src/{robustExteranlApiCallerService → robust-api-caller}/cacheAndConcurrentRequestsResolver.js.html +5 -5
  32. package/coverage/rabbit-ui-kit/src/{robustExteranlApiCallerService → robust-api-caller}/cachedRobustExternalApiCallerService.js.html +6 -6
  33. package/coverage/rabbit-ui-kit/src/{robustExteranlApiCallerService → robust-api-caller}/cancelProcessing.js.html +3 -3
  34. package/coverage/rabbit-ui-kit/src/{robustExteranlApiCallerService → robust-api-caller}/concurrentCalculationsMetadataHolder.js.html +4 -4
  35. package/coverage/rabbit-ui-kit/src/{robustExteranlApiCallerService → robust-api-caller}/externalApiProvider.js.html +3 -3
  36. package/coverage/rabbit-ui-kit/src/{robustExteranlApiCallerService → robust-api-caller}/externalServicesStatsCollector.js.html +5 -5
  37. package/coverage/rabbit-ui-kit/src/{robustExteranlApiCallerService → robust-api-caller}/index.html +3 -3
  38. package/coverage/rabbit-ui-kit/src/{robustExteranlApiCallerService → robust-api-caller}/robustExternalAPICallerService.js.html +8 -8
  39. package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/index.html +24 -24
  40. package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapProvider.js.html +9 -6
  41. package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +190 -130
  42. package/coverage/rabbit-ui-kit/src/swaps-lib/models/baseSwapCreationInfo.js.html +14 -5
  43. package/coverage/rabbit-ui-kit/src/swaps-lib/models/existingSwap.js.html +1 -1
  44. package/coverage/rabbit-ui-kit/src/swaps-lib/models/existingSwapWithFiatData.js.html +1 -1
  45. package/coverage/rabbit-ui-kit/src/swaps-lib/models/index.html +7 -7
  46. package/coverage/rabbit-ui-kit/src/swaps-lib/services/index.html +5 -5
  47. package/coverage/rabbit-ui-kit/src/swaps-lib/services/publicSwapService.js.html +14 -11
  48. package/coverage/rabbit-ui-kit/src/swaps-lib/utils/index.html +1 -1
  49. package/coverage/rabbit-ui-kit/src/swaps-lib/utils/swapUtils.js.html +7 -7
  50. package/coverage/rabbit-ui-kit/src/{assets → ui-kit/assets}/wrappedImages/arrowIcon.jsx.html +10 -10
  51. package/coverage/rabbit-ui-kit/src/{assets → ui-kit/assets}/wrappedImages/arrowTosca.jsx.html +10 -10
  52. package/coverage/rabbit-ui-kit/src/{assets → ui-kit/assets}/wrappedImages/arrowWhite.jsx.html +11 -11
  53. package/coverage/rabbit-ui-kit/src/{assets → ui-kit/assets}/wrappedImages/darkRectangle.jsx.html +10 -10
  54. package/coverage/rabbit-ui-kit/src/{assets → ui-kit/assets}/wrappedImages/determinedError.jsx.html +10 -10
  55. package/coverage/rabbit-ui-kit/src/{assets → ui-kit/assets}/wrappedImages/failedValidationIcon.jsx.html +10 -10
  56. package/coverage/rabbit-ui-kit/src/{assets → ui-kit/assets}/wrappedImages/index.html +10 -10
  57. package/coverage/rabbit-ui-kit/src/{assets → ui-kit/assets}/wrappedImages/infoIcon.jsx.html +10 -10
  58. package/coverage/rabbit-ui-kit/src/{assets → ui-kit/assets}/wrappedImages/noticeQuestionIcon.jsx.html +10 -10
  59. package/coverage/rabbit-ui-kit/src/{assets → ui-kit/assets}/wrappedImages/successfulValidationIcon.jsx.html +10 -10
  60. package/coverage/rabbit-ui-kit/src/{assets → ui-kit/assets}/wrappedImages/walletIcon.jsx.html +10 -10
  61. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/AssetIcon/AssetIcon.jsx.html +20 -17
  62. package/coverage/rabbit-ui-kit/src/{constants/organisms/dialog/DialogStep → ui-kit/components/atoms/AssetIcon}/index.html +8 -8
  63. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/AssetSelection/AssetSelection.jsx.html +23 -20
  64. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetSelection/index.html +116 -0
  65. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/BackgroundTitle/BackgroundTitle.jsx.html +10 -10
  66. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/BackgroundTitle/index.html +116 -0
  67. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/InformationMessage/InformationMessage.jsx.html +21 -18
  68. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/InformationMessage/index.html +116 -0
  69. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/Input/Input.jsx.html +38 -35
  70. package/coverage/rabbit-ui-kit/src/{components/atoms/buttons/Button → ui-kit/components/atoms/Input}/index.html +8 -8
  71. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/LoadingDots/LoadingDots.jsx.html +10 -10
  72. package/coverage/rabbit-ui-kit/src/{components/atoms/buttons/LinkButton → ui-kit/components/atoms/LoadingDots}/index.html +8 -8
  73. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/NoticeIcon/NoticeIcon.jsx.html +19 -22
  74. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/NoticeIcon/index.html +116 -0
  75. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/QrCode/QrCode.jsx.html +18 -15
  76. package/coverage/rabbit-ui-kit/src/{components/atoms/buttons/Close → ui-kit/components/atoms/QrCode}/index.html +8 -8
  77. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/RateSelector/RateSelector.jsx.html +16 -13
  78. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/RateSelector/index.html +116 -0
  79. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/SupportChat/SupportChat.jsx.html +16 -13
  80. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/SupportChat/index.html +116 -0
  81. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/Textarea/Textarea.jsx.html +36 -30
  82. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Textarea/index.html +116 -0
  83. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/TitleBox/TitleBox.jsx.html +29 -29
  84. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TitleBox/index.html +116 -0
  85. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/Tooltip/Tooltip.jsx.html +48 -21
  86. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Tooltip/index.html +116 -0
  87. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/TwoLinesOfText/LinesOfText.jsx.html +29 -23
  88. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/index.html +116 -0
  89. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/Validation/Validation.jsx.html +13 -13
  90. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Validation/index.html +116 -0
  91. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/buttons/Button/Button.jsx.html +10 -10
  92. package/coverage/rabbit-ui-kit/src/{components/atoms/AssetSelection → ui-kit/components/atoms/buttons/Button}/index.html +15 -15
  93. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/buttons/Close/Close.jsx.html +30 -15
  94. package/coverage/rabbit-ui-kit/src/{components/atoms/InformationMessage → ui-kit/components/atoms/buttons/Close}/index.html +15 -15
  95. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/buttons/LinkButton/LinkButton.jsx.html +34 -16
  96. package/coverage/rabbit-ui-kit/src/{components/atoms/BackgroundTitle → ui-kit/components/atoms/buttons/LinkButton}/index.html +15 -15
  97. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +11 -11
  98. package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/index.html +116 -0
  99. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/molecules/AmountInput/AmountInput.jsx.html +20 -17
  100. package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/AmountInput/index.html +116 -0
  101. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/molecules/CoinPicker/CoinPicker.jsx.html +44 -38
  102. package/coverage/rabbit-ui-kit/src/{components/organisms/Dialog/DialogStep → ui-kit/components/molecules/CoinPicker}/index.html +8 -8
  103. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/molecules/LineWithIconLink/LineWithIconLink.jsx.html +10 -10
  104. package/coverage/rabbit-ui-kit/src/{components/organisms/Dialog/DialogButtons → ui-kit/components/molecules/LineWithIconLink}/index.html +8 -8
  105. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx.html +25 -19
  106. package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/TitledLineWithIconLink/index.html +116 -0
  107. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +20 -14
  108. package/coverage/rabbit-ui-kit/src/{components/atoms/buttons/RadioButtonWithText → ui-kit/components/organisms/CoinPickerDialogStep}/index.html +8 -8
  109. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/organisms/Dialog/Dialog.jsx.html +106 -19
  110. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +13 -13
  111. package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/index.html +116 -0
  112. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/organisms/Dialog/DialogStep/DialogStep.jsx.html +66 -60
  113. package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/index.html +116 -0
  114. package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/index.html +116 -0
  115. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/organisms/SwapForm/SwapForm.jsx.html +361 -76
  116. package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/SwapForm/index.html +116 -0
  117. package/coverage/rabbit-ui-kit/src/{components → ui-kit/components}/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx.html +12 -12
  118. package/coverage/rabbit-ui-kit/src/ui-kit/components/templates/DeterminedErrorDialogStep/index.html +116 -0
  119. package/coverage/rabbit-ui-kit/src/{components → ui-kit}/hooks/index.html +22 -7
  120. package/coverage/rabbit-ui-kit/src/{components → ui-kit}/hooks/useCallHandlingErrors.js.html +4 -4
  121. package/coverage/rabbit-ui-kit/src/ui-kit/hooks/useIsHydrated.js.html +121 -0
  122. package/coverage/rabbit-ui-kit/src/{components → ui-kit}/hooks/useReferredState.js.html +3 -3
  123. package/coverage/rabbit-ui-kit/src/{components → ui-kit}/utils/index.html +3 -3
  124. package/coverage/rabbit-ui-kit/src/{components → ui-kit}/utils/inputValueProviders.js.html +3 -3
  125. package/coverage/rabbit-ui-kit/src/{components → ui-kit}/utils/textUtils.js.html +4 -4
  126. package/coverage/rabbit-ui-kit/src/{components → ui-kit}/utils/uiUtils.js.html +3 -3
  127. package/coverage/rabbit-ui-kit/src/{components → ui-kit}/utils/urlQueryUtils.js.html +3 -3
  128. package/coverage/rabbit-ui-kit/stories/atoms/BackgroundTitle.stories.jsx.html +2 -2
  129. package/coverage/rabbit-ui-kit/stories/atoms/LinesOfText.stories.jsx.html +4 -4
  130. package/coverage/rabbit-ui-kit/stories/atoms/LoadingDots.stories.jsx.html +3 -3
  131. package/coverage/rabbit-ui-kit/stories/atoms/QrCode.stories.jsx.html +3 -3
  132. package/coverage/rabbit-ui-kit/stories/atoms/RateSelector.stories.jsx.html +2 -2
  133. package/coverage/rabbit-ui-kit/stories/atoms/Validation.stories.jsx.html +2 -2
  134. package/coverage/rabbit-ui-kit/stories/atoms/buttons/Button.stories.jsx.html +27 -90
  135. package/coverage/rabbit-ui-kit/stories/atoms/buttons/Close.stories.jsx.html +7 -10
  136. package/coverage/rabbit-ui-kit/stories/atoms/buttons/LinkButton.stories.jsx.html +13 -7
  137. package/coverage/rabbit-ui-kit/stories/atoms/buttons/index.html +9 -9
  138. package/coverage/rabbit-ui-kit/stories/atoms/index.html +1 -1
  139. package/coverage/rabbit-ui-kit/stories/molecules/LineWithIconLink.stories.jsx.html +3 -3
  140. package/coverage/rabbit-ui-kit/stories/molecules/TitledLineWithIconLink.stories.jsx.html +2 -2
  141. package/coverage/rabbit-ui-kit/stories/molecules/index.html +1 -1
  142. package/coverage/rabbit-ui-kit/stories/organisms/Dialog/Dialog.stories.jsx.html +13 -79
  143. package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogButtons/DialogButtons.stories.jsx.html +3 -3
  144. package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogButtons/index.html +1 -1
  145. package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogStep/DialogStep.stories.jsx.html +4 -4
  146. package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogStep/index.html +1 -1
  147. package/coverage/rabbit-ui-kit/stories/organisms/Dialog/index.html +5 -5
  148. package/coverage/rabbit-ui-kit/stories/stubs/exampleContent.jsx.html +1 -1
  149. package/coverage/rabbit-ui-kit/stories/stubs/index.html +1 -1
  150. package/coverage/rabbit-ui-kit/stories/templates/DeterminedErrorDialogStep.stories.jsx.html +7 -10
  151. package/coverage/rabbit-ui-kit/stories/templates/index.html +5 -5
  152. package/dist/index.cjs +488 -301
  153. package/dist/index.cjs.map +1 -1
  154. package/dist/index.css +21029 -21029
  155. package/dist/index.modern.js +346 -219
  156. package/dist/index.modern.js.map +1 -1
  157. package/dist/index.module.js +487 -302
  158. package/dist/index.module.js.map +1 -1
  159. package/dist/index.umd.js +488 -301
  160. package/dist/index.umd.js.map +1 -1
  161. package/package.json +3 -3
  162. package/src/{common → common-apis}/external-apis/ipAddressProviders.js +2 -2
  163. package/src/index.js +62 -66
  164. package/src/{robustExteranlApiCallerService → robust-api-caller}/cacheAndConcurrentRequestsResolver.js +2 -2
  165. package/src/{robustExteranlApiCallerService → robust-api-caller}/cachedRobustExternalApiCallerService.js +3 -3
  166. package/src/{robustExteranlApiCallerService → robust-api-caller}/concurrentCalculationsMetadataHolder.js +1 -1
  167. package/src/{robustExteranlApiCallerService → robust-api-caller}/externalServicesStatsCollector.js +2 -2
  168. package/src/{robustExteranlApiCallerService → robust-api-caller}/robustExternalAPICallerService.js +5 -5
  169. package/src/{robustExteranlApiCallerService → robust-api-caller}/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/_performCallAttempt.test.js +2 -2
  170. package/src/{robustExteranlApiCallerService → robust-api-caller}/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/callExternalAPI.test.js +1 -1
  171. package/src/{robustExteranlApiCallerService → robust-api-caller}/tests/robustExternalAPICallerService/robustExternalAPICallerService/constructor.test.js +1 -1
  172. package/src/swaps-lib/external-apis/swapProvider.js +1 -0
  173. package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +27 -7
  174. package/src/swaps-lib/models/baseSwapCreationInfo.js +4 -1
  175. package/src/swaps-lib/services/publicSwapService.js +8 -7
  176. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +3 -3
  177. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/createSwap.test.js +3 -3
  178. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getAllSupportedCurrencies.test.js +1 -1
  179. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getDepositCurrencies.test.js +1 -1
  180. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getSwapInfo.test.js +124 -4
  181. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getWithdrawalCurrencies.test.js +1 -1
  182. package/src/swaps-lib/test/utils/swapUtils/safeHandleRequestsLimitExceeding.test.js +2 -2
  183. package/src/swaps-lib/utils/swapUtils.js +6 -6
  184. package/{styles → src/ui-kit/assets/styles}/index.scss +1 -1
  185. package/src/{assets → ui-kit/assets}/wrappedImages/arrowWhite.jsx +1 -1
  186. package/src/{components → ui-kit/components}/atoms/AssetIcon/AssetIcon.jsx +5 -4
  187. package/src/{components → ui-kit/components}/atoms/AssetIcon/asset-icon.module.scss +1 -1
  188. package/src/{components → ui-kit/components}/atoms/AssetSelection/AssetSelection.jsx +8 -7
  189. package/src/{components → ui-kit/components}/atoms/AssetSelection/asset-selection.module.scss +1 -1
  190. package/src/{components → ui-kit/components}/atoms/BackgroundTitle/background-title.module.scss +1 -1
  191. package/src/{components → ui-kit/components}/atoms/InformationMessage/InformationMessage.jsx +6 -5
  192. package/src/{components → ui-kit/components}/atoms/InformationMessage/information-message.module.scss +1 -1
  193. package/src/{components → ui-kit/components}/atoms/Input/Input.jsx +23 -22
  194. package/src/{components → ui-kit/components}/atoms/Input/input.module.scss +1 -1
  195. package/src/{components → ui-kit/components}/atoms/LoadingDots/LoadingDots.module.scss +1 -1
  196. package/src/{components → ui-kit/components}/atoms/NoticeIcon/NoticeIcon.jsx +6 -7
  197. package/src/{components → ui-kit/components}/atoms/NoticeIcon/notice-icon.module.scss +1 -1
  198. package/src/{components → ui-kit/components}/atoms/QrCode/QrCode.jsx +3 -2
  199. package/src/{components → ui-kit/components}/atoms/QrCode/qr-code.module.scss +1 -1
  200. package/src/{components → ui-kit/components}/atoms/RateSelector/RateSelector.jsx +1 -0
  201. package/src/{components → ui-kit/components}/atoms/RateSelector/rate-selector.module.scss +1 -1
  202. package/src/{components → ui-kit/components}/atoms/SupportChat/SupportChat.jsx +1 -0
  203. package/src/{components → ui-kit/components}/atoms/Textarea/Textarea.jsx +19 -17
  204. package/src/{components → ui-kit/components}/atoms/Textarea/textarea.module.scss +1 -1
  205. package/src/{components → ui-kit/components}/atoms/TitleBox/TitleBox.jsx +19 -19
  206. package/src/{components → ui-kit/components}/atoms/TitleBox/title-box.module.scss +1 -1
  207. package/src/{components → ui-kit/components}/atoms/Tooltip/Tooltip.jsx +17 -8
  208. package/src/{components → ui-kit/components}/atoms/Tooltip/tooltip.module.scss +1 -1
  209. package/src/{components → ui-kit/components}/atoms/TwoLinesOfText/LinesOfText.jsx +11 -9
  210. package/src/{components → ui-kit/components}/atoms/TwoLinesOfText/lines-of-text.module.scss +1 -1
  211. package/src/{components → ui-kit/components}/atoms/Validation/Validation.jsx +2 -2
  212. package/src/{components → ui-kit/components}/atoms/Validation/validation.module.scss +1 -1
  213. package/src/{components → ui-kit/components}/atoms/buttons/Button/Button.module.scss +1 -1
  214. package/src/{components → ui-kit/components}/atoms/buttons/Close/Close.jsx +7 -2
  215. package/src/{components → ui-kit/components}/atoms/buttons/Close/close.module.scss +1 -1
  216. package/src/{components → ui-kit/components}/atoms/buttons/LinkButton/LinkButton.jsx +9 -3
  217. package/src/{components → ui-kit/components}/atoms/buttons/LinkButton/link-button.module.scss +1 -1
  218. package/src/{components → ui-kit/components}/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx +1 -1
  219. package/src/{components → ui-kit/components}/atoms/buttons/RadioButtonWithText/radio-button-with-text.module.scss +1 -1
  220. package/src/{components → ui-kit/components}/molecules/AmountInput/AmountInput.jsx +5 -4
  221. package/src/{components → ui-kit/components}/molecules/AmountInput/amount-input.module.scss +1 -1
  222. package/src/{components → ui-kit/components}/molecules/CoinPicker/CoinPicker.jsx +27 -25
  223. package/src/{components → ui-kit/components}/molecules/CoinPicker/coin-picker.module.scss +1 -1
  224. package/src/{components → ui-kit/components}/molecules/LineWithIconLink/line-with-icon-link.module.scss +1 -1
  225. package/src/{components → ui-kit/components}/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx +8 -6
  226. package/src/{components → ui-kit/components}/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx +3 -1
  227. package/src/{components → ui-kit/components}/organisms/Dialog/Dialog.jsx +35 -6
  228. package/src/{components → ui-kit/components}/organisms/Dialog/DialogButtons/DialogButtons.jsx +3 -3
  229. package/src/{components → ui-kit/components}/organisms/Dialog/DialogButtons/dialog-buttons.module.scss +1 -1
  230. package/src/{components → ui-kit/components}/organisms/Dialog/DialogStep/DialogStep.jsx +49 -47
  231. package/src/{components → ui-kit/components}/organisms/Dialog/DialogStep/dialog-step.module.scss +1 -1
  232. package/src/{components → ui-kit/components}/organisms/Dialog/dialog.module.scss +1 -1
  233. package/src/{components → ui-kit/components}/organisms/SwapForm/SwapForm.jsx +158 -63
  234. package/src/{components → ui-kit/components}/organisms/SwapForm/swap-form.module.scss +1 -1
  235. package/src/{components → ui-kit/components}/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx +2 -2
  236. package/src/{components → ui-kit}/hooks/useCallHandlingErrors.js +1 -1
  237. package/src/ui-kit/hooks/useIsHydrated.js +12 -0
  238. package/src/{components → ui-kit}/utils/textUtils.js +1 -1
  239. package/coverage/rabbit-ui-kit/src/components/atoms/AssetIcon/index.html +0 -116
  240. package/coverage/rabbit-ui-kit/src/components/atoms/Input/index.html +0 -116
  241. package/coverage/rabbit-ui-kit/src/components/atoms/LoadingDots/index.html +0 -116
  242. package/coverage/rabbit-ui-kit/src/components/atoms/NoticeIcon/index.html +0 -116
  243. package/coverage/rabbit-ui-kit/src/components/atoms/QrCode/index.html +0 -116
  244. package/coverage/rabbit-ui-kit/src/components/atoms/RateSelector/index.html +0 -116
  245. package/coverage/rabbit-ui-kit/src/components/atoms/SupportChat/index.html +0 -116
  246. package/coverage/rabbit-ui-kit/src/components/atoms/Textarea/index.html +0 -116
  247. package/coverage/rabbit-ui-kit/src/components/atoms/TitleBox/index.html +0 -116
  248. package/coverage/rabbit-ui-kit/src/components/atoms/Tooltip/index.html +0 -116
  249. package/coverage/rabbit-ui-kit/src/components/atoms/TwoLinesOfText/index.html +0 -116
  250. package/coverage/rabbit-ui-kit/src/components/atoms/Validation/index.html +0 -116
  251. package/coverage/rabbit-ui-kit/src/components/molecules/AmountInput/index.html +0 -116
  252. package/coverage/rabbit-ui-kit/src/components/molecules/CoinPicker/index.html +0 -116
  253. package/coverage/rabbit-ui-kit/src/components/molecules/LineWithIconLink/index.html +0 -116
  254. package/coverage/rabbit-ui-kit/src/components/molecules/TitledLineWithIconLink/index.html +0 -116
  255. package/coverage/rabbit-ui-kit/src/components/organisms/CoinPickerDialogStep/index.html +0 -116
  256. package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/index.html +0 -116
  257. package/coverage/rabbit-ui-kit/src/components/organisms/SwapForm/index.html +0 -116
  258. package/coverage/rabbit-ui-kit/src/components/templates/DeterminedErrorDialogStep/index.html +0 -116
  259. package/coverage/rabbit-ui-kit/src/constants/atoms/Close/close.jsx.html +0 -100
  260. package/coverage/rabbit-ui-kit/src/constants/atoms/Close/index.html +0 -116
  261. package/coverage/rabbit-ui-kit/src/constants/atoms/LinkButton/index.html +0 -116
  262. package/coverage/rabbit-ui-kit/src/constants/atoms/LinkButton/linkButton.jsx.html +0 -103
  263. package/coverage/rabbit-ui-kit/src/constants/atoms/Tooltip/index.html +0 -116
  264. package/coverage/rabbit-ui-kit/src/constants/atoms/Tooltip/tooltip.jsx.html +0 -109
  265. package/coverage/rabbit-ui-kit/src/constants/index.html +0 -116
  266. package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/DialogStep/dialogStep.js.html +0 -88
  267. package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/dialog.js.html +0 -172
  268. package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/index.html +0 -116
  269. package/src/assets/image/icons/arrow-tosca.svg +0 -3
  270. package/src/constants/atoms/Close/close.jsx +0 -5
  271. package/src/constants/atoms/LinkButton/linkButton.jsx +0 -6
  272. package/src/constants/atoms/Tooltip/tooltip.jsx +0 -8
  273. package/src/constants/organisms/dialog/DialogStep/dialogStep.js +0 -1
  274. package/src/constants/organisms/dialog/dialog.js +0 -29
  275. /package/src/{common → common-apis}/adapters/axiosAdapter.js +0 -0
  276. /package/src/{common → common-apis}/adapters/qrUtils.js +0 -0
  277. /package/src/{common → common-apis}/amountUtils.js +0 -0
  278. /package/src/{common → common-apis}/errorUtils.js +0 -0
  279. /package/src/{common → common-apis}/external-apis/apiGroups.js +0 -0
  280. /package/src/{common → common-apis}/fiatCurrenciesService.js +0 -0
  281. /package/src/{constants → common-apis}/globalConstants.jsx +0 -0
  282. /package/src/{common → common-apis}/models/blockchain.js +0 -0
  283. /package/src/{common → common-apis}/models/coin.js +0 -0
  284. /package/src/{common → common-apis}/models/protocol.js +0 -0
  285. /package/src/{common → common-apis}/tests/amountUtils/composeRateText.test.js +0 -0
  286. /package/src/{common → common-apis}/tests/integration/external-apis/ipAddressProviders/getClientIpAddress.test.js +0 -0
  287. /package/src/{common → common-apis}/utils/cache.js +0 -0
  288. /package/src/{common → common-apis}/utils/emailAPI.js +0 -0
  289. /package/src/{common → common-apis}/utils/logging/logger.js +0 -0
  290. /package/src/{common → common-apis}/utils/logging/logsStorage.js +0 -0
  291. /package/src/{common → common-apis}/utils/postponeExecution.js +0 -0
  292. /package/src/{common → common-apis}/utils/safeStringify.js +0 -0
  293. /package/src/{robustExteranlApiCallerService → robust-api-caller}/cancelProcessing.js +0 -0
  294. /package/src/{robustExteranlApiCallerService → robust-api-caller}/externalApiProvider.js +0 -0
  295. /package/{styles → src/ui-kit/assets/styles}/_functions.scss +0 -0
  296. /package/{styles → src/ui-kit/assets/styles}/_global-classes.scss +0 -0
  297. /package/{styles → src/ui-kit/assets/styles}/_mixins.scss +0 -0
  298. /package/{styles → src/ui-kit/assets/styles}/_placeholder.scss +0 -0
  299. /package/{styles → src/ui-kit/assets/styles}/_variables.scss +0 -0
  300. /package/{styles → src/ui-kit/assets/styles}/colors/_light-colors.scss +0 -0
  301. /package/{styles → src/ui-kit/assets/styles}/colors/_solid-colors.scss +0 -0
  302. /package/{styles → src/ui-kit/assets/styles}/fonts/NunitoSans-Bold.ttf +0 -0
  303. /package/{styles → src/ui-kit/assets/styles}/fonts/NunitoSans-ExtraBold.ttf +0 -0
  304. /package/{styles → src/ui-kit/assets/styles}/fonts/NunitoSans-Light.ttf +0 -0
  305. /package/{styles → src/ui-kit/assets/styles}/fonts/NunitoSans-Regular.ttf +0 -0
  306. /package/{styles → src/ui-kit/assets/styles}/fonts/NunitoSans-SemiBold.ttf +0 -0
  307. /package/{styles → src/ui-kit/assets/styles}/global-styles-index.scss +0 -0
  308. /package/{styles → src/ui-kit/assets/styles}/size/_margin-size.scss +0 -0
  309. /package/{styles → src/ui-kit/assets/styles}/size/_padding-size.scss +0 -0
  310. /package/src/{assets → ui-kit/assets}/wrappedImages/arrowIcon.jsx +0 -0
  311. /package/src/{assets → ui-kit/assets}/wrappedImages/arrowTosca.jsx +0 -0
  312. /package/src/{assets → ui-kit/assets}/wrappedImages/darkRectangle.jsx +0 -0
  313. /package/src/{assets → ui-kit/assets}/wrappedImages/determinedError.jsx +0 -0
  314. /package/src/{assets → ui-kit/assets}/wrappedImages/failedValidationIcon.jsx +0 -0
  315. /package/src/{assets → ui-kit/assets}/wrappedImages/infoIcon.jsx +0 -0
  316. /package/src/{assets → ui-kit/assets}/wrappedImages/noticeQuestionIcon.jsx +0 -0
  317. /package/src/{assets → ui-kit/assets}/wrappedImages/successfulValidationIcon.jsx +0 -0
  318. /package/src/{assets → ui-kit/assets}/wrappedImages/walletIcon.jsx +0 -0
  319. /package/src/{components → ui-kit/components}/atoms/BackgroundTitle/BackgroundTitle.jsx +0 -0
  320. /package/src/{components → ui-kit/components}/atoms/LoadingDots/LoadingDots.jsx +0 -0
  321. /package/src/{components → ui-kit/components}/atoms/buttons/Button/Button.jsx +0 -0
  322. /package/src/{components → ui-kit/components}/molecules/LineWithIconLink/LineWithIconLink.jsx +0 -0
  323. /package/src/{components → ui-kit}/hooks/useReferredState.js +0 -0
  324. /package/src/{components → ui-kit}/tests/utils/inputValueProviders/provideFormatOfFloatValueByInputString.test.js +0 -0
  325. /package/src/{components → ui-kit}/tests/utils/urlQueryUtils/getQueryParameterValues.test.js +0 -0
  326. /package/src/{components → ui-kit}/tests/utils/urlQueryUtils/saveQueryParameterAndValues.test.js +0 -0
  327. /package/src/{components → ui-kit}/utils/inputValueProviders.js +0 -0
  328. /package/src/{components → ui-kit}/utils/uiUtils.js +0 -0
  329. /package/src/{components → ui-kit}/utils/urlQueryUtils.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabbitio/ui-kit",
3
- "version": "1.0.0-beta.70",
3
+ "version": "1.0.0-beta.72",
4
4
  "description": "Rabbit.io react.js components kit",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -50,9 +50,7 @@
50
50
  "eventbusjs": "0.2.0",
51
51
  "jshashes": "1.0.8",
52
52
  "qrcode": "1.4.4",
53
- "react": ">=18.2.0",
54
53
  "react-animate-height": "3.2.3",
55
- "react-dom": ">=18.2.0",
56
54
  "react-textarea-autosize": "^8.5.3",
57
55
  "react-transition-group": "4.4.5",
58
56
  "resize-observer-polyfill": "1.5.1",
@@ -76,6 +74,8 @@
76
74
  "microbundle": "^0.15.1",
77
75
  "prettier": "^3.1.1",
78
76
  "prop-types": "^15.8.1",
77
+ "react": "18.2.0",
78
+ "react-dom": "18.2.0",
79
79
  "resolve-url-loader": "^5.0.0",
80
80
  "sass": "^1.70.0",
81
81
  "sass-loader": "^14.1.0",
@@ -1,7 +1,7 @@
1
1
  import EventBusInstance from "eventbusjs";
2
- import { ExternalApiProvider } from "../../robustExteranlApiCallerService/externalApiProvider.js";
2
+ import { ExternalApiProvider } from "../../robust-api-caller/externalApiProvider.js";
3
3
  import { ApiGroups } from "./apiGroups.js";
4
- import { CachedRobustExternalApiCallerService } from "../../robustExteranlApiCallerService/cachedRobustExternalApiCallerService.js";
4
+ import { CachedRobustExternalApiCallerService } from "../../robust-api-caller/cachedRobustExternalApiCallerService.js";
5
5
  import { Cache } from "../utils/cache.js";
6
6
  import { improveAndRethrow } from "../errorUtils.js";
7
7
 
package/src/index.js CHANGED
@@ -1,82 +1,78 @@
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";
6
- export { LinkButton } from "./components/atoms/buttons/LinkButton/LinkButton.jsx";
7
- export { DialogButtons } from "./components/organisms/Dialog/DialogButtons/DialogButtons.jsx";
8
- export { BackgroundTitle } from "./components/atoms/BackgroundTitle/BackgroundTitle.jsx";
9
- export { Close } from "./components/atoms/buttons/Close/Close.jsx";
10
- export { Validation } from "./components/atoms/Validation/Validation.jsx";
11
- export { Dialog } from "./components/organisms/Dialog/Dialog.jsx";
12
- export { DialogStep } from "./components/organisms/Dialog/DialogStep/DialogStep.jsx";
13
- export { AssetSelection } from "./components/atoms/AssetSelection/AssetSelection.jsx";
14
- export { Tooltip } from "./components/atoms/Tooltip/Tooltip.jsx";
15
- export { NoticeIcon } from "./components/atoms/NoticeIcon/NoticeIcon.jsx";
16
- export { TitleBox } from "./components/atoms/TitleBox/TitleBox.jsx";
17
- export { AmountInput } from "./components/molecules/AmountInput/AmountInput.jsx";
18
- export { SwapForm } from "./components/organisms/SwapForm/SwapForm.jsx";
19
- export { Textarea } from "./components/atoms/Textarea/Textarea.jsx";
20
- export { QrCode } from "./components/atoms/QrCode/QrCode.jsx";
21
- export { LinesOfText } from "./components/atoms/TwoLinesOfText/LinesOfText.jsx";
22
- export { LineWithIconLink } from "./components/molecules/LineWithIconLink/LineWithIconLink.jsx";
23
- export { DeterminedErrorDialogStep } from "./components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx";
24
- export { TitledLineWithIconLink } from "./components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx";
25
- export { RadioButtonWithText } from "./components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx";
26
- export { InformationMessage } from "./components/atoms/InformationMessage/InformationMessage.jsx";
27
- export { Input } from "./components/atoms/Input/Input.jsx";
28
- export { COIN_PICKER_MODES, CoinPicker } from "./components/molecules/CoinPicker/CoinPicker.jsx";
29
- export { CoinPickerDialogStep } from "./components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.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
30
 
31
31
  // UI-KIT constants
32
- export { DIALOG_SIZES } from "./constants/organisms/dialog/dialog.js";
33
- export { DIALOG_STEP_CLASS } from "./constants/organisms/dialog/DialogStep/dialogStep.js";
34
- export { ICON_ROTATE_OPTIONS } from "./constants/atoms/LinkButton/linkButton.jsx";
35
- export { TOOLTIP_POSITIONS } from "./constants/atoms/Tooltip/tooltip.jsx";
36
- export { CLOSE_COLORS } from "./constants/atoms/Close/close.jsx";
37
- export { FALLBACK_ASSET_ICON_URL, DEFAULT_CRYPTO_DECIMAL_COUNT } from "./constants/globalConstants.jsx";
32
+ export { FALLBACK_ASSET_ICON_URL, DEFAULT_CRYPTO_DECIMAL_COUNT } from "./common-apis/globalConstants.jsx";
38
33
 
39
- export { useCallHandlingErrors } from "./components/hooks/useCallHandlingErrors.js";
40
- export { useReferredState } from "./components/hooks/useReferredState.js";
41
- export { handleClickOutside } from "./components/utils/uiUtils.js";
42
- export { InputValuesProviders } from "./components/utils/inputValueProviders.js";
43
- export { copyBrowserTextToClipboard } from "./components/utils/textUtils.js";
34
+ export { useCallHandlingErrors } from "./ui-kit/hooks/useCallHandlingErrors.js";
35
+ export { useReferredState } from "./ui-kit/hooks/useReferredState.js";
36
+ export { handleClickOutside } from "./ui-kit/utils/uiUtils.js";
37
+ export { InputValuesProviders } from "./ui-kit/utils/inputValueProviders.js";
38
+ export { copyBrowserTextToClipboard } from "./ui-kit/utils/textUtils.js";
39
+ export { useIsHydrated } from "./ui-kit/hooks/useIsHydrated.js";
44
40
 
45
- export { saveQueryParameterAndValues } from "./components/utils/urlQueryUtils.js";
46
- export { removeQueryParameterAndValues } from "./components/utils/urlQueryUtils.js";
47
- export { getQueryParameterSingleValue } from "./components/utils/urlQueryUtils.js";
48
- export { getQueryParameterValues } from "./components/utils/urlQueryUtils.js";
41
+ export { saveQueryParameterAndValues } from "./ui-kit/utils/urlQueryUtils.js";
42
+ export { removeQueryParameterAndValues } from "./ui-kit/utils/urlQueryUtils.js";
43
+ export { getQueryParameterSingleValue } from "./ui-kit/utils/urlQueryUtils.js";
44
+ export { getQueryParameterValues } from "./ui-kit/utils/urlQueryUtils.js";
49
45
 
50
46
  // Common code lib (to be extracted later to dedicated lib)
51
- export { improveAndRethrow } from "./common/errorUtils.js";
52
- export { logErrorOrOutputToConsole } from "./common/errorUtils.js";
53
- export { FiatCurrenciesService } from "./common/fiatCurrenciesService.js";
54
- export { AmountUtils } from "./common/amountUtils.js";
47
+ export { improveAndRethrow } from "./common-apis/errorUtils.js";
48
+ export { logErrorOrOutputToConsole } from "./common-apis/errorUtils.js";
49
+ export { FiatCurrenciesService } from "./common-apis/fiatCurrenciesService.js";
50
+ export { AmountUtils } from "./common-apis/amountUtils.js";
55
51
 
56
- export { Blockchain } from "./common/models/blockchain.js";
57
- export { Protocol } from "./common/models/protocol.js";
58
- export { Coin } from "./common/models/coin.js";
52
+ export { Blockchain } from "./common-apis/models/blockchain.js";
53
+ export { Protocol } from "./common-apis/models/protocol.js";
54
+ export { Coin } from "./common-apis/models/coin.js";
59
55
 
60
- export { Cache } from "./common/utils/cache.js";
61
- export { safeStringify } from "./common/utils/safeStringify.js";
62
- export { LogsStorage } from "./common/utils/logging/logsStorage.js";
63
- export { Logger } from "./common/utils/logging/logger.js";
64
- export { postponeExecution } from "./common/utils/postponeExecution.js";
65
- export { AxiosAdapter } from "./common/adapters/axiosAdapter.js";
56
+ export { Cache } from "./common-apis/utils/cache.js";
57
+ export { safeStringify } from "./common-apis/utils/safeStringify.js";
58
+ export { LogsStorage } from "./common-apis/utils/logging/logsStorage.js";
59
+ export { Logger } from "./common-apis/utils/logging/logger.js";
60
+ export { postponeExecution } from "./common-apis/utils/postponeExecution.js";
61
+ export { AxiosAdapter } from "./common-apis/adapters/axiosAdapter.js";
66
62
 
67
- export { EmailsApi } from "./common/utils/emailAPI.js";
68
- export { IpAddressProvider } from "./common/external-apis/ipAddressProviders.js";
63
+ export { EmailsApi } from "./common-apis/utils/emailAPI.js";
64
+ export { IpAddressProvider } from "./common-apis/external-apis/ipAddressProviders.js";
69
65
 
70
66
  // Robust data retriever service and related APIs (to be extracted later to dedicated lib)
71
- export { CacheAndConcurrentRequestsResolver } from "./robustExteranlApiCallerService/cacheAndConcurrentRequestsResolver.js";
72
- export { CachedRobustExternalApiCallerService } from "./robustExteranlApiCallerService/cachedRobustExternalApiCallerService.js";
73
- export { CancelProcessing } from "./robustExteranlApiCallerService/cancelProcessing.js";
74
- export { ExternalApiProvider } from "./robustExteranlApiCallerService/externalApiProvider.js";
75
- export { RobustExternalAPICallerService } from "./robustExteranlApiCallerService/robustExternalAPICallerService.js";
76
- export { ConcurrentCalculationsMetadataHolder } from "./robustExteranlApiCallerService/concurrentCalculationsMetadataHolder.js";
67
+ export { CacheAndConcurrentRequestsResolver } from "./robust-api-caller/cacheAndConcurrentRequestsResolver.js";
68
+ export { CachedRobustExternalApiCallerService } from "./robust-api-caller/cachedRobustExternalApiCallerService.js";
69
+ export { CancelProcessing } from "./robust-api-caller/cancelProcessing.js";
70
+ export { ExternalApiProvider } from "./robust-api-caller/externalApiProvider.js";
71
+ export { RobustExternalAPICallerService } from "./robust-api-caller/robustExternalAPICallerService.js";
72
+ export { ConcurrentCalculationsMetadataHolder } from "./robust-api-caller/concurrentCalculationsMetadataHolder.js";
77
73
 
78
- export { ApiGroups } from "./common/external-apis/apiGroups.js";
79
- export { ApiGroup } from "./common/external-apis/apiGroups.js";
74
+ export { ApiGroups } from "./common-apis/external-apis/apiGroups.js";
75
+ export { ApiGroup } from "./common-apis/external-apis/apiGroups.js";
80
76
 
81
77
  // Swaps lib (to be extracted later to dedicated lib)
82
78
  export { ExistingSwap } from "./swaps-lib/models/existingSwap.js";
@@ -1,7 +1,7 @@
1
1
  import { v4 } from "uuid";
2
2
 
3
- import { improveAndRethrow } from "../common/errorUtils.js";
4
- import { Logger } from "../common/utils/logging/logger.js";
3
+ import { improveAndRethrow } from "../common-apis/errorUtils.js";
4
+ import { Logger } from "../common-apis/utils/logging/logger.js";
5
5
 
6
6
  /**
7
7
  * This util helps to avoid duplicated calls to a shared resource.
@@ -1,8 +1,8 @@
1
1
  import Hashes from "jshashes";
2
2
 
3
- import { improveAndRethrow } from "../common/errorUtils.js";
4
- import { safeStringify } from "../common/utils/safeStringify.js";
5
- import { Logger } from "../common/utils/logging/logger.js";
3
+ import { improveAndRethrow } from "../common-apis/errorUtils.js";
4
+ import { safeStringify } from "../common-apis/utils/safeStringify.js";
5
+ import { Logger } from "../common-apis/utils/logging/logger.js";
6
6
 
7
7
  import { RobustExternalAPICallerService } from "./robustExternalAPICallerService.js";
8
8
  import { CacheAndConcurrentRequestsResolver } from "./cacheAndConcurrentRequestsResolver.js";
@@ -1,6 +1,6 @@
1
1
  import { v4 } from "uuid";
2
2
 
3
- import { Logger } from "../common/utils/logging/logger.js";
3
+ import { Logger } from "../common-apis/utils/logging/logger.js";
4
4
 
5
5
  // TODO: [refactoring, low] Consider removing this logic task_id=c360f2af75764bde8badd9ff1cc00d48
6
6
  export class ConcurrentCalculationsMetadataHolder {
@@ -1,5 +1,5 @@
1
- import { improveAndRethrow } from "../common/errorUtils.js";
2
- import { Logger } from "../common/utils/logging/logger.js";
1
+ import { improveAndRethrow } from "../common-apis/errorUtils.js";
2
+ import { Logger } from "../common-apis/utils/logging/logger.js";
3
3
 
4
4
  export class ExternalServicesStatsCollector {
5
5
  constructor() {
@@ -1,8 +1,8 @@
1
- import { improveAndRethrow } from "../common/errorUtils.js";
2
- import { safeStringify } from "../common/utils/safeStringify.js";
3
- import { Logger } from "../common/utils/logging/logger.js";
4
- import { postponeExecution } from "../common/utils/postponeExecution.js";
5
- import { AxiosAdapter } from "../common/adapters/axiosAdapter.js";
1
+ import { improveAndRethrow } from "../common-apis/errorUtils.js";
2
+ import { safeStringify } from "../common-apis/utils/safeStringify.js";
3
+ import { Logger } from "../common-apis/utils/logging/logger.js";
4
+ import { postponeExecution } from "../common-apis/utils/postponeExecution.js";
5
+ import { AxiosAdapter } from "../common-apis/adapters/axiosAdapter.js";
6
6
 
7
7
  import { concurrentCalculationsMetadataHolder } from "./concurrentCalculationsMetadataHolder.js";
8
8
  import { ExternalServicesStatsCollector } from "./externalServicesStatsCollector.js";
@@ -4,8 +4,8 @@ import should from "should";
4
4
  import { beforeEach, afterEach, describe, it } from "vitest";
5
5
  import { v4 } from "uuid";
6
6
  import { ExternalApiProvider } from "../../../../externalApiProvider.js";
7
- import { ApiGroup } from "../../../../../common/external-apis/apiGroups.js";
8
- import { AxiosAdapter } from "../../../../../common/adapters/axiosAdapter.js";
7
+ import { ApiGroup } from "../../../../../common-apis/external-apis/apiGroups.js";
8
+ import { AxiosAdapter } from "../../../../../common-apis/adapters/axiosAdapter.js";
9
9
  import { RobustExternalAPICallerService } from "../../../../robustExternalAPICallerService.js";
10
10
 
11
11
  /**
@@ -5,7 +5,7 @@ import { beforeEach, afterEach, describe, it } from "vitest";
5
5
 
6
6
  import { v4 } from "uuid";
7
7
  import { ExternalApiProvider } from "../../../../externalApiProvider.js";
8
- import { ApiGroup } from "../../../../../common/external-apis/apiGroups.js";
8
+ import { ApiGroup } from "../../../../../common-apis/external-apis/apiGroups.js";
9
9
  import { RobustExternalAPICallerService } from "../../../../robustExternalAPICallerService.js";
10
10
 
11
11
  describe("RobustExternalAPICallerService", function () {
@@ -4,7 +4,7 @@ import { describe, it } from "vitest";
4
4
 
5
5
  import { ExternalApiProvider } from "../../../externalApiProvider.js";
6
6
  import { RobustExternalAPICallerService } from "../../../robustExternalAPICallerService.js";
7
- import { ApiGroup } from "../../../../common/external-apis/apiGroups.js";
7
+ import { ApiGroup } from "../../../../common-apis/external-apis/apiGroups.js";
8
8
 
9
9
  describe("RobustExternalAPICallerService", function () {
10
10
  describe("#constructor", function () {
@@ -117,6 +117,7 @@ export class SwapProvider {
117
117
  * rate: (string|null),
118
118
  * durationMinutesRange: string,
119
119
  * fixed: boolean,
120
+ * isRefundAddressRequired: boolean,
120
121
  * [rawSwapData]: Object
121
122
  * })>}
122
123
  */
@@ -1,15 +1,15 @@
1
1
  import axios from "axios";
2
2
  import { BigNumber } from "bignumber.js";
3
3
 
4
- import { AmountUtils } from "../../common/amountUtils.js";
5
- import { improveAndRethrow } from "../../common/errorUtils.js";
4
+ import { AmountUtils } from "../../common-apis/amountUtils.js";
5
+ import { improveAndRethrow } from "../../common-apis/errorUtils.js";
6
6
  import { SwapProvider } from "./swapProvider.js";
7
7
  import { ExistingSwap } from "../models/existingSwap.js";
8
- import { Coin } from "../../common/models/coin.js";
9
- import { Protocol } from "../../common/models/protocol.js";
10
- import { safeStringify } from "../../common/utils/safeStringify.js";
11
- import { Logger } from "../../common/utils/logging/logger.js";
12
- import { FALLBACK_ASSET_ICON_URL } from "../../constants/globalConstants.jsx";
8
+ import { Coin } from "../../common-apis/models/coin.js";
9
+ import { Protocol } from "../../common-apis/models/protocol.js";
10
+ import { safeStringify } from "../../common-apis/utils/safeStringify.js";
11
+ import { Logger } from "../../common-apis/utils/logging/logger.js";
12
+ import { FALLBACK_ASSET_ICON_URL } from "../../common-apis/globalConstants.jsx";
13
13
 
14
14
  export const BANNED_PARTNERS = ["stealthex", "changee", "coincraddle"];
15
15
 
@@ -17,6 +17,7 @@ export class SwapspaceSwapProvider extends SwapProvider {
17
17
  constructor(apiKeysProxyUrl, cache, customCoinBuilder = (coin, network) => null, useRestrictedCoinsSet = true) {
18
18
  super();
19
19
  this._supportedCoins = [];
20
+ this._partners = [];
20
21
  this._URL = `${apiKeysProxyUrl}`;
21
22
  this._maxRateDigits = 20;
22
23
  this.useRestrictedCoinsSet = useRestrictedCoinsSet;
@@ -198,6 +199,19 @@ export class SwapspaceSwapProvider extends SwapProvider {
198
199
  }
199
200
  }
200
201
 
202
+ async _fetchPartnersListIfNeeded() {
203
+ const loggerSource = "_fetchPartnersListIfNeeded";
204
+ try {
205
+ if (this._partners?.length === 0) {
206
+ const rawResponse = await axios.get(`${this._URL}/api/v2/partners`);
207
+ Logger.log(`Retrieved ${rawResponse?.data?.length} partners`, loggerSource);
208
+ this._partners = Array.isArray(rawResponse?.data) ? rawResponse?.data : [];
209
+ }
210
+ } catch (e) {
211
+ Logger.logError(e, loggerSource, "Failed to fetch partners list from swapspace");
212
+ }
213
+ }
214
+
201
215
  /**
202
216
  * This method sort internal list putting popular (as swapspace thinks) coins to the top.
203
217
  * This is just for users of this API if they don't care about the sorting - we just improve a list a bit this way.
@@ -387,6 +401,11 @@ export class SwapspaceSwapProvider extends SwapProvider {
387
401
 
388
402
  const rate =
389
403
  bestOpt.toAmount && bestOpt.fromAmount ? BigNumber(bestOpt.toAmount).div(bestOpt.fromAmount) : null;
404
+
405
+ await this._fetchPartnersListIfNeeded();
406
+ const partner = this._partners.find(p => bestOpt?.partner?.toLowerCase() === p.path.toLowerCase());
407
+ const isRefundAddressRequired =
408
+ partner == null ? true : bestOpt.fixed ? partner.reqFixedRefund : partner.reqFloatRefund;
390
409
  return {
391
410
  result: true,
392
411
  min: min,
@@ -397,6 +416,7 @@ export class SwapspaceSwapProvider extends SwapProvider {
397
416
  durationMinutesRange: bestOpt.duration ?? null,
398
417
  fixed: bestOpt.fixed,
399
418
  rawSwapData: bestOpt,
419
+ isRefundAddressRequired: !!isRefundAddressRequired,
400
420
  };
401
421
  }
402
422
  const result = {
@@ -12,6 +12,7 @@ export class BaseSwapCreationInfo {
12
12
  * @param fiatMax {number}
13
13
  * @param durationMinutesRange {string}
14
14
  * @param fixed {boolean}
15
+ * @param [isRefundAddressRequired=false] {boolean}
15
16
  */
16
17
  constructor(
17
18
  fromCoin,
@@ -25,7 +26,8 @@ export class BaseSwapCreationInfo {
25
26
  max,
26
27
  fiatMax,
27
28
  durationMinutesRange,
28
- fixed
29
+ fixed,
30
+ isRefundAddressRequired = false
29
31
  ) {
30
32
  this.fromCoin = fromCoin;
31
33
  this.toCoin = toCoin;
@@ -39,5 +41,6 @@ export class BaseSwapCreationInfo {
39
41
  this.fiatMax = fiatMax;
40
42
  this.durationMinutesRange = durationMinutesRange;
41
43
  this.fixed = fixed;
44
+ this.isRefundAddressRequired = isRefundAddressRequired;
42
45
  }
43
46
  }
@@ -1,12 +1,12 @@
1
1
  import { BigNumber } from "bignumber.js";
2
2
  import EventBusInstance from "eventbusjs";
3
3
 
4
- import { FiatCurrenciesService } from "../../common/fiatCurrenciesService.js";
5
- import { improveAndRethrow } from "../../common/errorUtils.js";
6
- import { safeStringify } from "../../common/utils/safeStringify.js";
7
- import { Logger } from "../../common/utils/logging/logger.js";
8
- import { Coin } from "../../common/models/coin.js";
9
- import { AmountUtils } from "../../common/amountUtils.js";
4
+ import { FiatCurrenciesService } from "../../common-apis/fiatCurrenciesService.js";
5
+ import { improveAndRethrow } from "../../common-apis/errorUtils.js";
6
+ import { safeStringify } from "../../common-apis/utils/safeStringify.js";
7
+ import { Logger } from "../../common-apis/utils/logging/logger.js";
8
+ import { Coin } from "../../common-apis/models/coin.js";
9
+ import { AmountUtils } from "../../common-apis/amountUtils.js";
10
10
  import { BaseSwapCreationInfo } from "../models/baseSwapCreationInfo.js";
11
11
  import { SwapUtils } from "../utils/swapUtils.js";
12
12
  import { SwapspaceSwapProvider } from "../external-apis/swapspaceSwapProvider.js";
@@ -245,7 +245,8 @@ export class PublicSwapService {
245
245
  max,
246
246
  fiatMax,
247
247
  details.durationMinutesRange,
248
- details.fixed
248
+ details.fixed,
249
+ details.isRefundAddressRequired
249
250
  ),
250
251
  };
251
252
  Logger.log(
@@ -5,9 +5,9 @@ import should from "should";
5
5
  import { beforeEach, afterEach, describe, it } from "vitest";
6
6
 
7
7
  import { SwapspaceSwapProvider } from "../../../external-apis/swapspaceSwapProvider.js";
8
- import { Coin } from "../../../../common/models/coin.js";
9
- import { Cache } from "../../../../common/utils/cache.js";
10
- import { Protocol } from "../../../../common/models/protocol.js";
8
+ import { Coin } from "../../../../common-apis/models/coin.js";
9
+ import { Cache } from "../../../../common-apis/utils/cache.js";
10
+ import { Protocol } from "../../../../common-apis/models/protocol.js";
11
11
 
12
12
  describe("swapspaceSwapProvider", function () {
13
13
  describe("_fetchSupportedCurrenciesIfNeeded", function () {
@@ -6,9 +6,9 @@ import { beforeEach, afterEach, describe, it } from "vitest";
6
6
 
7
7
  import { SwapProvider } from "../../../external-apis/swapProvider.js";
8
8
  import { SwapspaceSwapProvider } from "../../../external-apis/swapspaceSwapProvider.js";
9
- import { Coin } from "../../../../common/models/coin.js";
10
- import { Blockchain } from "../../../../common/models/blockchain.js";
11
- import { Cache } from "../../../../common/utils/cache.js";
9
+ import { Coin } from "../../../../common-apis/models/coin.js";
10
+ import { Blockchain } from "../../../../common-apis/models/blockchain.js";
11
+ import { Cache } from "../../../../common-apis/utils/cache.js";
12
12
 
13
13
  describe("swapspaceSwapProvider", function () {
14
14
  describe("createSwap", function () {
@@ -6,7 +6,7 @@ import { beforeEach, afterEach, describe, it } from "vitest";
6
6
 
7
7
  import { SwapProvider } from "../../../external-apis/swapProvider.js";
8
8
  import { SwapspaceSwapProvider } from "../../../external-apis/swapspaceSwapProvider.js";
9
- import { Cache } from "../../../../common/utils/cache.js";
9
+ import { Cache } from "../../../../common-apis/utils/cache.js";
10
10
 
11
11
  describe("swapspaceSwapProvider", function () {
12
12
  describe("getAllSupportedCurrencies", function () {
@@ -6,7 +6,7 @@ import { beforeEach, afterEach, describe, it } from "vitest";
6
6
 
7
7
  import { SwapProvider } from "../../../external-apis/swapProvider.js";
8
8
  import { SwapspaceSwapProvider } from "../../../external-apis/swapspaceSwapProvider.js";
9
- import { Cache } from "../../../../common/utils/cache.js";
9
+ import { Cache } from "../../../../common-apis/utils/cache.js";
10
10
 
11
11
  describe("swapspaceSwapProvider", function () {
12
12
  describe("getDepositCurrencies", function () {
@@ -6,10 +6,10 @@ import { beforeEach, afterEach, describe, it } from "vitest";
6
6
 
7
7
  import { SwapProvider } from "../../../external-apis/swapProvider.js";
8
8
  import { SwapspaceSwapProvider } from "../../../external-apis/swapspaceSwapProvider.js";
9
- import { Cache } from "../../../../common/utils/cache.js";
10
- import { AmountUtils } from "../../../../common/amountUtils.js";
11
- import { Coin } from "../../../../common/models/coin.js";
12
- import { Blockchain } from "../../../../common/models/blockchain.js";
9
+ import { Cache } from "../../../../common-apis/utils/cache.js";
10
+ import { AmountUtils } from "../../../../common-apis/amountUtils.js";
11
+ import { Coin } from "../../../../common-apis/models/coin.js";
12
+ import { Blockchain } from "../../../../common-apis/models/blockchain.js";
13
13
 
14
14
  describe("swapspaceSwapProvider", function () {
15
15
  describe("getSwapInfo", function () {
@@ -92,6 +92,7 @@ describe("swapspaceSwapProvider", function () {
92
92
  let swapspaceSwapProvider;
93
93
  let axiosGetStub;
94
94
  let trimCryptoAmountByCoinStub;
95
+ let _fetchPartnersListIfNeededStub;
95
96
 
96
97
  beforeEach(() => {
97
98
  swapspaceSwapProvider = new SwapspaceSwapProvider("", new Cache());
@@ -100,6 +101,9 @@ describe("swapspaceSwapProvider", function () {
100
101
 
101
102
  trimCryptoAmountByCoinStub = sinon.stub(AmountUtils, "trim");
102
103
  trimCryptoAmountByCoinStub.callsFake(amount => amount?.toString());
104
+
105
+ _fetchPartnersListIfNeededStub = sinon.stub(swapspaceSwapProvider, "_fetchPartnersListIfNeeded");
106
+ _fetchPartnersListIfNeededStub.resolves();
103
107
  });
104
108
 
105
109
  afterEach(() => {
@@ -1576,5 +1580,121 @@ describe("swapspaceSwapProvider", function () {
1576
1580
  result.result.should.be.false();
1577
1581
  result.reason.should.be.equal(SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED);
1578
1582
  });
1583
+
1584
+ [
1585
+ {
1586
+ description: "should return a result with isRefundAddressRequired true when partner is not found",
1587
+ supportedCoins: [
1588
+ { coin: BTC, code: "btc", network: "btc", deposit: true },
1589
+ { coin: ETH, code: "eth", network: "eth", withdrawal: true },
1590
+ ],
1591
+ mockData: [
1592
+ {
1593
+ exists: true,
1594
+ fixed: false,
1595
+ toAmount: 2,
1596
+ fromAmount: 1,
1597
+ duration: "10-20",
1598
+ max: 5,
1599
+ min: 0.1,
1600
+ partner: "partner1",
1601
+ },
1602
+ ],
1603
+ partners: [],
1604
+ expected: {
1605
+ result: true,
1606
+ isRefundAddressRequired: true,
1607
+ },
1608
+ },
1609
+ {
1610
+ description:
1611
+ "should return a result with isRefundAddressRequired false for a fixed option with reqFixedRefund as false",
1612
+ isFixed: true,
1613
+ supportedCoins: [
1614
+ { coin: BTC, code: "btc", network: "btc", deposit: true },
1615
+ { coin: ETH, code: "eth", network: "eth", withdrawal: true },
1616
+ ],
1617
+ mockData: [
1618
+ {
1619
+ exists: true,
1620
+ fixed: true,
1621
+ toAmount: 2,
1622
+ fromAmount: 1,
1623
+ duration: "10-20",
1624
+ max: 5,
1625
+ min: 0.1,
1626
+ partner: "partner1",
1627
+ },
1628
+ ],
1629
+ partners: [{ path: "partner1", reqFixedRefund: false, reqFloatRefund: true }],
1630
+ expected: {
1631
+ result: true,
1632
+ isRefundAddressRequired: false,
1633
+ },
1634
+ },
1635
+ {
1636
+ description:
1637
+ "should return a result with isRefundAddressRequired true for a floating option with reqFloatRefund as true",
1638
+ supportedCoins: [
1639
+ { coin: BTC, code: "btc", network: "btc", deposit: true },
1640
+ { coin: ETH, code: "eth", network: "eth", withdrawal: true },
1641
+ ],
1642
+ mockData: [
1643
+ {
1644
+ exists: true,
1645
+ fixed: false,
1646
+ toAmount: 2,
1647
+ fromAmount: 1,
1648
+ duration: "10-20",
1649
+ max: 5,
1650
+ min: 0.1,
1651
+ partner: "partner1",
1652
+ },
1653
+ ],
1654
+ partners: [{ path: "partner1", reqFixedRefund: false, reqFloatRefund: true }],
1655
+ expected: {
1656
+ result: true,
1657
+ isRefundAddressRequired: true,
1658
+ },
1659
+ },
1660
+ ].forEach(({ description, isFixed, supportedCoins, mockData, partners, expected }) => {
1661
+ it(description, async () => {
1662
+ swapspaceSwapProvider._supportedCoins = supportedCoins;
1663
+ axiosGetStub.returns(Promise.resolve({ data: mockData }));
1664
+
1665
+ _fetchPartnersListIfNeededStub.resolves();
1666
+ swapspaceSwapProvider._partners = partners;
1667
+
1668
+ const result = await swapspaceSwapProvider.getSwapInfo(BTC, ETH, "1", !!isFixed);
1669
+
1670
+ result.result.should.be.equal(expected.result);
1671
+ result.isRefundAddressRequired.should.be.equal(expected.isRefundAddressRequired);
1672
+ });
1673
+ });
1674
+ it("should call _fetchPartnersListIfNeeded ones", async () => {
1675
+ swapspaceSwapProvider._supportedCoins = [
1676
+ { coin: BTC, code: "btc", network: "btc", deposit: true },
1677
+ { coin: ETH, code: "eth", network: "eth", withdrawal: true },
1678
+ ];
1679
+ const mockData = [
1680
+ {
1681
+ exists: true,
1682
+ fixed: false,
1683
+ toAmount: 2,
1684
+ fromAmount: 1,
1685
+ duration: "10-20",
1686
+ max: 5,
1687
+ min: 0.1,
1688
+ partner: "partner1",
1689
+ },
1690
+ ];
1691
+ axiosGetStub.returns(Promise.resolve({ data: mockData }));
1692
+
1693
+ swapspaceSwapProvider._partners = [{ path: "partner1", reqFixedRefund: false, reqFloatRefund: true }];
1694
+
1695
+ await swapspaceSwapProvider.getSwapInfo(BTC, ETH, "1");
1696
+
1697
+ _fetchPartnersListIfNeededStub.callCount.should.be.equal(1);
1698
+ });
1579
1699
  });
1580
1700
  });
@@ -6,7 +6,7 @@ import { beforeEach, afterEach, describe, it } from "vitest";
6
6
 
7
7
  import { SwapProvider } from "../../../external-apis/swapProvider.js";
8
8
  import { SwapspaceSwapProvider } from "../../../external-apis/swapspaceSwapProvider.js";
9
- import { Cache } from "../../../../common/utils/cache.js";
9
+ import { Cache } from "../../../../common-apis/utils/cache.js";
10
10
 
11
11
  describe("swapspaceSwapProvider", function () {
12
12
  describe("getWithdrawalCurrencies", function () {