@rabbitio/ui-kit 1.0.0-beta.74 → 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 +700 -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 +54 -18
- 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 +87 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +84 -45
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +87 -45
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +87 -45
- 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 +24 -12
- 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",
|
|
@@ -4448,14 +4448,12 @@ const SwapForm = ({
|
|
|
4448
4448
|
setIsPairSupported(true);
|
|
4449
4449
|
setIsSwapCalculated(false);
|
|
4450
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);
|
|
4451
|
-
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)) {
|
|
4452
4452
|
// Means amount changed and we no more need to do this exact calculation
|
|
4453
4453
|
return;
|
|
4454
4454
|
}
|
|
4455
4455
|
if (response.result) {
|
|
4456
4456
|
const swapCreationInfo = response.swapCreationInfo;
|
|
4457
|
-
setUpdateSendInputTo(swapCreationInfo.fromAmountCoins);
|
|
4458
|
-
setUpdateReceiveInputTo(swapCreationInfo.toAmountCoins);
|
|
4459
4457
|
if (isSwapAll.current) {
|
|
4460
4458
|
setIsAmountZero(BigNumber("0").eq(swapCreationInfo.fromAmountCoins));
|
|
4461
4459
|
}
|
|
@@ -4464,6 +4462,8 @@ const SwapForm = ({
|
|
|
4464
4462
|
setIsRefundAddressRequired(swapCreationInfo == null ? void 0 : swapCreationInfo.isRefundAddressRequired);
|
|
4465
4463
|
processMinMaxAmounts(isSwapAll.current ? swapCreationInfo.fromAmountCoins : amount);
|
|
4466
4464
|
setIsSwapCalculated(true);
|
|
4465
|
+
setUpdateSendInputTo(swapCreationInfo.fromAmountCoins);
|
|
4466
|
+
setUpdateReceiveInputTo(swapCreationInfo.toAmountCoins);
|
|
4467
4467
|
} else {
|
|
4468
4468
|
_handleSwapServiceError(response.reason, setValidationContent, setBalanceValid, setMinimalAmountValid, setMaximumAmountValid, setIsPairSupported, setIsSameCoins);
|
|
4469
4469
|
if (isSwapAll.current) {
|
|
@@ -4625,7 +4625,11 @@ const SwapForm = ({
|
|
|
4625
4625
|
}, [updateSendInputTo, updateReceiveInputTo]);
|
|
4626
4626
|
useEffect(() => {
|
|
4627
4627
|
if (swapRate != null && sendAssetAmount.current != null) {
|
|
4628
|
-
|
|
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
|
+
}
|
|
4629
4633
|
}
|
|
4630
4634
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4631
4635
|
}, [swapRate]);
|
|
@@ -4647,6 +4651,8 @@ const SwapForm = ({
|
|
|
4647
4651
|
setIsSwapCalculated(false);
|
|
4648
4652
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4649
4653
|
}, [sendAssetAmount.current]);
|
|
4654
|
+
const recipientAddressExtraIdName = _getExtraIdNameByTicker(receivingAssetTicker);
|
|
4655
|
+
const refundAddressExtraIdName = _getExtraIdNameByTicker(sendingAssetTicker);
|
|
4650
4656
|
return /*#__PURE__*/React.createElement("div", {
|
|
4651
4657
|
className: s$9["swap-form"]
|
|
4652
4658
|
}, /*#__PURE__*/React.createElement(TitleBox, {
|
|
@@ -4682,7 +4688,7 @@ const SwapForm = ({
|
|
|
4682
4688
|
upperFormPosition: true,
|
|
4683
4689
|
errorEncountered: !minimalAmountValid,
|
|
4684
4690
|
ref: _fromAssetSelectionButtonRef,
|
|
4685
|
-
isLoading: false,
|
|
4691
|
+
isLoading: isLastEditedReceiving ? isLoading.current : false,
|
|
4686
4692
|
cryptoAssetToFiatRate: _sendingAssetToFiatRate,
|
|
4687
4693
|
fiatCurrencyCode: _formHasFiat ? _fiatCurrencyCode : null,
|
|
4688
4694
|
fiatCurrencyDecimals: _fiatCurrencyDecimals,
|
|
@@ -4714,7 +4720,7 @@ const SwapForm = ({
|
|
|
4714
4720
|
lowerFormPosition: true,
|
|
4715
4721
|
estimateAmount: !isFixedRate.current,
|
|
4716
4722
|
ref: _toAssetSelectionButtonRef,
|
|
4717
|
-
isLoading: isLoading.current,
|
|
4723
|
+
isLoading: isLastEditedReceiving ? false : isLoading.current,
|
|
4718
4724
|
cryptoAssetToFiatRate: _receivingAssetToFiatRate,
|
|
4719
4725
|
fiatCurrencyCode: _formHasFiat ? _fiatCurrencyCode : null,
|
|
4720
4726
|
fiatCurrencyDecimals: _fiatCurrencyDecimals,
|
|
@@ -7854,8 +7860,28 @@ class SwapProvider {
|
|
|
7854
7860
|
* @private
|
|
7855
7861
|
*/
|
|
7856
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"];
|
|
7857
7864
|
this._supportedCoins.sort((i1, i2) => {
|
|
7858
|
-
|
|
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
|
|
7859
7885
|
return i1.coin.ticker.localeCompare(i2.coin.ticker);
|
|
7860
7886
|
});
|
|
7861
7887
|
}
|
|
@@ -8580,7 +8606,7 @@ class SwapspaceSwapProvider extends SwapProvider {
|
|
|
8580
8606
|
const wo404 = responses.flat();
|
|
8581
8607
|
Logger.log("All swaps RAW: " + JSON.stringify(wo404.map(r => r.data)), loggerSource);
|
|
8582
8608
|
const swaps = wo404.map(r => r.data).map((swap, index) => {
|
|
8583
|
-
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;
|
|
8584
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;
|
|
8585
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;
|
|
8586
8612
|
if (!fromCoin || !toCoin) {
|
|
@@ -8592,7 +8618,8 @@ class SwapspaceSwapProvider extends SwapProvider {
|
|
|
8592
8618
|
const status = this._mapSwapspaceStatusToRabbitStatus(swap.status, isExpiredByTime);
|
|
8593
8619
|
const toDigits = status === SwapProvider.SWAP_STATUSES.REFUNDED ? fromCoin.digits : toCoin.digits;
|
|
8594
8620
|
const addressToSendCoinsToSwapspace = swap.from.address;
|
|
8595
|
-
|
|
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);
|
|
8596
8623
|
}).flat();
|
|
8597
8624
|
Logger.log(`Swap details result ${safeStringify(swaps)}`, loggerSource);
|
|
8598
8625
|
return {
|
|
@@ -8827,6 +8854,8 @@ class LetsExchangeSwapProvider extends SwapProvider {
|
|
|
8827
8854
|
}
|
|
8828
8855
|
async getSwapInfo(fromCoin, toCoin, amountCoins, fixed = false, fromCoinToUsdRate = null, amountIsToReceive = false) {
|
|
8829
8856
|
const loggerSource = "getSwapInfo";
|
|
8857
|
+
let min = null;
|
|
8858
|
+
let max = null;
|
|
8830
8859
|
try {
|
|
8831
8860
|
if (!(fromCoin instanceof Coin) || !(toCoin instanceof Coin) || typeof amountCoins !== "string" || BigNumber(amountCoins).lt("0") || fixed !== null && typeof fixed !== "boolean" || amountIsToReceive && !fixed) {
|
|
8832
8861
|
throw new Error(`Wrong input params: ${amountCoins} ${fromCoin.ticker} -> ${toCoin.ticker}, ${fromCoin instanceof Coin}, ${toCoin instanceof Coin}, ${typeof fixed} ${fixed}, ${amountIsToReceive}`);
|
|
@@ -8868,11 +8897,9 @@ class LetsExchangeSwapProvider extends SwapProvider {
|
|
|
8868
8897
|
// const extraUsdToFitMinMax = BigNumber("1"); // We correct the limits as the exact limit can fluctuate and cause failed swap creation
|
|
8869
8898
|
// extraCoinsToFitMinMax = AmountUtils.trim(extraUsdToFitMinMax.div(fromCoinToUsdRate), fromCoin.digits);
|
|
8870
8899
|
// }
|
|
8871
|
-
let min = null;
|
|
8872
8900
|
if (data != null && data.min_amount) {
|
|
8873
8901
|
min = AmountUtils.trim(data == null ? void 0 : data.min_amount, amountIsToReceive ? toCoin.digits : fromCoin.digits);
|
|
8874
8902
|
}
|
|
8875
|
-
let max = null;
|
|
8876
8903
|
if (data != null && data.max_amount) {
|
|
8877
8904
|
max = AmountUtils.trim(data == null ? void 0 : data.max_amount, amountIsToReceive ? toCoin.digits : fromCoin.digits);
|
|
8878
8905
|
}
|
|
@@ -8924,8 +8951,16 @@ class LetsExchangeSwapProvider extends SwapProvider {
|
|
|
8924
8951
|
isRefundAddressRequired: false
|
|
8925
8952
|
};
|
|
8926
8953
|
} catch (e) {
|
|
8927
|
-
var _e$response;
|
|
8928
|
-
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) {
|
|
8929
8964
|
return {
|
|
8930
8965
|
result: false,
|
|
8931
8966
|
reason: SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
@@ -8998,14 +9033,14 @@ class LetsExchangeSwapProvider extends SwapProvider {
|
|
|
8998
9033
|
Logger.log(errorMessage, loggerSource);
|
|
8999
9034
|
throw new Error(errorMessage);
|
|
9000
9035
|
} catch (e) {
|
|
9001
|
-
var _e$
|
|
9036
|
+
var _e$response3, _e$response4;
|
|
9002
9037
|
Logger.logError(e, loggerSource, `Failed to create swap. Error is: ${safeStringify(e)}`);
|
|
9003
9038
|
const composeFailResult = reason => ({
|
|
9004
9039
|
result: false,
|
|
9005
9040
|
reason: reason
|
|
9006
9041
|
});
|
|
9007
|
-
const status = e == null || (_e$
|
|
9008
|
-
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;
|
|
9009
9044
|
if (status === 429) {
|
|
9010
9045
|
Logger.log(`Returning fail - RPS limit exceeded ${data}`, loggerSource);
|
|
9011
9046
|
return composeFailResult(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
|
|
@@ -9037,7 +9072,10 @@ class LetsExchangeSwapProvider extends SwapProvider {
|
|
|
9037
9072
|
const isExpiredByTime = expiresAt && expiresAt < Date.now();
|
|
9038
9073
|
const status = this._mapLetsExchangeStatusToRabbitStatus(swap.status, isExpiredByTime);
|
|
9039
9074
|
const toDigits = status === SwapProvider.SWAP_STATUSES.REFUNDED ? fromCoin.digits : toCoin.digits;
|
|
9040
|
-
|
|
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);
|
|
9041
9079
|
}).flat();
|
|
9042
9080
|
Logger.log(`Swap details result ${safeStringify(swaps)}`, loggerSource);
|
|
9043
9081
|
return {
|
|
@@ -9045,14 +9083,14 @@ class LetsExchangeSwapProvider extends SwapProvider {
|
|
|
9045
9083
|
swaps: swaps
|
|
9046
9084
|
};
|
|
9047
9085
|
} catch (e) {
|
|
9048
|
-
var _e$
|
|
9086
|
+
var _e$response5, _e$response6;
|
|
9049
9087
|
Logger.logError(e, loggerSource, `Failed to get swap details. Error is: ${safeStringify(e)}`);
|
|
9050
9088
|
const composeFailResult = reason => ({
|
|
9051
9089
|
result: false,
|
|
9052
9090
|
reason: reason
|
|
9053
9091
|
});
|
|
9054
|
-
const status = e == null || (_e$
|
|
9055
|
-
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;
|
|
9056
9094
|
if (status === 429) {
|
|
9057
9095
|
Logger.log(`Returning fail - RPS limit exceeded ${data}`, loggerSource);
|
|
9058
9096
|
return composeFailResult(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
|
|
@@ -9060,21 +9098,21 @@ class LetsExchangeSwapProvider extends SwapProvider {
|
|
|
9060
9098
|
improveAndRethrow(e, loggerSource);
|
|
9061
9099
|
}
|
|
9062
9100
|
}
|
|
9063
|
-
|
|
9064
|
-
// TODO: [dev] Serg, please check this during the review to make sure I did no mistakes in statuses mapping.
|
|
9065
|
-
// I will remove these comments after the review. https://api.letsexchange.io/doc
|
|
9066
|
-
// wait The exchange has just been created and it’s waiting for coins to reach the deposit wallet
|
|
9067
|
-
// confirmation The transaction appears in mempool and now it is waiting for necessary network confirmations to start.
|
|
9068
|
-
// confirmed The user’s payment is confirmed, the exchange process is about to start.
|
|
9069
|
-
// exchanging The exchange process is running.
|
|
9070
|
-
// sending Funds are being sent to the recipient`s address.
|
|
9071
|
-
// sending_confirmation The outgoing transaction is waiting for network confirmations.
|
|
9072
|
-
// success The exchange is completed and the funds are successfully sent to the recipient’s address.
|
|
9073
|
-
// aml_check_failed The deposit was marked as risky by AML check service.
|
|
9074
|
-
// overdue The deposit receiving time for this transaction has expired.
|
|
9075
|
-
// error The transaction has failed. In most cases, the amount that was sent differs from the amount that was specified when creating the transaction.
|
|
9076
|
-
// refund The exchange failed and the coins were refunded to the user's wallet.
|
|
9077
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
|
+
*/
|
|
9078
9116
|
switch (status) {
|
|
9079
9117
|
case "wait":
|
|
9080
9118
|
if (isExpiredByTime) {
|
|
@@ -9088,7 +9126,7 @@ class LetsExchangeSwapProvider extends SwapProvider {
|
|
|
9088
9126
|
case "exchanging":
|
|
9089
9127
|
return SwapProvider.SWAP_STATUSES.EXCHANGING;
|
|
9090
9128
|
case "sending":
|
|
9091
|
-
return SwapProvider.SWAP_STATUSES.
|
|
9129
|
+
return SwapProvider.SWAP_STATUSES.EXCHANGING;
|
|
9092
9130
|
case "sending_confirmation":
|
|
9093
9131
|
return SwapProvider.SWAP_STATUSES.EXCHANGING;
|
|
9094
9132
|
case "success":
|
|
@@ -9243,7 +9281,7 @@ class PublicSwapService {
|
|
|
9243
9281
|
*
|
|
9244
9282
|
* @param fromCoin {Coin}
|
|
9245
9283
|
* @param toCoin {Coin}
|
|
9246
|
-
* @param
|
|
9284
|
+
* @param amountCoins {string}
|
|
9247
9285
|
* @param [fixed=false] {boolean|null} null means fixed or float doesn't matter
|
|
9248
9286
|
* @param [withoutFiat=false] {boolean} pass true if you don't need the fiat equivalent - this will diminish requests count
|
|
9249
9287
|
* @param [amountIsToReceive=false] {boolean} whether the given amount is receiving amount.
|
|
@@ -9261,7 +9299,7 @@ class PublicSwapService {
|
|
|
9261
9299
|
* swapCreationInfo: BaseSwapCreationInfo
|
|
9262
9300
|
* }>}
|
|
9263
9301
|
*/
|
|
9264
|
-
async getPublicSwapDetails(fromCoin, toCoin,
|
|
9302
|
+
async getPublicSwapDetails(fromCoin, toCoin, amountCoins, fixed = false, withoutFiat = false, amountIsToReceive = false) {
|
|
9265
9303
|
const loggerSource = "getPublicSwapDetails";
|
|
9266
9304
|
try {
|
|
9267
9305
|
var _await$getCoinToUSDTR, _await$getCoinToUSDTR2, _result$swapCreationI, _result$swapCreationI2;
|
|
@@ -9269,7 +9307,7 @@ class PublicSwapService {
|
|
|
9269
9307
|
throw new Error("Estimating allowed only for fixed rate.");
|
|
9270
9308
|
}
|
|
9271
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;
|
|
9272
|
-
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);
|
|
9273
9311
|
|
|
9274
9312
|
// eslint-disable-next-line no-console
|
|
9275
9313
|
console.log("getSwapInfo result: ", details);
|
|
@@ -9309,13 +9347,14 @@ class PublicSwapService {
|
|
|
9309
9347
|
return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.NO_FIXED_BUT_HAVE_FLOATING_PUBLIC_SWAP_OPTION);
|
|
9310
9348
|
}
|
|
9311
9349
|
}
|
|
9312
|
-
const
|
|
9313
|
-
if (typeof min === "string" &&
|
|
9350
|
+
const amountBigNumber = BigNumber(amountCoins);
|
|
9351
|
+
if (typeof min === "string" && amountBigNumber.lt(min)) {
|
|
9314
9352
|
return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.AMOUNT_LESS_THAN_MIN_SWAPPABLE);
|
|
9315
|
-
} else if (typeof max === "string" &&
|
|
9353
|
+
} else if (typeof max === "string" && amountBigNumber.gt(max)) {
|
|
9316
9354
|
return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.AMOUNT_HIGHER_THAN_MAX_SWAPPABLE);
|
|
9317
9355
|
}
|
|
9318
|
-
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);
|
|
9319
9358
|
const result = {
|
|
9320
9359
|
result: true,
|
|
9321
9360
|
swapCreationInfo: new BaseSwapCreationInfo(fromCoin, toCoin, fromAmountCoins, toAmountCoins, details.rate, details.rawSwapData, min, fiatMin, max, fiatMax, details.durationMinutesRange, details.fixed, details.isRefundAddressRequired)
|