@rabbitio/ui-kit 1.0.0-beta.7 → 1.0.0-beta.70
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/.gitlab-ci.yml +29 -0
- package/.husky/commit-msg +14 -0
- package/.husky/pre-push +1 -0
- package/CHANGELOG.md +0 -0
- package/README.md +27 -18
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +11536 -0
- package/coverage/coverage-final.json +100 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +986 -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/assets/wrappedImages/arrowIcon.jsx.html +124 -0
- package/coverage/rabbit-ui-kit/src/assets/wrappedImages/arrowTosca.jsx.html +127 -0
- package/coverage/rabbit-ui-kit/src/assets/wrappedImages/arrowWhite.jsx.html +127 -0
- package/coverage/rabbit-ui-kit/src/assets/wrappedImages/darkRectangle.jsx.html +106 -0
- package/coverage/rabbit-ui-kit/src/assets/wrappedImages/determinedError.jsx.html +439 -0
- package/coverage/rabbit-ui-kit/src/assets/wrappedImages/failedValidationIcon.jsx.html +202 -0
- package/coverage/rabbit-ui-kit/src/assets/wrappedImages/index.html +251 -0
- package/coverage/rabbit-ui-kit/src/assets/wrappedImages/infoIcon.jsx.html +133 -0
- package/coverage/rabbit-ui-kit/src/assets/wrappedImages/noticeQuestionIcon.jsx.html +247 -0
- package/coverage/rabbit-ui-kit/src/assets/wrappedImages/successfulValidationIcon.jsx.html +163 -0
- package/coverage/rabbit-ui-kit/src/assets/wrappedImages/walletIcon.jsx.html +151 -0
- package/coverage/rabbit-ui-kit/src/common/adapters/axiosAdapter.js.html +190 -0
- package/coverage/rabbit-ui-kit/src/common/adapters/index.html +131 -0
- package/coverage/rabbit-ui-kit/src/common/adapters/qrUtils.js.html +139 -0
- package/coverage/rabbit-ui-kit/src/common/amountUtils.js.html +1162 -0
- package/coverage/rabbit-ui-kit/src/common/errorUtils.js.html +211 -0
- package/coverage/rabbit-ui-kit/src/common/external-apis/apiGroups.js.html +250 -0
- package/coverage/rabbit-ui-kit/src/common/external-apis/index.html +131 -0
- package/coverage/rabbit-ui-kit/src/common/external-apis/ipAddressProviders.js.html +352 -0
- package/coverage/rabbit-ui-kit/src/common/fiatCurrenciesService.js.html +544 -0
- package/coverage/rabbit-ui-kit/src/common/index.html +146 -0
- package/coverage/rabbit-ui-kit/src/common/models/blockchain.js.html +115 -0
- package/coverage/rabbit-ui-kit/src/common/models/coin.js.html +544 -0
- package/coverage/rabbit-ui-kit/src/common/models/index.html +146 -0
- package/coverage/rabbit-ui-kit/src/common/models/protocol.js.html +100 -0
- package/coverage/rabbit-ui-kit/src/common/utils/cache.js.html +811 -0
- package/coverage/rabbit-ui-kit/src/common/utils/emailAPI.js.html +133 -0
- package/coverage/rabbit-ui-kit/src/common/utils/index.html +161 -0
- package/coverage/rabbit-ui-kit/src/common/utils/logging/index.html +131 -0
- package/coverage/rabbit-ui-kit/src/common/utils/logging/logger.js.html +208 -0
- package/coverage/rabbit-ui-kit/src/common/utils/logging/logsStorage.js.html +268 -0
- package/coverage/rabbit-ui-kit/src/common/utils/postponeExecution.js.html +118 -0
- package/coverage/rabbit-ui-kit/src/common/utils/safeStringify.js.html +235 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/AssetIcon/AssetIcon.jsx.html +247 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/AssetIcon/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/AssetSelection/AssetSelection.jsx.html +286 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/AssetSelection/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +187 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/BackgroundTitle/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/InformationMessage/InformationMessage.jsx.html +235 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/InformationMessage/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/Input/Input.jsx.html +631 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/Input/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/LoadingDots/LoadingDots.jsx.html +196 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/LoadingDots/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/NoticeIcon/NoticeIcon.jsx.html +277 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/NoticeIcon/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/QrCode/QrCode.jsx.html +187 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/QrCode/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/RateSelector/RateSelector.jsx.html +172 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/RateSelector/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/SupportChat/SupportChat.jsx.html +214 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/SupportChat/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/Textarea/Textarea.jsx.html +523 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/Textarea/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/TitleBox/TitleBox.jsx.html +508 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/TitleBox/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/Tooltip/Tooltip.jsx.html +289 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/Tooltip/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/TwoLinesOfText/LinesOfText.jsx.html +307 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/TwoLinesOfText/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/Validation/Validation.jsx.html +208 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/Validation/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/Button/Button.jsx.html +712 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/Button/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/Close/Close.jsx.html +244 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/Close/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/LinkButton/LinkButton.jsx.html +403 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/LinkButton/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +415 -0
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/RadioButtonWithText/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/hooks/index.html +131 -0
- package/coverage/rabbit-ui-kit/src/components/hooks/useCallHandlingErrors.js.html +151 -0
- package/coverage/rabbit-ui-kit/src/components/hooks/useReferredState.js.html +157 -0
- package/coverage/rabbit-ui-kit/src/components/molecules/AmountInput/AmountInput.jsx.html +997 -0
- package/coverage/rabbit-ui-kit/src/components/molecules/AmountInput/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/molecules/CoinPicker/CoinPicker.jsx.html +1612 -0
- package/coverage/rabbit-ui-kit/src/components/molecules/CoinPicker/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/molecules/LineWithIconLink/LineWithIconLink.jsx.html +190 -0
- package/coverage/rabbit-ui-kit/src/components/molecules/LineWithIconLink/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx.html +175 -0
- package/coverage/rabbit-ui-kit/src/components/molecules/TitledLineWithIconLink/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +277 -0
- package/coverage/rabbit-ui-kit/src/components/organisms/CoinPickerDialogStep/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/Dialog.jsx.html +1480 -0
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +451 -0
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/DialogButtons/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +1684 -0
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/DialogStep/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/organisms/SwapForm/SwapForm.jsx.html +3400 -0
- package/coverage/rabbit-ui-kit/src/components/organisms/SwapForm/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx.html +316 -0
- package/coverage/rabbit-ui-kit/src/components/templates/DeterminedErrorDialogStep/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/components/utils/index.html +161 -0
- package/coverage/rabbit-ui-kit/src/components/utils/inputValueProviders.js.html +235 -0
- package/coverage/rabbit-ui-kit/src/components/utils/textUtils.js.html +139 -0
- package/coverage/rabbit-ui-kit/src/components/utils/uiUtils.js.html +121 -0
- package/coverage/rabbit-ui-kit/src/components/utils/urlQueryUtils.js.html +271 -0
- package/coverage/rabbit-ui-kit/src/constants/atoms/Close/close.jsx.html +100 -0
- package/coverage/rabbit-ui-kit/src/constants/atoms/Close/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/constants/atoms/LinkButton/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/constants/atoms/LinkButton/linkButton.jsx.html +103 -0
- package/coverage/rabbit-ui-kit/src/constants/atoms/Tooltip/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/constants/atoms/Tooltip/tooltip.jsx.html +109 -0
- package/coverage/rabbit-ui-kit/src/constants/globalConstants.jsx.html +94 -0
- package/coverage/rabbit-ui-kit/src/constants/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/DialogStep/dialogStep.js.html +88 -0
- package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/DialogStep/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/dialog.js.html +172 -0
- package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/index.js.html +349 -0
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/cacheAndConcurrentRequestsResolver.js.html +1570 -0
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/cachedRobustExternalApiCallerService.js.html +526 -0
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/cancelProcessing.js.html +172 -0
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/concurrentCalculationsMetadataHolder.js.html +310 -0
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/externalApiProvider.js.html +553 -0
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/externalServicesStatsCollector.js.html +319 -0
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/index.html +206 -0
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/robustExternalAPICallerService.js.html +997 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/index.html +131 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapProvider.js.html +709 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +2197 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/baseSwapCreationInfo.js.html +214 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/existingSwap.js.html +304 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/existingSwapWithFiatData.js.html +469 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/index.html +146 -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 +1888 -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 +595 -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 +946 -0
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/Close.stories.jsx.html +214 -0
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/LinkButton.stories.jsx.html +295 -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/LineWithIconLink.stories.jsx.html +154 -0
- package/coverage/rabbit-ui-kit/stories/molecules/TitledLineWithIconLink.stories.jsx.html +160 -0
- package/coverage/rabbit-ui-kit/stories/molecules/index.html +131 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/Dialog.stories.jsx.html +589 -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/stubs/exampleContent.jsx.html +145 -0
- package/coverage/rabbit-ui-kit/stories/stubs/index.html +116 -0
- package/coverage/rabbit-ui-kit/stories/templates/DeterminedErrorDialogStep.stories.jsx.html +193 -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/index.cjs +10019 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +71418 -1641
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +7716 -11
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +9939 -11
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +10010 -12
- package/dist/index.umd.js.map +1 -1
- package/index.js +1 -1
- package/package.json +29 -5
- package/src/assets/image/icons/arrow-tosca.svg +3 -0
- package/src/assets/wrappedImages/arrowIcon.jsx +13 -0
- package/src/assets/wrappedImages/arrowTosca.jsx +14 -0
- package/src/assets/wrappedImages/arrowWhite.jsx +14 -0
- package/src/assets/wrappedImages/darkRectangle.jsx +7 -0
- package/src/assets/wrappedImages/determinedError.jsx +118 -0
- package/src/assets/wrappedImages/failedValidationIcon.jsx +39 -0
- package/src/assets/wrappedImages/infoIcon.jsx +16 -0
- package/src/assets/wrappedImages/noticeQuestionIcon.jsx +54 -0
- package/src/assets/wrappedImages/successfulValidationIcon.jsx +26 -0
- package/src/assets/wrappedImages/walletIcon.jsx +22 -0
- package/src/common/adapters/axiosAdapter.js +35 -0
- package/src/common/adapters/qrUtils.js +18 -0
- package/src/common/amountUtils.js +359 -0
- package/src/common/errorUtils.js +42 -0
- package/src/common/external-apis/apiGroups.js +55 -0
- package/src/common/external-apis/ipAddressProviders.js +89 -0
- package/src/common/fiatCurrenciesService.js +153 -0
- package/src/common/models/blockchain.js +10 -0
- package/src/common/models/coin.js +153 -0
- package/src/common/models/protocol.js +5 -0
- package/src/common/tests/amountUtils/composeRateText.test.js +152 -0
- package/src/common/tests/integration/external-apis/ipAddressProviders/getClientIpAddress.test.js +12 -0
- package/src/common/utils/cache.js +242 -0
- package/src/common/utils/emailAPI.js +16 -0
- package/src/common/utils/logging/logger.js +41 -0
- package/src/common/utils/logging/logsStorage.js +61 -0
- package/src/common/utils/postponeExecution.js +11 -0
- package/src/common/utils/safeStringify.js +50 -0
- package/src/components/atoms/AssetIcon/AssetIcon.jsx +54 -0
- package/{stories → src/components}/atoms/AssetIcon/asset-icon.module.scss +1 -1
- package/src/components/atoms/AssetSelection/AssetSelection.jsx +67 -0
- package/src/components/atoms/AssetSelection/asset-selection.module.scss +56 -0
- package/src/components/atoms/BackgroundTitle/BackgroundTitle.jsx +34 -0
- package/src/components/atoms/BackgroundTitle/background-title.module.scss +52 -0
- package/src/components/atoms/InformationMessage/InformationMessage.jsx +50 -0
- package/src/components/atoms/InformationMessage/information-message.module.scss +38 -0
- package/src/components/atoms/Input/Input.jsx +182 -0
- package/src/components/atoms/Input/input.module.scss +107 -0
- package/{stories → src/components}/atoms/LoadingDots/LoadingDots.jsx +8 -28
- package/{stories → src/components}/atoms/LoadingDots/LoadingDots.module.scss +1 -1
- package/src/components/atoms/NoticeIcon/NoticeIcon.jsx +64 -0
- package/src/components/atoms/NoticeIcon/notice-icon.module.scss +14 -0
- package/src/components/atoms/QrCode/QrCode.jsx +34 -0
- package/src/components/atoms/QrCode/qr-code.module.scss +15 -0
- package/src/components/atoms/RateSelector/RateSelector.jsx +29 -0
- package/src/components/atoms/RateSelector/rate-selector.module.scss +47 -0
- package/{stories/atoms/SupportChat/SupportChat.js → src/components/atoms/SupportChat/SupportChat.jsx} +4 -1
- package/src/components/atoms/Textarea/Textarea.jsx +146 -0
- package/src/components/atoms/Textarea/textarea.module.scss +71 -0
- package/src/components/atoms/TitleBox/TitleBox.jsx +141 -0
- package/src/components/atoms/TitleBox/title-box.module.scss +32 -0
- package/src/components/atoms/Tooltip/Tooltip.jsx +68 -0
- package/src/components/atoms/Tooltip/tooltip.module.scss +237 -0
- package/src/components/atoms/TwoLinesOfText/LinesOfText.jsx +74 -0
- package/src/components/atoms/TwoLinesOfText/lines-of-text.module.scss +65 -0
- package/src/components/atoms/Validation/Validation.jsx +41 -0
- package/src/components/atoms/Validation/validation.module.scss +15 -0
- package/{stories → src/components}/atoms/buttons/Button/Button.jsx +22 -48
- package/{stories → src/components}/atoms/buttons/Button/Button.module.scss +1 -1
- package/src/components/atoms/buttons/Close/Close.jsx +53 -0
- package/src/components/atoms/buttons/Close/close.module.scss +75 -0
- package/src/components/atoms/buttons/LinkButton/LinkButton.jsx +106 -0
- package/src/components/atoms/buttons/LinkButton/link-button.module.scss +49 -0
- package/src/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx +110 -0
- package/src/components/atoms/buttons/RadioButtonWithText/radio-button-with-text.module.scss +86 -0
- package/src/components/hooks/useCallHandlingErrors.js +22 -0
- package/src/components/hooks/useReferredState.js +24 -0
- package/src/components/molecules/AmountInput/AmountInput.jsx +304 -0
- package/src/components/molecules/AmountInput/amount-input.module.scss +189 -0
- package/src/components/molecules/CoinPicker/CoinPicker.jsx +509 -0
- package/src/components/molecules/CoinPicker/coin-picker.module.scss +207 -0
- package/src/components/molecules/LineWithIconLink/LineWithIconLink.jsx +35 -0
- package/src/components/molecules/LineWithIconLink/line-with-icon-link.module.scss +25 -0
- package/src/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx +30 -0
- package/src/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx +64 -0
- package/src/components/organisms/Dialog/Dialog.jsx +465 -0
- package/src/components/organisms/Dialog/DialogButtons/DialogButtons.jsx +122 -0
- package/src/components/organisms/Dialog/DialogButtons/dialog-buttons.module.scss +25 -0
- package/src/components/organisms/Dialog/DialogStep/DialogStep.jsx +533 -0
- package/src/components/organisms/Dialog/DialogStep/dialog-step.module.scss +381 -0
- package/src/components/organisms/Dialog/dialog.module.scss +226 -0
- package/src/components/organisms/SwapForm/SwapForm.jsx +1105 -0
- package/src/components/organisms/SwapForm/swap-form.module.scss +134 -0
- package/src/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx +77 -0
- package/src/components/tests/utils/inputValueProviders/provideFormatOfFloatValueByInputString.test.js +132 -0
- package/src/components/tests/utils/urlQueryUtils/getQueryParameterValues.test.js +65 -0
- package/src/components/tests/utils/urlQueryUtils/saveQueryParameterAndValues.test.js +104 -0
- package/src/components/utils/inputValueProviders.js +50 -0
- package/src/components/utils/textUtils.js +18 -0
- package/src/components/utils/uiUtils.js +12 -0
- package/src/components/utils/urlQueryUtils.js +62 -0
- package/src/constants/atoms/Close/close.jsx +5 -0
- package/src/constants/atoms/LinkButton/linkButton.jsx +6 -0
- package/src/constants/atoms/Tooltip/tooltip.jsx +8 -0
- package/src/constants/globalConstants.jsx +3 -0
- package/src/constants/organisms/dialog/DialogStep/dialogStep.js +1 -0
- package/src/constants/organisms/dialog/dialog.js +29 -0
- package/src/index.js +88 -0
- package/src/robustExteranlApiCallerService/cacheAndConcurrentRequestsResolver.js +495 -0
- package/src/robustExteranlApiCallerService/cachedRobustExternalApiCallerService.js +147 -0
- package/src/robustExteranlApiCallerService/cancelProcessing.js +29 -0
- package/src/robustExteranlApiCallerService/concurrentCalculationsMetadataHolder.js +75 -0
- package/src/robustExteranlApiCallerService/externalApiProvider.js +156 -0
- package/src/robustExteranlApiCallerService/externalServicesStatsCollector.js +78 -0
- package/src/robustExteranlApiCallerService/robustExternalAPICallerService.js +304 -0
- package/src/robustExteranlApiCallerService/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/_performCallAttempt.test.js +533 -0
- package/src/robustExteranlApiCallerService/tests/robustExternalAPICallerService/robustExternalAPICallerService/callExternalAPI/callExternalAPI.test.js +532 -0
- package/src/robustExteranlApiCallerService/tests/robustExternalAPICallerService/robustExternalAPICallerService/constructor.test.js +19 -0
- package/src/swaps-lib/external-apis/swapProvider.js +208 -0
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +704 -0
- package/src/swaps-lib/models/baseSwapCreationInfo.js +43 -0
- package/src/swaps-lib/models/existingSwap.js +73 -0
- package/src/swaps-lib/models/existingSwapWithFiatData.js +128 -0
- package/src/swaps-lib/services/publicSwapService.js +601 -0
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +538 -0
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/createSwap.test.js +1249 -0
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getAllSupportedCurrencies.test.js +66 -0
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getDepositCurrencies.test.js +76 -0
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getSwapInfo.test.js +1580 -0
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getWithdrawalCurrencies.test.js +105 -0
- package/src/swaps-lib/test/utils/swapUtils/safeHandleRequestsLimitExceeding.test.js +80 -0
- package/src/swaps-lib/utils/swapUtils.js +170 -0
- package/stories/stubs/exampleContent.jsx +20 -0
- package/styles/_placeholder.scss +1 -1
- 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 +1 -1
- package/styles/index.scss +5 -3
- package/stories/atoms/AssetIcon/AssetIcon.js +0 -55
- package/stories/index.js +0 -4
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
export class SwapProvider {
|
|
2
|
+
static COMMON_ERRORS = {
|
|
3
|
+
REQUESTS_LIMIT_EXCEEDED: "requestsLimitExceeded",
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
static NO_SWAPS_REASONS = {
|
|
7
|
+
TOO_LOW: "tooLow",
|
|
8
|
+
TOO_HIGH: "tooHigh",
|
|
9
|
+
NOT_SUPPORTED: "notSupported",
|
|
10
|
+
NO_FIXED_BUT_HAVE_FLOATING: "noFixedButHaveFloating",
|
|
11
|
+
NO_FLOATING_BUT_HAVE_FIXED: "noFloatingButHaveFixed",
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
static CREATION_FAIL_REASONS = {
|
|
15
|
+
RETRIABLE_FAIL: "retriableFail",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
static SWAP_STATUSES = {
|
|
19
|
+
WAITING_FOR_PAYMENT: "waiting_for_payment", // public +
|
|
20
|
+
CONFIRMING: "confirming",
|
|
21
|
+
PAYMENT_RECEIVED: "payment_received", // public +
|
|
22
|
+
EXCHANGING: "exchanging", // session full // public +
|
|
23
|
+
COMPLETED: "completed", // session full // public +
|
|
24
|
+
REFUNDED: "refunded", // session full // public +
|
|
25
|
+
EXPIRED: "expired", // public +
|
|
26
|
+
FAILED: "failed", // public +
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @return {Promise<void>}
|
|
31
|
+
*/
|
|
32
|
+
async initialize() {
|
|
33
|
+
throw new Error("Not implemented in base");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @return {number} milliseconds TTL
|
|
38
|
+
*/
|
|
39
|
+
getSwapCreationInfoTtlMs() {
|
|
40
|
+
throw new Error("Not implemented in base");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Retrieves all currencies supported by this swap provider.
|
|
45
|
+
* Returns one of SwapProvider.COMMON_ERRORS in case of processable fail.
|
|
46
|
+
*
|
|
47
|
+
* @return {Promise<({ result: true, coins: Coin[] }|{ result: false, reason: string })>}
|
|
48
|
+
*/
|
|
49
|
+
async getAllSupportedCurrencies() {
|
|
50
|
+
throw new Error("Not implemented in base");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Retrieves all deposit currencies supported by this swap provider.
|
|
55
|
+
* Returns one of SwapProvider.COMMON_ERRORS in case of processable fail.
|
|
56
|
+
*
|
|
57
|
+
* @return {Promise<({ result: true, coins: Coin[] }|{ result: false, reason: string })>}
|
|
58
|
+
*/
|
|
59
|
+
async getDepositCurrencies() {
|
|
60
|
+
throw new Error("Not implemented in base");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Retrieves all withdrawable currencies supported by this swap provider.
|
|
65
|
+
* Returns one of SwapProvider.COMMON_ERRORS in case of processable fail.
|
|
66
|
+
*
|
|
67
|
+
* @param [exceptCurrency=null] {Coin|null}
|
|
68
|
+
* @return {Promise<({ result: true, coins: Coin[] }|{ result: false, reason: string })>}
|
|
69
|
+
*/
|
|
70
|
+
async getWithdrawalCurrencies(exceptCurrency = null) {
|
|
71
|
+
throw new Error("Not implemented in base");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Retrieves URL for coin icon or fallback if not found.
|
|
76
|
+
*
|
|
77
|
+
* @param coin {Coin|string} coin or rabbit-format of coin ticker
|
|
78
|
+
* @return {string}
|
|
79
|
+
*/
|
|
80
|
+
getIconUrl(coin) {
|
|
81
|
+
throw new Error("Not implemented in base");
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Retrieves coin to USDT rate.
|
|
86
|
+
*
|
|
87
|
+
* @param coin {Coin}
|
|
88
|
+
* @return {{result: true, rate: string}|{result: false}}
|
|
89
|
+
*/
|
|
90
|
+
async getCoinToUSDTRate(coin) {
|
|
91
|
+
throw new Error("Not implemented in base");
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Retrieves estimation for swapping giving coins amount.
|
|
96
|
+
* null min or max signals there is no corresponding limitation. undefined means that the limits were not retrieved.
|
|
97
|
+
* For fail result on of SwapProvider.NO_SWAPS_REASONS or SwapProvider.COMMON_ERRORS reasons will be returned.
|
|
98
|
+
*
|
|
99
|
+
* WARNING: MUST return NOT_SUPPORTED error code for any case when pair is not available/supported (Should not throw random errors for this case)
|
|
100
|
+
* @param fromCoin {Coin}
|
|
101
|
+
* @param toCoin {Coin}
|
|
102
|
+
* @param amountCoins {string}
|
|
103
|
+
* @param [fixed=false] {boolean|null} null means fixed or float doesn't matter
|
|
104
|
+
* @param [fromCoinToUsdRate=null] pass if you want to increase the min amount returned
|
|
105
|
+
* by provider with some fixed "insurance" amount to cover min amount fluctuations.
|
|
106
|
+
* @return {Promise<({
|
|
107
|
+
* result: false,
|
|
108
|
+
* reason: string,
|
|
109
|
+
* smallestMin: (string|null|undefined),
|
|
110
|
+
* greatestMax: (string|null|undefined),
|
|
111
|
+
* }|{
|
|
112
|
+
* result: true,
|
|
113
|
+
* min: (string|null),
|
|
114
|
+
* max: (string|null),
|
|
115
|
+
* smallestMin: (string|null),
|
|
116
|
+
* greatestMax: (string|null),
|
|
117
|
+
* rate: (string|null),
|
|
118
|
+
* durationMinutesRange: string,
|
|
119
|
+
* fixed: boolean,
|
|
120
|
+
* [rawSwapData]: Object
|
|
121
|
+
* })>}
|
|
122
|
+
*/
|
|
123
|
+
async getSwapInfo(fromCoin, toCoin, amountCoins, fixed = false, fromCoinToUsdRate = null) {
|
|
124
|
+
throw new Error("Not implemented in base");
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* For fail result we return one of SwapProvider.CREATION_FAIL_REASONS or SwapProvider.COMMON_ERRORS.*
|
|
129
|
+
*
|
|
130
|
+
* @param fromCoin {Coin}
|
|
131
|
+
* @param toCoin {Coin}
|
|
132
|
+
* @param amount {string}
|
|
133
|
+
* @param toAddress {string}
|
|
134
|
+
* @param refundAddress {string}
|
|
135
|
+
* @param rawSwapData {Object|null}
|
|
136
|
+
* @param clientIpAddress {string}
|
|
137
|
+
* @param fixed {boolean}
|
|
138
|
+
* @param [toCurrencyExtraId=""] {string} optional extra ID
|
|
139
|
+
* @param [refundExtraId=""] {string} optional extra ID for refund address
|
|
140
|
+
* @return {Promise<({
|
|
141
|
+
* result: true,
|
|
142
|
+
* swapId: string,
|
|
143
|
+
* fromCoin: Coin,
|
|
144
|
+
* fromAmount: string,
|
|
145
|
+
* fromAddress: string,
|
|
146
|
+
* toCoin: Coin,
|
|
147
|
+
* toAmount: string,
|
|
148
|
+
* toAddress: string,
|
|
149
|
+
* rate: string,
|
|
150
|
+
* fromCurrencyExtraId: string|undefined,
|
|
151
|
+
* fixed: boolean
|
|
152
|
+
* }|{
|
|
153
|
+
* result: false,
|
|
154
|
+
* reason: string,
|
|
155
|
+
* partner: string
|
|
156
|
+
* })>}
|
|
157
|
+
*/
|
|
158
|
+
async createSwap(
|
|
159
|
+
fromCoin,
|
|
160
|
+
toCoin,
|
|
161
|
+
amount,
|
|
162
|
+
toAddress,
|
|
163
|
+
refundAddress,
|
|
164
|
+
rawSwapData,
|
|
165
|
+
clientIpAddress,
|
|
166
|
+
fixed,
|
|
167
|
+
toCurrencyExtraId = "",
|
|
168
|
+
refundExtraId = ""
|
|
169
|
+
) {
|
|
170
|
+
throw new Error("Not implemented in base");
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Retrieves details and status for swaps by given ids.
|
|
175
|
+
* If some swap is not found by id then there is no item in return list.
|
|
176
|
+
*
|
|
177
|
+
* @param swapIds {string[]}
|
|
178
|
+
* @return {Promise<{result: false, reason: string}|{result:true, swaps: ExistingSwap[]}>}
|
|
179
|
+
*/
|
|
180
|
+
async getExistingSwapsDetailsAndStatus(swapIds) {
|
|
181
|
+
throw new Error("Not implemented in base");
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @param ticker {string}
|
|
186
|
+
* @return {Coin|null}
|
|
187
|
+
*/
|
|
188
|
+
getCoinByTickerIfPresent(ticker) {
|
|
189
|
+
throw new Error("Not implemented in base");
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* @param asset {Coin}
|
|
194
|
+
* @param address {string}
|
|
195
|
+
* @return {boolean}
|
|
196
|
+
*/
|
|
197
|
+
isAddressValidForAsset(asset, address) {
|
|
198
|
+
throw new Error("Not implemented in base");
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @param asset {Coin}
|
|
203
|
+
* @return {string|null}
|
|
204
|
+
*/
|
|
205
|
+
getExtraIdNameIfPresent(asset) {
|
|
206
|
+
throw new Error("Not implemented in base");
|
|
207
|
+
}
|
|
208
|
+
}
|