@rabbitio/ui-kit 1.0.0-beta.12 → 1.0.0-beta.121
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 +19749 -0
- package/coverage/coverage-final.json +122 -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 +388 -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/changeHeroSwapProvider.js.html +2800 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/changeNowSwapProvider.js.html +2644 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/exolixSwapProvider.js.html +1942 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/goexmeSwapProvider.js.html +2389 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/index.html +236 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/letsExchangeSwapProvider.js.html +1666 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/retriableErrorsUtils.js.html +274 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapProvider.js.html +1888 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +1981 -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 +337 -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 +1654 -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 +4375 -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 +15089 -1593
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +2352 -8493
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +11801 -1298
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +15003 -1594
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +15081 -1596
- 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 +91 -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/changeHeroSwapProvider.js +905 -0
- package/src/swaps-lib/external-apis/changeNowSwapProvider.js +853 -0
- package/src/swaps-lib/external-apis/exolixSwapProvider.js +619 -0
- package/src/swaps-lib/external-apis/goexmeSwapProvider.js +768 -0
- package/src/swaps-lib/external-apis/letsExchangeSwapProvider.js +527 -0
- package/src/swaps-lib/external-apis/retriableErrorsUtils.js +63 -0
- package/src/swaps-lib/external-apis/swapProvider.js +457 -25
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +320 -486
- 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 +84 -0
- package/src/swaps-lib/services/publicSwapService.js +523 -0
- package/src/swaps-lib/test/external-apis/changeHeroSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +155 -0
- package/src/swaps-lib/test/external-apis/changeHeroSwapProvider/createSwap.test.js +702 -0
- package/src/swaps-lib/test/external-apis/changeHeroSwapProvider/getExistingSwapsDetailsAndStatus.test.js +501 -0
- package/src/swaps-lib/test/external-apis/changeHeroSwapProvider/getSwapInfo.test.js +425 -0
- package/src/swaps-lib/test/external-apis/changeNowSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +83 -0
- package/src/swaps-lib/test/external-apis/changeNowSwapProvider/_providerHelpers.test.js +54 -0
- package/src/swaps-lib/test/external-apis/changeNowSwapProvider/_validateAddressWithProvider.test.js +49 -0
- package/src/swaps-lib/test/external-apis/changeNowSwapProvider/createSwap.test.js +938 -0
- package/src/swaps-lib/test/external-apis/changeNowSwapProvider/getExistingSwapsDetailsAndStatus.test.js +353 -0
- package/src/swaps-lib/test/external-apis/changeNowSwapProvider/getSwapInfo.test.js +342 -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 +1081 -0
- package/src/swaps-lib/test/external-apis/exolixSwapProvider/getSwapInfo.test.js +611 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/_convertCurrencyMeta.test.js +95 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +75 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/createSwap.test.js +225 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/getExistingSwapsDetailsAndStatus.test.js +175 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/getSwapInfo.test.js +177 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/helpers.test.js +26 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/PairSupport.int.test.js +69 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/_fetchSupportedCurrenciesIfNeeded.int.test.js +307 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/createSwap.int.test.js +335 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/getSwapInfo.int.test.js +154 -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 +1359 -0
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getExistingSwapsDetailsAndStatus.test.js +136 -0
- package/src/swaps-lib/test/external-apis/swapspaceSwapProvider/getSwapInfo.test.js +1743 -0
- package/src/swaps-lib/test/utils/swapUtils/isIpBannedProviderError.test.js +150 -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 +1430 -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BigNumber } from "bignumber.js";
|
|
2
2
|
|
|
3
|
-
import { FiatCurrenciesService } from "
|
|
3
|
+
import { FiatCurrenciesService } from "../services/fiatCurrenciesService.js";
|
|
4
4
|
import { improveAndRethrow } from "./errorUtils.js";
|
|
5
5
|
|
|
6
6
|
// TODO: [dev] return addCommasToAmountString internal method to encapsulate commas adding
|
|
@@ -38,54 +38,31 @@ export class AmountUtils {
|
|
|
38
38
|
try {
|
|
39
39
|
const params = { ...this.defaultFiatParams, ...passedParams };
|
|
40
40
|
|
|
41
|
-
if (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
)
|
|
45
|
-
return "NULL";
|
|
46
|
-
|
|
47
|
-
const currencySymbol =
|
|
48
|
-
FiatCurrenciesService.getCurrencySymbolByCode(currencyCode);
|
|
49
|
-
const currencyDecimalCount =
|
|
50
|
-
FiatCurrenciesService.getCurrencyDecimalCountByCode(
|
|
51
|
-
currencyCode
|
|
52
|
-
);
|
|
41
|
+
if (this._checkIfAmountInvalid(amount, true) || typeof currencyCode !== "string") return "NULL";
|
|
42
|
+
|
|
43
|
+
const currencySymbol = FiatCurrenciesService.getCurrencySymbolByCode(currencyCode);
|
|
44
|
+
const currencyDecimalCount = FiatCurrenciesService.getCurrencyDecimalCountByCode(currencyCode);
|
|
53
45
|
|
|
54
|
-
const trimmedByMaxDigits =
|
|
55
|
-
currencyDecimalCount,
|
|
56
|
-
BigNumber
|
|
57
|
-
);
|
|
46
|
+
const trimmedByMaxDigits = params.collapsible
|
|
47
|
+
? BigNumber(amount).toFixed(currencyDecimalCount, BigNumber.ROUND_FLOOR)
|
|
48
|
+
: BigNumber(amount);
|
|
58
49
|
|
|
59
50
|
let processedAmount = BigNumber(trimmedByMaxDigits);
|
|
60
|
-
if (
|
|
61
|
-
params.collapsible &&
|
|
62
|
-
processedAmount.gte(BigNumber("1000000"))
|
|
63
|
-
) {
|
|
51
|
+
if (params.collapsible && processedAmount.gte(BigNumber("1000"))) {
|
|
64
52
|
processedAmount = this._collapseToMillionsAndFormat(
|
|
65
53
|
processedAmount,
|
|
66
54
|
this.collapsedDecimalCount,
|
|
67
55
|
params
|
|
68
56
|
);
|
|
69
57
|
} else {
|
|
70
|
-
const limitResult = this._limitTotalAmountLengthIfNeeded(
|
|
71
|
-
|
|
72
|
-
params
|
|
73
|
-
);
|
|
74
|
-
processedAmount = BigNumber(
|
|
75
|
-
limitResult.processedAmount
|
|
76
|
-
).toFormat(); // Adds commas to integer part
|
|
58
|
+
const limitResult = this._limitTotalAmountLengthIfNeeded(trimmedByMaxDigits, params);
|
|
59
|
+
processedAmount = BigNumber(limitResult.processedAmount).toFormat(); // Adds commas to integer part
|
|
77
60
|
}
|
|
78
61
|
|
|
79
62
|
// Add the currency code or currency symbol, if symbol is enabled and available
|
|
80
63
|
if (params.ticker) {
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
params.enableCurrencySymbols
|
|
84
|
-
) {
|
|
85
|
-
processedAmount =
|
|
86
|
-
currencySymbol +
|
|
87
|
-
(currencySymbol.length > 1 ? " " : "") +
|
|
88
|
-
processedAmount;
|
|
64
|
+
if (typeof currencySymbol === "string" && params.enableCurrencySymbols) {
|
|
65
|
+
processedAmount = currencySymbol + (currencySymbol.length > 1 ? " " : "") + processedAmount;
|
|
89
66
|
} else {
|
|
90
67
|
processedAmount = processedAmount + " " + currencyCode;
|
|
91
68
|
}
|
|
@@ -104,6 +81,7 @@ export class AmountUtils {
|
|
|
104
81
|
limitTotalLength: true, // Limits the total amount length to maxTotalLength
|
|
105
82
|
extraSmallLength: false, // Limits the total amount length to extraSmallMaxTotalLength
|
|
106
83
|
periods: true, // Whether we add periods ("..") as suffix for trimmed numbers
|
|
84
|
+
numberPartsSeparator: true, // Whether we add separators e.g. for 1000000 -> 1,000,000
|
|
107
85
|
};
|
|
108
86
|
|
|
109
87
|
static cryptoWoTicker(amount, digits) {
|
|
@@ -132,6 +110,16 @@ export class AmountUtils {
|
|
|
132
110
|
});
|
|
133
111
|
}
|
|
134
112
|
|
|
113
|
+
static cryptoFullPureNumber(amount, digits) {
|
|
114
|
+
return this.crypto(amount, null, digits, {
|
|
115
|
+
ticker: false,
|
|
116
|
+
collapsible: false,
|
|
117
|
+
trim: false,
|
|
118
|
+
limitTotalLength: false,
|
|
119
|
+
numberPartsSeparator: false,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
135
123
|
/**
|
|
136
124
|
* Universal method for rendering of crypto amounts, taking into account the rules of
|
|
137
125
|
* the passed ticker. Requires the number of digits after period to be less of equal to
|
|
@@ -143,33 +131,19 @@ export class AmountUtils {
|
|
|
143
131
|
* @param passedParams {object} Formatting parameters
|
|
144
132
|
* @return {string} Formatted crypto amount string
|
|
145
133
|
*/
|
|
146
|
-
static crypto(
|
|
147
|
-
amount,
|
|
148
|
-
ticker,
|
|
149
|
-
digits = this.significantDecimalCount,
|
|
150
|
-
passedParams
|
|
151
|
-
) {
|
|
134
|
+
static crypto(amount, ticker, digits = this.significantDecimalCount, passedParams) {
|
|
152
135
|
try {
|
|
153
136
|
const params = { ...this.defaultCryptoParams, ...passedParams };
|
|
154
137
|
|
|
155
|
-
if (
|
|
156
|
-
this._checkIfAmountInvalid(amount) ||
|
|
157
|
-
(typeof ticker !== "string" && params.ticker)
|
|
158
|
-
)
|
|
159
|
-
return "NULL";
|
|
138
|
+
if (this._checkIfAmountInvalid(amount) || (typeof ticker !== "string" && params.ticker)) return "NULL";
|
|
160
139
|
|
|
161
140
|
let addPeriods = false;
|
|
162
141
|
|
|
163
142
|
const amountBigNumber = BigNumber(amount);
|
|
164
143
|
|
|
165
|
-
let processedAmount = amountBigNumber.toFixed(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
);
|
|
169
|
-
processedAmount =
|
|
170
|
-
this.removeRedundantRightZerosFromNumberString(processedAmount);
|
|
171
|
-
const originalAmountDecimalPlaces =
|
|
172
|
-
BigNumber(processedAmount).decimalPlaces();
|
|
144
|
+
let processedAmount = amountBigNumber.toFixed(digits, BigNumber.ROUND_FLOOR);
|
|
145
|
+
processedAmount = this.removeRedundantRightZerosFromNumberString(processedAmount);
|
|
146
|
+
const originalAmountDecimalPlaces = BigNumber(processedAmount).decimalPlaces();
|
|
173
147
|
// Check decimal count and throw an error, if the amount has more decimal digits than supported by the asset
|
|
174
148
|
if (originalAmountDecimalPlaces > digits) {
|
|
175
149
|
const errorMessage = `An attempt to render a crypto value with too many digits after period was made: ${amount}, allowed digits: ${digits}. This is a no-op, since the logical and visually rendered values would differ, which is not acceptable for crypto amounts. Please trim the amount before rendering, using the trimCryptoAmountByCoin(amount, coin) method.`;
|
|
@@ -180,21 +154,13 @@ export class AmountUtils {
|
|
|
180
154
|
|
|
181
155
|
// Shortening the value to general significant number of digits after period
|
|
182
156
|
if (params.trim) {
|
|
183
|
-
processedAmount =
|
|
184
|
-
this.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
BigNumber.ROUND_FLOOR
|
|
188
|
-
)
|
|
189
|
-
);
|
|
190
|
-
addPeriods =
|
|
191
|
-
originalAmountDecimalPlaces > this.significantDecimalCount;
|
|
157
|
+
processedAmount = this.removeRedundantRightZerosFromNumberString(
|
|
158
|
+
amountBigNumber.toFixed(this.significantDecimalCount, BigNumber.ROUND_FLOOR)
|
|
159
|
+
);
|
|
160
|
+
addPeriods = originalAmountDecimalPlaces > this.significantDecimalCount;
|
|
192
161
|
}
|
|
193
162
|
|
|
194
|
-
const limitResult = this._limitTotalAmountLengthIfNeeded(
|
|
195
|
-
processedAmount,
|
|
196
|
-
params
|
|
197
|
-
);
|
|
163
|
+
const limitResult = this._limitTotalAmountLengthIfNeeded(processedAmount, params);
|
|
198
164
|
processedAmount = limitResult.processedAmount;
|
|
199
165
|
addPeriods ||= limitResult.addPeriods;
|
|
200
166
|
|
|
@@ -207,7 +173,7 @@ export class AmountUtils {
|
|
|
207
173
|
params
|
|
208
174
|
);
|
|
209
175
|
wereMillionsCollapsed = true;
|
|
210
|
-
} else {
|
|
176
|
+
} else if (params.numberPartsSeparator) {
|
|
211
177
|
// Add separators to integer part of the amount
|
|
212
178
|
processedAmount = BigNumber(processedAmount).toFormat();
|
|
213
179
|
}
|
|
@@ -224,11 +190,7 @@ export class AmountUtils {
|
|
|
224
190
|
|
|
225
191
|
return processedAmount;
|
|
226
192
|
} catch (e) {
|
|
227
|
-
improveAndRethrow(
|
|
228
|
-
e,
|
|
229
|
-
"crypto",
|
|
230
|
-
`Passed: ${amount}, ${ticker}, ${digits}`
|
|
231
|
-
);
|
|
193
|
+
improveAndRethrow(e, "crypto", `Passed: ${amount}, ${ticker}, ${digits}`);
|
|
232
194
|
}
|
|
233
195
|
}
|
|
234
196
|
|
|
@@ -262,11 +224,13 @@ export class AmountUtils {
|
|
|
262
224
|
}
|
|
263
225
|
|
|
264
226
|
/**
|
|
227
|
+
* Returns integer part of number as a string.
|
|
228
|
+
*
|
|
265
229
|
* @param amount {BigNumber|number|string|null|undefined} The number value to be trimmed.
|
|
266
230
|
* HEX strings also allowed "0x..." and JS hex numbers
|
|
267
231
|
* @return {string|null}
|
|
268
232
|
*/
|
|
269
|
-
static
|
|
233
|
+
static toIntegerString(amount) {
|
|
270
234
|
return this.trim(amount, 0);
|
|
271
235
|
}
|
|
272
236
|
|
|
@@ -278,32 +242,39 @@ export class AmountUtils {
|
|
|
278
242
|
* @param params {object} params object
|
|
279
243
|
* @return {string} A shortened string, converted into "millions" format, if the amount exceeds 1 million
|
|
280
244
|
*/
|
|
281
|
-
static _collapseToMillionsAndFormat(
|
|
282
|
-
amountBigNumber,
|
|
283
|
-
decimalCount,
|
|
284
|
-
params = {}
|
|
285
|
-
) {
|
|
245
|
+
static _collapseToMillionsAndFormat(amountBigNumber, decimalCount, params = {}) {
|
|
286
246
|
try {
|
|
287
|
-
|
|
288
|
-
const
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
)
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
247
|
+
const thousand = BigNumber("1000");
|
|
248
|
+
const million = BigNumber("1000000");
|
|
249
|
+
const billion = BigNumber("1000000000");
|
|
250
|
+
const trillion = BigNumber("1000000000000");
|
|
251
|
+
|
|
252
|
+
let shortAmount;
|
|
253
|
+
let suffix = "";
|
|
254
|
+
|
|
255
|
+
if (amountBigNumber.gte(trillion)) {
|
|
256
|
+
shortAmount = amountBigNumber.div(trillion).toFixed(decimalCount, BigNumber.ROUND_FLOOR);
|
|
257
|
+
suffix = "T";
|
|
258
|
+
} else if (amountBigNumber.gte(billion)) {
|
|
259
|
+
shortAmount = amountBigNumber.div(billion).toFixed(decimalCount, BigNumber.ROUND_FLOOR);
|
|
260
|
+
suffix = "B";
|
|
261
|
+
} else if (amountBigNumber.gte(million)) {
|
|
262
|
+
shortAmount = amountBigNumber.div(million).toFixed(decimalCount, BigNumber.ROUND_FLOOR);
|
|
263
|
+
suffix = "M";
|
|
264
|
+
} else if (amountBigNumber.gte(thousand)) {
|
|
265
|
+
shortAmount = amountBigNumber.div(thousand).toFixed(decimalCount, BigNumber.ROUND_FLOOR);
|
|
266
|
+
suffix = "K";
|
|
267
|
+
} else {
|
|
268
|
+
shortAmount = amountBigNumber.toFixed(decimalCount, BigNumber.ROUND_FLOOR);
|
|
269
|
+
suffix = "";
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
const limitedResult = this._limitTotalAmountLengthIfNeeded(shortAmount, params);
|
|
273
|
+
const formattedAmount = BigNumber(limitedResult.processedAmount).toFormat();
|
|
274
|
+
|
|
275
|
+
return formattedAmount + suffix;
|
|
301
276
|
} catch (e) {
|
|
302
|
-
improveAndRethrow(
|
|
303
|
-
e,
|
|
304
|
-
"_collapseAmountAndFormat",
|
|
305
|
-
`Passed: ${amountBigNumber.toFixed()}, ${decimalCount}`
|
|
306
|
-
);
|
|
277
|
+
improveAndRethrow(e, "_collapseAmountAndFormat", `Passed: ${amountBigNumber.toFixed()}, ${decimalCount}`);
|
|
307
278
|
}
|
|
308
279
|
}
|
|
309
280
|
|
|
@@ -316,13 +287,10 @@ export class AmountUtils {
|
|
|
316
287
|
try {
|
|
317
288
|
let addPeriods = false;
|
|
318
289
|
if (params.limitTotalLength || params.extraSmallLength) {
|
|
319
|
-
const maxLength = params.extraSmallLength
|
|
320
|
-
? this.extraSmallMaxTotalLength
|
|
321
|
-
: this.maxTotalLength;
|
|
290
|
+
const maxLength = params.extraSmallLength ? this.extraSmallMaxTotalLength : this.maxTotalLength;
|
|
322
291
|
if (amountString.length > maxLength) {
|
|
323
292
|
const delta = amountString.length - maxLength;
|
|
324
|
-
const currentDecimalsCount =
|
|
325
|
-
BigNumber(amountString).decimalPlaces();
|
|
293
|
+
const currentDecimalsCount = BigNumber(amountString).decimalPlaces();
|
|
326
294
|
const newDecimalCount = currentDecimalsCount - delta;
|
|
327
295
|
amountString = BigNumber(amountString).toFixed(
|
|
328
296
|
newDecimalCount > 2 ? newDecimalCount : 2,
|
|
@@ -334,62 +302,58 @@ export class AmountUtils {
|
|
|
334
302
|
|
|
335
303
|
return { addPeriods: addPeriods, processedAmount: amountString };
|
|
336
304
|
} catch (e) {
|
|
337
|
-
improveAndRethrow(
|
|
338
|
-
e,
|
|
339
|
-
"_limitTotalAmountLengthIfNeeded",
|
|
340
|
-
`Passed: ${amountString}, ${params}`
|
|
341
|
-
);
|
|
305
|
+
improveAndRethrow(e, "_limitTotalAmountLengthIfNeeded", `Passed: ${amountString}, ${params}`);
|
|
342
306
|
}
|
|
343
307
|
}
|
|
344
308
|
|
|
345
309
|
/**
|
|
346
|
-
* Safely composes rate string (handles small/big rates)
|
|
310
|
+
* Safely composes rate string (handles small/big rates).
|
|
311
|
+
* Here we try to calculate a clear rate for the user. The difficulty is that the rate value can be pretty
|
|
312
|
+
* small as some coins have significantly higher price than the other. For such cases we calculate
|
|
313
|
+
* not the "1 <coin_A> is X <coin B>" but "Y <coin_A> is X <coin B>" where Y is one of the powers of 100.
|
|
347
314
|
*
|
|
348
315
|
* @param leftTicker {string}
|
|
349
316
|
* @param rightTicker {string}
|
|
350
317
|
* @param rate {number|string|BigNumber}
|
|
351
318
|
* @param [rightCurrencyDigitsAfterDots=8] {number}
|
|
319
|
+
* @param [strictRate=false] {boolean} true if the rate is strict and false if approximate
|
|
352
320
|
* @return {string}
|
|
353
321
|
*/
|
|
354
322
|
static composeRateText(
|
|
355
323
|
leftTicker,
|
|
356
324
|
rightTicker,
|
|
357
325
|
rate,
|
|
358
|
-
rightCurrencyDigitsAfterDots = this.significantDecimalCount
|
|
326
|
+
rightCurrencyDigitsAfterDots = this.significantDecimalCount,
|
|
327
|
+
strictRate = false
|
|
359
328
|
) {
|
|
360
329
|
try {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
*/
|
|
330
|
+
if (rightCurrencyDigitsAfterDots < 0) {
|
|
331
|
+
rightCurrencyDigitsAfterDots = this.significantDecimalCount;
|
|
332
|
+
}
|
|
365
333
|
let leftNumber = BigNumber("1");
|
|
366
334
|
const multiplier = BigNumber("100");
|
|
367
335
|
const maxAttemptsToGetRate = 10;
|
|
368
336
|
let right = null;
|
|
369
337
|
const rateBigNumber = BigNumber(rate);
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
338
|
+
if (BigNumber(rate).eq("0")) {
|
|
339
|
+
right = BigNumber("0");
|
|
340
|
+
} else if (rate && (BigNumber.isBigNumber(rate) || !Number.isNaN(+rate))) {
|
|
341
|
+
for (let i = 0; i < maxAttemptsToGetRate; ++i) {
|
|
342
|
+
const rightNumberAttempt = rateBigNumber
|
|
343
|
+
.times(leftNumber)
|
|
344
|
+
.toFixed(rightCurrencyDigitsAfterDots, BigNumber.ROUND_FLOOR);
|
|
345
|
+
if (!BigNumber(rightNumberAttempt).eq(BigNumber("0"))) {
|
|
346
|
+
right = BigNumber(rightNumberAttempt);
|
|
347
|
+
break;
|
|
348
|
+
} else {
|
|
349
|
+
leftNumber = leftNumber.times(multiplier);
|
|
350
|
+
}
|
|
382
351
|
}
|
|
383
352
|
}
|
|
384
|
-
const leftAmountString = AmountUtils.
|
|
353
|
+
const leftAmountString = AmountUtils.toIntegerString(leftNumber);
|
|
385
354
|
const rightAmountString =
|
|
386
|
-
right != null
|
|
387
|
-
|
|
388
|
-
rightCurrencyDigitsAfterDots,
|
|
389
|
-
BigNumber.ROUND_FLOOR
|
|
390
|
-
)
|
|
391
|
-
: null;
|
|
392
|
-
return `${leftAmountString} ${leftTicker} ~ ${
|
|
355
|
+
right != null ? right.toFixed(rightCurrencyDigitsAfterDots, BigNumber.ROUND_FLOOR) : null;
|
|
356
|
+
return `${leftAmountString} ${leftTicker} ${strictRate ? "=" : "~"} ${
|
|
393
357
|
rightAmountString ?? "?"
|
|
394
358
|
} ${rightTicker}`;
|
|
395
359
|
} catch (e) {
|
|
@@ -413,11 +377,7 @@ export class AmountUtils {
|
|
|
413
377
|
|
|
414
378
|
return `${parts[0]}${right?.length ? `.${right}` : ""}`;
|
|
415
379
|
} catch (e) {
|
|
416
|
-
improveAndRethrow(
|
|
417
|
-
e,
|
|
418
|
-
"removeRedundantRightZerosFromNumberString",
|
|
419
|
-
`Passed: ${numberAsAString}`
|
|
420
|
-
);
|
|
380
|
+
improveAndRethrow(e, "removeRedundantRightZerosFromNumberString", `Passed: ${numberAsAString}`);
|
|
421
381
|
}
|
|
422
382
|
}
|
|
423
383
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { improveAndRethrow } from "
|
|
1
|
+
import { improveAndRethrow } from "./errorUtils.js";
|
|
2
2
|
import { Logger } from "./logging/logger.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -9,10 +9,10 @@ import { Logger } from "./logging/logger.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export class Cache {
|
|
11
11
|
/**
|
|
12
|
-
* @param eventBus {EventBus} EventBus.js lib instance
|
|
13
|
-
* @param [noSessionEvents=[]] {string[]} array of events that will be treated as "no session"
|
|
12
|
+
* @param [eventBus=null] {EventBus} EventBus.js lib instance if you plan to use Cache with events handling
|
|
13
|
+
* @param [noSessionEvents=[]] {string[]} array of events that will be treated as "no session", you should pass EventBus to make it work
|
|
14
14
|
*/
|
|
15
|
-
constructor(eventBus, noSessionEvents = []) {
|
|
15
|
+
constructor(eventBus = null, noSessionEvents = []) {
|
|
16
16
|
this._cache = new Map();
|
|
17
17
|
this._eventDependentDataKeys = [];
|
|
18
18
|
this._noSessionEvents = noSessionEvents;
|
|
@@ -24,11 +24,7 @@ export class Cache {
|
|
|
24
24
|
try {
|
|
25
25
|
for (const key of this._cache.keys()) {
|
|
26
26
|
const item = this._cache.get(key);
|
|
27
|
-
if (
|
|
28
|
-
item &&
|
|
29
|
-
item.ttlMs &&
|
|
30
|
-
item.addedMsTimestamp + item.ttlMs < Date.now()
|
|
31
|
-
) {
|
|
27
|
+
if (item && item.ttlMs && item.addedMsTimestamp + item.ttlMs < Date.now()) {
|
|
32
28
|
this._cache.delete(key);
|
|
33
29
|
}
|
|
34
30
|
}
|
|
@@ -53,9 +49,7 @@ export class Cache {
|
|
|
53
49
|
put(key, data, ttlMs = null) {
|
|
54
50
|
try {
|
|
55
51
|
if (typeof key !== "string" || data == null) {
|
|
56
|
-
throw new Error(
|
|
57
|
-
`Trying to cache corrupted data: ${key}, ${data}`
|
|
58
|
-
);
|
|
52
|
+
throw new Error(`Trying to cache corrupted data: ${key}, ${data}`);
|
|
59
53
|
}
|
|
60
54
|
this._cache.set(key, {
|
|
61
55
|
data: data,
|
|
@@ -87,9 +81,7 @@ export class Cache {
|
|
|
87
81
|
_putEventDependentData(key, data, events, ttlMs = null) {
|
|
88
82
|
try {
|
|
89
83
|
if (typeof key !== "string" || data == null) {
|
|
90
|
-
throw new Error(
|
|
91
|
-
`Trying to cache corrupted data: ${key}, ${data}`
|
|
92
|
-
);
|
|
84
|
+
throw new Error(`Trying to cache corrupted data: ${key}, ${data}`);
|
|
93
85
|
}
|
|
94
86
|
this._cache.set(key, {
|
|
95
87
|
data: data,
|
|
@@ -97,27 +89,17 @@ export class Cache {
|
|
|
97
89
|
ttlMs: ttlMs,
|
|
98
90
|
});
|
|
99
91
|
for (let event of events) {
|
|
100
|
-
const eventAndKeys = this._eventDependentDataKeys.find(
|
|
101
|
-
(item) => item[0] === event
|
|
102
|
-
);
|
|
92
|
+
const eventAndKeys = this._eventDependentDataKeys.find(item => item[0] === event);
|
|
103
93
|
if (eventAndKeys) {
|
|
104
94
|
eventAndKeys.push(key);
|
|
105
|
-
} else {
|
|
95
|
+
} else if (this._eventBus) {
|
|
106
96
|
this._eventDependentDataKeys.push([event, key]);
|
|
107
97
|
this._eventBus.addEventListener(event, () => {
|
|
108
98
|
try {
|
|
109
|
-
const keys = this._eventDependentDataKeys.find(
|
|
110
|
-
|
|
111
|
-
);
|
|
112
|
-
(keys ?? [event])
|
|
113
|
-
.slice(1)
|
|
114
|
-
.forEach((key) => this._cache.delete(key));
|
|
99
|
+
const keys = this._eventDependentDataKeys.find(item => item[0] === event);
|
|
100
|
+
(keys ?? [event]).slice(1).forEach(key => this._cache.delete(key));
|
|
115
101
|
} catch (e) {
|
|
116
|
-
Logger.logError(
|
|
117
|
-
e,
|
|
118
|
-
"cache.removing-for-event",
|
|
119
|
-
`Event: ${event}`
|
|
120
|
-
);
|
|
102
|
+
Logger.logError(e, "cache.removing-for-event", `Event: ${event}`);
|
|
121
103
|
}
|
|
122
104
|
});
|
|
123
105
|
}
|
|
@@ -132,11 +114,7 @@ export class Cache {
|
|
|
132
114
|
try {
|
|
133
115
|
const item = this._cache.get(key);
|
|
134
116
|
if (item) {
|
|
135
|
-
if (
|
|
136
|
-
item.addedMsTimestamp &&
|
|
137
|
-
item.ttlMs !== null &&
|
|
138
|
-
item.addedMsTimestamp + item.ttlMs < Date.now()
|
|
139
|
-
) {
|
|
117
|
+
if (item.addedMsTimestamp && item.ttlMs !== null && item.addedMsTimestamp + item.ttlMs < Date.now()) {
|
|
140
118
|
this._cache.delete(key);
|
|
141
119
|
return null;
|
|
142
120
|
} else {
|
|
@@ -185,16 +163,12 @@ export class Cache {
|
|
|
185
163
|
|
|
186
164
|
invalidateContaining(keyPart) {
|
|
187
165
|
if (typeof keyPart !== "string" || keyPart === "") {
|
|
188
|
-
throw new Error(
|
|
189
|
-
"Trying to invalidate containing wrong key or empty key: " +
|
|
190
|
-
keyPart
|
|
191
|
-
);
|
|
166
|
+
throw new Error("Trying to invalidate containing wrong key or empty key: " + keyPart);
|
|
192
167
|
}
|
|
193
168
|
|
|
194
169
|
try {
|
|
195
170
|
const matchedKeys = Array.from(this._cache.keys()).filter(
|
|
196
|
-
(key)
|
|
197
|
-
typeof key === "string" && new RegExp(keyPart).test(key)
|
|
171
|
+
key => typeof key === "string" && new RegExp(keyPart).test(key)
|
|
198
172
|
);
|
|
199
173
|
for (let i = 0; i < matchedKeys.length; ++i) {
|
|
200
174
|
this._cache.delete(matchedKeys[i]);
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Logger } from "./logging/logger.js";
|
|
2
|
+
import { safeStringify } from "./safeStringify.js";
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* This function improves the passed error object (its message) by adding the passed function name
|
|
3
6
|
* and additional message to it.
|
|
@@ -25,3 +28,15 @@ function improvedErrorMessage(e, settingFunction, additionalMessage) {
|
|
|
25
28
|
|
|
26
29
|
return message;
|
|
27
30
|
}
|
|
31
|
+
|
|
32
|
+
export function logErrorOrOutputToConsole(e) {
|
|
33
|
+
try {
|
|
34
|
+
// TODO: [dev] remove this after few weeks of testing output in real life
|
|
35
|
+
// eslint-disable-next-line no-console
|
|
36
|
+
console.log("BEFORE SAFE", e);
|
|
37
|
+
Logger.log("logErrorOrOutputToConsole", safeStringify(e));
|
|
38
|
+
} catch (e) {
|
|
39
|
+
// eslint-disable-next-line no-console
|
|
40
|
+
console.log("logErrorOrOutputToConsole", e);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -13,22 +13,16 @@ export class Logger {
|
|
|
13
13
|
static log(logString, source) {
|
|
14
14
|
const timestamp = new Date().toISOString();
|
|
15
15
|
LogsStorage.saveLog(`${timestamp}|${source}:${logString}`);
|
|
16
|
+
console.log(logString);
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
static logError(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
additionalMessage
|
|
22
|
-
onlyToConsole = false
|
|
23
|
-
) {
|
|
24
|
-
let message = `\nFunction call ${
|
|
25
|
-
settingFunction ?? ""
|
|
26
|
-
} failed. Error message: ${e?.message}. ${additionalMessage} `;
|
|
19
|
+
static logError(e, settingFunction, additionalMessage = "", onlyToConsole = false) {
|
|
20
|
+
let message = `\nFunction call ${settingFunction ?? ""} failed. Error message: ${
|
|
21
|
+
e?.message
|
|
22
|
+
}. ${additionalMessage} `;
|
|
27
23
|
message +=
|
|
28
24
|
`${e?.errorDescription ?? ""}${e?.howToFix ?? ""}` +
|
|
29
|
-
(e?.httpStatus === 403
|
|
30
|
-
? "Authentication has expired or was lost. "
|
|
31
|
-
: "");
|
|
25
|
+
(e?.httpStatus === 403 ? "Authentication has expired or was lost. " : "");
|
|
32
26
|
|
|
33
27
|
if (e?.response) {
|
|
34
28
|
try {
|
|
@@ -39,7 +33,7 @@ export class Logger {
|
|
|
39
33
|
|
|
40
34
|
const finalErrorText = message + ". " + safeStringify(e);
|
|
41
35
|
// eslint-disable-next-line no-console
|
|
42
|
-
console.error(finalErrorText);
|
|
36
|
+
console.error(finalErrorText, e);
|
|
43
37
|
|
|
44
38
|
if (!onlyToConsole) {
|
|
45
39
|
this.log(finalErrorText, "logError");
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Major point of rabbit ticker format definition.
|
|
3
|
+
* Our asset ticker format is just stick standard (printable) ticker with protocol code.
|
|
4
|
+
* If protocol code is the same as asset ticker than it is not added.
|
|
5
|
+
* Examples:
|
|
6
|
+
* SHIBERC20 - shiba inu on ethereum,
|
|
7
|
+
* TON - Ton coin on ton blockchain,
|
|
8
|
+
* BTC - Bitcoin in BTC mainnet,
|
|
9
|
+
* NOTTON - Notcoin in Ton blockchain
|
|
10
|
+
*
|
|
11
|
+
* @param standardPrintableTicker {string}
|
|
12
|
+
* @param protocolOrNetworkCode {string}
|
|
13
|
+
* @return {string}
|
|
14
|
+
*/
|
|
15
|
+
export function toRabbitTicker(standardPrintableTicker, protocolOrNetworkCode) {
|
|
16
|
+
if (
|
|
17
|
+
typeof standardPrintableTicker !== "string" ||
|
|
18
|
+
(typeof protocolOrNetworkCode !== "string" && protocolOrNetworkCode != null)
|
|
19
|
+
)
|
|
20
|
+
throw new Error("Wrong ticker/protocol passed: " + standardPrintableTicker + ", " + protocolOrNetworkCode);
|
|
21
|
+
const upperTicker = standardPrintableTicker.toUpperCase();
|
|
22
|
+
const upperCode = (protocolOrNetworkCode ?? "").toUpperCase();
|
|
23
|
+
return `${upperTicker}${upperCode === upperTicker ? "" : upperCode}`;
|
|
24
|
+
}
|