@rabbitio/ui-kit 1.0.0-beta.11 → 1.0.0-beta.111
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/.env.example +1 -0
- package/.gitlab-ci.yml +29 -0
- package/.husky/commit-msg +19 -0
- package/.husky/pre-push +1 -0
- package/README.md +14 -4
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +17666 -0
- package/coverage/coverage-final.json +119 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +1001 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/rabbit-ui-kit/index.html +116 -0
- package/coverage/rabbit-ui-kit/index.js.html +88 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/analyticsAdapters/googleAnalyticsAdapter.js.html +151 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/analyticsAdapters/index.html +146 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/analyticsAdapters/metrikaAdapter.js.html +172 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/analyticsAdapters/mixpanelAdapter.js.html +199 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/axiosAdapter.js.html +190 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/index.html +131 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/qrUtils.js.html +139 -0
- package/coverage/rabbit-ui-kit/src/common-apis/external-apis/apiGroups.js.html +253 -0
- package/coverage/rabbit-ui-kit/src/common-apis/external-apis/emailAPI.js.html +133 -0
- package/coverage/rabbit-ui-kit/src/common-apis/external-apis/index.html +146 -0
- package/coverage/rabbit-ui-kit/src/common-apis/external-apis/ipAddressProviders.js.html +391 -0
- package/coverage/rabbit-ui-kit/src/common-apis/globalConstants.jsx.html +94 -0
- package/coverage/rabbit-ui-kit/src/common-apis/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/common-apis/models/blockchain.js.html +115 -0
- package/coverage/rabbit-ui-kit/src/common-apis/models/coin.js.html +829 -0
- package/coverage/rabbit-ui-kit/src/common-apis/models/index.html +146 -0
- package/coverage/rabbit-ui-kit/src/common-apis/models/protocol.js.html +100 -0
- package/coverage/rabbit-ui-kit/src/common-apis/services/fiatCurrenciesService.js.html +544 -0
- package/coverage/rabbit-ui-kit/src/common-apis/services/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/amountUtils.js.html +1234 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/cache.js.html +811 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/errorUtils.js.html +211 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/index.html +191 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/logging/index.html +131 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/logging/logger.js.html +211 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/logging/logsStorage.js.html +268 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/postponeExecution.js.html +118 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/rabbitTicker.js.html +157 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/safeStringify.js.html +235 -0
- package/coverage/rabbit-ui-kit/src/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/index.js.html +382 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/cacheAndConcurrentRequestsResolver.js.html +1660 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/cachedRobustExternalApiCallerService.js.html +526 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/cancelProcessing.js.html +172 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/concurrentCalculationsMetadataHolder.js.html +310 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/externalApiProvider.js.html +553 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/externalServicesStatsCollector.js.html +319 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/index.html +206 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/robustExternalAPICallerService.js.html +997 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/exolixSwapProvider.js.html +1891 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/goexmeSwapProvider.js.html +2077 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/index.html +191 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/letsExchangeSwapProvider.js.html +1633 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapProvider.js.html +1825 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +1924 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/utils.js.html +163 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/baseSwapCreationInfo.js.html +319 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/existingSwap.js.html +514 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/existingSwapWithFiatData.js.html +529 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/index.html +176 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/partner.js.html +166 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/swapProviderCoinInfo.js.html +331 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/services/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/services/publicSwapService.js.html +1570 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/utils/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/utils/swapUtils.js.html +706 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/arrowIcon.jsx.html +124 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/arrowTosca.jsx.html +127 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/arrowWhite.jsx.html +127 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/darkRectangle.jsx.html +106 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/determinedError.jsx.html +439 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/failedValidationIcon.jsx.html +202 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/index.html +281 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/infoIcon.jsx.html +133 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/messageIcon.jsx.html +346 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/noticeQuestionIcon.jsx.html +247 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx.html +163 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/supportDialogImage.jsx.html +268 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/walletIcon.jsx.html +151 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetIcon/AssetIcon.jsx.html +256 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetIcon/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetSelection/AssetSelection.jsx.html +289 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetSelection/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +187 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/BackgroundTitle/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/InformationMessage/InformationMessage.jsx.html +238 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/InformationMessage/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Input/Input.jsx.html +634 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Input/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/LoadingDots/LoadingDots.jsx.html +196 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/LoadingDots/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx.html +277 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/NoticeIcon/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/QrCode/QrCode.jsx.html +199 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/QrCode/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx.html +175 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/RateSelector/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/SupportChat/SupportChat.jsx.html +217 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/SupportChat/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Textarea/Textarea.jsx.html +529 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Textarea/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TitleBox/TitleBox.jsx.html +508 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TitleBox/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Tooltip/Tooltip.jsx.html +316 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Tooltip/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx.html +313 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Validation/Validation.jsx.html +202 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Validation/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Button/Button.jsx.html +733 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Button/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Close/Close.jsx.html +259 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Close/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx.html +433 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/LinkButton/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +415 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx.html +1429 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/AmountInput/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx.html +1474 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/CoinPicker/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/ColoredNotice/ColoredNotice.jsx.html +241 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/ColoredNotice/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/LineWithIconLink/LineWithIconLink.jsx.html +190 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/LineWithIconLink/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/LogoCarousel/LogoCarousel.jsx.html +307 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/LogoCarousel/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/SearchableCoinsList/SearchableCoinsList.jsx.html +427 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/SearchableCoinsList/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx.html +181 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/TitledLineWithIconLink/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +283 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/CoinPickerDialogStep/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/Dialog.jsx.html +1567 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +481 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +1747 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx.html +4228 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/SwapForm/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/WaitlistSubscription/WaitlistSubscription.jsx.html +559 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/WaitlistSubscription/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx.html +316 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/templates/DeterminedErrorDialogStep/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/hooks/index.html +146 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/hooks/useCallHandlingErrors.js.html +166 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/hooks/useIsHydrated.js.html +121 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/hooks/useReferredState.js.html +157 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/index.html +176 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/inputValueProviders.js.html +235 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/searchCoins.js.html +259 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/textUtils.js.html +139 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/uiUtils.js.html +121 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/urlQueryUtils.js.html +271 -0
- package/coverage/rabbit-ui-kit/stories/atoms/BackgroundTitle.stories.jsx.html +202 -0
- package/coverage/rabbit-ui-kit/stories/atoms/LinesOfText.stories.jsx.html +283 -0
- package/coverage/rabbit-ui-kit/stories/atoms/LoadingDots.stories.jsx.html +226 -0
- package/coverage/rabbit-ui-kit/stories/atoms/QrCode.stories.jsx.html +175 -0
- package/coverage/rabbit-ui-kit/stories/atoms/RateSelector.stories.jsx.html +136 -0
- package/coverage/rabbit-ui-kit/stories/atoms/Validation.stories.jsx.html +178 -0
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/Button.stories.jsx.html +883 -0
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/Close.stories.jsx.html +211 -0
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/LinkButton.stories.jsx.html +301 -0
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/index.html +146 -0
- package/coverage/rabbit-ui-kit/stories/atoms/index.html +191 -0
- package/coverage/rabbit-ui-kit/stories/molecules/AmountInput.stories.jsx.html +289 -0
- package/coverage/rabbit-ui-kit/stories/molecules/CoinPicker.stories.jsx.html +322 -0
- package/coverage/rabbit-ui-kit/stories/molecules/ColoredNotice.stories.jsx.html +178 -0
- package/coverage/rabbit-ui-kit/stories/molecules/LineWithIconLink.stories.jsx.html +154 -0
- package/coverage/rabbit-ui-kit/stories/molecules/LogoCarousel.stories.jsx.html +235 -0
- package/coverage/rabbit-ui-kit/stories/molecules/TitledLineWithIconLink.stories.jsx.html +160 -0
- package/coverage/rabbit-ui-kit/stories/molecules/index.html +191 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/Dialog.stories.jsx.html +523 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogButtons/DialogButtons.stories.jsx.html +328 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogButtons/index.html +116 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogStep/DialogStep.stories.jsx.html +337 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogStep/index.html +116 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/index.html +116 -0
- package/coverage/rabbit-ui-kit/stories/organisms/WaitlistSubscription.stories.jsx.html +151 -0
- package/coverage/rabbit-ui-kit/stories/organisms/index.html +116 -0
- package/coverage/rabbit-ui-kit/stories/stubs/coins.jsx.html +6880 -0
- package/coverage/rabbit-ui-kit/stories/stubs/exampleContent.jsx.html +145 -0
- package/coverage/rabbit-ui-kit/stories/stubs/index.html +131 -0
- package/coverage/rabbit-ui-kit/stories/templates/DeterminedErrorDialogStep.stories.jsx.html +190 -0
- package/coverage/rabbit-ui-kit/stories/templates/index.html +116 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/dist/global.css +197 -0
- package/dist/global.css.map +1 -0
- package/dist/index.cjs +13003 -1052
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +2350 -8491
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +9951 -847
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +12930 -1066
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +12994 -1055
- package/dist/index.umd.js.map +1 -1
- package/package.json +35 -9
- package/raw +1000 -0
- package/src/common-apis/adapters/analyticsAdapters/googleAnalyticsAdapter.js +22 -0
- package/src/common-apis/adapters/analyticsAdapters/metrikaAdapter.js +29 -0
- package/src/common-apis/adapters/analyticsAdapters/mixpanelAdapter.js +38 -0
- package/src/common-apis/adapters/axiosAdapter.js +35 -0
- package/src/common-apis/adapters/qrUtils.js +18 -0
- package/src/common-apis/external-apis/apiGroups.js +56 -0
- package/src/common-apis/external-apis/emailAPI.js +16 -0
- package/src/common-apis/external-apis/ipAddressProviders.js +102 -0
- package/src/common-apis/globalConstants.jsx +3 -0
- package/src/{common → common-apis}/models/coin.js +98 -7
- package/src/{common → common-apis/services}/fiatCurrenciesService.js +4 -12
- package/src/common-apis/tests/integration/external-apis/ipAddressProviders/getClientIpAddress.test.js +18 -0
- package/src/common-apis/tests/units/utils/amountUtils/composeRateText.test.js +152 -0
- package/src/{common → common-apis/utils}/amountUtils.js +100 -140
- package/src/{common → common-apis}/utils/cache.js +15 -41
- package/src/{common → common-apis/utils}/errorUtils.js +15 -0
- package/src/{common → common-apis}/utils/logging/logger.js +7 -13
- package/src/common-apis/utils/postponeExecution.js +11 -0
- package/src/common-apis/utils/rabbitTicker.js +24 -0
- package/src/index.js +90 -14
- package/src/robust-api-caller/cacheAndConcurrentRequestsResolver.js +525 -0
- package/src/robust-api-caller/cachedRobustExternalApiCallerService.js +147 -0
- package/src/robust-api-caller/cancelProcessing.js +29 -0
- package/src/robust-api-caller/concurrentCalculationsMetadataHolder.js +75 -0
- package/src/robust-api-caller/externalApiProvider.js +156 -0
- package/src/robust-api-caller/externalServicesStatsCollector.js +78 -0
- package/src/robust-api-caller/robustExternalAPICallerService.js +304 -0
- package/src/robust-api-caller/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/_performCallAttempt.test.js +533 -0
- package/src/robust-api-caller/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/callExternalAPI.test.js +532 -0
- package/src/robust-api-caller/tests/robustExternalAPICallerService/robustExternalAPICallerService/constructor.test.js +19 -0
- package/src/swaps-lib/external-apis/exolixSwapProvider.js +602 -0
- package/src/swaps-lib/external-apis/goexmeSwapProvider.js +664 -0
- package/src/swaps-lib/external-apis/letsExchangeSwapProvider.js +516 -0
- package/src/swaps-lib/external-apis/swapProvider.js +435 -24
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +613 -0
- package/src/swaps-lib/external-apis/utils.js +26 -0
- package/src/swaps-lib/models/baseSwapCreationInfo.js +78 -0
- package/src/swaps-lib/models/existingSwap.js +101 -16
- package/src/swaps-lib/models/existingSwapWithFiatData.js +148 -0
- package/src/swaps-lib/models/partner.js +27 -0
- package/src/swaps-lib/models/swapProviderCoinInfo.js +82 -0
- package/src/swaps-lib/services/publicSwapService.js +495 -0
- package/src/swaps-lib/test/external-apis/exolixSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +34 -0
- package/src/swaps-lib/test/external-apis/exolixSwapProvider/createSwap.test.js +1043 -0
- package/src/swaps-lib/test/external-apis/exolixSwapProvider/getSwapInfo.test.js +611 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +148 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/createSwap.test.js +115 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/getSwapInfo.test.js +149 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/PairSupport.int.test.js +97 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/_fetchSupportedCurrenciesIfNeeded.int.test.js +171 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/createSwap.int.test.js +239 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/getSwapInfo.int.test.js +141 -0
- package/src/swaps-lib/test/external-apis/swapProvider/getAllSupportedCurrencies.test.js +63 -0
- package/src/swaps-lib/test/external-apis/swapProvider/getDepositCurrencies.test.js +73 -0
- package/src/swaps-lib/test/external-apis/swapProvider/getWithdrawalCurrencies.test.js +102 -0
- package/src/swaps-lib/test/external-apis/swapProvider/removeProtocolNameFromCoinName.test.js +152 -0
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +536 -0
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/createSwap.test.js +1214 -0
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getSwapInfo.test.js +1743 -0
- package/src/swaps-lib/test/utils/swapUtils/safeHandleRequestsLimitExceeding.test.js +80 -0
- package/src/swaps-lib/utils/swapUtils.js +207 -0
- package/{styles → src/ui-kit/assets/styles}/_functions.scss +5 -0
- package/{styles → src/ui-kit/assets/styles}/_mixins.scss +2 -2
- package/{styles → src/ui-kit/assets/styles}/_placeholder.scss +3 -3
- package/{styles → src/ui-kit/assets/styles}/_variables.scss +17 -15
- package/src/ui-kit/assets/styles/fonts/NunitoSans-Bold.ttf +0 -0
- package/src/ui-kit/assets/styles/fonts/NunitoSans-ExtraBold.ttf +0 -0
- package/src/ui-kit/assets/styles/fonts/NunitoSans-Light.ttf +0 -0
- package/src/ui-kit/assets/styles/fonts/NunitoSans-Regular.ttf +0 -0
- package/src/ui-kit/assets/styles/fonts/NunitoSans-SemiBold.ttf +0 -0
- package/src/ui-kit/assets/styles/global.scss +171 -0
- package/src/ui-kit/assets/styles/index.scss +10 -0
- package/src/ui-kit/assets/wrappedImages/arrowIcon.jsx +13 -0
- package/src/ui-kit/assets/wrappedImages/arrowTosca.jsx +14 -0
- package/src/ui-kit/assets/wrappedImages/arrowWhite.jsx +14 -0
- package/src/ui-kit/assets/wrappedImages/darkRectangle.jsx +7 -0
- package/src/ui-kit/assets/wrappedImages/determinedError.jsx +118 -0
- package/src/ui-kit/assets/wrappedImages/failedValidationIcon.jsx +39 -0
- package/src/ui-kit/assets/wrappedImages/infoIcon.jsx +16 -0
- package/src/ui-kit/assets/wrappedImages/messageIcon.jsx +87 -0
- package/src/ui-kit/assets/wrappedImages/noticeQuestionIcon.jsx +54 -0
- package/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx +26 -0
- package/src/ui-kit/assets/wrappedImages/supportDialogImage.jsx +61 -0
- package/src/ui-kit/assets/wrappedImages/walletIcon.jsx +22 -0
- package/src/{components → ui-kit/components}/atoms/AssetIcon/AssetIcon.jsx +16 -14
- package/src/{components → ui-kit/components}/atoms/AssetIcon/asset-icon.module.scss +1 -1
- package/src/ui-kit/components/atoms/AssetSelection/AssetSelection.jsx +68 -0
- package/src/ui-kit/components/atoms/AssetSelection/asset-selection.module.scss +56 -0
- package/src/ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx +34 -0
- package/src/ui-kit/components/atoms/BackgroundTitle/background-title.module.scss +52 -0
- package/src/ui-kit/components/atoms/InformationMessage/InformationMessage.jsx +51 -0
- package/src/ui-kit/components/atoms/InformationMessage/information-message.module.scss +38 -0
- package/src/ui-kit/components/atoms/Input/Input.jsx +183 -0
- package/src/ui-kit/components/atoms/Input/input.module.scss +107 -0
- package/src/{components → ui-kit/components}/atoms/LoadingDots/LoadingDots.jsx +8 -28
- package/src/{components → ui-kit/components}/atoms/LoadingDots/LoadingDots.module.scss +3 -2
- package/src/ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx +64 -0
- package/src/ui-kit/components/atoms/NoticeIcon/notice-icon.module.scss +14 -0
- package/src/ui-kit/components/atoms/QrCode/QrCode.jsx +38 -0
- package/src/ui-kit/components/atoms/QrCode/qr-code.module.scss +8 -0
- package/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx +30 -0
- package/src/ui-kit/components/atoms/RateSelector/rate-selector.module.scss +47 -0
- package/src/{components → ui-kit/components}/atoms/SupportChat/SupportChat.jsx +5 -1
- package/src/ui-kit/components/atoms/Textarea/Textarea.jsx +148 -0
- package/src/ui-kit/components/atoms/Textarea/textarea.module.scss +71 -0
- package/src/ui-kit/components/atoms/TitleBox/TitleBox.jsx +141 -0
- package/src/ui-kit/components/atoms/TitleBox/title-box.module.scss +32 -0
- package/src/ui-kit/components/atoms/Tooltip/Tooltip.jsx +77 -0
- package/src/ui-kit/components/atoms/Tooltip/tooltip.module.scss +237 -0
- package/src/ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx +76 -0
- package/src/ui-kit/components/atoms/TwoLinesOfText/lines-of-text.module.scss +65 -0
- package/src/ui-kit/components/atoms/Validation/Validation.jsx +39 -0
- package/src/ui-kit/components/atoms/Validation/validation.module.scss +19 -0
- package/src/{components → ui-kit/components}/atoms/buttons/Button/Button.jsx +26 -45
- package/src/{components → ui-kit/components}/atoms/buttons/Button/Button.module.scss +1 -1
- package/src/ui-kit/components/atoms/buttons/Close/Close.jsx +58 -0
- package/src/ui-kit/components/atoms/buttons/Close/close.module.scss +75 -0
- package/src/ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx +116 -0
- package/src/ui-kit/components/atoms/buttons/LinkButton/link-button.module.scss +53 -0
- package/src/ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx +110 -0
- package/src/ui-kit/components/atoms/buttons/RadioButtonWithText/radio-button-with-text.module.scss +86 -0
- package/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx +448 -0
- package/src/ui-kit/components/molecules/AmountInput/amount-input.module.scss +233 -0
- package/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx +463 -0
- package/src/ui-kit/components/molecules/CoinPicker/coin-picker.module.scss +207 -0
- package/src/ui-kit/components/molecules/ColoredNotice/ColoredNotice.jsx +52 -0
- package/src/ui-kit/components/molecules/ColoredNotice/colored-notice.module.scss +36 -0
- package/src/ui-kit/components/molecules/LineWithIconLink/LineWithIconLink.jsx +35 -0
- package/src/ui-kit/components/molecules/LineWithIconLink/line-with-icon-link.module.scss +25 -0
- package/src/ui-kit/components/molecules/LogoCarousel/LogoCarousel.jsx +74 -0
- package/src/ui-kit/components/molecules/LogoCarousel/logo-carousel.module.scss +106 -0
- package/src/ui-kit/components/molecules/SearchableCoinsList/SearchableCoinsList.jsx +114 -0
- package/src/ui-kit/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx +32 -0
- package/src/ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx +66 -0
- package/src/ui-kit/components/organisms/Dialog/Dialog.jsx +494 -0
- package/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx +132 -0
- package/src/ui-kit/components/organisms/Dialog/DialogButtons/dialog-buttons.module.scss +25 -0
- package/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx +554 -0
- package/src/ui-kit/components/organisms/Dialog/DialogStep/dialog-step.module.scss +382 -0
- package/src/ui-kit/components/organisms/Dialog/dialog.module.scss +226 -0
- package/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx +1381 -0
- package/src/ui-kit/components/organisms/SwapForm/swap-form.module.scss +134 -0
- package/src/ui-kit/components/organisms/WaitlistSubscription/WaitlistSubscription.jsx +158 -0
- package/src/ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx +77 -0
- package/src/ui-kit/hooks/useCallHandlingErrors.js +27 -0
- package/src/ui-kit/hooks/useIsHydrated.js +12 -0
- package/src/ui-kit/hooks/useReferredState.js +24 -0
- package/src/ui-kit/tests/utils/inputValueProviders/provideFormatOfFloatValueByInputString.test.js +146 -0
- package/src/ui-kit/tests/utils/urlQueryUtils/getQueryParameterValues.test.js +65 -0
- package/src/ui-kit/tests/utils/urlQueryUtils/saveQueryParameterAndValues.test.js +104 -0
- package/src/ui-kit/utils/inputValueProviders.js +50 -0
- package/src/ui-kit/utils/searchCoins.js +58 -0
- package/src/ui-kit/utils/textUtils.js +18 -0
- package/src/ui-kit/utils/uiUtils.js +12 -0
- package/src/ui-kit/utils/urlQueryUtils.js +62 -0
- package/stories/font.scss +40 -0
- package/stories/stubs/coins.jsx +2266 -0
- package/stories/stubs/exampleContent.jsx +20 -0
- package/styles/_global-classes.scss +0 -433
- package/styles/fonts/NunitoSans-Bold.ttf +0 -0
- package/styles/fonts/NunitoSans-ExtraBold.ttf +0 -0
- package/styles/fonts/NunitoSans-Light.ttf +0 -0
- package/styles/fonts/NunitoSans-Regular.ttf +0 -0
- package/styles/fonts/NunitoSans-SemiBold.ttf +0 -0
- package/styles/global-styles-index.scss +0 -74
- package/styles/index.scss +0 -33
- /package/src/{common → common-apis}/models/blockchain.js +0 -0
- /package/src/{common → common-apis}/models/protocol.js +0 -0
- /package/src/{common → common-apis}/utils/logging/logsStorage.js +0 -0
- /package/src/{common → common-apis}/utils/safeStringify.js +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}/size/_margin-size.scss +0 -0
- /package/{styles → src/ui-kit/assets/styles}/size/_padding-size.scss +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export class BaseSwapCreationInfo {
|
|
2
|
+
/** @type {Coin} */
|
|
3
|
+
fromCoin;
|
|
4
|
+
/** @type {Coin} */
|
|
5
|
+
toCoin;
|
|
6
|
+
/** @type {string} */
|
|
7
|
+
fromAmountCoins;
|
|
8
|
+
/** @type {string} */
|
|
9
|
+
toAmountCoins;
|
|
10
|
+
/** @type {string} */
|
|
11
|
+
rate;
|
|
12
|
+
/** @type {Object} */
|
|
13
|
+
rawSwapData;
|
|
14
|
+
/** @type {string} */
|
|
15
|
+
min;
|
|
16
|
+
/** @type {number} */
|
|
17
|
+
fiatMin;
|
|
18
|
+
/** @type {string} */
|
|
19
|
+
max;
|
|
20
|
+
/** @type {number} */
|
|
21
|
+
fiatMax;
|
|
22
|
+
/** @type {string} */
|
|
23
|
+
durationMinutesRange;
|
|
24
|
+
/** @type {boolean} */
|
|
25
|
+
fixed;
|
|
26
|
+
/** @type {string|null} */
|
|
27
|
+
partner;
|
|
28
|
+
/** @type {boolean} */
|
|
29
|
+
isRefundAddressRequired;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @param fromCoin {Coin}
|
|
33
|
+
* @param toCoin {Coin}
|
|
34
|
+
* @param fromAmountCoins {string}
|
|
35
|
+
* @param toAmountCoins {string}
|
|
36
|
+
* @param rate {string}
|
|
37
|
+
* @param rawSwapData {Object}
|
|
38
|
+
* @param min {string}
|
|
39
|
+
* @param fiatMin {number}
|
|
40
|
+
* @param max {string}
|
|
41
|
+
* @param fiatMax {number}
|
|
42
|
+
* @param durationMinutesRange {string}
|
|
43
|
+
* @param fixed {boolean}
|
|
44
|
+
* @param partner {string|null} rabbit partner id
|
|
45
|
+
* @param [isRefundAddressRequired=false] {boolean}
|
|
46
|
+
*/
|
|
47
|
+
constructor(
|
|
48
|
+
fromCoin,
|
|
49
|
+
toCoin,
|
|
50
|
+
fromAmountCoins,
|
|
51
|
+
toAmountCoins,
|
|
52
|
+
rate,
|
|
53
|
+
rawSwapData,
|
|
54
|
+
min,
|
|
55
|
+
fiatMin,
|
|
56
|
+
max,
|
|
57
|
+
fiatMax,
|
|
58
|
+
durationMinutesRange,
|
|
59
|
+
fixed,
|
|
60
|
+
partner = null,
|
|
61
|
+
isRefundAddressRequired = false
|
|
62
|
+
) {
|
|
63
|
+
this.fromCoin = fromCoin;
|
|
64
|
+
this.toCoin = toCoin;
|
|
65
|
+
this.fromAmountCoins = fromAmountCoins;
|
|
66
|
+
this.toAmountCoins = toAmountCoins;
|
|
67
|
+
this.rate = rate;
|
|
68
|
+
this.rawSwapData = rawSwapData;
|
|
69
|
+
this.min = min;
|
|
70
|
+
this.fiatMin = fiatMin;
|
|
71
|
+
this.max = max;
|
|
72
|
+
this.fiatMax = fiatMax;
|
|
73
|
+
this.durationMinutesRange = durationMinutesRange;
|
|
74
|
+
this.fixed = fixed;
|
|
75
|
+
this.partner = partner;
|
|
76
|
+
this.isRefundAddressRequired = isRefundAddressRequired;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -1,20 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an existing swap.
|
|
3
|
+
*/
|
|
1
4
|
export class ExistingSwap {
|
|
5
|
+
/** @type {string} The ID of the swap. */
|
|
6
|
+
swapId;
|
|
7
|
+
|
|
8
|
+
/** @type {SwapProvider.SWAP_STATUSES} The status of the swap. */
|
|
9
|
+
status;
|
|
10
|
+
|
|
11
|
+
/** @type {number} The timestamp when the swap was created. */
|
|
12
|
+
createdAt;
|
|
13
|
+
|
|
14
|
+
/** @type {number} The timestamp when the swap expires. */
|
|
15
|
+
expiresAt;
|
|
16
|
+
|
|
17
|
+
/** @type {number|null} The number of confirmations the swap has received, or null if not applicable. */
|
|
18
|
+
confirmations;
|
|
19
|
+
|
|
20
|
+
/** @type {string} The exchange rate for the swap. */
|
|
21
|
+
rate;
|
|
22
|
+
|
|
23
|
+
/** @type {boolean} Whether the rate is fixed. */
|
|
24
|
+
fixed;
|
|
25
|
+
|
|
26
|
+
/** @type {string|null} The refund address in case the swap fails, or null if not applicable. */
|
|
27
|
+
refundAddress;
|
|
28
|
+
|
|
29
|
+
/** @type {string} The address to send the payment to. */
|
|
30
|
+
payToAddress;
|
|
31
|
+
|
|
32
|
+
/** @type {Coin} The coin from which the swap is made. */
|
|
33
|
+
fromCoin;
|
|
34
|
+
|
|
35
|
+
/** @type {string} The amount of the fromCoin being swapped. */
|
|
36
|
+
fromAmount;
|
|
37
|
+
|
|
38
|
+
/** @type {string|null} The transaction ID for the fromCoin, or null if not applicable. */
|
|
39
|
+
fromTransactionId;
|
|
40
|
+
|
|
41
|
+
/** @type {string|null} The link to view the fromCoin transaction, or null if not applicable. */
|
|
42
|
+
fromTransactionLink;
|
|
43
|
+
|
|
44
|
+
/** @type {Coin} The coin to which the swap is made. */
|
|
45
|
+
toCoin;
|
|
46
|
+
|
|
47
|
+
/** @type {string} The amount of the toCoin received. */
|
|
48
|
+
toAmount;
|
|
49
|
+
|
|
50
|
+
/** @type {string|null} The transaction ID for the toCoin, or null if not applicable. */
|
|
51
|
+
toTransactionId;
|
|
52
|
+
|
|
53
|
+
/** @type {string|null} The link to view the toCoin transaction, or null if not applicable. */
|
|
54
|
+
toTransactionLink;
|
|
55
|
+
|
|
56
|
+
/** @type {string} The address to send the swapped toCoin to. */
|
|
57
|
+
toAddress;
|
|
58
|
+
|
|
59
|
+
/** @type {string|null} The partner associated with the swap, or null if not applicable. */
|
|
60
|
+
partner;
|
|
61
|
+
|
|
62
|
+
/** @type {string|null} Extra identifier for the fromCoin, or null if not applicable. */
|
|
63
|
+
fromExtraId;
|
|
64
|
+
|
|
65
|
+
/** @type {string|null} Extra identifier for the toCoin, or null if not applicable. */
|
|
66
|
+
toExtraId;
|
|
67
|
+
|
|
68
|
+
/** @type {string|null} Extra identifier for refund, or null if not applicable. */
|
|
69
|
+
refundExtraId;
|
|
70
|
+
|
|
2
71
|
/**
|
|
3
|
-
* @
|
|
4
|
-
* @param
|
|
5
|
-
* @param
|
|
6
|
-
* @param
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
13
|
-
* @param
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
72
|
+
* @constructor
|
|
73
|
+
* @param {string} swapId - The ID of the swap.
|
|
74
|
+
* @param {SwapProvider.SWAP_STATUSES} status - The status of the swap.
|
|
75
|
+
* @param {number} createdAt - The timestamp when the swap was created.
|
|
76
|
+
* @param {number} expiresAt - The timestamp when the swap expires.
|
|
77
|
+
* @param {number|null} confirmations - The number of confirmations the swap has received, or null.
|
|
78
|
+
* @param {string} rate - The exchange rate for the swap.
|
|
79
|
+
* @param {null} fixed - Indicates if the rate is fixed.
|
|
80
|
+
* @param {string|null} refundAddress - The address to refund to in case of failure, or null.
|
|
81
|
+
* @param {string} payToAddress - The address to send the funds to.
|
|
82
|
+
* @param {Coin} fromCoin - The coin that is being swapped from.
|
|
83
|
+
* @param {string} fromAmount - The amount of the coin being swapped from.
|
|
84
|
+
* @param {string|null} fromTransactionId - The transaction ID for the fromCoin, or null.
|
|
85
|
+
* @param {string|null} fromTransactionLink - The link to view the fromCoin transaction, or null.
|
|
86
|
+
* @param {Coin} toCoin - The coin that is being swapped to.
|
|
87
|
+
* @param {string} toAmount - The amount of the coin being swapped to.
|
|
88
|
+
* @param {string|null} toTransactionId - The transaction ID for the toCoin, or null.
|
|
89
|
+
* @param {string|null} toTransactionLink - The link to view the toCoin transaction, or null.
|
|
90
|
+
* @param {string} toAddress - The address to send the swapped coin to.
|
|
91
|
+
* @param {string|null} partner - The partner associated with the swap, or null.
|
|
92
|
+
* @param {string|null} fromExtraId - Any extra ID related to the fromCoin, or null.
|
|
93
|
+
* @param {string|null} toExtraId - Any extra ID related to the toCoin, or null.
|
|
94
|
+
* @param {string|null} refundExtraId - Any extra ID related to the refund, or null.
|
|
18
95
|
*/
|
|
19
96
|
constructor(
|
|
20
97
|
swapId,
|
|
@@ -23,6 +100,7 @@ export class ExistingSwap {
|
|
|
23
100
|
expiresAt,
|
|
24
101
|
confirmations,
|
|
25
102
|
rate,
|
|
103
|
+
fixed,
|
|
26
104
|
refundAddress,
|
|
27
105
|
payToAddress,
|
|
28
106
|
fromCoin,
|
|
@@ -34,7 +112,10 @@ export class ExistingSwap {
|
|
|
34
112
|
toTransactionId,
|
|
35
113
|
toTransactionLink,
|
|
36
114
|
toAddress, // TODO: [refactoring, moderate] toAddress is not quite clear. How about recipientAddress? task_id=0815a111c99543b78d374217eadbde4f
|
|
37
|
-
partner
|
|
115
|
+
partner,
|
|
116
|
+
fromExtraId,
|
|
117
|
+
toExtraId,
|
|
118
|
+
refundExtraId
|
|
38
119
|
) {
|
|
39
120
|
this.swapId = swapId;
|
|
40
121
|
this.status = status;
|
|
@@ -42,6 +123,7 @@ export class ExistingSwap {
|
|
|
42
123
|
this.expiresAt = expiresAt;
|
|
43
124
|
this.confirmations = confirmations;
|
|
44
125
|
this.rate = rate;
|
|
126
|
+
this.fixed = fixed;
|
|
45
127
|
this.refundAddress = refundAddress;
|
|
46
128
|
this.payToAddress = payToAddress;
|
|
47
129
|
this.fromCoin = fromCoin;
|
|
@@ -54,5 +136,8 @@ export class ExistingSwap {
|
|
|
54
136
|
this.toAmount = toAmount;
|
|
55
137
|
this.toAddress = toAddress;
|
|
56
138
|
this.partner = partner;
|
|
139
|
+
this.fromExtraId = fromExtraId;
|
|
140
|
+
this.toExtraId = toExtraId;
|
|
141
|
+
this.refundExtraId = refundExtraId;
|
|
57
142
|
}
|
|
58
143
|
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { ExistingSwap } from "./existingSwap.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @class ExistingSwapWithFiatData
|
|
5
|
+
* @extends {ExistingSwap}
|
|
6
|
+
* @description Represents a swap with additional fiat currency data.
|
|
7
|
+
*/
|
|
8
|
+
export class ExistingSwapWithFiatData extends ExistingSwap {
|
|
9
|
+
/** @type {number|null} The fiat equivalent of the fromAmount. */
|
|
10
|
+
fromAmountFiat;
|
|
11
|
+
|
|
12
|
+
/** @type {number|null} The fiat equivalent of the toAmount. */
|
|
13
|
+
toAmountFiat;
|
|
14
|
+
|
|
15
|
+
/** @type {string} The fiat currency code (e.g., USD, EUR). */
|
|
16
|
+
fiatCurrencyCode;
|
|
17
|
+
|
|
18
|
+
/** @type {number} The number of decimals for the fiat currency. */
|
|
19
|
+
fiatCurrencyDecimals;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @constructor
|
|
23
|
+
* @param {string} swapId - The ID of the swap.
|
|
24
|
+
* @param {SwapProvider.SWAP_STATUSES} status - The status of the swap.
|
|
25
|
+
* @param {number} createdAt - The timestamp when the swap was created.
|
|
26
|
+
* @param {number} expiresAt - The timestamp when the swap expires.
|
|
27
|
+
* @param {number|null} confirmations - The number of confirmations the swap has received.
|
|
28
|
+
* @param {string} rate - The exchange rate for the swap.
|
|
29
|
+
* @param {boolean} fixed - Indicates if the rate is fixed.
|
|
30
|
+
* @param {string|null} refundAddress - The address to refund to in case of failure.
|
|
31
|
+
* @param {string} payToAddress - The address to send the funds to.
|
|
32
|
+
* @param {Coin} fromCoin - The coin that is being swapped from.
|
|
33
|
+
* @param {string} fromAmount - The amount of the coin being swapped from.
|
|
34
|
+
* @param {string|null} fromTransactionId - The transaction ID for the fromCoin.
|
|
35
|
+
* @param {string|null} fromTransactionLink - The link to view the fromCoin transaction.
|
|
36
|
+
* @param {Coin} toCoin - The coin that is being swapped to.
|
|
37
|
+
* @param {string} toAmount - The amount of the coin being swapped to.
|
|
38
|
+
* @param {string|null} toTransactionId - The transaction ID for the toCoin.
|
|
39
|
+
* @param {string|null} toTransactionLink - The link to view the toCoin transaction.
|
|
40
|
+
* @param {string} toAddress - The address to send the swapped coin to.
|
|
41
|
+
* @param {string|null} partner - The partner id associated with the swap.
|
|
42
|
+
* @param {string|null} fromExtraId - Any extra ID related to the fromCoin.
|
|
43
|
+
* @param {string|null} toExtraId - Any extra ID related to the toCoin.
|
|
44
|
+
* @param {string|null} refundExtraId - Any extra ID related to the refund.
|
|
45
|
+
* @param {number|null} fromAmountFiat - The fiat equivalent of the fromAmount.
|
|
46
|
+
* @param {number|null} toAmountFiat - The fiat equivalent of the toAmount.
|
|
47
|
+
* @param {string} fiatCurrencyCode - The fiat currency code (e.g., USD, EUR).
|
|
48
|
+
* @param {number} fiatCurrencyDecimals - The number of decimals for the fiat currency.
|
|
49
|
+
*/
|
|
50
|
+
constructor(
|
|
51
|
+
swapId,
|
|
52
|
+
status,
|
|
53
|
+
createdAt,
|
|
54
|
+
expiresAt,
|
|
55
|
+
confirmations,
|
|
56
|
+
rate,
|
|
57
|
+
fixed,
|
|
58
|
+
refundAddress,
|
|
59
|
+
payToAddress,
|
|
60
|
+
fromCoin,
|
|
61
|
+
fromAmount,
|
|
62
|
+
fromTransactionId,
|
|
63
|
+
fromTransactionLink,
|
|
64
|
+
toCoin,
|
|
65
|
+
toAmount,
|
|
66
|
+
toTransactionId,
|
|
67
|
+
toTransactionLink,
|
|
68
|
+
toAddress,
|
|
69
|
+
partner,
|
|
70
|
+
fromExtraId,
|
|
71
|
+
toExtraId,
|
|
72
|
+
refundExtraId,
|
|
73
|
+
fromAmountFiat,
|
|
74
|
+
toAmountFiat,
|
|
75
|
+
fiatCurrencyCode,
|
|
76
|
+
fiatCurrencyDecimals
|
|
77
|
+
) {
|
|
78
|
+
super(
|
|
79
|
+
swapId,
|
|
80
|
+
status,
|
|
81
|
+
createdAt,
|
|
82
|
+
expiresAt,
|
|
83
|
+
confirmations,
|
|
84
|
+
rate,
|
|
85
|
+
fixed,
|
|
86
|
+
refundAddress,
|
|
87
|
+
payToAddress,
|
|
88
|
+
fromCoin,
|
|
89
|
+
fromAmount,
|
|
90
|
+
fromTransactionId,
|
|
91
|
+
fromTransactionLink,
|
|
92
|
+
toCoin,
|
|
93
|
+
toAmount,
|
|
94
|
+
toTransactionId,
|
|
95
|
+
toTransactionLink,
|
|
96
|
+
toAddress,
|
|
97
|
+
partner,
|
|
98
|
+
fromExtraId,
|
|
99
|
+
toExtraId,
|
|
100
|
+
refundExtraId
|
|
101
|
+
);
|
|
102
|
+
this.fromAmountFiat = fromAmountFiat;
|
|
103
|
+
this.toAmountFiat = toAmountFiat;
|
|
104
|
+
this.fiatCurrencyCode = fiatCurrencyCode;
|
|
105
|
+
this.fiatCurrencyDecimals = fiatCurrencyDecimals;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Creates an instance of ExistingSwapWithFiatData from an ExistingSwap.
|
|
110
|
+
* @static
|
|
111
|
+
* @param {ExistingSwap} existingSwap - The existing swap data.
|
|
112
|
+
* @param {number|null} fromAmountFiat - The fiat equivalent of the fromAmount.
|
|
113
|
+
* @param {number|null} toAmountFiat - The fiat equivalent of the toAmount.
|
|
114
|
+
* @param {string} fiatCurrencyCode - The fiat currency code (e.g., USD, EUR).
|
|
115
|
+
* @param {number} fiatCurrencyDecimals - The number of decimals for the fiat currency.
|
|
116
|
+
* @returns {ExistingSwapWithFiatData} A new instance of ExistingSwapWithFiatData.
|
|
117
|
+
*/
|
|
118
|
+
static fromExistingSwap(existingSwap, fromAmountFiat, toAmountFiat, fiatCurrencyCode, fiatCurrencyDecimals) {
|
|
119
|
+
return new ExistingSwapWithFiatData(
|
|
120
|
+
existingSwap.swapId,
|
|
121
|
+
existingSwap.status,
|
|
122
|
+
existingSwap.createdAt,
|
|
123
|
+
existingSwap.expiresAt,
|
|
124
|
+
existingSwap.confirmations,
|
|
125
|
+
existingSwap.rate,
|
|
126
|
+
existingSwap.fixed,
|
|
127
|
+
existingSwap.refundAddress,
|
|
128
|
+
existingSwap.payToAddress,
|
|
129
|
+
existingSwap.fromCoin,
|
|
130
|
+
existingSwap.fromAmount,
|
|
131
|
+
existingSwap.fromTransactionId,
|
|
132
|
+
existingSwap.fromTransactionLink,
|
|
133
|
+
existingSwap.toCoin,
|
|
134
|
+
existingSwap.toAmount,
|
|
135
|
+
existingSwap.toTransactionId,
|
|
136
|
+
existingSwap.toTransactionLink,
|
|
137
|
+
existingSwap.toAddress,
|
|
138
|
+
existingSwap.partner,
|
|
139
|
+
existingSwap.fromExtraId,
|
|
140
|
+
existingSwap.toExtraId,
|
|
141
|
+
existingSwap.refundExtraId,
|
|
142
|
+
fromAmountFiat,
|
|
143
|
+
toAmountFiat,
|
|
144
|
+
fiatCurrencyCode,
|
|
145
|
+
fiatCurrencyDecimals
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class Partner {
|
|
2
|
+
/**
|
|
3
|
+
* Rabbit id for partner.
|
|
4
|
+
*
|
|
5
|
+
* @type {string}
|
|
6
|
+
* */
|
|
7
|
+
id;
|
|
8
|
+
/** @type {string} */
|
|
9
|
+
name;
|
|
10
|
+
/** @type {string|undefined|null} */
|
|
11
|
+
logoUrl;
|
|
12
|
+
/** @type {string|null} */
|
|
13
|
+
kycLevel;
|
|
14
|
+
|
|
15
|
+
constructor(id, name, logoUrl, kycLevel = null) {
|
|
16
|
+
this.id = id;
|
|
17
|
+
this.name = name;
|
|
18
|
+
this.logoUrl = logoUrl;
|
|
19
|
+
this.kycLevel = Object.values(KYC_LEVELS).find(level => level === (kycLevel ?? "").toLowerCase()) ?? null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const KYC_LEVELS = {
|
|
24
|
+
LOW: "low",
|
|
25
|
+
MEDIUM: "medium",
|
|
26
|
+
HIGH: "high",
|
|
27
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { FALLBACK_ASSET_ICON_URL } from "../../common-apis/globalConstants.jsx";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* construction rules:
|
|
5
|
+
* 1. Coin class ticker should be built using toRabbitTicker function
|
|
6
|
+
* 2. name should not contain (PROTOCOL_CODE) or just PROTOCOL_CODe
|
|
7
|
+
* 3. protocol should be null for coins major for their blockchains like BTC, ETH
|
|
8
|
+
* 4. isPopular should be a number - the higher -> the more popular
|
|
9
|
+
*/
|
|
10
|
+
export class SwapProviderCoinInfo {
|
|
11
|
+
/** @type {Coin} */
|
|
12
|
+
coin;
|
|
13
|
+
|
|
14
|
+
/** @type {string} */
|
|
15
|
+
code;
|
|
16
|
+
|
|
17
|
+
/** @type {string} */
|
|
18
|
+
network;
|
|
19
|
+
|
|
20
|
+
/** @type {boolean} */
|
|
21
|
+
hasExtraId;
|
|
22
|
+
|
|
23
|
+
/** @type {string|null} */
|
|
24
|
+
extraIdName;
|
|
25
|
+
|
|
26
|
+
/** @type {number} */
|
|
27
|
+
isPopular;
|
|
28
|
+
|
|
29
|
+
/** @type {string} */
|
|
30
|
+
iconURL;
|
|
31
|
+
|
|
32
|
+
/** @type {boolean} */
|
|
33
|
+
deposit;
|
|
34
|
+
|
|
35
|
+
/** @type {boolean} */
|
|
36
|
+
withdrawal;
|
|
37
|
+
|
|
38
|
+
/** @type {string|null} */
|
|
39
|
+
validationRegexp;
|
|
40
|
+
|
|
41
|
+
/** @type {boolean} */
|
|
42
|
+
isAvailable;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @param {Coin} coin
|
|
46
|
+
* @param {string} code - The ticker code raw as in the provider
|
|
47
|
+
* @param {string} network - The network raw as in the provider
|
|
48
|
+
* @param {boolean} hasExtraId - Whether the coin requires an extra ID for transactions.
|
|
49
|
+
* @param {string|null} extraIdName - The name of the extra ID, if applicable.
|
|
50
|
+
* @param {number} popularity - A number indicating the popularity of the coin.
|
|
51
|
+
* @param {string} iconURL - The URL of the coin's icon.
|
|
52
|
+
* @param {boolean} [deposit=false] - Indicates whether deposits are supported. Defaults to `false`.
|
|
53
|
+
* @param {boolean} [withdrawal=false] - Indicates whether withdrawals are supported. Defaults to `false`.
|
|
54
|
+
* @param {string|null} [validationRegexp=null] - A regular expression for validating addresses, if applicable.
|
|
55
|
+
* @param {boolean} [isAvailable=true] - Whether the coin is available for transactions. Defaults to `true`.
|
|
56
|
+
*/
|
|
57
|
+
constructor(
|
|
58
|
+
coin,
|
|
59
|
+
code,
|
|
60
|
+
network,
|
|
61
|
+
hasExtraId,
|
|
62
|
+
extraIdName,
|
|
63
|
+
popularity,
|
|
64
|
+
iconURL,
|
|
65
|
+
deposit,
|
|
66
|
+
withdrawal,
|
|
67
|
+
validationRegexp,
|
|
68
|
+
isAvailable
|
|
69
|
+
) {
|
|
70
|
+
this.coin = coin;
|
|
71
|
+
this.code = code;
|
|
72
|
+
this.network = network;
|
|
73
|
+
this.hasExtraId = hasExtraId;
|
|
74
|
+
this.extraIdName = extraIdName;
|
|
75
|
+
this.isPopular = popularity;
|
|
76
|
+
this.iconURL = iconURL ?? FALLBACK_ASSET_ICON_URL;
|
|
77
|
+
this.deposit = deposit ?? false;
|
|
78
|
+
this.withdrawal = withdrawal ?? false;
|
|
79
|
+
this.validationRegexp = validationRegexp ?? null;
|
|
80
|
+
this.isAvailable = isAvailable ?? true;
|
|
81
|
+
}
|
|
82
|
+
}
|