@rabbitio/ui-kit 1.0.0-beta.82 → 1.0.0-beta.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/coverage/clover.xml +1272 -546
- package/coverage/coverage-final.json +27 -17
- package/coverage/index.html +125 -50
- package/coverage/rabbit-ui-kit/index.html +1 -1
- package/coverage/rabbit-ui-kit/index.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/analyticsAdapters/googleAnalyticsAdapter.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/analyticsAdapters/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/analyticsAdapters/mixpanelAdapter.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/axiosAdapter.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/qrUtils.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/amountUtils.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/errorUtils.js.html +13 -13
- package/coverage/rabbit-ui-kit/src/common-apis/external-apis/apiGroups.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/external-apis/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/external-apis/ipAddressProviders.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/fiatCurrenciesService.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/globalConstants.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/models/blockchain.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/models/coin.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/models/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/models/protocol.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/utils/cache.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/utils/emailAPI.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/utils/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/utils/logging/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/utils/logging/logger.js.html +4 -4
- package/coverage/rabbit-ui-kit/src/common-apis/utils/logging/logsStorage.js.html +3 -3
- package/coverage/rabbit-ui-kit/src/common-apis/utils/postponeExecution.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common-apis/utils/safeStringify.js.html +27 -27
- package/coverage/rabbit-ui-kit/src/index.html +5 -5
- package/coverage/rabbit-ui-kit/src/index.js.html +16 -4
- package/coverage/rabbit-ui-kit/src/robust-api-caller/cacheAndConcurrentRequestsResolver.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robust-api-caller/cachedRobustExternalApiCallerService.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robust-api-caller/cancelProcessing.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robust-api-caller/concurrentCalculationsMetadataHolder.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robust-api-caller/externalApiProvider.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robust-api-caller/externalServicesStatsCollector.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robust-api-caller/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/robust-api-caller/robustExternalAPICallerService.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/index.html +28 -28
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/letsExchangeSwapProvider.js.html +37 -7
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapProvider.js.html +58 -16
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +79 -31
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/baseSwapCreationInfo.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/existingSwap.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/existingSwapWithFiatData.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/index.html +22 -7
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/partner.js.html +106 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/swapProviderCoinInfo.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/services/index.html +5 -5
- package/coverage/rabbit-ui-kit/src/swaps-lib/services/publicSwapService.js.html +78 -12
- package/coverage/rabbit-ui-kit/src/swaps-lib/utils/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/utils/swapUtils.js.html +2 -2
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/arrowIcon.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/arrowTosca.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/arrowWhite.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/darkRectangle.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/determinedError.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/failedValidationIcon.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/index.html +35 -5
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/infoIcon.jsx.html +1 -1
- 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 +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx.html +1 -1
- 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 +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetIcon/AssetIcon.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetIcon/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetSelection/AssetSelection.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetSelection/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/BackgroundTitle/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/InformationMessage/InformationMessage.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/InformationMessage/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Input/Input.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Input/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/LoadingDots/LoadingDots.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/LoadingDots/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/NoticeIcon/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/QrCode/QrCode.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/QrCode/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx.html +3 -3
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/RateSelector/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/SupportChat/SupportChat.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/SupportChat/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Textarea/Textarea.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Textarea/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TitleBox/TitleBox.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TitleBox/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Tooltip/Tooltip.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Tooltip/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Validation/Validation.jsx.html +12 -18
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Validation/index.html +5 -5
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Button/Button.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Button/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Close/Close.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Close/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/LinkButton/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx.html +79 -52
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/AmountInput/index.html +5 -5
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx.html +87 -231
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/CoinPicker/index.html +5 -5
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/ColoredNotice/ColoredNotice.jsx.html +211 -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 +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/LineWithIconLink/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/LogoCarousel/LogoCarousel.jsx.html +196 -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 +496 -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 +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/TitledLineWithIconLink/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/CoinPickerDialogStep/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/Dialog.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +34 -4
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/index.html +5 -5
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +52 -4
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/index.html +5 -5
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx.html +85 -16
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/SwapForm/index.html +5 -5
- 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 +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/components/templates/DeterminedErrorDialogStep/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/hooks/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/hooks/useCallHandlingErrors.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/hooks/useIsHydrated.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/hooks/useReferredState.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/inputValueProviders.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/textUtils.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/uiUtils.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/urlQueryUtils.js.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/BackgroundTitle.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/LinesOfText.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/LoadingDots.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/QrCode.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/RateSelector.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/Validation.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/Button.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/Close.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/LinkButton.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/index.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/index.html +1 -1
- package/coverage/rabbit-ui-kit/stories/molecules/CoinPicker.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/molecules/ColoredNotice.stories.jsx.html +178 -0
- package/coverage/rabbit-ui-kit/stories/molecules/LineWithIconLink.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/molecules/LogoCarousel.stories.jsx.html +160 -0
- package/coverage/rabbit-ui-kit/stories/molecules/TitledLineWithIconLink.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/molecules/index.html +35 -5
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/Dialog.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogButtons/DialogButtons.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogButtons/index.html +1 -1
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogStep/DialogStep.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogStep/index.html +1 -1
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/index.html +1 -1
- 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 +1 -1
- package/coverage/rabbit-ui-kit/stories/stubs/exampleContent.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/stubs/index.html +1 -1
- package/coverage/rabbit-ui-kit/stories/templates/DeterminedErrorDialogStep.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/templates/index.html +1 -1
- package/dist/global.css.map +1 -1
- package/dist/index.cjs +1151 -536
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +93 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +955 -447
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +1148 -537
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +1151 -536
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/index.js +4 -0
- package/src/swaps-lib/external-apis/letsExchangeSwapProvider.js +13 -3
- package/src/swaps-lib/external-apis/swapProvider.js +22 -8
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +23 -7
- package/src/swaps-lib/models/partner.js +7 -0
- package/src/swaps-lib/services/publicSwapService.js +30 -8
- package/src/swaps-lib/utils/swapUtils.js +1 -1
- package/src/ui-kit/assets/styles/global.scss +4 -7
- package/src/ui-kit/assets/wrappedImages/messageIcon.jsx +87 -0
- package/src/ui-kit/assets/wrappedImages/supportDialogImage.jsx +61 -0
- package/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx +2 -2
- package/src/ui-kit/components/atoms/Validation/Validation.jsx +7 -9
- package/src/ui-kit/components/atoms/Validation/validation.module.scss +4 -0
- package/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx +57 -48
- package/src/ui-kit/components/molecules/AmountInput/amount-input.module.scss +33 -0
- package/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx +84 -132
- package/src/ui-kit/components/molecules/ColoredNotice/ColoredNotice.jsx +42 -0
- package/src/ui-kit/components/molecules/ColoredNotice/colored-notice.module.scss +20 -0
- package/src/ui-kit/components/molecules/LogoCarousel/LogoCarousel.jsx +37 -0
- package/src/ui-kit/components/molecules/LogoCarousel/logo-carousel.module.scss +64 -0
- package/src/ui-kit/components/molecules/SearchableCoinsList/SearchableCoinsList.jsx +137 -0
- package/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx +10 -0
- package/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx +16 -0
- package/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx +35 -12
- package/src/ui-kit/components/organisms/WaitlistSubscription/WaitlistSubscription.jsx +158 -0
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -27,6 +27,10 @@ export { InformationMessage } from "./ui-kit/components/atoms/InformationMessage
|
|
|
27
27
|
export { Input } from "./ui-kit/components/atoms/Input/Input.jsx";
|
|
28
28
|
export { COIN_PICKER_MODES, CoinPicker } from "./ui-kit/components/molecules/CoinPicker/CoinPicker.jsx";
|
|
29
29
|
export { CoinPickerDialogStep } from "./ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx";
|
|
30
|
+
export { SearchableCoinsList } from "./ui-kit/components/molecules/SearchableCoinsList/SearchableCoinsList.jsx";
|
|
31
|
+
export { ColoredNotice } from "./ui-kit/components/molecules/ColoredNotice/ColoredNotice.jsx";
|
|
32
|
+
export { WaitlistSubscription } from "./ui-kit/components/organisms/WaitlistSubscription/WaitlistSubscription.jsx";
|
|
33
|
+
export { LogoCarousel } from "./ui-kit/components/molecules/LogoCarousel/LogoCarousel.jsx";
|
|
30
34
|
|
|
31
35
|
// UI-KIT constants
|
|
32
36
|
export { FALLBACK_ASSET_ICON_URL, DEFAULT_CRYPTO_DECIMAL_COUNT } from "./common-apis/globalConstants.jsx";
|
|
@@ -10,6 +10,7 @@ import { safeStringify } from "../../common-apis/utils/safeStringify.js";
|
|
|
10
10
|
import { Logger } from "../../common-apis/utils/logging/logger.js";
|
|
11
11
|
import { DEFAULT_CRYPTO_DECIMAL_COUNT, FALLBACK_ASSET_ICON_URL } from "../../common-apis/globalConstants.jsx";
|
|
12
12
|
import { SwapProviderCoinInfo } from "../models/swapProviderCoinInfo.js";
|
|
13
|
+
import { Partner } from "../models/partner.js";
|
|
13
14
|
|
|
14
15
|
export class LetsExchangeSwapProvider extends SwapProvider {
|
|
15
16
|
constructor(apiKeysProxyUrl, cache, customCoinBuilder = (coin, network) => null, useRestrictedCoinsSet = true) {
|
|
@@ -131,10 +132,9 @@ export class LetsExchangeSwapProvider extends SwapProvider {
|
|
|
131
132
|
}
|
|
132
133
|
const fromCoinDetails = this._supportedCoins.find(i => i.coin?.ticker === fromCoin?.ticker);
|
|
133
134
|
const toCoinDetails = this._supportedCoins.find(i => i.coin?.ticker === toCoin?.ticker);
|
|
134
|
-
if (!fromCoinDetails || !toCoinDetails) {
|
|
135
|
-
throw new Error("Failed to find coin details for: " + fromCoin.ticker + " -> " + toCoin.ticker);
|
|
136
|
-
}
|
|
137
135
|
if (
|
|
136
|
+
!fromCoinDetails ||
|
|
137
|
+
!toCoinDetails ||
|
|
138
138
|
!fromCoinDetails.deposit ||
|
|
139
139
|
!fromCoinDetails.isAvailable ||
|
|
140
140
|
!toCoinDetails.withdrawal ||
|
|
@@ -473,4 +473,14 @@ export class LetsExchangeSwapProvider extends SwapProvider {
|
|
|
473
473
|
throw new Error(`Unknown LetsExchange status: ${status}`);
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
+
|
|
477
|
+
async getPartnersList() {
|
|
478
|
+
return [
|
|
479
|
+
new Partner(
|
|
480
|
+
"LetsExchange",
|
|
481
|
+
"https://letsexchange.io/",
|
|
482
|
+
"https://letsexchange.notion.site/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F02e45813-b375-49d8-b2b0-092ce1847fff%2F55ebbc3c-4ee6-4fa7-847b-f673e82594f3%2Flets-logo-basic__on-light.svg?table=block&id=bec5952a-2f9c-47fb-8cc0-86e1391a7f60&spaceId=02e45813-b375-49d8-b2b0-092ce1847fff&userId=&cache=v2"
|
|
483
|
+
),
|
|
484
|
+
];
|
|
485
|
+
}
|
|
476
486
|
}
|
|
@@ -70,6 +70,7 @@ export class SwapProvider {
|
|
|
70
70
|
WAITING_FOR_PAYMENT: "waiting_for_payment",
|
|
71
71
|
CONFIRMING: "confirming",
|
|
72
72
|
PAYMENT_RECEIVED: "payment_received",
|
|
73
|
+
VERIFYING: "verifying",
|
|
73
74
|
EXCHANGING: "exchanging",
|
|
74
75
|
COMPLETED: "completed",
|
|
75
76
|
REFUNDED: "refunded",
|
|
@@ -160,11 +161,15 @@ export class SwapProvider {
|
|
|
160
161
|
* @private
|
|
161
162
|
*/
|
|
162
163
|
async _fetchSupportedCurrenciesIfNeeded() {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
if (!this.useRestrictedCoinsSet) {
|
|
165
|
+
PRE_LISTED_COINS.forEach(preListedCoin => {
|
|
166
|
+
if (
|
|
167
|
+
!this._supportedCoins.find(existingCoin => preListedCoin.coin.ticker === existingCoin.coin.ticker)
|
|
168
|
+
) {
|
|
169
|
+
this._supportedCoins.push(preListedCoin);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}
|
|
168
173
|
}
|
|
169
174
|
|
|
170
175
|
/**
|
|
@@ -276,7 +281,7 @@ export class SwapProvider {
|
|
|
276
281
|
* Retrieves coin to USDT rate.
|
|
277
282
|
*
|
|
278
283
|
* @param coin {Coin}
|
|
279
|
-
* @return {{result: true, rate: string}|
|
|
284
|
+
* @return {{result: true, rate: string}|null}
|
|
280
285
|
*/
|
|
281
286
|
async getCoinToUSDTRate(coin) {
|
|
282
287
|
const loggerSource = "getCoinToUSDTRate";
|
|
@@ -284,11 +289,13 @@ export class SwapProvider {
|
|
|
284
289
|
if (!coin) return null;
|
|
285
290
|
|
|
286
291
|
await this._fetchSupportedCurrenciesIfNeeded();
|
|
292
|
+
const isCoinAvailableForThisProvider = !!this.getCoinByTickerIfPresent(coin.ticker);
|
|
293
|
+
if (!isCoinAvailableForThisProvider) return null;
|
|
287
294
|
|
|
288
295
|
// Using USDT TRC20 as usually fee in this network is smaller than ERC20 and this network is widely used for USDT
|
|
289
296
|
const usdtTrc20 = this._supportedCoins.find(i => i.coin.ticker === "USDTTRC20")?.coin;
|
|
290
297
|
if (!usdtTrc20) {
|
|
291
|
-
return
|
|
298
|
+
return null;
|
|
292
299
|
}
|
|
293
300
|
const cached = this._cache.get("swapspace_usdt_rate_" + coin.ticker);
|
|
294
301
|
if (cached != null) {
|
|
@@ -301,7 +308,7 @@ export class SwapProvider {
|
|
|
301
308
|
Logger.log("Loading USDT->coin rate as not found in cache:", coin?.ticker);
|
|
302
309
|
const result = await this.getSwapInfo(usdtTrc20, coin, "5000", false);
|
|
303
310
|
if (!result.result) {
|
|
304
|
-
return
|
|
311
|
+
return null;
|
|
305
312
|
}
|
|
306
313
|
|
|
307
314
|
// This calculation is not precise as we cannot recognize the actual fee and network fee. Just approximate.
|
|
@@ -523,4 +530,11 @@ export class SwapProvider {
|
|
|
523
530
|
}
|
|
524
531
|
return coinName;
|
|
525
532
|
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* @return {Promise<Partner[]>}
|
|
536
|
+
*/
|
|
537
|
+
async getPartnersList() {
|
|
538
|
+
return [];
|
|
539
|
+
}
|
|
526
540
|
}
|
|
@@ -11,8 +11,9 @@ import { safeStringify } from "../../common-apis/utils/safeStringify.js";
|
|
|
11
11
|
import { Logger } from "../../common-apis/utils/logging/logger.js";
|
|
12
12
|
import { FALLBACK_ASSET_ICON_URL } from "../../common-apis/globalConstants.jsx";
|
|
13
13
|
import { SwapProviderCoinInfo } from "../models/swapProviderCoinInfo.js";
|
|
14
|
+
import { Partner } from "../models/partner.js";
|
|
14
15
|
|
|
15
|
-
export const BANNED_PARTNERS = ["stealthex", "changee", "coincraddle"];
|
|
16
|
+
export const BANNED_PARTNERS = ["stealthex", "changee", "coincraddle", "easybit"];
|
|
16
17
|
|
|
17
18
|
export class SwapspaceSwapProvider extends SwapProvider {
|
|
18
19
|
constructor(apiKeysProxyUrl, cache, customCoinBuilder = (coin, network) => null, useRestrictedCoinsSet = true) {
|
|
@@ -144,12 +145,9 @@ export class SwapspaceSwapProvider extends SwapProvider {
|
|
|
144
145
|
}
|
|
145
146
|
const fromCoinSwapspaceDetails = this._supportedCoins.find(i => i.coin?.ticker === fromCoin?.ticker);
|
|
146
147
|
const toCoinSwapspaceDetails = this._supportedCoins.find(i => i.coin?.ticker === toCoin?.ticker);
|
|
147
|
-
if (!fromCoinSwapspaceDetails || !toCoinSwapspaceDetails) {
|
|
148
|
-
throw new Error(
|
|
149
|
-
"Failed to find swapspace coin details for: " + fromCoin.ticker + " -> " + toCoin.ticker
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
148
|
if (
|
|
149
|
+
!fromCoinSwapspaceDetails ||
|
|
150
|
+
!toCoinSwapspaceDetails ||
|
|
153
151
|
!fromCoinSwapspaceDetails.deposit ||
|
|
154
152
|
!toCoinSwapspaceDetails.withdrawal ||
|
|
155
153
|
!fromCoinSwapspaceDetails.isAvailable ||
|
|
@@ -456,7 +454,7 @@ export class SwapspaceSwapProvider extends SwapProvider {
|
|
|
456
454
|
case "finished":
|
|
457
455
|
return SwapProvider.SWAP_STATUSES.COMPLETED;
|
|
458
456
|
case "verifying":
|
|
459
|
-
return SwapProvider.SWAP_STATUSES.
|
|
457
|
+
return SwapProvider.SWAP_STATUSES.VERIFYING;
|
|
460
458
|
case "refunded":
|
|
461
459
|
return SwapProvider.SWAP_STATUSES.REFUNDED;
|
|
462
460
|
case "expired":
|
|
@@ -553,4 +551,22 @@ export class SwapspaceSwapProvider extends SwapProvider {
|
|
|
553
551
|
improveAndRethrow(e, loggerSource);
|
|
554
552
|
}
|
|
555
553
|
}
|
|
554
|
+
|
|
555
|
+
async getPartnersList() {
|
|
556
|
+
try {
|
|
557
|
+
await this._fetchPartnersListIfNeeded();
|
|
558
|
+
return this._partners
|
|
559
|
+
.filter(p => !BANNED_PARTNERS.find(banned => banned === p.path))
|
|
560
|
+
.map(
|
|
561
|
+
p =>
|
|
562
|
+
new Partner(
|
|
563
|
+
p.name,
|
|
564
|
+
null, // No data in swapspace
|
|
565
|
+
p?.image?.default ? "https://storage.swapspace.co" + p.image.default : null
|
|
566
|
+
)
|
|
567
|
+
);
|
|
568
|
+
} catch (e) {
|
|
569
|
+
improveAndRethrow(e, "swapspace.getPartnersList");
|
|
570
|
+
}
|
|
571
|
+
}
|
|
556
572
|
}
|
|
@@ -590,13 +590,13 @@ export class PublicSwapService {
|
|
|
590
590
|
|
|
591
591
|
/**
|
|
592
592
|
* @param ticker {string}
|
|
593
|
-
* @param [fixed=false] {boolean}
|
|
594
593
|
* @return {Coin|null}
|
|
595
594
|
*/
|
|
596
|
-
getCoinByTickerIfPresent(ticker
|
|
597
|
-
return
|
|
598
|
-
|
|
599
|
-
|
|
595
|
+
getCoinByTickerIfPresent(ticker) {
|
|
596
|
+
return (
|
|
597
|
+
this._swapProvider.getCoinByTickerIfPresent(ticker) ??
|
|
598
|
+
this._fixedSwapProvider.getCoinByTickerIfPresent(ticker)
|
|
599
|
+
);
|
|
600
600
|
}
|
|
601
601
|
|
|
602
602
|
/**
|
|
@@ -605,15 +605,20 @@ export class PublicSwapService {
|
|
|
605
605
|
* @return {Promise<string|null>}
|
|
606
606
|
*/
|
|
607
607
|
async getAssetToUsdtRate(asset) {
|
|
608
|
+
let result = null;
|
|
609
|
+
try {
|
|
610
|
+
result = await this._swapProvider.getCoinToUSDTRate(asset);
|
|
611
|
+
} catch (e) {
|
|
612
|
+
Logger.logError(e, "getAssetToUsdtRate");
|
|
613
|
+
}
|
|
608
614
|
try {
|
|
609
|
-
let result = await this._swapProvider.getCoinToUSDTRate(asset);
|
|
610
615
|
if (result?.rate == null) {
|
|
611
616
|
result = await this._fixedSwapProvider.getCoinToUSDTRate(asset);
|
|
612
617
|
}
|
|
613
|
-
return result?.rate ?? null;
|
|
614
618
|
} catch (e) {
|
|
615
|
-
|
|
619
|
+
Logger.logError(e, "getAssetToUsdtRate", "Failed via both fixed and floating providers");
|
|
616
620
|
}
|
|
621
|
+
return result?.rate ?? null;
|
|
617
622
|
}
|
|
618
623
|
|
|
619
624
|
/**
|
|
@@ -667,4 +672,21 @@ export class PublicSwapService {
|
|
|
667
672
|
improveAndRethrow(e, "getExtraIdNameIfPresentForAsset");
|
|
668
673
|
}
|
|
669
674
|
}
|
|
675
|
+
|
|
676
|
+
async getPartnersList() {
|
|
677
|
+
try {
|
|
678
|
+
let allPartners = [this._swapProvider, this._fixedSwapProvider].map(provider => provider.getPartnersList());
|
|
679
|
+
allPartners = await Promise.all(allPartners);
|
|
680
|
+
allPartners = allPartners.flat().flat();
|
|
681
|
+
return allPartners.reduce((prev, cur) => {
|
|
682
|
+
if (!prev.find(partner => partner.name.toLowerCase() === cur.name.toLowerCase())) {
|
|
683
|
+
prev.push(cur);
|
|
684
|
+
}
|
|
685
|
+
return prev;
|
|
686
|
+
}, []);
|
|
687
|
+
} catch (e) {
|
|
688
|
+
Logger.logError(e, "getPartnersList");
|
|
689
|
+
}
|
|
690
|
+
return [];
|
|
691
|
+
}
|
|
670
692
|
}
|
|
@@ -52,7 +52,7 @@ export class SwapUtils {
|
|
|
52
52
|
const defaultAmountUsd = BigNumber("300");
|
|
53
53
|
const coinUsdRate = await swapProvider.getCoinToUSDTRate(fromCoin);
|
|
54
54
|
const coinAmountForDefaultUsdAmount = AmountUtils.trim(
|
|
55
|
-
coinUsdRate
|
|
55
|
+
coinUsdRate?.result ? defaultAmountUsd.div(coinUsdRate?.rate) : defaultAmountUsd,
|
|
56
56
|
fromCoin.digits
|
|
57
57
|
);
|
|
58
58
|
Logger.log(`Init: ${coinAmountForDefaultUsdAmount} ${fromCoin.ticker}->${toCoin.ticker}`, loggerSource);
|
|
@@ -6,13 +6,10 @@
|
|
|
6
6
|
// Global classes.
|
|
7
7
|
//
|
|
8
8
|
// Rule for adding new global classes:
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
// name
|
|
13
|
-
// add a prefix "gc_", so that we can easily find all its usages throughout the code.
|
|
14
|
-
// For example, if you want to add a class called ".button", you must name it as
|
|
15
|
-
// ".gc_button", so that it can be easily found.
|
|
9
|
+
// All new classes must start with prefix ".global-class--", so that
|
|
10
|
+
// the class name is unique enough for it to be searched globally.
|
|
11
|
+
// For example, if you want to add a class called ".button", you must
|
|
12
|
+
// name it as ".global-class--button", so that it can be easily found.
|
|
16
13
|
|
|
17
14
|
.container {
|
|
18
15
|
max-width: 1260px;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export default () => (
|
|
4
|
+
<svg width="130" height="130" viewBox="0 0 130 130" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
+
<path
|
|
6
|
+
fill-rule="evenodd"
|
|
7
|
+
clip-rule="evenodd"
|
|
8
|
+
d="M65 130C100.899 130 130 100.899 130 65C130 29.1015 100.899 0 65 0C29.1015 0 0 29.1015 0 65C0 100.899 29.1015 130 65 130Z"
|
|
9
|
+
fill="#2294F0"
|
|
10
|
+
/>
|
|
11
|
+
<mask id="mask0" style={{ maskType: "alpha" }} maskUnits="userSpaceOnUse" x="0" y="0" width="130" height="130">
|
|
12
|
+
<path
|
|
13
|
+
fill-rule="evenodd"
|
|
14
|
+
clip-rule="evenodd"
|
|
15
|
+
d="M65 130C100.899 130 130 100.899 130 65C130 29.1015 100.899 0 65 0C29.1015 0 0 29.1015 0 65C0 100.899 29.1015 130 65 130Z"
|
|
16
|
+
fill="white"
|
|
17
|
+
/>
|
|
18
|
+
</mask>
|
|
19
|
+
<g mask="url(#mask0)">
|
|
20
|
+
<rect
|
|
21
|
+
opacity="0.3"
|
|
22
|
+
x="3.25"
|
|
23
|
+
y="150.776"
|
|
24
|
+
width="227.136"
|
|
25
|
+
height="25.2373"
|
|
26
|
+
transform="rotate(-45 3.25 150.776)"
|
|
27
|
+
fill="white"
|
|
28
|
+
/>
|
|
29
|
+
<rect
|
|
30
|
+
opacity="0.3"
|
|
31
|
+
x="-48.4546"
|
|
32
|
+
y="126.52"
|
|
33
|
+
width="227.136"
|
|
34
|
+
height="25.2373"
|
|
35
|
+
transform="rotate(-45 -48.4546 126.52)"
|
|
36
|
+
fill="white"
|
|
37
|
+
/>
|
|
38
|
+
<rect x="27.75" y="29.5" width="74.5" height="81.5" rx="12" fill="white" />
|
|
39
|
+
<path
|
|
40
|
+
d="M27.75 41.5C27.75 34.8726 33.1226 29.5 39.75 29.5H90.25C96.8774 29.5 102.25 34.8726 102.25 41.5V118C102.25 124.627 96.8774 130 90.25 130H39.75C33.1226 130 27.75 124.627 27.75 118V41.5Z"
|
|
41
|
+
fill="white"
|
|
42
|
+
/>
|
|
43
|
+
<path
|
|
44
|
+
fill-rule="evenodd"
|
|
45
|
+
clip-rule="evenodd"
|
|
46
|
+
d="M51.5 63.5C58.1274 63.5 63.5 58.1274 63.5 51.5C63.5 44.8726 58.1274 39.5 51.5 39.5C44.8726 39.5 39.5 44.8726 39.5 51.5C39.5 58.1274 44.8726 63.5 51.5 63.5Z"
|
|
47
|
+
fill="#2294F0"
|
|
48
|
+
/>
|
|
49
|
+
<path
|
|
50
|
+
d="M50.072 49.088H52.03V54.5H50.072V49.088ZM52.074 46.382V48.153H50.028V46.382H52.074Z"
|
|
51
|
+
fill="white"
|
|
52
|
+
/>
|
|
53
|
+
<path
|
|
54
|
+
opacity="0.2"
|
|
55
|
+
d="M41 74.5H63"
|
|
56
|
+
stroke="#2294F0"
|
|
57
|
+
stroke-width="4"
|
|
58
|
+
stroke-linecap="round"
|
|
59
|
+
stroke-linejoin="round"
|
|
60
|
+
/>
|
|
61
|
+
<path
|
|
62
|
+
opacity="0.2"
|
|
63
|
+
d="M41 84.6157H84.1426"
|
|
64
|
+
stroke="#2294F0"
|
|
65
|
+
stroke-width="4"
|
|
66
|
+
stroke-linecap="round"
|
|
67
|
+
stroke-linejoin="round"
|
|
68
|
+
/>
|
|
69
|
+
<path
|
|
70
|
+
opacity="0.2"
|
|
71
|
+
d="M41 94.7314H84.1426"
|
|
72
|
+
stroke="#2294F0"
|
|
73
|
+
stroke-width="4"
|
|
74
|
+
stroke-linecap="round"
|
|
75
|
+
stroke-linejoin="round"
|
|
76
|
+
/>
|
|
77
|
+
<path
|
|
78
|
+
opacity="0.2"
|
|
79
|
+
d="M41 104.731H84.1426"
|
|
80
|
+
stroke="#2294F0"
|
|
81
|
+
stroke-width="4"
|
|
82
|
+
stroke-linecap="round"
|
|
83
|
+
stroke-linejoin="round"
|
|
84
|
+
/>
|
|
85
|
+
</g>
|
|
86
|
+
</svg>
|
|
87
|
+
);
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export default () => (
|
|
4
|
+
<svg width="130" height="130" viewBox="0 0 130 130" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
+
<path
|
|
6
|
+
fill-rule="evenodd"
|
|
7
|
+
clip-rule="evenodd"
|
|
8
|
+
d="M65 130C100.899 130 130 100.899 130 65C130 29.1015 100.899 0 65 0C29.1015 0 0 29.1015 0 65C0 100.899 29.1015 130 65 130Z"
|
|
9
|
+
fill="#AFEBC3"
|
|
10
|
+
/>
|
|
11
|
+
<mask id="mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="130" height="130">
|
|
12
|
+
<path
|
|
13
|
+
fill-rule="evenodd"
|
|
14
|
+
clip-rule="evenodd"
|
|
15
|
+
d="M65 130C100.899 130 130 100.899 130 65C130 29.1015 100.899 0 65 0C29.1015 0 0 29.1015 0 65C0 100.899 29.1015 130 65 130Z"
|
|
16
|
+
fill="white"
|
|
17
|
+
/>
|
|
18
|
+
</mask>
|
|
19
|
+
<g mask="url(#mask0)">
|
|
20
|
+
<rect
|
|
21
|
+
opacity="0.3"
|
|
22
|
+
x="3.25"
|
|
23
|
+
y="150.776"
|
|
24
|
+
width="227.136"
|
|
25
|
+
height="25.2373"
|
|
26
|
+
transform="rotate(-45 3.25 150.776)"
|
|
27
|
+
fill="white"
|
|
28
|
+
/>
|
|
29
|
+
<rect
|
|
30
|
+
opacity="0.3"
|
|
31
|
+
x="-48.4545"
|
|
32
|
+
y="126.52"
|
|
33
|
+
width="227.136"
|
|
34
|
+
height="25.2373"
|
|
35
|
+
transform="rotate(-45 -48.4545 126.52)"
|
|
36
|
+
fill="white"
|
|
37
|
+
/>
|
|
38
|
+
<path
|
|
39
|
+
d="M9.69092 69.153C9.69092 66.0864 11.2523 63.2309 13.8339 61.576L55.8257 34.6583C61.4168 31.0742 68.5832 31.0742 74.1743 34.6583L116.166 61.576C118.748 63.2309 120.309 66.0864 120.309 69.153V126.495C120.309 131.466 116.28 135.495 111.309 135.495H18.6909C13.7204 135.495 9.69092 131.466 9.69092 126.495V69.153Z"
|
|
40
|
+
fill="#14A957"
|
|
41
|
+
/>
|
|
42
|
+
<path d="M30.9045 51.8818H97.9136V117.118H30.9045V51.8818Z" fill="white" />
|
|
43
|
+
<path
|
|
44
|
+
opacity="0.1"
|
|
45
|
+
d="M63.8182 107.167C76.8722 107.167 87.4545 96.5849 87.4545 83.5308C87.4545 70.4768 76.8722 59.8945 63.8182 59.8945C50.7642 59.8945 40.1818 70.4768 40.1818 83.5308C40.1818 96.5849 50.7642 107.167 63.8182 107.167Z"
|
|
46
|
+
fill="#24BE6A"
|
|
47
|
+
/>
|
|
48
|
+
<path
|
|
49
|
+
d="M58.2093 83.4849L63.0246 88.3002L71.3036 79.047"
|
|
50
|
+
stroke="#24BE6A"
|
|
51
|
+
stroke-width="3.76358"
|
|
52
|
+
stroke-linecap="round"
|
|
53
|
+
stroke-linejoin="round"
|
|
54
|
+
/>
|
|
55
|
+
<path
|
|
56
|
+
d="M9.69092 70.2531C9.69092 68.672 11.4391 67.7161 12.7703 68.5694L65 102.05L117.23 68.5694C118.561 67.7161 120.309 68.672 120.309 70.2531V128.859C120.309 133.83 116.28 137.859 111.309 137.859H18.6909C13.7204 137.859 9.69092 133.83 9.69092 128.859V70.2531Z"
|
|
57
|
+
fill="#24BE6A"
|
|
58
|
+
/>
|
|
59
|
+
</g>
|
|
60
|
+
</svg>
|
|
61
|
+
);
|
|
@@ -15,13 +15,13 @@ export const RateSelector = ({
|
|
|
15
15
|
<div className={s["rate-selector"]}>
|
|
16
16
|
<div
|
|
17
17
|
className={`${s["rate-selector-item"]} ${!isFixed ? s["selected"] : ""}`}
|
|
18
|
-
onClick={() => setIsFixed(false)}
|
|
18
|
+
onClick={() => (isFixed ? setIsFixed(false) : null)}
|
|
19
19
|
>
|
|
20
20
|
<div className={s["rate-selector-item-text"]}>{translations.floatingRate}</div>
|
|
21
21
|
</div>
|
|
22
22
|
<div
|
|
23
23
|
className={`${s["rate-selector-item"]} ${isFixed ? s["selected"] : ""}`}
|
|
24
|
-
onClick={() => setIsFixed(true)}
|
|
24
|
+
onClick={() => (!isFixed ? setIsFixed(true) : null)}
|
|
25
25
|
>
|
|
26
26
|
<div className={s["rate-selector-item-text"]}>{translations.fixedRate}</div>
|
|
27
27
|
</div>
|
|
@@ -16,15 +16,13 @@ import FailedValidationIcon from "../../../assets/wrappedImages/failedValidation
|
|
|
16
16
|
export const Validation = ({ text = "", isSuccessAlert }) => {
|
|
17
17
|
return (
|
|
18
18
|
<div className={s["validation"]}>
|
|
19
|
-
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)}
|
|
27
|
-
</div>
|
|
19
|
+
{isSuccessAlert ? (
|
|
20
|
+
// <img src={successfulValidationIcon} alt="validation icon" />
|
|
21
|
+
<SuccessfulValidationIcon />
|
|
22
|
+
) : (
|
|
23
|
+
// <img src={failedValidationIcon} alt="validation icon" />
|
|
24
|
+
<FailedValidationIcon />
|
|
25
|
+
)}
|
|
28
26
|
<span className={s["validation-text"]}>{text}</span>
|
|
29
27
|
</div>
|
|
30
28
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from "react";
|
|
2
2
|
import { BigNumber } from "bignumber.js";
|
|
3
|
+
import { CSSTransition } from "react-transition-group";
|
|
3
4
|
|
|
4
5
|
import s from "./amount-input.module.scss";
|
|
5
6
|
import WalletIcon from "../../../assets/wrappedImages/walletIcon.jsx";
|
|
@@ -251,55 +252,63 @@ export const AmountInput = React.forwardRef(
|
|
|
251
252
|
</div>
|
|
252
253
|
)}
|
|
253
254
|
</div>
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
onChange={e => handleChangeAmountFiat(e.target.value)}
|
|
275
|
-
placeholder={placeholderByDecimalCount(fiatCurrencyDecimals)}
|
|
276
|
-
autoFocus={fiatAmountAutoFocus}
|
|
277
|
-
onFocus={e => callHandlingErrors(() => setIsInFocus(true), e)}
|
|
278
|
-
onBlur={e => callHandlingErrors(() => setIsInFocus(false), e)}
|
|
279
|
-
/>
|
|
280
|
-
) : (
|
|
281
|
-
<div className={s["requested-amount-fiat-skeleton"]}>
|
|
282
|
-
<span
|
|
283
|
-
className={
|
|
284
|
-
s["requested-amount-fiat-skeleton-content"] +
|
|
285
|
-
" " +
|
|
286
|
-
"skeleton-dark"
|
|
287
|
-
}
|
|
288
|
-
></span>
|
|
289
|
-
</div>
|
|
290
|
-
)}
|
|
291
|
-
</>
|
|
292
|
-
) : (
|
|
293
|
-
<span
|
|
294
|
-
className={s["requested-amount-fiat-placeholder"]}
|
|
295
|
-
onClick={e => callHandlingErrors(() => handleFiatInteraction(), e)}
|
|
296
|
-
>
|
|
297
|
-
{fiatInputPlaceholderText}
|
|
255
|
+
<CSSTransition
|
|
256
|
+
in={fiatCurrencyCode !== null}
|
|
257
|
+
timeout={200}
|
|
258
|
+
classNames={{
|
|
259
|
+
enter: s["requested-amount-fiat-enter"],
|
|
260
|
+
enterActive: s["requested-amount-fiat-enter-active"],
|
|
261
|
+
exit: s["requested-amount-fiat-exit"],
|
|
262
|
+
exitActive: s["requested-amount-fiat-exit-active"],
|
|
263
|
+
}}
|
|
264
|
+
unmountOnExit
|
|
265
|
+
>
|
|
266
|
+
<div
|
|
267
|
+
className={
|
|
268
|
+
s["requested-amount-fiat"] + (interactedWith ? " " + s["interacted"] : "")
|
|
269
|
+
}
|
|
270
|
+
>
|
|
271
|
+
{interactedWith ? (
|
|
272
|
+
<>
|
|
273
|
+
<span className={s["requested-amount-fiat-currency"]}>
|
|
274
|
+
{(estimateAmount ? "~ " : "") + fiatCurrencyCode}
|
|
298
275
|
</span>
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
276
|
+
|
|
277
|
+
{!isLoading && cryptoAssetToFiatRate != null ? (
|
|
278
|
+
<input
|
|
279
|
+
type="text"
|
|
280
|
+
inputMode="decimal"
|
|
281
|
+
className={s["requested-amount-fiat-input"]}
|
|
282
|
+
value={fiatAmountValue}
|
|
283
|
+
disabled={disabled || locked}
|
|
284
|
+
onChange={e => handleChangeAmountFiat(e.target.value)}
|
|
285
|
+
placeholder={placeholderByDecimalCount(fiatCurrencyDecimals)}
|
|
286
|
+
autoFocus={fiatAmountAutoFocus}
|
|
287
|
+
onFocus={e => callHandlingErrors(() => setIsInFocus(true), e)}
|
|
288
|
+
onBlur={e => callHandlingErrors(() => setIsInFocus(false), e)}
|
|
289
|
+
/>
|
|
290
|
+
) : (
|
|
291
|
+
<div className={s["requested-amount-fiat-skeleton"]}>
|
|
292
|
+
<span
|
|
293
|
+
className={
|
|
294
|
+
s["requested-amount-fiat-skeleton-content"] +
|
|
295
|
+
" " +
|
|
296
|
+
"skeleton-dark"
|
|
297
|
+
}
|
|
298
|
+
></span>
|
|
299
|
+
</div>
|
|
300
|
+
)}
|
|
301
|
+
</>
|
|
302
|
+
) : (
|
|
303
|
+
<span
|
|
304
|
+
className={s["requested-amount-fiat-placeholder"]}
|
|
305
|
+
onClick={e => callHandlingErrors(() => handleFiatInteraction(), e)}
|
|
306
|
+
>
|
|
307
|
+
{fiatInputPlaceholderText}
|
|
308
|
+
</span>
|
|
309
|
+
)}
|
|
310
|
+
</div>
|
|
311
|
+
</CSSTransition>
|
|
303
312
|
</div>
|
|
304
313
|
{showChangeAssetButton && ticker ? (
|
|
305
314
|
<div className={s["amount-input-container-button-wrapper"]} ref={buttonForwardRef}>
|