@rabbitio/ui-kit 1.0.0-beta.64 → 1.0.0-beta.66
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 +6325 -4201
- package/coverage/coverage-final.json +160 -99
- package/coverage/index.html +444 -189
- 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/src/assets/wrappedImages/arrowTosca.jsx.html → ui-kit/src/assets/wrappedImages/arrowIcon.jsx.html} +8 -29
- package/coverage/{rabbit-ui-kit/src/assets/wrappedImages/arrowIcon.jsx.html → ui-kit/src/assets/wrappedImages/arrowTosca.jsx.html} +9 -24
- package/coverage/{rabbit-ui-kit → ui-kit}/src/assets/wrappedImages/arrowWhite.jsx.html +7 -25
- package/coverage/ui-kit/src/assets/wrappedImages/darkRectangle.jsx.html +106 -0
- package/coverage/{rabbit-ui-kit → ui-kit}/src/assets/wrappedImages/determinedError.jsx.html +9 -42
- package/coverage/{rabbit-ui-kit/src/assets/wrappedImages/successfulValidationIcon.jsx.html → ui-kit/src/assets/wrappedImages/failedValidationIcon.jsx.html} +28 -31
- package/coverage/{rabbit-ui-kit → ui-kit}/src/assets/wrappedImages/index.html +25 -25
- package/coverage/{rabbit-ui-kit/src/assets/wrappedImages/darkRectangle.jsx.html → ui-kit/src/assets/wrappedImages/infoIcon.jsx.html} +13 -19
- package/coverage/{rabbit-ui-kit → ui-kit}/src/assets/wrappedImages/noticeQuestionIcon.jsx.html +7 -25
- package/coverage/{rabbit-ui-kit/src/assets/wrappedImages/walletIcon.jsx.html → ui-kit/src/assets/wrappedImages/successfulValidationIcon.jsx.html} +23 -59
- package/coverage/{rabbit-ui-kit/src/assets/wrappedImages/infoIcon.jsx.html → ui-kit/src/assets/wrappedImages/walletIcon.jsx.html} +16 -16
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/adapters/axiosAdapter.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/adapters/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/adapters/qrUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/amountUtils.js.html +44 -308
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/errorUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/external-apis/apiGroups.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/external-apis/index.html +14 -14
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/external-apis/ipAddressProviders.js.html +31 -178
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/fiatCurrenciesService.js.html +12 -36
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/index.html +20 -20
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/models/blockchain.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/models/coin.js.html +10 -22
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/models/index.html +13 -13
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/models/protocol.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/utils/cache.js.html +23 -101
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/utils/emailAPI.js.html +9 -15
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/utils/index.html +19 -19
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/utils/logging/index.html +9 -9
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/utils/logging/logger.js.html +14 -35
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/utils/logging/logsStorage.js.html +5 -5
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/utils/postponeExecution.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common/utils/safeStringify.js.html +29 -29
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/AssetIcon/AssetIcon.jsx.html +11 -41
- package/coverage/ui-kit/src/components/atoms/AssetIcon/index.html +116 -0
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/AssetSelection/AssetSelection.jsx.html +9 -33
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/AssetSelection/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +8 -38
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/BackgroundTitle/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/InformationMessage/InformationMessage.jsx.html +8 -38
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/InformationMessage/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/Input/Input.jsx.html +15 -63
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/Input/index.html +7 -7
- package/coverage/ui-kit/src/components/atoms/LoadingDots/LoadingDots.jsx.html +196 -0
- package/coverage/{rabbit-ui-kit/src/components/atoms/RateSelector → ui-kit/src/components/atoms/LoadingDots}/index.html +4 -4
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/NoticeIcon/NoticeIcon.jsx.html +10 -40
- package/coverage/{rabbit-ui-kit/src/components/atoms/AssetIcon → ui-kit/src/components/atoms/NoticeIcon}/index.html +4 -4
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/QrCode/QrCode.jsx.html +8 -26
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/QrCode/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/RateSelector/RateSelector.jsx.html +10 -34
- package/coverage/ui-kit/src/components/atoms/RateSelector/index.html +116 -0
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/SupportChat/SupportChat.jsx.html +7 -22
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/SupportChat/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/Textarea/Textarea.jsx.html +17 -53
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/Textarea/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/TitleBox/TitleBox.jsx.html +13 -82
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/TitleBox/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/Tooltip/Tooltip.jsx.html +12 -18
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/Tooltip/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/TwoLinesOfText/LinesOfText.jsx.html +12 -30
- package/coverage/{rabbit-ui-kit/src/components/atoms/NoticeIcon → ui-kit/src/components/atoms/TwoLinesOfText}/index.html +4 -4
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/Validation/Validation.jsx.html +19 -13
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/Validation/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/buttons/Button/Button.jsx.html +23 -113
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/buttons/Button/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/buttons/Close/Close.jsx.html +9 -27
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/buttons/Close/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/buttons/LinkButton/LinkButton.jsx.html +11 -38
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/buttons/LinkButton/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +13 -67
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/atoms/buttons/RadioButtonWithText/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/hooks/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/hooks/useCallHandlingErrors.js.html +7 -19
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/hooks/useReferredState.js.html +4 -4
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/molecules/AmountInput/AmountInput.jsx.html +56 -407
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/molecules/AmountInput/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/molecules/CoinPicker/CoinPicker.jsx.html +67 -466
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/molecules/CoinPicker/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/molecules/LineWithIconLink/LineWithIconLink.jsx.html +7 -22
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/molecules/LineWithIconLink/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/molecules/TitledLineWithIconLink/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +9 -15
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/organisms/CoinPickerDialogStep/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/organisms/Dialog/Dialog.jsx.html +44 -194
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/organisms/Dialog/DialogButtons/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +63 -525
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/organisms/Dialog/DialogStep/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/organisms/Dialog/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/organisms/SwapForm/SwapForm.jsx.html +145 -670
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/organisms/SwapForm/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/templates/DeterminedErrorDialogStep/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/utils/index.html +20 -20
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/utils/inputValueProviders.js.html +11 -35
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/utils/textUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/utils/uiUtils.js.html +7 -13
- package/coverage/{rabbit-ui-kit → ui-kit}/src/components/utils/urlQueryUtils.js.html +18 -93
- package/coverage/{rabbit-ui-kit → ui-kit}/src/constants/atoms/Close/close.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/constants/atoms/Close/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/constants/atoms/LinkButton/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/constants/atoms/LinkButton/linkButton.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/constants/atoms/Tooltip/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/constants/atoms/Tooltip/tooltip.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/constants/globalConstants.jsx.html +7 -10
- package/coverage/{rabbit-ui-kit → ui-kit}/src/constants/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/constants/organisms/dialog/DialogStep/dialogStep.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/constants/organisms/dialog/DialogStep/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/constants/organisms/dialog/dialog.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/constants/organisms/dialog/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/index.js.html +8 -26
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robustExteranlApiCallerService/cacheAndConcurrentRequestsResolver.js.html +30 -222
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robustExteranlApiCallerService/cachedRobustExternalApiCallerService.js.html +24 -147
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robustExteranlApiCallerService/cancelProcessing.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robustExteranlApiCallerService/concurrentCalculationsMetadataHolder.js.html +19 -103
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robustExteranlApiCallerService/externalApiProvider.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robustExteranlApiCallerService/externalServicesStatsCollector.js.html +11 -23
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robustExteranlApiCallerService/index.html +38 -38
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robustExteranlApiCallerService/robustExternalAPICallerService.js.html +53 -305
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/index.html +24 -24
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/swapProvider.js.html +10 -28
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +277 -1009
- 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 +9 -27
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/index.html +13 -13
- 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 +53 -374
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/utils/index.html +13 -13
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/utils/swapUtils.js.html +32 -179
- 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/dist/index.cjs +65 -49
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +5 -2
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +43 -28
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +65 -49
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +65 -49
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -3
- package/src/assets/wrappedImages/arrowIcon.jsx +1 -7
- package/src/assets/wrappedImages/arrowTosca.jsx +1 -7
- package/src/assets/wrappedImages/arrowWhite.jsx +1 -7
- package/src/assets/wrappedImages/darkRectangle.jsx +2 -13
- package/src/assets/wrappedImages/determinedError.jsx +2 -13
- package/src/assets/wrappedImages/failedValidationIcon.jsx +2 -16
- package/src/assets/wrappedImages/infoIcon.jsx +1 -7
- package/src/assets/wrappedImages/noticeQuestionIcon.jsx +1 -7
- package/src/assets/wrappedImages/successfulValidationIcon.jsx +2 -16
- package/src/assets/wrappedImages/walletIcon.jsx +3 -19
- package/src/common/amountUtils.js +36 -124
- package/src/common/external-apis/ipAddressProviders.js +22 -71
- package/src/common/fiatCurrenciesService.js +4 -12
- package/src/common/models/coin.js +2 -6
- package/src/common/tests/amountUtils/composeRateText.test.js +12 -69
- package/src/common/tests/integration/external-apis/ipAddressProviders/getClientIpAddress.test.js +1 -3
- package/src/common/utils/cache.js +10 -36
- package/src/common/utils/emailAPI.js +1 -3
- package/src/common/utils/logging/logger.js +5 -12
- package/src/components/atoms/AssetIcon/AssetIcon.jsx +4 -14
- package/src/components/atoms/AssetSelection/AssetSelection.jsx +3 -11
- package/src/components/atoms/BackgroundTitle/BackgroundTitle.jsx +2 -12
- package/src/components/atoms/InformationMessage/InformationMessage.jsx +2 -12
- package/src/components/atoms/InformationMessage/information-message.module.scss +4 -2
- package/src/components/atoms/Input/Input.jsx +9 -25
- package/src/components/atoms/LoadingDots/LoadingDots.jsx +8 -28
- package/src/components/atoms/NoticeIcon/NoticeIcon.jsx +4 -14
- package/src/components/atoms/QrCode/QrCode.jsx +2 -8
- package/src/components/atoms/RateSelector/RateSelector.jsx +4 -12
- package/src/components/atoms/SupportChat/SupportChat.jsx +1 -6
- package/src/components/atoms/Textarea/Textarea.jsx +11 -23
- package/src/components/atoms/TitleBox/TitleBox.jsx +7 -30
- package/src/components/atoms/TitleBox/title-box.module.scss +2 -0
- package/src/components/atoms/Tooltip/Tooltip.jsx +6 -8
- package/src/components/atoms/TwoLinesOfText/LinesOfText.jsx +5 -11
- package/src/components/atoms/Validation/Validation.jsx +9 -7
- package/src/components/atoms/buttons/Button/Button.jsx +17 -47
- package/src/components/atoms/buttons/Close/Close.jsx +3 -9
- package/src/components/atoms/buttons/LinkButton/LinkButton.jsx +5 -14
- package/src/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx +7 -25
- package/src/components/hooks/useCallHandlingErrors.js +1 -5
- package/src/components/hooks/useReferredState.js +1 -1
- package/src/components/molecules/AmountInput/AmountInput.jsx +50 -167
- package/src/components/molecules/CoinPicker/CoinPicker.jsx +61 -194
- package/src/components/molecules/CoinPicker/coin-picker.module.scss +1 -4
- package/src/components/molecules/LineWithIconLink/LineWithIconLink.jsx +1 -6
- package/src/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx +3 -5
- package/src/components/organisms/Dialog/Dialog.jsx +38 -88
- package/src/components/organisms/Dialog/DialogStep/DialogStep.jsx +57 -211
- package/src/components/organisms/Dialog/DialogStep/dialog-step.module.scss +2 -4
- package/src/components/organisms/SwapForm/SwapForm.jsx +139 -314
- package/src/components/tests/utils/inputValueProviders/provideFormatOfFloatValueByInputString.test.js +5 -12
- package/src/components/tests/utils/urlQueryUtils/getQueryParameterValues.test.js +3 -9
- package/src/components/tests/utils/urlQueryUtils/saveQueryParameterAndValues.test.js +11 -51
- package/src/components/utils/inputValueProviders.js +3 -11
- package/src/components/utils/uiUtils.js +1 -3
- package/src/components/utils/urlQueryUtils.js +10 -35
- package/src/constants/globalConstants.jsx +1 -2
- package/src/index.js +2 -8
- package/src/robustExteranlApiCallerService/cacheAndConcurrentRequestsResolver.js +22 -86
- package/src/robustExteranlApiCallerService/cachedRobustExternalApiCallerService.js +15 -56
- package/src/robustExteranlApiCallerService/concurrentCalculationsMetadataHolder.js +11 -39
- package/src/robustExteranlApiCallerService/externalServicesStatsCollector.js +3 -7
- package/src/robustExteranlApiCallerService/robustExternalAPICallerService.js +45 -129
- package/src/robustExteranlApiCallerService/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/_performCallAttempt.test.js +76 -330
- package/src/robustExteranlApiCallerService/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/callExternalAPI.test.js +57 -270
- package/src/robustExteranlApiCallerService/tests/robustExternalAPICallerService/robustExternalAPICallerService/constructor.test.js +3 -15
- package/src/swaps-lib/external-apis/swapProvider.js +1 -7
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +117 -361
- package/src/swaps-lib/models/existingSwapWithFiatData.js +1 -7
- package/src/swaps-lib/services/publicSwapService.js +47 -154
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +33 -118
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/createSwap.test.js +23 -85
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getAllSupportedCurrencies.test.js +4 -14
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getDepositCurrencies.test.js +3 -9
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getSwapInfo.test.js +148 -460
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getWithdrawalCurrencies.test.js +5 -11
- package/src/swaps-lib/test/utils/swapUtils/safeHandleRequestsLimitExceeding.test.js +2 -10
- package/src/swaps-lib/utils/swapUtils.js +24 -73
- package/coverage/rabbit-ui-kit/src/assets/wrappedImages/failedValidationIcon.jsx.html +0 -244
- package/coverage/rabbit-ui-kit/src/components/atoms/LoadingDots/LoadingDots.jsx.html +0 -256
- package/coverage/rabbit-ui-kit/src/components/atoms/LoadingDots/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/atoms/TwoLinesOfText/index.html +0 -116
package/dist/index.module.js
CHANGED
|
@@ -2048,13 +2048,13 @@ var Validation = function Validation(_ref) {
|
|
|
2048
2048
|
isSuccessAlert = _ref.isSuccessAlert;
|
|
2049
2049
|
return /*#__PURE__*/React.createElement("div", {
|
|
2050
2050
|
className: s$h["validation"]
|
|
2051
|
-
}, isSuccessAlert ?
|
|
2051
|
+
}, /*#__PURE__*/React.createElement("div", null, isSuccessAlert ?
|
|
2052
2052
|
/*#__PURE__*/
|
|
2053
2053
|
// <img src={successfulValidationIcon} alt="validation icon" />
|
|
2054
2054
|
React.createElement(SuccessfulValidationIcon, null) :
|
|
2055
2055
|
/*#__PURE__*/
|
|
2056
2056
|
// <img src={failedValidationIcon} alt="validation icon" />
|
|
2057
|
-
React.createElement(FailedValidationIcon, null), /*#__PURE__*/React.createElement("span", {
|
|
2057
|
+
React.createElement(FailedValidationIcon, null)), /*#__PURE__*/React.createElement("span", {
|
|
2058
2058
|
className: s$h["validation-text"]
|
|
2059
2059
|
}, text));
|
|
2060
2060
|
};
|
|
@@ -2855,10 +2855,10 @@ var DialogStep = function DialogStep(_ref) {
|
|
|
2855
2855
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2856
2856
|
}, []);
|
|
2857
2857
|
var handleTransitionEnd = function handleTransitionEnd(event) {
|
|
2858
|
-
if (isMultiStep && isCurrentStep(stepName) && event.propertyName === "opacity" && event.target.classList[0] === DIALOG_STEP_CLASS) {
|
|
2858
|
+
if (isMultiStep && isCurrentStep(stepName) && event.propertyName === "opacity" && event.target.classList[0] === s$f[DIALOG_STEP_CLASS]) {
|
|
2859
2859
|
disableAnimation(animationConfiguration.animateHeightTransitionEnabled);
|
|
2860
2860
|
}
|
|
2861
|
-
if (isMultiStep && unmountOnAnimationEndTrigger && event.propertyName === "opacity" && event.target.classList[0] === DIALOG_STEP_CLASS) {
|
|
2861
|
+
if (isMultiStep && unmountOnAnimationEndTrigger && event.propertyName === "opacity" && event.target.classList[0] === s$f[DIALOG_STEP_CLASS]) {
|
|
2862
2862
|
clearButtonsConfiguration();
|
|
2863
2863
|
scrollDialogToTop();
|
|
2864
2864
|
setStepMounted(false);
|
|
@@ -4028,6 +4028,7 @@ var AmountInput = /*#__PURE__*/React.forwardRef(function (_ref, buttonForwardRef
|
|
|
4028
4028
|
_ref$handleBalanceVal = _ref.handleBalanceValidationChange,
|
|
4029
4029
|
handleBalanceValidationChange = _ref$handleBalanceVal === void 0 ? function (isValid) {} : _ref$handleBalanceVal,
|
|
4030
4030
|
disabled = _ref.disabled,
|
|
4031
|
+
locked = _ref.locked,
|
|
4031
4032
|
alertText = _ref.alertText,
|
|
4032
4033
|
predefinedValue = _ref.predefinedValue,
|
|
4033
4034
|
children = _ref.children,
|
|
@@ -4159,7 +4160,7 @@ var AmountInput = /*#__PURE__*/React.forwardRef(function (_ref, buttonForwardRef
|
|
|
4159
4160
|
return "0" + (decimalCount > 0 ? "." + "0".repeat(decimalCount) : "");
|
|
4160
4161
|
};
|
|
4161
4162
|
var handleFiatInteraction = function handleFiatInteraction() {
|
|
4162
|
-
if (disabled) return;
|
|
4163
|
+
if (disabled || locked) return;
|
|
4163
4164
|
setFiatAmountAutoFocus(true);
|
|
4164
4165
|
setInteractedWith(true);
|
|
4165
4166
|
};
|
|
@@ -4191,7 +4192,7 @@ var AmountInput = /*#__PURE__*/React.forwardRef(function (_ref, buttonForwardRef
|
|
|
4191
4192
|
// Clearing the custom focus upon disabling or enabling the form
|
|
4192
4193
|
useEffect(function () {
|
|
4193
4194
|
return setIsInFocus(false);
|
|
4194
|
-
}, [disabled]);
|
|
4195
|
+
}, [disabled, locked]);
|
|
4195
4196
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TitleBox, {
|
|
4196
4197
|
title: label,
|
|
4197
4198
|
linkText: isSendAll !== null ? isSendAll ? linkButtonActiveText : linkButtonInactiveText : null,
|
|
@@ -4215,7 +4216,7 @@ var AmountInput = /*#__PURE__*/React.forwardRef(function (_ref, buttonForwardRef
|
|
|
4215
4216
|
},
|
|
4216
4217
|
placeholder: coinAmountPlaceholder,
|
|
4217
4218
|
className: s$a["requested-amount-coin-input"],
|
|
4218
|
-
disabled: disabled,
|
|
4219
|
+
disabled: disabled || locked,
|
|
4219
4220
|
onFocus: function onFocus(e) {
|
|
4220
4221
|
return callHandlingErrors(function () {
|
|
4221
4222
|
return setIsInFocus(true);
|
|
@@ -4239,7 +4240,7 @@ var AmountInput = /*#__PURE__*/React.forwardRef(function (_ref, buttonForwardRef
|
|
|
4239
4240
|
inputMode: "decimal",
|
|
4240
4241
|
className: s$a["requested-amount-fiat-input"],
|
|
4241
4242
|
value: fiatAmountValue,
|
|
4242
|
-
disabled: disabled,
|
|
4243
|
+
disabled: disabled || locked,
|
|
4243
4244
|
onChange: function onChange(e) {
|
|
4244
4245
|
return handleChangeAmountFiat(e.target.value);
|
|
4245
4246
|
},
|
|
@@ -4500,6 +4501,21 @@ var RateSelector = function RateSelector(_ref) {
|
|
|
4500
4501
|
* @return {void}
|
|
4501
4502
|
*/
|
|
4502
4503
|
|
|
4504
|
+
/**
|
|
4505
|
+
* Handler for the confirm button click. You should implement errors handling inside it.
|
|
4506
|
+
*
|
|
4507
|
+
* @function
|
|
4508
|
+
* @name handleConfirmButtonClick
|
|
4509
|
+
* @param {function} resetButtonLoader - callback resetting the confirm button loader
|
|
4510
|
+
* @param {function} setValidationContent - Function to set the validation error message on the form.
|
|
4511
|
+
* @param {function} setBalanceValid - Function to set the balance validity, accepts a boolean.
|
|
4512
|
+
* @param {function} setMinimalAmountValid - Function to set the minimal amount validity, accepts a boolean.
|
|
4513
|
+
* @param {function} setMaximumAmountValid - Function to set the maximum amount validity, accepts a boolean.
|
|
4514
|
+
* @param {function} setIsPairSupported - Function to set the pair support status, accepts a boolean.
|
|
4515
|
+
* @param {function} setIsSameCoins - Function to set the status if the same coins are used, accepts a boolean.
|
|
4516
|
+
* @return {void}
|
|
4517
|
+
*/
|
|
4518
|
+
|
|
4503
4519
|
/**
|
|
4504
4520
|
* Async function that retrieves swap creation info by given params.
|
|
4505
4521
|
*
|
|
@@ -4567,7 +4583,7 @@ var RateSelector = function RateSelector(_ref) {
|
|
|
4567
4583
|
* @param {string} [props.receivingAssetBalance] - Balance of the receiving asset.
|
|
4568
4584
|
* @param {handleClick} props.handleChangeSendingAssetClick - Function to handle clicking on the change sending asset button.
|
|
4569
4585
|
* @param {handleClick} props.handleChangeReceivingAssetClick - Function to handle clicking on the change receiving asset button.
|
|
4570
|
-
* @param {
|
|
4586
|
+
* @param {handleConfirmButtonClick} props.handleConfirmButtonClick - Function to handle clicking on the confirm button.
|
|
4571
4587
|
* @param {composeConfirmButtonTo} props.composeConfirmButtonTo - Function to compose the URL for the confirm button.
|
|
4572
4588
|
* @param {setSwapCreationEstimation} props.setSwapCreationEstimation - Function to set the swap creation estimation.
|
|
4573
4589
|
* @param {handleUnexpectedError} props.handleUnexpectedError - Function to handle unexpected errors.
|
|
@@ -4606,7 +4622,7 @@ function _catch$c(body, recover) {
|
|
|
4606
4622
|
return result;
|
|
4607
4623
|
}
|
|
4608
4624
|
var SwapForm = function SwapForm(_ref) {
|
|
4609
|
-
var _maximumAmount$curren4, _maximumAmount$curren5, _maximumAmount$curren6, _minimalAmount$curren5;
|
|
4625
|
+
var _isFixedRate$current2, _maximumAmount$curren4, _maximumAmount$curren5, _maximumAmount$curren6, _minimalAmount$curren5, _isFixedRate$current3;
|
|
4610
4626
|
var sendingAssetTicker = _ref.sendingAssetTicker,
|
|
4611
4627
|
receivingAssetTicker = _ref.receivingAssetTicker,
|
|
4612
4628
|
_ref$sendingAssetDeci = _ref.sendingAssetDecimalCount,
|
|
@@ -4631,7 +4647,7 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4631
4647
|
handleChangeSendingAssetClick = _ref.handleChangeSendingAssetClick,
|
|
4632
4648
|
handleChangeReceivingAssetClick = _ref.handleChangeReceivingAssetClick,
|
|
4633
4649
|
_ref$handleConfirmBut = _ref.handleConfirmButtonClick,
|
|
4634
|
-
handleConfirmButtonClick = _ref$handleConfirmBut === void 0 ? function () {} : _ref$handleConfirmBut,
|
|
4650
|
+
handleConfirmButtonClick = _ref$handleConfirmBut === void 0 ? function (resetButtonLoader, setValidationContent, setBalanceValid, setMinimalAmountValid, setMaximumAmountValid, setIsPairSupported, setIsSameCoins) {} : _ref$handleConfirmBut,
|
|
4635
4651
|
_ref$composeConfirmBu = _ref.composeConfirmButtonTo,
|
|
4636
4652
|
composeConfirmButtonTo = _ref$composeConfirmBu === void 0 ? function (fromTicker, toTicker, fromAmount) {
|
|
4637
4653
|
return "";
|
|
@@ -4704,7 +4720,6 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4704
4720
|
},
|
|
4705
4721
|
addressFields: {
|
|
4706
4722
|
addressTitle: "Recepient address",
|
|
4707
|
-
addressPlaceholder: "Example: 1XPTgDRh...",
|
|
4708
4723
|
extraIdTitle: "Extra ID (optional)",
|
|
4709
4724
|
extraIdPlaceholder: "Example: ABC123",
|
|
4710
4725
|
extraIdNotice: "Please check if your recipient address requires a 'Memo' or 'Destination Tag' - sometimes called a tag, ID, label, or a note. Exchanges may require such ID for the deposit. Including this identifier is crucial when required, as omitting or misentering it can result in lost assets."
|
|
@@ -4729,10 +4744,9 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4729
4744
|
_ref$recepientAddress3 = _ref.recepientAddressExtraIdAvailable,
|
|
4730
4745
|
recepientAddressExtraIdAvailable = _ref$recepientAddress3 === void 0 ? false : _ref$recepientAddress3,
|
|
4731
4746
|
_ref$displayRateSelec = _ref.displayRateSelector,
|
|
4732
|
-
displayRateSelector = _ref$displayRateSelec === void 0 ? false : _ref$displayRateSelec
|
|
4733
|
-
_ref$dispatchRateMode = _ref.dispatchRateModeChanged,
|
|
4734
|
-
dispatchRateModeChanged = _ref$dispatchRateMode === void 0 ? function (isFixed) {} : _ref$dispatchRateMode;
|
|
4747
|
+
displayRateSelector = _ref$displayRateSelec === void 0 ? false : _ref$displayRateSelec;
|
|
4735
4748
|
var DETAIL_REFRESH_INTERVAL_MS = 1.5 * 60000;
|
|
4749
|
+
var IS_FIXED_BY_DEFAULT = false;
|
|
4736
4750
|
|
|
4737
4751
|
// Updating the states below will insert the new value into the send or receive input field
|
|
4738
4752
|
var _useState = useState(preservedAmount != null ? preservedAmount : null),
|
|
@@ -4785,30 +4799,30 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4785
4799
|
var _useState12 = useState(false),
|
|
4786
4800
|
isAddressFieldEnabled = _useState12[0],
|
|
4787
4801
|
setIsAddressFieldEnabled = _useState12[1];
|
|
4788
|
-
var _useState13 = useState(null),
|
|
4789
|
-
isFixedRate = _useState13[0],
|
|
4790
|
-
setIsFixedRate = _useState13[1];
|
|
4791
|
-
var _useState14 = useState(composeConfirmButtonTo(sendingAssetTicker, receivingAssetTicker, preservedAmount)),
|
|
4792
|
-
confirmButtonTo = _useState14[0],
|
|
4793
|
-
setConfirmButtonTo = _useState14[1];
|
|
4794
|
-
var _useState15 = useState(),
|
|
4795
|
-
transactionFee = _useState15[0],
|
|
4796
|
-
setTransactionFee = _useState15[1];
|
|
4797
|
-
var _useState16 = useState(true),
|
|
4798
|
-
balanceValid = _useState16[0],
|
|
4799
|
-
setBalanceValid = _useState16[1]; // Whether the amount is less than total balance
|
|
4800
4802
|
var _useReferredState5 = useReferredState(null),
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
var
|
|
4804
|
-
|
|
4805
|
-
|
|
4803
|
+
isFixedRate = _useReferredState5[0],
|
|
4804
|
+
setIsFixedRate = _useReferredState5[1];
|
|
4805
|
+
var _useState13 = useState(composeConfirmButtonTo(sendingAssetTicker, receivingAssetTicker, preservedAmount)),
|
|
4806
|
+
confirmButtonTo = _useState13[0],
|
|
4807
|
+
setConfirmButtonTo = _useState13[1];
|
|
4808
|
+
var _useState14 = useState(),
|
|
4809
|
+
transactionFee = _useState14[0],
|
|
4810
|
+
setTransactionFee = _useState14[1];
|
|
4811
|
+
var _useState15 = useState(true),
|
|
4812
|
+
balanceValid = _useState15[0],
|
|
4813
|
+
setBalanceValid = _useState15[1]; // Whether the amount is less than total balance
|
|
4806
4814
|
var _useReferredState6 = useReferredState(null),
|
|
4807
|
-
|
|
4808
|
-
|
|
4815
|
+
isSwapAll = _useReferredState6[0],
|
|
4816
|
+
setIsSwapAll = _useReferredState6[1];
|
|
4817
|
+
var _useState16 = useState([]),
|
|
4818
|
+
swapAllButtonLoaderReSetter = _useState16[0],
|
|
4819
|
+
setSwapAllButtonLoaderReSetter = _useState16[1];
|
|
4809
4820
|
var _useReferredState7 = useReferredState(null),
|
|
4810
|
-
|
|
4811
|
-
|
|
4821
|
+
dataUpdateTimeoutId = _useReferredState7[0],
|
|
4822
|
+
setDataUpdateTimeoutId = _useReferredState7[1];
|
|
4823
|
+
var _useReferredState8 = useReferredState(null),
|
|
4824
|
+
idleDataUpdateTimeoutId = _useReferredState8[0],
|
|
4825
|
+
setIdleDataUpdateTimeoutId = _useReferredState8[1];
|
|
4812
4826
|
var callHandlingErrors = useCallHandlingErrors();
|
|
4813
4827
|
var recalculationDelayOnTyping = 1000;
|
|
4814
4828
|
var handleSendAssetAmountChange = function handleSendAssetAmountChange(amount) {
|
|
@@ -4921,7 +4935,7 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4921
4935
|
(function () {
|
|
4922
4936
|
try {
|
|
4923
4937
|
return _catch$c(function () {
|
|
4924
|
-
var _minimalAmount$curren4, _maximumAmount$curren3;
|
|
4938
|
+
var _minimalAmount$curren4, _maximumAmount$curren3, _isFixedRate$current;
|
|
4925
4939
|
var dataMemento = {
|
|
4926
4940
|
rate: swapRate,
|
|
4927
4941
|
min: (_minimalAmount$curren4 = minimalAmount.current) == null ? void 0 : _minimalAmount$curren4.crypto,
|
|
@@ -4938,7 +4952,7 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4938
4952
|
setIsSameCoins(false);
|
|
4939
4953
|
setIsPairSupported(true);
|
|
4940
4954
|
setIsSwapCalculated(false);
|
|
4941
|
-
return Promise.resolve(retrieveSwapDetails(sendingAssetTicker, receivingAssetTicker, amount, isSwapAll.current, isFixedRate)).then(function (response) {
|
|
4955
|
+
return Promise.resolve(retrieveSwapDetails(sendingAssetTicker, receivingAssetTicker, amount, isSwapAll.current, (_isFixedRate$current = isFixedRate.current) != null ? _isFixedRate$current : IS_FIXED_BY_DEFAULT)).then(function (response) {
|
|
4942
4956
|
if (!isSwapAll.current && String(amount) !== String(isForPreserved && sendAssetAmount.current == null ? preservedAmount : sendAssetAmount.current)) {
|
|
4943
4957
|
// Means amount changed and we no more need to do this exact calculation
|
|
4944
4958
|
return;
|
|
@@ -5024,7 +5038,6 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
5024
5038
|
};
|
|
5025
5039
|
var handleRateModeChanged = function handleRateModeChanged(isFixed) {
|
|
5026
5040
|
setIsFixedRate(isFixed);
|
|
5027
|
-
dispatchRateModeChanged(isFixed);
|
|
5028
5041
|
requestDataRefresh(sendAssetAmount.current, true);
|
|
5029
5042
|
};
|
|
5030
5043
|
useEffect(function () {
|
|
@@ -5188,6 +5201,7 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
5188
5201
|
assetIconProtocolSrc: receivingAssetProtocolIconSrc,
|
|
5189
5202
|
fallbackAssetIconSrc: fallBackAssetIconSrc,
|
|
5190
5203
|
disabled: isSwapAll.current || sendingAssetTicker === null || receivingAssetTicker === null,
|
|
5204
|
+
locked: !formHasBalance,
|
|
5191
5205
|
handleCoinAmountChange: handleReceiveAssetAmountChange,
|
|
5192
5206
|
handleChangeAssetClick: handleChangeReceivingAssetClick,
|
|
5193
5207
|
updateAssetInputTo: updateReceiveInputTo,
|
|
@@ -5195,7 +5209,7 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
5195
5209
|
changeAssetButtonProtocol: receivingAssetProtocol,
|
|
5196
5210
|
showBalance: formHasBalance,
|
|
5197
5211
|
lowerFormPosition: true,
|
|
5198
|
-
estimateAmount:
|
|
5212
|
+
estimateAmount: !isFixedRate,
|
|
5199
5213
|
ref: toAssetSelectionButtonRef,
|
|
5200
5214
|
isLoading: isLoading.current,
|
|
5201
5215
|
cryptoAssetToFiatRate: receivingAssetToFiatRate,
|
|
@@ -5207,7 +5221,7 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
5207
5221
|
className: s$9["swap-form-information-field"]
|
|
5208
5222
|
}, /*#__PURE__*/React.createElement("p", null, !isPairSupported ? translations.informationBlock.pairNotAvailable : transactionFee && minimalAmountValid ? /*#__PURE__*/React.createElement(React.Fragment, null, translations.informationBlock.transactionFee, /*#__PURE__*/React.createElement("span", null, AmountUtils.crypto(transactionFee == null ? void 0 : transactionFee.crypto, sendingAssetFeeCoinTickerPrintable)), (transactionFee == null ? void 0 : transactionFee.fiat) != null && (transactionFee == null ? void 0 : transactionFee.fiat) !== "" ? /*#__PURE__*/React.createElement("span", {
|
|
5209
5223
|
className: s$9["semi-transparent"]
|
|
5210
|
-
}, " ~ " + AmountUtils.fiat(transactionFee == null ? void 0 : transactionFee.fiat, fiatCurrencyCode)) : "") : isSwapCalculated ? /*#__PURE__*/React.createElement(React.Fragment, null, translations.informationBlock.swapRate, /*#__PURE__*/React.createElement("span", null, AmountUtils.composeRateText(sendingAssetTickerPrintable, receivingAssetTickerPrintable, swapRate, receivingAssetDecimalCount, isFixedRate))) : minimalAmount.current ? !maximumAmountValid && maximumAmount.current != null ? /*#__PURE__*/React.createElement(React.Fragment, null, translations.informationBlock.maximumAmount, /*#__PURE__*/React.createElement("span", {
|
|
5224
|
+
}, " ~ " + AmountUtils.fiat(transactionFee == null ? void 0 : transactionFee.fiat, fiatCurrencyCode)) : "") : isSwapCalculated || !minimalAmount.current && swapRate ? /*#__PURE__*/React.createElement(React.Fragment, null, translations.informationBlock.swapRate, /*#__PURE__*/React.createElement("span", null, AmountUtils.composeRateText(sendingAssetTickerPrintable, receivingAssetTickerPrintable, swapRate, receivingAssetDecimalCount, (_isFixedRate$current2 = isFixedRate.current) != null ? _isFixedRate$current2 : IS_FIXED_BY_DEFAULT))) : minimalAmount.current || maximumAmount.current ? !maximumAmountValid && maximumAmount.current != null ? /*#__PURE__*/React.createElement(React.Fragment, null, translations.informationBlock.maximumAmount, /*#__PURE__*/React.createElement("span", {
|
|
5211
5225
|
className: s$9["interactable"] + " " + s$9["red"],
|
|
5212
5226
|
onClick: isLoading.current ? function () {} : function (e) {
|
|
5213
5227
|
return callHandlingErrors(handleMaximumAmountClick, e);
|
|
@@ -5232,8 +5246,7 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
5232
5246
|
},
|
|
5233
5247
|
value: recepientAddress,
|
|
5234
5248
|
adaptiveHeight: true,
|
|
5235
|
-
errorEncountered: !recepientAddressValid && recepientAddress !== ""
|
|
5236
|
-
placeholder: translations.addressFields.addressPlaceholder
|
|
5249
|
+
errorEncountered: !recepientAddressValid && recepientAddress !== ""
|
|
5237
5250
|
})), recepientAddressExtraIdAvailable ? /*#__PURE__*/React.createElement(TitleBox, {
|
|
5238
5251
|
title: translations.addressFields.extraIdTitle,
|
|
5239
5252
|
titleNoticeText: translations.addressFields.extraIdNotice,
|
|
@@ -5250,8 +5263,8 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
5250
5263
|
})) : "") : "", displayRateSelector ? /*#__PURE__*/React.createElement("div", {
|
|
5251
5264
|
className: s$9["swap-form-rate-selector"]
|
|
5252
5265
|
}, /*#__PURE__*/React.createElement(RateSelector, {
|
|
5253
|
-
isFixed: isFixedRate,
|
|
5254
|
-
setIsFixed: handleRateModeChanged,
|
|
5266
|
+
isFixed: (_isFixedRate$current3 = isFixedRate.current) != null ? _isFixedRate$current3 : IS_FIXED_BY_DEFAULT,
|
|
5267
|
+
setIsFixed: !isLoading.current ? handleRateModeChanged : function () {},
|
|
5255
5268
|
translations: translations.rateSelector
|
|
5256
5269
|
})) : "", validationContent ? /*#__PURE__*/React.createElement("div", {
|
|
5257
5270
|
className: s$9["swap-form-validation-text"]
|
|
@@ -5273,11 +5286,13 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
5273
5286
|
size: "lg",
|
|
5274
5287
|
mode: "primary",
|
|
5275
5288
|
content: translations.confirmButtonText,
|
|
5276
|
-
onClick:
|
|
5289
|
+
onClick: function onClick(resetButtonLoader) {
|
|
5290
|
+
return handleConfirmButtonClick(resetButtonLoader, setValidationContent, setBalanceValid, setMinimalAmountValid, setMaximumAmountValid, setIsPairSupported, setIsSameCoins);
|
|
5291
|
+
},
|
|
5277
5292
|
fullWidthOnMobiles: true,
|
|
5278
5293
|
isDisabled: !readyToSwap,
|
|
5279
5294
|
to: formHasBalance ? "" : confirmButtonTo,
|
|
5280
|
-
loader:
|
|
5295
|
+
loader: true,
|
|
5281
5296
|
handleError: callHandlingErrors
|
|
5282
5297
|
}))));
|
|
5283
5298
|
};
|
|
@@ -5328,7 +5343,7 @@ SwapForm.defaultProps = {
|
|
|
5328
5343
|
sendingAssetProtocolIconSrc: null,
|
|
5329
5344
|
receivingAssetProtocolIconSrc: null,
|
|
5330
5345
|
fallBackAssetIconSrc: null,
|
|
5331
|
-
handleConfirmButtonClick: function handleConfirmButtonClick() {},
|
|
5346
|
+
handleConfirmButtonClick: function handleConfirmButtonClick(resetButtonLoader, setValidationContent, setBalanceValid, setMinimalAmountValid, setMaximumAmountValid, setIsPairSupported, setIsSameCoins) {},
|
|
5332
5347
|
composeConfirmButtonTo: function composeConfirmButtonTo(fromTicker, toTicker, fromAmount) {
|
|
5333
5348
|
return "";
|
|
5334
5349
|
},
|
|
@@ -9982,10 +9997,11 @@ var SwapspaceSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
9982
9997
|
var _response$data, _exchangesSupportingT;
|
|
9983
9998
|
Logger.log("Retrieved " + (response == null || (_response$data = response.data) == null ? void 0 : _response$data.length) + " options", loggerSource);
|
|
9984
9999
|
var options = Array.isArray(response.data) ? response.data : [];
|
|
10000
|
+
// TODO: [feature, high] remove if possible over-engineering about toAmount = 0 options treating as supported but not available. task_id=404ae30d9a7743238af3cc0d3bae9239
|
|
9985
10001
|
var exchangesSupportingThePairDespiteFixedOrFloating = options.filter(function (exchange) {
|
|
9986
10002
|
return (exchange == null ? void 0 : exchange.exists) && !BANNED_PARTNERS.find(function (bannedPartner) {
|
|
9987
10003
|
return bannedPartner === (exchange == null ? void 0 : exchange.partner);
|
|
9988
|
-
}) && ((exchange == null ? void 0 : exchange.fixed) === false || (exchange == null ? void 0 : exchange.fixed) === true) &&
|
|
10004
|
+
}) && ((exchange == null ? void 0 : exchange.fixed) === false || (exchange == null ? void 0 : exchange.fixed) === true) && typeof exchange.min === "number" && typeof exchange.max === "number" && typeof exchange.toAmount === "number" && exchange.toAmount > 0 && (exchange.min === 0 || exchange.max === 0 || exchange.max > exchange.min);
|
|
9989
10005
|
});
|
|
9990
10006
|
var exchangesSupportingThePair = exchangesSupportingThePairDespiteFixedOrFloating;
|
|
9991
10007
|
if (fixed != null) {
|