@rabbitio/ui-kit 1.0.0-beta.73 → 1.0.0-beta.75

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 (246) hide show
  1. package/.husky/commit-msg +5 -0
  2. package/coverage/clover.xml +713 -4535
  3. package/coverage/coverage-final.json +96 -157
  4. package/coverage/index.html +73 -328
  5. package/coverage/{ui-kit → rabbit-ui-kit}/index.html +3 -3
  6. package/coverage/{ui-kit → rabbit-ui-kit}/index.js.html +3 -3
  7. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/adapters/axiosAdapter.js.html +3 -3
  8. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/adapters/index.html +3 -3
  9. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/adapters/qrUtils.js.html +3 -3
  10. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/amountUtils.js.html +3 -3
  11. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/errorUtils.js.html +3 -3
  12. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/external-apis/apiGroups.js.html +3 -3
  13. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/external-apis/index.html +3 -3
  14. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/external-apis/ipAddressProviders.js.html +3 -3
  15. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/fiatCurrenciesService.js.html +3 -3
  16. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/globalConstants.jsx.html +3 -3
  17. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/index.html +3 -3
  18. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/models/blockchain.js.html +3 -3
  19. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/models/coin.js.html +3 -3
  20. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/models/index.html +3 -3
  21. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/models/protocol.js.html +3 -3
  22. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/utils/cache.js.html +3 -3
  23. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/utils/emailAPI.js.html +3 -3
  24. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/utils/index.html +3 -3
  25. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/utils/logging/index.html +3 -3
  26. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/utils/logging/logger.js.html +3 -3
  27. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/utils/logging/logsStorage.js.html +3 -3
  28. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/utils/postponeExecution.js.html +3 -3
  29. package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/utils/safeStringify.js.html +3 -3
  30. package/coverage/{ui-kit → rabbit-ui-kit}/src/index.html +3 -3
  31. package/coverage/{ui-kit → rabbit-ui-kit}/src/index.js.html +3 -3
  32. package/coverage/{ui-kit → rabbit-ui-kit}/src/robust-api-caller/cacheAndConcurrentRequestsResolver.js.html +3 -3
  33. package/coverage/{ui-kit → rabbit-ui-kit}/src/robust-api-caller/cachedRobustExternalApiCallerService.js.html +3 -3
  34. package/coverage/{ui-kit → rabbit-ui-kit}/src/robust-api-caller/cancelProcessing.js.html +3 -3
  35. package/coverage/{ui-kit → rabbit-ui-kit}/src/robust-api-caller/concurrentCalculationsMetadataHolder.js.html +3 -3
  36. package/coverage/{ui-kit → rabbit-ui-kit}/src/robust-api-caller/externalApiProvider.js.html +3 -3
  37. package/coverage/{ui-kit → rabbit-ui-kit}/src/robust-api-caller/externalServicesStatsCollector.js.html +3 -3
  38. package/coverage/{ui-kit → rabbit-ui-kit}/src/robust-api-caller/index.html +3 -3
  39. package/coverage/{ui-kit → rabbit-ui-kit}/src/robust-api-caller/robustExternalAPICallerService.js.html +3 -3
  40. package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/external-apis/index.html +25 -25
  41. package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/external-apis/letsExchangeSwapProvider.js.html +82 -25
  42. package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/external-apis/swapProvider.js.html +159 -12
  43. package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +27 -9
  44. package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/models/baseSwapCreationInfo.js.html +3 -3
  45. package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/models/existingSwap.js.html +3 -3
  46. package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/models/existingSwapWithFiatData.js.html +3 -3
  47. package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/models/index.html +3 -3
  48. package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/services/index.html +7 -7
  49. package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/services/publicSwapService.js.html +28 -13
  50. package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/utils/index.html +3 -3
  51. package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/utils/swapUtils.js.html +3 -3
  52. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/arrowIcon.jsx.html +3 -3
  53. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/arrowTosca.jsx.html +3 -3
  54. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/arrowWhite.jsx.html +3 -3
  55. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/darkRectangle.jsx.html +3 -3
  56. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/determinedError.jsx.html +3 -3
  57. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/failedValidationIcon.jsx.html +3 -3
  58. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/index.html +3 -3
  59. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/infoIcon.jsx.html +3 -3
  60. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/noticeQuestionIcon.jsx.html +3 -3
  61. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx.html +3 -3
  62. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/walletIcon.jsx.html +3 -3
  63. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/AssetIcon/AssetIcon.jsx.html +3 -3
  64. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/AssetIcon/index.html +3 -3
  65. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/AssetSelection/AssetSelection.jsx.html +3 -3
  66. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/AssetSelection/index.html +3 -3
  67. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +3 -3
  68. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/BackgroundTitle/index.html +3 -3
  69. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/InformationMessage/InformationMessage.jsx.html +3 -3
  70. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/InformationMessage/index.html +3 -3
  71. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/Input/Input.jsx.html +3 -3
  72. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/Input/index.html +3 -3
  73. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/LoadingDots/LoadingDots.jsx.html +3 -3
  74. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/LoadingDots/index.html +3 -3
  75. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx.html +3 -3
  76. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/NoticeIcon/index.html +3 -3
  77. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/QrCode/QrCode.jsx.html +3 -3
  78. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/QrCode/index.html +3 -3
  79. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx.html +3 -3
  80. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/RateSelector/index.html +3 -3
  81. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/SupportChat/SupportChat.jsx.html +3 -3
  82. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/SupportChat/index.html +3 -3
  83. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/Textarea/Textarea.jsx.html +3 -3
  84. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/Textarea/index.html +3 -3
  85. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/TitleBox/TitleBox.jsx.html +3 -3
  86. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/TitleBox/index.html +3 -3
  87. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/Tooltip/Tooltip.jsx.html +3 -3
  88. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/Tooltip/index.html +3 -3
  89. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx.html +3 -3
  90. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/TwoLinesOfText/index.html +3 -3
  91. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/Validation/Validation.jsx.html +3 -3
  92. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/Validation/index.html +3 -3
  93. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/buttons/Button/Button.jsx.html +3 -3
  94. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/buttons/Button/index.html +3 -3
  95. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/buttons/Close/Close.jsx.html +3 -3
  96. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/buttons/Close/index.html +3 -3
  97. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx.html +3 -3
  98. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/buttons/LinkButton/index.html +3 -3
  99. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +3 -3
  100. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/buttons/RadioButtonWithText/index.html +3 -3
  101. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx.html +3 -3
  102. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/molecules/AmountInput/index.html +3 -3
  103. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx.html +3 -3
  104. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/molecules/CoinPicker/index.html +3 -3
  105. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/molecules/LineWithIconLink/LineWithIconLink.jsx.html +3 -3
  106. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/molecules/LineWithIconLink/index.html +3 -3
  107. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx.html +3 -3
  108. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/molecules/TitledLineWithIconLink/index.html +3 -3
  109. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +3 -3
  110. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/CoinPickerDialogStep/index.html +3 -3
  111. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/Dialog/Dialog.jsx.html +3 -3
  112. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +3 -3
  113. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/Dialog/DialogButtons/index.html +3 -3
  114. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +3 -3
  115. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/Dialog/DialogStep/index.html +3 -3
  116. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/Dialog/index.html +3 -3
  117. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx.html +99 -24
  118. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/SwapForm/index.html +7 -7
  119. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx.html +3 -3
  120. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/templates/DeterminedErrorDialogStep/index.html +3 -3
  121. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/hooks/index.html +3 -3
  122. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/hooks/useCallHandlingErrors.js.html +3 -3
  123. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/hooks/useIsHydrated.js.html +3 -3
  124. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/hooks/useReferredState.js.html +3 -3
  125. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/utils/index.html +3 -3
  126. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/utils/inputValueProviders.js.html +3 -3
  127. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/utils/textUtils.js.html +3 -3
  128. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/utils/uiUtils.js.html +3 -3
  129. package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/utils/urlQueryUtils.js.html +3 -3
  130. package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/BackgroundTitle.stories.jsx.html +3 -3
  131. package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/LinesOfText.stories.jsx.html +3 -3
  132. package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/LoadingDots.stories.jsx.html +3 -3
  133. package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/QrCode.stories.jsx.html +3 -3
  134. package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/RateSelector.stories.jsx.html +3 -3
  135. package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/Validation.stories.jsx.html +3 -3
  136. package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/buttons/Button.stories.jsx.html +3 -3
  137. package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/buttons/Close.stories.jsx.html +3 -3
  138. package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/buttons/LinkButton.stories.jsx.html +3 -3
  139. package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/buttons/index.html +3 -3
  140. package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/index.html +3 -3
  141. package/coverage/{ui-kit → rabbit-ui-kit}/stories/molecules/LineWithIconLink.stories.jsx.html +3 -3
  142. package/coverage/{ui-kit → rabbit-ui-kit}/stories/molecules/TitledLineWithIconLink.stories.jsx.html +3 -3
  143. package/coverage/{ui-kit → rabbit-ui-kit}/stories/molecules/index.html +3 -3
  144. package/coverage/{ui-kit → rabbit-ui-kit}/stories/organisms/Dialog/Dialog.stories.jsx.html +3 -3
  145. package/coverage/{ui-kit → rabbit-ui-kit}/stories/organisms/Dialog/DialogButtons/DialogButtons.stories.jsx.html +3 -3
  146. package/coverage/{ui-kit → rabbit-ui-kit}/stories/organisms/Dialog/DialogButtons/index.html +3 -3
  147. package/coverage/{ui-kit → rabbit-ui-kit}/stories/organisms/Dialog/DialogStep/DialogStep.stories.jsx.html +3 -3
  148. package/coverage/{ui-kit → rabbit-ui-kit}/stories/organisms/Dialog/DialogStep/index.html +3 -3
  149. package/coverage/{ui-kit → rabbit-ui-kit}/stories/organisms/Dialog/index.html +3 -3
  150. package/coverage/{ui-kit → rabbit-ui-kit}/stories/stubs/exampleContent.jsx.html +3 -3
  151. package/coverage/{ui-kit → rabbit-ui-kit}/stories/stubs/index.html +3 -3
  152. package/coverage/{ui-kit → rabbit-ui-kit}/stories/templates/DeterminedErrorDialogStep.stories.jsx.html +3 -3
  153. package/coverage/{ui-kit → rabbit-ui-kit}/stories/templates/index.html +3 -3
  154. package/dist/index.cjs +139 -86
  155. package/dist/index.cjs.map +1 -1
  156. package/dist/index.modern.js +99 -51
  157. package/dist/index.modern.js.map +1 -1
  158. package/dist/index.module.js +139 -86
  159. package/dist/index.module.js.map +1 -1
  160. package/dist/index.umd.js +139 -86
  161. package/dist/index.umd.js.map +1 -1
  162. package/package.json +1 -1
  163. package/src/swaps-lib/external-apis/letsExchangeSwapProvider.js +38 -19
  164. package/src/swaps-lib/external-apis/swapProvider.js +50 -1
  165. package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +7 -1
  166. package/src/swaps-lib/services/publicSwapService.js +12 -7
  167. package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +1 -1
  168. package/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx +43 -18
  169. package/coverage/ui-kit/storybook-static/124.c2d01e5e.iframe.bundle.js.html +0 -85
  170. package/coverage/ui-kit/storybook-static/138.56b7edc4.iframe.bundle.js.html +0 -85
  171. package/coverage/ui-kit/storybook-static/312.6f62bbd9.iframe.bundle.js.html +0 -85
  172. package/coverage/ui-kit/storybook-static/341.57a15f57.iframe.bundle.js.html +0 -85
  173. package/coverage/ui-kit/storybook-static/370.73bb343e.iframe.bundle.js.html +0 -85
  174. package/coverage/ui-kit/storybook-static/595.2e40d981.iframe.bundle.js.html +0 -85
  175. package/coverage/ui-kit/storybook-static/607.3ea32459.iframe.bundle.js.html +0 -85
  176. package/coverage/ui-kit/storybook-static/609.8c79ec77.iframe.bundle.js.html +0 -85
  177. package/coverage/ui-kit/storybook-static/666.09fdc1d7.iframe.bundle.js.html +0 -85
  178. package/coverage/ui-kit/storybook-static/797.c87cdf19.iframe.bundle.js.html +0 -85
  179. package/coverage/ui-kit/storybook-static/822.4bc0ebce.iframe.bundle.js.html +0 -85
  180. package/coverage/ui-kit/storybook-static/833.08e3ebb6.iframe.bundle.js.html +0 -85
  181. package/coverage/ui-kit/storybook-static/862.bf6bfe62.iframe.bundle.js.html +0 -85
  182. package/coverage/ui-kit/storybook-static/87.0a1bfeb1.iframe.bundle.js.html +0 -85
  183. package/coverage/ui-kit/storybook-static/893.4b09f929.iframe.bundle.js.html +0 -85
  184. package/coverage/ui-kit/storybook-static/996.846a677b.iframe.bundle.js.html +0 -85
  185. package/coverage/ui-kit/storybook-static/atoms-BackgroundTitle-stories.1a5386a1.iframe.bundle.js.html +0 -85
  186. package/coverage/ui-kit/storybook-static/atoms-LinesOfText-stories.7043a48b.iframe.bundle.js.html +0 -85
  187. package/coverage/ui-kit/storybook-static/atoms-LoadingDots-stories.091245c7.iframe.bundle.js.html +0 -85
  188. package/coverage/ui-kit/storybook-static/atoms-QrCode-stories.e10363b6.iframe.bundle.js.html +0 -85
  189. package/coverage/ui-kit/storybook-static/atoms-RateSelector-stories.af208e9a.iframe.bundle.js.html +0 -85
  190. package/coverage/ui-kit/storybook-static/atoms-Validation-stories.d561b311.iframe.bundle.js.html +0 -85
  191. package/coverage/ui-kit/storybook-static/atoms-buttons-Button-stories.e8e6b930.iframe.bundle.js.html +0 -85
  192. package/coverage/ui-kit/storybook-static/atoms-buttons-Close-stories.0a902a7c.iframe.bundle.js.html +0 -85
  193. package/coverage/ui-kit/storybook-static/atoms-buttons-LinkButton-stories.ca93ab6b.iframe.bundle.js.html +0 -85
  194. package/coverage/ui-kit/storybook-static/index.html +0 -596
  195. package/coverage/ui-kit/storybook-static/main.41f410f2.iframe.bundle.js.html +0 -85
  196. package/coverage/ui-kit/storybook-static/molecules-LineWithIconLink-stories.9721a18c.iframe.bundle.js.html +0 -85
  197. package/coverage/ui-kit/storybook-static/molecules-TitledLineWithIconLink-stories.1383fe3f.iframe.bundle.js.html +0 -85
  198. package/coverage/ui-kit/storybook-static/organisms-Dialog-Dialog-stories.4e6da717.iframe.bundle.js.html +0 -85
  199. package/coverage/ui-kit/storybook-static/organisms-Dialog-DialogButtons-DialogButtons-stories.6f45ae6e.iframe.bundle.js.html +0 -85
  200. package/coverage/ui-kit/storybook-static/organisms-Dialog-DialogStep-DialogStep-stories.74896048.iframe.bundle.js.html +0 -85
  201. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/addon-backgrounds/dist/index.html +0 -116
  202. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/addon-backgrounds/dist/preview.js.html +0 -118
  203. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/components/dist/formatter-SWP5E3XI.mjs.html +0 -118
  204. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/components/dist/index.html +0 -116
  205. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/buffer/index.html +0 -116
  206. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/buffer/index.js.html +0 -118
  207. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/markdown-to-jsx/dist/index.html +0 -116
  208. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/markdown-to-jsx/dist/index.modern.js.html +0 -118
  209. package/coverage/ui-kit/storybook-static/runtime~main.ad918f38.iframe.bundle.js.html +0 -85
  210. package/coverage/ui-kit/storybook-static/sb-addons/actions-9/index.html +0 -116
  211. package/coverage/ui-kit/storybook-static/sb-addons/actions-9/manager-bundle.js.html +0 -94
  212. package/coverage/ui-kit/storybook-static/sb-addons/essentials-backgrounds-2/index.html +0 -116
  213. package/coverage/ui-kit/storybook-static/sb-addons/essentials-backgrounds-2/manager-bundle.js.html +0 -121
  214. package/coverage/ui-kit/storybook-static/sb-addons/essentials-controls-1/index.html +0 -116
  215. package/coverage/ui-kit/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js.html +0 -274
  216. package/coverage/ui-kit/storybook-static/sb-addons/essentials-measure-4/index.html +0 -116
  217. package/coverage/ui-kit/storybook-static/sb-addons/essentials-measure-4/manager-bundle.js.html +0 -94
  218. package/coverage/ui-kit/storybook-static/sb-addons/essentials-outline-5/index.html +0 -116
  219. package/coverage/ui-kit/storybook-static/sb-addons/essentials-outline-5/manager-bundle.js.html +0 -94
  220. package/coverage/ui-kit/storybook-static/sb-addons/essentials-toolbars-3/index.html +0 -116
  221. package/coverage/ui-kit/storybook-static/sb-addons/essentials-toolbars-3/manager-bundle.js.html +0 -94
  222. package/coverage/ui-kit/storybook-static/sb-addons/interactions-7/index.html +0 -116
  223. package/coverage/ui-kit/storybook-static/sb-addons/interactions-7/manager-bundle.js.html +0 -121
  224. package/coverage/ui-kit/storybook-static/sb-addons/links-0/index.html +0 -116
  225. package/coverage/ui-kit/storybook-static/sb-addons/links-0/manager-bundle.js.html +0 -94
  226. package/coverage/ui-kit/storybook-static/sb-addons/onboarding-6/index.html +0 -116
  227. package/coverage/ui-kit/storybook-static/sb-addons/onboarding-6/manager-bundle.js.html +0 -1588
  228. package/coverage/ui-kit/storybook-static/sb-addons/viewport-8/index.html +0 -116
  229. package/coverage/ui-kit/storybook-static/sb-addons/viewport-8/manager-bundle.js.html +0 -94
  230. package/coverage/ui-kit/storybook-static/sb-manager/WithTooltip-V3YHNWJZ-LVYLGZW2.js.html +0 -88
  231. package/coverage/ui-kit/storybook-static/sb-manager/chunk-2IXBUOFS.js.html +0 -106
  232. package/coverage/ui-kit/storybook-static/sb-manager/chunk-INSKDKQB.js.html +0 -1129
  233. package/coverage/ui-kit/storybook-static/sb-manager/chunk-NGTUFCUO.js.html +0 -112
  234. package/coverage/ui-kit/storybook-static/sb-manager/chunk-UUEAOBSN.js.html +0 -1303
  235. package/coverage/ui-kit/storybook-static/sb-manager/chunk-ZEU7PDD3.js.html +0 -88
  236. package/coverage/ui-kit/storybook-static/sb-manager/formatter-SWP5E3XI-7BGIK6BL.js.html +0 -553
  237. package/coverage/ui-kit/storybook-static/sb-manager/globals-module-info.js.html +0 -88
  238. package/coverage/ui-kit/storybook-static/sb-manager/globals.js.html +0 -88
  239. package/coverage/ui-kit/storybook-static/sb-manager/index.html +0 -281
  240. package/coverage/ui-kit/storybook-static/sb-manager/index.js.html +0 -88
  241. package/coverage/ui-kit/storybook-static/sb-manager/runtime.js.html +0 -88
  242. package/coverage/ui-kit/storybook-static/sb-manager/syntaxhighlighter-V7JZZA35-DXZCI2WR.js.html +0 -88
  243. package/coverage/ui-kit/storybook-static/sb-preview/globals.js.html +0 -88
  244. package/coverage/ui-kit/storybook-static/sb-preview/index.html +0 -131
  245. package/coverage/ui-kit/storybook-static/sb-preview/runtime.js.html +0 -421
  246. package/coverage/ui-kit/storybook-static/templates-DeterminedErrorDialogStep-stories.3cc14214.iframe.bundle.js.html +0 -85
