@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.module.js
CHANGED
|
@@ -4728,7 +4728,7 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4728
4728
|
_ref$formHasBalance = _ref.formHasBalance,
|
|
4729
4729
|
formHasBalance = _ref$formHasBalance === void 0 ? false : _ref$formHasBalance,
|
|
4730
4730
|
_ref$retrieveSwapDeta = _ref.retrieveSwapDetails,
|
|
4731
|
-
retrieveSwapDetails = _ref$retrieveSwapDeta === void 0 ? function (sendingAssetTicker, receivingAssetTicker, amount, isSwapAll,
|
|
4731
|
+
retrieveSwapDetails = _ref$retrieveSwapDeta === void 0 ? function (sendingAssetTicker, receivingAssetTicker, amount, isSwapAll, isFixed, amountIsToReceive) {
|
|
4732
4732
|
return Promise.resolve();
|
|
4733
4733
|
} : _ref$retrieveSwapDeta,
|
|
4734
4734
|
_ref$retrieveInitialS = _ref.retrieveInitialSwapData,
|
|
@@ -4755,6 +4755,10 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4755
4755
|
termsOfUseUrl = _ref$termsOfUseUrl === void 0 ? null : _ref$termsOfUseUrl,
|
|
4756
4756
|
_ref$privacyPolicyUrl = _ref.privacyPolicyUrl,
|
|
4757
4757
|
privacyPolicyUrl = _ref$privacyPolicyUrl === void 0 ? null : _ref$privacyPolicyUrl,
|
|
4758
|
+
_ref$getExtraIdNameBy = _ref.getExtraIdNameByTicker,
|
|
4759
|
+
getExtraIdNameByTicker = _ref$getExtraIdNameBy === void 0 ? function (ticker) {
|
|
4760
|
+
return null;
|
|
4761
|
+
} : _ref$getExtraIdNameBy,
|
|
4758
4762
|
_ref$validateAddressB = _ref.validateAddressByTicker,
|
|
4759
4763
|
validateAddressByTicker = _ref$validateAddressB === void 0 ? function () {
|
|
4760
4764
|
return false;
|
|
@@ -4764,8 +4768,6 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4764
4768
|
swapButtonAlwaysActive = _ref$swapButtonAlways === void 0 ? false : _ref$swapButtonAlways,
|
|
4765
4769
|
_ref$onIsFixedChange = _ref.onIsFixedChange,
|
|
4766
4770
|
onIsFixedChange = _ref$onIsFixedChange === void 0 ? function () {} : _ref$onIsFixedChange,
|
|
4767
|
-
recipientAddressExtraIdName = _ref.recipientAddressExtraIdName,
|
|
4768
|
-
refundAddressExtraIdName = _ref.refundAddressExtraIdName,
|
|
4769
4771
|
_ref$translations = _ref.translations,
|
|
4770
4772
|
translations = _ref$translations === void 0 ? {
|
|
4771
4773
|
swapAllButtonTitles: {
|
|
@@ -5047,14 +5049,12 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
5047
5049
|
setIsPairSupported(true);
|
|
5048
5050
|
setIsSwapCalculated(false);
|
|
5049
5051
|
return Promise.resolve(retrieveSwapDetails(sendingAssetTicker, receivingAssetTicker, amount, isSwapAll.current, (_isFixedRate$current = isFixedRate.current) != null ? _isFixedRate$current : IS_FIXED_BY_DEFAULT, isFixedRate.current ? isLastEditedReceiving : false)).then(function (response) {
|
|
5050
|
-
if (!isSwapAll.current && String(amount) !== String(isForPreserved && sendAssetAmount.current == null ? preservedAmount : sendAssetAmount.current)) {
|
|
5052
|
+
if (!isSwapAll.current && String(amount) !== String(isForPreserved && sendAssetAmount.current == null ? preservedAmount : isFixedRate.current && isLastEditedReceiving ? receiveAssetAmount.current : sendAssetAmount.current)) {
|
|
5051
5053
|
// Means amount changed and we no more need to do this exact calculation
|
|
5052
5054
|
return;
|
|
5053
5055
|
}
|
|
5054
5056
|
if (response.result) {
|
|
5055
5057
|
var swapCreationInfo = response.swapCreationInfo;
|
|
5056
|
-
setUpdateSendInputTo(swapCreationInfo.fromAmountCoins);
|
|
5057
|
-
setUpdateReceiveInputTo(swapCreationInfo.toAmountCoins);
|
|
5058
5058
|
if (isSwapAll.current) {
|
|
5059
5059
|
setIsAmountZero(BigNumber("0").eq(swapCreationInfo.fromAmountCoins));
|
|
5060
5060
|
}
|
|
@@ -5063,6 +5063,8 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
5063
5063
|
setIsRefundAddressRequired(swapCreationInfo == null ? void 0 : swapCreationInfo.isRefundAddressRequired);
|
|
5064
5064
|
processMinMaxAmounts(isSwapAll.current ? swapCreationInfo.fromAmountCoins : amount);
|
|
5065
5065
|
setIsSwapCalculated(true);
|
|
5066
|
+
setUpdateSendInputTo(swapCreationInfo.fromAmountCoins);
|
|
5067
|
+
setUpdateReceiveInputTo(swapCreationInfo.toAmountCoins);
|
|
5066
5068
|
} else {
|
|
5067
5069
|
handleSwapServiceError(response.reason, setValidationContent, setBalanceValid, setMinimalAmountValid, setMaximumAmountValid, setIsPairSupported, setIsSameCoins);
|
|
5068
5070
|
if (isSwapAll.current) {
|
|
@@ -5252,7 +5254,11 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
5252
5254
|
}, [updateSendInputTo, updateReceiveInputTo]);
|
|
5253
5255
|
useEffect(function () {
|
|
5254
5256
|
if (swapRate != null && sendAssetAmount.current != null) {
|
|
5255
|
-
|
|
5257
|
+
if (isLastEditedReceiving) {
|
|
5258
|
+
setUpdateSendInputTo(AmountUtils.trim(BigNumber(receiveAssetAmount.current).div(swapRate), sendingAssetDecimalCount));
|
|
5259
|
+
} else {
|
|
5260
|
+
setUpdateReceiveInputTo(AmountUtils.trim(BigNumber(sendAssetAmount.current).times(swapRate), receivingAssetDecimalCount));
|
|
5261
|
+
}
|
|
5256
5262
|
}
|
|
5257
5263
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5258
5264
|
}, [swapRate]);
|
|
@@ -5274,6 +5280,8 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
5274
5280
|
setIsSwapCalculated(false);
|
|
5275
5281
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5276
5282
|
}, [sendAssetAmount.current]);
|
|
5283
|
+
var recipientAddressExtraIdName = getExtraIdNameByTicker(receivingAssetTicker);
|
|
5284
|
+
var refundAddressExtraIdName = getExtraIdNameByTicker(sendingAssetTicker);
|
|
5277
5285
|
return /*#__PURE__*/React.createElement("div", {
|
|
5278
5286
|
className: s$9["swap-form"]
|
|
5279
5287
|
}, /*#__PURE__*/React.createElement(TitleBox, {
|
|
@@ -5313,7 +5321,7 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
5313
5321
|
upperFormPosition: true,
|
|
5314
5322
|
errorEncountered: !minimalAmountValid,
|
|
5315
5323
|
ref: fromAssetSelectionButtonRef,
|
|
5316
|
-
isLoading: false,
|
|
5324
|
+
isLoading: isLastEditedReceiving ? isLoading.current : false,
|
|
5317
5325
|
cryptoAssetToFiatRate: sendingAssetToFiatRate,
|
|
5318
5326
|
fiatCurrencyCode: formHasFiat ? fiatCurrencyCode : null,
|
|
5319
5327
|
fiatCurrencyDecimals: fiatCurrencyDecimals,
|
|
@@ -5347,7 +5355,7 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
5347
5355
|
lowerFormPosition: true,
|
|
5348
5356
|
estimateAmount: !isFixedRate.current,
|
|
5349
5357
|
ref: toAssetSelectionButtonRef,
|
|
5350
|
-
isLoading: isLoading.current,
|
|
5358
|
+
isLoading: isLastEditedReceiving ? false : isLoading.current,
|
|
5351
5359
|
cryptoAssetToFiatRate: receivingAssetToFiatRate,
|
|
5352
5360
|
fiatCurrencyCode: formHasFiat ? fiatCurrencyCode : null,
|
|
5353
5361
|
fiatCurrencyDecimals: fiatCurrencyDecimals,
|
|
@@ -9674,8 +9682,28 @@ var SwapProvider = /*#__PURE__*/function () {
|
|
|
9674
9682
|
* @private
|
|
9675
9683
|
*/;
|
|
9676
9684
|
_proto._putPopularCoinsFirst = function _putPopularCoinsFirst() {
|
|
9685
|
+
var 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"];
|
|
9677
9686
|
this._supportedCoins.sort(function (i1, i2) {
|
|
9678
|
-
|
|
9687
|
+
var isInPopularList1 = popularCoinsList.includes(i1.coin.ticker);
|
|
9688
|
+
var isInPopularList2 = popularCoinsList.includes(i2.coin.ticker);
|
|
9689
|
+
|
|
9690
|
+
// If both are in the popularCoinsList, sort by their index in the list
|
|
9691
|
+
if (isInPopularList1 && isInPopularList2) {
|
|
9692
|
+
var index1 = popularCoinsList.indexOf(i1.coin.ticker);
|
|
9693
|
+
var index2 = popularCoinsList.indexOf(i2.coin.ticker);
|
|
9694
|
+
return index1 - index2;
|
|
9695
|
+
}
|
|
9696
|
+
|
|
9697
|
+
// Sort by whether the coin is in the popularCoinsList
|
|
9698
|
+
if (isInPopularList1 && !isInPopularList2) return -1;
|
|
9699
|
+
if (!isInPopularList1 && isInPopularList2) return 1;
|
|
9700
|
+
|
|
9701
|
+
// If both are not in the popularCoinsList, use the isPopular flag - partners can fill it
|
|
9702
|
+
var p1 = i1.isPopular;
|
|
9703
|
+
var p2 = i2.isPopular;
|
|
9704
|
+
if (p1 !== p2) return p2 - p1;
|
|
9705
|
+
|
|
9706
|
+
// By default, sort by the coin ticker
|
|
9679
9707
|
return i1.coin.ticker.localeCompare(i2.coin.ticker);
|
|
9680
9708
|
});
|
|
9681
9709
|
}
|
|
@@ -10568,7 +10596,7 @@ var SwapspaceSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
10568
10596
|
var swaps = wo404.map(function (r) {
|
|
10569
10597
|
return r.data;
|
|
10570
10598
|
}).map(function (swap, index) {
|
|
10571
|
-
var _this6$_supportedCoin, _this6$_supportedCoin2, _swap$from$extraId, _swap$to$extraId, _swap$refundExtraId;
|
|
10599
|
+
var _this6$_supportedCoin, _this6$_supportedCoin2, _swap$blockExplorerTr, _swap$from$extraId, _swap$to$extraId, _swap$refundExtraId;
|
|
10572
10600
|
var fromCoin = (_this6$_supportedCoin = _this6._supportedCoins.find(function (i) {
|
|
10573
10601
|
return i.code === swap.from.code && i.network === swap.from.network;
|
|
10574
10602
|
})) == null ? void 0 : _this6$_supportedCoin.coin;
|
|
@@ -10586,7 +10614,8 @@ var SwapspaceSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
10586
10614
|
var status = _this6._mapSwapspaceStatusToRabbitStatus(swap.status, isExpiredByTime);
|
|
10587
10615
|
var toDigits = status === SwapProvider.SWAP_STATUSES.REFUNDED ? fromCoin.digits : toCoin.digits;
|
|
10588
10616
|
var addressToSendCoinsToSwapspace = swap.from.address;
|
|
10589
|
-
|
|
10617
|
+
var toUrl = ((_swap$blockExplorerTr = swap.blockExplorerTransactionUrl.to) != null ? _swap$blockExplorerTr : "").replace(/from=swapspace&?/g, "").replaceAll(/&&+/g, "&").replace("?&", "?").replace(/&$/, "").replace(/\?$/, "");
|
|
10618
|
+
return new ExistingSwap(swapIds[index], status, toUtcTimestamp(swap.timestamps.createdAt), expiresAt, swap.confirmations, AmountUtils.trim(swap.rate, _this6._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);
|
|
10590
10619
|
}).flat();
|
|
10591
10620
|
Logger.log("Swap details result " + safeStringify(swaps), loggerSource);
|
|
10592
10621
|
return {
|
|
@@ -11082,6 +11111,8 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
11082
11111
|
try {
|
|
11083
11112
|
var _this3 = this;
|
|
11084
11113
|
var loggerSource = "getSwapInfo";
|
|
11114
|
+
var min = null;
|
|
11115
|
+
var max = null;
|
|
11085
11116
|
return Promise.resolve(_catch$1(function () {
|
|
11086
11117
|
if (!(fromCoin instanceof Coin) || !(toCoin instanceof Coin) || typeof amountCoins !== "string" || BigNumber(amountCoins).lt("0") || fixed !== null && typeof fixed !== "boolean" || amountIsToReceive && !fixed) {
|
|
11087
11118
|
throw new Error("Wrong input params: " + amountCoins + " " + fromCoin.ticker + " -> " + toCoin.ticker + ", " + (fromCoin instanceof Coin) + ", " + (toCoin instanceof Coin) + ", " + typeof fixed + " " + fixed + ", " + amountIsToReceive);
|
|
@@ -11123,11 +11154,9 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
11123
11154
|
// const extraUsdToFitMinMax = BigNumber("1"); // We correct the limits as the exact limit can fluctuate and cause failed swap creation
|
|
11124
11155
|
// extraCoinsToFitMinMax = AmountUtils.trim(extraUsdToFitMinMax.div(fromCoinToUsdRate), fromCoin.digits);
|
|
11125
11156
|
// }
|
|
11126
|
-
var min = null;
|
|
11127
11157
|
if (data != null && data.min_amount) {
|
|
11128
11158
|
min = AmountUtils.trim(data == null ? void 0 : data.min_amount, amountIsToReceive ? toCoin.digits : fromCoin.digits);
|
|
11129
11159
|
}
|
|
11130
|
-
var max = null;
|
|
11131
11160
|
if (data != null && data.max_amount) {
|
|
11132
11161
|
max = AmountUtils.trim(data == null ? void 0 : data.max_amount, amountIsToReceive ? toCoin.digits : fromCoin.digits);
|
|
11133
11162
|
}
|
|
@@ -11180,8 +11209,16 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
11180
11209
|
};
|
|
11181
11210
|
});
|
|
11182
11211
|
}, function (e) {
|
|
11183
|
-
var _e$response;
|
|
11184
|
-
if ((e == null || (_e$response = e.response) == null ? void 0 : _e$response.status) ===
|
|
11212
|
+
var _e$response, _e$response2;
|
|
11213
|
+
if ((e == null || (_e$response = e.response) == null ? void 0 : _e$response.status) === 404) {
|
|
11214
|
+
return {
|
|
11215
|
+
result: false,
|
|
11216
|
+
reason: SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED,
|
|
11217
|
+
smallestMin: min,
|
|
11218
|
+
greatestMax: max
|
|
11219
|
+
};
|
|
11220
|
+
}
|
|
11221
|
+
if ((e == null || (_e$response2 = e.response) == null ? void 0 : _e$response2.status) === 429) {
|
|
11185
11222
|
return {
|
|
11186
11223
|
result: false,
|
|
11187
11224
|
reason: SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED
|
|
@@ -11269,7 +11306,7 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
11269
11306
|
throw new Error(errorMessage);
|
|
11270
11307
|
});
|
|
11271
11308
|
}, function (e) {
|
|
11272
|
-
var _e$
|
|
11309
|
+
var _e$response3, _e$response4;
|
|
11273
11310
|
Logger.logError(e, loggerSource, "Failed to create swap. Error is: " + safeStringify(e));
|
|
11274
11311
|
var composeFailResult = function composeFailResult(reason) {
|
|
11275
11312
|
return {
|
|
@@ -11277,8 +11314,8 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
11277
11314
|
reason: reason
|
|
11278
11315
|
};
|
|
11279
11316
|
};
|
|
11280
|
-
var status = e == null || (_e$
|
|
11281
|
-
var data = e == null || (_e$
|
|
11317
|
+
var status = e == null || (_e$response3 = e.response) == null ? void 0 : _e$response3.status;
|
|
11318
|
+
var data = e == null || (_e$response4 = e.response) == null ? void 0 : _e$response4.data;
|
|
11282
11319
|
if (status === 429) {
|
|
11283
11320
|
Logger.log("Returning fail - RPS limit exceeded " + data, loggerSource);
|
|
11284
11321
|
return composeFailResult(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
|
|
@@ -11323,7 +11360,10 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
11323
11360
|
var isExpiredByTime = expiresAt && expiresAt < Date.now();
|
|
11324
11361
|
var status = _this5._mapLetsExchangeStatusToRabbitStatus(swap.status, isExpiredByTime);
|
|
11325
11362
|
var toDigits = status === SwapProvider.SWAP_STATUSES.REFUNDED ? fromCoin.digits : toCoin.digits;
|
|
11326
|
-
|
|
11363
|
+
var deposit = swap.real_deposit_amount && swap.real_deposit_amount !== "" ? swap.real_deposit_amount : swap.deposit_amount;
|
|
11364
|
+
var withdrawal = swap.real_withdrawal_amount && swap.real_withdrawal_amount !== "" ? swap.real_withdrawal_amount : swap.withdrawal_amount;
|
|
11365
|
+
var rate = BigNumber(withdrawal).div(deposit).toFixed(_this5._maxRateDigits); // We don't use their rate as it excludes their fee
|
|
11366
|
+
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);
|
|
11327
11367
|
}).flat();
|
|
11328
11368
|
Logger.log("Swap details result " + safeStringify(swaps), loggerSource);
|
|
11329
11369
|
return {
|
|
@@ -11332,7 +11372,7 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
11332
11372
|
};
|
|
11333
11373
|
});
|
|
11334
11374
|
}, function (e) {
|
|
11335
|
-
var _e$
|
|
11375
|
+
var _e$response5, _e$response6;
|
|
11336
11376
|
Logger.logError(e, loggerSource, "Failed to get swap details. Error is: " + safeStringify(e));
|
|
11337
11377
|
var composeFailResult = function composeFailResult(reason) {
|
|
11338
11378
|
return {
|
|
@@ -11340,8 +11380,8 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
11340
11380
|
reason: reason
|
|
11341
11381
|
};
|
|
11342
11382
|
};
|
|
11343
|
-
var status = e == null || (_e$
|
|
11344
|
-
var data = e == null || (_e$
|
|
11383
|
+
var status = e == null || (_e$response5 = e.response) == null ? void 0 : _e$response5.status;
|
|
11384
|
+
var data = e == null || (_e$response6 = e.response) == null ? void 0 : _e$response6.data;
|
|
11345
11385
|
if (status === 429) {
|
|
11346
11386
|
Logger.log("Returning fail - RPS limit exceeded " + data, loggerSource);
|
|
11347
11387
|
return composeFailResult(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
|
|
@@ -11351,21 +11391,22 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
11351
11391
|
} catch (e) {
|
|
11352
11392
|
return Promise.reject(e);
|
|
11353
11393
|
}
|
|
11354
|
-
}
|
|
11355
|
-
// I will remove these comments after the review. https://api.letsexchange.io/doc
|
|
11356
|
-
// wait The exchange has just been created and it’s waiting for coins to reach the deposit wallet
|
|
11357
|
-
// confirmation The transaction appears in mempool and now it is waiting for necessary network confirmations to start.
|
|
11358
|
-
// confirmed The user’s payment is confirmed, the exchange process is about to start.
|
|
11359
|
-
// exchanging The exchange process is running.
|
|
11360
|
-
// sending Funds are being sent to the recipient`s address.
|
|
11361
|
-
// sending_confirmation The outgoing transaction is waiting for network confirmations.
|
|
11362
|
-
// success The exchange is completed and the funds are successfully sent to the recipient’s address.
|
|
11363
|
-
// aml_check_failed The deposit was marked as risky by AML check service.
|
|
11364
|
-
// overdue The deposit receiving time for this transaction has expired.
|
|
11365
|
-
// error The transaction has failed. In most cases, the amount that was sent differs from the amount that was specified when creating the transaction.
|
|
11366
|
-
// refund The exchange failed and the coins were refunded to the user's wallet.
|
|
11367
|
-
;
|
|
11394
|
+
};
|
|
11368
11395
|
_proto._mapLetsExchangeStatusToRabbitStatus = function _mapLetsExchangeStatusToRabbitStatus(status, isExpiredByTime) {
|
|
11396
|
+
/**
|
|
11397
|
+
* Lets exchange statuses description
|
|
11398
|
+
* wait - The exchange has just been created and it’s waiting for coins to reach the deposit wallet
|
|
11399
|
+
* confirmation - The transaction appears in mempool and now it is waiting for necessary network confirmations to start.
|
|
11400
|
+
* confirmed - The user’s payment is confirmed, the exchange process is about to start.
|
|
11401
|
+
* exchanging - The exchange process is running.
|
|
11402
|
+
* sending - Funds are being sent to the recipient`s address.
|
|
11403
|
+
* sending_confirmation - The outgoing transaction is waiting for network confirmations.
|
|
11404
|
+
* success - The exchange is completed and the funds are successfully sent to the recipient’s address.
|
|
11405
|
+
* aml_check_failed - The deposit was marked as risky by AML check service.
|
|
11406
|
+
* overdue - The deposit receiving time for this transaction has expired.
|
|
11407
|
+
* error - The transaction has failed. In most cases, the amount that was sent differs from the amount that was specified when creating the transaction.
|
|
11408
|
+
* refund - The exchange failed and the coins were refunded to the user's wallet.
|
|
11409
|
+
*/
|
|
11369
11410
|
switch (status) {
|
|
11370
11411
|
case "wait":
|
|
11371
11412
|
if (isExpiredByTime) {
|
|
@@ -11379,7 +11420,7 @@ var LetsExchangeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
11379
11420
|
case "exchanging":
|
|
11380
11421
|
return SwapProvider.SWAP_STATUSES.EXCHANGING;
|
|
11381
11422
|
case "sending":
|
|
11382
|
-
return SwapProvider.SWAP_STATUSES.
|
|
11423
|
+
return SwapProvider.SWAP_STATUSES.EXCHANGING;
|
|
11383
11424
|
case "sending_confirmation":
|
|
11384
11425
|
return SwapProvider.SWAP_STATUSES.EXCHANGING;
|
|
11385
11426
|
case "success":
|
|
@@ -11599,7 +11640,7 @@ var PublicSwapService = /*#__PURE__*/function () {
|
|
|
11599
11640
|
*
|
|
11600
11641
|
* @param fromCoin {Coin}
|
|
11601
11642
|
* @param toCoin {Coin}
|
|
11602
|
-
* @param
|
|
11643
|
+
* @param amountCoins {string}
|
|
11603
11644
|
* @param [fixed=false] {boolean|null} null means fixed or float doesn't matter
|
|
11604
11645
|
* @param [withoutFiat=false] {boolean} pass true if you don't need the fiat equivalent - this will diminish requests count
|
|
11605
11646
|
* @param [amountIsToReceive=false] {boolean} whether the given amount is receiving amount.
|
|
@@ -11618,7 +11659,7 @@ var PublicSwapService = /*#__PURE__*/function () {
|
|
|
11618
11659
|
* }>}
|
|
11619
11660
|
*/
|
|
11620
11661
|
;
|
|
11621
|
-
_proto.getPublicSwapDetails = function getPublicSwapDetails(fromCoin, toCoin,
|
|
11662
|
+
_proto.getPublicSwapDetails = function getPublicSwapDetails(fromCoin, toCoin, amountCoins, fixed, withoutFiat, amountIsToReceive) {
|
|
11622
11663
|
if (fixed === void 0) {
|
|
11623
11664
|
fixed = false;
|
|
11624
11665
|
}
|
|
@@ -11635,7 +11676,7 @@ var PublicSwapService = /*#__PURE__*/function () {
|
|
|
11635
11676
|
function _temp2(_getCoinToUSDTRate) {
|
|
11636
11677
|
var _getCoinToUSDTRate$ra;
|
|
11637
11678
|
var coinUsdtRate = withoutFiat ? _getCoinToUSDTRate : (_getCoinToUSDTRate$ra = _getCoinToUSDTRate == null ? void 0 : _getCoinToUSDTRate.rate) != null ? _getCoinToUSDTRate$ra : null;
|
|
11638
|
-
return Promise.resolve((fixed ? _this7._fixedSwapProvider : _this7._swapProvider).getSwapInfo(fromCoin, toCoin,
|
|
11679
|
+
return Promise.resolve((fixed ? _this7._fixedSwapProvider : _this7._swapProvider).getSwapInfo(fromCoin, toCoin, amountCoins, fixed, coinUsdtRate, amountIsToReceive)).then(function (details) {
|
|
11639
11680
|
var _result$swapCreationI, _result$swapCreationI2;
|
|
11640
11681
|
// eslint-disable-next-line no-console
|
|
11641
11682
|
console.log("getSwapInfo result: ", details);
|
|
@@ -11675,13 +11716,14 @@ var PublicSwapService = /*#__PURE__*/function () {
|
|
|
11675
11716
|
return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.NO_FIXED_BUT_HAVE_FLOATING_PUBLIC_SWAP_OPTION);
|
|
11676
11717
|
}
|
|
11677
11718
|
}
|
|
11678
|
-
var
|
|
11679
|
-
if (typeof min === "string" &&
|
|
11719
|
+
var amountBigNumber = BigNumber(amountCoins);
|
|
11720
|
+
if (typeof min === "string" && amountBigNumber.lt(min)) {
|
|
11680
11721
|
return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.AMOUNT_LESS_THAN_MIN_SWAPPABLE);
|
|
11681
|
-
} else if (typeof max === "string" &&
|
|
11722
|
+
} else if (typeof max === "string" && amountBigNumber.gt(max)) {
|
|
11682
11723
|
return composeFailResult(PublicSwapService.PUBLIC_SWAP_DETAILS_FAIL_REASONS.AMOUNT_HIGHER_THAN_MAX_SWAPPABLE);
|
|
11683
11724
|
}
|
|
11684
|
-
var
|
|
11725
|
+
var fromAmountCoins = amountIsToReceive ? AmountUtils.trim(amountBigNumber.div(details.rate), fromCoin.digits) : amountCoins;
|
|
11726
|
+
var toAmountCoins = amountIsToReceive ? amountCoins : AmountUtils.trim(amountBigNumber.times(details.rate), toCoin.digits);
|
|
11685
11727
|
var result = {
|
|
11686
11728
|
result: true,
|
|
11687
11729
|
swapCreationInfo: new BaseSwapCreationInfo(fromCoin, toCoin, fromAmountCoins, toAmountCoins, details.rate, details.rawSwapData, min, fiatMin, max, fiatMax, details.durationMinutesRange, details.fixed, details.isRefundAddressRequired)
|