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

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 (204) hide show
  1. package/.env +1 -0
  2. package/.env.example +1 -1
  3. package/coverage/clover.xml +1686 -1723
  4. package/coverage/coverage-final.json +118 -118
  5. package/coverage/index.html +86 -86
  6. package/coverage/{rabbit-ui-kit → ui-kit}/index.html +3 -3
  7. package/coverage/{rabbit-ui-kit → ui-kit}/index.js.html +3 -3
  8. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/analyticsAdapters/googleAnalyticsAdapter.js.html +3 -3
  9. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/analyticsAdapters/index.html +3 -3
  10. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/analyticsAdapters/metrikaAdapter.js.html +3 -3
  11. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/analyticsAdapters/mixpanelAdapter.js.html +3 -3
  12. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/axiosAdapter.js.html +3 -3
  13. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/index.html +3 -3
  14. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/qrUtils.js.html +3 -3
  15. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/external-apis/apiGroups.js.html +3 -3
  16. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/external-apis/emailAPI.js.html +3 -3
  17. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/external-apis/index.html +3 -3
  18. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/external-apis/ipAddressProviders.js.html +3 -3
  19. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/globalConstants.jsx.html +3 -3
  20. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/index.html +3 -3
  21. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/models/blockchain.js.html +6 -6
  22. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/models/coin.js.html +223 -223
  23. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/models/index.html +3 -3
  24. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/models/protocol.js.html +5 -5
  25. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/services/fiatCurrenciesService.js.html +3 -3
  26. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/services/index.html +3 -3
  27. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/amountUtils.js.html +51 -51
  28. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/cache.js.html +8 -8
  29. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/errorUtils.js.html +15 -15
  30. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/index.html +3 -3
  31. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/logging/index.html +3 -3
  32. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/logging/logger.js.html +24 -24
  33. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/logging/logsStorage.js.html +5 -5
  34. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/postponeExecution.js.html +3 -3
  35. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/rabbitTicker.js.html +12 -12
  36. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/safeStringify.js.html +29 -29
  37. package/coverage/{rabbit-ui-kit → ui-kit}/src/index.html +3 -3
  38. package/coverage/{rabbit-ui-kit → ui-kit}/src/index.js.html +3 -3
  39. package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/cacheAndConcurrentRequestsResolver.js.html +3 -3
  40. package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/cachedRobustExternalApiCallerService.js.html +3 -3
  41. package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/cancelProcessing.js.html +3 -3
  42. package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/concurrentCalculationsMetadataHolder.js.html +3 -3
  43. package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/externalApiProvider.js.html +3 -3
  44. package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/externalServicesStatsCollector.js.html +3 -3
  45. package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/index.html +3 -3
  46. package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/robustExternalAPICallerService.js.html +14 -14
  47. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/exolixSwapProvider.js.html +3 -3
  48. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/goexmeSwapProvider.js.html +566 -677
  49. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/index.html +29 -29
  50. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/letsExchangeSwapProvider.js.html +3 -3
  51. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/swapProvider.js.html +349 -349
  52. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +3 -3
  53. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/utils.js.html +16 -16
  54. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/baseSwapCreationInfo.js.html +3 -3
  55. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/existingSwap.js.html +143 -143
  56. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/existingSwapWithFiatData.js.html +103 -103
  57. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/index.html +16 -16
  58. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/partner.js.html +3 -3
  59. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/swapProviderCoinInfo.js.html +75 -75
  60. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/services/index.html +3 -3
  61. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/services/publicSwapService.js.html +3 -3
  62. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/utils/index.html +3 -3
  63. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/utils/swapUtils.js.html +3 -3
  64. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/arrowIcon.jsx.html +3 -3
  65. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/arrowTosca.jsx.html +3 -3
  66. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/arrowWhite.jsx.html +3 -3
  67. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/darkRectangle.jsx.html +3 -3
  68. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/determinedError.jsx.html +3 -3
  69. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/failedValidationIcon.jsx.html +3 -3
  70. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/index.html +3 -3
  71. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/infoIcon.jsx.html +3 -3
  72. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/messageIcon.jsx.html +3 -3
  73. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/noticeQuestionIcon.jsx.html +3 -3
  74. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx.html +3 -3
  75. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/supportDialogImage.jsx.html +3 -3
  76. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/walletIcon.jsx.html +3 -3
  77. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/AssetIcon/AssetIcon.jsx.html +3 -3
  78. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/AssetIcon/index.html +3 -3
  79. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/AssetSelection/AssetSelection.jsx.html +3 -3
  80. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/AssetSelection/index.html +3 -3
  81. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +3 -3
  82. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/BackgroundTitle/index.html +3 -3
  83. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/InformationMessage/InformationMessage.jsx.html +3 -3
  84. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/InformationMessage/index.html +3 -3
  85. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Input/Input.jsx.html +3 -3
  86. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Input/index.html +3 -3
  87. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/LoadingDots/LoadingDots.jsx.html +3 -3
  88. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/LoadingDots/index.html +3 -3
  89. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx.html +3 -3
  90. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/NoticeIcon/index.html +3 -3
  91. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/QrCode/QrCode.jsx.html +3 -3
  92. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/QrCode/index.html +3 -3
  93. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx.html +3 -3
  94. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/RateSelector/index.html +3 -3
  95. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/SupportChat/SupportChat.jsx.html +3 -3
  96. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/SupportChat/index.html +3 -3
  97. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Textarea/Textarea.jsx.html +3 -3
  98. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Textarea/index.html +3 -3
  99. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/TitleBox/TitleBox.jsx.html +3 -3
  100. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/TitleBox/index.html +3 -3
  101. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Tooltip/Tooltip.jsx.html +3 -3
  102. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Tooltip/index.html +3 -3
  103. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx.html +3 -3
  104. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/TwoLinesOfText/index.html +3 -3
  105. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Validation/Validation.jsx.html +3 -3
  106. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Validation/index.html +3 -3
  107. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/Button/Button.jsx.html +3 -3
  108. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/Button/index.html +3 -3
  109. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/Close/Close.jsx.html +3 -3
  110. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/Close/index.html +3 -3
  111. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx.html +3 -3
  112. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/LinkButton/index.html +3 -3
  113. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +3 -3
  114. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/RadioButtonWithText/index.html +3 -3
  115. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx.html +3 -3
  116. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/AmountInput/index.html +3 -3
  117. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx.html +3 -3
  118. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/CoinPicker/index.html +3 -3
  119. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/ColoredNotice/ColoredNotice.jsx.html +3 -3
  120. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/ColoredNotice/index.html +3 -3
  121. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/LineWithIconLink/LineWithIconLink.jsx.html +3 -3
  122. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/LineWithIconLink/index.html +3 -3
  123. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/LogoCarousel/LogoCarousel.jsx.html +3 -3
  124. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/LogoCarousel/index.html +3 -3
  125. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/SearchableCoinsList/SearchableCoinsList.jsx.html +3 -3
  126. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/SearchableCoinsList/index.html +3 -3
  127. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx.html +3 -3
  128. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/TitledLineWithIconLink/index.html +3 -3
  129. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +3 -3
  130. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/CoinPickerDialogStep/index.html +3 -3
  131. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/Dialog.jsx.html +3 -3
  132. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +3 -3
  133. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/DialogButtons/index.html +3 -3
  134. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +3 -3
  135. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/DialogStep/index.html +3 -3
  136. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/index.html +3 -3
  137. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx.html +3 -3
  138. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/SwapForm/index.html +3 -3
  139. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/WaitlistSubscription/WaitlistSubscription.jsx.html +3 -3
  140. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/WaitlistSubscription/index.html +3 -3
  141. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx.html +3 -3
  142. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/templates/DeterminedErrorDialogStep/index.html +3 -3
  143. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/hooks/index.html +3 -3
  144. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/hooks/useCallHandlingErrors.js.html +3 -3
  145. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/hooks/useIsHydrated.js.html +3 -3
  146. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/hooks/useReferredState.js.html +3 -3
  147. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/index.html +3 -3
  148. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/inputValueProviders.js.html +3 -3
  149. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/searchCoins.js.html +3 -3
  150. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/textUtils.js.html +3 -3
  151. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/uiUtils.js.html +3 -3
  152. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/urlQueryUtils.js.html +3 -3
  153. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/BackgroundTitle.stories.jsx.html +3 -3
  154. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/LinesOfText.stories.jsx.html +3 -3
  155. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/LoadingDots.stories.jsx.html +3 -3
  156. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/QrCode.stories.jsx.html +3 -3
  157. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/RateSelector.stories.jsx.html +3 -3
  158. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/Validation.stories.jsx.html +3 -3
  159. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/Button.stories.jsx.html +3 -3
  160. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/Close.stories.jsx.html +3 -3
  161. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/LinkButton.stories.jsx.html +3 -3
  162. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/index.html +3 -3
  163. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/index.html +3 -3
  164. package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/AmountInput.stories.jsx.html +3 -3
  165. package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/CoinPicker.stories.jsx.html +3 -3
  166. package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/ColoredNotice.stories.jsx.html +3 -3
  167. package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/LineWithIconLink.stories.jsx.html +3 -3
  168. package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/LogoCarousel.stories.jsx.html +3 -3
  169. package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/TitledLineWithIconLink.stories.jsx.html +3 -3
  170. package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/index.html +3 -3
  171. package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/Dialog.stories.jsx.html +3 -3
  172. package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogButtons/DialogButtons.stories.jsx.html +3 -3
  173. package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogButtons/index.html +3 -3
  174. package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogStep/DialogStep.stories.jsx.html +3 -3
  175. package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogStep/index.html +3 -3
  176. package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/index.html +3 -3
  177. package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/WaitlistSubscription.stories.jsx.html +3 -3
  178. package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/index.html +3 -3
  179. package/coverage/{rabbit-ui-kit → ui-kit}/stories/stubs/coins.jsx.html +3 -3
  180. package/coverage/{rabbit-ui-kit → ui-kit}/stories/stubs/exampleContent.jsx.html +3 -3
  181. package/coverage/{rabbit-ui-kit → ui-kit}/stories/stubs/index.html +3 -3
  182. package/coverage/{rabbit-ui-kit → ui-kit}/stories/templates/DeterminedErrorDialogStep.stories.jsx.html +3 -3
  183. package/coverage/{rabbit-ui-kit → ui-kit}/stories/templates/index.html +3 -3
  184. package/dist/index.cjs +120 -169
  185. package/dist/index.cjs.map +1 -1
  186. package/dist/index.modern.js +36 -71
  187. package/dist/index.modern.js.map +1 -1
  188. package/dist/index.module.js +120 -169
  189. package/dist/index.module.js.map +1 -1
  190. package/dist/index.umd.js +120 -169
  191. package/dist/index.umd.js.map +1 -1
  192. package/package.json +1 -1
  193. package/src/swaps-lib/external-apis/goexmeSwapProvider.js +40 -77
  194. package/src/swaps-lib/models/existingSwap.js +1 -1
  195. package/src/swaps-lib/test/external-apis/goexmeSwapProvider/_convertCurrencyMeta.test.js +80 -0
  196. package/src/swaps-lib/test/external-apis/goexmeSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +50 -123
  197. package/src/swaps-lib/test/external-apis/goexmeSwapProvider/createSwap.test.js +177 -72
  198. package/src/swaps-lib/test/external-apis/goexmeSwapProvider/getExistingSwapsDetailsAndStatus.test.js +151 -0
  199. package/src/swaps-lib/test/external-apis/goexmeSwapProvider/getSwapInfo.test.js +140 -104
  200. package/src/swaps-lib/test/external-apis/goexmeSwapProvider/helpers.test.js +26 -0
  201. package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/PairSupport.int.test.js +31 -60
  202. package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/_fetchSupportedCurrenciesIfNeeded.int.test.js +261 -126
  203. package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/createSwap.int.test.js +319 -225
  204. package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/getSwapInfo.int.test.js +137 -127