package/dist/index.cjs CHANGED
@@ -4741,7 +4741,7 @@ var SwapForm = function SwapForm(_ref) {
4741
4741
  _ref$formHasBalance = _ref.formHasBalance,
4742
4742
  formHasBalance = _ref$formHasBalance === void 0 ? false : _ref$formHasBalance,
4743
4743
  _ref$retrieveSwapDeta = _ref.retrieveSwapDetails,
4744
- retrieveSwapDetails = _ref$retrieveSwapDeta === void 0 ? function (sendingAssetTicker, receivingAssetTicker, amount, isSwapAll, editedLastInput) {
4744
+ retrieveSwapDetails = _ref$retrieveSwapDeta === void 0 ? function (sendingAssetTicker, receivingAssetTicker, amount, isSwapAll, isFixed, amountIsToReceive) {
4745
4745
  return Promise.resolve();
4746
4746
  } : _ref$retrieveSwapDeta,
4747
4747
  _ref$retrieveInitialS = _ref.retrieveInitialSwapData,
@@ -4768,6 +4768,10 @@ var SwapForm = function SwapForm(_ref) {
4768
4768
  termsOfUseUrl = _ref$termsOfUseUrl === void 0 ? null : _ref$termsOfUseUrl,
4769
4769
  _ref$privacyPolicyUrl = _ref.privacyPolicyUrl,
4770
4770
  privacyPolicyUrl = _ref$privacyPolicyUrl === void 0 ? null : _ref$privacyPolicyUrl,
4771
+ _ref$getExtraIdNameBy = _ref.getExtraIdNameByTicker,
4772
+ getExtraIdNameByTicker = _ref$getExtraIdNameBy === void 0 ? function (ticker) {
4773
+ return null;
4774
+ } : _ref$getExtraIdNameBy,
4771
4775
  _ref$validateAddressB = _ref.validateAddressByTicker,
4772
4776
  validateAddressByTicker = _ref$validateAddressB === void 0 ? function () {
4773
4777
  return false;
@@ -4777,8 +4781,6 @@ var SwapForm = function SwapForm(_ref) {
4777
4781
  swapButtonAlwaysActive = _ref$swapButtonAlways === void 0 ? false : _ref$swapButtonAlways,
4778
4782
  _ref$onIsFixedChange = _ref.onIsFixedChange,
4779
4783
  onIsFixedChange = _ref$onIsFixedChange === void 0 ? function () {} : _ref$onIsFixedChange,
4780
- recipientAddressExtraIdName = _ref.recipientAddressExtraIdName,
4781
- refundAddressExtraIdName = _ref.refundAddressExtraIdName,
4782
4784
  _ref$translations = _ref.translations,
4783
4785
  translations = _ref$translations === void 0 ? {
4784
4786
  swapAllButtonTitles: {
@@ -4822,6 +4824,8 @@ var SwapForm = function SwapForm(_ref) {
4822
4824
  } : _ref$translations;
4823
4825
  var DETAIL_REFRESH_INTERVAL_MS = 1.5 * 60000;
4824
4826
  var IS_FIXED_BY_DEFAULT = false;
4827
+
4828
+ // Updating the states below will insert the new value into the send or receive input field
4825
4829
  var _useState = React.useState(preservedAmount != null ? preservedAmount : null),
4826
4830
  updateSendInputTo = _useState[0],
4827
4831
  setUpdateSendInputTo = _useState[1];
@@ -4831,15 +4835,18 @@ var SwapForm = function SwapForm(_ref) {
4831
4835
  var _useReferredState = useReferredState(preservedAmount == null || preservedAmount === "" ? null : preservedAmount),
4832
4836
  sendAssetAmount = _useReferredState[0],
4833
4837
  setSendAssetAmount = _useReferredState[1];
4838
+ var _useReferredState2 = useReferredState(null),
4839
+ receiveAssetAmount = _useReferredState2[0],
4840
+ setReceiveAssetAmount = _useReferredState2[1];
4834
4841
  var _useState3 = React.useState(),
4835
4842
  swapRate = _useState3[0],
4836
4843
  setSwapRate = _useState3[1];
4837
- var _useReferredState2 = useReferredState(null),
4838
- minimalAmount = _useReferredState2[0],
4839
- setMinimalAmount = _useReferredState2[1];
4840
4844
  var _useReferredState3 = useReferredState(null),
4841
- maximumAmount = _useReferredState3[0],
4842
- setMaximumAmount = _useReferredState3[1];
4845
+ minimalAmount = _useReferredState3[0],
4846
+ setMinimalAmount = _useReferredState3[1];
4847
+ var _useReferredState4 = useReferredState(null),
4848
+ maximumAmount = _useReferredState4[0],
4849
+ setMaximumAmount = _useReferredState4[1];
4843
4850
  var _useState4 = React.useState(),
4844
4851
  validationContent = _useState4[0],
4845
4852
  setValidationContent = _useState4[1];
@@ -4861,15 +4868,17 @@ var SwapForm = function SwapForm(_ref) {
4861
4868
  var _useState10 = React.useState(false),
4862
4869
  readyToSwap = _useState10[0],
4863
4870
  setReadyToSwap = _useState10[1]; // Basically a param that enables/disables the "Next" button
4871
+ // TODO: [refactoring, moderate] instead of handling preservedAmount at a lot of cases below, just
4872
+ // write single useEffect setting sendAssetAmount to the=is passed value and simplify the logic below. task_id=6453251e49b04c5e88a3cc771479ffb5
4864
4873
  var _useState11 = React.useState(preservedAmount == null || String(preservedAmount) === "0"),
4865
4874
  isAmountZero = _useState11[0],
4866
4875
  setIsAmountZero = _useState11[1];
4867
- var _useReferredState4 = useReferredState(false),
4868
- isLoading = _useReferredState4[0],
4869
- setIsLoading = _useReferredState4[1]; // Whether the form is in the progress of loading some data (new rates, for example)
4870
- var _useReferredState5 = useReferredState(null),
4871
- isFixedRate = _useReferredState5[0],
4872
- setIsFixedRate = _useReferredState5[1];
4876
+ var _useReferredState5 = useReferredState(false),
4877
+ isLoading = _useReferredState5[0],
4878
+ setIsLoading = _useReferredState5[1]; // Whether the form is in the progress of loading some data (new rates, for example)
4879
+ var _useReferredState6 = useReferredState(null),
4880
+ isFixedRate = _useReferredState6[0],
4881
+ setIsFixedRate = _useReferredState6[1];
4873
4882
  var _useState12 = React.useState(false),
4874
4883
  isLastEditedReceiving = _useState12[0],
4875
4884
  setIsLastEditedReceiving = _useState12[1];
@@ -4882,39 +4891,39 @@ var SwapForm = function SwapForm(_ref) {
4882
4891
  var _useState15 = React.useState(true),
4883
4892
  balanceValid = _useState15[0],
4884
4893
  setBalanceValid = _useState15[1]; // Whether the amount is less than total balance
4885
- var _useReferredState6 = useReferredState(null),
4886
- isSwapAll = _useReferredState6[0],
4887
- setIsSwapAll = _useReferredState6[1];
4894
+ var _useReferredState7 = useReferredState(null),
4895
+ isSwapAll = _useReferredState7[0],
4896
+ setIsSwapAll = _useReferredState7[1];
4888
4897
  var _useState16 = React.useState([]),
4889
4898
  swapAllButtonLoaderReSetter = _useState16[0],
4890
4899
  setSwapAllButtonLoaderReSetter = _useState16[1];
4891
- var _useReferredState7 = useReferredState(null),
4892
- dataUpdateTimeoutId = _useReferredState7[0],
4893
- setDataUpdateTimeoutId = _useReferredState7[1];
4894
4900
  var _useReferredState8 = useReferredState(null),
4895
- idleDataUpdateTimeoutId = _useReferredState8[0],
4896
- setIdleDataUpdateTimeoutId = _useReferredState8[1];
4897
- var _useReferredState9 = useReferredState(""),
4898
- recipientAddress = _useReferredState9[0],
4899
- setRecipientAddress = _useReferredState9[1];
4901
+ dataUpdateTimeoutId = _useReferredState8[0],
4902
+ setDataUpdateTimeoutId = _useReferredState8[1];
4903
+ var _useReferredState9 = useReferredState(null),
4904
+ idleDataUpdateTimeoutId = _useReferredState9[0],
4905
+ setIdleDataUpdateTimeoutId = _useReferredState9[1];
4900
4906
  var _useReferredState10 = useReferredState(""),
4901
- recipientAddressExtraId = _useReferredState10[0],
4902
- setRecipientAddressExtraId = _useReferredState10[1];
4903
- var _useReferredState11 = useReferredState(false),
4904
- isRecipientAddressValid = _useReferredState11[0],
4905
- setIsRecipientAddressValid = _useReferredState11[1];
4907
+ recipientAddress = _useReferredState10[0],
4908
+ setRecipientAddress = _useReferredState10[1];
4909
+ var _useReferredState11 = useReferredState(""),
4910
+ recipientAddressExtraId = _useReferredState11[0],
4911
+ setRecipientAddressExtraId = _useReferredState11[1];
4912
+ var _useReferredState12 = useReferredState(false),
4913
+ isRecipientAddressValid = _useReferredState12[0],
4914
+ setIsRecipientAddressValid = _useReferredState12[1];
4906
4915
  var _useState17 = React.useState(false),
4907
4916
  isRefundAddressRequired = _useState17[0],
4908
4917
  setIsRefundAddressRequired = _useState17[1];
4909
- var _useReferredState12 = useReferredState(""),
4910
- refundAddress = _useReferredState12[0],
4911
- setRefundAddress = _useReferredState12[1];
4912
4918
  var _useReferredState13 = useReferredState(""),
4913
- refundAddressExtraId = _useReferredState13[0],
4914
- setRefundAddressExtraId = _useReferredState13[1];
4915
- var _useReferredState14 = useReferredState(false),
4916
- isRefundAddressValid = _useReferredState14[0],
4917
- setIsRefundAddressValid = _useReferredState14[1];
4919
+ refundAddress = _useReferredState13[0],
4920
+ setRefundAddress = _useReferredState13[1];
4921
+ var _useReferredState14 = useReferredState(""),
4922
+ refundAddressExtraId = _useReferredState14[0],
4923
+ setRefundAddressExtraId = _useReferredState14[1];
4924
+ var _useReferredState15 = useReferredState(false),
4925
+ isRefundAddressValid = _useReferredState15[0],
4926
+ setIsRefundAddressValid = _useReferredState15[1];
4918
4927
  var callHandlingErrors = useCallHandlingErrors();
4919
4928
  var isHydrated = useIsHydrated();
4920
4929
  var recalculationDelayOnTyping = 1000;
@@ -4922,14 +4931,17 @@ var SwapForm = function SwapForm(_ref) {
4922
4931
  var displayRateSelector = !formHasBalance;
4923
4932
  var handleSendAssetAmountChange = function handleSendAssetAmountChange(amount) {
4924
4933
  setIsLastEditedReceiving(false);
4934
+ var receiveAmount = AmountUtils.trim(bignumber_js.BigNumber(amount).times(swapRate), receivingAssetDecimalCount);
4925
4935
  if (amount != null && amount !== "") {
4926
- setUpdateReceiveInputTo(AmountUtils.trim(bignumber_js.BigNumber(amount).times(swapRate), receivingAssetDecimalCount));
4936
+ setReceiveAssetAmount(receiveAmount);
4937
+ setUpdateReceiveInputTo(receiveAmount);
4927
4938
  } else {
4928
4939
  setUpdateReceiveInputTo("");
4929
4940
  }
4930
4941
  setSendAssetAmount(amount);
4931
4942
  };
4932
4943
  var handleReceiveAssetAmountChange = function handleReceiveAssetAmountChange(amount) {
4944
+ setReceiveAssetAmount(amount);
4933
4945
  setIsLastEditedReceiving(true);
4934
4946
  var sendAssetAmount = "";
4935
4947
  if (amount != null && amount !== "") {
@@ -5050,14 +5062,12 @@ var SwapForm = function SwapForm(_ref) {
5050
5062
  setIsPairSupported(true);
5051
5063
  setIsSwapCalculated(false);
5052
5064
  return Promise.resolve(retrieveSwapDetails(sendingAssetTicker, receivingAssetTicker, amount, isSwapAll.current, (_isFixedRate$current = isFixedRate.current) != null ? _isFixedRate$current : IS_FIXED_BY_DEFAULT, isFixedRate.current ? isLastEditedReceiving : false)).then(function (response) {
5053
- if (!isSwapAll.current && String(amount) !== String(isForPreserved && sendAssetAmount.current == null ? preservedAmount : sendAssetAmount.current)) {
5065
+ if (!isSwapAll.current && String(amount) !== String(isForPreserved && sendAssetAmount.current == null ? preservedAmount : isFixedRate.current && isLastEditedReceiving ? receiveAssetAmount.current : sendAssetAmount.current)) {
5054
5066
  // Means amount changed and we no more need to do this exact calculation
5055
5067
  return;
5056
5068
  }
5057
5069
  if (response.result) {
5058
5070
  var swapCreationInfo = response.swapCreationInfo;
5059
- setUpdateSendInputTo(swapCreationInfo.fromAmountCoins);
5060
- setUpdateReceiveInputTo(swapCreationInfo.toAmountCoins);
5061
5071
  if (isSwapAll.current) {
5062
5072
  setIsAmountZero(bignumber_js.BigNumber("0").eq(swapCreationInfo.fromAmountCoins));
5063
5073
  }
@@ -5066,6 +5076,8 @@ var SwapForm = function SwapForm(_ref) {
5066
5076
  setIsRefundAddressRequired(swapCreationInfo == null ? void 0 : swapCreationInfo.isRefundAddressRequired);
5067
5077
  processMinMaxAmounts(isSwapAll.current ? swapCreationInfo.fromAmountCoins : amount);
5068
5078
  setIsSwapCalculated(true);
5079
+ setUpdateSendInputTo(swapCreationInfo.fromAmountCoins);
5080
+ setUpdateReceiveInputTo(swapCreationInfo.toAmountCoins);
5069
5081
  } else {
5070
5082
  handleSwapServiceError(response.reason, setValidationContent, setBalanceValid, setMinimalAmountValid, setMaximumAmountValid, setIsPairSupported, setIsSameCoins);
5071
5083
  if (isSwapAll.current) {
@@ -5137,7 +5149,7 @@ var SwapForm = function SwapForm(_ref) {
5137
5149
  };
5138
5150
  var handleRateModeChanged = function handleRateModeChanged(isFixed) {
5139
5151
  setIsFixedRate(isFixed);
5140
- requestDataRefresh(sendAssetAmount.current, true);
5152
+ requestDataRefresh(isLastEditedReceiving ? receiveAssetAmount.current : sendAssetAmount.current, true);
5141
5153
  };
5142
5154
  React.useEffect(function () {
5143
5155
  if (isSwapAll.current === true) {
@@ -5160,7 +5172,7 @@ var SwapForm = function SwapForm(_ref) {
5160
5172
  var isCurrentAmountNotZero = sendAssetAmount.current && !bignumber_js.BigNumber("0").eq(sendAssetAmount.current);
5161
5173
  var isPreservedAmountNotZero = preservedAmount && !bignumber_js.BigNumber("0").eq(preservedAmount);
5162
5174
  if (isCurrentAmountNotZero) {
5163
- loadFullEstimation(sendAssetAmount.current);
5175
+ loadFullEstimation(isLastEditedReceiving ? receiveAssetAmount.current : sendAssetAmount.current);
5164
5176
  } else if (isPreservedAmountNotZero) {
5165
5177
  loadFullEstimation(preservedAmount, true);
5166
5178
  } else {
@@ -5227,7 +5239,7 @@ var SwapForm = function SwapForm(_ref) {
5227
5239
  if (readyToSwap) {
5228
5240
  timeoutId = setTimeout(function () {
5229
5241
  var _sendAssetAmount$curr;
5230
- return requestDataRefresh((_sendAssetAmount$curr = sendAssetAmount.current) != null ? _sendAssetAmount$curr : preservedAmount, true);
5242
+ return requestDataRefresh(isLastEditedReceiving ? receiveAssetAmount.current : (_sendAssetAmount$curr = sendAssetAmount.current) != null ? _sendAssetAmount$curr : preservedAmount, true);
5231
5243
  }, DETAIL_REFRESH_INTERVAL_MS);
5232
5244
  setIdleDataUpdateTimeoutId(timeoutId);
5233
5245
  } else {
@@ -5255,7 +5267,11 @@ var SwapForm = function SwapForm(_ref) {
5255
5267
  }, [updateSendInputTo, updateReceiveInputTo]);
5256
5268
  React.useEffect(function () {
5257
5269
  if (swapRate != null && sendAssetAmount.current != null) {
5258
- setUpdateReceiveInputTo(AmountUtils.trim(bignumber_js.BigNumber(sendAssetAmount.current).times(swapRate), receivingAssetDecimalCount));
5270
+ if (isLastEditedReceiving) {
5271
+ setUpdateSendInputTo(AmountUtils.trim(bignumber_js.BigNumber(receiveAssetAmount.current).div(swapRate), sendingAssetDecimalCount));
5272
+ } else {
5273
+ setUpdateReceiveInputTo(AmountUtils.trim(bignumber_js.BigNumber(sendAssetAmount.current).times(swapRate), receivingAssetDecimalCount));
5274
+ }
5259
5275
  }
5260
5276
  // eslint-disable-next-line react-hooks/exhaustive-deps
5261
5277
  }, [swapRate]);
@@ -5270,12 +5286,15 @@ var SwapForm = function SwapForm(_ref) {
5270
5286
  setConfirmButtonTo(composeConfirmButtonTo(sendingAssetTicker, receivingAssetTicker, sendAssetAmount.current));
5271
5287
  if (sendAssetAmount.current == null) return;
5272
5288
  var processingAmount = sendAssetAmount.current === "" ? "0" : sendAssetAmount.current;
5273
- requestDataRefresh(processingAmount);
5289
+ var processingReceivingAmount = receiveAssetAmount.current === "" ? "0" : receiveAssetAmount.current;
5290
+ requestDataRefresh(isLastEditedReceiving ? processingReceivingAmount : processingAmount);
5274
5291
  processMinMaxAmounts(processingAmount);
5275
5292
  setIsAmountZero(bignumber_js.BigNumber("0").eq(processingAmount));
5276
5293
  setIsSwapCalculated(false);
5277
5294
  // eslint-disable-next-line react-hooks/exhaustive-deps
5278
5295
  }, [sendAssetAmount.current]);
5296
+ var recipientAddressExtraIdName = getExtraIdNameByTicker(receivingAssetTicker);
5297
+ var refundAddressExtraIdName = getExtraIdNameByTicker(sendingAssetTicker);
5279
5298
  return /*#__PURE__*/React__default["default"].createElement("div", {
5280
5299
  className: s$9["swap-form"]
5281
5300
  }, /*#__PURE__*/React__default["default"].createElement(TitleBox, {
@@ -5315,7 +5334,7 @@ var SwapForm = function SwapForm(_ref) {
5315
5334
  upperFormPosition: true,
5316
5335
  errorEncountered: !minimalAmountValid,
5317
5336
  ref: fromAssetSelectionButtonRef,
5318
- isLoading: false,
5337
+ isLoading: isLastEditedReceiving ? isLoading.current : false,
5319
5338
  cryptoAssetToFiatRate: sendingAssetToFiatRate,
5320
5339
  fiatCurrencyCode: formHasFiat ? fiatCurrencyCode : null,
5321
5340
  fiatCurrencyDecimals: fiatCurrencyDecimals,
@@ -5349,7 +5368,7 @@ var SwapForm = function SwapForm(_ref) {
5349
5368
  lowerFormPosition: true,
5350
5369
  estimateAmount: !isFixedRate.current,
5351
5370
  ref: toAssetSelectionButtonRef,
5352
- isLoading: isLoading.current,
5371
+ isLoading: isLastEditedReceiving ? false : isLoading.current,
5353
5372
  cryptoAssetToFiatRate: receivingAssetToFiatRate,
5354
5373
  fiatCurrencyCode: formHasFiat ? fiatCurrencyCode : null,
5355
5374
  fiatCurrencyDecimals: fiatCurrencyDecimals,
@@ -5440,7 +5459,7 @@ var SwapForm = function SwapForm(_ref) {
5440
5459
  mode: "primary",
5441
5460
  content: translations.confirmButtonText,
5442
5461
  onClick: function onClick(resetButtonLoader) {
5443
- return handleConfirmButtonClick(resetButtonLoader, setValidationContent, setBalanceValid, setMinimalAmountValid, setMaximumAmountValid, setIsPairSupported, setIsSameCoins, recipientAddress.current, recipientAddressExtraId.current, refundAddress.current, refundAddressExtraId.current);
5462
+ return handleConfirmButtonClick(resetButtonLoader, setValidationContent, setBalanceValid, setMinimalAmountValid, setMaximumAmountValid, setIsPairSupported, setIsSameCoins, recipientAddress.current, recipientAddressExtraId.current, refundAddress.current, refundAddressExtraId.current, isLastEditedReceiving);
5444
5463
  },
5445
5464
  fullWidthOnMobiles: true,
5446
5465
  isDisabled: !readyToSwap,
@@ -9676,8 +9695,28 @@ var SwapProvider = /*#__PURE__*/function () {
9676
9695
  * @private
9677
9696
  */;
9678
9697
  _proto._putPopularCoinsFirst = function _putPopularCoinsFirst() {
9698
+ var popularCoinsList = ["BTC", "ETH", "USDTERC20", "USDTTRC20", "USDCERC20", "XRP", "TON", "XMR", "TRX", "DAIERC20", "DOGE", "BNB", "PEPEERC20", "NOTTON", "SOL", "DOT", "LTC", "SHIBERC20", "AVAX", "UNIERC20", "LINKERC20", "MATIC", "BUSDBEP20", "AAVEERC20", "ATOM", "RUNE", "ADA"];
9679
9699
  this._supportedCoins.sort(function (i1, i2) {
9680
- if (i1.isPopular !== i2.isPopular) return i2.isPopular - i1.isPopular;
9700
+ var isInPopularList1 = popularCoinsList.includes(i1.coin.ticker);
9701
+ var isInPopularList2 = popularCoinsList.includes(i2.coin.ticker);
9702
+
9703
+ // If both are in the popularCoinsList, sort by their index in the list
9704
+ if (isInPopularList1 && isInPopularList2) {
9705
+ var index1 = popularCoinsList.indexOf(i1.coin.ticker);
9706
+ var index2 = popularCoinsList.indexOf(i2.coin.ticker);
9707
+ return index1 - index2;
9708
+ }
9709
+
9710
+ // Sort by whether the coin is in the popularCoinsList
9711
+ if (isInPopularList1 && !isInPopularList2) return -1;
9712
+ if (!isInPopularList1 && isInPopularList2) return 1;
9713
+
9714
+ // If both are not in the popularCoinsList, use the isPopular flag - partners can fill it
9715
+ var p1 = i1.isPopular;
9716
+ var p2 = i2.isPopular;
9717
+ if (p1 !== p2) return p2 - p1;
9718
+
9719
+ // By default, sort by the coin ticker
9681
9720
  return i1.coin.ticker.localeCompare(i2.coin.ticker);
9682
9721
  });
9683
9722
  }
@@ -10570,7 +10609,7 @@ var SwapspaceSwapProvider = /*#__PURE__*/function (_SwapProvider) {
10570
10609
  var swaps = wo404.map(function (r) {
10571
10610
  return r.data;
10572
10611
  }).map(function (swap, index) {
10573
- var _this6$_supportedCoin, _this6$_supportedCoin2, _swap$from$extraId, _swap$to$extraId, _swap$refundExtraId;
10612
+ var _this6$_supportedCoin, _this6$_supportedCoin2, _swap$blockExplorerTr, _swap$from$extraId, _swap$to$extraId, _swap$refundExtraId;
10574
10613
  var fromCoin = (_this6$_supportedCoin = _this6._supportedCoins.find(function (i) {
10575
10614
  return i.code === swap.from.code && i.network === swap.from.network;
10576
10615
  })) == null ? void 0 : _this6$_supportedCoin.coin;
@@ -10588,7 +10627,8 @@ var SwapspaceSwapProvider = /*#__PURE__*/function (_SwapProvider) {
10588
10627
  var status = _this6._mapSwapspaceStatusToRabbitStatus(swap.status, isExpiredByTime);
10589
10628
  var toDigits = status === SwapProvider.SWAP_STATUSES.REFUNDED ? fromCoin.digits : toCoin.digits;
10590
10629
  var addressToSendCoinsToSwapspace = swap.from.address;
10591
- return new ExistingSwap(swapIds[index], status, toUtcTimestamp(swap.timestamps.createdAt), expiresAt, swap.confirmations, AmountUtils.trim(swap.rate, _this6._maxRateDigits), swap.fixed, swap.refundAddress, addressToSendCoinsToSwapspace, fromCoin, AmountUtils.trim(swap.from.amount, fromCoin.digits), swap.from.transactionHash, swap.blockExplorerTransactionUrl.from, toCoin, AmountUtils.trim(swap.to.amount, toDigits), swap.to.transactionHash, swap.blockExplorerTransactionUrl.to, swap.to.address, swap.partner, (_swap$from$extraId = swap.from.extraId) != null ? _swap$from$extraId : null, (_swap$to$extraId = swap.to.extraId) != null ? _swap$to$extraId : null, (_swap$refundExtraId = swap.refundExtraId) != null ? _swap$refundExtraId : null);
10630
+ var toUrl = ((_swap$blockExplorerTr = swap.blockExplorerTransactionUrl.to) != null ? _swap$blockExplorerTr : "").replace(/from=swapspace&?/g, "").replaceAll(/&&+/g, "&").replace("?&", "?").replace(/&$/, "").replace(/\?$/, "");
10631
+ return new ExistingSwap(swapIds[index], status, toUtcTimestamp(swap.timestamps.createdAt), expiresAt, swap.confirmations, AmountUtils.trim(swap.rate, _this6._maxRateDigits), swap.fixed, swap.refundAddress, addressToSendCoinsToSwapspace, fromCoin, AmountUtils.trim(swap.from.amount, fromCoin.digits), swap.from.transactionHash, swap.blockExplorerTransactionUrl.from, toCoin, AmountUtils.trim(swap.to.amount, toDigits), swap.to.transactionHash, toUrl, swap.to.address, swap.partner, (_swap$from$extraId = swap.from.extraId) != null ? _swap$from$extraId : null, (_swap$to$extraId = swap.to.extraId) != null ? _swap$to$extraId : null, (_swap$refundExtraId = swap.refundExtraId) != null ? _swap$refundExtraId : null);
10592
10632
  }).flat();
10593
10633
  Logger.log("Swap details result " + safeStringify(swaps), loggerSource);
10594
10634
  return {
@@ -11084,6 +11124,8 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
11084
11124
  try {
11085
11125
  var _this3 = this;
11086
11126
  var loggerSource = "getSwapInfo";
11127
+ var min = null;
11128
+ var max = null;
11087
11129
  return Promise.resolve(_catch$1(function () {
11088
11130
  if (!(fromCoin instanceof Coin) || !(toCoin instanceof Coin) || typeof amountCoins !== "string" || bignumber_js.BigNumber(amountCoins).lt("0") || fixed !== null && typeof fixed !== "boolean" || amountIsToReceive && !fixed) {
11089
11131
  throw new Error("Wrong input params: " + amountCoins + " " + fromCoin.ticker + " -> " + toCoin.ticker + ", " + (fromCoin instanceof Coin) + ", " + (toCoin instanceof Coin) + ", " + typeof fixed + " " + fixed + ", " + amountIsToReceive);
@@ -11125,11 +11167,9 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
11125
11167
  // const extraUsdToFitMinMax = BigNumber("1"); // We correct the limits as the exact limit can fluctuate and cause failed swap creation
11126
11168
  // extraCoinsToFitMinMax = AmountUtils.trim(extraUsdToFitMinMax.div(fromCoinToUsdRate), fromCoin.digits);
11127
11169
  // }
11128
- var min = null;
11129
11170
  if (data != null && data.min_amount) {
11130
11171
  min = AmountUtils.trim(data == null ? void 0 : data.min_amount, amountIsToReceive ? toCoin.digits : fromCoin.digits);
11131
11172
  }
11132
- var max = null;
11133
11173
  if (data != null && data.max_amount) {
11134
11174
  max = AmountUtils.trim(data == null ? void 0 : data.max_amount, amountIsToReceive ? toCoin.digits : fromCoin.digits);
11135
11175
  }
@@ -11182,8 +11222,16 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
11182
11222
  };
11183
11223
  });
11184
11224
  }, function (e) {
11185
- var _e$response;
11186
- if ((e == null || (_e$response = e.response) == null ? void 0 : _e$response.status) === 429) {
11225
+ var _e$response, _e$response2;
11226
+ if ((e == null || (_e$response = e.response) == null ? void 0 : _e$response.status) === 404) {
11227
+ return {
11228
+ result: false,
11229
+ reason: SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED,
11230
+ smallestMin: min,
11231
+ greatestMax: max
11232
+ };
11233
+ }
11234
+ if ((e == null || (_e$response2 = e.response) == null ? void 0 : _e$response2.status) === 429) {
11187
11235
  return {
11188
11236
  result: false,
11189
11237
  reason: SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
@@ -11271,7 +11319,7 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
11271
11319
  throw new Error(errorMessage);
11272
11320
  });
11273
11321
  }, function (e) {
11274
- var _e$response2, _e$response3;
11322
+ var _e$response3, _e$response4;
11275
11323
  Logger.logError(e, loggerSource, "Failed to create swap. Error is: " + safeStringify(e));
11276
11324
  var composeFailResult = function composeFailResult(reason) {
11277
11325
  return {
@@ -11279,8 +11327,8 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
11279
11327
  reason: reason
11280
11328
  };
11281
11329
  };
11282
- var status = e == null || (_e$response2 = e.response) == null ? void 0 : _e$response2.status;
11283
- var data = e == null || (_e$response3 = e.response) == null ? void 0 : _e$response3.data;
11330
+ var status = e == null || (_e$response3 = e.response) == null ? void 0 : _e$response3.status;
11331
+ var data = e == null || (_e$response4 = e.response) == null ? void 0 : _e$response4.data;
11284
11332
  if (status === 429) {
11285
11333
  Logger.log("Returning fail - RPS limit exceeded " + data, loggerSource);
11286
11334
  return composeFailResult(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
@@ -11325,7 +11373,10 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
11325
11373
  var isExpiredByTime = expiresAt && expiresAt < Date.now();
11326
11374
  var status = _this5._mapLetsExchangeStatusToRabbitStatus(swap.status, isExpiredByTime);
11327
11375
  var toDigits = status === SwapProvider.SWAP_STATUSES.REFUNDED ? fromCoin.digits : toCoin.digits;
11328
- return new ExistingSwap(swapIds[index], status, createdAt, expiresAt, swap.confirmations, AmountUtils.trim(swap.rate, _this5._maxRateDigits), swap.is_float != null ? !swap.is_float : false, swap["return"], swap.deposit, fromCoin, AmountUtils.trim(swap.deposit_amount, fromCoin.digits), swap.hash_in, swap.hash_in ? "" + swap.coin_from_explorer_url + swap.hash_in : null, toCoin, AmountUtils.trim(swap.withdrawal_amount, toDigits), swap.hash_out, swap.hash_out ? "" + swap.coin_to_explorer_url + swap.hash_out : null, swap.withdrawal, "letsexchange", (_swap$deposit_extra_i = swap.deposit_extra_id) != null ? _swap$deposit_extra_i : null, (_swap$withdrawal_extr = swap.withdrawal_extra_id) != null ? _swap$withdrawal_extr : null, (_swap$return_extra_id = swap.return_extra_id) != null ? _swap$return_extra_id : null);
11376
+ var deposit = swap.real_deposit_amount && swap.real_deposit_amount !== "" ? swap.real_deposit_amount : swap.deposit_amount;
11377
+ var withdrawal = swap.real_withdrawal_amount && swap.real_withdrawal_amount !== "" ? swap.real_withdrawal_amount : swap.withdrawal_amount;
11378
+ var rate = bignumber_js.BigNumber(withdrawal).div(deposit).toFixed(_this5._maxRateDigits); // We don't use their rate as it excludes their fee
11379
+ return new ExistingSwap(swapIds[index], status, createdAt, expiresAt, swap.confirmations, rate, swap.is_float != null ? !swap.is_float : false, swap["return"], swap.deposit, fromCoin, AmountUtils.trim(deposit, fromCoin.digits), swap.hash_in, swap.hash_in ? "" + swap.coin_from_explorer_url + swap.hash_in : null, toCoin, AmountUtils.trim(withdrawal, toDigits), swap.hash_out, swap.hash_out ? "" + swap.coin_to_explorer_url + swap.hash_out : null, swap.withdrawal, "letsexchange", (_swap$deposit_extra_i = swap.deposit_extra_id) != null ? _swap$deposit_extra_i : null, (_swap$withdrawal_extr = swap.withdrawal_extra_id) != null ? _swap$withdrawal_extr : null, (_swap$return_extra_id = swap.return_extra_id) != null ? _swap$return_extra_id : null);
11329
11380
  }).flat();
11330
11381
  Logger.log("Swap details result " + safeStringify(swaps), loggerSource);
11331
11382
  return {
@@ -11334,7 +11385,7 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
11334
11385
  };
11335
11386
  });
11336
11387
  }, function (e) {
11337
- var _e$response4, _e$response5;
11388
+ var _e$response5, _e$response6;
11338
11389
  Logger.logError(e, loggerSource, "Failed to get swap details. Error is: " + safeStringify(e));
11339
11390
  var composeFailResult = function composeFailResult(reason) {
11340
11391
  return {
@@ -11342,8 +11393,8 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
11342
11393
  reason: reason
11343
11394
  };
11344
11395
  };
11345
- var status = e == null || (_e$response4 = e.response) == null ? void 0 : _e$response4.status;
11346
- var data = e == null || (_e$response5 = e.response) == null ? void 0 : _e$response5.data;
11396
+ var status = e == null || (_e$response5 = e.response) == null ? void 0 : _e$response5.status;
11397
+ var data = e == null || (_e$response6 = e.response) == null ? void 0 : _e$response6.data;
11347
11398
  if (status === 429) {
11348
11399
  Logger.log("Returning fail - RPS limit exceeded " + data, loggerSource);
11349
11400
  return composeFailResult(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
@@ -11353,21 +11404,22 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
11353
11404
  } catch (e) {
11354
11405
  return Promise.reject(e);
11355
11406
  }
11356
- } // TODO: [dev] Serg, please check this during the review to make sure I did no mistakes in statuses mapping.
11357
- // I will remove these comments after the review. https://api.letsexchange.io/doc
11358
- // wait The exchange has just been created and it’s waiting for coins to reach the deposit wallet
11359
- // confirmation The transaction appears in mempool and now it is waiting for necessary network confirmations to start.
11360
- // confirmed The user’s payment is confirmed, the exchange process is about to start.
11361
- // exchanging The exchange process is running.
11362
- // sending Funds are being sent to the recipient`s address.
11363
- // sending_confirmation The outgoing transaction is waiting for network confirmations.
11364
- // success The exchange is completed and the funds are successfully sent to the recipient’s address.
11365
- // aml_check_failed The deposit was marked as risky by AML check service.
11366
- // overdue The deposit receiving time for this transaction has expired.
11367
- // error The transaction has failed. In most cases, the amount that was sent differs from the amount that was specified when creating the transaction.
11368
- // refund The exchange failed and the coins were refunded to the user's wallet.
11369
- ;
11407
+ };
11370
11408
  _proto._mapLetsExchangeStatusToRabbitStatus = function _mapLetsExchangeStatusToRabbitStatus(status, isExpiredByTime) {
11409
+ /**
11410
+ * Lets exchange statuses description
11411
+ * wait - The exchange has just been created and it’s waiting for coins to reach the deposit wallet
11412
+ * confirmation - The transaction appears in mempool and now it is waiting for necessary network confirmations to start.
11413
+ * confirmed - The user’s payment is confirmed, the exchange process is about to start.
11414
+ * exchanging - The exchange process is running.
11415
+ * sending - Funds are being sent to the recipient`s address.
11416
+ * sending_confirmation - The outgoing transaction is waiting for network confirmations.
11417
+ * success - The exchange is completed and the funds are successfully sent to the recipient’s address.
11418
+ * aml_check_failed - The deposit was marked as risky by AML check service.
11419
+ * overdue - The deposit receiving time for this transaction has expired.
11420
+ * error - The transaction has failed. In most cases, the amount that was sent differs from the amount that was specified when creating the transaction.
11421
+ * refund - The exchange failed and the coins were refunded to the user's wallet.
11422
+ */
11371
11423
  switch (status) {
11372
11424
  case "wait":
11373
11425
  if (isExpiredByTime) {
@@ -11381,7 +11433,7 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
11381
11433
  case "exchanging":
11382
11434
  return SwapProvider.SWAP_STATUSES.EXCHANGING;
11383
11435
  case "sending":
11384
- return SwapProvider.SWAP_STATUSES.PAYMENT_RECEIVED;
11436
+ return SwapProvider.SWAP_STATUSES.EXCHANGING;
11385
11437
  case "sending_confirmation":
11386
11438
  return SwapProvider.SWAP_STATUSES.EXCHANGING;
11387
11439
  case "success":
@@ -11601,7 +11653,7 @@ var PublicSwapService = /*#__PURE__*/function () {
11601
11653
  *
11602
11654
  * @param fromCoin {Coin}
11603
11655
  * @param toCoin {Coin}
11604
- * @param fromAmountCoins {string}
11656
+ * @param amountCoins {string}
11605
11657
  * @param [fixed=false] {boolean|null} null means fixed or float doesn't matter
11606
11658
  * @param [withoutFiat=false] {boolean} pass true if you don't need the fiat equivalent - this will diminish requests count
11607
11659
  * @param [amountIsToReceive=false] {boolean} whether the given amount is receiving amount.
@@ -11620,7 +11672,7 @@ var PublicSwapService = /*#__PURE__*/function () {
11620
11672
  * }>}
11621
11673
  */
11622
11674
  ;
11623
- _proto.getPublicSwapDetails = function getPublicSwapDetails(fromCoin, toCoin, fromAmountCoins, fixed, withoutFiat, amountIsToReceive) {
11675
+ _proto.getPublicSwapDetails = function getPublicSwapDetails(fromCoin, toCoin, amountCoins, fixed, withoutFiat, amountIsToReceive) {
11624
11676
  if (fixed === void 0) {
11625
11677
  fixed = false;
11626
11678
  }
@@ -11637,7 +11689,7 @@ var PublicSwapService = /*#__PURE__*/function () {
11637
11689
  function _temp2(_getCoinToUSDTRate) {
11638
11690
  var _getCoinToUSDTRate$ra;
11639
11691
  var coinUsdtRate = withoutFiat ? _getCoinToUSDTRate : (_getCoinToUSDTRate$ra = _getCoinToUSDTRate == null ? void 0 : _getCoinToUSDTRate.rate) != null ? _getCoinToUSDTRate$ra : null;
11640
- return Promise.resolve((fixed ? _this7._fixedSwapProvider : _this7._swapProvider).getSwapInfo(fromCoin, toCoin, fromAmountCoins, fixed, coinUsdtRate, amountIsToReceive)).then(function (details) {
11692
+ return Promise.resolve((fixed ? _this7._fixedSwapProvider : _this7._swapProvider).getSwapInfo(fromCoin, toCoin, amountCoins, fixed, coinUsdtRate, amountIsToReceive)).then(function (details) {
11641
11693
  var _result$swapCreationI, _result$swapCreationI2;
11642
11694
  // eslint-disable-next-line no-console
11643
11695
  console.log("getSwapInfo result: ", details);
@@ -11677,13 +11729,14 @@ var PublicSwapService = /*#__PURE__*/function () {
11677
11729
  return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.NO_FIXED_BUT_HAVE_FLOATING_PUBLIC_SWAP_OPTION);
11678
11730
  }
11679
11731
  }
11680
- var fromAmountBigNumber = bignumber_js.BigNumber(fromAmountCoins);
11681
- if (typeof min === "string" && fromAmountBigNumber.lt(min)) {
11732
+ var amountBigNumber = bignumber_js.BigNumber(amountCoins);
11733
+ if (typeof min === "string" && amountBigNumber.lt(min)) {
11682
11734
  return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.AMOUNT_LESS_THAN_MIN_SWAPPABLE);
11683
- } else if (typeof max === "string" && fromAmountBigNumber.gt(max)) {
11735
+ } else if (typeof max === "string" && amountBigNumber.gt(max)) {
11684
11736
  return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.AMOUNT_HIGHER_THAN_MAX_SWAPPABLE);
11685
11737
  }
11686
- var toAmountCoins = AmountUtils.trim(fromAmountBigNumber.times(details.rate), fromCoin.digits);
11738
+ var fromAmountCoins = amountIsToReceive ? AmountUtils.trim(amountBigNumber.div(details.rate), fromCoin.digits) : amountCoins;
11739
+ var toAmountCoins = amountIsToReceive ? amountCoins : AmountUtils.trim(amountBigNumber.times(details.rate), toCoin.digits);
11687
11740
  var result = {
11688
11741
  result: true,
11689
11742
  swapCreationInfo: new BaseSwapCreationInfo(fromCoin, toCoin, fromAmountCoins, toAmountCoins, details.rate, details.rawSwapData, min, fiatMin, max, fiatMax, details.durationMinutesRange, details.fixed, details.isRefundAddressRequired)