@rabbitio/ui-kit 1.0.0-beta.111 → 1.0.0-beta.113
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 +1 -0
- package/.env.example +1 -1
- package/coverage/clover.xml +1686 -1723
- package/coverage/coverage-final.json +118 -118
- package/coverage/index.html +86 -86
- package/coverage/{rabbit-ui-kit → ui-kit}/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/index.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/analyticsAdapters/googleAnalyticsAdapter.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/analyticsAdapters/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/analyticsAdapters/metrikaAdapter.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/analyticsAdapters/mixpanelAdapter.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/axiosAdapter.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/adapters/qrUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/external-apis/apiGroups.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/external-apis/emailAPI.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/external-apis/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/external-apis/ipAddressProviders.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/globalConstants.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/models/blockchain.js.html +6 -6
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/models/coin.js.html +223 -223
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/models/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/models/protocol.js.html +5 -5
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/services/fiatCurrenciesService.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/services/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/amountUtils.js.html +51 -51
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/cache.js.html +8 -8
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/errorUtils.js.html +15 -15
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/logging/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/logging/logger.js.html +24 -24
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/logging/logsStorage.js.html +5 -5
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/postponeExecution.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/rabbitTicker.js.html +12 -12
- package/coverage/{rabbit-ui-kit → ui-kit}/src/common-apis/utils/safeStringify.js.html +29 -29
- package/coverage/{rabbit-ui-kit → ui-kit}/src/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/index.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/cacheAndConcurrentRequestsResolver.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/cachedRobustExternalApiCallerService.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/cancelProcessing.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/concurrentCalculationsMetadataHolder.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/externalApiProvider.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/externalServicesStatsCollector.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/robust-api-caller/robustExternalAPICallerService.js.html +14 -14
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/exolixSwapProvider.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/goexmeSwapProvider.js.html +566 -677
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/index.html +29 -29
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/letsExchangeSwapProvider.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/swapProvider.js.html +349 -349
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/external-apis/utils.js.html +16 -16
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/baseSwapCreationInfo.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/existingSwap.js.html +143 -143
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/existingSwapWithFiatData.js.html +103 -103
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/index.html +16 -16
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/partner.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/models/swapProviderCoinInfo.js.html +75 -75
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/services/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/services/publicSwapService.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/utils/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/swaps-lib/utils/swapUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/arrowIcon.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/arrowTosca.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/arrowWhite.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/darkRectangle.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/determinedError.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/failedValidationIcon.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/infoIcon.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/messageIcon.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/noticeQuestionIcon.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/supportDialogImage.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/assets/wrappedImages/walletIcon.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/AssetIcon/AssetIcon.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/AssetIcon/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/AssetSelection/AssetSelection.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/AssetSelection/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/BackgroundTitle/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/InformationMessage/InformationMessage.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/InformationMessage/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Input/Input.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Input/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/LoadingDots/LoadingDots.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/LoadingDots/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/NoticeIcon/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/QrCode/QrCode.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/QrCode/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/RateSelector/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/SupportChat/SupportChat.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/SupportChat/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Textarea/Textarea.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Textarea/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/TitleBox/TitleBox.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/TitleBox/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Tooltip/Tooltip.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Tooltip/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/TwoLinesOfText/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Validation/Validation.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/Validation/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/Button/Button.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/Button/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/Close/Close.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/Close/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/LinkButton/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/atoms/buttons/RadioButtonWithText/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/AmountInput/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/CoinPicker/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/ColoredNotice/ColoredNotice.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/ColoredNotice/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/LineWithIconLink/LineWithIconLink.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/LineWithIconLink/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/LogoCarousel/LogoCarousel.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/LogoCarousel/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/SearchableCoinsList/SearchableCoinsList.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/SearchableCoinsList/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/molecules/TitledLineWithIconLink/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/CoinPickerDialogStep/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/Dialog.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/DialogButtons/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/DialogStep/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/Dialog/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/SwapForm/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/WaitlistSubscription/WaitlistSubscription.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/organisms/WaitlistSubscription/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/components/templates/DeterminedErrorDialogStep/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/hooks/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/hooks/useCallHandlingErrors.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/hooks/useIsHydrated.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/hooks/useReferredState.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/inputValueProviders.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/searchCoins.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/textUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/uiUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/src/ui-kit/utils/urlQueryUtils.js.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/BackgroundTitle.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/LinesOfText.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/LoadingDots.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/QrCode.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/RateSelector.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/Validation.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/Button.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/Close.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/LinkButton.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/buttons/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/atoms/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/AmountInput.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/CoinPicker.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/ColoredNotice.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/LineWithIconLink.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/LogoCarousel.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/TitledLineWithIconLink.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/molecules/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/Dialog.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogButtons/DialogButtons.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogButtons/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogStep/DialogStep.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/DialogStep/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/Dialog/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/WaitlistSubscription.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/organisms/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/stubs/coins.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/stubs/exampleContent.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/stubs/index.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/templates/DeterminedErrorDialogStep.stories.jsx.html +3 -3
- package/coverage/{rabbit-ui-kit → ui-kit}/stories/templates/index.html +3 -3
- package/dist/index.cjs +120 -169
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +36 -71
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +120 -169
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +120 -169
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/swaps-lib/external-apis/goexmeSwapProvider.js +40 -77
- package/src/swaps-lib/models/existingSwap.js +1 -1
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/_convertCurrencyMeta.test.js +80 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/_fetchSupportedCurrenciesIfNeeded.test.js +50 -123
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/createSwap.test.js +177 -72
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/getExistingSwapsDetailsAndStatus.test.js +151 -0
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/getSwapInfo.test.js +140 -104
- 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 +31 -60
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/_fetchSupportedCurrenciesIfNeeded.int.test.js +261 -126
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/createSwap.int.test.js +319 -225
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/getSwapInfo.int.test.js +137 -127
package/dist/index.cjs
CHANGED
|
@@ -10674,7 +10674,7 @@ var ExistingSwap = /** @type {string} The ID of the swap. */
|
|
|
10674
10674
|
* @param {number} expiresAt - The timestamp when the swap expires.
|
|
10675
10675
|
* @param {number|null} confirmations - The number of confirmations the swap has received, or null.
|
|
10676
10676
|
* @param {string} rate - The exchange rate for the swap.
|
|
10677
|
-
* @param {
|
|
10677
|
+
* @param {boolean} fixed - Indicates if the rate is fixed.
|
|
10678
10678
|
* @param {string|null} refundAddress - The address to refund to in case of failure, or null.
|
|
10679
10679
|
* @param {string} payToAddress - The address to send the funds to.
|
|
10680
10680
|
* @param {Coin} fromCoin - The coin that is being swapped from.
|
|
@@ -13279,23 +13279,13 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13279
13279
|
}
|
|
13280
13280
|
};
|
|
13281
13281
|
_this.COINS_EXPIRATION_TIME_MS = 5 * 60 * 1000;
|
|
13282
|
-
_this.PAIRS_EXPIRATION_TIME_MS = 5 * 60 * 1000;
|
|
13283
13282
|
_this.SWAP_EXPIRATION_TIME_MS = 4 * 60 * 60 * 1000;
|
|
13284
|
-
_this._pairsCache = null;
|
|
13285
|
-
_this._pairsCacheTimestamp = 0;
|
|
13286
13283
|
return _this;
|
|
13287
13284
|
}
|
|
13288
13285
|
var _proto = GoexmeSwapProvider.prototype;
|
|
13289
13286
|
_proto.getSwapCreationInfoTtlMs = function getSwapCreationInfoTtlMs() {
|
|
13290
13287
|
return 30000;
|
|
13291
13288
|
};
|
|
13292
|
-
_proto._isPairSupported = function _isPairSupported(fromInfo, toInfo) {
|
|
13293
|
-
if (!this._pairsCache || !this._pairsCache[fromInfo.code]) return false;
|
|
13294
|
-
var toSet = this._pairsCache[fromInfo.code];
|
|
13295
|
-
/* GoExme may list either the raw provider code **or**
|
|
13296
|
-
* the “pretty” Rabbit ticker in `/pairs`, so we test both. */
|
|
13297
|
-
return toSet.has(toInfo.code) || toSet.has(toInfo.coin.ticker);
|
|
13298
|
-
};
|
|
13299
13289
|
_proto._findInfoByTicker = function _findInfoByTicker(ticker) {
|
|
13300
13290
|
return this._supportedCoins.find(function (i) {
|
|
13301
13291
|
return i.coin.ticker === ticker;
|
|
@@ -13360,36 +13350,6 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13360
13350
|
// extraIdName (only if needed)
|
|
13361
13351
|
0, FALLBACK_ASSET_ICON_URL, true, true, null, true);
|
|
13362
13352
|
};
|
|
13363
|
-
_proto._ensurePairsLoaded = function _ensurePairsLoaded() {
|
|
13364
|
-
try {
|
|
13365
|
-
var _this3 = this;
|
|
13366
|
-
var loggerSource = "Goexme._ensurePairsLoaded";
|
|
13367
|
-
return Promise.resolve(_catch$2(function () {
|
|
13368
|
-
if (_this3._pairsCache && Date.now() - _this3._pairsCacheTimestamp < _this3.PAIRS_EXPIRATION_TIME_MS) return;
|
|
13369
|
-
return Promise.resolve(axios__default["default"].get(_this3._URL + "/pairs", _extends({}, _this3.axiosPreset, createRobustTimeoutSetupForAxios(), {
|
|
13370
|
-
params: {
|
|
13371
|
-
key: _this3._apiKey
|
|
13372
|
-
}
|
|
13373
|
-
}))).then(function (response) {
|
|
13374
|
-
if (response.status !== 200 || typeof response.data !== "object") {
|
|
13375
|
-
throw new Error("Failed to load /pairs");
|
|
13376
|
-
}
|
|
13377
|
-
_this3._pairsCache = Object.fromEntries(Object.entries(response.data).map(function (_ref3) {
|
|
13378
|
-
var from = _ref3[0],
|
|
13379
|
-
arr = _ref3[1];
|
|
13380
|
-
return [from.toUpperCase(), new Set(arr.map(function (v) {
|
|
13381
|
-
return v.toUpperCase();
|
|
13382
|
-
}))];
|
|
13383
|
-
}));
|
|
13384
|
-
_this3._pairsCacheTimestamp = Date.now();
|
|
13385
|
-
});
|
|
13386
|
-
}, function (e) {
|
|
13387
|
-
improveAndRethrow(e, loggerSource);
|
|
13388
|
-
}));
|
|
13389
|
-
} catch (e) {
|
|
13390
|
-
return Promise.reject(e);
|
|
13391
|
-
}
|
|
13392
|
-
};
|
|
13393
13353
|
_proto._mapGoexmeStatus = function _mapGoexmeStatus(status) {
|
|
13394
13354
|
switch (status) {
|
|
13395
13355
|
case "new":
|
|
@@ -13442,87 +13402,84 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13442
13402
|
amountIsToReceive = false;
|
|
13443
13403
|
}
|
|
13444
13404
|
try {
|
|
13445
|
-
var
|
|
13405
|
+
var _this3 = this;
|
|
13446
13406
|
var loggerSource = "Goexme.getSwapInfo";
|
|
13447
13407
|
return Promise.resolve(_catch$2(function () {
|
|
13448
13408
|
if (amountIsToReceive) throw new Error("amountIsToReceive is not supported by GoExme");
|
|
13449
13409
|
if (!(fromCoin instanceof Coin) || !(toCoin instanceof Coin) || BigNumber__default["default"](amountCoins).lte(0)) throw new Error("Invalid params for getSwapInfo");
|
|
13450
|
-
return Promise.resolve(
|
|
13451
|
-
|
|
13452
|
-
|
|
13453
|
-
|
|
13454
|
-
|
|
13410
|
+
return Promise.resolve(_this3._fetchSupportedCurrenciesIfNeeded()).then(function () {
|
|
13411
|
+
var fromCoinInfo = _this3._findInfoByTicker(fromCoin.ticker);
|
|
13412
|
+
var toCoinInfo = _this3._findInfoByTicker(toCoin.ticker);
|
|
13413
|
+
if (!fromCoinInfo || !toCoinInfo) {
|
|
13414
|
+
return {
|
|
13415
|
+
result: false,
|
|
13416
|
+
reason: SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED
|
|
13417
|
+
};
|
|
13418
|
+
}
|
|
13419
|
+
var params = _extends({
|
|
13420
|
+
key: _this3._apiKey,
|
|
13421
|
+
from: fromCoinInfo.code,
|
|
13422
|
+
to: toCoinInfo.code,
|
|
13423
|
+
amount: amountCoins
|
|
13424
|
+
}, fixed ? {
|
|
13425
|
+
fix: true
|
|
13426
|
+
} : {});
|
|
13427
|
+
return Promise.resolve(axios__default["default"].get(_this3._URL + "/rate", _extends({}, _this3.axiosPreset, createRobustTimeoutSetupForAxios(), {
|
|
13428
|
+
params: params
|
|
13429
|
+
}))).then(function (response) {
|
|
13430
|
+
var _response$data, _response$data$minamo, _response$data$maxamo;
|
|
13431
|
+
if (response.status !== 200 || ((_response$data = response.data) == null ? void 0 : _response$data.result) !== true || !response.data) {
|
|
13432
|
+
Logger.log("Unexpected response from /rate: " + response.status + ": " + safeStringify(response.data), loggerSource);
|
|
13455
13433
|
return {
|
|
13456
13434
|
result: false,
|
|
13457
13435
|
reason: SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED
|
|
13458
13436
|
};
|
|
13459
13437
|
}
|
|
13460
|
-
var
|
|
13461
|
-
|
|
13462
|
-
|
|
13463
|
-
|
|
13464
|
-
|
|
13465
|
-
}, fixed ? {
|
|
13466
|
-
fix: true
|
|
13467
|
-
} : {});
|
|
13468
|
-
return Promise.resolve(axios__default["default"].get(_this4._URL + "/rate", _extends({}, _this4.axiosPreset, createRobustTimeoutSetupForAxios(), {
|
|
13469
|
-
params: params
|
|
13470
|
-
}))).then(function (response) {
|
|
13471
|
-
var _response$data, _response$data$minamo, _response$data$maxamo;
|
|
13472
|
-
if (response.status !== 200 || ((_response$data = response.data) == null ? void 0 : _response$data.result) !== true || !response.data) {
|
|
13473
|
-
Logger.log("Unexpected response from /rate: " + response.status + ": " + safeStringify(response.data), loggerSource);
|
|
13474
|
-
return {
|
|
13475
|
-
result: false,
|
|
13476
|
-
reason: SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED
|
|
13477
|
-
};
|
|
13478
|
-
}
|
|
13479
|
-
var pairMinRaw = (_response$data$minamo = response.data.minamount) != null ? _response$data$minamo : null;
|
|
13480
|
-
var pairMaxRaw = (_response$data$maxamo = response.data.maxamount) != null ? _response$data$maxamo : null;
|
|
13481
|
-
var pairMin = pairMinRaw ? AmountUtils.trim(pairMinRaw, fromCoin.digits) : null;
|
|
13482
|
-
var pairMax = pairMaxRaw ? AmountUtils.trim(pairMaxRaw, fromCoin.digits) : null;
|
|
13483
|
-
if (pairMin && BigNumber__default["default"](amountCoins).lt(pairMin)) {
|
|
13484
|
-
return {
|
|
13485
|
-
result: false,
|
|
13486
|
-
reason: SwapProvider.NO_SWAPS_REASONS.TOO_LOW,
|
|
13487
|
-
smallestMin: pairMin
|
|
13488
|
-
};
|
|
13489
|
-
}
|
|
13490
|
-
if (pairMax && BigNumber__default["default"](amountCoins).gt(pairMax)) {
|
|
13491
|
-
return {
|
|
13492
|
-
result: false,
|
|
13493
|
-
reason: SwapProvider.NO_SWAPS_REASONS.TOO_HIGH,
|
|
13494
|
-
greatestMax: pairMax
|
|
13495
|
-
};
|
|
13496
|
-
}
|
|
13497
|
-
|
|
13498
|
-
/* --------------------------------------------------------
|
|
13499
|
-
* Convert amountTo → ratio so that downstream code can do
|
|
13500
|
-
* amountFrom * rate === amountTo
|
|
13501
|
-
* -------------------------------------------------------- */
|
|
13502
|
-
var rateRatio = null;
|
|
13503
|
-
if (response.data.rate != null && BigNumber__default["default"](amountCoins).gt(0)) {
|
|
13504
|
-
rateRatio = AmountUtils.trim(BigNumber__default["default"](response.data.rate).div(amountCoins).toString(), _this4._maxRateDigits);
|
|
13505
|
-
}
|
|
13438
|
+
var pairMinRaw = (_response$data$minamo = response.data.minamount) != null ? _response$data$minamo : null;
|
|
13439
|
+
var pairMaxRaw = (_response$data$maxamo = response.data.maxamount) != null ? _response$data$maxamo : null;
|
|
13440
|
+
var pairMin = pairMinRaw ? AmountUtils.trim(pairMinRaw, fromCoin.digits) : null;
|
|
13441
|
+
var pairMax = pairMaxRaw ? AmountUtils.trim(pairMaxRaw, fromCoin.digits) : null;
|
|
13442
|
+
if (pairMin && BigNumber__default["default"](amountCoins).lt(pairMin)) {
|
|
13506
13443
|
return {
|
|
13507
|
-
result:
|
|
13508
|
-
|
|
13509
|
-
|
|
13510
|
-
smallestMin: pairMin,
|
|
13511
|
-
greatestMax: pairMax,
|
|
13512
|
-
rate: rateRatio,
|
|
13513
|
-
durationMinutesRange: null,
|
|
13514
|
-
fixed: !!response.data.fix,
|
|
13515
|
-
rawSwapData: response.data,
|
|
13516
|
-
/**
|
|
13517
|
-
* GoExme never requires a refund address.
|
|
13518
|
-
*
|
|
13519
|
-
* The official API documentation marks `destinationTag` / `refundTag` as **optional**.
|
|
13520
|
-
* Support chat confirmation (2025‑06‑27): "Yes, it's optional and can be omitted even for small amounts."
|
|
13521
|
-
*
|
|
13522
|
-
*/
|
|
13523
|
-
isRefundAddressRequired: false
|
|
13444
|
+
result: false,
|
|
13445
|
+
reason: SwapProvider.NO_SWAPS_REASONS.TOO_LOW,
|
|
13446
|
+
smallestMin: pairMin
|
|
13524
13447
|
};
|
|
13525
|
-
}
|
|
13448
|
+
}
|
|
13449
|
+
if (pairMax && BigNumber__default["default"](amountCoins).gt(pairMax)) {
|
|
13450
|
+
return {
|
|
13451
|
+
result: false,
|
|
13452
|
+
reason: SwapProvider.NO_SWAPS_REASONS.TOO_HIGH,
|
|
13453
|
+
greatestMax: pairMax
|
|
13454
|
+
};
|
|
13455
|
+
}
|
|
13456
|
+
if (response.data.rate == null || BigNumber__default["default"](response.data.rate).isNaN() || BigNumber__default["default"](response.data.rate).lte(0)) {
|
|
13457
|
+
return {
|
|
13458
|
+
result: false,
|
|
13459
|
+
reason: SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED
|
|
13460
|
+
};
|
|
13461
|
+
}
|
|
13462
|
+
|
|
13463
|
+
// Convert amountTo → ratio so that downstream code can do amountFrom * rate === amountTo
|
|
13464
|
+
var rateRatio = null;
|
|
13465
|
+
if (response.data.rate != null && BigNumber__default["default"](amountCoins).gt(0)) {
|
|
13466
|
+
rateRatio = AmountUtils.trim(BigNumber__default["default"](response.data.rate).div(amountCoins).toString(), _this3._maxRateDigits);
|
|
13467
|
+
}
|
|
13468
|
+
return {
|
|
13469
|
+
result: true,
|
|
13470
|
+
min: pairMin,
|
|
13471
|
+
max: pairMax,
|
|
13472
|
+
smallestMin: pairMin,
|
|
13473
|
+
greatestMax: pairMax,
|
|
13474
|
+
rate: rateRatio,
|
|
13475
|
+
durationMinutesRange: null,
|
|
13476
|
+
fixed: !!response.data.fix,
|
|
13477
|
+
rawSwapData: response.data,
|
|
13478
|
+
/**
|
|
13479
|
+
* GoExme never requires a refund address.
|
|
13480
|
+
*/
|
|
13481
|
+
isRefundAddressRequired: false
|
|
13482
|
+
};
|
|
13526
13483
|
});
|
|
13527
13484
|
});
|
|
13528
13485
|
}, function (e) {
|
|
@@ -13541,23 +13498,28 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13541
13498
|
/**
|
|
13542
13499
|
* Creates a swap on GoExme.
|
|
13543
13500
|
*
|
|
13544
|
-
*
|
|
13545
|
-
* `
|
|
13546
|
-
*
|
|
13547
|
-
* •
|
|
13501
|
+
* The `proprietarySwapEstimationData` object **must** carry two distinct values
|
|
13502
|
+
* produced by a prior `/rate` call:
|
|
13503
|
+
*
|
|
13504
|
+
* • `rawSwapData.rate` – **amountTo**
|
|
13505
|
+
* (the exact number of coins GoExme will send to the user);
|
|
13506
|
+
* • `rate` – **ratio**
|
|
13507
|
+
* (`amountTo / amountFrom`, i.e. Rabbit‑style per‑coin rate).
|
|
13508
|
+
*
|
|
13509
|
+
* Processing steps
|
|
13510
|
+
* ----------------
|
|
13511
|
+
* 1. Determine **amountTo** (`rawSwapData.rate`).
|
|
13512
|
+
* 2. Compute the canonical per‑coin **ratio**:
|
|
13548
13513
|
*
|
|
13549
|
-
*
|
|
13550
|
-
* estimation as amountTo, then derive the ratio ourselves.
|
|
13514
|
+
* ratio = amountTo / amountFrom
|
|
13551
13515
|
*
|
|
13552
|
-
*
|
|
13553
|
-
*
|
|
13554
|
-
*
|
|
13555
|
-
*
|
|
13556
|
-
*
|
|
13557
|
-
*
|
|
13558
|
-
*
|
|
13559
|
-
* → both mandatory fields (`rate`, `withdrawal.amount`)
|
|
13560
|
-
* are always present, avoiding schema validation errors.
|
|
13516
|
+
* 3. Return both numbers for downstream code:
|
|
13517
|
+
* • `rate` → ratio (Rabbit convention);
|
|
13518
|
+
* • `toAmount` → amountTo (final coins the user receives).
|
|
13519
|
+
*
|
|
13520
|
+
* This guarantees the invariant:
|
|
13521
|
+
*
|
|
13522
|
+
* amountFrom * rate === toAmount
|
|
13561
13523
|
*/
|
|
13562
13524
|
;
|
|
13563
13525
|
_proto.createSwap = function createSwap(fromCoin, toCoin, amount, toAddress, refundAddress, proprietarySwapEstimationData, clientIpAddress, fixed, toCurrencyExtraId, refundExtraId, amountIsToReceive) {
|
|
@@ -13571,19 +13533,19 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13571
13533
|
amountIsToReceive = false;
|
|
13572
13534
|
}
|
|
13573
13535
|
try {
|
|
13574
|
-
var
|
|
13536
|
+
var _this4 = this;
|
|
13575
13537
|
var loggerSource = "Goexme.createSwap";
|
|
13576
13538
|
return Promise.resolve(_catch$2(function () {
|
|
13577
13539
|
if (amountIsToReceive) throw new Error("amountIsToReceive is not supported by GoExme");
|
|
13578
|
-
return Promise.resolve(
|
|
13579
|
-
var fromCoinInfo =
|
|
13580
|
-
var toCoinInfo =
|
|
13581
|
-
if (!fromCoinInfo || !toCoinInfo
|
|
13540
|
+
return Promise.resolve(_this4._fetchSupportedCurrenciesIfNeeded()).then(function () {
|
|
13541
|
+
var fromCoinInfo = _this4._findInfoByTicker(fromCoin.ticker);
|
|
13542
|
+
var toCoinInfo = _this4._findInfoByTicker(toCoin.ticker);
|
|
13543
|
+
if (!fromCoinInfo || !toCoinInfo) {
|
|
13582
13544
|
throw new Error("Unsupported pair " + fromCoin.ticker + " -> " + toCoin.ticker);
|
|
13583
13545
|
}
|
|
13584
|
-
|
|
13546
|
+
_this4._validateCreateSwapParams(fromCoin, toCoin, amount, toAddress, refundAddress, fixed, toCurrencyExtraId, refundExtraId, amountIsToReceive, fromCoinInfo, toCoinInfo);
|
|
13585
13547
|
var params = _extends({
|
|
13586
|
-
key:
|
|
13548
|
+
key: _this4._apiKey,
|
|
13587
13549
|
from: fromCoinInfo.code,
|
|
13588
13550
|
to: toCoinInfo.code,
|
|
13589
13551
|
destinationAddress: toAddress
|
|
@@ -13591,34 +13553,32 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13591
13553
|
fix: true
|
|
13592
13554
|
} : {});
|
|
13593
13555
|
params.amount = amount;
|
|
13556
|
+
|
|
13557
|
+
// Add refundAddress only if extraId is present:
|
|
13558
|
+
// GoExme documents these fields as optional, and support (2025‑06‑27) confirmed that.
|
|
13559
|
+
// Extract amountTo from estimation (first non-null source).
|
|
13560
|
+
// Derive ratio so that amountFrom * ratio = amountTo.
|
|
13594
13561
|
if (toCoinInfo.hasExtraId && toCurrencyExtraId) params.destinationTag = toCurrencyExtraId;
|
|
13595
13562
|
if (refundAddress) {
|
|
13596
13563
|
params.refundAddress = refundAddress;
|
|
13597
13564
|
if (fromCoinInfo.hasExtraId && refundExtraId) params.refundTag = refundExtraId;
|
|
13598
13565
|
}
|
|
13599
|
-
return Promise.resolve(axios__default["default"].get(
|
|
13566
|
+
return Promise.resolve(axios__default["default"].get(_this4._URL + "/exchange-create", _extends({}, _this4.axiosPreset, createRobustTimeoutSetupForAxios(), {
|
|
13600
13567
|
params: params
|
|
13601
13568
|
}))).then(function (response) {
|
|
13602
|
-
var
|
|
13569
|
+
var _ref3, _proprietarySwapEstim, _proprietarySwapEstim2, _data$depositTag;
|
|
13603
13570
|
var data = response.data;
|
|
13604
13571
|
if ((data == null ? void 0 : data.result) !== true || !(data != null && data.id) || !(data != null && data.depositAddress)) {
|
|
13605
13572
|
var errMsg = "Goexme createSwap failed: " + safeStringify(data != null ? data : {});
|
|
13606
13573
|
Logger.log(errMsg, loggerSource);
|
|
13607
13574
|
throw new Error(errMsg);
|
|
13608
13575
|
}
|
|
13609
|
-
|
|
13610
|
-
/*------------------------------------------------------------
|
|
13611
|
-
* Extract amountTo from estimation (first non-null source).
|
|
13612
|
-
*-----------------------------------------------------------*/
|
|
13613
|
-
/*------------------------------------------------------------
|
|
13614
|
-
* Derive ratio so that amountFrom * ratio = amountTo.
|
|
13615
|
-
*-----------------------------------------------------------*/
|
|
13616
|
-
var amountToCandidate = (_ref4 = (_proprietarySwapEstim = proprietarySwapEstimationData == null || (_proprietarySwapEstim2 = proprietarySwapEstimationData.rawSwapData) == null ? void 0 : _proprietarySwapEstim2.rate) != null ? _proprietarySwapEstim : proprietarySwapEstimationData == null ? void 0 : proprietarySwapEstimationData.rate) != null ? _ref4 : null;
|
|
13576
|
+
var amountToCandidate = (_ref3 = (_proprietarySwapEstim = proprietarySwapEstimationData == null || (_proprietarySwapEstim2 = proprietarySwapEstimationData.rawSwapData) == null ? void 0 : _proprietarySwapEstim2.rate) != null ? _proprietarySwapEstim : proprietarySwapEstimationData == null ? void 0 : proprietarySwapEstimationData.rate) != null ? _ref3 : null;
|
|
13617
13577
|
if (amountToCandidate == null) {
|
|
13618
13578
|
throw new Error("Estimation does not contain amountTo/rate");
|
|
13619
13579
|
}
|
|
13620
13580
|
var toAmountCalculated = AmountUtils.trim(amountToCandidate, toCoin.digits);
|
|
13621
|
-
var rateRatio = AmountUtils.trim(BigNumber__default["default"](toAmountCalculated).div(amount).toString(),
|
|
13581
|
+
var rateRatio = AmountUtils.trim(BigNumber__default["default"](toAmountCalculated).div(amount).toString(), _this4._maxRateDigits);
|
|
13622
13582
|
return {
|
|
13623
13583
|
result: true,
|
|
13624
13584
|
swapId: data.id,
|
|
@@ -13655,7 +13615,7 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13655
13615
|
};
|
|
13656
13616
|
_proto.getExistingSwapsDetailsAndStatus = function getExistingSwapsDetailsAndStatus(swapIds) {
|
|
13657
13617
|
try {
|
|
13658
|
-
var
|
|
13618
|
+
var _this5 = this;
|
|
13659
13619
|
var loggerSource = "Goexme.getExistingSwapsDetailsAndStatus";
|
|
13660
13620
|
return Promise.resolve(_catch$2(function () {
|
|
13661
13621
|
if (swapIds.some(function (id) {
|
|
@@ -13663,9 +13623,9 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13663
13623
|
})) throw new Error("swapIds must be strings");
|
|
13664
13624
|
var fetchOne = function fetchOne(id) {
|
|
13665
13625
|
try {
|
|
13666
|
-
return Promise.resolve(axios__default["default"].get(
|
|
13626
|
+
return Promise.resolve(axios__default["default"].get(_this5._URL + "/exchange-status", _extends({}, _this5.axiosPreset, createRobustTimeoutSetupForAxios(), {
|
|
13667
13627
|
params: {
|
|
13668
|
-
key:
|
|
13628
|
+
key: _this5._apiKey,
|
|
13669
13629
|
id: id
|
|
13670
13630
|
}
|
|
13671
13631
|
}))).then(function (response) {
|
|
@@ -13676,59 +13636,50 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13676
13636
|
}
|
|
13677
13637
|
};
|
|
13678
13638
|
return Promise.resolve(Promise.all(swapIds.map(fetchOne))).then(function (statusResponses) {
|
|
13679
|
-
|
|
13639
|
+
// helper: normalize coin code using CODE_TRANSLATIONS
|
|
13680
13640
|
var normalize = function normalize(code) {
|
|
13681
13641
|
var _CODE_TRANSLATIONS$co2;
|
|
13682
13642
|
return (_CODE_TRANSLATIONS$co2 = CODE_TRANSLATIONS[code.toUpperCase()]) != null ? _CODE_TRANSLATIONS$co2 : code.toUpperCase();
|
|
13683
13643
|
};
|
|
13684
13644
|
var swaps = statusResponses.map(function (statusData, swapIndex) {
|
|
13685
|
-
var
|
|
13645
|
+
var _ref4, _statusData$amountFro, _ref5, _statusData$amountTo, _statusData$refundAdd;
|
|
13686
13646
|
if (!statusData) return null;
|
|
13687
|
-
|
|
13688
|
-
/* ------------------ coins ------------------ */
|
|
13689
13647
|
var fromCoinTicker = toRabbitTicker(normalize(statusData.from), "");
|
|
13690
13648
|
var toCoinTicker = toRabbitTicker(normalize(statusData.to), "");
|
|
13691
|
-
var fromCoin =
|
|
13692
|
-
var toCoin =
|
|
13693
|
-
|
|
13694
|
-
/* fallback: look up by raw provider code if ticker lookup failed */
|
|
13649
|
+
var fromCoin = _this5.getCoinByTickerIfPresent(fromCoinTicker);
|
|
13650
|
+
var toCoin = _this5.getCoinByTickerIfPresent(toCoinTicker);
|
|
13695
13651
|
if (!fromCoin) {
|
|
13696
13652
|
var _byCode$coin;
|
|
13697
|
-
var byCode =
|
|
13653
|
+
var byCode = _this5._supportedCoins.find(function (c) {
|
|
13698
13654
|
return c.code === statusData.from;
|
|
13699
13655
|
});
|
|
13700
13656
|
fromCoin = (_byCode$coin = byCode == null ? void 0 : byCode.coin) != null ? _byCode$coin : null;
|
|
13701
13657
|
}
|
|
13702
|
-
/* fallback: look up by raw provider code if ticker lookup failed */
|
|
13703
13658
|
if (!toCoin) {
|
|
13704
13659
|
var _byCode$coin2;
|
|
13705
|
-
var _byCode =
|
|
13660
|
+
var _byCode = _this5._supportedCoins.find(function (c) {
|
|
13706
13661
|
return c.code === statusData.to;
|
|
13707
13662
|
});
|
|
13708
13663
|
toCoin = (_byCode$coin2 = _byCode == null ? void 0 : _byCode.coin) != null ? _byCode$coin2 : null;
|
|
13709
13664
|
}
|
|
13710
13665
|
if (!fromCoin || !toCoin) return null;
|
|
13711
|
-
|
|
13712
|
-
/* timestamps */
|
|
13713
13666
|
var createdAt = GoexmeSwapProvider._parseGoexmeDate(statusData.date);
|
|
13714
|
-
var expiresAt = createdAt +
|
|
13715
|
-
|
|
13716
|
-
|
|
13717
|
-
var amountFromEffective = (_ref5 = (_statusData$amountFro = statusData.amountFrom) != null ? _statusData$amountFro : statusData.expectedAmountFrom) != null ? _ref5 : "0";
|
|
13718
|
-
var amountToEffective = (_ref6 = (_statusData$amountTo = statusData.amountTo) != null ? _statusData$amountTo : statusData.expectedAmountTo) != null ? _ref6 : null;
|
|
13667
|
+
var expiresAt = createdAt + _this5.SWAP_EXPIRATION_TIME_MS;
|
|
13668
|
+
var amountFromEffective = (_ref4 = (_statusData$amountFro = statusData.amountFrom) != null ? _statusData$amountFro : statusData.expectedAmountFrom) != null ? _ref4 : "0";
|
|
13669
|
+
var amountToEffective = (_ref5 = (_statusData$amountTo = statusData.amountTo) != null ? _statusData$amountTo : statusData.expectedAmountTo) != null ? _ref5 : null;
|
|
13719
13670
|
var rateVal = statusData.rate;
|
|
13720
13671
|
if (rateVal == null && amountFromEffective && amountToEffective) {
|
|
13721
13672
|
rateVal = BigNumber__default["default"](amountToEffective).div(amountFromEffective).toString();
|
|
13722
13673
|
}
|
|
13723
13674
|
if (rateVal == null) rateVal = "0";
|
|
13724
|
-
var rateTrimmed = AmountUtils.trim(rateVal,
|
|
13675
|
+
var rateTrimmed = AmountUtils.trim(rateVal, _this5._maxRateDigits);
|
|
13725
13676
|
var toAmountCalculated = amountToEffective;
|
|
13726
13677
|
if (toAmountCalculated == null && rateVal && amountFromEffective) {
|
|
13727
13678
|
toAmountCalculated = BigNumber__default["default"](amountFromEffective).times(rateVal).toString();
|
|
13728
13679
|
}
|
|
13729
13680
|
if (toAmountCalculated == null) toAmountCalculated = "0";
|
|
13730
13681
|
var toAmountTrimmed = AmountUtils.trim(toAmountCalculated, toCoin.digits);
|
|
13731
|
-
return new ExistingSwap(swapIds[swapIndex],
|
|
13682
|
+
return new ExistingSwap(swapIds[swapIndex], _this5._mapGoexmeStatus(statusData.status), createdAt, expiresAt, -1, rateTrimmed, null, (_statusData$refundAdd = statusData.refundAddress) != null ? _statusData$refundAdd : "", statusData.depositAddress, fromCoin, AmountUtils.trim(amountFromEffective, fromCoin.digits), statusData.depositHash, null, toCoin, toAmountTrimmed, statusData.txId, null, statusData.destinationAddress, _this5.id, statusData.depositTag || null, statusData.destinationTag || null, statusData.refundTag || null);
|
|
13732
13683
|
}).filter(Boolean);
|
|
13733
13684
|
return {
|
|
13734
13685
|
result: true,
|
|
@@ -13749,8 +13700,8 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13749
13700
|
};
|
|
13750
13701
|
_proto.getPartnersList = function getPartnersList() {
|
|
13751
13702
|
try {
|
|
13752
|
-
var
|
|
13753
|
-
return Promise.resolve([new Partner(
|
|
13703
|
+
var _this6 = this;
|
|
13704
|
+
return Promise.resolve([new Partner(_this6.id, "GoExme", "https://storage.swapspace.co/static/c9c19112c41a4caebf08196766eaead480e33bce2d4201c572a39c1800cb95e2.svg", KYC_LEVELS.LOW)]);
|
|
13754
13705
|
} catch (e) {
|
|
13755
13706
|
return Promise.reject(e);
|
|
13756
13707
|
}
|