@rabbitio/ui-kit 1.0.0-beta.71 → 1.0.0-beta.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/coverage/clover.xml +12889 -8253
- package/coverage/coverage-final.json +157 -99
- package/coverage/index.html +385 -220
- package/coverage/{rabbit-ui-kit → ui-kit}/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/index.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/adapters/axiosAdapter.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/adapters/index.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/adapters/qrUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/amountUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/errorUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/external-apis/apiGroups.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/external-apis/index.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/external-apis/ipAddressProviders.js.html +5 -5
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/fiatCurrenciesService.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/constants → ui-kit/src/common-apis}/globalConstants.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/index.html +22 -7
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/models/blockchain.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/models/coin.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/models/index.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/models/protocol.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/utils/cache.js.html +8 -8
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/utils/emailAPI.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/utils/index.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/utils/logging/index.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/utils/logging/logger.js.html +6 -6
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/utils/logging/logsStorage.js.html +5 -5
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/utils/postponeExecution.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/common → ui-kit/src/common-apis}/utils/safeStringify.js.html +29 -29
- package/coverage/{rabbit-ui-kit → ui-kit}/src/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/index.js.html +68 -80
- package/coverage/{rabbit-ui-kit/src/robustExteranlApiCallerService → ui-kit/src/robust-api-caller}/cacheAndConcurrentRequestsResolver.js.html +5 -5
- package/coverage/{rabbit-ui-kit/src/robustExteranlApiCallerService → ui-kit/src/robust-api-caller}/cachedRobustExternalApiCallerService.js.html +6 -6
- package/coverage/{rabbit-ui-kit/src/robustExteranlApiCallerService → ui-kit/src/robust-api-caller}/cancelProcessing.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/robustExteranlApiCallerService → ui-kit/src/robust-api-caller}/concurrentCalculationsMetadataHolder.js.html +4 -4
- package/coverage/{rabbit-ui-kit/src/robustExteranlApiCallerService → ui-kit/src/robust-api-caller}/externalApiProvider.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/robustExteranlApiCallerService → ui-kit/src/robust-api-caller}/externalServicesStatsCollector.js.html +5 -5
- package/coverage/{rabbit-ui-kit/src/robustExteranlApiCallerService → ui-kit/src/robust-api-caller}/index.html +3 -3
- package/coverage/{rabbit-ui-kit/src/robustExteranlApiCallerService → ui-kit/src/robust-api-caller}/robustExternalAPICallerService.js.html +8 -8
- package/coverage/ui-kit/src/swaps-lib/external-apis/index.html +146 -0
- package/coverage/ui-kit/src/swaps-lib/external-apis/letsExchangeSwapProvider.js.html +1456 -0
- package/coverage/ui-kit/src/swaps-lib/external-apis/swapProvider.js.html +1390 -0
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +182 -662
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/baseSwapCreationInfo.js.html +16 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/existingSwap.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/existingSwapWithFiatData.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/index.html +9 -9
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/services/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/services/publicSwapService.js.html +243 -57
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/utils/index.html +13 -13
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/utils/swapUtils.js.html +127 -52
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/arrowIcon.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/arrowTosca.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/arrowWhite.jsx.html +11 -11
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/darkRectangle.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/determinedError.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/failedValidationIcon.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/index.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/infoIcon.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/noticeQuestionIcon.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/successfulValidationIcon.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/assets/wrappedImages/walletIcon.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/AssetIcon/AssetIcon.jsx.html +20 -17
- package/coverage/{rabbit-ui-kit/src/components/atoms/buttons/Button → ui-kit/src/ui-kit/components/atoms/AssetIcon}/index.html +8 -8
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/AssetSelection/AssetSelection.jsx.html +23 -20
- package/coverage/{rabbit-ui-kit/src/components/atoms/buttons/LinkButton → ui-kit/src/ui-kit/components/atoms/AssetSelection}/index.html +8 -8
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +10 -10
- package/coverage/ui-kit/src/ui-kit/components/atoms/BackgroundTitle/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/InformationMessage/InformationMessage.jsx.html +21 -18
- package/coverage/ui-kit/src/ui-kit/components/atoms/InformationMessage/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/Input/Input.jsx.html +38 -35
- package/coverage/{rabbit-ui-kit/src/components/atoms/buttons/Close → ui-kit/src/ui-kit/components/atoms/Input}/index.html +8 -8
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/LoadingDots/LoadingDots.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src/constants/organisms/dialog/DialogStep → ui-kit/src/ui-kit/components/atoms/LoadingDots}/index.html +8 -8
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/NoticeIcon/NoticeIcon.jsx.html +19 -22
- package/coverage/ui-kit/src/ui-kit/components/atoms/NoticeIcon/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/QrCode/QrCode.jsx.html +63 -15
- package/coverage/ui-kit/src/ui-kit/components/atoms/QrCode/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/RateSelector/RateSelector.jsx.html +16 -13
- package/coverage/ui-kit/src/ui-kit/components/atoms/RateSelector/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/SupportChat/SupportChat.jsx.html +16 -13
- package/coverage/ui-kit/src/ui-kit/components/atoms/SupportChat/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/Textarea/Textarea.jsx.html +36 -30
- package/coverage/ui-kit/src/ui-kit/components/atoms/Textarea/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/TitleBox/TitleBox.jsx.html +29 -29
- package/coverage/ui-kit/src/ui-kit/components/atoms/TitleBox/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/Tooltip/Tooltip.jsx.html +48 -21
- package/coverage/ui-kit/src/ui-kit/components/atoms/Tooltip/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/TwoLinesOfText/LinesOfText.jsx.html +29 -23
- package/coverage/ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/Validation/Validation.jsx.html +13 -13
- package/coverage/ui-kit/src/ui-kit/components/atoms/Validation/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/buttons/Button/Button.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src/components/atoms/AssetSelection → ui-kit/src/ui-kit/components/atoms/buttons/Button}/index.html +15 -15
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/buttons/Close/Close.jsx.html +30 -15
- package/coverage/{rabbit-ui-kit/src/components/atoms/BackgroundTitle → ui-kit/src/ui-kit/components/atoms/buttons/Close}/index.html +15 -15
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/buttons/LinkButton/LinkButton.jsx.html +34 -16
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/LinkButton/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +11 -11
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/molecules/AmountInput/AmountInput.jsx.html +20 -17
- package/coverage/ui-kit/src/ui-kit/components/molecules/AmountInput/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/molecules/CoinPicker/CoinPicker.jsx.html +44 -38
- package/coverage/ui-kit/src/ui-kit/components/molecules/CoinPicker/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/molecules/LineWithIconLink/LineWithIconLink.jsx.html +10 -10
- package/coverage/{rabbit-ui-kit/src/components/organisms/Dialog/DialogStep → ui-kit/src/ui-kit/components/molecules/LineWithIconLink}/index.html +8 -8
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx.html +25 -19
- package/coverage/{rabbit-ui-kit/src/components/atoms/buttons/RadioButtonWithText → ui-kit/src/ui-kit/components/molecules/TitledLineWithIconLink}/index.html +8 -8
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +20 -14
- package/coverage/{rabbit-ui-kit/src/components/organisms/Dialog/DialogButtons → ui-kit/src/ui-kit/components/organisms/CoinPickerDialogStep}/index.html +8 -8
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/organisms/Dialog/Dialog.jsx.html +106 -19
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +13 -13
- package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +66 -60
- package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/index.html +116 -0
- package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/organisms/SwapForm/SwapForm.jsx.html +470 -98
- package/coverage/ui-kit/src/ui-kit/components/organisms/SwapForm/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src → ui-kit/src/ui-kit}/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx.html +12 -12
- package/coverage/ui-kit/src/ui-kit/components/templates/DeterminedErrorDialogStep/index.html +116 -0
- package/coverage/{rabbit-ui-kit/src/components → ui-kit/src/ui-kit}/hooks/index.html +22 -7
- package/coverage/{rabbit-ui-kit/src/components → ui-kit/src/ui-kit}/hooks/useCallHandlingErrors.js.html +4 -4
- package/coverage/ui-kit/src/ui-kit/hooks/useIsHydrated.js.html +121 -0
- package/coverage/{rabbit-ui-kit/src/components → ui-kit/src/ui-kit}/hooks/useReferredState.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/components → ui-kit/src/ui-kit}/utils/index.html +3 -3
- package/coverage/{rabbit-ui-kit/src/components → ui-kit/src/ui-kit}/utils/inputValueProviders.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/components → ui-kit/src/ui-kit}/utils/textUtils.js.html +4 -4
- package/coverage/{rabbit-ui-kit/src/components → ui-kit/src/ui-kit}/utils/uiUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit/src/components → ui-kit/src/ui-kit}/utils/urlQueryUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/BackgroundTitle.stories.jsx.html +4 -4
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/LinesOfText.stories.jsx.html +6 -6
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/LoadingDots.stories.jsx.html +5 -5
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/QrCode.stories.jsx.html +5 -5
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/RateSelector.stories.jsx.html +4 -4
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/Validation.stories.jsx.html +4 -4
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/Button.stories.jsx.html +29 -92
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/Close.stories.jsx.html +9 -12
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/LinkButton.stories.jsx.html +15 -9
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/index.html +11 -11
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/LineWithIconLink.stories.jsx.html +5 -5
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/TitledLineWithIconLink.stories.jsx.html +4 -4
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/Dialog.stories.jsx.html +15 -81
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogButtons/DialogButtons.stories.jsx.html +5 -5
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogButtons/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogStep/DialogStep.stories.jsx.html +6 -6
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogStep/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/index.html +7 -7
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/stubs/exampleContent.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/stubs/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/templates/DeterminedErrorDialogStep.stories.jsx.html +9 -12
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/templates/index.html +7 -7
- package/coverage/ui-kit/storybook-static/124.c2d01e5e.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/138.56b7edc4.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/312.6f62bbd9.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/341.57a15f57.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/370.73bb343e.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/595.2e40d981.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/607.3ea32459.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/609.8c79ec77.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/666.09fdc1d7.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/797.c87cdf19.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/822.4bc0ebce.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/833.08e3ebb6.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/862.bf6bfe62.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/87.0a1bfeb1.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/893.4b09f929.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/996.846a677b.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-BackgroundTitle-stories.1a5386a1.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-LinesOfText-stories.7043a48b.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-LoadingDots-stories.091245c7.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-QrCode-stories.e10363b6.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-RateSelector-stories.af208e9a.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-Validation-stories.d561b311.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-buttons-Button-stories.e8e6b930.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-buttons-Close-stories.0a902a7c.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/atoms-buttons-LinkButton-stories.ca93ab6b.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/index.html +596 -0
- package/coverage/ui-kit/storybook-static/main.41f410f2.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/molecules-LineWithIconLink-stories.9721a18c.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/molecules-TitledLineWithIconLink-stories.1383fe3f.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/organisms-Dialog-Dialog-stories.4e6da717.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/organisms-Dialog-DialogButtons-DialogButtons-stories.6f45ae6e.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/organisms-Dialog-DialogStep-DialogStep-stories.74896048.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/addon-backgrounds/dist/index.html +116 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/addon-backgrounds/dist/preview.js.html +118 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/components/dist/formatter-SWP5E3XI.mjs.html +118 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/@storybook/components/dist/index.html +116 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/buffer/index.html +116 -0
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/buffer/index.js.html +118 -0
- package/coverage/{rabbit-ui-kit/src/components/atoms/InformationMessage → ui-kit/storybook-static/rabbitio/ui-kit/node_modules/markdown-to-jsx/dist}/index.html +15 -15
- package/coverage/ui-kit/storybook-static/rabbitio/ui-kit/node_modules/markdown-to-jsx/dist/index.modern.js.html +118 -0
- package/coverage/ui-kit/storybook-static/runtime~main.ad918f38.iframe.bundle.js.html +85 -0
- package/coverage/ui-kit/storybook-static/sb-addons/actions-9/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/actions-9/manager-bundle.js.html +94 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-backgrounds-2/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-backgrounds-2/manager-bundle.js.html +121 -0
- package/coverage/{rabbit-ui-kit/src/components/atoms/LoadingDots → ui-kit/storybook-static/sb-addons/essentials-controls-1}/index.html +15 -15
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js.html +274 -0
- package/coverage/{rabbit-ui-kit/src/components/atoms/AssetIcon → ui-kit/storybook-static/sb-addons/essentials-measure-4}/index.html +15 -15
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-measure-4/manager-bundle.js.html +94 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-outline-5/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-outline-5/manager-bundle.js.html +94 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-toolbars-3/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/essentials-toolbars-3/manager-bundle.js.html +94 -0
- package/coverage/{rabbit-ui-kit/src/components/atoms/QrCode → ui-kit/storybook-static/sb-addons/interactions-7}/index.html +15 -15
- package/coverage/ui-kit/storybook-static/sb-addons/interactions-7/manager-bundle.js.html +121 -0
- package/coverage/{rabbit-ui-kit/src/constants/atoms/Close → ui-kit/storybook-static/sb-addons/links-0}/index.html +15 -15
- package/coverage/{rabbit-ui-kit/src/constants/atoms/LinkButton/linkButton.jsx.html → ui-kit/storybook-static/sb-addons/links-0/manager-bundle.js.html} +16 -25
- package/coverage/ui-kit/storybook-static/sb-addons/onboarding-6/index.html +116 -0
- package/coverage/ui-kit/storybook-static/sb-addons/onboarding-6/manager-bundle.js.html +1588 -0
- package/coverage/{rabbit-ui-kit/src/constants/atoms/Tooltip → ui-kit/storybook-static/sb-addons/viewport-8}/index.html +15 -15
- package/coverage/ui-kit/storybook-static/sb-addons/viewport-8/manager-bundle.js.html +94 -0
- package/coverage/{rabbit-ui-kit/src/constants/atoms/Close/close.jsx.html → ui-kit/storybook-static/sb-manager/WithTooltip-V3YHNWJZ-LVYLGZW2.js.html} +14 -26
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-2IXBUOFS.js.html +106 -0
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-INSKDKQB.js.html +1129 -0
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-NGTUFCUO.js.html +112 -0
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-UUEAOBSN.js.html +1303 -0
- package/coverage/ui-kit/storybook-static/sb-manager/chunk-ZEU7PDD3.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-manager/formatter-SWP5E3XI-7BGIK6BL.js.html +553 -0
- package/coverage/ui-kit/storybook-static/sb-manager/globals-module-info.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-manager/globals.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-manager/index.html +281 -0
- package/coverage/{rabbit-ui-kit/src/constants/organisms/dialog/DialogStep/dialogStep.js.html → ui-kit/storybook-static/sb-manager/index.js.html} +11 -11
- package/coverage/ui-kit/storybook-static/sb-manager/runtime.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-manager/syntaxhighlighter-V7JZZA35-DXZCI2WR.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-preview/globals.js.html +88 -0
- package/coverage/ui-kit/storybook-static/sb-preview/index.html +131 -0
- package/coverage/ui-kit/storybook-static/sb-preview/runtime.js.html +421 -0
- package/coverage/ui-kit/storybook-static/templates-DeterminedErrorDialogStep-stories.3cc14214.iframe.bundle.js.html +85 -0
- package/dist/index.cjs +1568 -796
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +21030 -21030
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +1108 -534
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +1567 -797
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +1568 -796
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
- package/src/{common → common-apis}/external-apis/ipAddressProviders.js +2 -2
- package/src/index.js +62 -66
- package/src/{robustExteranlApiCallerService → robust-api-caller}/cacheAndConcurrentRequestsResolver.js +2 -2
- package/src/{robustExteranlApiCallerService → robust-api-caller}/cachedRobustExternalApiCallerService.js +3 -3
- package/src/{robustExteranlApiCallerService → robust-api-caller}/concurrentCalculationsMetadataHolder.js +1 -1
- package/src/{robustExteranlApiCallerService → robust-api-caller}/externalServicesStatsCollector.js +2 -2
- package/src/{robustExteranlApiCallerService → robust-api-caller}/robustExternalAPICallerService.js +5 -5
- package/src/{robustExteranlApiCallerService → robust-api-caller}/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/_performCallAttempt.test.js +2 -2
- package/src/{robustExteranlApiCallerService → robust-api-caller}/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/callExternalAPI.test.js +1 -1
- package/src/{robustExteranlApiCallerService → robust-api-caller}/tests/robustExternalAPICallerService/robustExternalAPICallerService/constructor.test.js +1 -1
- package/src/swaps-lib/external-apis/letsExchangeSwapProvider.js +457 -0
- package/src/swaps-lib/external-apis/swapProvider.js +247 -20
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +41 -201
- package/src/swaps-lib/models/baseSwapCreationInfo.js +4 -1
- package/src/swaps-lib/services/publicSwapService.js +113 -51
- package/src/swaps-lib/test/external-apis/swapProvider/removeProtocolNameFromCoinName.test.js +142 -0
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +5 -5
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/createSwap.test.js +3 -3
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getAllSupportedCurrencies.test.js +1 -1
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getDepositCurrencies.test.js +1 -1
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getSwapInfo.test.js +124 -4
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getWithdrawalCurrencies.test.js +1 -1
- package/src/swaps-lib/test/utils/swapUtils/safeHandleRequestsLimitExceeding.test.js +2 -2
- package/src/swaps-lib/utils/swapUtils.js +69 -44
- package/{styles → src/ui-kit/assets/styles}/index.scss +1 -1
- package/src/{assets → ui-kit/assets}/wrappedImages/arrowWhite.jsx +1 -1
- package/src/{components → ui-kit/components}/atoms/AssetIcon/AssetIcon.jsx +5 -4
- package/src/{components → ui-kit/components}/atoms/AssetIcon/asset-icon.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/AssetSelection/AssetSelection.jsx +8 -7
- package/src/{components → ui-kit/components}/atoms/AssetSelection/asset-selection.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/BackgroundTitle/background-title.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/InformationMessage/InformationMessage.jsx +6 -5
- package/src/{components → ui-kit/components}/atoms/InformationMessage/information-message.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/Input/Input.jsx +23 -22
- package/src/{components → ui-kit/components}/atoms/Input/input.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/LoadingDots/LoadingDots.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/NoticeIcon/NoticeIcon.jsx +6 -7
- package/src/{components → ui-kit/components}/atoms/NoticeIcon/notice-icon.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/QrCode/QrCode.jsx +18 -2
- package/src/{components → ui-kit/components}/atoms/QrCode/qr-code.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/RateSelector/RateSelector.jsx +1 -0
- package/src/{components → ui-kit/components}/atoms/RateSelector/rate-selector.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/SupportChat/SupportChat.jsx +1 -0
- package/src/{components → ui-kit/components}/atoms/Textarea/Textarea.jsx +19 -17
- package/src/{components → ui-kit/components}/atoms/Textarea/textarea.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/TitleBox/TitleBox.jsx +19 -19
- package/src/{components → ui-kit/components}/atoms/TitleBox/title-box.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/Tooltip/Tooltip.jsx +17 -8
- package/src/{components → ui-kit/components}/atoms/Tooltip/tooltip.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/TwoLinesOfText/LinesOfText.jsx +11 -9
- package/src/{components → ui-kit/components}/atoms/TwoLinesOfText/lines-of-text.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/Validation/Validation.jsx +2 -2
- package/src/{components → ui-kit/components}/atoms/Validation/validation.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/buttons/Button/Button.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/buttons/Close/Close.jsx +7 -2
- package/src/{components → ui-kit/components}/atoms/buttons/Close/close.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/buttons/LinkButton/LinkButton.jsx +9 -3
- package/src/{components → ui-kit/components}/atoms/buttons/LinkButton/link-button.module.scss +1 -1
- package/src/{components → ui-kit/components}/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx +1 -1
- package/src/{components → ui-kit/components}/atoms/buttons/RadioButtonWithText/radio-button-with-text.module.scss +1 -1
- package/src/{components → ui-kit/components}/molecules/AmountInput/AmountInput.jsx +5 -4
- package/src/{components → ui-kit/components}/molecules/AmountInput/amount-input.module.scss +1 -1
- package/src/{components → ui-kit/components}/molecules/CoinPicker/CoinPicker.jsx +27 -25
- package/src/{components → ui-kit/components}/molecules/CoinPicker/coin-picker.module.scss +1 -1
- package/src/{components → ui-kit/components}/molecules/LineWithIconLink/line-with-icon-link.module.scss +1 -1
- package/src/{components → ui-kit/components}/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx +8 -6
- package/src/{components → ui-kit/components}/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx +3 -1
- package/src/{components → ui-kit/components}/organisms/Dialog/Dialog.jsx +35 -6
- package/src/{components → ui-kit/components}/organisms/Dialog/DialogButtons/DialogButtons.jsx +3 -3
- package/src/{components → ui-kit/components}/organisms/Dialog/DialogButtons/dialog-buttons.module.scss +1 -1
- package/src/{components → ui-kit/components}/organisms/Dialog/DialogStep/DialogStep.jsx +49 -47
- package/src/{components → ui-kit/components}/organisms/Dialog/DialogStep/dialog-step.module.scss +1 -1
- package/src/{components → ui-kit/components}/organisms/Dialog/dialog.module.scss +1 -1
- package/src/{components → ui-kit/components}/organisms/SwapForm/SwapForm.jsx +209 -85
- package/src/{components → ui-kit/components}/organisms/SwapForm/swap-form.module.scss +2 -2
- package/src/{components → ui-kit/components}/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx +2 -2
- package/src/{components → ui-kit}/hooks/useCallHandlingErrors.js +1 -1
- package/src/ui-kit/hooks/useIsHydrated.js +12 -0
- package/src/{components → ui-kit}/utils/textUtils.js +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/Input/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/atoms/NoticeIcon/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/atoms/RateSelector/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/atoms/SupportChat/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/atoms/Textarea/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/atoms/TitleBox/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/atoms/Tooltip/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/atoms/TwoLinesOfText/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/atoms/Validation/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/molecules/AmountInput/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/molecules/CoinPicker/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/molecules/LineWithIconLink/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/molecules/TitledLineWithIconLink/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/organisms/CoinPickerDialogStep/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/organisms/SwapForm/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/components/templates/DeterminedErrorDialogStep/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/constants/atoms/LinkButton/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/constants/atoms/Tooltip/tooltip.jsx.html +0 -109
- package/coverage/rabbit-ui-kit/src/constants/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/dialog.js.html +0 -172
- package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/index.html +0 -116
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/index.html +0 -131
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapProvider.js.html +0 -709
- package/src/assets/image/icons/arrow-tosca.svg +0 -3
- package/src/constants/atoms/Close/close.jsx +0 -5
- package/src/constants/atoms/LinkButton/linkButton.jsx +0 -6
- package/src/constants/atoms/Tooltip/tooltip.jsx +0 -8
- package/src/constants/organisms/dialog/DialogStep/dialogStep.js +0 -1
- package/src/constants/organisms/dialog/dialog.js +0 -29
- /package/src/{common → common-apis}/adapters/axiosAdapter.js +0 -0
- /package/src/{common → common-apis}/adapters/qrUtils.js +0 -0
- /package/src/{common → common-apis}/amountUtils.js +0 -0
- /package/src/{common → common-apis}/errorUtils.js +0 -0
- /package/src/{common → common-apis}/external-apis/apiGroups.js +0 -0
- /package/src/{common → common-apis}/fiatCurrenciesService.js +0 -0
- /package/src/{constants → common-apis}/globalConstants.jsx +0 -0
- /package/src/{common → common-apis}/models/blockchain.js +0 -0
- /package/src/{common → common-apis}/models/coin.js +0 -0
- /package/src/{common → common-apis}/models/protocol.js +0 -0
- /package/src/{common → common-apis}/tests/amountUtils/composeRateText.test.js +0 -0
- /package/src/{common → common-apis}/tests/integration/external-apis/ipAddressProviders/getClientIpAddress.test.js +0 -0
- /package/src/{common → common-apis}/utils/cache.js +0 -0
- /package/src/{common → common-apis}/utils/emailAPI.js +0 -0
- /package/src/{common → common-apis}/utils/logging/logger.js +0 -0
- /package/src/{common → common-apis}/utils/logging/logsStorage.js +0 -0
- /package/src/{common → common-apis}/utils/postponeExecution.js +0 -0
- /package/src/{common → common-apis}/utils/safeStringify.js +0 -0
- /package/src/{robustExteranlApiCallerService → robust-api-caller}/cancelProcessing.js +0 -0
- /package/src/{robustExteranlApiCallerService → robust-api-caller}/externalApiProvider.js +0 -0
- /package/{styles → src/ui-kit/assets/styles}/_functions.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/_global-classes.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/_mixins.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/_placeholder.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/_variables.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/colors/_light-colors.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/colors/_solid-colors.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/fonts/NunitoSans-Bold.ttf +0 -0
- /package/{styles → src/ui-kit/assets/styles}/fonts/NunitoSans-ExtraBold.ttf +0 -0
- /package/{styles → src/ui-kit/assets/styles}/fonts/NunitoSans-Light.ttf +0 -0
- /package/{styles → src/ui-kit/assets/styles}/fonts/NunitoSans-Regular.ttf +0 -0
- /package/{styles → src/ui-kit/assets/styles}/fonts/NunitoSans-SemiBold.ttf +0 -0
- /package/{styles → src/ui-kit/assets/styles}/global-styles-index.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/size/_margin-size.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/size/_padding-size.scss +0 -0
- /package/src/{assets → ui-kit/assets}/wrappedImages/arrowIcon.jsx +0 -0
- /package/src/{assets → ui-kit/assets}/wrappedImages/arrowTosca.jsx +0 -0
- /package/src/{assets → ui-kit/assets}/wrappedImages/darkRectangle.jsx +0 -0
- /package/src/{assets → ui-kit/assets}/wrappedImages/determinedError.jsx +0 -0
- /package/src/{assets → ui-kit/assets}/wrappedImages/failedValidationIcon.jsx +0 -0
- /package/src/{assets → ui-kit/assets}/wrappedImages/infoIcon.jsx +0 -0
- /package/src/{assets → ui-kit/assets}/wrappedImages/noticeQuestionIcon.jsx +0 -0
- /package/src/{assets → ui-kit/assets}/wrappedImages/successfulValidationIcon.jsx +0 -0
- /package/src/{assets → ui-kit/assets}/wrappedImages/walletIcon.jsx +0 -0
- /package/src/{components → ui-kit/components}/atoms/BackgroundTitle/BackgroundTitle.jsx +0 -0
- /package/src/{components → ui-kit/components}/atoms/LoadingDots/LoadingDots.jsx +0 -0
- /package/src/{components → ui-kit/components}/atoms/buttons/Button/Button.jsx +0 -0
- /package/src/{components → ui-kit/components}/molecules/LineWithIconLink/LineWithIconLink.jsx +0 -0
- /package/src/{components → ui-kit}/hooks/useReferredState.js +0 -0
- /package/src/{components → ui-kit}/tests/utils/inputValueProviders/provideFormatOfFloatValueByInputString.test.js +0 -0
- /package/src/{components → ui-kit}/tests/utils/urlQueryUtils/getQueryParameterValues.test.js +0 -0
- /package/src/{components → ui-kit}/tests/utils/urlQueryUtils/saveQueryParameterAndValues.test.js +0 -0
- /package/src/{components → ui-kit}/utils/inputValueProviders.js +0 -0
- /package/src/{components → ui-kit}/utils/uiUtils.js +0 -0
- /package/src/{components → ui-kit}/utils/urlQueryUtils.js +0 -0
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { BigNumber } from "bignumber.js";
|
|
3
|
+
import { AmountUtils } from "../../common-apis/amountUtils.js";
|
|
4
|
+
import { improveAndRethrow } from "../../common-apis/errorUtils.js";
|
|
5
|
+
import { SwapProvider } from "./swapProvider.js";
|
|
6
|
+
import { ExistingSwap } from "../models/existingSwap.js";
|
|
7
|
+
import { Coin } from "../../common-apis/models/coin.js";
|
|
8
|
+
import { Protocol } from "../../common-apis/models/protocol.js";
|
|
9
|
+
import { safeStringify } from "../../common-apis/utils/safeStringify.js";
|
|
10
|
+
import { Logger } from "../../common-apis/utils/logging/logger.js";
|
|
11
|
+
import { DEFAULT_CRYPTO_DECIMAL_COUNT, FALLBACK_ASSET_ICON_URL } from "../../common-apis/globalConstants.jsx";
|
|
12
|
+
|
|
13
|
+
export class LetsExchangeSwapProvider extends SwapProvider {
|
|
14
|
+
constructor(apiKeysProxyUrl, cache, customCoinBuilder = (coin, network) => null, useRestrictedCoinsSet = true) {
|
|
15
|
+
super(cache, customCoinBuilder, useRestrictedCoinsSet);
|
|
16
|
+
this._partners = [];
|
|
17
|
+
this._URL = `${apiKeysProxyUrl}/letsexchange`;
|
|
18
|
+
this.isAggregator = false;
|
|
19
|
+
this.COINS_EXPIRATION_TIME_MS = 5 * 60 * 1000;
|
|
20
|
+
this.coinsLastUpdateTimestamp = null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static AFFILIATE_ID = "0zbj9hf7xg7jgdgv";
|
|
24
|
+
|
|
25
|
+
getSwapCreationInfoTtlMs() {
|
|
26
|
+
return 110000;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async _fetchSupportedCurrenciesIfNeeded() {
|
|
30
|
+
const loggerSource = "_fetchSupportedCurrenciesIfNeeded";
|
|
31
|
+
try {
|
|
32
|
+
if (
|
|
33
|
+
!this._supportedCoins?.length ||
|
|
34
|
+
!this.coinsLastUpdateTimestamp ||
|
|
35
|
+
this.coinsLastUpdateTimestamp + this.COINS_EXPIRATION_TIME_MS < Date.now()
|
|
36
|
+
) {
|
|
37
|
+
const rawResponse = await axios.get(`${this._URL}/v2/coins`);
|
|
38
|
+
Logger.log(`Retrieved ${rawResponse?.data?.length}`, loggerSource);
|
|
39
|
+
let allowedCoins = rawResponse?.data ?? [];
|
|
40
|
+
Logger.log(`Allowed cnt ${allowedCoins.length}`, loggerSource);
|
|
41
|
+
|
|
42
|
+
this._supportedCoins = allowedCoins
|
|
43
|
+
.map(item => {
|
|
44
|
+
const code = item.code.toUpperCase();
|
|
45
|
+
|
|
46
|
+
if (!Array.isArray(item.networks)) return [];
|
|
47
|
+
|
|
48
|
+
return item.networks.map(networkDetails => {
|
|
49
|
+
const network = networkDetails.code.toUpperCase();
|
|
50
|
+
let coin = this._customCoinBuilder(code, network);
|
|
51
|
+
if (!coin && !this.useRestrictedCoinsSet) {
|
|
52
|
+
let name = this.removeProtocolNameFromCoinName(item.name, code, network);
|
|
53
|
+
const ticker = `${code}${code === network ? "" : network}`;
|
|
54
|
+
const defaultDecimalPlacesForCoinNotSupportedOOB = DEFAULT_CRYPTO_DECIMAL_COUNT;
|
|
55
|
+
const defaultMinConfirmationsForCoinNotSupportedOOB = 1;
|
|
56
|
+
coin = new Coin(
|
|
57
|
+
name,
|
|
58
|
+
ticker,
|
|
59
|
+
code,
|
|
60
|
+
defaultDecimalPlacesForCoinNotSupportedOOB,
|
|
61
|
+
null,
|
|
62
|
+
"",
|
|
63
|
+
null,
|
|
64
|
+
null,
|
|
65
|
+
defaultMinConfirmationsForCoinNotSupportedOOB,
|
|
66
|
+
null,
|
|
67
|
+
[],
|
|
68
|
+
60000,
|
|
69
|
+
null,
|
|
70
|
+
code !== network ? new Protocol(network) : null,
|
|
71
|
+
item.contract_address || null,
|
|
72
|
+
false
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
if (coin) {
|
|
76
|
+
return {
|
|
77
|
+
coin: coin,
|
|
78
|
+
code: item.code,
|
|
79
|
+
network: networkDetails.code,
|
|
80
|
+
hasExtraId: !!networkDetails.has_extra,
|
|
81
|
+
extraIdName: networkDetails.extra_name ?? null,
|
|
82
|
+
isPopular: item.rating || 0,
|
|
83
|
+
iconURL: item.icon ? item.icon : FALLBACK_ASSET_ICON_URL,
|
|
84
|
+
deposit: true, // Letsexchange provide no such details
|
|
85
|
+
withdrawal: true, // Letsexchange provide no such details
|
|
86
|
+
validationRegexp: networkDetails.validation_address_regex ?? null,
|
|
87
|
+
isAvailable:
|
|
88
|
+
(typeof item.is_active !== "number" || item.is_active === 1) &&
|
|
89
|
+
(typeof item.disabled !== "number" || item.disabled === 0) &&
|
|
90
|
+
(typeof networkDetails.is_active !== "number" ||
|
|
91
|
+
networkDetails.is_active === 1),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
return [];
|
|
95
|
+
});
|
|
96
|
+
})
|
|
97
|
+
.flat();
|
|
98
|
+
this.coinsLastUpdateTimestamp = Date.now();
|
|
99
|
+
this._putPopularCoinsFirst();
|
|
100
|
+
}
|
|
101
|
+
} catch (e) {
|
|
102
|
+
improveAndRethrow(e, loggerSource);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async getSwapInfo(
|
|
107
|
+
fromCoin,
|
|
108
|
+
toCoin,
|
|
109
|
+
amountCoins,
|
|
110
|
+
fixed = false,
|
|
111
|
+
fromCoinToUsdRate = null,
|
|
112
|
+
amountIsToReceive = false
|
|
113
|
+
) {
|
|
114
|
+
const loggerSource = "getSwapInfo";
|
|
115
|
+
try {
|
|
116
|
+
if (
|
|
117
|
+
!(fromCoin instanceof Coin) ||
|
|
118
|
+
!(toCoin instanceof Coin) ||
|
|
119
|
+
typeof amountCoins !== "string" ||
|
|
120
|
+
BigNumber(amountCoins).lt("0") ||
|
|
121
|
+
(fixed !== null && typeof fixed !== "boolean") ||
|
|
122
|
+
(amountIsToReceive && !fixed)
|
|
123
|
+
) {
|
|
124
|
+
throw new Error(
|
|
125
|
+
`Wrong input params: ${amountCoins} ${fromCoin.ticker} -> ${toCoin.ticker}, ${
|
|
126
|
+
fromCoin instanceof Coin
|
|
127
|
+
}, ${toCoin instanceof Coin}, ${typeof fixed} ${fixed}, ${amountIsToReceive}`
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
const fromCoinDetails = this._supportedCoins.find(i => i.coin?.ticker === fromCoin?.ticker);
|
|
131
|
+
const toCoinDetails = this._supportedCoins.find(i => i.coin?.ticker === toCoin?.ticker);
|
|
132
|
+
if (!fromCoinDetails || !toCoinDetails) {
|
|
133
|
+
throw new Error("Failed to find coin details for: " + fromCoin.ticker + " -> " + toCoin.ticker);
|
|
134
|
+
}
|
|
135
|
+
if (
|
|
136
|
+
!fromCoinDetails.deposit ||
|
|
137
|
+
!fromCoinDetails.isAvailable ||
|
|
138
|
+
!toCoinDetails.withdrawal ||
|
|
139
|
+
!toCoinDetails.isAvailable
|
|
140
|
+
) {
|
|
141
|
+
return {
|
|
142
|
+
result: false,
|
|
143
|
+
reason: SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const pathAndQuery = `/v1/info${amountIsToReceive ? "-revert" : `?float=${!fixed}`}`;
|
|
148
|
+
const response = await axios.post(`${this._URL}${pathAndQuery}`, {
|
|
149
|
+
from: fromCoinDetails.code,
|
|
150
|
+
to: toCoinDetails.code,
|
|
151
|
+
network_from: fromCoinDetails.network,
|
|
152
|
+
network_to: toCoinDetails.network,
|
|
153
|
+
amount: amountCoins,
|
|
154
|
+
affiliate_id: LetsExchangeSwapProvider.AFFILIATE_ID,
|
|
155
|
+
});
|
|
156
|
+
Logger.log(`Retrieved ${response?.data}`, loggerSource);
|
|
157
|
+
const data = response.data;
|
|
158
|
+
|
|
159
|
+
// TODO: [dev] add SwapProvider.NO_SWAPS_REASONS.NO_FIXED_BUT_HAVE_FLOATING - request alternative rate. task_id=
|
|
160
|
+
|
|
161
|
+
// TODO: [feature, low] implement extra coins to fit min/max if there are frequent errors due to min/max exceeding
|
|
162
|
+
// let extraCoinsToFitMinMax = "0";
|
|
163
|
+
// if (typeof fromCoinToUsdRate === "string" && BigNumber(fromCoinToUsdRate).gt("0")) {
|
|
164
|
+
// const extraUsdToFitMinMax = BigNumber("1"); // We correct the limits as the exact limit can fluctuate and cause failed swap creation
|
|
165
|
+
// extraCoinsToFitMinMax = AmountUtils.trim(extraUsdToFitMinMax.div(fromCoinToUsdRate), fromCoin.digits);
|
|
166
|
+
// }
|
|
167
|
+
let min = null;
|
|
168
|
+
if (data?.min_amount) {
|
|
169
|
+
min = AmountUtils.trim(data?.min_amount, amountIsToReceive ? toCoin.digits : fromCoin.digits);
|
|
170
|
+
}
|
|
171
|
+
let max = null;
|
|
172
|
+
if (data?.max_amount) {
|
|
173
|
+
max = AmountUtils.trim(data?.max_amount, amountIsToReceive ? toCoin.digits : fromCoin.digits);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (data.success === false && data.error) {
|
|
177
|
+
// TODO: [dev] waiting for response from letsexchange about their not-documented responses
|
|
178
|
+
// {
|
|
179
|
+
// "success": false,
|
|
180
|
+
// "error": "Internal error"
|
|
181
|
+
// }
|
|
182
|
+
throw new Error("Failed to estimate swap letsexchange");
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (BigNumber(data.rate).eq("0") || BigNumber(data.amount).eq("0")) {
|
|
186
|
+
// TODO actualize according to letsexchage clarification - decide, can we count on min/max abcense? task_id=76512110797f4eab8b37f1bb789825cb
|
|
187
|
+
// amount: "0", rate: "0", rate_id: ""
|
|
188
|
+
let reason = SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED;
|
|
189
|
+
if (min && BigNumber(amountCoins).lt(min)) {
|
|
190
|
+
reason = SwapProvider.NO_SWAPS_REASONS.TOO_LOW;
|
|
191
|
+
} else if (max && BigNumber(amountCoins).gt(max)) {
|
|
192
|
+
reason = SwapProvider.NO_SWAPS_REASONS.TOO_HIGH;
|
|
193
|
+
} else if (!amountIsToReceive) {
|
|
194
|
+
// If we are not requesting receiving amount (it cannot be floating-rate)
|
|
195
|
+
// todo [feature, moderate] request alternative rate. task_id=31884db5392f49738c20a86115c90e1f
|
|
196
|
+
// const alternativeRate = 1;
|
|
197
|
+
// const alternativeRateAvailable = alternativeRate;
|
|
198
|
+
// if (alternativeRateAvailable) {
|
|
199
|
+
// reason = fixed
|
|
200
|
+
// ? SwapProvider.NO_SWAPS_REASONS.NO_FIXED_BUT_HAVE_FLOATING
|
|
201
|
+
// : SwapProvider.NO_SWAPS_REASONS.NO_FLOATING_BUT_HAVE_FIXED;
|
|
202
|
+
// }
|
|
203
|
+
}
|
|
204
|
+
return {
|
|
205
|
+
result: false,
|
|
206
|
+
reason: reason,
|
|
207
|
+
smallestMin: min,
|
|
208
|
+
greatestMax: max,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
const rate = amountIsToReceive
|
|
212
|
+
? BigNumber(amountCoins).div(data.amount)
|
|
213
|
+
: BigNumber(data.amount).div(amountCoins);
|
|
214
|
+
return {
|
|
215
|
+
result: true,
|
|
216
|
+
min: min,
|
|
217
|
+
max: max,
|
|
218
|
+
smallestMin: min,
|
|
219
|
+
greatestMax: max,
|
|
220
|
+
rate: AmountUtils.trim(rate, this._maxRateDigits),
|
|
221
|
+
durationMinutesRange: null,
|
|
222
|
+
fixed: fixed,
|
|
223
|
+
rawSwapData: data,
|
|
224
|
+
isRefundAddressRequired: false,
|
|
225
|
+
};
|
|
226
|
+
} catch (e) {
|
|
227
|
+
if (e?.response?.status === 429) {
|
|
228
|
+
return {
|
|
229
|
+
result: false,
|
|
230
|
+
reason: SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
Logger.log(`Internal error when getting swap options ${safeStringify(e)}`, loggerSource);
|
|
234
|
+
improveAndRethrow(e, loggerSource);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
async createSwap(
|
|
239
|
+
fromCoin,
|
|
240
|
+
toCoin,
|
|
241
|
+
amount,
|
|
242
|
+
toAddress,
|
|
243
|
+
refundAddress,
|
|
244
|
+
rawSwapData,
|
|
245
|
+
clientIpAddress,
|
|
246
|
+
fixed,
|
|
247
|
+
toCurrencyExtraId = "",
|
|
248
|
+
refundExtraId = "",
|
|
249
|
+
amountIsToReceive = false
|
|
250
|
+
) {
|
|
251
|
+
const loggerSource = "createSwap";
|
|
252
|
+
try {
|
|
253
|
+
if (
|
|
254
|
+
!(fromCoin instanceof Coin) ||
|
|
255
|
+
!(toCoin instanceof Coin) ||
|
|
256
|
+
typeof amount !== "string" ||
|
|
257
|
+
typeof toAddress !== "string" ||
|
|
258
|
+
typeof refundAddress !== "string" ||
|
|
259
|
+
typeof clientIpAddress != "string" ||
|
|
260
|
+
typeof fixed != "boolean"
|
|
261
|
+
) {
|
|
262
|
+
throw new Error(
|
|
263
|
+
`Invalid input: ${fromCoin} ${toCoin} ${amount} ${toAddress} ${refundAddress} ${fixed}`
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
if (typeof rawSwapData !== "object" || (fixed && !rawSwapData.rate_id)) {
|
|
267
|
+
throw new Error(`Invalid raw swap data: ${safeStringify(rawSwapData)}`);
|
|
268
|
+
}
|
|
269
|
+
const fromCoinDetails = this._supportedCoins.find(i => i.coin?.ticker === fromCoin?.ticker);
|
|
270
|
+
const toCoinDetails = this._supportedCoins.find(i => i.coin?.ticker === toCoin?.ticker);
|
|
271
|
+
if (!fromCoinDetails || !toCoinDetails) {
|
|
272
|
+
throw new Error("Failed to find coin details for: " + fromCoin.ticker + " -> " + toCoin.ticker);
|
|
273
|
+
}
|
|
274
|
+
const requestBody = {
|
|
275
|
+
coin_from: fromCoinDetails.code,
|
|
276
|
+
network_from: fromCoinDetails.network,
|
|
277
|
+
coin_to: toCoinDetails.code,
|
|
278
|
+
network_to: toCoinDetails.network,
|
|
279
|
+
withdrawal: toAddress,
|
|
280
|
+
withdrawal_extra_id: toCurrencyExtraId,
|
|
281
|
+
return: refundAddress,
|
|
282
|
+
return_extra_id: refundExtraId,
|
|
283
|
+
affiliate_id: LetsExchangeSwapProvider.AFFILIATE_ID,
|
|
284
|
+
};
|
|
285
|
+
if (amountIsToReceive) {
|
|
286
|
+
requestBody.withdrawal_amount = amount;
|
|
287
|
+
} else {
|
|
288
|
+
requestBody.deposit_amount = amount;
|
|
289
|
+
}
|
|
290
|
+
if (fixed) {
|
|
291
|
+
requestBody.rate_id = rawSwapData.rate_id;
|
|
292
|
+
}
|
|
293
|
+
const response = await axios.post(
|
|
294
|
+
`${this._URL}/v1/transaction${amountIsToReceive ? "-revert" : `?float=${!fixed}`}`,
|
|
295
|
+
requestBody
|
|
296
|
+
);
|
|
297
|
+
const result = response.data;
|
|
298
|
+
Logger.log(`Creation result ${safeStringify(result)}`, loggerSource);
|
|
299
|
+
|
|
300
|
+
if (result?.transaction_id) {
|
|
301
|
+
const rate = BigNumber(result.rate ?? 0).isZero()
|
|
302
|
+
? BigNumber(result.withdrawal_amount).div(result.deposit_amount)
|
|
303
|
+
: BigNumber(result.rate);
|
|
304
|
+
|
|
305
|
+
return {
|
|
306
|
+
result: true,
|
|
307
|
+
swapId: result.transaction_id,
|
|
308
|
+
fromCoin: fromCoin,
|
|
309
|
+
fromAmount: AmountUtils.trim(result.deposit_amount, fromCoin.digits),
|
|
310
|
+
fromAddress: result.deposit,
|
|
311
|
+
toCoin: toCoin,
|
|
312
|
+
toAmount: AmountUtils.trim(result.withdrawal_amount, toCoin.digits),
|
|
313
|
+
toAddress: result.withdrawal,
|
|
314
|
+
fromCurrencyExtraId: result.deposit_extra_id ?? "",
|
|
315
|
+
rate: AmountUtils.trim(rate, this._maxRateDigits),
|
|
316
|
+
fixed: !result.is_float,
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
const errorMessage = `Swap creation succeeded but the response is wrong: ${safeStringify(response)}`;
|
|
321
|
+
Logger.log(errorMessage, loggerSource);
|
|
322
|
+
throw new Error(errorMessage);
|
|
323
|
+
} catch (e) {
|
|
324
|
+
Logger.logError(e, loggerSource, `Failed to create swap. Error is: ${safeStringify(e)}`);
|
|
325
|
+
const composeFailResult = reason => ({
|
|
326
|
+
result: false,
|
|
327
|
+
reason: reason,
|
|
328
|
+
});
|
|
329
|
+
const status = e?.response?.status;
|
|
330
|
+
const data = e?.response?.data;
|
|
331
|
+
if (status === 429) {
|
|
332
|
+
Logger.log(`Returning fail - RPS limit exceeded ${data}`, loggerSource);
|
|
333
|
+
return composeFailResult(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
|
|
334
|
+
}
|
|
335
|
+
// TODO: [feature, low] add custom errors handling - waiting for response from letsexchange. task_id=00d2e435f6df4fb99af912135bd9ee27
|
|
336
|
+
// 422 - missing params
|
|
337
|
+
Logger.log(`Internal error for swap: ${safeStringify(e)}`, loggerSource);
|
|
338
|
+
improveAndRethrow(e, loggerSource);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
async getExistingSwapsDetailsAndStatus(swapIds) {
|
|
343
|
+
const loggerSource = "getExistingSwapsDetailsAndStatus";
|
|
344
|
+
try {
|
|
345
|
+
if (swapIds.find(id => typeof id !== "string")) {
|
|
346
|
+
throw new Error("Swap id is not string: " + safeStringify(swapIds));
|
|
347
|
+
}
|
|
348
|
+
const response = await axios.get(`${this._URL}/v1/transactions-list?ids[]=${swapIds.join("&ids[]=")}`);
|
|
349
|
+
|
|
350
|
+
Logger.log("All swaps RAW: " + safeStringify(response.data), loggerSource);
|
|
351
|
+
const swaps = response.data
|
|
352
|
+
.map((swap, index) => {
|
|
353
|
+
const fromCoin = this._supportedCoins.find(
|
|
354
|
+
i => i.code === swap.coin_from && i.network === swap.coin_from_network
|
|
355
|
+
)?.coin;
|
|
356
|
+
const toCoin = this._supportedCoins.find(
|
|
357
|
+
i => i.code === swap.coin_to && i.network === swap.coin_to_network
|
|
358
|
+
)?.coin;
|
|
359
|
+
if (!fromCoin || !toCoin) {
|
|
360
|
+
return []; // We skip swaps with not supported coins for now
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
const toUtcTimestamp = timeStr => Date.parse(timeStr.match(/.+[Zz]$/) ? timeStr : `${timeStr}Z`);
|
|
364
|
+
const expiresAt = swap.expired_at ? swap.expired_at * 1000 : null;
|
|
365
|
+
const createdAt = swap.created_at ? toUtcTimestamp(`${swap.created_at}`) : null;
|
|
366
|
+
const isExpiredByTime = expiresAt && expiresAt < Date.now();
|
|
367
|
+
const status = this._mapLetsExchangeStatusToRabbitStatus(swap.status, isExpiredByTime);
|
|
368
|
+
const toDigits = status === SwapProvider.SWAP_STATUSES.REFUNDED ? fromCoin.digits : toCoin.digits;
|
|
369
|
+
return new ExistingSwap(
|
|
370
|
+
swapIds[index],
|
|
371
|
+
status,
|
|
372
|
+
createdAt,
|
|
373
|
+
expiresAt,
|
|
374
|
+
swap.confirmations,
|
|
375
|
+
AmountUtils.trim(swap.rate, this._maxRateDigits),
|
|
376
|
+
swap.is_float != null ? !swap.is_float : false,
|
|
377
|
+
swap.return,
|
|
378
|
+
swap.deposit,
|
|
379
|
+
fromCoin,
|
|
380
|
+
AmountUtils.trim(swap.deposit_amount, fromCoin.digits),
|
|
381
|
+
swap.hash_in,
|
|
382
|
+
swap.hash_in ? `${swap.coin_from_explorer_url}${swap.hash_in}` : null,
|
|
383
|
+
toCoin,
|
|
384
|
+
AmountUtils.trim(swap.withdrawal_amount, toDigits),
|
|
385
|
+
swap.hash_out,
|
|
386
|
+
swap.hash_out ? `${swap.coin_to_explorer_url}${swap.hash_out}` : null,
|
|
387
|
+
swap.withdrawal,
|
|
388
|
+
"letsexchange",
|
|
389
|
+
swap.deposit_extra_id ?? null,
|
|
390
|
+
swap.withdrawal_extra_id ?? null,
|
|
391
|
+
swap.return_extra_id ?? null
|
|
392
|
+
);
|
|
393
|
+
})
|
|
394
|
+
.flat();
|
|
395
|
+
Logger.log(`Swap details result ${safeStringify(swaps)}`, loggerSource);
|
|
396
|
+
return { result: true, swaps: swaps };
|
|
397
|
+
} catch (e) {
|
|
398
|
+
Logger.logError(e, loggerSource, `Failed to get swap details. Error is: ${safeStringify(e)}`);
|
|
399
|
+
const composeFailResult = reason => ({
|
|
400
|
+
result: false,
|
|
401
|
+
reason: reason,
|
|
402
|
+
});
|
|
403
|
+
const status = e?.response?.status;
|
|
404
|
+
const data = e?.response?.data;
|
|
405
|
+
if (status === 429) {
|
|
406
|
+
Logger.log(`Returning fail - RPS limit exceeded ${data}`, loggerSource);
|
|
407
|
+
return composeFailResult(SwapProvider.COMMON_ERRORS.REQUESTS_LIMIT_EXCEEDED);
|
|
408
|
+
}
|
|
409
|
+
improveAndRethrow(e, loggerSource);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// TODO: [dev] Serg, please check this during the review to make sure I did no mistakes in statuses mapping.
|
|
414
|
+
// I will remove these comments after the review. https://api.letsexchange.io/doc
|
|
415
|
+
// wait The exchange has just been created and it’s waiting for coins to reach the deposit wallet
|
|
416
|
+
// confirmation The transaction appears in mempool and now it is waiting for necessary network confirmations to start.
|
|
417
|
+
// confirmed The user’s payment is confirmed, the exchange process is about to start.
|
|
418
|
+
// exchanging The exchange process is running.
|
|
419
|
+
// sending Funds are being sent to the recipient`s address.
|
|
420
|
+
// sending_confirmation The outgoing transaction is waiting for network confirmations.
|
|
421
|
+
// success The exchange is completed and the funds are successfully sent to the recipient’s address.
|
|
422
|
+
// aml_check_failed The deposit was marked as risky by AML check service.
|
|
423
|
+
// overdue The deposit receiving time for this transaction has expired.
|
|
424
|
+
// error The transaction has failed. In most cases, the amount that was sent differs from the amount that was specified when creating the transaction.
|
|
425
|
+
// refund The exchange failed and the coins were refunded to the user's wallet.
|
|
426
|
+
_mapLetsExchangeStatusToRabbitStatus(status, isExpiredByTime) {
|
|
427
|
+
switch (status) {
|
|
428
|
+
case "wait":
|
|
429
|
+
if (isExpiredByTime) {
|
|
430
|
+
return SwapProvider.SWAP_STATUSES.EXPIRED;
|
|
431
|
+
}
|
|
432
|
+
return SwapProvider.SWAP_STATUSES.WAITING_FOR_PAYMENT;
|
|
433
|
+
case "confirmation":
|
|
434
|
+
return SwapProvider.SWAP_STATUSES.CONFIRMING;
|
|
435
|
+
case "confirmed":
|
|
436
|
+
return SwapProvider.SWAP_STATUSES.PAYMENT_RECEIVED;
|
|
437
|
+
case "exchanging":
|
|
438
|
+
return SwapProvider.SWAP_STATUSES.EXCHANGING;
|
|
439
|
+
case "sending":
|
|
440
|
+
return SwapProvider.SWAP_STATUSES.PAYMENT_RECEIVED;
|
|
441
|
+
case "sending_confirmation":
|
|
442
|
+
return SwapProvider.SWAP_STATUSES.EXCHANGING;
|
|
443
|
+
case "success":
|
|
444
|
+
return SwapProvider.SWAP_STATUSES.COMPLETED;
|
|
445
|
+
case "refund":
|
|
446
|
+
return SwapProvider.SWAP_STATUSES.REFUNDED;
|
|
447
|
+
case "overdue":
|
|
448
|
+
return SwapProvider.SWAP_STATUSES.EXPIRED;
|
|
449
|
+
case "aml_check_failed":
|
|
450
|
+
return SwapProvider.SWAP_STATUSES.EXCHANGING;
|
|
451
|
+
case "error":
|
|
452
|
+
return SwapProvider.SWAP_STATUSES.FAILED;
|
|
453
|
+
default:
|
|
454
|
+
throw new Error(`Unknown LetsExchange status: ${status}`);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|