@rabbitio/ui-kit 1.0.0-beta.110 → 1.0.0-beta.112
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 -1
- package/.env.example +1 -1
- package/coverage/clover.xml +1411 -1410
- package/coverage/coverage-final.json +18 -18
- package/coverage/index.html +17 -17
- package/coverage/ui-kit/index.html +1 -1
- package/coverage/ui-kit/index.js.html +1 -1
- package/coverage/ui-kit/src/common-apis/adapters/analyticsAdapters/googleAnalyticsAdapter.js.html +1 -1
- package/coverage/ui-kit/src/common-apis/adapters/analyticsAdapters/index.html +1 -1
- package/coverage/ui-kit/src/common-apis/adapters/analyticsAdapters/metrikaAdapter.js.html +1 -1
- package/coverage/ui-kit/src/common-apis/adapters/analyticsAdapters/mixpanelAdapter.js.html +1 -1
- package/coverage/ui-kit/src/common-apis/adapters/axiosAdapter.js.html +1 -1
- package/coverage/ui-kit/src/common-apis/adapters/index.html +1 -1
- package/coverage/ui-kit/src/common-apis/adapters/qrUtils.js.html +1 -1
- package/coverage/ui-kit/src/common-apis/external-apis/apiGroups.js.html +1 -1
- package/coverage/ui-kit/src/common-apis/external-apis/emailAPI.js.html +1 -1
- package/coverage/ui-kit/src/common-apis/external-apis/index.html +1 -1
- package/coverage/ui-kit/src/common-apis/external-apis/ipAddressProviders.js.html +1 -1
- package/coverage/ui-kit/src/common-apis/globalConstants.jsx.html +1 -1
- package/coverage/ui-kit/src/common-apis/index.html +1 -1
- package/coverage/ui-kit/src/common-apis/models/blockchain.js.html +4 -4
- package/coverage/ui-kit/src/common-apis/models/coin.js.html +221 -221
- package/coverage/ui-kit/src/common-apis/models/index.html +1 -1
- package/coverage/ui-kit/src/common-apis/models/protocol.js.html +3 -3
- package/coverage/ui-kit/src/common-apis/services/fiatCurrenciesService.js.html +1 -1
- package/coverage/ui-kit/src/common-apis/services/index.html +1 -1
- package/coverage/ui-kit/src/common-apis/utils/amountUtils.js.html +21 -21
- package/coverage/ui-kit/src/common-apis/utils/cache.js.html +6 -6
- package/coverage/ui-kit/src/common-apis/utils/errorUtils.js.html +13 -13
- package/coverage/ui-kit/src/common-apis/utils/index.html +1 -1
- package/coverage/ui-kit/src/common-apis/utils/logging/index.html +1 -1
- package/coverage/ui-kit/src/common-apis/utils/logging/logger.js.html +22 -22
- package/coverage/ui-kit/src/common-apis/utils/logging/logsStorage.js.html +3 -3
- package/coverage/ui-kit/src/common-apis/utils/postponeExecution.js.html +1 -1
- package/coverage/ui-kit/src/common-apis/utils/rabbitTicker.js.html +10 -10
- package/coverage/ui-kit/src/common-apis/utils/safeStringify.js.html +27 -27
- package/coverage/ui-kit/src/index.html +1 -1
- package/coverage/ui-kit/src/index.js.html +1 -1
- package/coverage/ui-kit/src/robust-api-caller/cacheAndConcurrentRequestsResolver.js.html +1 -1
- package/coverage/ui-kit/src/robust-api-caller/cachedRobustExternalApiCallerService.js.html +1 -1
- package/coverage/ui-kit/src/robust-api-caller/cancelProcessing.js.html +1 -1
- package/coverage/ui-kit/src/robust-api-caller/concurrentCalculationsMetadataHolder.js.html +1 -1
- package/coverage/ui-kit/src/robust-api-caller/externalApiProvider.js.html +1 -1
- package/coverage/ui-kit/src/robust-api-caller/externalServicesStatsCollector.js.html +1 -1
- package/coverage/ui-kit/src/robust-api-caller/index.html +1 -1
- package/coverage/ui-kit/src/robust-api-caller/robustExternalAPICallerService.js.html +1 -1
- package/coverage/ui-kit/src/swaps-lib/external-apis/exolixSwapProvider.js.html +66 -45
- package/coverage/ui-kit/src/swaps-lib/external-apis/goexmeSwapProvider.js.html +521 -545
- package/coverage/ui-kit/src/swaps-lib/external-apis/index.html +27 -27
- package/coverage/ui-kit/src/swaps-lib/external-apis/letsExchangeSwapProvider.js.html +1 -1
- package/coverage/ui-kit/src/swaps-lib/external-apis/swapProvider.js.html +328 -328
- package/coverage/ui-kit/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +76 -52
- package/coverage/ui-kit/src/swaps-lib/external-apis/utils.js.html +14 -14
- package/coverage/ui-kit/src/swaps-lib/models/baseSwapCreationInfo.js.html +1 -1
- package/coverage/ui-kit/src/swaps-lib/models/existingSwap.js.html +141 -141
- package/coverage/ui-kit/src/swaps-lib/models/existingSwapWithFiatData.js.html +1 -1
- package/coverage/ui-kit/src/swaps-lib/models/index.html +1 -1
- package/coverage/ui-kit/src/swaps-lib/models/partner.js.html +1 -1
- package/coverage/ui-kit/src/swaps-lib/models/swapProviderCoinInfo.js.html +73 -73
- package/coverage/ui-kit/src/swaps-lib/services/index.html +1 -1
- package/coverage/ui-kit/src/swaps-lib/services/publicSwapService.js.html +1 -1
- package/coverage/ui-kit/src/swaps-lib/utils/index.html +1 -1
- package/coverage/ui-kit/src/swaps-lib/utils/swapUtils.js.html +1 -1
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/arrowIcon.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/arrowTosca.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/arrowWhite.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/darkRectangle.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/determinedError.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/failedValidationIcon.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/infoIcon.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/messageIcon.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/noticeQuestionIcon.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/supportDialogImage.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/assets/wrappedImages/walletIcon.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/AssetIcon/AssetIcon.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/AssetIcon/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/AssetSelection/AssetSelection.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/AssetSelection/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/BackgroundTitle/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/InformationMessage/InformationMessage.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/InformationMessage/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/Input/Input.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/Input/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/LoadingDots/LoadingDots.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/LoadingDots/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/NoticeIcon/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/QrCode/QrCode.jsx.html +7 -25
- package/coverage/ui-kit/src/ui-kit/components/atoms/QrCode/index.html +5 -5
- package/coverage/ui-kit/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/RateSelector/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/SupportChat/SupportChat.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/SupportChat/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/Textarea/Textarea.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/Textarea/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/TitleBox/TitleBox.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/TitleBox/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/Tooltip/Tooltip.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/Tooltip/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/Validation/Validation.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/Validation/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/Button/Button.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/Button/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/Close/Close.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/Close/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/LinkButton/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/molecules/AmountInput/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/molecules/CoinPicker/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/molecules/ColoredNotice/ColoredNotice.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/molecules/ColoredNotice/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/molecules/LineWithIconLink/LineWithIconLink.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/molecules/LineWithIconLink/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/molecules/LogoCarousel/LogoCarousel.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/molecules/LogoCarousel/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/molecules/SearchableCoinsList/SearchableCoinsList.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/molecules/SearchableCoinsList/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/molecules/TitledLineWithIconLink/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/organisms/CoinPickerDialogStep/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/Dialog.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/organisms/Dialog/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/organisms/SwapForm/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/organisms/WaitlistSubscription/WaitlistSubscription.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/organisms/WaitlistSubscription/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx.html +1 -1
- package/coverage/ui-kit/src/ui-kit/components/templates/DeterminedErrorDialogStep/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/hooks/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/hooks/useCallHandlingErrors.js.html +1 -1
- package/coverage/ui-kit/src/ui-kit/hooks/useIsHydrated.js.html +1 -1
- package/coverage/ui-kit/src/ui-kit/hooks/useReferredState.js.html +1 -1
- package/coverage/ui-kit/src/ui-kit/utils/index.html +1 -1
- package/coverage/ui-kit/src/ui-kit/utils/inputValueProviders.js.html +1 -1
- package/coverage/ui-kit/src/ui-kit/utils/searchCoins.js.html +1 -1
- package/coverage/ui-kit/src/ui-kit/utils/textUtils.js.html +1 -1
- package/coverage/ui-kit/src/ui-kit/utils/uiUtils.js.html +1 -1
- package/coverage/ui-kit/src/ui-kit/utils/urlQueryUtils.js.html +1 -1
- package/coverage/ui-kit/stories/atoms/BackgroundTitle.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/atoms/LinesOfText.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/atoms/LoadingDots.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/atoms/QrCode.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/atoms/RateSelector.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/atoms/Validation.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/atoms/buttons/Button.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/atoms/buttons/Close.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/atoms/buttons/LinkButton.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/atoms/buttons/index.html +1 -1
- package/coverage/ui-kit/stories/atoms/index.html +1 -1
- package/coverage/ui-kit/stories/molecules/AmountInput.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/molecules/CoinPicker.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/molecules/ColoredNotice.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/molecules/LineWithIconLink.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/molecules/LogoCarousel.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/molecules/TitledLineWithIconLink.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/molecules/index.html +1 -1
- package/coverage/ui-kit/stories/organisms/Dialog/Dialog.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/organisms/Dialog/DialogButtons/DialogButtons.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/organisms/Dialog/DialogButtons/index.html +1 -1
- package/coverage/ui-kit/stories/organisms/Dialog/DialogStep/DialogStep.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/organisms/Dialog/DialogStep/index.html +1 -1
- package/coverage/ui-kit/stories/organisms/Dialog/index.html +1 -1
- package/coverage/ui-kit/stories/organisms/WaitlistSubscription.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/organisms/index.html +1 -1
- package/coverage/ui-kit/stories/stubs/coins.jsx.html +1 -1
- package/coverage/ui-kit/stories/stubs/exampleContent.jsx.html +1 -1
- package/coverage/ui-kit/stories/stubs/index.html +1 -1
- package/coverage/ui-kit/stories/templates/DeterminedErrorDialogStep.stories.jsx.html +1 -1
- package/coverage/ui-kit/stories/templates/index.html +1 -1
- package/dist/index.cjs +94 -92
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +4 -12
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +82 -78
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +94 -92
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +94 -92
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/common-apis/tests/integration/external-apis/ipAddressProviders/getClientIpAddress.test.js +9 -5
- package/src/swaps-lib/external-apis/exolixSwapProvider.js +46 -39
- package/src/swaps-lib/external-apis/goexmeSwapProvider.js +29 -37
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +54 -46
- 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/_ensurePairsLoaded.test.js +77 -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 +184 -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 +155 -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 +57 -57
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/_fetchSupportedCurrenciesIfNeeded.int.test.js +289 -126
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/createSwap.int.test.js +320 -225
- package/src/swaps-lib/test/external-apis/goexmeSwapProvider/integration/getSwapInfo.int.test.js +138 -127
- package/src/ui-kit/components/atoms/QrCode/QrCode.jsx +2 -8
- package/src/ui-kit/components/atoms/QrCode/qr-code.module.scss +4 -11
package/dist/index.modern.js
CHANGED
|
@@ -5172,7 +5172,7 @@ async function generateQrAndShowInCanvas(encodingString) {
|
|
|
5172
5172
|
}
|
|
5173
5173
|
}
|
|
5174
5174
|
|
|
5175
|
-
var s$8 = {"qr-code":"_VZ0dT"
|
|
5175
|
+
var s$8 = {"qr-code":"_VZ0dT"};
|
|
5176
5176
|
|
|
5177
5177
|
/**
|
|
5178
5178
|
* QrCode component renders a QR code for a provided crypto address.
|
|
@@ -5180,13 +5180,11 @@ var s$8 = {"qr-code":"_VZ0dT","fill":"_hFE1l"};
|
|
|
5180
5180
|
* @component
|
|
5181
5181
|
* @param {Object} props - The props for the component.
|
|
5182
5182
|
* @param {string} props.address - The crypto address to generate the QR code for.
|
|
5183
|
-
* @param {boolean} [props.fill=false] - If true, applies additional CSS class to fill the container.
|
|
5184
5183
|
*
|
|
5185
5184
|
* @returns {JSX.Element} A div containing the generated QR code.
|
|
5186
5185
|
*/
|
|
5187
5186
|
const QrCode = ({
|
|
5188
|
-
address
|
|
5189
|
-
fill: _fill = false
|
|
5187
|
+
address
|
|
5190
5188
|
}) => {
|
|
5191
5189
|
const canvasRef = useRef();
|
|
5192
5190
|
useEffect(() => {
|
|
@@ -5201,16 +5199,12 @@ const QrCode = ({
|
|
|
5201
5199
|
})();
|
|
5202
5200
|
}, [address]);
|
|
5203
5201
|
return /*#__PURE__*/React.createElement("div", {
|
|
5204
|
-
className: s$8["qr-code"]
|
|
5202
|
+
className: s$8["qr-code"],
|
|
5205
5203
|
ref: canvasRef
|
|
5206
5204
|
});
|
|
5207
5205
|
};
|
|
5208
5206
|
QrCode.propTypes = {
|
|
5209
|
-
address: PropTypes.string.isRequired
|
|
5210
|
-
fill: PropTypes.bool
|
|
5211
|
-
};
|
|
5212
|
-
QrCode.defaultProps = {
|
|
5213
|
-
fill: false
|
|
5207
|
+
address: PropTypes.string.isRequired
|
|
5214
5208
|
};
|
|
5215
5209
|
|
|
5216
5210
|
var s$7 = {"first-line-text":"_IGz2I","wrap":"_eKd8P","break":"_mT5i4","full-text":"_PVKxC","shorted":"_wB5qV","horizontal":"_lqJz-","line":"_MGRy0","second-line-text":"_hdF64"};
|
|
@@ -8733,7 +8727,7 @@ class ExistingSwap {
|
|
|
8733
8727
|
* @param {number} expiresAt - The timestamp when the swap expires.
|
|
8734
8728
|
* @param {number|null} confirmations - The number of confirmations the swap has received, or null.
|
|
8735
8729
|
* @param {string} rate - The exchange rate for the swap.
|
|
8736
|
-
* @param {
|
|
8730
|
+
* @param {boolean} fixed - Indicates if the rate is fixed.
|
|
8737
8731
|
* @param {string|null} refundAddress - The address to refund to in case of failure, or null.
|
|
8738
8732
|
* @param {string} payToAddress - The address to send the funds to.
|
|
8739
8733
|
* @param {Coin} fromCoin - The coin that is being swapped from.
|
|
@@ -9874,22 +9868,33 @@ class SwapspaceSwapProvider extends SwapProvider {
|
|
|
9874
9868
|
};
|
|
9875
9869
|
const responses = await Promise.all(swapIds.map(swapId => getNotFailingOn404(swapId)));
|
|
9876
9870
|
const wo404 = responses.flat();
|
|
9877
|
-
Logger.log("All swaps RAW: " + JSON.stringify(wo404.map(r => r.data)), loggerSource);
|
|
9871
|
+
Logger.log("All swaps RAW swapspace: " + JSON.stringify(wo404.map(r => r.data)), loggerSource);
|
|
9878
9872
|
const swaps = wo404.map(r => r.data).map((swap, index) => {
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
|
|
9882
|
-
|
|
9883
|
-
|
|
9873
|
+
try {
|
|
9874
|
+
var _this$_supportedCoins, _this$_supportedCoins2, _this$_supportedCoins3, _this$_supportedCoins4, _swap$blockExplorerTr, _swap$from$extraId, _swap$to$extraId, _swap$refundExtraId;
|
|
9875
|
+
let fromCoin = (_this$_supportedCoins = (_this$_supportedCoins2 = this._supportedCoins.find(i => i.code === swap.from.code && i.network === swap.from.network)) == null ? void 0 : _this$_supportedCoins2.coin) != null ? _this$_supportedCoins : {
|
|
9876
|
+
ticker: toRabbitTicker(swap.from.code, swap.from.network),
|
|
9877
|
+
digits: 8
|
|
9878
|
+
};
|
|
9879
|
+
let toCoin = (_this$_supportedCoins3 = (_this$_supportedCoins4 = this._supportedCoins.find(i => i.code === swap.to.code && i.network === swap.to.network)) == null ? void 0 : _this$_supportedCoins4.coin) != null ? _this$_supportedCoins3 : {
|
|
9880
|
+
ticker: toRabbitTicker(swap.to.code, swap.to.network),
|
|
9881
|
+
digits: 8
|
|
9882
|
+
};
|
|
9883
|
+
if (!fromCoin || !toCoin) {
|
|
9884
|
+
return []; // We skip swaps with not supported coins for now
|
|
9885
|
+
}
|
|
9886
|
+
const toUtcTimestamp = timeStr => Date.parse(timeStr.match(/.+[Zz]$/) ? timeStr : `${timeStr}Z`);
|
|
9887
|
+
const expiresAt = toUtcTimestamp(swap.timestamps.expiresAt);
|
|
9888
|
+
const isExpiredByTime = expiresAt < Date.now();
|
|
9889
|
+
const status = this._mapSwapspaceStatusToRabbitStatus(swap.status, isExpiredByTime);
|
|
9890
|
+
const toDigits = status === SwapProvider.SWAP_STATUSES.REFUNDED ? fromCoin.digits : toCoin.digits;
|
|
9891
|
+
const addressToSendCoinsToSwapspace = swap.from.address;
|
|
9892
|
+
const toUrl = ((_swap$blockExplorerTr = swap.blockExplorerTransactionUrl.to) != null ? _swap$blockExplorerTr : "").replace(/from=swapspace&?/g, "").replaceAll(/&&+/g, "&").replace("?&", "?").replace(/&$/, "").replace(/\?$/, "");
|
|
9893
|
+
return new ExistingSwap(swapIds[index], status, toUtcTimestamp(swap.timestamps.createdAt), expiresAt, swap.confirmations, AmountUtils.trim(swap.rate, this._maxRateDigits), swap.fixed, swap.refundAddress, addressToSendCoinsToSwapspace, fromCoin, AmountUtils.trim(swap.from.amount, fromCoin.digits), swap.from.transactionHash, swap.blockExplorerTransactionUrl.from, toCoin, AmountUtils.trim(swap.to.amount, toDigits), swap.to.transactionHash, toUrl, swap.to.address, swap.partner, (_swap$from$extraId = swap.from.extraId) != null ? _swap$from$extraId : null, (_swap$to$extraId = swap.to.extraId) != null ? _swap$to$extraId : null, (_swap$refundExtraId = swap.refundExtraId) != null ? _swap$refundExtraId : null);
|
|
9894
|
+
} catch (e) {
|
|
9895
|
+
console.log("Failed to parse loaded swap", e);
|
|
9896
|
+
return [];
|
|
9884
9897
|
}
|
|
9885
|
-
const toUtcTimestamp = timeStr => Date.parse(timeStr.match(/.+[Zz]$/) ? timeStr : `${timeStr}Z`);
|
|
9886
|
-
const expiresAt = toUtcTimestamp(swap.timestamps.expiresAt);
|
|
9887
|
-
const isExpiredByTime = expiresAt < Date.now();
|
|
9888
|
-
const status = this._mapSwapspaceStatusToRabbitStatus(swap.status, isExpiredByTime);
|
|
9889
|
-
const toDigits = status === SwapProvider.SWAP_STATUSES.REFUNDED ? fromCoin.digits : toCoin.digits;
|
|
9890
|
-
const addressToSendCoinsToSwapspace = swap.from.address;
|
|
9891
|
-
const toUrl = ((_swap$blockExplorerTr = swap.blockExplorerTransactionUrl.to) != null ? _swap$blockExplorerTr : "").replace(/from=swapspace&?/g, "").replaceAll(/&&+/g, "&").replace("?&", "?").replace(/&$/, "").replace(/\?$/, "");
|
|
9892
|
-
return new ExistingSwap(swapIds[index], status, toUtcTimestamp(swap.timestamps.createdAt), expiresAt, swap.confirmations, AmountUtils.trim(swap.rate, this._maxRateDigits), swap.fixed, swap.refundAddress, addressToSendCoinsToSwapspace, fromCoin, AmountUtils.trim(swap.from.amount, fromCoin.digits), swap.from.transactionHash, swap.blockExplorerTransactionUrl.from, toCoin, AmountUtils.trim(swap.to.amount, toDigits), swap.to.transactionHash, toUrl, swap.to.address, swap.partner, (_swap$from$extraId = swap.from.extraId) != null ? _swap$from$extraId : null, (_swap$to$extraId = swap.to.extraId) != null ? _swap$to$extraId : null, (_swap$refundExtraId = swap.refundExtraId) != null ? _swap$refundExtraId : null);
|
|
9893
9898
|
}).flat();
|
|
9894
9899
|
Logger.log(`Swap details result ${safeStringify(swaps)}`, loggerSource);
|
|
9895
9900
|
return {
|
|
@@ -10569,19 +10574,30 @@ class ExolixSwapProvider extends SwapProvider {
|
|
|
10569
10574
|
const fetchedSwaps = responses.flat();
|
|
10570
10575
|
Logger.log("All swaps RAW: " + JSON.stringify(fetchedSwaps.map(r => r.data)), loggerSource);
|
|
10571
10576
|
const swaps = fetchedSwaps.map(r => r.data).map((swap, index) => {
|
|
10572
|
-
|
|
10573
|
-
|
|
10574
|
-
|
|
10575
|
-
|
|
10576
|
-
|
|
10577
|
+
try {
|
|
10578
|
+
var _this$_supportedCoins, _this$_supportedCoins2, _this$_supportedCoins3, _this$_supportedCoins4, _swap$depositExtraId, _swap$withdrawalExtra, _swap$refundExtraId;
|
|
10579
|
+
const fromCoin = (_this$_supportedCoins = (_this$_supportedCoins2 = this._supportedCoins.find(i => i.code === swap.coinFrom.coinCode && i.network === swap.coinFrom.network)) == null ? void 0 : _this$_supportedCoins2.coin) != null ? _this$_supportedCoins : {
|
|
10580
|
+
ticker: toRabbitTicker(swap.coinFrom.coinCode, swap.coinFrom.network),
|
|
10581
|
+
digits: 8
|
|
10582
|
+
};
|
|
10583
|
+
const toCoin = (_this$_supportedCoins3 = (_this$_supportedCoins4 = this._supportedCoins.find(i => i.code === swap.coinTo.coinCode && i.network === swap.coinTo.network)) == null ? void 0 : _this$_supportedCoins4.coin) != null ? _this$_supportedCoins3 : {
|
|
10584
|
+
ticker: toRabbitTicker(swap.coinTo.coinCode, swap.coinTo.network),
|
|
10585
|
+
digits: 8
|
|
10586
|
+
};
|
|
10587
|
+
if (!fromCoin || !toCoin) {
|
|
10588
|
+
return []; // We skip swaps with not supported coins for now
|
|
10589
|
+
}
|
|
10590
|
+
const toUtcTimestamp = timeStr => Date.parse(timeStr.match(/.+[Zz]$/) ? timeStr : `${timeStr}Z`);
|
|
10591
|
+
const createdAt = toUtcTimestamp(swap.createdAt);
|
|
10592
|
+
const expiresAt = createdAt + 25 * 60 * 1000; // Hack with hard-coded 25 minutes
|
|
10593
|
+
const isExpiredByTime = expiresAt < Date.now();
|
|
10594
|
+
const status = this._mapExolixStatusToRabbitStatus(swap.status, isExpiredByTime);
|
|
10595
|
+
const toDigits = status === SwapProvider.SWAP_STATUSES.REFUNDED ? fromCoin.digits : toCoin.digits;
|
|
10596
|
+
return new ExistingSwap(swapIds[index], status, createdAt, expiresAt, -1, AmountUtils.trim(swap.rate, this._maxRateDigits), (swap == null ? void 0 : swap.rateType) === "fixed", swap.refundAddress, swap.depositAddress, fromCoin, AmountUtils.trim(swap.amount, fromCoin.digits), swap.hashIn.hash, swap.hashIn.link, toCoin, AmountUtils.trim(swap.amountTo, toDigits), swap.hashOut.hash, swap.hashOut.link, swap.withdrawalAddress, this.id, (_swap$depositExtraId = swap.depositExtraId) != null ? _swap$depositExtraId : null, (_swap$withdrawalExtra = swap.withdrawalExtraId) != null ? _swap$withdrawalExtra : null, (_swap$refundExtraId = swap.refundExtraId) != null ? _swap$refundExtraId : null);
|
|
10597
|
+
} catch (e) {
|
|
10598
|
+
console.log("Failed to parse loaded swap", e);
|
|
10599
|
+
return [];
|
|
10577
10600
|
}
|
|
10578
|
-
const toUtcTimestamp = timeStr => Date.parse(timeStr.match(/.+[Zz]$/) ? timeStr : `${timeStr}Z`);
|
|
10579
|
-
const createdAt = toUtcTimestamp(swap.createdAt);
|
|
10580
|
-
const expiresAt = createdAt + 25 * 60 * 1000; // Hack with hard-coded 25 minutes
|
|
10581
|
-
const isExpiredByTime = expiresAt < Date.now();
|
|
10582
|
-
const status = this._mapExolixStatusToRabbitStatus(swap.status, isExpiredByTime);
|
|
10583
|
-
const toDigits = status === SwapProvider.SWAP_STATUSES.REFUNDED ? fromCoin.digits : toCoin.digits;
|
|
10584
|
-
return new ExistingSwap(swapIds[index], status, createdAt, expiresAt, -1, AmountUtils.trim(swap.rate, this._maxRateDigits), (swap == null ? void 0 : swap.rateType) === "fixed", swap.refundAddress, swap.depositAddress, fromCoin, AmountUtils.trim(swap.amount, fromCoin.digits), swap.hashIn.hash, swap.hashIn.link, toCoin, AmountUtils.trim(swap.amountTo, toDigits), swap.hashOut.hash, swap.hashOut.link, swap.withdrawalAddress, this.id, (_swap$depositExtraId = swap.depositExtraId) != null ? _swap$depositExtraId : null, (_swap$withdrawalExtra = swap.withdrawalExtraId) != null ? _swap$withdrawalExtra : null, (_swap$refundExtraId = swap.refundExtraId) != null ? _swap$refundExtraId : null);
|
|
10585
10601
|
}).flat();
|
|
10586
10602
|
Logger.log(`Swap details result ${safeStringify(swaps)}`, loggerSource);
|
|
10587
10603
|
return {
|
|
@@ -10862,10 +10878,7 @@ class GoexmeSwapProvider extends SwapProvider {
|
|
|
10862
10878
|
};
|
|
10863
10879
|
}
|
|
10864
10880
|
|
|
10865
|
-
|
|
10866
|
-
* Convert amountTo → ratio so that downstream code can do
|
|
10867
|
-
* amountFrom * rate === amountTo
|
|
10868
|
-
* -------------------------------------------------------- */
|
|
10881
|
+
// Convert amountTo → ratio so that downstream code can do amountFrom * rate === amountTo
|
|
10869
10882
|
let rateRatio = null;
|
|
10870
10883
|
if (response.data.rate != null && BigNumber$1(amountCoins).gt(0)) {
|
|
10871
10884
|
rateRatio = AmountUtils.trim(BigNumber$1(response.data.rate).div(amountCoins).toString(), this._maxRateDigits);
|
|
@@ -10882,10 +10895,6 @@ class GoexmeSwapProvider extends SwapProvider {
|
|
|
10882
10895
|
rawSwapData: response.data,
|
|
10883
10896
|
/**
|
|
10884
10897
|
* GoExme never requires a refund address.
|
|
10885
|
-
*
|
|
10886
|
-
* The official API documentation marks `destinationTag` / `refundTag` as **optional**.
|
|
10887
|
-
* Support chat confirmation (2025‑06‑27): "Yes, it's optional and can be omitted even for small amounts."
|
|
10888
|
-
*
|
|
10889
10898
|
*/
|
|
10890
10899
|
isRefundAddressRequired: false
|
|
10891
10900
|
};
|
|
@@ -10903,23 +10912,28 @@ class GoexmeSwapProvider extends SwapProvider {
|
|
|
10903
10912
|
/**
|
|
10904
10913
|
* Creates a swap on GoExme.
|
|
10905
10914
|
*
|
|
10906
|
-
*
|
|
10907
|
-
* `
|
|
10908
|
-
*
|
|
10909
|
-
* •
|
|
10915
|
+
* The `proprietarySwapEstimationData` object **must** carry two distinct values
|
|
10916
|
+
* produced by a prior `/rate` call:
|
|
10917
|
+
*
|
|
10918
|
+
* • `rawSwapData.rate` – **amountTo**
|
|
10919
|
+
* (the exact number of coins GoExme will send to the user);
|
|
10920
|
+
* • `rate` – **ratio**
|
|
10921
|
+
* (`amountTo / amountFrom`, i.e. Rabbit‑style per‑coin rate).
|
|
10910
10922
|
*
|
|
10911
|
-
*
|
|
10912
|
-
*
|
|
10923
|
+
* Processing steps
|
|
10924
|
+
* ----------------
|
|
10925
|
+
* 1. Determine **amountTo** (`rawSwapData.rate`).
|
|
10926
|
+
* 2. Compute the canonical per‑coin **ratio**:
|
|
10913
10927
|
*
|
|
10914
|
-
*
|
|
10915
|
-
*
|
|
10916
|
-
*
|
|
10917
|
-
*
|
|
10918
|
-
*
|
|
10919
|
-
*
|
|
10920
|
-
*
|
|
10921
|
-
*
|
|
10922
|
-
*
|
|
10928
|
+
* ratio = amountTo / amountFrom
|
|
10929
|
+
*
|
|
10930
|
+
* 3. Return both numbers for downstream code:
|
|
10931
|
+
* • `rate` → ratio (Rabbit convention);
|
|
10932
|
+
* • `toAmount` → amountTo (final coins the user receives).
|
|
10933
|
+
*
|
|
10934
|
+
* This guarantees the invariant:
|
|
10935
|
+
*
|
|
10936
|
+
* amountFrom * rate === toAmount
|
|
10923
10937
|
*/
|
|
10924
10938
|
async createSwap(fromCoin, toCoin, amount, toAddress, refundAddress, proprietarySwapEstimationData, clientIpAddress, fixed, toCurrencyExtraId = "", refundExtraId = "", amountIsToReceive = false) {
|
|
10925
10939
|
const loggerSource = "Goexme.createSwap";
|
|
@@ -10942,6 +10956,9 @@ class GoexmeSwapProvider extends SwapProvider {
|
|
|
10942
10956
|
fix: true
|
|
10943
10957
|
} : {});
|
|
10944
10958
|
params.amount = amount;
|
|
10959
|
+
|
|
10960
|
+
// Add refundAddress only if extraId is present:
|
|
10961
|
+
// GoExme documents these fields as optional, and support (2025‑06‑27) confirmed that.
|
|
10945
10962
|
if (toCoinInfo.hasExtraId && toCurrencyExtraId) params.destinationTag = toCurrencyExtraId;
|
|
10946
10963
|
if (refundAddress) {
|
|
10947
10964
|
params.refundAddress = refundAddress;
|
|
@@ -10957,18 +10974,14 @@ class GoexmeSwapProvider extends SwapProvider {
|
|
|
10957
10974
|
throw new Error(errMsg);
|
|
10958
10975
|
}
|
|
10959
10976
|
|
|
10960
|
-
|
|
10961
|
-
* Extract amountTo from estimation (first non-null source).
|
|
10962
|
-
*-----------------------------------------------------------*/
|
|
10977
|
+
// Extract amountTo from estimation (first non-null source).
|
|
10963
10978
|
const amountToCandidate = (_ref = (_proprietarySwapEstim = proprietarySwapEstimationData == null || (_proprietarySwapEstim2 = proprietarySwapEstimationData.rawSwapData) == null ? void 0 : _proprietarySwapEstim2.rate) != null ? _proprietarySwapEstim : proprietarySwapEstimationData == null ? void 0 : proprietarySwapEstimationData.rate) != null ? _ref : null;
|
|
10964
10979
|
if (amountToCandidate == null) {
|
|
10965
10980
|
throw new Error("Estimation does not contain amountTo/rate");
|
|
10966
10981
|
}
|
|
10967
10982
|
const toAmountCalculated = AmountUtils.trim(amountToCandidate, toCoin.digits);
|
|
10968
10983
|
|
|
10969
|
-
|
|
10970
|
-
* Derive ratio so that amountFrom * ratio = amountTo.
|
|
10971
|
-
*-----------------------------------------------------------*/
|
|
10984
|
+
// Derive ratio so that amountFrom * ratio = amountTo.
|
|
10972
10985
|
const rateRatio = AmountUtils.trim(BigNumber$1(toAmountCalculated).div(amount).toString(), this._maxRateDigits);
|
|
10973
10986
|
return {
|
|
10974
10987
|
result: true,
|
|
@@ -11015,40 +11028,31 @@ class GoexmeSwapProvider extends SwapProvider {
|
|
|
11015
11028
|
};
|
|
11016
11029
|
const statusResponses = await Promise.all(swapIds.map(fetchOne));
|
|
11017
11030
|
|
|
11018
|
-
|
|
11031
|
+
// helper: normalize coin code using CODE_TRANSLATIONS
|
|
11019
11032
|
const normalize = code => {
|
|
11020
11033
|
var _CODE_TRANSLATIONS$co2;
|
|
11021
11034
|
return (_CODE_TRANSLATIONS$co2 = CODE_TRANSLATIONS[code.toUpperCase()]) != null ? _CODE_TRANSLATIONS$co2 : code.toUpperCase();
|
|
11022
11035
|
};
|
|
11023
11036
|
const swaps = statusResponses.map((statusData, swapIndex) => {
|
|
11024
|
-
var _ref2, _statusData$amountFro, _ref3, _statusData$amountTo, _statusData$refundAdd
|
|
11037
|
+
var _ref2, _statusData$amountFro, _ref3, _statusData$amountTo, _statusData$refundAdd;
|
|
11025
11038
|
if (!statusData) return null;
|
|
11026
|
-
|
|
11027
|
-
/* ------------------ coins ------------------ */
|
|
11028
11039
|
const fromCoinTicker = toRabbitTicker(normalize(statusData.from), "");
|
|
11029
11040
|
const toCoinTicker = toRabbitTicker(normalize(statusData.to), "");
|
|
11030
11041
|
let fromCoin = this.getCoinByTickerIfPresent(fromCoinTicker);
|
|
11031
11042
|
let toCoin = this.getCoinByTickerIfPresent(toCoinTicker);
|
|
11032
|
-
|
|
11033
|
-
/* fallback: look up by raw provider code if ticker lookup failed */
|
|
11034
11043
|
if (!fromCoin) {
|
|
11035
11044
|
var _byCode$coin;
|
|
11036
11045
|
const byCode = this._supportedCoins.find(c => c.code === statusData.from);
|
|
11037
11046
|
fromCoin = (_byCode$coin = byCode == null ? void 0 : byCode.coin) != null ? _byCode$coin : null;
|
|
11038
11047
|
}
|
|
11039
|
-
/* fallback: look up by raw provider code if ticker lookup failed */
|
|
11040
11048
|
if (!toCoin) {
|
|
11041
11049
|
var _byCode$coin2;
|
|
11042
11050
|
const byCode = this._supportedCoins.find(c => c.code === statusData.to);
|
|
11043
11051
|
toCoin = (_byCode$coin2 = byCode == null ? void 0 : byCode.coin) != null ? _byCode$coin2 : null;
|
|
11044
11052
|
}
|
|
11045
11053
|
if (!fromCoin || !toCoin) return null;
|
|
11046
|
-
|
|
11047
|
-
/* timestamps */
|
|
11048
11054
|
const createdAt = GoexmeSwapProvider._parseGoexmeDate(statusData.date);
|
|
11049
11055
|
const expiresAt = createdAt + this.SWAP_EXPIRATION_TIME_MS;
|
|
11050
|
-
|
|
11051
|
-
/* amounts & rate */
|
|
11052
11056
|
const amountFromEffective = (_ref2 = (_statusData$amountFro = statusData.amountFrom) != null ? _statusData$amountFro : statusData.expectedAmountFrom) != null ? _ref2 : "0";
|
|
11053
11057
|
const amountToEffective = (_ref3 = (_statusData$amountTo = statusData.amountTo) != null ? _statusData$amountTo : statusData.expectedAmountTo) != null ? _ref3 : null;
|
|
11054
11058
|
let rateVal = statusData.rate;
|
|
@@ -11063,7 +11067,7 @@ class GoexmeSwapProvider extends SwapProvider {
|
|
|
11063
11067
|
}
|
|
11064
11068
|
if (toAmountCalculated == null) toAmountCalculated = "0";
|
|
11065
11069
|
const toAmountTrimmed = AmountUtils.trim(toAmountCalculated, toCoin.digits);
|
|
11066
|
-
return new ExistingSwap(swapIds[swapIndex], this._mapGoexmeStatus(statusData.status), createdAt, expiresAt, -1, rateTrimmed, null, (_statusData$refundAdd = statusData.refundAddress) != null ? _statusData$refundAdd : "", statusData.depositAddress, fromCoin, AmountUtils.trim(amountFromEffective, fromCoin.digits),
|
|
11070
|
+
return new ExistingSwap(swapIds[swapIndex], this._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, this.id, statusData.depositTag || null, statusData.destinationTag || null, statusData.refundTag || null);
|
|
11067
11071
|
}).filter(Boolean);
|
|
11068
11072
|
return {
|
|
11069
11073
|
result: true,
|