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

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 (245) hide show
  1. package/coverage/clover.xml +4180 -158
  2. package/coverage/coverage-final.json +157 -96
  3. package/coverage/index.html +323 -68
  4. package/coverage/{rabbit-ui-kit → ui-kit}/index.html +3 -3
  5. package/coverage/{rabbit-ui-kit → ui-kit}/index.js.html +3 -3
  6. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/axiosAdapter.js.html +3 -3
  7. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/index.html +3 -3
  8. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/qrUtils.js.html +3 -3
  9. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/amountUtils.js.html +3 -3
  10. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/errorUtils.js.html +3 -3
  11. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/external-apis/apiGroups.js.html +3 -3
  12. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/external-apis/index.html +3 -3
  13. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/external-apis/ipAddressProviders.js.html +3 -3
  14. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/fiatCurrenciesService.js.html +3 -3
  15. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/globalConstants.jsx.html +3 -3
  16. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/index.html +3 -3
  17. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/models/blockchain.js.html +3 -3
  18. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/models/coin.js.html +3 -3
  19. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/models/index.html +3 -3
  20. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/models/protocol.js.html +3 -3
  21. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/cache.js.html +3 -3
  22. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/emailAPI.js.html +3 -3
  23. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/index.html +3 -3
  24. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/logging/index.html +3 -3
  25. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/logging/logger.js.html +3 -3
  26. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/logging/logsStorage.js.html +3 -3
  27. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/postponeExecution.js.html +3 -3
  28. package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/safeStringify.js.html +3 -3
  29. package/coverage/{rabbit-ui-kit → ui-kit}/src/index.html +3 -3
  30. package/coverage/{rabbit-ui-kit → ui-kit}/src/index.js.html +3 -3
  31. package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/cacheAndConcurrentRequestsResolver.js.html +3 -3
  32. package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/cachedRobustExternalApiCallerService.js.html +3 -3
  33. package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/cancelProcessing.js.html +3 -3
  34. package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/concurrentCalculationsMetadataHolder.js.html +3 -3
  35. package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/externalApiProvider.js.html +3 -3
  36. package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/externalServicesStatsCollector.js.html +3 -3
  37. package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/index.html +3 -3
  38. package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/robustExternalAPICallerService.js.html +3 -3
  39. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/index.html +3 -3
  40. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/letsExchangeSwapProvider.js.html +3 -3
  41. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/swapProvider.js.html +3 -3
  42. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +3 -3
  43. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/baseSwapCreationInfo.js.html +3 -3
  44. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/existingSwap.js.html +3 -3
  45. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/existingSwapWithFiatData.js.html +3 -3
  46. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/index.html +3 -3
  47. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/services/index.html +7 -7
  48. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/services/publicSwapService.js.html +17 -8
  49. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/utils/index.html +3 -3
  50. package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/utils/swapUtils.js.html +3 -3
  51. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/arrowIcon.jsx.html +3 -3
  52. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/arrowTosca.jsx.html +3 -3
  53. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/arrowWhite.jsx.html +3 -3
  54. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/darkRectangle.jsx.html +3 -3
  55. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/determinedError.jsx.html +3 -3
  56. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/failedValidationIcon.jsx.html +3 -3
  57. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/index.html +3 -3
  58. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/infoIcon.jsx.html +3 -3
  59. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/noticeQuestionIcon.jsx.html +3 -3
  60. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx.html +3 -3
  61. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/walletIcon.jsx.html +3 -3
  62. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/AssetIcon/AssetIcon.jsx.html +3 -3
  63. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/AssetIcon/index.html +3 -3
  64. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/AssetSelection/AssetSelection.jsx.html +3 -3
  65. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/AssetSelection/index.html +3 -3
  66. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +3 -3
  67. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/BackgroundTitle/index.html +3 -3
  68. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/InformationMessage/InformationMessage.jsx.html +3 -3
  69. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/InformationMessage/index.html +3 -3
  70. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Input/Input.jsx.html +3 -3
  71. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Input/index.html +3 -3
  72. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/LoadingDots/LoadingDots.jsx.html +3 -3
  73. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/LoadingDots/index.html +3 -3
  74. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx.html +3 -3
  75. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/NoticeIcon/index.html +3 -3
  76. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/QrCode/QrCode.jsx.html +3 -3
  77. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/QrCode/index.html +3 -3
  78. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx.html +3 -3
  79. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/RateSelector/index.html +3 -3
  80. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/SupportChat/SupportChat.jsx.html +3 -3
  81. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/SupportChat/index.html +3 -3
  82. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Textarea/Textarea.jsx.html +3 -3
  83. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Textarea/index.html +3 -3
  84. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/TitleBox/TitleBox.jsx.html +3 -3
  85. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/TitleBox/index.html +3 -3
  86. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Tooltip/Tooltip.jsx.html +3 -3
  87. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Tooltip/index.html +3 -3
  88. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx.html +3 -3
  89. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/TwoLinesOfText/index.html +3 -3
  90. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Validation/Validation.jsx.html +3 -3
  91. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Validation/index.html +3 -3
  92. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/Button/Button.jsx.html +3 -3
  93. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/Button/index.html +3 -3
  94. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/Close/Close.jsx.html +3 -3
  95. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/Close/index.html +3 -3
  96. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx.html +3 -3
  97. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/LinkButton/index.html +3 -3
  98. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +3 -3
  99. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/RadioButtonWithText/index.html +3 -3
  100. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx.html +78 -18
  101. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/AmountInput/index.html +7 -7
  102. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx.html +3 -3
  103. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/CoinPicker/index.html +3 -3
  104. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/LineWithIconLink/LineWithIconLink.jsx.html +3 -3
  105. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/LineWithIconLink/index.html +3 -3
  106. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx.html +3 -3
  107. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/TitledLineWithIconLink/index.html +3 -3
  108. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +3 -3
  109. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/CoinPickerDialogStep/index.html +3 -3
  110. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/Dialog.jsx.html +3 -3
  111. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +3 -3
  112. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/DialogButtons/index.html +3 -3
  113. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +3 -3
  114. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/DialogStep/index.html +3 -3
  115. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/index.html +3 -3
  116. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx.html +283 -64
  117. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/SwapForm/index.html +7 -7
  118. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx.html +3 -3
  119. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/templates/DeterminedErrorDialogStep/index.html +3 -3
  120. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/hooks/index.html +3 -3
  121. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/hooks/useCallHandlingErrors.js.html +3 -3
  122. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/hooks/useIsHydrated.js.html +3 -3
  123. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/hooks/useReferredState.js.html +3 -3
  124. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/index.html +3 -3
  125. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/inputValueProviders.js.html +3 -3
  126. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/textUtils.js.html +3 -3
  127. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/uiUtils.js.html +3 -3
  128. package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/urlQueryUtils.js.html +3 -3
  129. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/BackgroundTitle.stories.jsx.html +3 -3
  130. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/LinesOfText.stories.jsx.html +3 -3
  131. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/LoadingDots.stories.jsx.html +3 -3
  132. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/QrCode.stories.jsx.html +3 -3
  133. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/RateSelector.stories.jsx.html +3 -3
  134. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/Validation.stories.jsx.html +3 -3
  135. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/Button.stories.jsx.html +3 -3
  136. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/Close.stories.jsx.html +3 -3
  137. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/LinkButton.stories.jsx.html +3 -3
  138. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/index.html +3 -3
  139. package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/index.html +3 -3
  140. package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/LineWithIconLink.stories.jsx.html +3 -3
  141. package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/TitledLineWithIconLink.stories.jsx.html +3 -3
  142. package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/index.html +3 -3
  143. package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/Dialog.stories.jsx.html +3 -3
  144. package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogButtons/DialogButtons.stories.jsx.html +3 -3
  145. package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogButtons/index.html +3 -3
  146. package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogStep/DialogStep.stories.jsx.html +3 -3
  147. package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogStep/index.html +3 -3
  148. package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/index.html +3 -3
  149. package/coverage/{rabbit-ui-kit → ui-kit}/stories/stubs/exampleContent.jsx.html +3 -3
  150. package/coverage/{rabbit-ui-kit → ui-kit}/stories/stubs/index.html +3 -3
  151. package/coverage/{rabbit-ui-kit → ui-kit}/stories/templates/DeterminedErrorDialogStep.stories.jsx.html +3 -3
  152. package/coverage/{rabbit-ui-kit → ui-kit}/stories/templates/index.html +3 -3
  153. package/coverage/ui-kit/storybook-static/124.c2d01e5e.iframe.bundle.js.html +85 -0
  154. package/coverage/ui-kit/storybook-static/138.56b7edc4.iframe.bundle.js.html +85 -0
  155. package/coverage/ui-kit/storybook-static/312.6f62bbd9.iframe.bundle.js.html +85 -0
  156. package/coverage/ui-kit/storybook-static/341.57a15f57.iframe.bundle.js.html +85 -0
  157. package/coverage/ui-kit/storybook-static/370.73bb343e.iframe.bundle.js.html +85 -0
  158. package/coverage/ui-kit/storybook-static/595.2e40d981.iframe.bundle.js.html +85 -0
  159. package/coverage/ui-kit/storybook-static/607.3ea32459.iframe.bundle.js.html +85 -0
  160. package/coverage/ui-kit/storybook-static/609.8c79ec77.iframe.bundle.js.html +85 -0
  161. package/coverage/ui-kit/storybook-static/666.09fdc1d7.iframe.bundle.js.html +85 -0
  162. package/coverage/ui-kit/storybook-static/797.c87cdf19.iframe.bundle.js.html +85 -0
  163. package/coverage/ui-kit/storybook-static/822.4bc0ebce.iframe.bundle.js.html +85 -0
  164. package/coverage/ui-kit/storybook-static/833.08e3ebb6.iframe.bundle.js.html +85 -0
  165. package/coverage/ui-kit/storybook-static/862.bf6bfe62.iframe.bundle.js.html +85 -0
  166. package/coverage/ui-kit/storybook-static/87.0a1bfeb1.iframe.bundle.js.html +85 -0
  167. package/coverage/ui-kit/storybook-static/893.4b09f929.iframe.bundle.js.html +85 -0
  168. package/coverage/ui-kit/storybook-static/996.846a677b.iframe.bundle.js.html +85 -0
  169. package/coverage/ui-kit/storybook-static/atoms-BackgroundTitle-stories.1a5386a1.iframe.bundle.js.html +85 -0
  170. package/coverage/ui-kit/storybook-static/atoms-LinesOfText-stories.7043a48b.iframe.bundle.js.html +85 -0
  171. package/coverage/ui-kit/storybook-static/atoms-LoadingDots-stories.091245c7.iframe.bundle.js.html +85 -0
  172. package/coverage/ui-kit/storybook-static/atoms-QrCode-stories.e10363b6.iframe.bundle.js.html +85 -0
  173. package/coverage/ui-kit/storybook-static/atoms-RateSelector-stories.af208e9a.iframe.bundle.js.html +85 -0
  174. package/coverage/ui-kit/storybook-static/atoms-Validation-stories.d561b311.iframe.bundle.js.html +85 -0
  175. package/coverage/ui-kit/storybook-static/atoms-buttons-Button-stories.e8e6b930.iframe.bundle.js.html +85 -0
  176. package/coverage/ui-kit/storybook-static/atoms-buttons-Close-stories.0a902a7c.iframe.bundle.js.html +85 -0
  177. package/coverage/ui-kit/storybook-static/atoms-buttons-LinkButton-stories.ca93ab6b.iframe.bundle.js.html +85 -0
  178. package/coverage/ui-kit/storybook-static/index.html +596 -0
  179. package/coverage/ui-kit/storybook-static/main.41f410f2.iframe.bundle.js.html +85 -0
  180. package/coverage/ui-kit/storybook-static/molecules-LineWithIconLink-stories.9721a18c.iframe.bundle.js.html +85 -0
  181. package/coverage/ui-kit/storybook-static/molecules-TitledLineWithIconLink-stories.1383fe3f.iframe.bundle.js.html +85 -0
  182. package/coverage/ui-kit/storybook-static/organisms-Dialog-Dialog-stories.4e6da717.iframe.bundle.js.html +85 -0
  183. package/coverage/ui-kit/storybook-static/organisms-Dialog-DialogButtons-DialogButtons-stories.6f45ae6e.iframe.bundle.js.html +85 -0
  184. package/coverage/ui-kit/storybook-static/organisms-Dialog-DialogStep-DialogStep-stories.74896048.iframe.bundle.js.html +85 -0
  185. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/addon-backgrounds/dist/index.html +116 -0
  186. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/addon-backgrounds/dist/preview.js.html +118 -0
  187. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/components/dist/formatter-SWP5E3XI.mjs.html +118 -0
  188. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/components/dist/index.html +116 -0
  189. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/buffer/index.html +116 -0
  190. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/buffer/index.js.html +118 -0
  191. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/markdown-to-jsx/dist/index.html +116 -0
  192. package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/markdown-to-jsx/dist/index.modern.js.html +118 -0
  193. package/coverage/ui-kit/storybook-static/runtime~main.ad918f38.iframe.bundle.js.html +85 -0
  194. package/coverage/ui-kit/storybook-static/sb-addons/actions-9/index.html +116 -0
  195. package/coverage/ui-kit/storybook-static/sb-addons/actions-9/manager-bundle.js.html +94 -0
  196. package/coverage/ui-kit/storybook-static/sb-addons/essentials-backgrounds-2/index.html +116 -0
  197. package/coverage/ui-kit/storybook-static/sb-addons/essentials-backgrounds-2/manager-bundle.js.html +121 -0
  198. package/coverage/ui-kit/storybook-static/sb-addons/essentials-controls-1/index.html +116 -0
  199. package/coverage/ui-kit/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js.html +274 -0
  200. package/coverage/ui-kit/storybook-static/sb-addons/essentials-measure-4/index.html +116 -0
  201. package/coverage/ui-kit/storybook-static/sb-addons/essentials-measure-4/manager-bundle.js.html +94 -0
  202. package/coverage/ui-kit/storybook-static/sb-addons/essentials-outline-5/index.html +116 -0
  203. package/coverage/ui-kit/storybook-static/sb-addons/essentials-outline-5/manager-bundle.js.html +94 -0
  204. package/coverage/ui-kit/storybook-static/sb-addons/essentials-toolbars-3/index.html +116 -0
  205. package/coverage/ui-kit/storybook-static/sb-addons/essentials-toolbars-3/manager-bundle.js.html +94 -0
  206. package/coverage/ui-kit/storybook-static/sb-addons/interactions-7/index.html +116 -0
  207. package/coverage/ui-kit/storybook-static/sb-addons/interactions-7/manager-bundle.js.html +121 -0
  208. package/coverage/ui-kit/storybook-static/sb-addons/links-0/index.html +116 -0
  209. package/coverage/ui-kit/storybook-static/sb-addons/links-0/manager-bundle.js.html +94 -0
  210. package/coverage/ui-kit/storybook-static/sb-addons/onboarding-6/index.html +116 -0
  211. package/coverage/ui-kit/storybook-static/sb-addons/onboarding-6/manager-bundle.js.html +1588 -0
  212. package/coverage/ui-kit/storybook-static/sb-addons/viewport-8/index.html +116 -0
  213. package/coverage/ui-kit/storybook-static/sb-addons/viewport-8/manager-bundle.js.html +94 -0
  214. package/coverage/ui-kit/storybook-static/sb-manager/WithTooltip-V3YHNWJZ-LVYLGZW2.js.html +88 -0
  215. package/coverage/ui-kit/storybook-static/sb-manager/chunk-2IXBUOFS.js.html +106 -0
  216. package/coverage/ui-kit/storybook-static/sb-manager/chunk-INSKDKQB.js.html +1129 -0
  217. package/coverage/ui-kit/storybook-static/sb-manager/chunk-NGTUFCUO.js.html +112 -0
  218. package/coverage/ui-kit/storybook-static/sb-manager/chunk-UUEAOBSN.js.html +1303 -0
  219. package/coverage/ui-kit/storybook-static/sb-manager/chunk-ZEU7PDD3.js.html +88 -0
  220. package/coverage/ui-kit/storybook-static/sb-manager/formatter-SWP5E3XI-7BGIK6BL.js.html +553 -0
  221. package/coverage/ui-kit/storybook-static/sb-manager/globals-module-info.js.html +88 -0
  222. package/coverage/ui-kit/storybook-static/sb-manager/globals.js.html +88 -0
  223. package/coverage/ui-kit/storybook-static/sb-manager/index.html +281 -0
  224. package/coverage/ui-kit/storybook-static/sb-manager/index.js.html +88 -0
  225. package/coverage/ui-kit/storybook-static/sb-manager/runtime.js.html +88 -0
  226. package/coverage/ui-kit/storybook-static/sb-manager/syntaxhighlighter-V7JZZA35-DXZCI2WR.js.html +88 -0
  227. package/coverage/ui-kit/storybook-static/sb-preview/globals.js.html +88 -0
  228. package/coverage/ui-kit/storybook-static/sb-preview/index.html +131 -0
  229. package/coverage/ui-kit/storybook-static/sb-preview/runtime.js.html +421 -0
  230. package/coverage/ui-kit/storybook-static/templates-DeterminedErrorDialogStep-stories.3cc14214.iframe.bundle.js.html +85 -0
  231. package/dist/index.cjs +186 -115
  232. package/dist/index.cjs.map +1 -1
  233. package/dist/index.css +17 -0
  234. package/dist/index.css.map +1 -1
  235. package/dist/index.modern.js +121 -57
  236. package/dist/index.modern.js.map +1 -1
  237. package/dist/index.module.js +186 -115
  238. package/dist/index.module.js.map +1 -1
  239. package/dist/index.umd.js +186 -115
  240. package/dist/index.umd.js.map +1 -1
  241. package/package.json +1 -1
  242. package/src/swaps-lib/services/publicSwapService.js +5 -2
  243. package/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx +32 -12
  244. package/src/ui-kit/components/molecules/AmountInput/amount-input.module.scss +10 -0
  245. package/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx +131 -58
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabbitio/ui-kit",
3
- "version": "1.0.0-beta.75",
3
+ "version": "1.0.0-beta.77",
4
4
  "description": "Rabbit.io react.js components kit",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -203,8 +203,11 @@ export class PublicSwapService {
203
203
 
204
204
  const coinUsdtRate = withoutFiat
205
205
  ? null
206
- : (await (fixed ? this._fixedSwapProvider : this._swapProvider).getCoinToUSDTRate(fromCoin))?.rate ??
207
- null;
206
+ : (
207
+ await (fixed ? this._fixedSwapProvider : this._swapProvider).getCoinToUSDTRate(
208
+ amountIsToReceive ? toCoin : fromCoin
209
+ )
210
+ )?.rate ?? null;
208
211
  const details = await (fixed ? this._fixedSwapProvider : this._swapProvider).getSwapInfo(
209
212
  fromCoin,
210
213
  toCoin,
@@ -144,6 +144,13 @@ export const AmountInput = React.forwardRef(
144
144
  // eslint-disable-next-line react-hooks/exhaustive-deps
145
145
  }, [predefinedValue]);
146
146
 
147
+ useEffect(() => {
148
+ if (!cryptoAssetToFiatRate || typeof cryptoAssetToFiatRate !== "string") return;
149
+
150
+ handleChangeAmount(coinAmountValue, false);
151
+ // eslint-disable-next-line react-hooks/exhaustive-deps
152
+ }, [cryptoAssetToFiatRate]);
153
+
147
154
  useEffect(() => {
148
155
  try {
149
156
  setCoinAmountPlaceholder(placeholderByDecimalCount(assetDecimalPlaces));
@@ -256,18 +263,31 @@ export const AmountInput = React.forwardRef(
256
263
  <span className={s["requested-amount-fiat-currency"]}>
257
264
  {(estimateAmount ? "~ " : "") + fiatCurrencyCode}
258
265
  </span>
259
- <input
260
- type="text"
261
- inputMode="decimal"
262
- className={s["requested-amount-fiat-input"]}
263
- value={fiatAmountValue}
264
- disabled={disabled || locked}
265
- onChange={e => handleChangeAmountFiat(e.target.value)}
266
- placeholder={placeholderByDecimalCount(fiatCurrencyDecimals)}
267
- autoFocus={fiatAmountAutoFocus}
268
- onFocus={e => callHandlingErrors(() => setIsInFocus(true), e)}
269
- onBlur={e => callHandlingErrors(() => setIsInFocus(false), e)}
270
- />
266
+
267
+ {!isLoading && cryptoAssetToFiatRate ? (
268
+ <input
269
+ type="text"
270
+ inputMode="decimal"
271
+ className={s["requested-amount-fiat-input"]}
272
+ value={fiatAmountValue}
273
+ disabled={disabled || locked}
274
+ onChange={e => handleChangeAmountFiat(e.target.value)}
275
+ placeholder={placeholderByDecimalCount(fiatCurrencyDecimals)}
276
+ autoFocus={fiatAmountAutoFocus}
277
+ onFocus={e => callHandlingErrors(() => setIsInFocus(true), e)}
278
+ onBlur={e => callHandlingErrors(() => setIsInFocus(false), e)}
279
+ />
280
+ ) : (
281
+ <div className={s["requested-amount-fiat-skeleton"]}>
282
+ <span
283
+ className={
284
+ s["requested-amount-fiat-skeleton-content"] +
285
+ " " +
286
+ s["skeleton-dark"]
287
+ }
288
+ ></span>
289
+ </div>
290
+ )}
271
291
  </>
272
292
  ) : (
273
293
  <span
@@ -181,6 +181,16 @@
181
181
  }
182
182
  }
183
183
 
184
+ &-skeleton {
185
+ width: 25%;
186
+ display: flex;
187
+ align-items: center;
188
+
189
+ &-content {
190
+ @extend %skeleton-text;
191
+ }
192
+ }
193
+
184
194
  &-placeholder {
185
195
  cursor: pointer;
186
196
  }
@@ -346,6 +346,15 @@ export const SwapForm = ({
346
346
  const DETAIL_REFRESH_INTERVAL_MS = 1.5 * 60000;
347
347
  const IS_FIXED_BY_DEFAULT = false;
348
348
 
349
+ const [sendingAssetTickerReferred, setSendingAssetTickerReferred] = useReferredState(null);
350
+ const [receivingAssetTickerReferred, setReceivingAssetTickerReferred] = useReferredState(null);
351
+
352
+ // eslint-disable-next-line react-hooks/exhaustive-deps
353
+ useEffect(() => setSendingAssetTickerReferred(sendingAssetTicker), [sendingAssetTicker]);
354
+
355
+ // eslint-disable-next-line react-hooks/exhaustive-deps
356
+ useEffect(() => setReceivingAssetTickerReferred(receivingAssetTicker), [receivingAssetTicker]);
357
+
349
358
  // Updating the states below will insert the new value into the send or receive input field
350
359
  const [updateSendInputTo, setUpdateSendInputTo] = useState(preservedAmount ?? null);
351
360
  const [updateReceiveInputTo, setUpdateReceiveInputTo] = useState(null);
@@ -371,7 +380,7 @@ export const SwapForm = ({
371
380
  const [isAmountZero, setIsAmountZero] = useState(preservedAmount == null || String(preservedAmount) === "0");
372
381
  const [isLoading, setIsLoading] = useReferredState(false); // Whether the form is in the progress of loading some data (new rates, for example)
373
382
  const [isFixedRate, setIsFixedRate] = useReferredState(null);
374
- const [isLastEditedReceiving, setIsLastEditedReceiving] = useState(false);
383
+ const [isLastEditedReceiving, setIsLastEditedReceiving] = useReferredState(false);
375
384
 
376
385
  const [confirmButtonTo, setConfirmButtonTo] = useState(
377
386
  composeConfirmButtonTo(sendingAssetTicker, receivingAssetTicker, preservedAmount)
@@ -403,21 +412,20 @@ export const SwapForm = ({
403
412
 
404
413
  const handleSendAssetAmountChange = amount => {
405
414
  setIsLastEditedReceiving(false);
406
- const receiveAmount = AmountUtils.trim(BigNumber(amount).times(swapRate), receivingAssetDecimalCount);
407
- if (amount != null && amount !== "") {
408
- setReceiveAssetAmount(receiveAmount);
409
- setUpdateReceiveInputTo(receiveAmount);
410
- } else {
411
- setUpdateReceiveInputTo("");
415
+ let receiveAmount = "";
416
+ if (amount != null && amount !== "" && swapRate != null) {
417
+ receiveAmount = AmountUtils.trim(BigNumber(amount).times(swapRate), receivingAssetDecimalCount);
412
418
  }
419
+ setReceiveAssetAmount(receiveAmount);
420
+ setUpdateReceiveInputTo(receiveAmount);
413
421
  setSendAssetAmount(amount);
414
422
  };
415
423
 
416
424
  const handleReceiveAssetAmountChange = amount => {
417
425
  setReceiveAssetAmount(amount);
418
- setIsLastEditedReceiving(true);
426
+ if (isFixedRate.current) setIsLastEditedReceiving(true);
419
427
  let sendAssetAmount = "";
420
- if (amount != null && amount !== "") {
428
+ if (amount != null && amount !== "" && swapRate != null) {
421
429
  sendAssetAmount = AmountUtils.trim(BigNumber(amount).div(swapRate), sendingAssetDecimalCount);
422
430
  }
423
431
  setUpdateSendInputTo(sendAssetAmount);
@@ -427,15 +435,25 @@ export const SwapForm = ({
427
435
  const handleMinimalAmountClick = () => {
428
436
  if (!minimalAmount.current) return;
429
437
 
430
- setUpdateSendInputTo(minimalAmount.current?.crypto);
431
- handleSendAssetAmountChange(minimalAmount.current?.crypto);
438
+ if (isLastEditedReceiving.current) {
439
+ setUpdateReceiveInputTo(minimalAmount.current?.crypto);
440
+ handleReceiveAssetAmountChange(minimalAmount.current?.crypto);
441
+ } else {
442
+ setUpdateSendInputTo(minimalAmount.current?.crypto);
443
+ handleSendAssetAmountChange(minimalAmount.current?.crypto);
444
+ }
432
445
  };
433
446
 
434
447
  const handleMaximumAmountClick = () => {
435
448
  if (!maximumAmount.current) return;
436
449
 
437
- setUpdateSendInputTo(maximumAmount.current?.crypto);
438
- handleSendAssetAmountChange(maximumAmount.current?.crypto);
450
+ if (isLastEditedReceiving.current) {
451
+ setUpdateReceiveInputTo(maximumAmount.current?.crypto);
452
+ handleReceiveAssetAmountChange(maximumAmount.current?.crypto);
453
+ } else {
454
+ setUpdateSendInputTo(maximumAmount.current?.crypto);
455
+ handleSendAssetAmountChange(maximumAmount.current?.crypto);
456
+ }
439
457
  };
440
458
 
441
459
  const handleSwapAllClick = resetButtonLoader => {
@@ -445,6 +463,7 @@ export const SwapForm = ({
445
463
  setUpdateSendInputTo("");
446
464
  setUpdateReceiveInputTo("");
447
465
  setSendAssetAmount(null);
466
+ setReceiveAssetAmount(null);
448
467
  }
449
468
  return !prev;
450
469
  });
@@ -497,6 +516,15 @@ export const SwapForm = ({
497
516
 
498
517
  const setAmountLimitsAndRate = details => {
499
518
  setSwapRate(details?.rate ?? null);
519
+ if (!details?.rate) {
520
+ if (isLastEditedReceiving.current) {
521
+ setUpdateSendInputTo("");
522
+ setSendAssetAmount("");
523
+ } else {
524
+ setUpdateReceiveInputTo("");
525
+ setReceiveAssetAmount("");
526
+ }
527
+ }
500
528
  setMinimalAmount(details.min == null ? null : { crypto: details.min, fiat: details.fiatMin });
501
529
  setMaximumAmount(details.max == null ? null : { crypto: details.max, fiat: details.fiatMax });
502
530
  if (details.feeCoins != null) {
@@ -529,22 +557,32 @@ export const SwapForm = ({
529
557
  setIsPairSupported(true);
530
558
  setIsSwapCalculated(false);
531
559
 
560
+ const currentSendingAssetTicker = sendingAssetTicker;
561
+ const currentReceivingAssetTicker = receivingAssetTicker;
562
+
532
563
  const response = await retrieveSwapDetails(
533
- sendingAssetTicker,
534
- receivingAssetTicker,
564
+ currentSendingAssetTicker,
565
+ currentReceivingAssetTicker,
535
566
  amount,
536
567
  isSwapAll.current,
537
568
  isFixedRate.current ?? IS_FIXED_BY_DEFAULT,
538
- isFixedRate.current ? isLastEditedReceiving : false
569
+ isFixedRate.current ? isLastEditedReceiving.current : false
539
570
  );
540
571
 
572
+ if (
573
+ currentSendingAssetTicker !== sendingAssetTickerReferred.current ||
574
+ currentReceivingAssetTicker !== receivingAssetTickerReferred.current
575
+ ) {
576
+ return;
577
+ }
578
+
541
579
  if (
542
580
  !isSwapAll.current &&
543
581
  String(amount) !==
544
582
  String(
545
- isForPreserved && sendAssetAmount.current == null
583
+ isForPreserved && sendAssetAmount.current == null && receiveAssetAmount.current == null
546
584
  ? preservedAmount
547
- : isFixedRate.current && isLastEditedReceiving
585
+ : isFixedRate.current && isLastEditedReceiving.current
548
586
  ? receiveAssetAmount.current
549
587
  : sendAssetAmount.current
550
588
  )
@@ -553,21 +591,27 @@ export const SwapForm = ({
553
591
  return;
554
592
  }
555
593
 
556
- if (response.result) {
557
- const swapCreationInfo = response.swapCreationInfo;
594
+ const swapCreationInfo = response?.swapCreationInfo;
558
595
 
596
+ if (response.result) {
559
597
  if (isSwapAll.current) {
560
598
  setIsAmountZero(BigNumber("0").eq(swapCreationInfo.fromAmountCoins));
561
599
  }
562
600
 
601
+ setUpdateSendInputTo(swapCreationInfo.fromAmountCoins);
602
+ setUpdateReceiveInputTo(swapCreationInfo.toAmountCoins);
603
+
604
+ if (isLastEditedReceiving.current) {
605
+ setSendAssetAmount(swapCreationInfo.fromAmountCoins);
606
+ } else {
607
+ setReceiveAssetAmount(swapCreationInfo.toAmountCoins);
608
+ }
609
+
563
610
  setAmountLimitsAndRate(swapCreationInfo);
564
611
  setSwapCreationEstimation(swapCreationInfo);
565
612
  setIsRefundAddressRequired(swapCreationInfo?.isRefundAddressRequired);
566
613
  processMinMaxAmounts(isSwapAll.current ? swapCreationInfo.fromAmountCoins : amount);
567
614
  setIsSwapCalculated(true);
568
-
569
- setUpdateSendInputTo(swapCreationInfo.fromAmountCoins);
570
- setUpdateReceiveInputTo(swapCreationInfo.toAmountCoins);
571
615
  } else {
572
616
  handleSwapServiceError(
573
617
  response.reason,
@@ -589,6 +633,11 @@ export const SwapForm = ({
589
633
  * for the swap All case.
590
634
  */
591
635
  setAmountLimitsAndRate(response);
636
+ if (isLastEditedReceiving.current) {
637
+ setSendAssetAmount("");
638
+ } else {
639
+ setReceiveAssetAmount("");
640
+ }
592
641
  }
593
642
  }
594
643
  setIsLoading(false);
@@ -643,6 +692,24 @@ export const SwapForm = ({
643
692
  setIsSwapAll(null);
644
693
  setMaximumAmountValid(true);
645
694
  setMinimalAmountValid(true);
695
+
696
+ const sendAssetAmountMemento = sendAssetAmount.current;
697
+ const receiveAssetAmountMemento = receiveAssetAmount.current;
698
+
699
+ if (isLastEditedReceiving.current) {
700
+ setSendAssetAmount("");
701
+ setUpdateSendInputTo("");
702
+
703
+ setReceiveAssetAmount(sendAssetAmountMemento);
704
+ setUpdateReceiveInputTo(sendAssetAmountMemento);
705
+ } else {
706
+ setSendAssetAmount(receiveAssetAmountMemento);
707
+ setUpdateSendInputTo(receiveAssetAmountMemento);
708
+
709
+ setReceiveAssetAmount("");
710
+ setUpdateReceiveInputTo("");
711
+ }
712
+
646
713
  rotateAssets(sendingAssetTicker, receivingAssetTicker);
647
714
  }
648
715
  }, e);
@@ -650,7 +717,7 @@ export const SwapForm = ({
650
717
 
651
718
  const handleRateModeChanged = isFixed => {
652
719
  setIsFixedRate(isFixed);
653
- requestDataRefresh(isLastEditedReceiving ? receiveAssetAmount.current : sendAssetAmount.current, true);
720
+ requestDataRefresh(isLastEditedReceiving.current ? receiveAssetAmount.current : sendAssetAmount.current, true);
654
721
  };
655
722
 
656
723
  useEffect(() => {
@@ -664,31 +731,18 @@ export const SwapForm = ({
664
731
 
665
732
  useEffect(() => {
666
733
  onIsFixedChange(isFixedRate.current);
734
+ if (!isFixedRate.current) setIsLastEditedReceiving(false);
667
735
  // eslint-disable-next-line react-hooks/exhaustive-deps
668
736
  }, [isFixedRate.current]);
669
737
 
670
- useEffect(() => {
671
- setConfirmButtonTo(
672
- composeConfirmButtonTo(
673
- sendingAssetTicker,
674
- receivingAssetTicker,
675
- sendAssetAmount.current || preservedAmount || null
676
- )
677
- );
678
- // eslint-disable-next-line react-hooks/exhaustive-deps
679
- }, [sendingAssetTicker, receivingAssetTicker]);
680
-
681
738
  useEffect(() => {
682
739
  if (!sendingAssetTicker || !receivingAssetTicker) return;
683
740
 
684
741
  const isCurrentAmountNotZero = sendAssetAmount.current && !BigNumber("0").eq(sendAssetAmount.current);
685
- const isPreservedAmountNotZero = preservedAmount && !BigNumber("0").eq(preservedAmount);
686
742
  if (isCurrentAmountNotZero) {
687
- loadFullEstimation(isLastEditedReceiving ? receiveAssetAmount.current : sendAssetAmount.current);
688
- } else if (isPreservedAmountNotZero) {
689
- loadFullEstimation(preservedAmount, true);
743
+ loadFullEstimation(isLastEditedReceiving.current ? receiveAssetAmount.current : sendAssetAmount.current);
690
744
  } else {
691
- loadMinimalAmountAndSwapRate();
745
+ loadMinimalAmountAndSwapRate(true);
692
746
  }
693
747
 
694
748
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -773,7 +827,9 @@ export const SwapForm = ({
773
827
  timeoutId = setTimeout(
774
828
  () =>
775
829
  requestDataRefresh(
776
- isLastEditedReceiving ? receiveAssetAmount.current : sendAssetAmount.current ?? preservedAmount,
830
+ isLastEditedReceiving.current
831
+ ? receiveAssetAmount.current
832
+ : sendAssetAmount.current ?? preservedAmount,
777
833
  true
778
834
  ),
779
835
  DETAIL_REFRESH_INTERVAL_MS
@@ -808,7 +864,7 @@ export const SwapForm = ({
808
864
 
809
865
  useEffect(() => {
810
866
  if (swapRate != null && sendAssetAmount.current != null) {
811
- if (isLastEditedReceiving) {
867
+ if (isLastEditedReceiving.current) {
812
868
  setUpdateSendInputTo(
813
869
  AmountUtils.trim(BigNumber(receiveAssetAmount.current).div(swapRate), sendingAssetDecimalCount)
814
870
  );
@@ -829,17 +885,21 @@ export const SwapForm = ({
829
885
  // eslint-disable-next-line react-hooks/exhaustive-deps
830
886
  }, [isLoading.current, swapAllButtonLoaderReSetter]);
831
887
 
832
- useEffect(() => {
833
- setConfirmButtonTo(composeConfirmButtonTo(sendingAssetTicker, receivingAssetTicker, sendAssetAmount.current));
834
-
835
- if (sendAssetAmount.current == null) return;
836
- let processingAmount = sendAssetAmount.current === "" ? "0" : sendAssetAmount.current;
837
- let processingReceivingAmount = receiveAssetAmount.current === "" ? "0" : receiveAssetAmount.current;
838
- requestDataRefresh(isLastEditedReceiving ? processingReceivingAmount : processingAmount);
839
- processMinMaxAmounts(processingAmount);
840
- setIsAmountZero(BigNumber("0").eq(processingAmount));
888
+ const handleAmountChange = amount => {
889
+ requestDataRefresh(amount);
890
+ processMinMaxAmounts(amount);
891
+ setIsAmountZero(BigNumber("0").eq(amount));
841
892
  setIsSwapCalculated(false);
842
- // eslint-disable-next-line react-hooks/exhaustive-deps
893
+ };
894
+
895
+ useEffect(() => {
896
+ if (!isLastEditedReceiving.current) return;
897
+ handleAmountChange(receiveAssetAmount.current === "" ? "0" : receiveAssetAmount.current);
898
+ }, [receiveAssetAmount.current]);
899
+
900
+ useEffect(() => {
901
+ if (isLastEditedReceiving.current) return;
902
+ handleAmountChange(sendAssetAmount.current === "" ? "0" : sendAssetAmount.current);
843
903
  }, [sendAssetAmount.current]);
844
904
 
845
905
  const recipientAddressExtraIdName = getExtraIdNameByTicker(receivingAssetTicker);
@@ -898,9 +958,11 @@ export const SwapForm = ({
898
958
  showChangeAssetButton
899
959
  changeAssetButtonProtocol={sendingAssetProtocol}
900
960
  upperFormPosition
901
- errorEncountered={!minimalAmountValid}
961
+ errorEncountered={
962
+ !isLastEditedReceiving.current && (!minimalAmountValid || !maximumAmountValid)
963
+ }
902
964
  ref={fromAssetSelectionButtonRef}
903
- isLoading={isLastEditedReceiving ? isLoading.current : false}
965
+ isLoading={isLastEditedReceiving.current ? isLoading.current : false}
904
966
  cryptoAssetToFiatRate={sendingAssetToFiatRate}
905
967
  fiatCurrencyCode={formHasFiat ? fiatCurrencyCode : null}
906
968
  fiatCurrencyDecimals={fiatCurrencyDecimals}
@@ -940,9 +1002,10 @@ export const SwapForm = ({
940
1002
  changeAssetButtonProtocol={receivingAssetProtocol}
941
1003
  showBalance={formHasBalance}
942
1004
  lowerFormPosition
1005
+ errorEncountered={isLastEditedReceiving.current && (!minimalAmountValid || !maximumAmountValid)}
943
1006
  estimateAmount={!isFixedRate.current}
944
1007
  ref={toAssetSelectionButtonRef}
945
- isLoading={isLastEditedReceiving ? false : isLoading.current}
1008
+ isLoading={isLastEditedReceiving.current ? false : isLoading.current}
946
1009
  cryptoAssetToFiatRate={receivingAssetToFiatRate}
947
1010
  fiatCurrencyCode={formHasFiat ? fiatCurrencyCode : null}
948
1011
  fiatCurrencyDecimals={fiatCurrencyDecimals}
@@ -993,7 +1056,12 @@ export const SwapForm = ({
993
1056
  : e => callHandlingErrors(handleMaximumAmountClick, e)
994
1057
  }
995
1058
  >
996
- {AmountUtils.crypto(maximumAmount.current?.crypto, sendingAssetTickerPrintable)}
1059
+ {AmountUtils.crypto(
1060
+ maximumAmount.current?.crypto,
1061
+ isLastEditedReceiving.current
1062
+ ? receivingAssetTickerPrintable
1063
+ : sendingAssetTickerPrintable
1064
+ )}
997
1065
  </span>
998
1066
  {maximumAmount.current?.fiat != null && maximumAmount.current?.fiat !== "" ? (
999
1067
  <span className={s["semi-transparent"]}>
@@ -1016,7 +1084,12 @@ export const SwapForm = ({
1016
1084
  : e => callHandlingErrors(handleMinimalAmountClick, e)
1017
1085
  }
1018
1086
  >
1019
- {AmountUtils.crypto(minimalAmount.current.crypto, sendingAssetTickerPrintable)}
1087
+ {AmountUtils.crypto(
1088
+ minimalAmount.current.crypto,
1089
+ isLastEditedReceiving.current
1090
+ ? receivingAssetTickerPrintable
1091
+ : sendingAssetTickerPrintable
1092
+ )}
1020
1093
  </span>
1021
1094
  {minimalAmount.current?.fiat != null && minimalAmount.current.fiat !== "" ? (
1022
1095
  <span className={s["semi-transparent"]}>
@@ -1144,7 +1217,7 @@ export const SwapForm = ({
1144
1217
  recipientAddressExtraId.current,
1145
1218
  refundAddress.current,
1146
1219
  refundAddressExtraId.current,
1147
- isLastEditedReceiving
1220
+ isLastEditedReceiving.current
1148
1221
  )
1149
1222
  }
1150
1223
  fullWidthOnMobiles