@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.module.js
CHANGED
|
@@ -10660,7 +10660,7 @@ var ExistingSwap = /** @type {string} The ID of the swap. */
|
|
|
10660
10660
|
* @param {number} expiresAt - The timestamp when the swap expires.
|
|
10661
10661
|
* @param {number|null} confirmations - The number of confirmations the swap has received, or null.
|
|
10662
10662
|
* @param {string} rate - The exchange rate for the swap.
|
|
10663
|
-
* @param {
|
|
10663
|
+
* @param {boolean} fixed - Indicates if the rate is fixed.
|
|
10664
10664
|
* @param {string|null} refundAddress - The address to refund to in case of failure, or null.
|
|
10665
10665
|
* @param {string} payToAddress - The address to send the funds to.
|
|
10666
10666
|
* @param {Coin} fromCoin - The coin that is being swapped from.
|
|
@@ -13265,23 +13265,13 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13265
13265
|
}
|
|
13266
13266
|
};
|
|
13267
13267
|
_this.COINS_EXPIRATION_TIME_MS = 5 * 60 * 1000;
|
|
13268
|
-
_this.PAIRS_EXPIRATION_TIME_MS = 5 * 60 * 1000;
|
|
13269
13268
|
_this.SWAP_EXPIRATION_TIME_MS = 4 * 60 * 60 * 1000;
|
|
13270
|
-
_this._pairsCache = null;
|
|
13271
|
-
_this._pairsCacheTimestamp = 0;
|
|
13272
13269
|
return _this;
|
|
13273
13270
|
}
|
|
13274
13271
|
var _proto = GoexmeSwapProvider.prototype;
|
|
13275
13272
|
_proto.getSwapCreationInfoTtlMs = function getSwapCreationInfoTtlMs() {
|
|
13276
13273
|
return 30000;
|
|
13277
13274
|
};
|
|
13278
|
-
_proto._isPairSupported = function _isPairSupported(fromInfo, toInfo) {
|
|
13279
|
-
if (!this._pairsCache || !this._pairsCache[fromInfo.code]) return false;
|
|
13280
|
-
var toSet = this._pairsCache[fromInfo.code];
|
|
13281
|
-
/* GoExme may list either the raw provider code **or**
|
|
13282
|
-
* the “pretty” Rabbit ticker in `/pairs`, so we test both. */
|
|
13283
|
-
return toSet.has(toInfo.code) || toSet.has(toInfo.coin.ticker);
|
|
13284
|
-
};
|
|
13285
13275
|
_proto._findInfoByTicker = function _findInfoByTicker(ticker) {
|
|
13286
13276
|
return this._supportedCoins.find(function (i) {
|
|
13287
13277
|
return i.coin.ticker === ticker;
|
|
@@ -13346,36 +13336,6 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13346
13336
|
// extraIdName (only if needed)
|
|
13347
13337
|
0, FALLBACK_ASSET_ICON_URL, true, true, null, true);
|
|
13348
13338
|
};
|
|
13349
|
-
_proto._ensurePairsLoaded = function _ensurePairsLoaded() {
|
|
13350
|
-
try {
|
|
13351
|
-
var _this3 = this;
|
|
13352
|
-
var loggerSource = "Goexme._ensurePairsLoaded";
|
|
13353
|
-
return Promise.resolve(_catch$2(function () {
|
|
13354
|
-
if (_this3._pairsCache && Date.now() - _this3._pairsCacheTimestamp < _this3.PAIRS_EXPIRATION_TIME_MS) return;
|
|
13355
|
-
return Promise.resolve(axios.get(_this3._URL + "/pairs", _extends({}, _this3.axiosPreset, createRobustTimeoutSetupForAxios(), {
|
|
13356
|
-
params: {
|
|
13357
|
-
key: _this3._apiKey
|
|
13358
|
-
}
|
|
13359
|
-
}))).then(function (response) {
|
|
13360
|
-
if (response.status !== 200 || typeof response.data !== "object") {
|
|
13361
|
-
throw new Error("Failed to load /pairs");
|
|
13362
|
-
}
|
|
13363
|
-
_this3._pairsCache = Object.fromEntries(Object.entries(response.data).map(function (_ref3) {
|
|
13364
|
-
var from = _ref3[0],
|
|
13365
|
-
arr = _ref3[1];
|
|
13366
|
-
return [from.toUpperCase(), new Set(arr.map(function (v) {
|
|
13367
|
-
return v.toUpperCase();
|
|
13368
|
-
}))];
|
|
13369
|
-
}));
|
|
13370
|
-
_this3._pairsCacheTimestamp = Date.now();
|
|
13371
|
-
});
|
|
13372
|
-
}, function (e) {
|
|
13373
|
-
improveAndRethrow(e, loggerSource);
|
|
13374
|
-
}));
|
|
13375
|
-
} catch (e) {
|
|
13376
|
-
return Promise.reject(e);
|
|
13377
|
-
}
|
|
13378
|
-
};
|
|
13379
13339
|
_proto._mapGoexmeStatus = function _mapGoexmeStatus(status) {
|
|
13380
13340
|
switch (status) {
|
|
13381
13341
|
case "new":
|
|
@@ -13428,87 +13388,84 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13428
13388
|
amountIsToReceive = false;
|
|
13429
13389
|
}
|
|
13430
13390
|
try {
|
|
13431
|
-
var
|
|
13391
|
+
var _this3 = this;
|
|
13432
13392
|
var loggerSource = "Goexme.getSwapInfo";
|
|
13433
13393
|
return Promise.resolve(_catch$2(function () {
|
|
13434
13394
|
if (amountIsToReceive) throw new Error("amountIsToReceive is not supported by GoExme");
|
|
13435
13395
|
if (!(fromCoin instanceof Coin) || !(toCoin instanceof Coin) || BigNumber$1(amountCoins).lte(0)) throw new Error("Invalid params for getSwapInfo");
|
|
13436
|
-
return Promise.resolve(
|
|
13437
|
-
|
|
13438
|
-
|
|
13439
|
-
|
|
13440
|
-
|
|
13396
|
+
return Promise.resolve(_this3._fetchSupportedCurrenciesIfNeeded()).then(function () {
|
|
13397
|
+
var fromCoinInfo = _this3._findInfoByTicker(fromCoin.ticker);
|
|
13398
|
+
var toCoinInfo = _this3._findInfoByTicker(toCoin.ticker);
|
|
13399
|
+
if (!fromCoinInfo || !toCoinInfo) {
|
|
13400
|
+
return {
|
|
13401
|
+
result: false,
|
|
13402
|
+
reason: SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED
|
|
13403
|
+
};
|
|
13404
|
+
}
|
|
13405
|
+
var params = _extends({
|
|
13406
|
+
key: _this3._apiKey,
|
|
13407
|
+
from: fromCoinInfo.code,
|
|
13408
|
+
to: toCoinInfo.code,
|
|
13409
|
+
amount: amountCoins
|
|
13410
|
+
}, fixed ? {
|
|
13411
|
+
fix: true
|
|
13412
|
+
} : {});
|
|
13413
|
+
return Promise.resolve(axios.get(_this3._URL + "/rate", _extends({}, _this3.axiosPreset, createRobustTimeoutSetupForAxios(), {
|
|
13414
|
+
params: params
|
|
13415
|
+
}))).then(function (response) {
|
|
13416
|
+
var _response$data, _response$data$minamo, _response$data$maxamo;
|
|
13417
|
+
if (response.status !== 200 || ((_response$data = response.data) == null ? void 0 : _response$data.result) !== true || !response.data) {
|
|
13418
|
+
Logger.log("Unexpected response from /rate: " + response.status + ": " + safeStringify(response.data), loggerSource);
|
|
13441
13419
|
return {
|
|
13442
13420
|
result: false,
|
|
13443
13421
|
reason: SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED
|
|
13444
13422
|
};
|
|
13445
13423
|
}
|
|
13446
|
-
var
|
|
13447
|
-
|
|
13448
|
-
|
|
13449
|
-
|
|
13450
|
-
|
|
13451
|
-
}, fixed ? {
|
|
13452
|
-
fix: true
|
|
13453
|
-
} : {});
|
|
13454
|
-
return Promise.resolve(axios.get(_this4._URL + "/rate", _extends({}, _this4.axiosPreset, createRobustTimeoutSetupForAxios(), {
|
|
13455
|
-
params: params
|
|
13456
|
-
}))).then(function (response) {
|
|
13457
|
-
var _response$data, _response$data$minamo, _response$data$maxamo;
|
|
13458
|
-
if (response.status !== 200 || ((_response$data = response.data) == null ? void 0 : _response$data.result) !== true || !response.data) {
|
|
13459
|
-
Logger.log("Unexpected response from /rate: " + response.status + ": " + safeStringify(response.data), loggerSource);
|
|
13460
|
-
return {
|
|
13461
|
-
result: false,
|
|
13462
|
-
reason: SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED
|
|
13463
|
-
};
|
|
13464
|
-
}
|
|
13465
|
-
var pairMinRaw = (_response$data$minamo = response.data.minamount) != null ? _response$data$minamo : null;
|
|
13466
|
-
var pairMaxRaw = (_response$data$maxamo = response.data.maxamount) != null ? _response$data$maxamo : null;
|
|
13467
|
-
var pairMin = pairMinRaw ? AmountUtils.trim(pairMinRaw, fromCoin.digits) : null;
|
|
13468
|
-
var pairMax = pairMaxRaw ? AmountUtils.trim(pairMaxRaw, fromCoin.digits) : null;
|
|
13469
|
-
if (pairMin && BigNumber$1(amountCoins).lt(pairMin)) {
|
|
13470
|
-
return {
|
|
13471
|
-
result: false,
|
|
13472
|
-
reason: SwapProvider.NO_SWAPS_REASONS.TOO_LOW,
|
|
13473
|
-
smallestMin: pairMin
|
|
13474
|
-
};
|
|
13475
|
-
}
|
|
13476
|
-
if (pairMax && BigNumber$1(amountCoins).gt(pairMax)) {
|
|
13477
|
-
return {
|
|
13478
|
-
result: false,
|
|
13479
|
-
reason: SwapProvider.NO_SWAPS_REASONS.TOO_HIGH,
|
|
13480
|
-
greatestMax: pairMax
|
|
13481
|
-
};
|
|
13482
|
-
}
|
|
13483
|
-
|
|
13484
|
-
/* --------------------------------------------------------
|
|
13485
|
-
* Convert amountTo → ratio so that downstream code can do
|
|
13486
|
-
* amountFrom * rate === amountTo
|
|
13487
|
-
* -------------------------------------------------------- */
|
|
13488
|
-
var rateRatio = null;
|
|
13489
|
-
if (response.data.rate != null && BigNumber$1(amountCoins).gt(0)) {
|
|
13490
|
-
rateRatio = AmountUtils.trim(BigNumber$1(response.data.rate).div(amountCoins).toString(), _this4._maxRateDigits);
|
|
13491
|
-
}
|
|
13424
|
+
var pairMinRaw = (_response$data$minamo = response.data.minamount) != null ? _response$data$minamo : null;
|
|
13425
|
+
var pairMaxRaw = (_response$data$maxamo = response.data.maxamount) != null ? _response$data$maxamo : null;
|
|
13426
|
+
var pairMin = pairMinRaw ? AmountUtils.trim(pairMinRaw, fromCoin.digits) : null;
|
|
13427
|
+
var pairMax = pairMaxRaw ? AmountUtils.trim(pairMaxRaw, fromCoin.digits) : null;
|
|
13428
|
+
if (pairMin && BigNumber$1(amountCoins).lt(pairMin)) {
|
|
13492
13429
|
return {
|
|
13493
|
-
result:
|
|
13494
|
-
|
|
13495
|
-
|
|
13496
|
-
smallestMin: pairMin,
|
|
13497
|
-
greatestMax: pairMax,
|
|
13498
|
-
rate: rateRatio,
|
|
13499
|
-
durationMinutesRange: null,
|
|
13500
|
-
fixed: !!response.data.fix,
|
|
13501
|
-
rawSwapData: response.data,
|
|
13502
|
-
/**
|
|
13503
|
-
* GoExme never requires a refund address.
|
|
13504
|
-
*
|
|
13505
|
-
* The official API documentation marks `destinationTag` / `refundTag` as **optional**.
|
|
13506
|
-
* Support chat confirmation (2025‑06‑27): "Yes, it's optional and can be omitted even for small amounts."
|
|
13507
|
-
*
|
|
13508
|
-
*/
|
|
13509
|
-
isRefundAddressRequired: false
|
|
13430
|
+
result: false,
|
|
13431
|
+
reason: SwapProvider.NO_SWAPS_REASONS.TOO_LOW,
|
|
13432
|
+
smallestMin: pairMin
|
|
13510
13433
|
};
|
|
13511
|
-
}
|
|
13434
|
+
}
|
|
13435
|
+
if (pairMax && BigNumber$1(amountCoins).gt(pairMax)) {
|
|
13436
|
+
return {
|
|
13437
|
+
result: false,
|
|
13438
|
+
reason: SwapProvider.NO_SWAPS_REASONS.TOO_HIGH,
|
|
13439
|
+
greatestMax: pairMax
|
|
13440
|
+
};
|
|
13441
|
+
}
|
|
13442
|
+
if (response.data.rate == null || BigNumber$1(response.data.rate).isNaN() || BigNumber$1(response.data.rate).lte(0)) {
|
|
13443
|
+
return {
|
|
13444
|
+
result: false,
|
|
13445
|
+
reason: SwapProvider.NO_SWAPS_REASONS.NOT_SUPPORTED
|
|
13446
|
+
};
|
|
13447
|
+
}
|
|
13448
|
+
|
|
13449
|
+
// Convert amountTo → ratio so that downstream code can do amountFrom * rate === amountTo
|
|
13450
|
+
var rateRatio = null;
|
|
13451
|
+
if (response.data.rate != null && BigNumber$1(amountCoins).gt(0)) {
|
|
13452
|
+
rateRatio = AmountUtils.trim(BigNumber$1(response.data.rate).div(amountCoins).toString(), _this3._maxRateDigits);
|
|
13453
|
+
}
|
|
13454
|
+
return {
|
|
13455
|
+
result: true,
|
|
13456
|
+
min: pairMin,
|
|
13457
|
+
max: pairMax,
|
|
13458
|
+
smallestMin: pairMin,
|
|
13459
|
+
greatestMax: pairMax,
|
|
13460
|
+
rate: rateRatio,
|
|
13461
|
+
durationMinutesRange: null,
|
|
13462
|
+
fixed: !!response.data.fix,
|
|
13463
|
+
rawSwapData: response.data,
|
|
13464
|
+
/**
|
|
13465
|
+
* GoExme never requires a refund address.
|
|
13466
|
+
*/
|
|
13467
|
+
isRefundAddressRequired: false
|
|
13468
|
+
};
|
|
13512
13469
|
});
|
|
13513
13470
|
});
|
|
13514
13471
|
}, function (e) {
|
|
@@ -13527,23 +13484,28 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13527
13484
|
/**
|
|
13528
13485
|
* Creates a swap on GoExme.
|
|
13529
13486
|
*
|
|
13530
|
-
*
|
|
13531
|
-
* `
|
|
13532
|
-
*
|
|
13533
|
-
* •
|
|
13487
|
+
* The `proprietarySwapEstimationData` object **must** carry two distinct values
|
|
13488
|
+
* produced by a prior `/rate` call:
|
|
13489
|
+
*
|
|
13490
|
+
* • `rawSwapData.rate` – **amountTo**
|
|
13491
|
+
* (the exact number of coins GoExme will send to the user);
|
|
13492
|
+
* • `rate` – **ratio**
|
|
13493
|
+
* (`amountTo / amountFrom`, i.e. Rabbit‑style per‑coin rate).
|
|
13494
|
+
*
|
|
13495
|
+
* Processing steps
|
|
13496
|
+
* ----------------
|
|
13497
|
+
* 1. Determine **amountTo** (`rawSwapData.rate`).
|
|
13498
|
+
* 2. Compute the canonical per‑coin **ratio**:
|
|
13534
13499
|
*
|
|
13535
|
-
*
|
|
13536
|
-
* estimation as amountTo, then derive the ratio ourselves.
|
|
13500
|
+
* ratio = amountTo / amountFrom
|
|
13537
13501
|
*
|
|
13538
|
-
*
|
|
13539
|
-
*
|
|
13540
|
-
*
|
|
13541
|
-
*
|
|
13542
|
-
*
|
|
13543
|
-
*
|
|
13544
|
-
*
|
|
13545
|
-
* → both mandatory fields (`rate`, `withdrawal.amount`)
|
|
13546
|
-
* are always present, avoiding schema validation errors.
|
|
13502
|
+
* 3. Return both numbers for downstream code:
|
|
13503
|
+
* • `rate` → ratio (Rabbit convention);
|
|
13504
|
+
* • `toAmount` → amountTo (final coins the user receives).
|
|
13505
|
+
*
|
|
13506
|
+
* This guarantees the invariant:
|
|
13507
|
+
*
|
|
13508
|
+
* amountFrom * rate === toAmount
|
|
13547
13509
|
*/
|
|
13548
13510
|
;
|
|
13549
13511
|
_proto.createSwap = function createSwap(fromCoin, toCoin, amount, toAddress, refundAddress, proprietarySwapEstimationData, clientIpAddress, fixed, toCurrencyExtraId, refundExtraId, amountIsToReceive) {
|
|
@@ -13557,19 +13519,19 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13557
13519
|
amountIsToReceive = false;
|
|
13558
13520
|
}
|
|
13559
13521
|
try {
|
|
13560
|
-
var
|
|
13522
|
+
var _this4 = this;
|
|
13561
13523
|
var loggerSource = "Goexme.createSwap";
|
|
13562
13524
|
return Promise.resolve(_catch$2(function () {
|
|
13563
13525
|
if (amountIsToReceive) throw new Error("amountIsToReceive is not supported by GoExme");
|
|
13564
|
-
return Promise.resolve(
|
|
13565
|
-
var fromCoinInfo =
|
|
13566
|
-
var toCoinInfo =
|
|
13567
|
-
if (!fromCoinInfo || !toCoinInfo
|
|
13526
|
+
return Promise.resolve(_this4._fetchSupportedCurrenciesIfNeeded()).then(function () {
|
|
13527
|
+
var fromCoinInfo = _this4._findInfoByTicker(fromCoin.ticker);
|
|
13528
|
+
var toCoinInfo = _this4._findInfoByTicker(toCoin.ticker);
|
|
13529
|
+
if (!fromCoinInfo || !toCoinInfo) {
|
|
13568
13530
|
throw new Error("Unsupported pair " + fromCoin.ticker + " -> " + toCoin.ticker);
|
|
13569
13531
|
}
|
|
13570
|
-
|
|
13532
|
+
_this4._validateCreateSwapParams(fromCoin, toCoin, amount, toAddress, refundAddress, fixed, toCurrencyExtraId, refundExtraId, amountIsToReceive, fromCoinInfo, toCoinInfo);
|
|
13571
13533
|
var params = _extends({
|
|
13572
|
-
key:
|
|
13534
|
+
key: _this4._apiKey,
|
|
13573
13535
|
from: fromCoinInfo.code,
|
|
13574
13536
|
to: toCoinInfo.code,
|
|
13575
13537
|
destinationAddress: toAddress
|
|
@@ -13577,34 +13539,32 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13577
13539
|
fix: true
|
|
13578
13540
|
} : {});
|
|
13579
13541
|
params.amount = amount;
|
|
13542
|
+
|
|
13543
|
+
// Add refundAddress only if extraId is present:
|
|
13544
|
+
// GoExme documents these fields as optional, and support (2025‑06‑27) confirmed that.
|
|
13545
|
+
// Extract amountTo from estimation (first non-null source).
|
|
13546
|
+
// Derive ratio so that amountFrom * ratio = amountTo.
|
|
13580
13547
|
if (toCoinInfo.hasExtraId && toCurrencyExtraId) params.destinationTag = toCurrencyExtraId;
|
|
13581
13548
|
if (refundAddress) {
|
|
13582
13549
|
params.refundAddress = refundAddress;
|
|
13583
13550
|
if (fromCoinInfo.hasExtraId && refundExtraId) params.refundTag = refundExtraId;
|
|
13584
13551
|
}
|
|
13585
|
-
return Promise.resolve(axios.get(
|
|
13552
|
+
return Promise.resolve(axios.get(_this4._URL + "/exchange-create", _extends({}, _this4.axiosPreset, createRobustTimeoutSetupForAxios(), {
|
|
13586
13553
|
params: params
|
|
13587
13554
|
}))).then(function (response) {
|
|
13588
|
-
var
|
|
13555
|
+
var _ref3, _proprietarySwapEstim, _proprietarySwapEstim2, _data$depositTag;
|
|
13589
13556
|
var data = response.data;
|
|
13590
13557
|
if ((data == null ? void 0 : data.result) !== true || !(data != null && data.id) || !(data != null && data.depositAddress)) {
|
|
13591
13558
|
var errMsg = "Goexme createSwap failed: " + safeStringify(data != null ? data : {});
|
|
13592
13559
|
Logger.log(errMsg, loggerSource);
|
|
13593
13560
|
throw new Error(errMsg);
|
|
13594
13561
|
}
|
|
13595
|
-
|
|
13596
|
-
/*------------------------------------------------------------
|
|
13597
|
-
* Extract amountTo from estimation (first non-null source).
|
|
13598
|
-
*-----------------------------------------------------------*/
|
|
13599
|
-
/*------------------------------------------------------------
|
|
13600
|
-
* Derive ratio so that amountFrom * ratio = amountTo.
|
|
13601
|
-
*-----------------------------------------------------------*/
|
|
13602
|
-
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;
|
|
13562
|
+
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;
|
|
13603
13563
|
if (amountToCandidate == null) {
|
|
13604
13564
|
throw new Error("Estimation does not contain amountTo/rate");
|
|
13605
13565
|
}
|
|
13606
13566
|
var toAmountCalculated = AmountUtils.trim(amountToCandidate, toCoin.digits);
|
|
13607
|
-
var rateRatio = AmountUtils.trim(BigNumber$1(toAmountCalculated).div(amount).toString(),
|
|
13567
|
+
var rateRatio = AmountUtils.trim(BigNumber$1(toAmountCalculated).div(amount).toString(), _this4._maxRateDigits);
|
|
13608
13568
|
return {
|
|
13609
13569
|
result: true,
|
|
13610
13570
|
swapId: data.id,
|
|
@@ -13641,7 +13601,7 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13641
13601
|
};
|
|
13642
13602
|
_proto.getExistingSwapsDetailsAndStatus = function getExistingSwapsDetailsAndStatus(swapIds) {
|
|
13643
13603
|
try {
|
|
13644
|
-
var
|
|
13604
|
+
var _this5 = this;
|
|
13645
13605
|
var loggerSource = "Goexme.getExistingSwapsDetailsAndStatus";
|
|
13646
13606
|
return Promise.resolve(_catch$2(function () {
|
|
13647
13607
|
if (swapIds.some(function (id) {
|
|
@@ -13649,9 +13609,9 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13649
13609
|
})) throw new Error("swapIds must be strings");
|
|
13650
13610
|
var fetchOne = function fetchOne(id) {
|
|
13651
13611
|
try {
|
|
13652
|
-
return Promise.resolve(axios.get(
|
|
13612
|
+
return Promise.resolve(axios.get(_this5._URL + "/exchange-status", _extends({}, _this5.axiosPreset, createRobustTimeoutSetupForAxios(), {
|
|
13653
13613
|
params: {
|
|
13654
|
-
key:
|
|
13614
|
+
key: _this5._apiKey,
|
|
13655
13615
|
id: id
|
|
13656
13616
|
}
|
|
13657
13617
|
}))).then(function (response) {
|
|
@@ -13662,59 +13622,50 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13662
13622
|
}
|
|
13663
13623
|
};
|
|
13664
13624
|
return Promise.resolve(Promise.all(swapIds.map(fetchOne))).then(function (statusResponses) {
|
|
13665
|
-
|
|
13625
|
+
// helper: normalize coin code using CODE_TRANSLATIONS
|
|
13666
13626
|
var normalize = function normalize(code) {
|
|
13667
13627
|
var _CODE_TRANSLATIONS$co2;
|
|
13668
13628
|
return (_CODE_TRANSLATIONS$co2 = CODE_TRANSLATIONS[code.toUpperCase()]) != null ? _CODE_TRANSLATIONS$co2 : code.toUpperCase();
|
|
13669
13629
|
};
|
|
13670
13630
|
var swaps = statusResponses.map(function (statusData, swapIndex) {
|
|
13671
|
-
var
|
|
13631
|
+
var _ref4, _statusData$amountFro, _ref5, _statusData$amountTo, _statusData$refundAdd;
|
|
13672
13632
|
if (!statusData) return null;
|
|
13673
|
-
|
|
13674
|
-
/* ------------------ coins ------------------ */
|
|
13675
13633
|
var fromCoinTicker = toRabbitTicker(normalize(statusData.from), "");
|
|
13676
13634
|
var toCoinTicker = toRabbitTicker(normalize(statusData.to), "");
|
|
13677
|
-
var fromCoin =
|
|
13678
|
-
var toCoin =
|
|
13679
|
-
|
|
13680
|
-
/* fallback: look up by raw provider code if ticker lookup failed */
|
|
13635
|
+
var fromCoin = _this5.getCoinByTickerIfPresent(fromCoinTicker);
|
|
13636
|
+
var toCoin = _this5.getCoinByTickerIfPresent(toCoinTicker);
|
|
13681
13637
|
if (!fromCoin) {
|
|
13682
13638
|
var _byCode$coin;
|
|
13683
|
-
var byCode =
|
|
13639
|
+
var byCode = _this5._supportedCoins.find(function (c) {
|
|
13684
13640
|
return c.code === statusData.from;
|
|
13685
13641
|
});
|
|
13686
13642
|
fromCoin = (_byCode$coin = byCode == null ? void 0 : byCode.coin) != null ? _byCode$coin : null;
|
|
13687
13643
|
}
|
|
13688
|
-
/* fallback: look up by raw provider code if ticker lookup failed */
|
|
13689
13644
|
if (!toCoin) {
|
|
13690
13645
|
var _byCode$coin2;
|
|
13691
|
-
var _byCode =
|
|
13646
|
+
var _byCode = _this5._supportedCoins.find(function (c) {
|
|
13692
13647
|
return c.code === statusData.to;
|
|
13693
13648
|
});
|
|
13694
13649
|
toCoin = (_byCode$coin2 = _byCode == null ? void 0 : _byCode.coin) != null ? _byCode$coin2 : null;
|
|
13695
13650
|
}
|
|
13696
13651
|
if (!fromCoin || !toCoin) return null;
|
|
13697
|
-
|
|
13698
|
-
/* timestamps */
|
|
13699
13652
|
var createdAt = GoexmeSwapProvider._parseGoexmeDate(statusData.date);
|
|
13700
|
-
var expiresAt = createdAt +
|
|
13701
|
-
|
|
13702
|
-
|
|
13703
|
-
var amountFromEffective = (_ref5 = (_statusData$amountFro = statusData.amountFrom) != null ? _statusData$amountFro : statusData.expectedAmountFrom) != null ? _ref5 : "0";
|
|
13704
|
-
var amountToEffective = (_ref6 = (_statusData$amountTo = statusData.amountTo) != null ? _statusData$amountTo : statusData.expectedAmountTo) != null ? _ref6 : null;
|
|
13653
|
+
var expiresAt = createdAt + _this5.SWAP_EXPIRATION_TIME_MS;
|
|
13654
|
+
var amountFromEffective = (_ref4 = (_statusData$amountFro = statusData.amountFrom) != null ? _statusData$amountFro : statusData.expectedAmountFrom) != null ? _ref4 : "0";
|
|
13655
|
+
var amountToEffective = (_ref5 = (_statusData$amountTo = statusData.amountTo) != null ? _statusData$amountTo : statusData.expectedAmountTo) != null ? _ref5 : null;
|
|
13705
13656
|
var rateVal = statusData.rate;
|
|
13706
13657
|
if (rateVal == null && amountFromEffective && amountToEffective) {
|
|
13707
13658
|
rateVal = BigNumber$1(amountToEffective).div(amountFromEffective).toString();
|
|
13708
13659
|
}
|
|
13709
13660
|
if (rateVal == null) rateVal = "0";
|
|
13710
|
-
var rateTrimmed = AmountUtils.trim(rateVal,
|
|
13661
|
+
var rateTrimmed = AmountUtils.trim(rateVal, _this5._maxRateDigits);
|
|
13711
13662
|
var toAmountCalculated = amountToEffective;
|
|
13712
13663
|
if (toAmountCalculated == null && rateVal && amountFromEffective) {
|
|
13713
13664
|
toAmountCalculated = BigNumber$1(amountFromEffective).times(rateVal).toString();
|
|
13714
13665
|
}
|
|
13715
13666
|
if (toAmountCalculated == null) toAmountCalculated = "0";
|
|
13716
13667
|
var toAmountTrimmed = AmountUtils.trim(toAmountCalculated, toCoin.digits);
|
|
13717
|
-
return new ExistingSwap(swapIds[swapIndex],
|
|
13668
|
+
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);
|
|
13718
13669
|
}).filter(Boolean);
|
|
13719
13670
|
return {
|
|
13720
13671
|
result: true,
|
|
@@ -13735,8 +13686,8 @@ var GoexmeSwapProvider = /*#__PURE__*/function (_SwapProvider) {
|
|
|
13735
13686
|
};
|
|
13736
13687
|
_proto.getPartnersList = function getPartnersList() {
|
|
13737
13688
|
try {
|
|
13738
|
-
var
|
|
13739
|
-
return Promise.resolve([new Partner(
|
|
13689
|
+
var _this6 = this;
|
|
13690
|
+
return Promise.resolve([new Partner(_this6.id, "GoExme", "https://storage.swapspace.co/static/c9c19112c41a4caebf08196766eaead480e33bce2d4201c572a39c1800cb95e2.svg", KYC_LEVELS.LOW)]);
|
|
13740
13691
|
} catch (e) {
|
|
13741
13692
|
return Promise.reject(e);
|
|
13742
13693
|
}
|