@rabbitio/ui-kit 1.0.0-beta.71 → 1.0.0-beta.73
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 +12889 -8253
- package/coverage/coverage-final.json +157 -99
- package/coverage/index.html +385 -220
- 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/common → ui-kit/src/common-apis}/adapters/axiosAdapter.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/adapters/index.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/adapters/qrUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/amountUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/errorUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/external-apis/apiGroups.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/external-apis/index.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/external-apis/ipAddressProviders.js.html +5 -5
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/fiatCurrenciesService.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/constants → ui-kit/src/common-apis}/globalConstants.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/index.html +22 -7
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/models/blockchain.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/models/coin.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/models/index.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/models/protocol.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/utils/cache.js.html +8 -8
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/utils/emailAPI.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/utils/index.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/utils/logging/index.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/utils/logging/logger.js.html +6 -6
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/utils/logging/logsStorage.js.html +5 -5
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/utils/postponeExecution.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/utils/safeStringify.js.html +29 -29
- package/coverage/{rabbit-ui-kit → ui-kit}/src/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/index.js.html +68 -80
- package/coverage/{rabbit-ui-kit/src/robustExteranlApiCallerService → ui-kit/src/robust-api-caller}/cacheAndConcurrentRequestsResolver.js.html +5 -5
- package/coverage/{rabbit-ui-kit/src/robustExteranlApiCallerService → ui-kit/src/robust-api-caller}/cachedRobustExternalApiCallerService.js.html +6 -6
- package/coverage/{rabbit-ui-kit/src/robustExteranlApiCallerService → ui-kit/src/robust-api-caller}/cancelProcessing.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/robustExteranlApiCallerService → ui-kit/src/robust-api-caller}/concurrentCalculationsMetadataHolder.js.html +4 -4
- package/coverage/{rabbit-ui-kit/src/robustExteranlApiCallerService → ui-kit/src/robust-api-caller}/externalApiProvider.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/robustExteranlApiCallerService → ui-kit/src/robust-api-caller}/externalServicesStatsCollector.js.html +5 -5
- package/coverage/{rabbit-ui-kit/src/robustExteranlApiCallerService → ui-kit/src/robust-api-caller}/index.html +3 -3
- package/coverage/{rabbit-ui-kit/src/robustExteranlApiCallerService → ui-kit/src/robust-api-caller}/robustExternalAPICallerService.js.html +8 -8
- package/coverage/ui-kit/src/swaps-lib/external-apis/index.html +146 -0
- package/coverage/ui-kit/src/swaps-lib/external-apis/letsExchangeSwapProvider.js.html +1456 -0
- package/coverage/ui-kit/src/swaps-lib/external-apis/swapProvider.js.html +1390 -0
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +182 -662
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/baseSwapCreationInfo.js.html +16 -7
- 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 +9 -9
- 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 +243 -57
- 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 +127 -52
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/arrowIcon.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/arrowTosca.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/arrowWhite.jsx.html +11 -11
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/darkRectangle.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/determinedError.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/failedValidationIcon.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/index.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/infoIcon.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/noticeQuestionIcon.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/successfulValidationIcon.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/walletIcon.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/AssetIcon/AssetIcon.jsx.html +20 -17
- package/coverage/{rabbit-ui-kit/src/components/atoms/buttons/Button → ui-kit/src/ui-kit/components/atoms/AssetIcon}/index.html +8 -8
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/AssetSelection/AssetSelection.jsx.html +23 -20
- package/coverage/{rabbit-ui-kit/src/components/atoms/buttons/LinkButton → ui-kit/src/ui-kit/components/atoms/AssetSelection}/index.html +8 -8
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +10 -10
- package/coverage/ui-kit/src/ui-kit/components/atoms/BackgroundTitle/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/InformationMessage/InformationMessage.jsx.html +21 -18
- package/coverage/ui-kit/src/ui-kit/components/atoms/InformationMessage/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/Input/Input.jsx.html +38 -35
- package/coverage/{rabbit-ui-kit/src/components/atoms/buttons/Close → ui-kit/src/ui-kit/components/atoms/Input}/index.html +8 -8
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/LoadingDots/LoadingDots.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src/constants/organisms/dialog/DialogStep → ui-kit/src/ui-kit/components/atoms/LoadingDots}/index.html +8 -8
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/NoticeIcon/NoticeIcon.jsx.html +19 -22
- package/coverage/ui-kit/src/ui-kit/components/atoms/NoticeIcon/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/QrCode/QrCode.jsx.html +63 -15
- package/coverage/ui-kit/src/ui-kit/components/atoms/QrCode/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/RateSelector/RateSelector.jsx.html +16 -13
- package/coverage/ui-kit/src/ui-kit/components/atoms/RateSelector/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/SupportChat/SupportChat.jsx.html +16 -13
- package/coverage/ui-kit/src/ui-kit/components/atoms/SupportChat/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/Textarea/Textarea.jsx.html +36 -30
- package/coverage/ui-kit/src/ui-kit/components/atoms/Textarea/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/TitleBox/TitleBox.jsx.html +29 -29
- package/coverage/ui-kit/src/ui-kit/components/atoms/TitleBox/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/Tooltip/Tooltip.jsx.html +48 -21
- package/coverage/ui-kit/src/ui-kit/components/atoms/Tooltip/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/TwoLinesOfText/LinesOfText.jsx.html +29 -23
- package/coverage/ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/Validation/Validation.jsx.html +13 -13
- package/coverage/ui-kit/src/ui-kit/components/atoms/Validation/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/buttons/Button/Button.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src/components/atoms/AssetSelection → ui-kit/src/ui-kit/components/atoms/buttons/Button}/index.html +15 -15
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/buttons/Close/Close.jsx.html +30 -15
- package/coverage/{rabbit-ui-kit/src/components/atoms/BackgroundTitle → ui-kit/src/ui-kit/components/atoms/buttons/Close}/index.html +15 -15
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/buttons/LinkButton/LinkButton.jsx.html +34 -16
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/LinkButton/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +11 -11
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/molecules/AmountInput/AmountInput.jsx.html +20 -17
- package/coverage/ui-kit/src/ui-kit/components/molecules/AmountInput/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/molecules/CoinPicker/CoinPicker.jsx.html +44 -38
- package/coverage/ui-kit/src/ui-kit/components/molecules/CoinPicker/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/molecules/LineWithIconLink/LineWithIconLink.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src/components/organisms/Dialog/DialogStep → ui-kit/src/ui-kit/components/molecules/LineWithIconLink}/index.html +8 -8
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx.html +25 -19
- package/coverage/{rabbit-ui-kit/src/components/atoms/buttons/RadioButtonWithText → ui-kit/src/ui-kit/components/molecules/TitledLineWithIconLink}/index.html +8 -8
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +20 -14
- package/coverage/{rabbit-ui-kit/src/components/organisms/Dialog/DialogButtons → ui-kit/src/ui-kit/components/organisms/CoinPickerDialogStep}/index.html +8 -8
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/organisms/Dialog/Dialog.jsx.html +106 -19
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +13 -13
- package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +66 -60
- package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/organisms/SwapForm/SwapForm.jsx.html +470 -98
- package/coverage/ui-kit/src/ui-kit/components/organisms/SwapForm/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx.html +12 -12
- package/coverage/ui-kit/src/ui-kit/components/templates/DeterminedErrorDialogStep/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src/components → ui-kit/src/ui-kit}/hooks/index.html +22 -7
- package/coverage/{rabbit-ui-kit/src/components → ui-kit/src/ui-kit}/hooks/useCallHandlingErrors.js.html +4 -4
- package/coverage/ui-kit/src/ui-kit/hooks/useIsHydrated.js.html +121 -0
- package/coverage/{rabbit-ui-kit/src/components → ui-kit/src/ui-kit}/hooks/useReferredState.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/components → ui-kit/src/ui-kit}/utils/index.html +3 -3
- package/coverage/{rabbit-ui-kit/src/components → ui-kit/src/ui-kit}/utils/inputValueProviders.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/components → ui-kit/src/ui-kit}/utils/textUtils.js.html +4 -4
- package/coverage/{rabbit-ui-kit/src/components → ui-kit/src/ui-kit}/utils/uiUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/components → ui-kit/src/ui-kit}/utils/urlQueryUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/BackgroundTitle.stories.jsx.html +4 -4
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/LinesOfText.stories.jsx.html +6 -6
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/LoadingDots.stories.jsx.html +5 -5
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/QrCode.stories.jsx.html +5 -5
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/RateSelector.stories.jsx.html +4 -4
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/Validation.stories.jsx.html +4 -4
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/Button.stories.jsx.html +29 -92
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/Close.stories.jsx.html +9 -12
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/LinkButton.stories.jsx.html +15 -9
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/index.html +11 -11
- 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 +5 -5
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/TitledLineWithIconLink.stories.jsx.html +4 -4
- 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 +15 -81
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogButtons/DialogButtons.stories.jsx.html +5 -5
- 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 +6 -6
- 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 +7 -7
- 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 +9 -12
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/templates/index.html +7 -7
- 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/{rabbit-ui-kit/src/components/atoms/InformationMessage → ui-kit/storybook-static/rabbitio/ui-kit/node_modules/markdown-to-jsx/dist}/index.html +15 -15
- 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/{rabbit-ui-kit/src/components/atoms/LoadingDots → ui-kit/storybook-static/sb-addons/essentials-controls-1}/index.html +15 -15
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js.html +274 -0
- package/coverage/{rabbit-ui-kit/src/components/atoms/AssetIcon → ui-kit/storybook-static/sb-addons/essentials-measure-4}/index.html +15 -15
- 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/{rabbit-ui-kit/src/components/atoms/QrCode → ui-kit/storybook-static/sb-addons/interactions-7}/index.html +15 -15
- package/coverage/ui-kit/storybook-static/sb-addons/interactions-7/manager-bundle.js.html +121 -0
- package/coverage/{rabbit-ui-kit/src/constants/atoms/Close → ui-kit/storybook-static/sb-addons/links-0}/index.html +15 -15
- package/coverage/{rabbit-ui-kit/src/constants/atoms/LinkButton/linkButton.jsx.html → ui-kit/storybook-static/sb-addons/links-0/manager-bundle.js.html} +16 -25
- 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/{rabbit-ui-kit/src/constants/atoms/Tooltip → ui-kit/storybook-static/sb-addons/viewport-8}/index.html +15 -15
- package/coverage/ui-kit/storybook-static/sb-addons/viewport-8/manager-bundle.js.html +94 -0
- package/coverage/{rabbit-ui-kit/src/constants/atoms/Close/close.jsx.html → ui-kit/storybook-static/sb-manager/WithTooltip-V3YHNWJZ-LVYLGZW2.js.html} +14 -26
- 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/{rabbit-ui-kit/src/constants/organisms/dialog/DialogStep/dialogStep.js.html → ui-kit/storybook-static/sb-manager/index.js.html} +11 -11
- 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 +1568 -796
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +21030 -21030
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +1108 -534
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +1567 -797
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +1568 -796
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
- package/src/{common → common-apis}/external-apis/ipAddressProviders.js +2 -2
- package/src/index.js +62 -66
- package/src/{robustExteranlApiCallerService → robust-api-caller}/cacheAndConcurrentRequestsResolver.js +2 -2
- package/src/{robustExteranlApiCallerService → robust-api-caller}/cachedRobustExternalApiCallerService.js +3 -3
- package/src/{robustExteranlApiCallerService → robust-api-caller}/concurrentCalculationsMetadataHolder.js +1 -1
- package/src/{robustExteranlApiCallerService → robust-api-caller}/externalServicesStatsCollector.js +2 -2
- package/src/{robustExteranlApiCallerService → robust-api-caller}/robustExternalAPICallerService.js +5 -5
- package/src/{robustExteranlApiCallerService → robust-api-caller}/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/_performCallAttempt.test.js +2 -2
- package/src/{robustExteranlApiCallerService → robust-api-caller}/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/callExternalAPI.test.js +1 -1
- package/src/{robustExteranlApiCallerService → robust-api-caller}/tests/robustExternalAPICallerService/robustExternalAPICallerService/constructor.test.js +1 -1
- package/src/swaps-lib/external-apis/letsExchangeSwapProvider.js +457 -0
- package/src/swaps-lib/external-apis/swapProvider.js +247 -20
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +41 -201
- package/src/swaps-lib/models/baseSwapCreationInfo.js +4 -1
- package/src/swaps-lib/services/publicSwapService.js +113 -51
- package/src/swaps-lib/test/external-apis/swapProvider/removeProtocolNameFromCoinName.test.js +142 -0
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +5 -5
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/createSwap.test.js +3 -3
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getAllSupportedCurrencies.test.js +1 -1
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getDepositCurrencies.test.js +1 -1
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getSwapInfo.test.js +124 -4
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getWithdrawalCurrencies.test.js +1 -1
- package/src/swaps-lib/test/utils/swapUtils/safeHandleRequestsLimitExceeding.test.js +2 -2
- package/src/swaps-lib/utils/swapUtils.js +69 -44
- package/{styles → src/ui-kit/assets/styles}/index.scss +1 -1
- package/src/{assets → ui-kit/assets}/wrappedImages/arrowWhite.jsx +1 -1
- package/src/{components → ui-kit/components}/atoms/AssetIcon/AssetIcon.jsx +5 -4
- package/src/{components → ui-kit/components}/atoms/AssetIcon/asset-icon.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/AssetSelection/AssetSelection.jsx +8 -7
- package/src/{components → ui-kit/components}/atoms/AssetSelection/asset-selection.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/BackgroundTitle/background-title.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/InformationMessage/InformationMessage.jsx +6 -5
- package/src/{components → ui-kit/components}/atoms/InformationMessage/information-message.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/Input/Input.jsx +23 -22
- package/src/{components → ui-kit/components}/atoms/Input/input.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/LoadingDots/LoadingDots.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/NoticeIcon/NoticeIcon.jsx +6 -7
- package/src/{components → ui-kit/components}/atoms/NoticeIcon/notice-icon.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/QrCode/QrCode.jsx +18 -2
- package/src/{components → ui-kit/components}/atoms/QrCode/qr-code.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/RateSelector/RateSelector.jsx +1 -0
- package/src/{components → ui-kit/components}/atoms/RateSelector/rate-selector.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/SupportChat/SupportChat.jsx +1 -0
- package/src/{components → ui-kit/components}/atoms/Textarea/Textarea.jsx +19 -17
- package/src/{components → ui-kit/components}/atoms/Textarea/textarea.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/TitleBox/TitleBox.jsx +19 -19
- package/src/{components → ui-kit/components}/atoms/TitleBox/title-box.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/Tooltip/Tooltip.jsx +17 -8
- package/src/{components → ui-kit/components}/atoms/Tooltip/tooltip.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/TwoLinesOfText/LinesOfText.jsx +11 -9
- package/src/{components → ui-kit/components}/atoms/TwoLinesOfText/lines-of-text.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/Validation/Validation.jsx +2 -2
- package/src/{components → ui-kit/components}/atoms/Validation/validation.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/buttons/Button/Button.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/buttons/Close/Close.jsx +7 -2
- package/src/{components → ui-kit/components}/atoms/buttons/Close/close.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/buttons/LinkButton/LinkButton.jsx +9 -3
- package/src/{components → ui-kit/components}/atoms/buttons/LinkButton/link-button.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx +1 -1
- package/src/{components → ui-kit/components}/atoms/buttons/RadioButtonWithText/radio-button-with-text.module.scss +1 -1
- package/src/{components → ui-kit/components}/molecules/AmountInput/AmountInput.jsx +5 -4
- package/src/{components → ui-kit/components}/molecules/AmountInput/amount-input.module.scss +1 -1
- package/src/{components → ui-kit/components}/molecules/CoinPicker/CoinPicker.jsx +27 -25
- package/src/{components → ui-kit/components}/molecules/CoinPicker/coin-picker.module.scss +1 -1
- package/src/{components → ui-kit/components}/molecules/LineWithIconLink/line-with-icon-link.module.scss +1 -1
- package/src/{components → ui-kit/components}/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx +8 -6
- package/src/{components → ui-kit/components}/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx +3 -1
- package/src/{components → ui-kit/components}/organisms/Dialog/Dialog.jsx +35 -6
- package/src/{components → ui-kit/components}/organisms/Dialog/DialogButtons/DialogButtons.jsx +3 -3
- package/src/{components → ui-kit/components}/organisms/Dialog/DialogButtons/dialog-buttons.module.scss +1 -1
- package/src/{components → ui-kit/components}/organisms/Dialog/DialogStep/DialogStep.jsx +49 -47
- package/src/{components → ui-kit/components}/organisms/Dialog/DialogStep/dialog-step.module.scss +1 -1
- package/src/{components → ui-kit/components}/organisms/Dialog/dialog.module.scss +1 -1
- package/src/{components → ui-kit/components}/organisms/SwapForm/SwapForm.jsx +209 -85
- package/src/{components → ui-kit/components}/organisms/SwapForm/swap-form.module.scss +2 -2
- package/src/{components → ui-kit/components}/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx +2 -2
- package/src/{components → ui-kit}/hooks/useCallHandlingErrors.js +1 -1
- package/src/ui-kit/hooks/useIsHydrated.js +12 -0
- package/src/{components → ui-kit}/utils/textUtils.js +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/Input/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/atoms/NoticeIcon/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/atoms/RateSelector/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/atoms/SupportChat/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/atoms/Textarea/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/atoms/TitleBox/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/atoms/Tooltip/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/atoms/TwoLinesOfText/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/atoms/Validation/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/molecules/AmountInput/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/molecules/CoinPicker/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/molecules/LineWithIconLink/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/molecules/TitledLineWithIconLink/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/organisms/CoinPickerDialogStep/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/organisms/SwapForm/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/templates/DeterminedErrorDialogStep/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/constants/atoms/LinkButton/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/constants/atoms/Tooltip/tooltip.jsx.html +0 -109
- package/coverage/rabbit-ui-kit/src/constants/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/dialog.js.html +0 -172
- package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/index.html +0 -131
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapProvider.js.html +0 -709
- package/src/assets/image/icons/arrow-tosca.svg +0 -3
- package/src/constants/atoms/Close/close.jsx +0 -5
- package/src/constants/atoms/LinkButton/linkButton.jsx +0 -6
- package/src/constants/atoms/Tooltip/tooltip.jsx +0 -8
- package/src/constants/organisms/dialog/DialogStep/dialogStep.js +0 -1
- package/src/constants/organisms/dialog/dialog.js +0 -29
- /package/src/{common → common-apis}/adapters/axiosAdapter.js +0 -0
- /package/src/{common → common-apis}/adapters/qrUtils.js +0 -0
- /package/src/{common → common-apis}/amountUtils.js +0 -0
- /package/src/{common → common-apis}/errorUtils.js +0 -0
- /package/src/{common → common-apis}/external-apis/apiGroups.js +0 -0
- /package/src/{common → common-apis}/fiatCurrenciesService.js +0 -0
- /package/src/{constants → common-apis}/globalConstants.jsx +0 -0
- /package/src/{common → common-apis}/models/blockchain.js +0 -0
- /package/src/{common → common-apis}/models/coin.js +0 -0
- /package/src/{common → common-apis}/models/protocol.js +0 -0
- /package/src/{common → common-apis}/tests/amountUtils/composeRateText.test.js +0 -0
- /package/src/{common → common-apis}/tests/integration/external-apis/ipAddressProviders/getClientIpAddress.test.js +0 -0
- /package/src/{common → common-apis}/utils/cache.js +0 -0
- /package/src/{common → common-apis}/utils/emailAPI.js +0 -0
- /package/src/{common → common-apis}/utils/logging/logger.js +0 -0
- /package/src/{common → common-apis}/utils/logging/logsStorage.js +0 -0
- /package/src/{common → common-apis}/utils/postponeExecution.js +0 -0
- /package/src/{common → common-apis}/utils/safeStringify.js +0 -0
- /package/src/{robustExteranlApiCallerService → robust-api-caller}/cancelProcessing.js +0 -0
- /package/src/{robustExteranlApiCallerService → robust-api-caller}/externalApiProvider.js +0 -0
- /package/{styles → src/ui-kit/assets/styles}/_functions.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/_global-classes.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/_mixins.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/_placeholder.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/_variables.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/colors/_light-colors.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/colors/_solid-colors.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/fonts/NunitoSans-Bold.ttf +0 -0
- /package/{styles → src/ui-kit/assets/styles}/fonts/NunitoSans-ExtraBold.ttf +0 -0
- /package/{styles → src/ui-kit/assets/styles}/fonts/NunitoSans-Light.ttf +0 -0
- /package/{styles → src/ui-kit/assets/styles}/fonts/NunitoSans-Regular.ttf +0 -0
- /package/{styles → src/ui-kit/assets/styles}/fonts/NunitoSans-SemiBold.ttf +0 -0
- /package/{styles → src/ui-kit/assets/styles}/global-styles-index.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/size/_margin-size.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/size/_padding-size.scss +0 -0
- /package/src/{assets → ui-kit/assets}/wrappedImages/arrowIcon.jsx +0 -0
- /package/src/{assets → ui-kit/assets}/wrappedImages/arrowTosca.jsx +0 -0
- /package/src/{assets → ui-kit/assets}/wrappedImages/darkRectangle.jsx +0 -0
- /package/src/{assets → ui-kit/assets}/wrappedImages/determinedError.jsx +0 -0
- /package/src/{assets → ui-kit/assets}/wrappedImages/failedValidationIcon.jsx +0 -0
- /package/src/{assets → ui-kit/assets}/wrappedImages/infoIcon.jsx +0 -0
- /package/src/{assets → ui-kit/assets}/wrappedImages/noticeQuestionIcon.jsx +0 -0
- /package/src/{assets → ui-kit/assets}/wrappedImages/successfulValidationIcon.jsx +0 -0
- /package/src/{assets → ui-kit/assets}/wrappedImages/walletIcon.jsx +0 -0
- /package/src/{components → ui-kit/components}/atoms/BackgroundTitle/BackgroundTitle.jsx +0 -0
- /package/src/{components → ui-kit/components}/atoms/LoadingDots/LoadingDots.jsx +0 -0
- /package/src/{components → ui-kit/components}/atoms/buttons/Button/Button.jsx +0 -0
- /package/src/{components → ui-kit/components}/molecules/LineWithIconLink/LineWithIconLink.jsx +0 -0
- /package/src/{components → ui-kit}/hooks/useReferredState.js +0 -0
- /package/src/{components → ui-kit}/tests/utils/inputValueProviders/provideFormatOfFloatValueByInputString.test.js +0 -0
- /package/src/{components → ui-kit}/tests/utils/urlQueryUtils/getQueryParameterValues.test.js +0 -0
- /package/src/{components → ui-kit}/tests/utils/urlQueryUtils/saveQueryParameterAndValues.test.js +0 -0
- /package/src/{components → ui-kit}/utils/inputValueProviders.js +0 -0
- /package/src/{components → ui-kit}/utils/uiUtils.js +0 -0
- /package/src/{components → ui-kit}/utils/urlQueryUtils.js +0 -0
|
@@ -4,17 +4,18 @@ import PropTypes from "prop-types";
|
|
|
4
4
|
|
|
5
5
|
import s from "./swap-form.module.scss";
|
|
6
6
|
|
|
7
|
-
import { useReferredState } from "
|
|
8
|
-
import { useCallHandlingErrors } from "
|
|
7
|
+
import { useReferredState } from "../../../hooks/useReferredState.js";
|
|
8
|
+
import { useCallHandlingErrors } from "../../../hooks/useCallHandlingErrors.js";
|
|
9
9
|
|
|
10
|
-
import { AmountUtils } from "
|
|
10
|
+
import { AmountUtils } from "../../../../common-apis/amountUtils.js";
|
|
11
11
|
import { TitleBox } from "../../atoms/TitleBox/TitleBox.jsx";
|
|
12
12
|
import { AmountInput } from "../../molecules/AmountInput/AmountInput.jsx";
|
|
13
13
|
import { Validation } from "../../atoms/Validation/Validation.jsx";
|
|
14
14
|
import { Button } from "../../atoms/buttons/Button/Button.jsx";
|
|
15
15
|
import { Textarea } from "../../atoms/Textarea/Textarea.jsx";
|
|
16
|
-
import { TOOLTIP_POSITIONS } from "../../../constants/atoms/Tooltip/tooltip.jsx";
|
|
17
16
|
import { RateSelector } from "../../atoms/RateSelector/RateSelector.jsx";
|
|
17
|
+
import { TOOLTIP_POSITIONS } from "../../atoms/Tooltip/Tooltip.jsx";
|
|
18
|
+
import { useIsHydrated } from "../../../hooks/useIsHydrated.js";
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* This is the type definition of a function used inside SwapForm to compose the URL for the hero button.
|
|
@@ -79,17 +80,21 @@ import { RateSelector } from "../../atoms/RateSelector/RateSelector.jsx";
|
|
|
79
80
|
*/
|
|
80
81
|
|
|
81
82
|
/**
|
|
82
|
-
* Handler for the confirm button click. You should implement
|
|
83
|
+
* Handler for the confirm button click. You should implement error handling inside it.
|
|
83
84
|
*
|
|
84
85
|
* @function
|
|
85
86
|
* @name handleConfirmButtonClick
|
|
86
|
-
* @param {function} resetButtonLoader -
|
|
87
|
+
* @param {function} resetButtonLoader - Callback for resetting the confirm button loader.
|
|
87
88
|
* @param {function} setValidationContent - Function to set the validation error message on the form.
|
|
88
89
|
* @param {function} setBalanceValid - Function to set the balance validity, accepts a boolean.
|
|
89
90
|
* @param {function} setMinimalAmountValid - Function to set the minimal amount validity, accepts a boolean.
|
|
90
91
|
* @param {function} setMaximumAmountValid - Function to set the maximum amount validity, accepts a boolean.
|
|
91
92
|
* @param {function} setIsPairSupported - Function to set the pair support status, accepts a boolean.
|
|
92
93
|
* @param {function} setIsSameCoins - Function to set the status if the same coins are used, accepts a boolean.
|
|
94
|
+
* @param {string} recipientAddress - The address of the recipient.
|
|
95
|
+
* @param {string} recipientAddressExtraId - Additional identifier for the recipient address.
|
|
96
|
+
* @param {string} refundAddress - The address for refund.
|
|
97
|
+
* @param {string} refundAddressExtraId - Additional identifier for the refund address.
|
|
93
98
|
* @return {void}
|
|
94
99
|
*/
|
|
95
100
|
|
|
@@ -136,6 +141,38 @@ import { RateSelector } from "../../atoms/RateSelector/RateSelector.jsx";
|
|
|
136
141
|
* }>}
|
|
137
142
|
*/
|
|
138
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Function returning extraId name for asset if present.
|
|
146
|
+
* You must pass it if you use the form with addresses inputs.
|
|
147
|
+
*
|
|
148
|
+
* @function
|
|
149
|
+
* @name getExtraIdNameByTicker
|
|
150
|
+
* @param {string} ticker - Ticker symbol of the asset.
|
|
151
|
+
* @return {string|null}
|
|
152
|
+
*/
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Callback to handle isFixed flag change.
|
|
156
|
+
*
|
|
157
|
+
* @function
|
|
158
|
+
* @name onIsFixedChange
|
|
159
|
+
* @param {boolean} isFixedNewValue - new value
|
|
160
|
+
* @return {void}
|
|
161
|
+
*/
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Function validating addresses.
|
|
165
|
+
* By default, will treat any addresses as valid.
|
|
166
|
+
* You must pass it if you use the form with addresses inputs and want to validate addresses.
|
|
167
|
+
*
|
|
168
|
+
* @function
|
|
169
|
+
* @name validateAddressByTicker
|
|
170
|
+
* @param {string} ticker - Ticker symbol of the asset.
|
|
171
|
+
* @param {string} address - Address to be validated
|
|
172
|
+
* @param {boolean} isFixed - Is swap rate mode = fixed
|
|
173
|
+
* @return {Promise<boolean>}
|
|
174
|
+
*/
|
|
175
|
+
|
|
139
176
|
/**
|
|
140
177
|
* Swap form provides basic functionality for entering to/from amounts both in crypto and fiat, switching assets,
|
|
141
178
|
* selecting assets, showing balance for assets. It gracefully handles unavailable fiat rates and can work
|
|
@@ -180,9 +217,13 @@ import { RateSelector } from "../../atoms/RateSelector/RateSelector.jsx";
|
|
|
180
217
|
* @param {boolean} [props.formHasFiat] - Indicates if the form supports fiat currency.
|
|
181
218
|
* @param {string|null} [props.termsOfUseUrl] - Terms of use URL, shown only if both terms & privacy policy passed.
|
|
182
219
|
* @param {string|null} [props.privacyPolicyUrl] - Privacy policy of use URL, shown only if both terms & privacy policy passed.
|
|
220
|
+
* @param {string} props.recipientAddressExtraIdName - Extra ID name for the recipient address.
|
|
221
|
+
* @param {string} props.refundAddressExtraIdName - Extra ID name for the refund address.
|
|
183
222
|
* @param {object} [props.translations] - Object containing translations, default English texts will be used if omitted.
|
|
184
223
|
* @param {string} props.swapSeparatorIconSrc - Source URL for the swap separator icon.
|
|
185
224
|
* @param {boolean} props.swapButtonAlwaysActive - Setting that allows the form state to proceed to the next step regardless of validity.
|
|
225
|
+
* @param {validateAddressByTicker} [props.validateAddressByTicker] - Function validating address
|
|
226
|
+
* @param {onIsFixedChange} [props.onIsFixedChange] - callback for changed isFixed
|
|
186
227
|
* @return {JSX.Element} Rendered SwapForm component.
|
|
187
228
|
* @constructor
|
|
188
229
|
*/
|
|
@@ -212,7 +253,11 @@ export const SwapForm = ({
|
|
|
212
253
|
setMinimalAmountValid,
|
|
213
254
|
setMaximumAmountValid,
|
|
214
255
|
setIsPairSupported,
|
|
215
|
-
setIsSameCoins
|
|
256
|
+
setIsSameCoins,
|
|
257
|
+
recipientAddress,
|
|
258
|
+
recipientAddressExtraId,
|
|
259
|
+
refundAddress,
|
|
260
|
+
refundAddressExtraId
|
|
216
261
|
) => {},
|
|
217
262
|
composeConfirmButtonTo = (fromTicker, toTicker, fromAmount) => "",
|
|
218
263
|
setSwapCreationEstimation = details => {},
|
|
@@ -229,7 +274,13 @@ export const SwapForm = ({
|
|
|
229
274
|
setIsSameCoins
|
|
230
275
|
) => {},
|
|
231
276
|
formHasBalance = false,
|
|
232
|
-
retrieveSwapDetails = async (
|
|
277
|
+
retrieveSwapDetails = async (
|
|
278
|
+
sendingAssetTicker,
|
|
279
|
+
receivingAssetTicker,
|
|
280
|
+
amount,
|
|
281
|
+
isSwapAll = false,
|
|
282
|
+
editedLastInput = false
|
|
283
|
+
) => {},
|
|
233
284
|
retrieveInitialSwapData = async (sendingAssetTicker, receivingAssetTicker) => {},
|
|
234
285
|
triggerDataUpdateResetting = 0,
|
|
235
286
|
fromAssetSelectionButtonRef = null,
|
|
@@ -241,6 +292,13 @@ export const SwapForm = ({
|
|
|
241
292
|
formHasFiat = true,
|
|
242
293
|
termsOfUseUrl = null,
|
|
243
294
|
privacyPolicyUrl = null,
|
|
295
|
+
getExtraIdNameByTicker = ticker => null,
|
|
296
|
+
validateAddressByTicker = () => false,
|
|
297
|
+
swapSeparatorIconSrc,
|
|
298
|
+
swapButtonAlwaysActive = false,
|
|
299
|
+
onIsFixedChange = () => {},
|
|
300
|
+
recipientAddressExtraIdName,
|
|
301
|
+
refundAddressExtraIdName,
|
|
244
302
|
translations = {
|
|
245
303
|
swapAllButtonTitles: {
|
|
246
304
|
enable: "Swap all",
|
|
@@ -268,10 +326,14 @@ export const SwapForm = ({
|
|
|
268
326
|
},
|
|
269
327
|
addressFields: {
|
|
270
328
|
addressTitle: "Recepient address",
|
|
271
|
-
|
|
272
|
-
extraIdPlaceholder: "
|
|
273
|
-
|
|
274
|
-
|
|
329
|
+
refundAddressTitle: "Refund address",
|
|
330
|
+
extraIdPlaceholder: "(optional)",
|
|
331
|
+
refundAddressExtraIdTitle: "Refund extra ID (MEMO):",
|
|
332
|
+
refundAddressExtraIdNotice:
|
|
333
|
+
"Please check if your address requires additional identifier (sometimes called a Memo, Destination Tag, Tag, ID, Label or Note). Including this identifier is crucial when required, as omitting or misentering it can result in lost assets.",
|
|
334
|
+
receivingAddressExtraIdTitle: "Destination extra ID (MEMO):",
|
|
335
|
+
receivingAddressExtraIdNotice:
|
|
336
|
+
"Please check if your address requires additional identifier (sometimes called a Memo, Destination Tag, Tag, ID, Label or Note). Including this identifier is crucial when required, as omitting or misentering it can result in lost assets.",
|
|
275
337
|
},
|
|
276
338
|
rateSelector: {
|
|
277
339
|
floatingRate: "Floating rate",
|
|
@@ -279,21 +341,10 @@ export const SwapForm = ({
|
|
|
279
341
|
},
|
|
280
342
|
confirmButtonText: "Swap",
|
|
281
343
|
},
|
|
282
|
-
swapSeparatorIconSrc,
|
|
283
|
-
swapButtonAlwaysActive = false,
|
|
284
|
-
recepientAddress,
|
|
285
|
-
recepientAddressExtraId,
|
|
286
|
-
recepientAddressValid = true,
|
|
287
|
-
recepientAddressExtraIdValid = true,
|
|
288
|
-
setRecepientAddress,
|
|
289
|
-
setRecepientAddressExtraId,
|
|
290
|
-
recepientAddressExtraIdAvailable = false,
|
|
291
|
-
displayRateSelector = false,
|
|
292
344
|
}) => {
|
|
293
345
|
const DETAIL_REFRESH_INTERVAL_MS = 1.5 * 60000;
|
|
294
346
|
const IS_FIXED_BY_DEFAULT = false;
|
|
295
347
|
|
|
296
|
-
// Updating the states below will insert the new value into the send or receive input field
|
|
297
348
|
const [updateSendInputTo, setUpdateSendInputTo] = useState(preservedAmount ?? null);
|
|
298
349
|
const [updateReceiveInputTo, setUpdateReceiveInputTo] = useState(null);
|
|
299
350
|
|
|
@@ -312,12 +363,10 @@ export const SwapForm = ({
|
|
|
312
363
|
const [isSameCoins, setIsSameCoins] = useState(false);
|
|
313
364
|
const [isSwapCalculated, setIsSwapCalculated] = useState(false);
|
|
314
365
|
const [readyToSwap, setReadyToSwap] = useState(false); // Basically a param that enables/disables the "Next" button
|
|
315
|
-
// TODO: [refactoring, moderate] instead of handling preservedAmount at a lot of cases below, just
|
|
316
|
-
// write single useEffect setting sendAssetAmount to the=is passed value and simplify the logic below. task_id=6453251e49b04c5e88a3cc771479ffb5
|
|
317
366
|
const [isAmountZero, setIsAmountZero] = useState(preservedAmount == null || String(preservedAmount) === "0");
|
|
318
367
|
const [isLoading, setIsLoading] = useReferredState(false); // Whether the form is in the progress of loading some data (new rates, for example)
|
|
319
|
-
const [isAddressFieldEnabled, setIsAddressFieldEnabled] = useState(false);
|
|
320
368
|
const [isFixedRate, setIsFixedRate] = useReferredState(null);
|
|
369
|
+
const [isLastEditedReceiving, setIsLastEditedReceiving] = useState(false);
|
|
321
370
|
|
|
322
371
|
const [confirmButtonTo, setConfirmButtonTo] = useState(
|
|
323
372
|
composeConfirmButtonTo(sendingAssetTicker, receivingAssetTicker, preservedAmount)
|
|
@@ -331,11 +380,24 @@ export const SwapForm = ({
|
|
|
331
380
|
const [dataUpdateTimeoutId, setDataUpdateTimeoutId] = useReferredState(null);
|
|
332
381
|
const [idleDataUpdateTimeoutId, setIdleDataUpdateTimeoutId] = useReferredState(null);
|
|
333
382
|
|
|
383
|
+
const [recipientAddress, setRecipientAddress] = useReferredState("");
|
|
384
|
+
const [recipientAddressExtraId, setRecipientAddressExtraId] = useReferredState("");
|
|
385
|
+
const [isRecipientAddressValid, setIsRecipientAddressValid] = useReferredState(false);
|
|
386
|
+
const [isRefundAddressRequired, setIsRefundAddressRequired] = useState(false);
|
|
387
|
+
const [refundAddress, setRefundAddress] = useReferredState("");
|
|
388
|
+
const [refundAddressExtraId, setRefundAddressExtraId] = useReferredState("");
|
|
389
|
+
const [isRefundAddressValid, setIsRefundAddressValid] = useReferredState(false);
|
|
390
|
+
|
|
334
391
|
const callHandlingErrors = useCallHandlingErrors();
|
|
392
|
+
const isHydrated = useIsHydrated();
|
|
335
393
|
|
|
336
394
|
const recalculationDelayOnTyping = 1000;
|
|
337
395
|
|
|
396
|
+
const isAddressFieldEnabled = !formHasBalance;
|
|
397
|
+
const displayRateSelector = !formHasBalance;
|
|
398
|
+
|
|
338
399
|
const handleSendAssetAmountChange = amount => {
|
|
400
|
+
setIsLastEditedReceiving(false);
|
|
339
401
|
if (amount != null && amount !== "") {
|
|
340
402
|
setUpdateReceiveInputTo(AmountUtils.trim(BigNumber(amount).times(swapRate), receivingAssetDecimalCount));
|
|
341
403
|
} else {
|
|
@@ -345,6 +407,7 @@ export const SwapForm = ({
|
|
|
345
407
|
};
|
|
346
408
|
|
|
347
409
|
const handleReceiveAssetAmountChange = amount => {
|
|
410
|
+
setIsLastEditedReceiving(true);
|
|
348
411
|
let sendAssetAmount = "";
|
|
349
412
|
if (amount != null && amount !== "") {
|
|
350
413
|
sendAssetAmount = AmountUtils.trim(BigNumber(amount).div(swapRate), sendingAssetDecimalCount);
|
|
@@ -463,7 +526,8 @@ export const SwapForm = ({
|
|
|
463
526
|
receivingAssetTicker,
|
|
464
527
|
amount,
|
|
465
528
|
isSwapAll.current,
|
|
466
|
-
isFixedRate.current ?? IS_FIXED_BY_DEFAULT
|
|
529
|
+
isFixedRate.current ?? IS_FIXED_BY_DEFAULT,
|
|
530
|
+
isFixedRate.current ? isLastEditedReceiving : false
|
|
467
531
|
);
|
|
468
532
|
|
|
469
533
|
if (
|
|
@@ -491,6 +555,7 @@ export const SwapForm = ({
|
|
|
491
555
|
|
|
492
556
|
setAmountLimitsAndRate(swapCreationInfo);
|
|
493
557
|
setSwapCreationEstimation(swapCreationInfo);
|
|
558
|
+
setIsRefundAddressRequired(swapCreationInfo?.isRefundAddressRequired);
|
|
494
559
|
processMinMaxAmounts(isSwapAll.current ? swapCreationInfo.fromAmountCoins : amount);
|
|
495
560
|
setIsSwapCalculated(true);
|
|
496
561
|
} else {
|
|
@@ -587,6 +652,11 @@ export const SwapForm = ({
|
|
|
587
652
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
588
653
|
}, [isSwapAll.current]);
|
|
589
654
|
|
|
655
|
+
useEffect(() => {
|
|
656
|
+
onIsFixedChange(isFixedRate.current);
|
|
657
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
658
|
+
}, [isFixedRate.current]);
|
|
659
|
+
|
|
590
660
|
useEffect(() => {
|
|
591
661
|
setConfirmButtonTo(
|
|
592
662
|
composeConfirmButtonTo(
|
|
@@ -630,9 +700,9 @@ export const SwapForm = ({
|
|
|
630
700
|
isSwapCalculated &&
|
|
631
701
|
(!isSameCoins || !formHasBalance) &&
|
|
632
702
|
isPairSupported &&
|
|
633
|
-
(!isAddressFieldEnabled ||
|
|
703
|
+
(!isAddressFieldEnabled || isRecipientAddressValid.current) &&
|
|
704
|
+
(!isRefundAddressRequired || isRefundAddressValid.current))
|
|
634
705
|
);
|
|
635
|
-
|
|
636
706
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
637
707
|
}, [
|
|
638
708
|
balanceValid,
|
|
@@ -643,9 +713,49 @@ export const SwapForm = ({
|
|
|
643
713
|
isSameCoins,
|
|
644
714
|
isPairSupported,
|
|
645
715
|
isAddressFieldEnabled,
|
|
646
|
-
|
|
716
|
+
isRecipientAddressValid.current,
|
|
717
|
+
isRefundAddressRequired,
|
|
718
|
+
isRefundAddressValid.current,
|
|
647
719
|
]);
|
|
648
720
|
|
|
721
|
+
useEffect(() => {
|
|
722
|
+
setIsRecipientAddressValid(false);
|
|
723
|
+
setRecipientAddress("");
|
|
724
|
+
setRecipientAddressExtraId("");
|
|
725
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
726
|
+
}, [receivingAssetTicker]);
|
|
727
|
+
|
|
728
|
+
useEffect(() => {
|
|
729
|
+
setIsRefundAddressValid(false);
|
|
730
|
+
setRefundAddress("");
|
|
731
|
+
setRefundAddressExtraId("");
|
|
732
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
733
|
+
}, [sendingAssetTicker]);
|
|
734
|
+
|
|
735
|
+
useEffect(() => {
|
|
736
|
+
(async () => {
|
|
737
|
+
if (!receivingAssetTicker) return;
|
|
738
|
+
setIsRecipientAddressValid(
|
|
739
|
+
recipientAddress.current === ""
|
|
740
|
+
? false
|
|
741
|
+
: await validateAddressByTicker(receivingAssetTicker, recipientAddress.current, isFixedRate.current)
|
|
742
|
+
);
|
|
743
|
+
})();
|
|
744
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
745
|
+
}, [recipientAddress.current, recipientAddressExtraId.current, receivingAssetTicker]);
|
|
746
|
+
|
|
747
|
+
useEffect(() => {
|
|
748
|
+
(async () => {
|
|
749
|
+
if (!sendingAssetTicker || !isRefundAddressRequired) return;
|
|
750
|
+
setIsRefundAddressValid(
|
|
751
|
+
refundAddress.current === ""
|
|
752
|
+
? false
|
|
753
|
+
: await validateAddressByTicker(sendingAssetTicker, refundAddress.current, isFixedRate.current)
|
|
754
|
+
);
|
|
755
|
+
})();
|
|
756
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
757
|
+
}, [refundAddress.current, refundAddressExtraId.current, sendingAssetTicker, isRefundAddressRequired]);
|
|
758
|
+
|
|
649
759
|
useEffect(() => {
|
|
650
760
|
// Here we set up auto recalculations for the swap details if the form is ready to swap but is idle for some time
|
|
651
761
|
let timeoutId = null;
|
|
@@ -665,7 +775,6 @@ export const SwapForm = ({
|
|
|
665
775
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
666
776
|
}, [readyToSwap]);
|
|
667
777
|
|
|
668
|
-
// TODO: [refactoring, critical] this code looks like a hack related to task_id=6e328d39063142b7b9fa01d497e616da
|
|
669
778
|
useEffect(() => {
|
|
670
779
|
if (triggerDataUpdateResetting) {
|
|
671
780
|
clearTimeout(dataUpdateTimeoutId.current);
|
|
@@ -677,7 +786,6 @@ export const SwapForm = ({
|
|
|
677
786
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
678
787
|
}, [triggerDataUpdateResetting]);
|
|
679
788
|
|
|
680
|
-
// Resets the passed "set value to" param to null, so it can be used multiple times with any value
|
|
681
789
|
useEffect(() => {
|
|
682
790
|
if (!!updateSendInputTo) setUpdateSendInputTo(null);
|
|
683
791
|
if (!!updateReceiveInputTo) setUpdateReceiveInputTo(null);
|
|
@@ -701,7 +809,6 @@ export const SwapForm = ({
|
|
|
701
809
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
702
810
|
}, [isLoading.current, swapAllButtonLoaderReSetter]);
|
|
703
811
|
|
|
704
|
-
// Handlers upon changing the asset amount
|
|
705
812
|
useEffect(() => {
|
|
706
813
|
setConfirmButtonTo(composeConfirmButtonTo(sendingAssetTicker, receivingAssetTicker, sendAssetAmount.current));
|
|
707
814
|
|
|
@@ -714,27 +821,6 @@ export const SwapForm = ({
|
|
|
714
821
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
715
822
|
}, [sendAssetAmount.current]);
|
|
716
823
|
|
|
717
|
-
// Checking if all necessary props for address input are passed properly.
|
|
718
|
-
useEffect(() => {
|
|
719
|
-
setIsAddressFieldEnabled(
|
|
720
|
-
recepientAddress !== undefined &&
|
|
721
|
-
recepientAddressExtraId !== undefined &&
|
|
722
|
-
recepientAddressValid !== undefined &&
|
|
723
|
-
setRecepientAddress !== undefined &&
|
|
724
|
-
typeof setRecepientAddress === "function" &&
|
|
725
|
-
setRecepientAddressExtraId !== undefined &&
|
|
726
|
-
typeof setRecepientAddressExtraId === "function"
|
|
727
|
-
);
|
|
728
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
729
|
-
}, [
|
|
730
|
-
recepientAddress,
|
|
731
|
-
recepientAddressExtraId,
|
|
732
|
-
recepientAddressValid,
|
|
733
|
-
recepientAddressExtraIdValid,
|
|
734
|
-
setRecepientAddress,
|
|
735
|
-
setRecepientAddressExtraId,
|
|
736
|
-
]);
|
|
737
|
-
|
|
738
824
|
return (
|
|
739
825
|
<div className={s["swap-form"]}>
|
|
740
826
|
<TitleBox
|
|
@@ -757,6 +843,18 @@ export const SwapForm = ({
|
|
|
757
843
|
BigNumber(sendingAssetBalance?.assetAmount).eq(0)
|
|
758
844
|
}
|
|
759
845
|
>
|
|
846
|
+
{displayRateSelector ? (
|
|
847
|
+
<div className={s["swap-form-rate-selector"]}>
|
|
848
|
+
<RateSelector
|
|
849
|
+
isFixed={isFixedRate.current ?? IS_FIXED_BY_DEFAULT}
|
|
850
|
+
setIsFixed={handleRateModeChanged}
|
|
851
|
+
translations={translations.rateSelector}
|
|
852
|
+
/>
|
|
853
|
+
</div>
|
|
854
|
+
) : (
|
|
855
|
+
""
|
|
856
|
+
)}
|
|
857
|
+
|
|
760
858
|
<div className={s["swap-form-inputs"]}>
|
|
761
859
|
<AmountInput
|
|
762
860
|
ticker={sendingAssetTicker}
|
|
@@ -810,7 +908,7 @@ export const SwapForm = ({
|
|
|
810
908
|
assetIconProtocolSrc={receivingAssetProtocolIconSrc}
|
|
811
909
|
fallbackAssetIconSrc={fallBackAssetIconSrc}
|
|
812
910
|
disabled={isSwapAll.current || sendingAssetTicker === null || receivingAssetTicker === null}
|
|
813
|
-
locked={!formHasBalance}
|
|
911
|
+
locked={!formHasBalance && !isFixedRate.current}
|
|
814
912
|
handleCoinAmountChange={handleReceiveAssetAmountChange}
|
|
815
913
|
handleChangeAssetClick={handleChangeReceivingAssetClick}
|
|
816
914
|
updateAssetInputTo={updateReceiveInputTo}
|
|
@@ -829,7 +927,6 @@ export const SwapForm = ({
|
|
|
829
927
|
/>
|
|
830
928
|
</div>
|
|
831
929
|
<div className={s["swap-form-information-field"]}>
|
|
832
|
-
{/* TODO: [refactoring, moderate] Add flags calculation for each message to avoid this ugly cumbersome implicit unclear logic of message displaying. task_id=8bc31dbcd94d46a598346e8bfb505971 */}
|
|
833
930
|
<p>
|
|
834
931
|
{!isPairSupported ? (
|
|
835
932
|
translations.informationBlock.pairNotAvailable
|
|
@@ -925,46 +1022,57 @@ export const SwapForm = ({
|
|
|
925
1022
|
<TitleBox title={translations.addressFields.addressTitle}>
|
|
926
1023
|
<Textarea
|
|
927
1024
|
type={"text"}
|
|
928
|
-
onChange={e =>
|
|
929
|
-
value={
|
|
1025
|
+
onChange={e => setRecipientAddress(e.target.value)}
|
|
1026
|
+
value={recipientAddress.current}
|
|
930
1027
|
adaptiveHeight={true}
|
|
931
|
-
errorEncountered={
|
|
1028
|
+
errorEncountered={recipientAddress.current !== "" && !isRecipientAddressValid.current}
|
|
932
1029
|
/>
|
|
933
1030
|
</TitleBox>
|
|
934
|
-
{
|
|
1031
|
+
{isHydrated && recipientAddressExtraIdName ? (
|
|
935
1032
|
<TitleBox
|
|
936
|
-
title={translations.addressFields.
|
|
937
|
-
titleNoticeText={translations.addressFields.
|
|
1033
|
+
title={translations.addressFields.receivingAddressExtraIdTitle}
|
|
1034
|
+
titleNoticeText={translations.addressFields.receivingAddressExtraIdNotice}
|
|
938
1035
|
titleNoticePosition={TOOLTIP_POSITIONS.TOP_LEFT}
|
|
939
1036
|
>
|
|
940
1037
|
<Textarea
|
|
941
1038
|
type={"text"}
|
|
942
|
-
onChange={e =>
|
|
943
|
-
value={
|
|
1039
|
+
onChange={e => setRecipientAddressExtraId(e.target.value)}
|
|
1040
|
+
value={recipientAddressExtraId.current}
|
|
944
1041
|
adaptiveHeight={true}
|
|
945
|
-
errorEncountered={!recepientAddressExtraIdValid}
|
|
946
1042
|
placeholder={translations.addressFields.extraIdPlaceholder}
|
|
947
1043
|
/>
|
|
948
1044
|
</TitleBox>
|
|
949
|
-
) :
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
1045
|
+
) : null}
|
|
1046
|
+
{isHydrated && isRefundAddressRequired ? (
|
|
1047
|
+
<>
|
|
1048
|
+
<TitleBox title={translations.addressFields.refundAddressTitle}>
|
|
1049
|
+
<Textarea
|
|
1050
|
+
type={"text"}
|
|
1051
|
+
onChange={e => setRefundAddress(e.target.value)}
|
|
1052
|
+
value={refundAddress.current}
|
|
1053
|
+
adaptiveHeight={true}
|
|
1054
|
+
errorEncountered={refundAddress.current !== "" && !isRefundAddressValid.current}
|
|
1055
|
+
/>
|
|
1056
|
+
</TitleBox>
|
|
1057
|
+
{refundAddressExtraIdName ? (
|
|
1058
|
+
<TitleBox
|
|
1059
|
+
title={translations.addressFields.refundAddressExtraIdTitle}
|
|
1060
|
+
titleNoticeText={translations.addressFields.refundAddressExtraIdNotice}
|
|
1061
|
+
titleNoticePosition={TOOLTIP_POSITIONS.TOP_LEFT}
|
|
1062
|
+
>
|
|
1063
|
+
<Textarea
|
|
1064
|
+
type={"text"}
|
|
1065
|
+
onChange={e => setRefundAddressExtraId(e.target.value)}
|
|
1066
|
+
value={refundAddressExtraId.current}
|
|
1067
|
+
adaptiveHeight={true}
|
|
1068
|
+
placeholder={translations.addressFields.extraIdPlaceholder}
|
|
1069
|
+
/>
|
|
1070
|
+
</TitleBox>
|
|
1071
|
+
) : null}
|
|
1072
|
+
</>
|
|
1073
|
+
) : null}
|
|
964
1074
|
</div>
|
|
965
|
-
) :
|
|
966
|
-
""
|
|
967
|
-
)}
|
|
1075
|
+
) : null}
|
|
968
1076
|
|
|
969
1077
|
{validationContent ? (
|
|
970
1078
|
<div className={s["swap-form-validation-text"]}>
|
|
@@ -1007,7 +1115,11 @@ export const SwapForm = ({
|
|
|
1007
1115
|
setMinimalAmountValid,
|
|
1008
1116
|
setMaximumAmountValid,
|
|
1009
1117
|
setIsPairSupported,
|
|
1010
|
-
setIsSameCoins
|
|
1118
|
+
setIsSameCoins,
|
|
1119
|
+
recipientAddress.current,
|
|
1120
|
+
recipientAddressExtraId.current,
|
|
1121
|
+
refundAddress.current,
|
|
1122
|
+
refundAddressExtraId.current
|
|
1011
1123
|
)
|
|
1012
1124
|
}
|
|
1013
1125
|
fullWidthOnMobiles
|
|
@@ -1059,7 +1171,12 @@ SwapForm.propTypes = {
|
|
|
1059
1171
|
fiatCurrencyCode: PropTypes.oneOfType([PropTypes.string, null]),
|
|
1060
1172
|
fiatCurrencyDecimals: PropTypes.oneOfType([PropTypes.number, null]),
|
|
1061
1173
|
formHasFiat: PropTypes.bool,
|
|
1174
|
+
termsOfUseUrl: PropTypes.oneOfType([PropTypes.string, null]),
|
|
1175
|
+
privacyPolicyUrl: PropTypes.oneOfType([PropTypes.string, null]),
|
|
1176
|
+
recipientAddressExtraIdName: PropTypes.string,
|
|
1177
|
+
refundAddressExtraIdName: PropTypes.string,
|
|
1062
1178
|
translations: PropTypes.object,
|
|
1179
|
+
validateAddressByTicker: PropTypes.func,
|
|
1063
1180
|
swapSeparatorIconSrc: PropTypes.string.isRequired,
|
|
1064
1181
|
swapButtonAlwaysActive: PropTypes.bool,
|
|
1065
1182
|
};
|
|
@@ -1077,7 +1194,11 @@ SwapForm.defaultProps = {
|
|
|
1077
1194
|
setMinimalAmountValid,
|
|
1078
1195
|
setMaximumAmountValid,
|
|
1079
1196
|
setIsPairSupported,
|
|
1080
|
-
setIsSameCoins
|
|
1197
|
+
setIsSameCoins,
|
|
1198
|
+
recipientAddress,
|
|
1199
|
+
recipientAddressExtraId,
|
|
1200
|
+
refundAddress,
|
|
1201
|
+
refundAddressExtraId
|
|
1081
1202
|
) => {},
|
|
1082
1203
|
composeConfirmButtonTo: (fromTicker, toTicker, fromAmount) => "",
|
|
1083
1204
|
setSwapCreationEstimation: details => {},
|
|
@@ -1103,5 +1224,8 @@ SwapForm.defaultProps = {
|
|
|
1103
1224
|
fiatCurrencyCode: null,
|
|
1104
1225
|
fiatCurrencyDecimals: null,
|
|
1105
1226
|
formHasFiat: true,
|
|
1227
|
+
termsOfUseUrl: null,
|
|
1228
|
+
privacyPolicyUrl: null,
|
|
1229
|
+
validateAddressByTicker: ticker => false,
|
|
1106
1230
|
swapButtonAlwaysActive: false,
|
|
1107
1231
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import "
|
|
1
|
+
@import "../../../assets/styles/index";
|
|
2
2
|
|
|
3
3
|
.swap-form {
|
|
4
4
|
width: 100%;
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
&-rate-selector {
|
|
94
|
-
margin-
|
|
94
|
+
margin-bottom: Margin("5");
|
|
95
95
|
display: block;
|
|
96
96
|
width: 100%;
|
|
97
97
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
|
|
4
|
-
import { DialogStep } from "../../organisms/Dialog/DialogStep/DialogStep";
|
|
4
|
+
import { DialogStep } from "../../organisms/Dialog/DialogStep/DialogStep.jsx";
|
|
5
5
|
|
|
6
|
-
import determinedErrorImage from "../../../assets/wrappedImages/determinedError";
|
|
6
|
+
import determinedErrorImage from "../../../assets/wrappedImages/determinedError.jsx";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Template dialog step to display an error through the title and subtitle.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useState, useEffect } from "react";
|
|
2
|
+
|
|
3
|
+
// Custom hook to check if the component is hydrated
|
|
4
|
+
export function useIsHydrated() {
|
|
5
|
+
const [isHydrated, setIsHydrated] = useState(false);
|
|
6
|
+
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
setIsHydrated(true);
|
|
9
|
+
}, []);
|
|
10
|
+
|
|
11
|
+
return isHydrated;
|
|
12
|
+
}
|