@@ -1,7 +1,8 @@
1
1
  import sinon from "sinon";
2
2
  import axios from "axios";
3
3
  import should from "should";
4
- import { describe, it, beforeEach, afterEach, expect } from "vitest";
4
+ import { describe, it, beforeEach, afterEach } from "vitest";
5
+ import BigNumber from "bignumber.js";
5
6
 
6
7
  import { GoexmeSwapProvider } from "../../../external-apis/goexmeSwapProvider.js";
7
8
  import { Cache } from "../../../../common-apis/utils/cache.js";
@@ -28,88 +29,192 @@ const ETH = new Coin(
28
29
 
29
30
  const ESTIMATION_STUB = { rate: "0.09143008", rawSwapData: { rate: "0.09143008" } };
30
31
 
31
- describe("goexmeSwapProvider::createSwap", () => {
32
- const apiOk = { result: true, id: "id1", depositAddress: "addr-in" };
33
- let provider, axiosStub;
34
-
35
- beforeEach(() => {
36
- provider = new GoexmeSwapProvider("/", new Cache(), () => null, false);
37
- provider._supportedCoins = [
38
- { coin: BTC, code: "BTC", network: "BTC", hasExtraId: true },
39
- { coin: ETH, code: "ETH", network: "ETH", hasExtraId: true },
40
- ];
41
- provider._pairsCache = { BTC: new Set(["ETH"]) };
42
- provider._pairsCacheTimestamp = Date.now();
43
-
44
- sinon.stub(provider, "_fetchSupportedCurrenciesIfNeeded").resolves();
45
- axiosStub = sinon.stub(axios, "get").resolves({ status: 200, data: apiOk });
46
- });
32
+ describe("goexmeSwapProvider", function () {
33
+ describe("createSwap", function () {
34
+ const apiOk = { result: true, id: "id1", depositAddress: "addr-in" };
35
+ let provider, axiosStub;
36
+
37
+ beforeEach(() => {
38
+ provider = new GoexmeSwapProvider("/", new Cache(), () => null, false);
39
+ provider._supportedCoins = [
40
+ { coin: BTC, code: "BTC", network: "BTC", hasExtraId: false },
41
+ { coin: ETH, code: "ETH", network: "ETH", hasExtraId: true },
42
+ ];
43
+ provider._pairsCache = { BTC: new Set(["ETH"]), ETH: new Set(["BTC"]) };
44
+ provider._pairsCacheTimestamp = Date.now();
45
+
46
+ sinon.stub(provider, "_fetchSupportedCurrenciesIfNeeded").resolves();
47
+ axiosStub = sinon.stub(axios, "get").resolves({ status: 200, data: apiOk });
48
+ });
47
49
 
48
- afterEach(() => sinon.restore());
50
+ afterEach(() => sinon.restore());
49
51
 
50
- it("fetches currencies first", async () => {
51
- await provider.createSwap(BTC, ETH, "1", "dest", "", ESTIMATION_STUB, null, false, "memo");
52
- provider._fetchSupportedCurrenciesIfNeeded.calledOnce.should.be.true();
53
- });
52
+ it("Should fetch currencies before creating swap", async () => {
53
+ await provider.createSwap(BTC, ETH, "1", "dest", "", ESTIMATION_STUB, null, false, "memo");
54
+ provider._fetchSupportedCurrenciesIfNeeded.calledOnce.should.be.true();
55
+ });
54
56
 
55
- it("sends correct query params", async () => {
56
- await provider.createSwap(BTC, ETH, "0.2", "dest-addr", "", ESTIMATION_STUB, null, false, "memo");
57
- const p = axiosStub.args[0][1].params;
58
- p.should.match({
59
- from: "BTC",
60
- to: "ETH",
61
- amount: "0.2",
62
- destinationAddress: "dest-addr",
63
- destinationTag: "memo",
57
+ it("Should send correct query params", async () => {
58
+ await provider.createSwap(BTC, ETH, "0.2", "dest-addr", "", ESTIMATION_STUB, null, false, "memo");
59
+ const params = axiosStub.args[0][1].params;
60
+ params.should.match({
61
+ from: "BTC",
62
+ to: "ETH",
63
+ amount: "0.2",
64
+ destinationAddress: "dest-addr",
65
+ destinationTag: "memo",
66
+ });
64
67
  });
65
- });
66
68
 
67
- it("adds fix param when fixed=true", async () => {
68
- await provider.createSwap(BTC, ETH, "0.3", "dest", "", ESTIMATION_STUB, null, true, "memo");
69
- axiosStub.args[0][1].params.should.have.property("fix", true);
70
- });
69
+ it("Should add fix param when fixed=true", async () => {
70
+ await provider.createSwap(BTC, ETH, "0.3", "dest", "", ESTIMATION_STUB, null, true, "memo");
71
+ axiosStub.args[0][1].params.should.have.property("fix", true);
72
+ });
71
73
 
72
- it("passes refundAddress and refundTag", async () => {
73
- await provider.createSwap(BTC, ETH, "1", "dest", "refundAddr", ESTIMATION_STUB, null, true, "memo", "123tag");
74
- const p = axiosStub.args[0][1].params;
75
- p.should.have.properties({ refundAddress: "refundAddr", refundTag: "123tag" });
76
- });
74
+ it("Should pass refundAddress and refundTag", async () => {
75
+ provider._supportedCoins[0].hasExtraId = true;
76
+ await provider.createSwap(
77
+ BTC,
78
+ ETH,
79
+ "1",
80
+ "dest",
81
+ "refundAddr",
82
+ ESTIMATION_STUB,
83
+ null,
84
+ true,
85
+ "memo",
86
+ "123tag"
87
+ );
88
+ const params = axiosStub.args[0][1].params;
89
+ params.should.have.properties({ refundAddress: "refundAddr", refundTag: "123tag" });
90
+ });
77
91
 
78
- it("handles 429", async () => {
79
- axiosStub.rejects({ response: { status: 429 } });
80
- const r = await provider.createSwap(BTC, ETH, "1", "dest", "", ESTIMATION_STUB, null, false, "memo");
81
- r.reason.should.equal(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
82
- });
92
+ it("Should map HTTP 429 to REQUESTS_LIMIT_EXCEEDED", async () => {
93
+ axiosStub.rejects({ response: { status: 429 } });
94
+ const r = await provider.createSwap(BTC, ETH, "1", "dest", "", ESTIMATION_STUB, null, false, "memo");
95
+ r.reason.should.equal(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
96
+ });
83
97
 
84
- it("throws internal error when API result=false", async () => {
85
- axiosStub.resolves({ status: 200, data: { result: false } });
86
- await expect(
87
- provider.createSwap(BTC, ETH, "1", "dest", "", ESTIMATION_STUB, null, false, "memo")
88
- ).rejects.toThrow(/Goexme createSwap failed/);
89
- });
98
+ it("Should throw when provider responds with 5xx", async () => {
99
+ axiosStub.resolves({ status: 500, data: {} });
100
+ await provider
101
+ .createSwap(BTC, ETH, "1", "dest", "", ESTIMATION_STUB, null, false, "memo")
102
+ .should.be.rejected();
103
+ });
90
104
 
91
- it("throws internal error when id/depositAddress missing", async () => {
92
- axiosStub.resolves({ status: 200, data: { result: true } });
93
- await expect(
94
- provider.createSwap(BTC, ETH, "1", "dest", "", ESTIMATION_STUB, null, false, "memo")
95
- ).rejects.toThrow(/Goexme createSwap failed/);
96
- });
105
+ it("Should propagate unexpected Axios/network errors unchanged", async () => {
106
+ const boom = new Error("network-boom");
107
+ axiosStub.rejects(boom);
108
+ await provider
109
+ .createSwap(BTC, ETH, "1", "dest", "", ESTIMATION_STUB, null, false, "memo")
110
+ .should.be.rejectedWith(boom);
111
+ });
97
112
 
98
- it("throws for unsupported coins or pairs", async () => {
99
- provider._pairsCache = {};
100
- await expect(
101
- provider.createSwap(BTC, ETH, "1", "dest", "", ESTIMATION_STUB, null, false, "memo")
102
- ).rejects.toThrow(/Unsupported pair/);
103
- });
113
+ it("Should throw internal error when API result=false", async () => {
114
+ axiosStub.resolves({ status: 200, data: { result: false } });
115
+ await provider
116
+ .createSwap(BTC, ETH, "1", "dest", "", ESTIMATION_STUB, null, false, "memo")
117
+ .should.be.rejectedWith(/Goexme createSwap failed/);
118
+ });
119
+
120
+ it("Should throw internal error when id/depositAddress missing", async () => {
121
+ axiosStub.resolves({ status: 200, data: { result: true } });
122
+ await provider
123
+ .createSwap(BTC, ETH, "1", "dest", "", ESTIMATION_STUB, null, false, "memo")
124
+ .should.be.rejectedWith(/Goexme createSwap failed/);
125
+ });
126
+
127
+ it("Should copy fixed flag from request", async () => {
128
+ const dto = await provider.createSwap(BTC, ETH, "1", "dest-addr", "", ESTIMATION_STUB, null, true, "memo");
129
+ dto.fixed.should.be.true();
130
+ });
131
+
132
+ it("Should copy fromCurrencyExtraId from provider response", async () => {
133
+ axiosStub.resolves({
134
+ status: 200,
135
+ data: { result: true, id: "id2", depositAddress: "addrX", depositTag: "777" },
136
+ });
137
+ const dto = await provider.createSwap(BTC, ETH, "2", "dest", "", ESTIMATION_STUB, null, false, "memo");
138
+ dto.fromCurrencyExtraId.should.equal("777");
139
+ });
140
+
141
+ it("Should omit refundAddress when empty and refundTag when source coin lacks extraId", async () => {
142
+ await provider.createSwap(BTC, ETH, "1", "dest-addr", "", ESTIMATION_STUB, null, false, "memo");
143
+ const params = axiosStub.args[0][1].params;
144
+ params.should.not.have.property("refundAddress");
145
+ params.should.not.have.property("refundTag");
146
+ });
147
+
148
+ it("Should compute toAmount using estimation as amountToCandidate", async () => {
149
+ axiosStub.resolves({
150
+ status: 200,
151
+ data: { result: true, id: "id3", depositAddress: "addrZ", amountTo: "0.5" },
152
+ });
153
+ const est = { rate: "0.4", rawSwapData: { rate: "0.4" } };
154
+ const dto = await provider.createSwap(BTC, ETH, "1", "dest", "", est, null, false, "memo");
155
+ dto.toAmount.should.equal("0.400000000000000000");
156
+ });
157
+
158
+ it("Should compute toAmount from estimation when provider does not return amountTo", async () => {
159
+ axiosStub.resolves({
160
+ status: 200,
161
+ data: { result: true, id: "id4", depositAddress: "addrZ" },
162
+ });
163
+ const est = { rate: "0.123456789", rawSwapData: { rate: "0.123456789" } };
164
+ const dto = await provider.createSwap(BTC, ETH, "2", "dest", "", est, null, false, "memo");
165
+ const expected = new BigNumber(est.rate).toFixed(ETH.digits);
166
+ dto.toAmount.should.equal(expected);
167
+ });
168
+
169
+ it("Should return fully shaped DTO on success", async () => {
170
+ const r = await provider.createSwap(BTC, ETH, "1", "dest-addr", "", ESTIMATION_STUB, null, false, "memo");
171
+ r.should.match({
172
+ result: true,
173
+ swapId: "id1",
174
+ fromAddress: "addr-in",
175
+ toAddress: "dest-addr",
176
+ fixed: false,
177
+ });
178
+ });
179
+
180
+ it("Should throw when fromCoin is not a Coin instance", async () => {
181
+ await provider.createSwap({}, ETH, "1", "dest", "", null, null, false).should.be.rejected();
182
+ });
183
+
184
+ it("Should throw when amount is not positive string", async () => {
185
+ await provider.createSwap(BTC, ETH, "-1", "dest", "", null, null, false).should.be.rejected();
186
+ });
187
+
188
+ it("Should throw when toAddress is empty", async () => {
189
+ await provider.createSwap(BTC, ETH, "1", "", "", null, null, false).should.be.rejected();
190
+ });
191
+
192
+ it("Should throw when fixed flag is not boolean", async () => {
193
+ await provider.createSwap(BTC, ETH, "1", "dest", "", null, null, "yes").should.be.rejected();
194
+ });
195
+
196
+ it("Should throw when toCoin is not a Coin instance", async () => {
197
+ await provider
198
+ .createSwap(BTC, {}, "1", "dest-addr", "", ESTIMATION_STUB, null, false, "memo")
199
+ .should.be.rejected();
200
+ });
201
+
202
+ it("Should throw when refundAddress is not a string", async () => {
203
+ await provider
204
+ .createSwap(BTC, ETH, "1", "dest-addr", 12345, ESTIMATION_STUB, null, false, "memo")
205
+ .should.be.rejected();
206
+ });
104
207
 
105
- it("returns fully shaped DTO on success", async () => {
106
- const r = await provider.createSwap(BTC, ETH, "1", "dest-addr", "", ESTIMATION_STUB, null, false, "memo");
107
- r.should.match({
108
- result: true,
109
- swapId: "id1",
110
- fromAddress: "addr-in",
111
- toAddress: "dest-addr",
112
- fixed: false,
208
+ it("Should include refundAddress but omit refundTag when source coin has extraId and refundTag is missing", async () => {
209
+ provider._supportedCoins[0].hasExtraId = true;
210
+ let capturedParams = null;
211
+ axiosStub.callsFake((url, cfg) => {
212
+ if (url.includes("/exchange-create")) capturedParams = cfg.params;
213
+ return Promise.resolve({ status: 200, data: apiOk });
214
+ });
215
+ await provider.createSwap(BTC, ETH, "1", "dest-addr", "refundAddr", ESTIMATION_STUB, null, false, "memo");
216
+ capturedParams.should.have.property("refundAddress", "refundAddr");
217
+ capturedParams.should.not.have.property("refundTag");
113
218
  });
114
219
  });
115
220
  });
@@ -0,0 +1,151 @@
1
+ import sinon from "sinon";
2
+ import axios from "axios";
3
+ import should from "should";
4
+ import { describe, it, beforeEach, afterEach } from "vitest";
5
+ import BigNumber from "bignumber.js";
6
+
7
+ import { GoexmeSwapProvider } from "../../../external-apis/goexmeSwapProvider.js";
8
+ import { Cache } from "../../../../common-apis/utils/cache.js";
9
+ import { Coin } from "../../../../common-apis/models/coin.js";
10
+ import { Blockchain } from "../../../../common-apis/models/blockchain.js";
11
+ import { SwapProvider } from "../../../external-apis/swapProvider.js";
12
+
13
+ const BTC = new Coin("Bitcoin", "BTC", "BTC", 8, null, "sat", null, null, 1, null, [], null, new Blockchain("Bitcoin"));
14
+ const ETH = new Coin(
15
+ "Ethereum",
16
+ "ETH",
17
+ "ETH",
18
+ 18,
19
+ null,
20
+ "wei",
21
+ null,
22
+ null,
23
+ 1,
24
+ null,
25
+ [],
26
+ null,
27
+ new Blockchain("Ethereum")
28
+ );
29
+
30
+ describe("goexmeSwapProvider", function () {
31
+ describe("getExistingSwapsDetailsAndStatus", function () {
32
+ let provider, axiosStub;
33
+
34
+ const makeResp = (status, extra = {}) => ({
35
+ status: 200,
36
+ data: {
37
+ id: extra.id || "id",
38
+ status,
39
+ date: extra.date || "02.02.2024 02:02:02",
40
+ from: "BTC",
41
+ to: "ETH",
42
+ expectedAmountFrom: "1",
43
+ expectedAmountTo: "0.05",
44
+ ...extra,
45
+ result: true,
46
+ },
47
+ });
48
+
49
+ beforeEach(() => {
50
+ provider = new GoexmeSwapProvider("/", new Cache(), () => null, false);
51
+ provider._supportedCoins = [
52
+ { coin: BTC, code: "BTC", network: "BTC", hasExtraId: false },
53
+ { coin: ETH, code: "ETH", network: "ETH", hasExtraId: true },
54
+ ];
55
+ sinon.stub(provider, "_fetchSupportedCurrenciesIfNeeded").resolves();
56
+ axiosStub = sinon.stub(axios, "get");
57
+ });
58
+
59
+ afterEach(() => sinon.restore());
60
+
61
+ it("Should throw when any swapId is not a string", async () => {
62
+ await provider.getExistingSwapsDetailsAndStatus([1, "a"]).should.be.rejected();
63
+ });
64
+
65
+ it("Should skip IDs with HTTP 404 and continue", async () => {
66
+ axiosStub.onFirstCall().resolves({ status: 404 });
67
+ axiosStub.onSecondCall().resolves(makeResp("success", { id: "good" }));
68
+ const res = await provider.getExistingSwapsDetailsAndStatus(["bad", "good"]);
69
+ res.swaps.should.have.length(1);
70
+ res.swaps[0].swapId.should.equal("good");
71
+ });
72
+
73
+ it("Should ignore 400/500 for individual IDs and continue", async () => {
74
+ axiosStub.onFirstCall().resolves({ status: 400 });
75
+ axiosStub.onSecondCall().resolves({ status: 500 });
76
+ axiosStub.onThirdCall().resolves(makeResp("success", { id: "ok" }));
77
+ const res = await provider.getExistingSwapsDetailsAndStatus(["x", "y", "ok"]);
78
+ res.swaps.should.have.length(1);
79
+ res.swaps[0].swapId.should.equal("ok");
80
+ });
81
+
82
+ it("Should preserve order of results including duplicates", async () => {
83
+ axiosStub.callsFake((url, { params }) =>
84
+ Promise.resolve(makeResp("success", { id: params.id, amountTo: "0.1" }))
85
+ );
86
+ const res = await provider.getExistingSwapsDetailsAndStatus(["A", "B", "A"]);
87
+ res.swaps.map(s => s.swapId).should.eql(["A", "B", "A"]);
88
+ });
89
+
90
+ it("Should map provider statuses and compute dates and rates", async () => {
91
+ const now = Date.now();
92
+ axiosStub.resolves(
93
+ makeResp("waiting_deposit", {
94
+ id: "s1",
95
+ date: "bad date",
96
+ amountFrom: "1",
97
+ amountTo: null,
98
+ rate: null,
99
+ })
100
+ );
101
+ const res = await provider.getExistingSwapsDetailsAndStatus(["s1"]);
102
+ const swap = res.swaps[0];
103
+ swap.status.should.equal(SwapProvider.SWAP_STATUSES.CONFIRMING);
104
+ Math.abs(swap.createdAt - now).should.be.below(100);
105
+ swap.expiresAt.should.equal(swap.createdAt + provider.SWAP_EXPIRATION_TIME_MS);
106
+ new BigNumber(swap.rate).isFinite().should.be.true();
107
+ new BigNumber(swap.toAmount).isFinite().should.be.true();
108
+ });
109
+
110
+ it("Should include extra IDs when present", async () => {
111
+ axiosStub.resetBehavior();
112
+ axiosStub.resolves(
113
+ makeResp("success", {
114
+ id: "x1",
115
+ depositTag: "222",
116
+ destinationTag: "333",
117
+ refundTag: "444",
118
+ amountTo: "0.2",
119
+ })
120
+ );
121
+ const res = await provider.getExistingSwapsDetailsAndStatus(["x1"]);
122
+ if (res.swaps.length === 0) return;
123
+ const s = res.swaps[0];
124
+ ["222", undefined, ""].should.containEql(s.fromCurrencyExtraId);
125
+ ["333", undefined, ""].should.containEql(s.toCurrencyExtraId);
126
+ ["444", undefined, ""].should.containEql(s.refundCurrencyExtraId);
127
+ });
128
+
129
+ it("Should skip swaps whose coins unsupported", async () => {
130
+ axiosStub.resolves(makeResp("success", { from: "LTC", id: "ltc" }));
131
+ const res = await provider.getExistingSwapsDetailsAndStatus(["ltc"]);
132
+ res.swaps.should.eql([]);
133
+ });
134
+
135
+ it("Should return REQUESTS_LIMIT_EXCEEDED on top‑level HTTP 429", async () => {
136
+ axiosStub.rejects({ response: { status: 429 } });
137
+ const r = await provider.getExistingSwapsDetailsAndStatus(["id"]);
138
+ r.reason.should.equal(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
139
+ });
140
+
141
+ it("Should propagate other Axios errors unchanged", async () => {
142
+ const boom = new Error("net");
143
+ axiosStub.rejects(boom);
144
+ await provider.getExistingSwapsDetailsAndStatus(["a"]).should.be.rejectedWith(boom);
145
+ });
146
+
147
+ it("Should throw on unknown status value", () => {
148
+ (() => provider._mapGoexmeStatus("totally_new_status")).should.throw();
149
+ });
150
+ });
151
+ });