@rabbitio/ui-kit 1.0.0-beta.73 → 1.0.0-beta.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.husky/commit-msg +5 -0
- package/coverage/clover.xml +713 -4535
- package/coverage/coverage-final.json +96 -157
- package/coverage/index.html +73 -328
- package/coverage/{ui-kit → rabbit-ui-kit}/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/index.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/adapters/axiosAdapter.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/adapters/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/adapters/qrUtils.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/amountUtils.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/errorUtils.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/external-apis/apiGroups.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/external-apis/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/external-apis/ipAddressProviders.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/fiatCurrenciesService.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/globalConstants.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/models/blockchain.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/models/coin.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/models/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/models/protocol.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/utils/cache.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/utils/emailAPI.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/utils/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/utils/logging/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/utils/logging/logger.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/utils/logging/logsStorage.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/utils/postponeExecution.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/common-apis/utils/safeStringify.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/index.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/robust-api-caller/cacheAndConcurrentRequestsResolver.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/robust-api-caller/cachedRobustExternalApiCallerService.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/robust-api-caller/cancelProcessing.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/robust-api-caller/concurrentCalculationsMetadataHolder.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/robust-api-caller/externalApiProvider.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/robust-api-caller/externalServicesStatsCollector.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/robust-api-caller/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/robust-api-caller/robustExternalAPICallerService.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/external-apis/index.html +25 -25
- package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/external-apis/letsExchangeSwapProvider.js.html +82 -25
- package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/external-apis/swapProvider.js.html +159 -12
- package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +27 -9
- package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/models/baseSwapCreationInfo.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/models/existingSwap.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/models/existingSwapWithFiatData.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/models/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/services/index.html +7 -7
- package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/services/publicSwapService.js.html +28 -13
- package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/utils/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/swaps-lib/utils/swapUtils.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/arrowIcon.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/arrowTosca.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/arrowWhite.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/darkRectangle.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/determinedError.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/failedValidationIcon.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/infoIcon.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/noticeQuestionIcon.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/assets/wrappedImages/walletIcon.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/AssetIcon/AssetIcon.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/AssetIcon/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/AssetSelection/AssetSelection.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/AssetSelection/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/BackgroundTitle/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/InformationMessage/InformationMessage.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/InformationMessage/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/Input/Input.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/Input/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/LoadingDots/LoadingDots.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/LoadingDots/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/NoticeIcon/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/QrCode/QrCode.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/QrCode/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/RateSelector/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/SupportChat/SupportChat.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/SupportChat/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/Textarea/Textarea.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/Textarea/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/TitleBox/TitleBox.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/TitleBox/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/Tooltip/Tooltip.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/Tooltip/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/TwoLinesOfText/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/Validation/Validation.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/Validation/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/buttons/Button/Button.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/buttons/Button/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/buttons/Close/Close.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/buttons/Close/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/buttons/LinkButton/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/atoms/buttons/RadioButtonWithText/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/molecules/AmountInput/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/molecules/CoinPicker/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/molecules/LineWithIconLink/LineWithIconLink.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/molecules/LineWithIconLink/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/molecules/TitledLineWithIconLink/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/CoinPickerDialogStep/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/Dialog/Dialog.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/Dialog/DialogButtons/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/Dialog/DialogStep/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/Dialog/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx.html +99 -24
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/organisms/SwapForm/index.html +7 -7
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/components/templates/DeterminedErrorDialogStep/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/hooks/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/hooks/useCallHandlingErrors.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/hooks/useIsHydrated.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/hooks/useReferredState.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/utils/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/utils/inputValueProviders.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/utils/textUtils.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/utils/uiUtils.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/src/ui-kit/utils/urlQueryUtils.js.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/BackgroundTitle.stories.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/LinesOfText.stories.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/LoadingDots.stories.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/QrCode.stories.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/RateSelector.stories.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/Validation.stories.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/buttons/Button.stories.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/buttons/Close.stories.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/buttons/LinkButton.stories.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/buttons/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/atoms/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/molecules/LineWithIconLink.stories.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/molecules/TitledLineWithIconLink.stories.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/molecules/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/organisms/Dialog/Dialog.stories.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/organisms/Dialog/DialogButtons/DialogButtons.stories.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/organisms/Dialog/DialogButtons/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/organisms/Dialog/DialogStep/DialogStep.stories.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/organisms/Dialog/DialogStep/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/organisms/Dialog/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/stubs/exampleContent.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/stubs/index.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/templates/DeterminedErrorDialogStep.stories.jsx.html +3 -3
- package/coverage/{ui-kit → rabbit-ui-kit}/stories/templates/index.html +3 -3
- package/dist/index.cjs +139 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +99 -51
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +139 -86
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +139 -86
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/swaps-lib/external-apis/letsExchangeSwapProvider.js +38 -19
- package/src/swaps-lib/external-apis/swapProvider.js +50 -1
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +7 -1
- package/src/swaps-lib/services/publicSwapService.js +12 -7
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +1 -1
- package/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx +43 -18
- package/coverage/ui-kit/storybook-static/124.c2d01e5e.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/138.56b7edc4.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/312.6f62bbd9.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/341.57a15f57.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/370.73bb343e.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/595.2e40d981.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/607.3ea32459.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/609.8c79ec77.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/666.09fdc1d7.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/797.c87cdf19.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/822.4bc0ebce.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/833.08e3ebb6.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/862.bf6bfe62.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/87.0a1bfeb1.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/893.4b09f929.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/996.846a677b.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/atoms-BackgroundTitle-stories.1a5386a1.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/atoms-LinesOfText-stories.7043a48b.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/atoms-LoadingDots-stories.091245c7.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/atoms-QrCode-stories.e10363b6.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/atoms-RateSelector-stories.af208e9a.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/atoms-Validation-stories.d561b311.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/atoms-buttons-Button-stories.e8e6b930.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/atoms-buttons-Close-stories.0a902a7c.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/atoms-buttons-LinkButton-stories.ca93ab6b.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/index.html +0 -596
- package/coverage/ui-kit/storybook-static/main.41f410f2.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/molecules-LineWithIconLink-stories.9721a18c.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/molecules-TitledLineWithIconLink-stories.1383fe3f.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/organisms-Dialog-Dialog-stories.4e6da717.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/organisms-Dialog-DialogButtons-DialogButtons-stories.6f45ae6e.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/organisms-Dialog-DialogStep-DialogStep-stories.74896048.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/addon-backgrounds/dist/index.html +0 -116
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/addon-backgrounds/dist/preview.js.html +0 -118
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/components/dist/formatter-SWP5E3XI.mjs.html +0 -118
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/components/dist/index.html +0 -116
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/buffer/index.html +0 -116
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/buffer/index.js.html +0 -118
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/markdown-to-jsx/dist/index.html +0 -116
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/markdown-to-jsx/dist/index.modern.js.html +0 -118
- package/coverage/ui-kit/storybook-static/runtime~main.ad918f38.iframe.bundle.js.html +0 -85
- package/coverage/ui-kit/storybook-static/sb-addons/actions-9/index.html +0 -116
- package/coverage/ui-kit/storybook-static/sb-addons/actions-9/manager-bundle.js.html +0 -94
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-backgrounds-2/index.html +0 -116
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-backgrounds-2/manager-bundle.js.html +0 -121
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-controls-1/index.html +0 -116
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js.html +0 -274
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-measure-4/index.html +0 -116
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-measure-4/manager-bundle.js.html +0 -94
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-outline-5/index.html +0 -116
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-outline-5/manager-bundle.js.html +0 -94
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-toolbars-3/index.html +0 -116
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-toolbars-3/manager-bundle.js.html +0 -94
- package/coverage/ui-kit/storybook-static/sb-addons/interactions-7/index.html +0 -116
- package/coverage/ui-kit/storybook-static/sb-addons/interactions-7/manager-bundle.js.html +0 -121
- package/coverage/ui-kit/storybook-static/sb-addons/links-0/index.html +0 -116
- package/coverage/ui-kit/storybook-static/sb-addons/links-0/manager-bundle.js.html +0 -94
- package/coverage/ui-kit/storybook-static/sb-addons/onboarding-6/index.html +0 -116
- package/coverage/ui-kit/storybook-static/sb-addons/onboarding-6/manager-bundle.js.html +0 -1588
- package/coverage/ui-kit/storybook-static/sb-addons/viewport-8/index.html +0 -116
- package/coverage/ui-kit/storybook-static/sb-addons/viewport-8/manager-bundle.js.html +0 -94
- package/coverage/ui-kit/storybook-static/sb-manager/WithTooltip-V3YHNWJZ-LVYLGZW2.js.html +0 -88
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-2IXBUOFS.js.html +0 -106
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-INSKDKQB.js.html +0 -1129
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-NGTUFCUO.js.html +0 -112
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-UUEAOBSN.js.html +0 -1303
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-ZEU7PDD3.js.html +0 -88
- package/coverage/ui-kit/storybook-static/sb-manager/formatter-SWP5E3XI-7BGIK6BL.js.html +0 -553
- package/coverage/ui-kit/storybook-static/sb-manager/globals-module-info.js.html +0 -88
- package/coverage/ui-kit/storybook-static/sb-manager/globals.js.html +0 -88
- package/coverage/ui-kit/storybook-static/sb-manager/index.html +0 -281
- package/coverage/ui-kit/storybook-static/sb-manager/index.js.html +0 -88
- package/coverage/ui-kit/storybook-static/sb-manager/runtime.js.html +0 -88
- package/coverage/ui-kit/storybook-static/sb-manager/syntaxhighlighter-V7JZZA35-DXZCI2WR.js.html +0 -88
- package/coverage/ui-kit/storybook-static/sb-preview/globals.js.html +0 -88
- package/coverage/ui-kit/storybook-static/sb-preview/index.html +0 -131
- package/coverage/ui-kit/storybook-static/sb-preview/runtime.js.html +0 -421
- package/coverage/ui-kit/storybook-static/templates-DeterminedErrorDialogStep-stories.3cc14214.iframe.bundle.js.html +0 -85
package/dist/index.modern.js
CHANGED
|
@@ -4225,7 +4225,7 @@ const SwapForm = ({
|
|
|
4225
4225
|
preservedAmount: _preservedAmount = null,
|
|
4226
4226
|
handleSwapServiceError: _handleSwapServiceError = (errorCode, setValidationContent, setBalanceValid, setMinimalAmountValid, setMaximumAmountValid, setIsPairSupported, setIsSameCoins) => {},
|
|
4227
4227
|
formHasBalance: _formHasBalance = false,
|
|
4228
|
-
retrieveSwapDetails: _retrieveSwapDetails = async (sendingAssetTicker, receivingAssetTicker, amount, isSwapAll = false,
|
|
4228
|
+
retrieveSwapDetails: _retrieveSwapDetails = async (sendingAssetTicker, receivingAssetTicker, amount, isSwapAll = false, isFixed = false, amountIsToReceive = false) => {},
|
|
4229
4229
|
retrieveInitialSwapData: _retrieveInitialSwapData = async (sendingAssetTicker, receivingAssetTicker) => {},
|
|
4230
4230
|
triggerDataUpdateResetting: _triggerDataUpdateResetting = 0,
|
|
4231
4231
|
fromAssetSelectionButtonRef: _fromAssetSelectionButtonRef = null,
|
|
@@ -4242,8 +4242,8 @@ const SwapForm = ({
|
|
|
4242
4242
|
swapSeparatorIconSrc,
|
|
4243
4243
|
swapButtonAlwaysActive: _swapButtonAlwaysActive = false,
|
|
4244
4244
|
onIsFixedChange: _onIsFixedChange = () => {},
|
|
4245
|
-
recipientAddressExtraIdName,
|
|
4246
|
-
refundAddressExtraIdName,
|
|
4245
|
+
// recipientAddressExtraIdName,
|
|
4246
|
+
// refundAddressExtraIdName,
|
|
4247
4247
|
translations: _translations = {
|
|
4248
4248
|
swapAllButtonTitles: {
|
|
4249
4249
|
enable: "Swap all",
|
|
@@ -4288,9 +4288,12 @@ const SwapForm = ({
|
|
|
4288
4288
|
var _isFixedRate$current2, _isFixedRate$current3, _maximumAmount$curren4, _maximumAmount$curren5, _maximumAmount$curren6, _minimalAmount$curren5;
|
|
4289
4289
|
const DETAIL_REFRESH_INTERVAL_MS = 1.5 * 60000;
|
|
4290
4290
|
const IS_FIXED_BY_DEFAULT = false;
|
|
4291
|
+
|
|
4292
|
+
// Updating the states below will insert the new value into the send or receive input field
|
|
4291
4293
|
const [updateSendInputTo, setUpdateSendInputTo] = useState(_preservedAmount != null ? _preservedAmount : null);
|
|
4292
4294
|
const [updateReceiveInputTo, setUpdateReceiveInputTo] = useState(null);
|
|
4293
4295
|
const [sendAssetAmount, setSendAssetAmount] = useReferredState(_preservedAmount == null || _preservedAmount === "" ? null : _preservedAmount);
|
|
4296
|
+
const [receiveAssetAmount, setReceiveAssetAmount] = useReferredState(null);
|
|
4294
4297
|
const [swapRate, setSwapRate] = useState();
|
|
4295
4298
|
const [minimalAmount, setMinimalAmount] = useReferredState(null);
|
|
4296
4299
|
const [maximumAmount, setMaximumAmount] = useReferredState(null);
|
|
@@ -4301,6 +4304,8 @@ const SwapForm = ({
|
|
|
4301
4304
|
const [isSameCoins, setIsSameCoins] = useState(false);
|
|
4302
4305
|
const [isSwapCalculated, setIsSwapCalculated] = useState(false);
|
|
4303
4306
|
const [readyToSwap, setReadyToSwap] = useState(false); // Basically a param that enables/disables the "Next" button
|
|
4307
|
+
// TODO: [refactoring, moderate] instead of handling preservedAmount at a lot of cases below, just
|
|
4308
|
+
// write single useEffect setting sendAssetAmount to the=is passed value and simplify the logic below. task_id=6453251e49b04c5e88a3cc771479ffb5
|
|
4304
4309
|
const [isAmountZero, setIsAmountZero] = useState(_preservedAmount == null || String(_preservedAmount) === "0");
|
|
4305
4310
|
const [isLoading, setIsLoading] = useReferredState(false); // Whether the form is in the progress of loading some data (new rates, for example)
|
|
4306
4311
|
const [isFixedRate, setIsFixedRate] = useReferredState(null);
|
|
@@ -4326,14 +4331,17 @@ const SwapForm = ({
|
|
|
4326
4331
|
const displayRateSelector = !_formHasBalance;
|
|
4327
4332
|
const handleSendAssetAmountChange = amount => {
|
|
4328
4333
|
setIsLastEditedReceiving(false);
|
|
4334
|
+
const receiveAmount = AmountUtils.trim(BigNumber(amount).times(swapRate), _receivingAssetDecimalCount);
|
|
4329
4335
|
if (amount != null && amount !== "") {
|
|
4330
|
-
|
|
4336
|
+
setReceiveAssetAmount(receiveAmount);
|
|
4337
|
+
setUpdateReceiveInputTo(receiveAmount);
|
|
4331
4338
|
} else {
|
|
4332
4339
|
setUpdateReceiveInputTo("");
|
|
4333
4340
|
}
|
|
4334
4341
|
setSendAssetAmount(amount);
|
|
4335
4342
|
};
|
|
4336
4343
|
const handleReceiveAssetAmountChange = amount => {
|
|
4344
|
+
setReceiveAssetAmount(amount);
|
|
4337
4345
|
setIsLastEditedReceiving(true);
|
|
4338
4346
|
let sendAssetAmount = "";
|
|
4339
4347
|
if (amount != null && amount !== "") {
|
|
@@ -4440,14 +4448,12 @@ const SwapForm = ({
|
|
|
4440
4448
|
setIsPairSupported(true);
|
|
4441
4449
|
setIsSwapCalculated(false);
|
|
4442
4450
|
const response = await _retrieveSwapDetails(sendingAssetTicker, receivingAssetTicker, amount, isSwapAll.current, (_isFixedRate$current = isFixedRate.current) != null ? _isFixedRate$current : IS_FIXED_BY_DEFAULT, isFixedRate.current ? isLastEditedReceiving : false);
|
|
4443
|
-
if (!isSwapAll.current && String(amount) !== String(isForPreserved && sendAssetAmount.current == null ? _preservedAmount : sendAssetAmount.current)) {
|
|
4451
|
+
if (!isSwapAll.current && String(amount) !== String(isForPreserved && sendAssetAmount.current == null ? _preservedAmount : isFixedRate.current && isLastEditedReceiving ? receiveAssetAmount.current : sendAssetAmount.current)) {
|
|
4444
4452
|
// Means amount changed and we no more need to do this exact calculation
|
|
4445
4453
|
return;
|
|
4446
4454
|
}
|
|
4447
4455
|
if (response.result) {
|
|
4448
4456
|
const swapCreationInfo = response.swapCreationInfo;
|
|
4449
|
-
setUpdateSendInputTo(swapCreationInfo.fromAmountCoins);
|
|
4450
|
-
setUpdateReceiveInputTo(swapCreationInfo.toAmountCoins);
|
|
4451
4457
|
if (isSwapAll.current) {
|
|
4452
4458
|
setIsAmountZero(BigNumber("0").eq(swapCreationInfo.fromAmountCoins));
|
|
4453
4459
|
}
|
|
@@ -4456,6 +4462,8 @@ const SwapForm = ({
|
|
|
4456
4462
|
setIsRefundAddressRequired(swapCreationInfo == null ? void 0 : swapCreationInfo.isRefundAddressRequired);
|
|
4457
4463
|
processMinMaxAmounts(isSwapAll.current ? swapCreationInfo.fromAmountCoins : amount);
|
|
4458
4464
|
setIsSwapCalculated(true);
|
|
4465
|
+
setUpdateSendInputTo(swapCreationInfo.fromAmountCoins);
|
|
4466
|
+
setUpdateReceiveInputTo(swapCreationInfo.toAmountCoins);
|
|
4459
4467
|
} else {
|
|
4460
4468
|
_handleSwapServiceError(response.reason, setValidationContent, setBalanceValid, setMinimalAmountValid, setMaximumAmountValid, setIsPairSupported, setIsSameCoins);
|
|
4461
4469
|
if (isSwapAll.current) {
|
|
@@ -4515,7 +4523,7 @@ const SwapForm = ({
|
|
|
4515
4523
|
};
|
|
4516
4524
|
const handleRateModeChanged = isFixed => {
|
|
4517
4525
|
setIsFixedRate(isFixed);
|
|
4518
|
-
requestDataRefresh(sendAssetAmount.current, true);
|
|
4526
|
+
requestDataRefresh(isLastEditedReceiving ? receiveAssetAmount.current : sendAssetAmount.current, true);
|
|
4519
4527
|
};
|
|
4520
4528
|
useEffect(() => {
|
|
4521
4529
|
if (isSwapAll.current === true) {
|
|
@@ -4538,7 +4546,7 @@ const SwapForm = ({
|
|
|
4538
4546
|
const isCurrentAmountNotZero = sendAssetAmount.current && !BigNumber("0").eq(sendAssetAmount.current);
|
|
4539
4547
|
const isPreservedAmountNotZero = _preservedAmount && !BigNumber("0").eq(_preservedAmount);
|
|
4540
4548
|
if (isCurrentAmountNotZero) {
|
|
4541
|
-
loadFullEstimation(sendAssetAmount.current);
|
|
4549
|
+
loadFullEstimation(isLastEditedReceiving ? receiveAssetAmount.current : sendAssetAmount.current);
|
|
4542
4550
|
} else if (isPreservedAmountNotZero) {
|
|
4543
4551
|
loadFullEstimation(_preservedAmount, true);
|
|
4544
4552
|
} else {
|
|
@@ -4589,7 +4597,7 @@ const SwapForm = ({
|
|
|
4589
4597
|
if (readyToSwap) {
|
|
4590
4598
|
timeoutId = setTimeout(() => {
|
|
4591
4599
|
var _sendAssetAmount$curr;
|
|
4592
|
-
return requestDataRefresh((_sendAssetAmount$curr = sendAssetAmount.current) != null ? _sendAssetAmount$curr : _preservedAmount, true);
|
|
4600
|
+
return requestDataRefresh(isLastEditedReceiving ? receiveAssetAmount.current : (_sendAssetAmount$curr = sendAssetAmount.current) != null ? _sendAssetAmount$curr : _preservedAmount, true);
|
|
4593
4601
|
}, DETAIL_REFRESH_INTERVAL_MS);
|
|
4594
4602
|
setIdleDataUpdateTimeoutId(timeoutId);
|
|
4595
4603
|
} else {
|
|
@@ -4617,7 +4625,11 @@ const SwapForm = ({
|
|
|
4617
4625
|
}, [updateSendInputTo, updateReceiveInputTo]);
|
|
4618
4626
|
useEffect(() => {
|
|
4619
4627
|
if (swapRate != null && sendAssetAmount.current != null) {
|
|
4620
|
-
|
|
4628
|
+
if (isLastEditedReceiving) {
|
|
4629
|
+
setUpdateSendInputTo(AmountUtils.trim(BigNumber(receiveAssetAmount.current).div(swapRate), _sendingAssetDecimalCount));
|
|
4630
|
+
} else {
|
|
4631
|
+
setUpdateReceiveInputTo(AmountUtils.trim(BigNumber(sendAssetAmount.current).times(swapRate), _receivingAssetDecimalCount));
|
|
4632
|
+
}
|
|
4621
4633
|
}
|
|
4622
4634
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4623
4635
|
}, [swapRate]);
|
|
@@ -4632,12 +4644,15 @@ const SwapForm = ({
|
|
|
4632
4644
|
setConfirmButtonTo(_composeConfirmButtonTo(sendingAssetTicker, receivingAssetTicker, sendAssetAmount.current));
|
|
4633
4645
|
if (sendAssetAmount.current == null) return;
|
|
4634
4646
|
let processingAmount = sendAssetAmount.current === "" ? "0" : sendAssetAmount.current;
|
|
4635
|
-
|
|
4647
|
+
let processingReceivingAmount = receiveAssetAmount.current === "" ? "0" : receiveAssetAmount.current;
|
|
4648
|
+
requestDataRefresh(isLastEditedReceiving ? processingReceivingAmount : processingAmount);
|
|
4636
4649
|
processMinMaxAmounts(processingAmount);
|
|
4637
4650
|
setIsAmountZero(BigNumber("0").eq(processingAmount));
|
|
4638
4651
|
setIsSwapCalculated(false);
|
|
4639
4652
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4640
4653
|
}, [sendAssetAmount.current]);
|
|
4654
|
+
const recipientAddressExtraIdName = _getExtraIdNameByTicker(receivingAssetTicker);
|
|
4655
|
+
const refundAddressExtraIdName = _getExtraIdNameByTicker(sendingAssetTicker);
|
|
4641
4656
|
return /*#__PURE__*/React.createElement("div", {
|
|
4642
4657
|
className: s$9["swap-form"]
|
|
4643
4658
|
}, /*#__PURE__*/React.createElement(TitleBox, {
|
|
@@ -4673,7 +4688,7 @@ const SwapForm = ({
|
|
|
4673
4688
|
upperFormPosition: true,
|
|
4674
4689
|
errorEncountered: !minimalAmountValid,
|
|
4675
4690
|
ref: _fromAssetSelectionButtonRef,
|
|
4676
|
-
isLoading: false,
|
|
4691
|
+
isLoading: isLastEditedReceiving ? isLoading.current : false,
|
|
4677
4692
|
cryptoAssetToFiatRate: _sendingAssetToFiatRate,
|
|
4678
4693
|
fiatCurrencyCode: _formHasFiat ? _fiatCurrencyCode : null,
|
|
4679
4694
|
fiatCurrencyDecimals: _fiatCurrencyDecimals,
|
|
@@ -4705,7 +4720,7 @@ const SwapForm = ({
|
|
|
4705
4720
|
lowerFormPosition: true,
|
|
4706
4721
|
estimateAmount: !isFixedRate.current,
|
|
4707
4722
|
ref: _toAssetSelectionButtonRef,
|
|
4708
|
-
isLoading: isLoading.current,
|
|
4723
|
+
isLoading: isLastEditedReceiving ? false : isLoading.current,
|
|
4709
4724
|
cryptoAssetToFiatRate: _receivingAssetToFiatRate,
|
|
4710
4725
|
fiatCurrencyCode: _formHasFiat ? _fiatCurrencyCode : null,
|
|
4711
4726
|
fiatCurrencyDecimals: _fiatCurrencyDecimals,
|
|
@@ -4783,7 +4798,7 @@ const SwapForm = ({
|
|
|
4783
4798
|
size: "lg",
|
|
4784
4799
|
mode: "primary",
|
|
4785
4800
|
content: _translations.confirmButtonText,
|
|
4786
|
-
onClick: resetButtonLoader => _handleConfirmButtonClick(resetButtonLoader, setValidationContent, setBalanceValid, setMinimalAmountValid, setMaximumAmountValid, setIsPairSupported, setIsSameCoins, recipientAddress.current, recipientAddressExtraId.current, refundAddress.current, refundAddressExtraId.current),
|
|
4801
|
+
onClick: resetButtonLoader => _handleConfirmButtonClick(resetButtonLoader, setValidationContent, setBalanceValid, setMinimalAmountValid, setMaximumAmountValid, setIsPairSupported, setIsSameCoins, recipientAddress.current, recipientAddressExtraId.current, refundAddress.current, refundAddressExtraId.current, isLastEditedReceiving),
|
|
4787
4802
|
fullWidthOnMobiles: true,
|
|
4788
4803
|
isDisabled: !readyToSwap,
|
|
4789
4804
|
to: _formHasBalance ? "" : confirmButtonTo,
|
|
@@ -7845,8 +7860,28 @@ class SwapProvider {
|
|
|
7845
7860
|
* @private
|
|
7846
7861
|
*/
|
|
7847
7862
|
_putPopularCoinsFirst() {
|
|
7863
|
+
const popularCoinsList = ["BTC", "ETH", "USDTERC20", "USDTTRC20", "USDCERC20", "XRP", "TON", "XMR", "TRX", "DAIERC20", "DOGE", "BNB", "PEPEERC20", "NOTTON", "SOL", "DOT", "LTC", "SHIBERC20", "AVAX", "UNIERC20", "LINKERC20", "MATIC", "BUSDBEP20", "AAVEERC20", "ATOM", "RUNE", "ADA"];
|
|
7848
7864
|
this._supportedCoins.sort((i1, i2) => {
|
|
7849
|
-
|
|
7865
|
+
const isInPopularList1 = popularCoinsList.includes(i1.coin.ticker);
|
|
7866
|
+
const isInPopularList2 = popularCoinsList.includes(i2.coin.ticker);
|
|
7867
|
+
|
|
7868
|
+
// If both are in the popularCoinsList, sort by their index in the list
|
|
7869
|
+
if (isInPopularList1 && isInPopularList2) {
|
|
7870
|
+
const index1 = popularCoinsList.indexOf(i1.coin.ticker);
|
|
7871
|
+
const index2 = popularCoinsList.indexOf(i2.coin.ticker);
|
|
7872
|
+
return index1 - index2;
|
|
7873
|
+
}
|
|
7874
|
+
|
|
7875
|
+
// Sort by whether the coin is in the popularCoinsList
|
|
7876
|
+
if (isInPopularList1 && !isInPopularList2) return -1;
|
|
7877
|
+
if (!isInPopularList1 && isInPopularList2) return 1;
|
|
7878
|
+
|
|
7879
|
+
// If both are not in the popularCoinsList, use the isPopular flag - partners can fill it
|
|
7880
|
+
let p1 = i1.isPopular;
|
|
7881
|
+
let p2 = i2.isPopular;
|
|
7882
|
+
if (p1 !== p2) return p2 - p1;
|
|
7883
|
+
|
|
7884
|
+
// By default, sort by the coin ticker
|
|
7850
7885
|
return i1.coin.ticker.localeCompare(i2.coin.ticker);
|
|
7851
7886
|
});
|
|
7852
7887
|
}
|
|
@@ -8571,7 +8606,7 @@ class SwapspaceSwapProvider extends SwapProvider {
|
|
|
8571
8606
|
const wo404 = responses.flat();
|
|
8572
8607
|
Logger.log("All swaps RAW: " + JSON.stringify(wo404.map(r => r.data)), loggerSource);
|
|
8573
8608
|
const swaps = wo404.map(r => r.data).map((swap, index) => {
|
|
8574
|
-
var _this$_supportedCoins2, _this$_supportedCoins3, _swap$from$extraId, _swap$to$extraId, _swap$refundExtraId;
|
|
8609
|
+
var _this$_supportedCoins2, _this$_supportedCoins3, _swap$blockExplorerTr, _swap$from$extraId, _swap$to$extraId, _swap$refundExtraId;
|
|
8575
8610
|
const fromCoin = (_this$_supportedCoins2 = this._supportedCoins.find(i => i.code === swap.from.code && i.network === swap.from.network)) == null ? void 0 : _this$_supportedCoins2.coin;
|
|
8576
8611
|
const toCoin = (_this$_supportedCoins3 = this._supportedCoins.find(i => i.code === swap.to.code && i.network === swap.to.network)) == null ? void 0 : _this$_supportedCoins3.coin;
|
|
8577
8612
|
if (!fromCoin || !toCoin) {
|
|
@@ -8583,7 +8618,8 @@ class SwapspaceSwapProvider extends SwapProvider {
|
|
|
8583
8618
|
const status = this._mapSwapspaceStatusToRabbitStatus(swap.status, isExpiredByTime);
|
|
8584
8619
|
const toDigits = status === SwapProvider.SWAP_STATUSES.REFUNDED ? fromCoin.digits : toCoin.digits;
|
|
8585
8620
|
const addressToSendCoinsToSwapspace = swap.from.address;
|
|
8586
|
-
|
|
8621
|
+
const toUrl = ((_swap$blockExplorerTr = swap.blockExplorerTransactionUrl.to) != null ? _swap$blockExplorerTr : "").replace(/from=swapspace&?/g, "").replaceAll(/&&+/g, "&").replace("?&", "?").replace(/&$/, "").replace(/\?$/, "");
|
|
8622
|
+
return new ExistingSwap(swapIds[index], status, toUtcTimestamp(swap.timestamps.createdAt), expiresAt, swap.confirmations, AmountUtils.trim(swap.rate, this._maxRateDigits), swap.fixed, swap.refundAddress, addressToSendCoinsToSwapspace, fromCoin, AmountUtils.trim(swap.from.amount, fromCoin.digits), swap.from.transactionHash, swap.blockExplorerTransactionUrl.from, toCoin, AmountUtils.trim(swap.to.amount, toDigits), swap.to.transactionHash, toUrl, swap.to.address, swap.partner, (_swap$from$extraId = swap.from.extraId) != null ? _swap$from$extraId : null, (_swap$to$extraId = swap.to.extraId) != null ? _swap$to$extraId : null, (_swap$refundExtraId = swap.refundExtraId) != null ? _swap$refundExtraId : null);
|
|
8587
8623
|
}).flat();
|
|
8588
8624
|
Logger.log(`Swap details result ${safeStringify(swaps)}`, loggerSource);
|
|
8589
8625
|
return {
|
|
@@ -8818,6 +8854,8 @@ class LetsExchangeSwapProvider extends SwapProvider {
|
|
|
8818
8854
|
}
|
|
8819
8855
|
async getSwapInfo(fromCoin, toCoin, amountCoins, fixed = false, fromCoinToUsdRate = null, amountIsToReceive = false) {
|
|
8820
8856
|
const loggerSource = "getSwapInfo";
|
|
8857
|
+
let min = null;
|
|
8858
|
+
let max = null;
|
|
8821
8859
|
try {
|
|
8822
8860
|
if (!(fromCoin instanceof Coin) || !(toCoin instanceof Coin) || typeof amountCoins !== "string" || BigNumber(amountCoins).lt("0") || fixed !== null && typeof fixed !== "boolean" || amountIsToReceive && !fixed) {
|
|
8823
8861
|
throw new Error(`Wrong input params: ${amountCoins} ${fromCoin.ticker} -> ${toCoin.ticker}, ${fromCoin instanceof Coin}, ${toCoin instanceof Coin}, ${typeof fixed} ${fixed}, ${amountIsToReceive}`);
|
|
@@ -8859,11 +8897,9 @@ class LetsExchangeSwapProvider extends SwapProvider {
|
|
|
8859
8897
|
// const extraUsdToFitMinMax = BigNumber("1"); // We correct the limits as the exact limit can fluctuate and cause failed swap creation
|
|
8860
8898
|
// extraCoinsToFitMinMax = AmountUtils.trim(extraUsdToFitMinMax.div(fromCoinToUsdRate), fromCoin.digits);
|
|
8861
8899
|
// }
|
|
8862
|
-
let min = null;
|
|
8863
8900
|
if (data != null && data.min_amount) {
|
|
8864
8901
|
min = AmountUtils.trim(data == null ? void 0 : data.min_amount, amountIsToReceive ? toCoin.digits : fromCoin.digits);
|
|
8865
8902
|
}
|
|
8866
|
-
let max = null;
|
|
8867
8903
|
if (data != null && data.max_amount) {
|
|
8868
8904
|
max = AmountUtils.trim(data == null ? void 0 : data.max_amount, amountIsToReceive ? toCoin.digits : fromCoin.digits);
|
|
8869
8905
|
}
|
|
@@ -8915,8 +8951,16 @@ class LetsExchangeSwapProvider extends SwapProvider {
|
|
|
8915
8951
|
isRefundAddressRequired: false
|
|
8916
8952
|
};
|
|
8917
8953
|
} catch (e) {
|
|
8918
|
-
var _e$response;
|
|
8919
|
-
if ((e == null || (_e$response = e.response) == null ? void 0 : _e$response.status) ===
|
|
8954
|
+
var _e$response, _e$response2;
|
|
8955
|
+
if ((e == null || (_e$response = e.response) == null ? void 0 : _e$response.status) === 404) {
|
|
8956
|
+
return {
|
|
8957
|
+
result: false,
|
|
8958
|
+
reason: SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED,
|
|
8959
|
+
smallestMin: min,
|
|
8960
|
+
greatestMax: max
|
|
8961
|
+
};
|
|
8962
|
+
}
|
|
8963
|
+
if ((e == null || (_e$response2 = e.response) == null ? void 0 : _e$response2.status) === 429) {
|
|
8920
8964
|
return {
|
|
8921
8965
|
result: false,
|
|
8922
8966
|
reason: SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
@@ -8989,14 +9033,14 @@ class LetsExchangeSwapProvider extends SwapProvider {
|
|
|
8989
9033
|
Logger.log(errorMessage, loggerSource);
|
|
8990
9034
|
throw new Error(errorMessage);
|
|
8991
9035
|
} catch (e) {
|
|
8992
|
-
var _e$
|
|
9036
|
+
var _e$response3, _e$response4;
|
|
8993
9037
|
Logger.logError(e, loggerSource, `Failed to create swap. Error is: ${safeStringify(e)}`);
|
|
8994
9038
|
const composeFailResult = reason => ({
|
|
8995
9039
|
result: false,
|
|
8996
9040
|
reason: reason
|
|
8997
9041
|
});
|
|
8998
|
-
const status = e == null || (_e$
|
|
8999
|
-
const data = e == null || (_e$
|
|
9042
|
+
const status = e == null || (_e$response3 = e.response) == null ? void 0 : _e$response3.status;
|
|
9043
|
+
const data = e == null || (_e$response4 = e.response) == null ? void 0 : _e$response4.data;
|
|
9000
9044
|
if (status === 429) {
|
|
9001
9045
|
Logger.log(`Returning fail - RPS limit exceeded ${data}`, loggerSource);
|
|
9002
9046
|
return composeFailResult(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
|
|
@@ -9028,7 +9072,10 @@ class LetsExchangeSwapProvider extends SwapProvider {
|
|
|
9028
9072
|
const isExpiredByTime = expiresAt && expiresAt < Date.now();
|
|
9029
9073
|
const status = this._mapLetsExchangeStatusToRabbitStatus(swap.status, isExpiredByTime);
|
|
9030
9074
|
const toDigits = status === SwapProvider.SWAP_STATUSES.REFUNDED ? fromCoin.digits : toCoin.digits;
|
|
9031
|
-
|
|
9075
|
+
const deposit = swap.real_deposit_amount && swap.real_deposit_amount !== "" ? swap.real_deposit_amount : swap.deposit_amount;
|
|
9076
|
+
const withdrawal = swap.real_withdrawal_amount && swap.real_withdrawal_amount !== "" ? swap.real_withdrawal_amount : swap.withdrawal_amount;
|
|
9077
|
+
const rate = BigNumber(withdrawal).div(deposit).toFixed(this._maxRateDigits); // We don't use their rate as it excludes their fee
|
|
9078
|
+
return new ExistingSwap(swapIds[index], status, createdAt, expiresAt, swap.confirmations, rate, swap.is_float != null ? !swap.is_float : false, swap.return, swap.deposit, fromCoin, AmountUtils.trim(deposit, fromCoin.digits), swap.hash_in, swap.hash_in ? `${swap.coin_from_explorer_url}${swap.hash_in}` : null, toCoin, AmountUtils.trim(withdrawal, toDigits), swap.hash_out, swap.hash_out ? `${swap.coin_to_explorer_url}${swap.hash_out}` : null, swap.withdrawal, "letsexchange", (_swap$deposit_extra_i = swap.deposit_extra_id) != null ? _swap$deposit_extra_i : null, (_swap$withdrawal_extr = swap.withdrawal_extra_id) != null ? _swap$withdrawal_extr : null, (_swap$return_extra_id = swap.return_extra_id) != null ? _swap$return_extra_id : null);
|
|
9032
9079
|
}).flat();
|
|
9033
9080
|
Logger.log(`Swap details result ${safeStringify(swaps)}`, loggerSource);
|
|
9034
9081
|
return {
|
|
@@ -9036,14 +9083,14 @@ class LetsExchangeSwapProvider extends SwapProvider {
|
|
|
9036
9083
|
swaps: swaps
|
|
9037
9084
|
};
|
|
9038
9085
|
} catch (e) {
|
|
9039
|
-
var _e$
|
|
9086
|
+
var _e$response5, _e$response6;
|
|
9040
9087
|
Logger.logError(e, loggerSource, `Failed to get swap details. Error is: ${safeStringify(e)}`);
|
|
9041
9088
|
const composeFailResult = reason => ({
|
|
9042
9089
|
result: false,
|
|
9043
9090
|
reason: reason
|
|
9044
9091
|
});
|
|
9045
|
-
const status = e == null || (_e$
|
|
9046
|
-
const data = e == null || (_e$
|
|
9092
|
+
const status = e == null || (_e$response5 = e.response) == null ? void 0 : _e$response5.status;
|
|
9093
|
+
const data = e == null || (_e$response6 = e.response) == null ? void 0 : _e$response6.data;
|
|
9047
9094
|
if (status === 429) {
|
|
9048
9095
|
Logger.log(`Returning fail - RPS limit exceeded ${data}`, loggerSource);
|
|
9049
9096
|
return composeFailResult(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
|
|
@@ -9051,21 +9098,21 @@ class LetsExchangeSwapProvider extends SwapProvider {
|
|
|
9051
9098
|
improveAndRethrow(e, loggerSource);
|
|
9052
9099
|
}
|
|
9053
9100
|
}
|
|
9054
|
-
|
|
9055
|
-
// TODO: [dev] Serg, please check this during the review to make sure I did no mistakes in statuses mapping.
|
|
9056
|
-
// I will remove these comments after the review. https://api.letsexchange.io/doc
|
|
9057
|
-
// wait The exchange has just been created and it’s waiting for coins to reach the deposit wallet
|
|
9058
|
-
// confirmation The transaction appears in mempool and now it is waiting for necessary network confirmations to start.
|
|
9059
|
-
// confirmed The user’s payment is confirmed, the exchange process is about to start.
|
|
9060
|
-
// exchanging The exchange process is running.
|
|
9061
|
-
// sending Funds are being sent to the recipient`s address.
|
|
9062
|
-
// sending_confirmation The outgoing transaction is waiting for network confirmations.
|
|
9063
|
-
// success The exchange is completed and the funds are successfully sent to the recipient’s address.
|
|
9064
|
-
// aml_check_failed The deposit was marked as risky by AML check service.
|
|
9065
|
-
// overdue The deposit receiving time for this transaction has expired.
|
|
9066
|
-
// error The transaction has failed. In most cases, the amount that was sent differs from the amount that was specified when creating the transaction.
|
|
9067
|
-
// refund The exchange failed and the coins were refunded to the user's wallet.
|
|
9068
9101
|
_mapLetsExchangeStatusToRabbitStatus(status, isExpiredByTime) {
|
|
9102
|
+
/**
|
|
9103
|
+
* Lets exchange statuses description
|
|
9104
|
+
* wait - The exchange has just been created and it’s waiting for coins to reach the deposit wallet
|
|
9105
|
+
* confirmation - The transaction appears in mempool and now it is waiting for necessary network confirmations to start.
|
|
9106
|
+
* confirmed - The user’s payment is confirmed, the exchange process is about to start.
|
|
9107
|
+
* exchanging - The exchange process is running.
|
|
9108
|
+
* sending - Funds are being sent to the recipient`s address.
|
|
9109
|
+
* sending_confirmation - The outgoing transaction is waiting for network confirmations.
|
|
9110
|
+
* success - The exchange is completed and the funds are successfully sent to the recipient’s address.
|
|
9111
|
+
* aml_check_failed - The deposit was marked as risky by AML check service.
|
|
9112
|
+
* overdue - The deposit receiving time for this transaction has expired.
|
|
9113
|
+
* error - The transaction has failed. In most cases, the amount that was sent differs from the amount that was specified when creating the transaction.
|
|
9114
|
+
* refund - The exchange failed and the coins were refunded to the user's wallet.
|
|
9115
|
+
*/
|
|
9069
9116
|
switch (status) {
|
|
9070
9117
|
case "wait":
|
|
9071
9118
|
if (isExpiredByTime) {
|
|
@@ -9079,7 +9126,7 @@ class LetsExchangeSwapProvider extends SwapProvider {
|
|
|
9079
9126
|
case "exchanging":
|
|
9080
9127
|
return SwapProvider.SWAP_STATUSES.EXCHANGING;
|
|
9081
9128
|
case "sending":
|
|
9082
|
-
return SwapProvider.SWAP_STATUSES.
|
|
9129
|
+
return SwapProvider.SWAP_STATUSES.EXCHANGING;
|
|
9083
9130
|
case "sending_confirmation":
|
|
9084
9131
|
return SwapProvider.SWAP_STATUSES.EXCHANGING;
|
|
9085
9132
|
case "success":
|
|
@@ -9234,7 +9281,7 @@ class PublicSwapService {
|
|
|
9234
9281
|
*
|
|
9235
9282
|
* @param fromCoin {Coin}
|
|
9236
9283
|
* @param toCoin {Coin}
|
|
9237
|
-
* @param
|
|
9284
|
+
* @param amountCoins {string}
|
|
9238
9285
|
* @param [fixed=false] {boolean|null} null means fixed or float doesn't matter
|
|
9239
9286
|
* @param [withoutFiat=false] {boolean} pass true if you don't need the fiat equivalent - this will diminish requests count
|
|
9240
9287
|
* @param [amountIsToReceive=false] {boolean} whether the given amount is receiving amount.
|
|
@@ -9252,7 +9299,7 @@ class PublicSwapService {
|
|
|
9252
9299
|
* swapCreationInfo: BaseSwapCreationInfo
|
|
9253
9300
|
* }>}
|
|
9254
9301
|
*/
|
|
9255
|
-
async getPublicSwapDetails(fromCoin, toCoin,
|
|
9302
|
+
async getPublicSwapDetails(fromCoin, toCoin, amountCoins, fixed = false, withoutFiat = false, amountIsToReceive = false) {
|
|
9256
9303
|
const loggerSource = "getPublicSwapDetails";
|
|
9257
9304
|
try {
|
|
9258
9305
|
var _await$getCoinToUSDTR, _await$getCoinToUSDTR2, _result$swapCreationI, _result$swapCreationI2;
|
|
@@ -9260,7 +9307,7 @@ class PublicSwapService {
|
|
|
9260
9307
|
throw new Error("Estimating allowed only for fixed rate.");
|
|
9261
9308
|
}
|
|
9262
9309
|
const coinUsdtRate = withoutFiat ? null : (_await$getCoinToUSDTR = (_await$getCoinToUSDTR2 = await (fixed ? this._fixedSwapProvider : this._swapProvider).getCoinToUSDTRate(fromCoin)) == null ? void 0 : _await$getCoinToUSDTR2.rate) != null ? _await$getCoinToUSDTR : null;
|
|
9263
|
-
const details = await (fixed ? this._fixedSwapProvider : this._swapProvider).getSwapInfo(fromCoin, toCoin,
|
|
9310
|
+
const details = await (fixed ? this._fixedSwapProvider : this._swapProvider).getSwapInfo(fromCoin, toCoin, amountCoins, fixed, coinUsdtRate, amountIsToReceive);
|
|
9264
9311
|
|
|
9265
9312
|
// eslint-disable-next-line no-console
|
|
9266
9313
|
console.log("getSwapInfo result: ", details);
|
|
@@ -9300,13 +9347,14 @@ class PublicSwapService {
|
|
|
9300
9347
|
return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.NO_FIXED_BUT_HAVE_FLOATING_PUBLIC_SWAP_OPTION);
|
|
9301
9348
|
}
|
|
9302
9349
|
}
|
|
9303
|
-
const
|
|
9304
|
-
if (typeof min === "string" &&
|
|
9350
|
+
const amountBigNumber = BigNumber(amountCoins);
|
|
9351
|
+
if (typeof min === "string" && amountBigNumber.lt(min)) {
|
|
9305
9352
|
return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.AMOUNT_LESS_THAN_MIN_SWAPPABLE);
|
|
9306
|
-
} else if (typeof max === "string" &&
|
|
9353
|
+
} else if (typeof max === "string" && amountBigNumber.gt(max)) {
|
|
9307
9354
|
return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.AMOUNT_HIGHER_THAN_MAX_SWAPPABLE);
|
|
9308
9355
|
}
|
|
9309
|
-
const
|
|
9356
|
+
const fromAmountCoins = amountIsToReceive ? AmountUtils.trim(amountBigNumber.div(details.rate), fromCoin.digits) : amountCoins;
|
|
9357
|
+
const toAmountCoins = amountIsToReceive ? amountCoins : AmountUtils.trim(amountBigNumber.times(details.rate), toCoin.digits);
|
|
9310
9358
|
const result = {
|
|
9311
9359
|
result: true,
|
|
9312
9360
|
swapCreationInfo: new BaseSwapCreationInfo(fromCoin, toCoin, fromAmountCoins, toAmountCoins, details.rate, details.rawSwapData, min, fiatMin, max, fiatMax, details.durationMinutesRange, details.fixed, details.isRefundAddressRequired)
|