@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.
- package/coverage/clover.xml +4180 -158
- package/coverage/coverage-final.json +157 -96
- package/coverage/index.html +323 -68
- package/coverage/{rabbit-ui-kit → ui-kit}/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/index.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/axiosAdapter.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/qrUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/amountUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/errorUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/external-apis/apiGroups.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/external-apis/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/external-apis/ipAddressProviders.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/fiatCurrenciesService.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/globalConstants.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/models/blockchain.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/models/coin.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/models/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/models/protocol.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/cache.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/emailAPI.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/logging/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/logging/logger.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/logging/logsStorage.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/postponeExecution.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/safeStringify.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/index.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/cacheAndConcurrentRequestsResolver.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/cachedRobustExternalApiCallerService.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/cancelProcessing.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/concurrentCalculationsMetadataHolder.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/externalApiProvider.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/externalServicesStatsCollector.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/robustExternalAPICallerService.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/letsExchangeSwapProvider.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/swapProvider.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/baseSwapCreationInfo.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/existingSwap.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/existingSwapWithFiatData.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/services/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/services/publicSwapService.js.html +17 -8
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/utils/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/utils/swapUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/arrowIcon.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/arrowTosca.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/arrowWhite.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/darkRectangle.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/determinedError.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/failedValidationIcon.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/infoIcon.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/noticeQuestionIcon.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/walletIcon.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/AssetIcon/AssetIcon.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/AssetIcon/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/AssetSelection/AssetSelection.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/AssetSelection/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/BackgroundTitle/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/InformationMessage/InformationMessage.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/InformationMessage/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Input/Input.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Input/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/LoadingDots/LoadingDots.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/LoadingDots/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/NoticeIcon/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/QrCode/QrCode.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/QrCode/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/RateSelector/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/SupportChat/SupportChat.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/SupportChat/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Textarea/Textarea.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Textarea/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/TitleBox/TitleBox.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/TitleBox/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Tooltip/Tooltip.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Tooltip/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/TwoLinesOfText/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Validation/Validation.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Validation/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/Button/Button.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/Button/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/Close/Close.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/Close/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/LinkButton/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/RadioButtonWithText/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx.html +78 -18
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/AmountInput/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/CoinPicker/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/LineWithIconLink/LineWithIconLink.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/LineWithIconLink/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/TitledLineWithIconLink/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/CoinPickerDialogStep/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/Dialog.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/DialogButtons/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/DialogStep/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx.html +283 -64
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/SwapForm/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/templates/DeterminedErrorDialogStep/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/hooks/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/hooks/useCallHandlingErrors.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/hooks/useIsHydrated.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/hooks/useReferredState.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/inputValueProviders.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/textUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/uiUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/urlQueryUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/BackgroundTitle.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/LinesOfText.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/LoadingDots.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/QrCode.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/RateSelector.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/Validation.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/Button.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/Close.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/LinkButton.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/LineWithIconLink.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/TitledLineWithIconLink.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/Dialog.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogButtons/DialogButtons.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogButtons/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogStep/DialogStep.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogStep/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/stubs/exampleContent.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/stubs/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/templates/DeterminedErrorDialogStep.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/templates/index.html +3 -3
- package/coverage/ui-kit/storybook-static/124.c2d01e5e.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/138.56b7edc4.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/312.6f62bbd9.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/341.57a15f57.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/370.73bb343e.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/595.2e40d981.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/607.3ea32459.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/609.8c79ec77.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/666.09fdc1d7.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/797.c87cdf19.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/822.4bc0ebce.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/833.08e3ebb6.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/862.bf6bfe62.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/87.0a1bfeb1.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/893.4b09f929.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/996.846a677b.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-BackgroundTitle-stories.1a5386a1.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-LinesOfText-stories.7043a48b.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-LoadingDots-stories.091245c7.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-QrCode-stories.e10363b6.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-RateSelector-stories.af208e9a.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-Validation-stories.d561b311.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-buttons-Button-stories.e8e6b930.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-buttons-Close-stories.0a902a7c.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-buttons-LinkButton-stories.ca93ab6b.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/index.html +596 -0
- package/coverage/ui-kit/storybook-static/main.41f410f2.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/molecules-LineWithIconLink-stories.9721a18c.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/molecules-TitledLineWithIconLink-stories.1383fe3f.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/organisms-Dialog-Dialog-stories.4e6da717.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/organisms-Dialog-DialogButtons-DialogButtons-stories.6f45ae6e.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/organisms-Dialog-DialogStep-DialogStep-stories.74896048.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/addon-backgrounds/dist/index.html +116 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/addon-backgrounds/dist/preview.js.html +118 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/components/dist/formatter-SWP5E3XI.mjs.html +118 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/components/dist/index.html +116 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/buffer/index.html +116 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/buffer/index.js.html +118 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/markdown-to-jsx/dist/index.html +116 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/markdown-to-jsx/dist/index.modern.js.html +118 -0
- package/coverage/ui-kit/storybook-static/runtime~main.ad918f38.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/sb-addons/actions-9/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/actions-9/manager-bundle.js.html +94 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-backgrounds-2/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-backgrounds-2/manager-bundle.js.html +121 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-controls-1/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js.html +274 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-measure-4/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-measure-4/manager-bundle.js.html +94 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-outline-5/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-outline-5/manager-bundle.js.html +94 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-toolbars-3/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-toolbars-3/manager-bundle.js.html +94 -0
- package/coverage/ui-kit/storybook-static/sb-addons/interactions-7/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/interactions-7/manager-bundle.js.html +121 -0
- package/coverage/ui-kit/storybook-static/sb-addons/links-0/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/links-0/manager-bundle.js.html +94 -0
- package/coverage/ui-kit/storybook-static/sb-addons/onboarding-6/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/onboarding-6/manager-bundle.js.html +1588 -0
- package/coverage/ui-kit/storybook-static/sb-addons/viewport-8/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/viewport-8/manager-bundle.js.html +94 -0
- package/coverage/ui-kit/storybook-static/sb-manager/WithTooltip-V3YHNWJZ-LVYLGZW2.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-2IXBUOFS.js.html +106 -0
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-INSKDKQB.js.html +1129 -0
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-NGTUFCUO.js.html +112 -0
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-UUEAOBSN.js.html +1303 -0
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-ZEU7PDD3.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-manager/formatter-SWP5E3XI-7BGIK6BL.js.html +553 -0
- package/coverage/ui-kit/storybook-static/sb-manager/globals-module-info.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-manager/globals.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-manager/index.html +281 -0
- package/coverage/ui-kit/storybook-static/sb-manager/index.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-manager/runtime.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-manager/syntaxhighlighter-V7JZZA35-DXZCI2WR.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-preview/globals.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-preview/index.html +131 -0
- package/coverage/ui-kit/storybook-static/sb-preview/runtime.js.html +421 -0
- package/coverage/ui-kit/storybook-static/templates-DeterminedErrorDialogStep-stories.3cc14214.iframe.bundle.js.html +85 -0
- package/dist/index.cjs +186 -115
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +17 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +121 -57
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +186 -115
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +186 -115
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/swaps-lib/services/publicSwapService.js +5 -2
- package/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx +32 -12
- package/src/ui-kit/components/molecules/AmountInput/amount-input.module.scss +10 -0
- package/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx +131 -58
package/package.json
CHANGED
|
@@ -203,8 +203,11 @@ export class PublicSwapService {
|
|
|
203
203
|
|
|
204
204
|
const coinUsdtRate = withoutFiat
|
|
205
205
|
? null
|
|
206
|
-
: (
|
|
207
|
-
|
|
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
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
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
|
|
@@ -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] =
|
|
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
|
-
|
|
407
|
-
if (amount != null && amount !== "") {
|
|
408
|
-
|
|
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
|
-
|
|
431
|
-
|
|
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
|
-
|
|
438
|
-
|
|
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
|
-
|
|
534
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
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
|
-
|
|
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={
|
|
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(
|
|
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(
|
|
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
|