@imtbl/checkout-widgets 2.1.17-alpha.9 → 2.2.1-alpha.0
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/dist/browser/{AddTokensWidget-BrVyGdMy.js → AddTokensWidget-DaksUeLJ.js} +26 -26
- package/dist/browser/{BridgeWidget-eWnqd7ja.js → BridgeWidget-D_3RTCX2.js} +52 -52
- package/dist/browser/{CommerceWidget-D4MvHH2v.js → CommerceWidget-C99-GGFC.js} +180 -186
- package/dist/browser/{FeesBreakdown-EPCUXpfZ.js → FeesBreakdown-BJbAIdyp.js} +1 -1
- package/dist/browser/{OnRampWidget-DsMj4ppX.js → OnRampWidget-BHGaS-OH.js} +8 -8
- package/dist/browser/{SaleWidget-LEMYC35h.js → SaleWidget-C4GWc59i.js} +61 -61
- package/dist/browser/{SpendingCapHero-E44UdwTd.js → SpendingCapHero-D7e3_oAu.js} +1 -1
- package/dist/browser/{SwapWidget-ByD49hU1.js → SwapWidget-IkGuHL6E.js} +22 -21
- package/dist/browser/{TokenImage-BJJQNbiN.js → TokenImage-AbfB1fSa.js} +1 -1
- package/dist/browser/{TopUpView-LE0qCcwd.js → TopUpView-D5fh2au_.js} +5 -5
- package/dist/browser/{WalletApproveHero-DFNBwINR.js → WalletApproveHero-CK_TX02R.js} +4 -4
- package/dist/browser/{WalletWidget-Bneo3erT.js → WalletWidget-DSTv_B3p.js} +18 -18
- package/dist/browser/{auto-track-kY7EK6TO.js → auto-track-r9fcwuc1.js} +1 -1
- package/dist/browser/{index-Bnx_z_U_.js → index-CN-bmJK5.js} +1 -1
- package/dist/browser/{index-B8pCZTSX.js → index-CgesMpxT.js} +1 -1
- package/dist/browser/{index-C6SmzCJY.js → index-Cwb6bavW.js} +1 -1
- package/dist/browser/{index-CNNenkmI.js → index-D9k7-57F.js} +1 -1
- package/dist/browser/{index-Bqw4AYV6.js → index-DW34ctVj.js} +1 -1
- package/dist/browser/{index-DeHTliqs.js → index-S9AO9JR0.js} +334 -357
- package/dist/browser/{index-D5SEQUtF.js → index-a_bddLOs.js} +1 -1
- package/dist/browser/{index-kwp7geUM.js → index-w-O9voe-.js} +2 -2
- package/dist/browser/index.js +1 -1
- package/dist/browser/{index.umd-D9GgjJ-D.js → index.umd-DRS1mtMS.js} +1 -1
- package/dist/browser/{useInterval-y2_pw8pf.js → useInterval-B_9ZtAsp.js} +1 -1
- package/dist/types/lib/index.d.ts +0 -1
- package/package.json +7 -7
- package/src/components/NetworkSwitchDrawer/NetworkSwitchDrawer.tsx +1 -2
- package/src/components/Transactions/Transactions.tsx +6 -8
- package/src/lib/index.ts +0 -1
- package/src/lib/utils.ts +4 -5
- package/src/widgets/add-tokens/components/TokenDrawerMenu.tsx +1 -2
- package/src/widgets/add-tokens/views/AddTokens.tsx +1 -2
- package/src/widgets/bridge/BridgeWidget.tsx +2 -3
- package/src/widgets/bridge/components/BridgeReviewSummary.tsx +2 -4
- package/src/widgets/bridge/components/WalletAndNetworkSelector.tsx +2 -3
- package/src/widgets/bridge/views/ClaimWithdrawal.tsx +3 -3
- package/src/widgets/connect/components/WalletList.tsx +2 -2
- package/src/widgets/connect/views/SwitchNetworkEth.tsx +2 -3
- package/src/widgets/connect/views/SwitchNetworkZkEVM.tsx +5 -5
- package/src/widgets/immutable-commerce/functions/getConnectLoaderParams.ts +9 -17
- package/src/widgets/on-ramp/OnRampWidgetRoot.tsx +1 -2
- package/src/widgets/sale/SaleWidgetRoot.tsx +1 -2
- package/src/widgets/sale/components/FundingRouteExecute/FundingRouteExecute.tsx +2 -3
- package/src/widgets/swap/SwapWidget.tsx +3 -2
- package/src/widgets/swap/SwapWidgetRoot.tsx +1 -2
- package/src/widgets/swap/components/SwapForm.tsx +2 -3
- package/src/widgets/transfer/TransferWidget.tsx +1 -2
- package/src/widgets/wallet/WalletWidgetRoot.tsx +1 -2
- package/src/widgets/wallet/components/BalanceItem/BalanceItem.tsx +6 -7
- package/src/widgets/wallet/views/WalletBalances.tsx +1 -2
- package/dist/types/lib/networkUtils.d.ts +0 -3
- package/src/lib/networkUtils.ts +0 -22
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { x as jsxs, w as jsx, D as Body, bH as PriceDisplay, B as Box, k as useTranslation, aA as Drawer, aP as MenuItem, aF as Fragment, aB as Divider, J as tokenValueFormat, h as formatZeroAmount, c4 as FooterLogo } from './index-S9AO9JR0.js';
|
|
2
2
|
|
|
3
3
|
const feesBreakdownContentStyles = {
|
|
4
4
|
display: 'flex',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { O as OnRampWidgetViews, T as TopUpView } from './TopUpView-
|
|
3
|
-
import { S as SpendingCapHero } from './SpendingCapHero-
|
|
1
|
+
import { b as reactExports, Z as ConnectLoaderContext, G as EventTargetContext, k as useTranslation, aU as ViewContext, a5 as SharedViews, F as useAnalytics, bm as Ot, bn as xt, V as ViewActions, w as jsx, z as SimpleLayout, M as HeaderNavigation, d8 as sendOnRampWidgetCloseEvent, O as orchestrationEvents, r as ro, B as Box, d9 as Vt, da as url, db as TRANSAK_ORIGIN, U as UserJourney, aK as isPassportProvider, c4 as FooterLogo, x as jsxs, d1 as SimpleTextBody, bI as viewReducer, bJ as initialViewState, cS as NATIVE, a0 as LoadingView, dc as sendOnRampSuccessEvent, c5 as StatusType, d7 as StatusView, dd as sendOnRampFailedEvent, bR as ServiceUnavailableErrorView } from './index-S9AO9JR0.js';
|
|
2
|
+
import { O as OnRampWidgetViews, T as TopUpView } from './TopUpView-D5fh2au_.js';
|
|
3
|
+
import { S as SpendingCapHero } from './SpendingCapHero-D7e3_oAu.js';
|
|
4
4
|
|
|
5
5
|
const containerStyle = (showIframe) => ({
|
|
6
6
|
position: 'relative',
|
|
@@ -188,8 +188,8 @@ function OnRampMain({ passport, showIframe, tokenAmount, tokenAddress, showBackB
|
|
|
188
188
|
let userWalletAddress = '';
|
|
189
189
|
(async () => {
|
|
190
190
|
const walletAddress = await (await provider.getSigner()).getAddress();
|
|
191
|
-
const assessment = await
|
|
192
|
-
if (
|
|
191
|
+
const assessment = await Ot([walletAddress], checkout.config);
|
|
192
|
+
if (xt(assessment)) {
|
|
193
193
|
viewDispatch({
|
|
194
194
|
payload: {
|
|
195
195
|
type: ViewActions.UPDATE_VIEW,
|
|
@@ -202,7 +202,7 @@ function OnRampMain({ passport, showIframe, tokenAmount, tokenAddress, showBackB
|
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
204
|
const params = {
|
|
205
|
-
exchangeType:
|
|
205
|
+
exchangeType: Vt.ONRAMP,
|
|
206
206
|
browserProvider: provider,
|
|
207
207
|
tokenAddress,
|
|
208
208
|
tokenAmount,
|
|
@@ -228,7 +228,7 @@ function OnRampMain({ passport, showIframe, tokenAmount, tokenAddress, showBackB
|
|
|
228
228
|
window.addEventListener('message', handleTransakEvents);
|
|
229
229
|
}, [checkout, provider, tokenAmount, tokenAddress, passport]);
|
|
230
230
|
return (jsx(Box, { sx: boxMainStyle(showIframe), children: jsx(SimpleLayout, { header: (jsx(HeaderNavigation, { title: t('views.ONRAMP.header.title'), onCloseButtonClick: () => sendOnRampWidgetCloseEvent(eventTarget), showBack: showBack, onBackButtonClick: () => {
|
|
231
|
-
orchestrationEvents.sendRequestGoBackEvent(eventTarget,
|
|
231
|
+
orchestrationEvents.sendRequestGoBackEvent(eventTarget, ro.IMTBL_ONRAMP_WIDGET_EVENT, {});
|
|
232
232
|
} })), footerBackgroundColor: "base.color.translucent.emphasis.200", children: jsx(Box, { sx: containerStyle(showIframe), children: jsx("iframe", { title: "Transak", id: transakIframeId, src: widgetUrl, allow: "camera;microphone;fullscreen;payment", style: {
|
|
233
233
|
height: '100%',
|
|
234
234
|
width: '100%',
|
|
@@ -286,7 +286,7 @@ function OnRampWidget({ amount, tokenAddress, config, showBackButton, }) {
|
|
|
286
286
|
},
|
|
287
287
|
});
|
|
288
288
|
}, statusType: StatusType.FAILURE, onCloseClick: () => sendOnRampWidgetCloseEvent(eventTarget), testId: "fail-view" })), (viewState.view.type !== OnRampWidgetViews.SUCCESS
|
|
289
|
-
&& viewState.view.type !== OnRampWidgetViews.FAIL) && (jsx(OnRampMain, { passport: checkout?.passport, showIframe: showIframe, tokenAmount: amount ?? viewState.view.data?.amount, tokenAddress: tknAddr ?? viewState.view.data?.tokenAddress, showBackButton: showBackButton })), viewState.view.type === SharedViews.TOP_UP_VIEW && (jsx(TopUpView, { analytics: { userJourney: UserJourney.ON_RAMP }, widgetEvent:
|
|
289
|
+
&& viewState.view.type !== OnRampWidgetViews.FAIL) && (jsx(OnRampMain, { passport: checkout?.passport, showIframe: showIframe, tokenAmount: amount ?? viewState.view.data?.amount, tokenAddress: tknAddr ?? viewState.view.data?.tokenAddress, showBackButton: showBackButton })), viewState.view.type === SharedViews.TOP_UP_VIEW && (jsx(TopUpView, { analytics: { userJourney: UserJourney.ON_RAMP }, widgetEvent: ro.IMTBL_ONRAMP_WIDGET_EVENT, checkout: checkout, provider: provider, showOnrampOption: isOnRampEnabled, showSwapOption: isSwapEnabled, showBridgeOption: isBridgeEnabled, onCloseButtonClick: () => sendOnRampWidgetCloseEvent(eventTarget) })), viewState.view.type
|
|
290
290
|
=== SharedViews.SERVICE_UNAVAILABLE_ERROR_VIEW && (jsx(ServiceUnavailableErrorView, { onCloseClick: () => sendOnRampWidgetCloseEvent(eventTarget) }))] }));
|
|
291
291
|
}
|
|
292
292
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { u as useMount, T as TopUpView } from './TopUpView-
|
|
3
|
-
import { T as TokenImage } from './TokenImage-
|
|
4
|
-
import { F as Fees, B as BridgeWidget } from './BridgeWidget-
|
|
5
|
-
import OnRampWidget from './OnRampWidget-
|
|
6
|
-
import { a as SwapWidget } from './SwapWidget-
|
|
7
|
-
import './WalletApproveHero-
|
|
8
|
-
import './useInterval-
|
|
9
|
-
import './FeesBreakdown-
|
|
10
|
-
import './SpendingCapHero-
|
|
1
|
+
import { bN as K, d as Contract, b as reactExports, bS as hexToText, bT as compareStr, aU as ViewContext, V as ViewActions, bm as Ot, w as jsx, bU as co, k as useTranslation, bV as TransakIframe, j as calculateCryptoToFiat, F as useAnalytics, G as EventTargetContext, bW as toPascalCase, bX as sendSaleWidgetCloseEvent, bY as toStringifyTransactions, bZ as sendSaleSuccessEvent, b_ as sendSaleFailedEvent, b$ as sendSaleTransactionSuccessEvent, c0 as sendSalePaymentMethodEvent, c1 as sendSalePaymentTokenEvent, U as UserJourney, M as HeaderNavigation, x as jsxs, c2 as LoadingOverlay, B as Box, aF as Fragment, z as SimpleLayout, aV as useHandover, aW as HandoverTarget, t as getRemoteRive, H as Heading, c3 as HandoverDuration, aK as isPassportProvider, aZ as HandoverContent, aP as MenuItem, bj as motion, bi as listVariants, bk as listItemVariants, bn as xt, a5 as SharedViews, c4 as FooterLogo, c5 as StatusType, c6 as prettyFormatNumber, J as tokenValueFormat, c7 as ShimmerCircle, y as Button, S as Stack, c8 as Te, c9 as abbreviateWalletAddress, ca as formatUnits, aA as Drawer, cb as Caption, aB as Divider, cc as tokenSymbolNameOverrides, cd as Re, ce as Ce, cf as M, cg as ct, a$ as isNativeToken, b0 as getTokenImageByAddress, ch as isGasFree, I as CryptoFiatContext, Z as ConnectLoaderContext, ci as eventTargetReducer, cj as initialEventTargetState, r as ro, ck as EventTargetActions, a0 as LoadingView, aQ as J, cl as ConnectWidgetViews, a7 as ConnectWidget, u as uo, i as io, l as lo, n as no, cm as ConnectLoaderActions, a1 as CryptoFiatActions, b3 as ButtCon, D as Body, cn as widgetTheme, bI as viewReducer, bJ as initialViewState, v as tt, bR as ServiceUnavailableErrorView, Y as CryptoFiatProvider } from './index-S9AO9JR0.js';
|
|
2
|
+
import { u as useMount, T as TopUpView } from './TopUpView-D5fh2au_.js';
|
|
3
|
+
import { T as TokenImage } from './TokenImage-AbfB1fSa.js';
|
|
4
|
+
import { F as Fees, B as BridgeWidget } from './BridgeWidget-D_3RTCX2.js';
|
|
5
|
+
import OnRampWidget from './OnRampWidget-BHGaS-OH.js';
|
|
6
|
+
import { a as SwapWidget } from './SwapWidget-IkGuHL6E.js';
|
|
7
|
+
import './WalletApproveHero-CK_TX02R.js';
|
|
8
|
+
import './useInterval-B_9ZtAsp.js';
|
|
9
|
+
import './FeesBreakdown-BJbAIdyp.js';
|
|
10
|
+
import './SpendingCapHero-D7e3_oAu.js';
|
|
11
11
|
|
|
12
12
|
var SaleWidgetViews;
|
|
13
13
|
(function (SaleWidgetViews) {
|
|
@@ -542,7 +542,7 @@ function SaleContextProvider(props) {
|
|
|
542
542
|
const [showCreditCardWarning, setShowCreditCardWarning] = reactExports.useState(false);
|
|
543
543
|
const [paymentMethod, setPaymentMethodState] = reactExports.useState(undefined);
|
|
544
544
|
const setPaymentMethod = (type) => {
|
|
545
|
-
if (type ===
|
|
545
|
+
if (type === co.CREDIT && !showCreditCardWarning) {
|
|
546
546
|
setPaymentMethodState(undefined);
|
|
547
547
|
setShowCreditCardWarning(true);
|
|
548
548
|
return;
|
|
@@ -592,7 +592,7 @@ function SaleContextProvider(props) {
|
|
|
592
592
|
if (!address) {
|
|
593
593
|
return;
|
|
594
594
|
}
|
|
595
|
-
const assessment = await
|
|
595
|
+
const assessment = await Ot([address], checkout.config);
|
|
596
596
|
setRiskAssessment(assessment);
|
|
597
597
|
})();
|
|
598
598
|
}, [checkout, provider]);
|
|
@@ -1275,9 +1275,9 @@ function PayWithCoins() {
|
|
|
1275
1275
|
function PaymentOption({ type, onClick, disabled = false, caption, size, rc = jsx("span", {}), }) {
|
|
1276
1276
|
const { t } = useTranslation();
|
|
1277
1277
|
const icon = {
|
|
1278
|
-
[
|
|
1279
|
-
[
|
|
1280
|
-
[
|
|
1278
|
+
[co.CRYPTO]: 'Coins',
|
|
1279
|
+
[co.DEBIT]: 'BankCard',
|
|
1280
|
+
[co.CREDIT]: 'BankCard',
|
|
1281
1281
|
};
|
|
1282
1282
|
const handleClick = () => onClick(type);
|
|
1283
1283
|
const menuItemProps = {
|
|
@@ -1296,9 +1296,9 @@ function PaymentOption({ type, onClick, disabled = false, caption, size, rc = js
|
|
|
1296
1296
|
}
|
|
1297
1297
|
|
|
1298
1298
|
const defaultPaymentOptions = [
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1299
|
+
co.CRYPTO,
|
|
1300
|
+
co.DEBIT,
|
|
1301
|
+
co.CREDIT,
|
|
1302
1302
|
];
|
|
1303
1303
|
function PaymentOptions(props) {
|
|
1304
1304
|
const { disabledOptions = [], paymentOptions, onClick, captions, size, hideDisabledOptions, } = props;
|
|
@@ -1330,8 +1330,8 @@ function PaymentMethods() {
|
|
|
1330
1330
|
sendSelectedPaymentMethod(paymentMethod, SaleWidgetViews.PAYMENT_METHODS); // checkoutPrimarySalePaymentMethods_SelectMenuItem
|
|
1331
1331
|
}
|
|
1332
1332
|
if (paymentMethod
|
|
1333
|
-
&& [
|
|
1334
|
-
if (riskAssessment &&
|
|
1333
|
+
&& [co.DEBIT, co.CREDIT].includes(paymentMethod)) {
|
|
1334
|
+
if (riskAssessment && xt(riskAssessment)) {
|
|
1335
1335
|
const error = new Error('Sanctioned address');
|
|
1336
1336
|
sendFailedEvent(error.message, {}, [], undefined, { riskAssessment, paymentMethod });
|
|
1337
1337
|
viewDispatch({
|
|
@@ -1366,7 +1366,7 @@ function PaymentMethods() {
|
|
|
1366
1366
|
},
|
|
1367
1367
|
});
|
|
1368
1368
|
}
|
|
1369
|
-
if (paymentMethod && paymentMethod ===
|
|
1369
|
+
if (paymentMethod && paymentMethod === co.CRYPTO) {
|
|
1370
1370
|
viewDispatch({
|
|
1371
1371
|
payload: {
|
|
1372
1372
|
type: ViewActions.UPDATE_VIEW,
|
|
@@ -1648,7 +1648,7 @@ const getTotalFeesBySymbol = (fees, tokenInfo) => fees
|
|
|
1648
1648
|
return acc;
|
|
1649
1649
|
}, {});
|
|
1650
1650
|
const getFundingBalanceTotalFees = (balance) => {
|
|
1651
|
-
if (balance.type !==
|
|
1651
|
+
if (balance.type !== Te.SWAP) {
|
|
1652
1652
|
return {};
|
|
1653
1653
|
}
|
|
1654
1654
|
const fees = [
|
|
@@ -1661,7 +1661,7 @@ const getFundingBalanceTotalFees = (balance) => {
|
|
|
1661
1661
|
};
|
|
1662
1662
|
const getFundingBalanceFeeBreakDown = (balance, conversions, t) => {
|
|
1663
1663
|
const feesBreakdown = [];
|
|
1664
|
-
if (balance.type !==
|
|
1664
|
+
if (balance.type !== Te.SWAP) {
|
|
1665
1665
|
return [];
|
|
1666
1666
|
}
|
|
1667
1667
|
const addFee = (fee, label, prefix = '~ ') => {
|
|
@@ -1719,7 +1719,7 @@ function CoinsDrawer({ conversions, balances, selectedIndex, visible, loading, t
|
|
|
1719
1719
|
if (balances.length > 3) {
|
|
1720
1720
|
size = 'small';
|
|
1721
1721
|
}
|
|
1722
|
-
const otherPaymentOptions = [
|
|
1722
|
+
const otherPaymentOptions = [co.DEBIT, co.CREDIT];
|
|
1723
1723
|
const withOtherOptions = !otherPaymentOptions.every((type) => disabledPaymentTypes?.includes(type));
|
|
1724
1724
|
return (jsx(Drawer, { size: "full", visible: visible, showHeaderBar: true, onCloseDrawer: onClose, headerBarTitle: t('views.ORDER_SUMMARY.coinsDrawer.header'), children: jsx(Drawer.Content, { rc: jsx(motion.div, { variants: listVariants, initial: "hidden", animate: "show" }), children: jsxs(Box, { sx: {
|
|
1725
1725
|
height: '100%',
|
|
@@ -1732,8 +1732,8 @@ function CoinsDrawer({ conversions, balances, selectedIndex, visible, loading, t
|
|
|
1732
1732
|
justifyContent: 'space-between',
|
|
1733
1733
|
mb: 'base.spacing.x2',
|
|
1734
1734
|
}, children: [jsx(Caption, { size: "small", children: t('views.ORDER_SUMMARY.coinsDrawer.caption1') }), jsx(Caption, { size: "small", children: t('views.ORDER_SUMMARY.coinsDrawer.caption2') })] }), balances?.map((balance, idx) => (jsx(CoinsDrawerItem, { onClick: handleOnclick(idx), balance: balance, selected: selectedIndex === idx, conversions: conversions, transactionRequirement: transactionRequirement, size: size, theme: theme, environment: environment, rc: jsx(motion.div, { variants: listItemVariants, custom: idx }) }, `${balance.fundingItem.token.symbol}-${balance.type}`))), loading && (jsx(motion.div, { variants: listItemVariants, custom: balances.length, children: jsx(MenuItem, { shimmer: true, emphasized: true, size: size, testId: "funding-balance-item-shimmer" }) }, "funding-balance-item-shimmer"))] }), onPayWithCard && (jsxs(Box, { sx: { pb: 'base.spacing.x4' }, rc: (jsx(motion.div, { variants: listItemVariants, custom: balances.length + (loading ? 1 : 0) })), children: [withOtherOptions && (jsx(Divider, { size: "small", rc: jsx(Caption, {}), sx: { my: 'base.spacing.x4' }, children: t('views.ORDER_SUMMARY.coinsDrawer.divider') })), jsx(PaymentOptions, { onClick: onPayWithCard, size: size, hideDisabledOptions: true, paymentOptions: otherPaymentOptions, disabledOptions: disabledPaymentTypes, captions: {
|
|
1735
|
-
[
|
|
1736
|
-
[
|
|
1735
|
+
[co.DEBIT]: t('views.PAYMENT_METHODS.options.debit.caption'),
|
|
1736
|
+
[co.CREDIT]: t('views.PAYMENT_METHODS.options.credit.caption'),
|
|
1737
1737
|
} })] }))] }) }) }));
|
|
1738
1738
|
}
|
|
1739
1739
|
|
|
@@ -1820,7 +1820,7 @@ function OrderReview({ fundingBalances, conversions, collectionName, loadingBala
|
|
|
1820
1820
|
if (!conversions?.size || !provider) {
|
|
1821
1821
|
return;
|
|
1822
1822
|
}
|
|
1823
|
-
if (fundingBalance.type !==
|
|
1823
|
+
if (fundingBalance.type !== Te.SWAP) {
|
|
1824
1824
|
return;
|
|
1825
1825
|
}
|
|
1826
1826
|
const totalFees = getFundingBalanceTotalFees(fundingBalance);
|
|
@@ -1843,7 +1843,7 @@ function OrderReview({ fundingBalances, conversions, collectionName, loadingBala
|
|
|
1843
1843
|
});
|
|
1844
1844
|
}, [fundingBalance, conversions, provider]);
|
|
1845
1845
|
reactExports.useEffect(() => {
|
|
1846
|
-
if (fundingBalance.type ===
|
|
1846
|
+
if (fundingBalance.type === Te.SWAP) {
|
|
1847
1847
|
return;
|
|
1848
1848
|
}
|
|
1849
1849
|
if (!gasFees || gasFees.balance <= 0) {
|
|
@@ -1926,9 +1926,9 @@ const getERC20ItemRequirement = (amount, spenderAddress, tokenAddress) => [
|
|
|
1926
1926
|
},
|
|
1927
1927
|
];
|
|
1928
1928
|
const getGasEstimate = () => ({
|
|
1929
|
-
type:
|
|
1929
|
+
type: Re.GAS,
|
|
1930
1930
|
gasToken: {
|
|
1931
|
-
type:
|
|
1931
|
+
type: Ce.NATIVE,
|
|
1932
1932
|
limit: BigInt(MAX_GAS_LIMIT),
|
|
1933
1933
|
},
|
|
1934
1934
|
});
|
|
@@ -1989,7 +1989,7 @@ const getFundingBalances = (smartCheckoutResult, environment) => {
|
|
|
1989
1989
|
}
|
|
1990
1990
|
if (smartCheckoutResult.sufficient === false
|
|
1991
1991
|
&& smartCheckoutResult?.router?.routingOutcome.type
|
|
1992
|
-
===
|
|
1992
|
+
=== ct.ROUTES_FOUND) {
|
|
1993
1993
|
return getAlternativeFundingSteps(smartCheckoutResult.router.routingOutcome.fundingRoutes, environment);
|
|
1994
1994
|
}
|
|
1995
1995
|
return null;
|
|
@@ -2037,7 +2037,7 @@ const getZeroFee = (fee) => ({
|
|
|
2037
2037
|
formattedAmount: '0',
|
|
2038
2038
|
});
|
|
2039
2039
|
const getGasFreeBalanceAdjustment = (balance, provider) => {
|
|
2040
|
-
if (balance.type !==
|
|
2040
|
+
if (balance.type !== Te.SWAP) {
|
|
2041
2041
|
return balance;
|
|
2042
2042
|
}
|
|
2043
2043
|
if (!isGasFree(provider)) {
|
|
@@ -2268,33 +2268,33 @@ function FundingRouteExecute({ fundingRouteStep, onFundingRouteExecuted, }) {
|
|
|
2268
2268
|
const network = await checkout.getNetworkInfo({
|
|
2269
2269
|
provider,
|
|
2270
2270
|
});
|
|
2271
|
-
if (step.type ===
|
|
2271
|
+
if (step.type === Te.BRIDGE) {
|
|
2272
2272
|
setBridgeParams({
|
|
2273
2273
|
tokenAddress: step.fundingItem.token.address,
|
|
2274
2274
|
amount: step.fundingItem.fundsRequired.formattedAmount,
|
|
2275
2275
|
});
|
|
2276
|
-
if (Number(network.chainId) ===
|
|
2276
|
+
if (Number(network.chainId) === checkout.config.l1ChainId) {
|
|
2277
2277
|
setView(FundingRouteExecuteViews.EXECUTE_BRIDGE);
|
|
2278
2278
|
return;
|
|
2279
2279
|
}
|
|
2280
2280
|
nextView.current = FundingRouteExecuteViews.EXECUTE_BRIDGE;
|
|
2281
2281
|
setView(FundingRouteExecuteViews.SWITCH_NETWORK_ETH);
|
|
2282
2282
|
}
|
|
2283
|
-
if (step.type ===
|
|
2283
|
+
if (step.type === Te.SWAP) {
|
|
2284
2284
|
setSwapParams({
|
|
2285
2285
|
amount: step.fundingItem.fundsRequired.formattedAmount,
|
|
2286
2286
|
fromTokenAddress: step.fundingItem.token.address,
|
|
2287
2287
|
toTokenAddress: requiredTokenAddress,
|
|
2288
2288
|
autoProceed: true,
|
|
2289
2289
|
});
|
|
2290
|
-
if (Number(network.chainId) ===
|
|
2290
|
+
if (Number(network.chainId) === checkout.config.l2ChainId) {
|
|
2291
2291
|
setView(FundingRouteExecuteViews.EXECUTE_SWAP);
|
|
2292
2292
|
return;
|
|
2293
2293
|
}
|
|
2294
2294
|
nextView.current = FundingRouteExecuteViews.EXECUTE_SWAP;
|
|
2295
2295
|
setView(FundingRouteExecuteViews.SWITCH_NETWORK_ZKEVM);
|
|
2296
2296
|
}
|
|
2297
|
-
if (step.type ===
|
|
2297
|
+
if (step.type === Te.ONRAMP) {
|
|
2298
2298
|
setOnRampParams({
|
|
2299
2299
|
amount: step.fundingItem.fundsRequired.formattedAmount,
|
|
2300
2300
|
tokenAddress: step.fundingItem.token.address,
|
|
@@ -2326,30 +2326,30 @@ function FundingRouteExecute({ fundingRouteStep, onFundingRouteExecuted, }) {
|
|
|
2326
2326
|
};
|
|
2327
2327
|
const handleCustomEvent = (event) => {
|
|
2328
2328
|
switch (event.detail.type) {
|
|
2329
|
-
case
|
|
2329
|
+
case io.SUCCESS: {
|
|
2330
2330
|
const successEvent = event.detail.data;
|
|
2331
2331
|
stepSuccess.current = successEvent;
|
|
2332
2332
|
onCloseWidget();
|
|
2333
2333
|
break;
|
|
2334
2334
|
}
|
|
2335
|
-
case
|
|
2336
|
-
case
|
|
2335
|
+
case lo.TRANSACTION_SENT:
|
|
2336
|
+
case uo.SUCCESS: {
|
|
2337
2337
|
const successEvent = event.detail.data;
|
|
2338
2338
|
stepSuccess.current = successEvent;
|
|
2339
2339
|
break;
|
|
2340
2340
|
}
|
|
2341
|
-
case
|
|
2342
|
-
case
|
|
2343
|
-
case
|
|
2341
|
+
case lo.FAILURE:
|
|
2342
|
+
case io.FAILURE:
|
|
2343
|
+
case uo.FAILURE: {
|
|
2344
2344
|
// On FAILURE, widget will prompt user to try again.
|
|
2345
2345
|
// We need to know if it failed though when they close the widget
|
|
2346
2346
|
const failureEvent = event.detail.data;
|
|
2347
2347
|
stepFailed.current = failureEvent;
|
|
2348
2348
|
break;
|
|
2349
2349
|
}
|
|
2350
|
-
case
|
|
2351
|
-
case
|
|
2352
|
-
case
|
|
2350
|
+
case lo.CLOSE_WIDGET:
|
|
2351
|
+
case io.CLOSE_WIDGET:
|
|
2352
|
+
case uo.CLOSE_WIDGET: {
|
|
2353
2353
|
onCloseWidget();
|
|
2354
2354
|
break;
|
|
2355
2355
|
}
|
|
@@ -2357,7 +2357,7 @@ function FundingRouteExecute({ fundingRouteStep, onFundingRouteExecuted, }) {
|
|
|
2357
2357
|
};
|
|
2358
2358
|
const handleConnectEvent = (event) => {
|
|
2359
2359
|
switch (event.detail.type) {
|
|
2360
|
-
case
|
|
2360
|
+
case no.SUCCESS: {
|
|
2361
2361
|
const eventData = event.detail.data;
|
|
2362
2362
|
connectLoaderDispatch({
|
|
2363
2363
|
payload: {
|
|
@@ -2371,8 +2371,8 @@ function FundingRouteExecute({ fundingRouteStep, onFundingRouteExecuted, }) {
|
|
|
2371
2371
|
}
|
|
2372
2372
|
break;
|
|
2373
2373
|
}
|
|
2374
|
-
case
|
|
2375
|
-
case
|
|
2374
|
+
case no.FAILURE:
|
|
2375
|
+
case no.CLOSE_WIDGET:
|
|
2376
2376
|
default:
|
|
2377
2377
|
onCloseWidget();
|
|
2378
2378
|
break;
|
|
@@ -2380,15 +2380,15 @@ function FundingRouteExecute({ fundingRouteStep, onFundingRouteExecuted, }) {
|
|
|
2380
2380
|
};
|
|
2381
2381
|
reactExports.useEffect(() => {
|
|
2382
2382
|
// Handle the connect event when switching networks
|
|
2383
|
-
eventTarget.addEventListener(
|
|
2383
|
+
eventTarget.addEventListener(ro.IMTBL_CONNECT_WIDGET_EVENT, handleConnectEvent);
|
|
2384
2384
|
// Handle the other widget events
|
|
2385
|
-
eventTarget.addEventListener(
|
|
2386
|
-
eventTarget.addEventListener(
|
|
2385
|
+
eventTarget.addEventListener(ro.IMTBL_BRIDGE_WIDGET_EVENT, handleCustomEvent);
|
|
2386
|
+
eventTarget.addEventListener(ro.IMTBL_SWAP_WIDGET_EVENT, handleCustomEvent);
|
|
2387
2387
|
// Remove the custom event listener when the component unmounts
|
|
2388
2388
|
return () => {
|
|
2389
|
-
eventTarget.removeEventListener(
|
|
2390
|
-
eventTarget.removeEventListener(
|
|
2391
|
-
eventTarget.removeEventListener(
|
|
2389
|
+
eventTarget.removeEventListener(ro.IMTBL_CONNECT_WIDGET_EVENT, handleConnectEvent);
|
|
2390
|
+
eventTarget.removeEventListener(ro.IMTBL_BRIDGE_WIDGET_EVENT, handleCustomEvent);
|
|
2391
|
+
eventTarget.removeEventListener(ro.IMTBL_SWAP_WIDGET_EVENT, handleCustomEvent);
|
|
2392
2392
|
};
|
|
2393
2393
|
}, []);
|
|
2394
2394
|
reactExports.useEffect(() => {
|
|
@@ -2399,9 +2399,9 @@ function FundingRouteExecute({ fundingRouteStep, onFundingRouteExecuted, }) {
|
|
|
2399
2399
|
},
|
|
2400
2400
|
});
|
|
2401
2401
|
}, [checkout]);
|
|
2402
|
-
return (jsxs(EventTargetContext.Provider, { value: eventTargetReducerValues, children: [view === FundingRouteExecuteViews.LOADING && (jsx(LoadingView, { loadingText: t('views.ORDER_SUMMARY.loading.balances') })), view === FundingRouteExecuteViews.EXECUTE_BRIDGE && (jsx(BridgeWidget, { ...bridgeParams, config: config, checkout: checkout })), view === FundingRouteExecuteViews.EXECUTE_SWAP && (jsx(SwapWidget, { ...swapParams, config: config })), view === FundingRouteExecuteViews.EXECUTE_ON_RAMP && (jsx(OnRampWidget, { config: config, ...onRampParams })), view === FundingRouteExecuteViews.SWITCH_NETWORK_ETH && (jsx(ConnectWidget, { config: config, targetChainId: checkout.config.isProduction ?
|
|
2403
|
-
?
|
|
2404
|
-
:
|
|
2402
|
+
return (jsxs(EventTargetContext.Provider, { value: eventTargetReducerValues, children: [view === FundingRouteExecuteViews.LOADING && (jsx(LoadingView, { loadingText: t('views.ORDER_SUMMARY.loading.balances') })), view === FundingRouteExecuteViews.EXECUTE_BRIDGE && (jsx(BridgeWidget, { ...bridgeParams, config: config, checkout: checkout })), view === FundingRouteExecuteViews.EXECUTE_SWAP && (jsx(SwapWidget, { ...swapParams, config: config })), view === FundingRouteExecuteViews.EXECUTE_ON_RAMP && (jsx(OnRampWidget, { config: config, ...onRampParams })), view === FundingRouteExecuteViews.SWITCH_NETWORK_ETH && (jsx(ConnectWidget, { config: config, targetChainId: checkout.config.isProduction ? J.ETHEREUM : J.SEPOLIA, browserProvider: provider, checkout: checkout, deepLink: ConnectWidgetViews.SWITCH_NETWORK })), view === FundingRouteExecuteViews.SWITCH_NETWORK_ZKEVM && (jsx(ConnectWidget, { config: config, targetChainId: checkout.config.isProduction
|
|
2403
|
+
? J.IMTBL_ZKEVM_MAINNET
|
|
2404
|
+
: J.IMTBL_ZKEVM_TESTNET, browserProvider: provider, checkout: checkout, deepLink: ConnectWidgetViews.SWITCH_NETWORK }))] }));
|
|
2405
2405
|
}
|
|
2406
2406
|
|
|
2407
2407
|
function LoadingHandover({ text, duration, animationUrl, inputValue = 0, }) {
|
|
@@ -2449,7 +2449,7 @@ function OrderSummary({ subView }) {
|
|
|
2449
2449
|
signAndProceed(selectedCurrency?.address);
|
|
2450
2450
|
};
|
|
2451
2451
|
const onProceedToBuy = (fundingBalance) => {
|
|
2452
|
-
if (riskAssessment &&
|
|
2452
|
+
if (riskAssessment && xt(riskAssessment)) {
|
|
2453
2453
|
const error = new Error('Sanctioned address');
|
|
2454
2454
|
sendFailedEvent(error.message, {}, [], undefined, { riskAssessment, paymentMethod });
|
|
2455
2455
|
viewDispatch({
|
|
@@ -2561,7 +2561,7 @@ function CreditCardWarningDrawer() {
|
|
|
2561
2561
|
const { t } = useTranslation();
|
|
2562
2562
|
const { showCreditCardWarning, setShowCreditCardWarning, setPaymentMethod } = useSaleContext();
|
|
2563
2563
|
const handleCtaButtonClick = () => {
|
|
2564
|
-
setPaymentMethod(
|
|
2564
|
+
setPaymentMethod(co.CREDIT);
|
|
2565
2565
|
};
|
|
2566
2566
|
return (jsx(Drawer, { size: "threeQuarter", visible: showCreditCardWarning, showHeaderBar: false, children: jsxs(Drawer.Content, { children: [jsx(ButtCon, { icon: "Close", variant: "tertiary", sx: {
|
|
2567
2567
|
pos: 'absolute',
|
|
@@ -2634,7 +2634,7 @@ function SaleWidget(props) {
|
|
|
2634
2634
|
customOrderData,
|
|
2635
2635
|
waitFulfillmentSettlements,
|
|
2636
2636
|
hideExcludedPaymentTypes,
|
|
2637
|
-
}, children: jsxs(CryptoFiatProvider, { environment: config.environment, children: [viewState.view.type === SharedViews.LOADING_VIEW && (jsx(LoadingView, { loadingText: loadingText })), viewState.view.type === SaleWidgetViews.PAYMENT_METHODS && (jsx(PaymentMethods, {})), viewState.view.type === SaleWidgetViews.PAY_WITH_CARD && (jsx(PayWithCard, {})), viewState.view.type === SaleWidgetViews.PAY_WITH_COINS && (jsx(PayWithCoins, {})), viewState.view.type === SaleWidgetViews.SALE_FAIL && (jsx(SaleErrorView, { biomeTheme: biomeTheme, errorType: viewState.view.data?.errorType, transactionHash: viewState.view.data?.transactionHash, blockExplorerLink:
|
|
2637
|
+
}, children: jsxs(CryptoFiatProvider, { environment: config.environment, children: [viewState.view.type === SharedViews.LOADING_VIEW && (jsx(LoadingView, { loadingText: loadingText })), viewState.view.type === SaleWidgetViews.PAYMENT_METHODS && (jsx(PaymentMethods, {})), viewState.view.type === SaleWidgetViews.PAY_WITH_CARD && (jsx(PayWithCard, {})), viewState.view.type === SaleWidgetViews.PAY_WITH_COINS && (jsx(PayWithCoins, {})), viewState.view.type === SaleWidgetViews.SALE_FAIL && (jsx(SaleErrorView, { biomeTheme: biomeTheme, errorType: viewState.view.data?.errorType, transactionHash: viewState.view.data?.transactionHash, blockExplorerLink: tt.getTransactionLink(chainId.current, viewState.view.data?.transactionHash) })), viewState.view.type === SaleWidgetViews.ORDER_SUMMARY && (jsx(OrderSummary, { subView: viewState.view.subView })), viewState.view.type === SharedViews.TOP_UP_VIEW && (jsx(TopUpView, { analytics: { userJourney: UserJourney.SALE }, widgetEvent: ro.IMTBL_SALE_WIDGET_EVENT, checkout: checkout, provider: provider, showOnrampOption: config.isOnRampEnabled, showSwapOption: false, showBridgeOption: config.isBridgeEnabled, onCloseButtonClick: () => sendSaleWidgetCloseEvent(eventTarget), onBackButtonClick: () => {
|
|
2638
2638
|
viewDispatch({
|
|
2639
2639
|
payload: {
|
|
2640
2640
|
type: ViewActions.UPDATE_VIEW,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { w as jsx, c$ as heroBackGroundStyles, B as Box, d0 as heroImageStyles, dF as heroImageBottomAlign, x as jsxs } from './index-S9AO9JR0.js';
|
|
2
2
|
|
|
3
3
|
function SpendingCapHero() {
|
|
4
4
|
return (jsx(Box, { sx: { ...heroBackGroundStyles, background: 'base.color.translucent.emphasis.100' }, children: jsx(Box, { sx: { ...heroImageStyles, ...heroImageBottomAlign }, children: jsxs("svg", { width: "430", height: "305", viewBox: "0 0 430 305", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { d: "M94.0614 105.632L93.6321 104L92 104.429L92.4292 106.061L94.0614 105.632Z", fill: "white" }), jsx("path", { d: "M63.6531 193.101L63.1006 191L60.9996 191.553L61.5521 193.654L63.6531 193.101Z", fill: "white" }), jsx("path", { d: "M344.489 224.345L342.345 224L342 226.145L344.144 226.49L344.489 224.345Z", fill: "white" }), jsx("path", { d: "M372.286 139.905L372.905 138.619L371.619 138L371 139.286L372.286 139.905Z", fill: "white" }), jsx("path", { d: "M341.653 78.101L341.101 76L339 76.5525L339.552 78.6535L341.653 78.101Z", fill: "white" }), jsx("path", { d: "M359.286 242.905L359.905 241.619L358.619 241L358 242.286L359.286 242.905Z", fill: "white" }), jsx("path", { d: "M87.0123 112.087L86.0869 111L85.0002 111.925L85.9256 113.012L87.0123 112.087Z", fill: "white" }), jsx("path", { d: "M84.2862 248.905L84.9053 247.619L83.6192 247L83.0001 248.286L84.2862 248.905Z", fill: "white" }), jsx("path", { d: "M215.496 262.992C268.237 262.992 310.993 220.237 310.993 167.496C310.993 114.755 268.237 72 215.496 72C162.755 72 120 114.755 120 167.496C120 220.237 162.755 262.992 215.496 262.992Z", fill: "white", fillOpacity: "0.24", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M159.82 95.1695C179.975 79.6536 204.651 73.1506 227.89 77.0665C261.089 82.6606 253.281 101.028 199.197 121.314C151.934 139.037 123.49 136.348 143.823 110.95C148.422 105.208 153.721 99.8623 159.82 95.1695Z", fill: "white", fillOpacity: "0.08" }), jsx("path", { d: "M215.497 227.183C171.451 227.183 135.159 219.871 130.194 210.462H130.187C145.912 241.626 178.21 263.001 215.497 263.001C252.705 263.001 284.942 241.719 300.706 210.664C295.33 219.98 259.232 227.183 215.505 227.183H215.497Z", fill: "#36E0F8", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M284.219 219.607L283.978 219.84C281.275 222.482 256.583 215.986 253.172 218.418C222.389 240.36 182.779 269.061 146.099 219.397C146.099 219.397 140.761 217.641 138.609 216.686C139.425 217.96 140.279 219.226 141.165 220.469C170.425 261.516 227.423 271.073 268.47 241.813C276.97 235.752 284.118 228.503 289.852 220.454L292.424 216.841L288.252 218.302C287.086 218.713 285.851 219.11 284.553 219.498L284.227 219.599L284.219 219.607Z", fill: "black" }), jsx("path", { d: "M215.496 241.4C262.183 241.4 300.03 226.557 300.03 208.248C300.03 189.938 262.183 175.095 215.496 175.095C168.81 175.095 130.963 189.938 130.963 208.248C130.963 226.557 168.81 241.4 215.496 241.4Z", fill: "#F191FA", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M300.705 210.659C300.705 210.659 300.705 210.65 300.705 210.641C300.705 210.641 300.705 210.65 300.705 210.659Z", fill: "#EBE9E9", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M193.624 204.511C208.952 204.511 221.377 199.638 221.377 193.626C221.377 187.614 208.952 182.741 193.624 182.741C178.297 182.741 165.871 187.614 165.871 193.626C165.871 199.638 178.297 204.511 193.624 204.511Z", fill: "#D0F500", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M193.624 204.511C208.954 204.511 221.377 199.64 221.377 193.626V201.349C221.377 207.363 208.954 212.234 193.624 212.234C178.295 212.234 165.871 207.363 165.871 201.349V193.626C165.871 199.64 178.295 204.511 193.624 204.511Z", fill: "#E4F4F7", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M197.33 204.41C199.49 204.294 201.573 204.084 203.546 203.789V211.512C201.573 211.807 199.49 212.017 197.33 212.133V204.41Z", fill: "#D0F500" }), jsx("path", { d: "M206.398 203.291C211.246 202.304 215.255 200.774 217.905 198.901V206.624C215.255 208.497 211.246 210.027 206.398 211.014V203.291Z", fill: "black" }), jsx("path", { d: "M193.624 204.511C208.954 204.511 221.377 199.64 221.377 193.626V201.349C221.377 207.363 208.954 212.234 193.624 212.234C178.295 212.234 165.871 207.363 165.871 201.349V193.626C165.871 199.64 178.295 204.511 193.624 204.511Z", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M206.398 211.015C211.246 210.028 215.255 208.497 217.905 206.625", stroke: "#A66CFF", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M193.624 196.788C208.952 196.788 221.377 191.914 221.377 185.903C221.377 179.891 208.952 175.017 193.624 175.017C178.297 175.017 165.871 179.891 165.871 185.903C165.871 191.914 178.297 196.788 193.624 196.788Z", fill: "#D0F500", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M193.624 196.788C208.954 196.788 221.377 191.917 221.377 185.903V193.626C221.377 199.639 208.954 204.511 193.624 204.511C178.295 204.511 165.871 199.639 165.871 193.626V185.903C165.871 191.917 178.295 196.788 193.624 196.788Z", fill: "#E4F4F7", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M197.33 196.687C199.49 196.57 201.573 196.361 203.546 196.065V203.788C201.573 204.084 199.49 204.293 197.33 204.41V196.687Z", fill: "#36E0F8" }), jsx("path", { d: "M206.398 195.568C211.246 194.581 215.255 193.051 217.905 191.178V198.901C215.255 200.774 211.246 202.304 206.398 203.291V195.568Z", fill: "black" }), jsx("path", { d: "M193.624 196.788C208.954 196.788 221.377 191.917 221.377 185.903V193.626C221.377 199.639 208.954 204.511 193.624 204.511C178.295 204.511 165.871 199.639 165.871 193.626V185.903C165.871 191.917 178.295 196.788 193.624 196.788Z", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M206.398 203.291C211.246 202.304 215.255 200.774 217.905 198.901", stroke: "white", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M193.624 189.065C208.952 189.065 221.377 184.192 221.377 178.18C221.377 172.168 208.952 167.294 193.624 167.294C178.297 167.294 165.871 172.168 165.871 178.18C165.871 184.192 178.297 189.065 193.624 189.065Z", fill: "#F191FA", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M193.624 189.065C208.954 189.065 221.377 184.194 221.377 178.18V185.903C221.377 191.917 208.954 196.788 193.624 196.788C178.295 196.788 165.871 191.917 165.871 185.903V178.18C165.871 184.194 178.295 189.065 193.624 189.065Z", fill: "#E4F4F7", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M197.33 188.965C199.49 188.849 201.573 188.639 203.546 188.343V196.067C201.573 196.362 199.49 196.571 197.33 196.688V188.965Z", fill: "#F191FA" }), jsx("path", { d: "M206.398 187.845C211.246 186.858 215.255 185.327 217.905 183.455V191.178C215.255 193.05 211.246 194.581 206.398 195.568V187.845Z", fill: "black" }), jsx("path", { d: "M193.624 189.065C208.954 189.065 221.377 184.194 221.377 178.18V185.903C221.377 191.917 208.954 196.788 193.624 196.788C178.295 196.788 165.871 191.917 165.871 185.903V178.18C165.871 184.194 178.295 189.065 193.624 189.065Z", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M206.398 195.569C211.246 194.582 215.255 193.052 217.905 191.179", stroke: "white", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M238.601 212.934C253.929 212.934 266.354 208.06 266.354 202.049C266.354 196.037 253.929 191.164 238.601 191.164C223.274 191.164 210.848 196.037 210.848 202.049C210.848 208.06 223.274 212.934 238.601 212.934Z", fill: "#D0F500", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M238.601 212.935C253.931 212.935 266.354 208.063 266.354 202.049V209.772C266.354 215.786 253.931 220.658 238.601 220.658C223.272 220.658 210.848 215.786 210.848 209.772V202.049C210.848 208.063 223.272 212.935 238.601 212.935Z", fill: "#E4F4F7", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M242.307 212.833C244.467 212.717 246.55 212.507 248.523 212.212V219.935C246.55 220.23 244.467 220.44 242.307 220.556V212.833Z", fill: "#F191FA" }), jsx("path", { d: "M251.375 211.713C256.223 210.727 260.232 209.196 262.882 207.324V215.047C260.232 216.919 256.223 218.45 251.375 219.436V211.713Z", fill: "black" }), jsx("path", { d: "M238.601 212.935C253.931 212.935 266.354 208.063 266.354 202.049V209.772C266.354 215.786 253.931 220.658 238.601 220.658C223.272 220.658 210.848 215.786 210.848 209.772V202.049C210.848 208.063 223.272 212.935 238.601 212.935Z", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M251.375 219.437C256.223 218.45 260.232 216.919 262.882 215.047", stroke: "white", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M238.601 205.21C253.929 205.21 266.354 200.336 266.354 194.324C266.354 188.313 253.929 183.439 238.601 183.439C223.274 183.439 210.848 188.313 210.848 194.324C210.848 200.336 223.274 205.21 238.601 205.21Z", fill: "#D0F500", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M238.601 205.21C253.931 205.21 266.354 200.339 266.354 194.325V202.048C266.354 208.062 253.931 212.934 238.601 212.934C223.272 212.934 210.848 208.062 210.848 202.048V194.325C210.848 200.339 223.272 205.21 238.601 205.21Z", fill: "#E4F4F7", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M242.307 205.109C244.467 204.993 246.55 204.783 248.523 204.488V212.211C246.55 212.506 244.467 212.716 242.307 212.832V205.109Z", fill: "#36E0F8" }), jsx("path", { d: "M251.375 203.989C256.223 203.003 260.232 201.472 262.882 199.6V207.323C260.232 209.195 256.223 210.726 251.375 211.712V203.989Z", fill: "black" }), jsx("path", { d: "M238.601 205.21C253.931 205.21 266.354 200.339 266.354 194.325V202.048C266.354 208.062 253.931 212.934 238.601 212.934C223.272 212.934 210.848 208.062 210.848 202.048V194.325C210.848 200.339 223.272 205.21 238.601 205.21Z", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M251.375 211.713C256.223 210.726 260.232 209.195 262.882 207.323", stroke: "white", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M238.601 197.487C253.929 197.487 266.354 192.613 266.354 186.602C266.354 180.59 253.929 175.716 238.601 175.716C223.274 175.716 210.848 180.59 210.848 186.602C210.848 192.613 223.274 197.487 238.601 197.487Z", fill: "#F191FA", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M238.601 197.487C253.931 197.487 266.354 192.616 266.354 186.602V194.325C266.354 200.339 253.931 205.21 238.601 205.21C223.272 205.21 210.848 200.339 210.848 194.325V186.602C210.848 192.616 223.272 197.487 238.601 197.487Z", fill: "#E4F4F7", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M242.307 197.386C244.467 197.27 246.55 197.06 248.523 196.765V204.488C246.55 204.783 244.467 204.992 242.307 205.109V197.386Z", fill: "#F191FA" }), jsx("path", { d: "M251.375 196.267C256.223 195.28 260.232 193.75 262.882 191.877V199.6C260.232 201.473 256.223 203.003 251.375 203.99V196.267Z", fill: "#9AEFFB" }), jsx("path", { d: "M238.601 197.487C253.931 197.487 266.354 192.616 266.354 186.602V194.325C266.354 200.339 253.931 205.21 238.601 205.21C223.272 205.21 210.848 200.339 210.848 194.325V186.602C210.848 192.616 223.272 197.487 238.601 197.487Z", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M251.375 203.99C256.223 203.004 260.232 201.473 262.882 199.601", stroke: "white", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M232.652 189.678C247.979 189.678 260.405 184.804 260.405 178.793C260.405 172.781 247.979 167.908 232.652 167.908C217.324 167.908 204.899 172.781 204.899 178.793C204.899 184.804 217.324 189.678 232.652 189.678Z", fill: "#F191FA", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M232.652 189.678C247.981 189.678 260.405 184.807 260.405 178.793V186.516C260.405 192.53 247.981 197.401 232.652 197.401C217.323 197.401 204.899 192.53 204.899 186.516V178.793C204.899 184.807 217.323 189.678 232.652 189.678Z", fill: "#E4F4F7", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M236.358 189.578C238.518 189.461 240.6 189.251 242.574 188.956V196.679C240.6 196.974 238.518 197.184 236.358 197.301V189.578Z", fill: "#F191FA" }), jsx("path", { d: "M245.426 188.458C250.274 187.471 254.283 185.94 256.932 184.067V191.791C254.283 193.663 250.274 195.194 245.426 196.18V188.458Z", fill: "black" }), jsx("path", { d: "M232.652 189.678C247.981 189.678 260.405 184.807 260.405 178.793V186.516C260.405 192.53 247.981 197.401 232.652 197.401C217.323 197.401 204.899 192.53 204.899 186.516V178.793C204.899 184.807 217.323 189.678 232.652 189.678Z", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M245.426 196.182C250.274 195.195 254.283 193.664 256.932 191.792", stroke: "white", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M240.99 180.021C256.317 180.021 268.743 175.148 268.743 169.136C268.743 163.124 256.317 158.25 240.99 158.25C225.662 158.25 213.237 163.124 213.237 169.136C213.237 175.148 225.662 180.021 240.99 180.021Z", fill: "#F191FA", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M240.99 180.021C256.319 180.021 268.743 175.15 268.743 169.136V176.859C268.743 182.873 256.319 187.744 240.99 187.744C225.66 187.744 213.237 182.873 213.237 176.859V169.136C213.237 175.15 225.66 180.021 240.99 180.021Z", fill: "#E4F4F7", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M244.696 179.92C246.856 179.804 248.938 179.594 250.911 179.299V187.022C248.938 187.317 246.856 187.527 244.696 187.643V179.92Z", fill: "#9AEFFB" }), jsx("path", { d: "M253.763 178.801C258.612 177.815 262.621 176.284 265.27 174.412V182.135C262.621 184.007 258.612 185.538 253.763 186.524V178.801Z", fill: "black" }), jsx("path", { d: "M240.99 180.021C256.319 180.021 268.743 175.15 268.743 169.136V176.859C268.743 182.873 256.319 187.744 240.99 187.744C225.66 187.744 213.237 182.873 213.237 176.859V169.136C213.237 175.15 225.66 180.021 240.99 180.021Z", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M253.763 186.525C258.612 185.538 262.621 184.007 265.27 182.135", stroke: "white", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M189.911 223.803C205.238 223.803 217.664 218.929 217.664 212.918C217.664 206.906 205.238 202.032 189.911 202.032C174.583 202.032 162.158 206.906 162.158 212.918C162.158 218.929 174.583 223.803 189.911 223.803Z", fill: "#F191FA", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M189.911 223.803C205.24 223.803 217.664 218.932 217.664 212.918V220.641C217.664 226.655 205.24 231.526 189.911 231.526C174.581 231.526 162.158 226.655 162.158 220.641V212.918C162.158 218.932 174.581 223.803 189.911 223.803Z", fill: "#E4F4F7", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M193.625 223.71C195.785 223.593 197.867 223.384 199.84 223.088V230.811C197.867 231.107 195.785 231.316 193.625 231.433V223.71Z", fill: "#F191FA" }), jsx("path", { d: "M202.685 222.583C207.533 221.596 211.542 220.066 214.191 218.193V225.916C211.542 227.789 207.533 229.319 202.685 230.306V222.583Z", fill: "#9AEFFB" }), jsx("path", { d: "M189.911 223.803C205.24 223.803 217.664 218.932 217.664 212.918V220.641C217.664 226.655 205.24 231.526 189.911 231.526C174.581 231.526 162.158 226.655 162.158 220.641V212.918C162.158 218.932 174.581 223.803 189.911 223.803Z", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M202.685 230.306C207.533 229.32 211.542 227.789 214.191 225.917", stroke: "white", strokeLinecap: "round", strokeLinejoin: "round" }), jsx("path", { d: "M300.705 210.658C300.705 210.658 300.705 210.649 300.705 210.641C300.705 210.641 300.705 210.649 300.705 210.658Z", fill: "#A66CFF", stroke: "black", strokeLinecap: "round", strokeLinejoin: "round" })] }) }) }));
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as SelectForm, T as TextInputForm, A as Accordion, b as gasAmountAccordionStyles, a as TransactionRejected, N as NetworkSwitchDrawer, W as WalletApproveHero, g as getAllowedBalances } from './WalletApproveHero-
|
|
3
|
-
import { u as useInterval } from './useInterval-
|
|
4
|
-
import { S as SwapWidgetViews, T as TopUpView } from './TopUpView-
|
|
5
|
-
import { F as FeesBreakdown } from './FeesBreakdown-
|
|
6
|
-
import { S as SpendingCapHero } from './SpendingCapHero-
|
|
1
|
+
import { k as useTranslation, x as jsxs, de as quickswapFooterStyles, B as Box, df as quickswapFooterLogoStyles, w as jsx, D as Body, dg as quickswapFooterDisclaimerTextStyles, dh as wo, X as getRemoteImage, b as reactExports, y as Button, aA as Drawer, W as CloudImage, H as Heading, cE as Logo, di as getImxTokenImage, ca as formatUnits, j as calculateCryptoToFiat, J as tokenValueFormat, ch as isGasFree, c as parseUnits, h as formatZeroAmount, cz as ShimmerBox, bH as PriceDisplay, aF as Fragment, dj as getCryptoToUSDConversion, Z as ConnectLoaderContext, a$ as isNativeToken, cS as NATIVE, aU as ViewContext, F as useAnalytics, dk as calculateFeesFiat, U as UserJourney, cV as DEFAULT_QUOTE_REFRESH_INTERVAL, aK as isPassportProvider, dl as parseEther, P as amountInputValidation, b3 as ButtCon, bj as motion, b8 as Tooltip, bd as Icon, bN as K, V as ViewActions, a5 as SharedViews, K as getDefaultTokenImage, dm as ESTIMATE_DEBOUNCE, dn as DEFAULT_TOKEN_VALIDATION_DECIMALS, bn as xt, cZ as DEFAULT_TOKEN_DECIMALS, G as EventTargetContext, dp as sendSwapWidgetCloseEvent, O as orchestrationEvents, r as ro, M as HeaderNavigation, a0 as LoadingView, z as SimpleLayout, cY as IMX_TOKEN_SYMBOL, cx as S, d1 as SimpleTextBody, d2 as FooterButton, dq as u, c$ as heroBackGroundStyles, d0 as heroImageStyles, bB as Trans, L as Link, c4 as FooterLogo, aV as useHandover, bI as viewReducer, bJ as initialViewState, dr as DEFAULT_BALANCE_RETRY_POLICY, bm as Ot, ds as yo, d7 as StatusView, dt as sendSwapSuccessEvent, c5 as StatusType, du as sendSwapFailedEvent, dv as sendSwapRejectedEvent, a6 as ErrorView, bR as ServiceUnavailableErrorView, e as ae, cQ as fe } from './index-S9AO9JR0.js';
|
|
2
|
+
import { S as SelectForm, T as TextInputForm, A as Accordion, b as gasAmountAccordionStyles, a as TransactionRejected, N as NetworkSwitchDrawer, W as WalletApproveHero, g as getAllowedBalances } from './WalletApproveHero-CK_TX02R.js';
|
|
3
|
+
import { u as useInterval } from './useInterval-B_9ZtAsp.js';
|
|
4
|
+
import { S as SwapWidgetViews, T as TopUpView } from './TopUpView-D5fh2au_.js';
|
|
5
|
+
import { F as FeesBreakdown } from './FeesBreakdown-BJbAIdyp.js';
|
|
6
|
+
import { S as SpendingCapHero } from './SpendingCapHero-D7e3_oAu.js';
|
|
7
7
|
|
|
8
8
|
function QuickswapFooter({ theme, environment }) {
|
|
9
9
|
const { t } = useTranslation();
|
|
10
|
-
const logo = theme ===
|
|
10
|
+
const logo = theme === wo.DARK
|
|
11
11
|
? getRemoteImage(environment, '/quickswapdark.webp')
|
|
12
12
|
: getRemoteImage(environment, '/quickswaplight.webp');
|
|
13
13
|
return (jsxs(Box, { testId: "quickswap-footer-container", sx: quickswapFooterStyles, children: [jsxs(Box, { testId: "quickswap-logo", sx: quickswapFooterLogoStyles, children: [jsx(Body, { size: "xSmall", sx: { paddingRight: 'base.spacing.x1' }, children: "By" }), jsx("img", { style: { height: '26px' }, alt: "Quickswap logo", src: logo })] }), jsx(Body, { testId: "quickswap-footer-disclaimer-text", size: "xSmall", sx: quickswapFooterDisclaimerTextStyles, children: t('footers.quickswapFooter.disclaimerText') })] }));
|
|
@@ -1117,7 +1117,7 @@ function SwapForm({ data, theme, cancelAutoProceed }) {
|
|
|
1117
1117
|
const sendTransaction = async () => {
|
|
1118
1118
|
if (!quote)
|
|
1119
1119
|
return;
|
|
1120
|
-
if (riskAssessment &&
|
|
1120
|
+
if (riskAssessment && xt(riskAssessment)) {
|
|
1121
1121
|
viewDispatch({
|
|
1122
1122
|
payload: {
|
|
1123
1123
|
type: ViewActions.UPDATE_VIEW,
|
|
@@ -1162,7 +1162,7 @@ function SwapForm({ data, theme, cancelAutoProceed }) {
|
|
|
1162
1162
|
const currentChainId = await provider.provider.send('eth_chainId', []);
|
|
1163
1163
|
// eslint-disable-next-line radix
|
|
1164
1164
|
const parsedChainId = parseInt(currentChainId.toString());
|
|
1165
|
-
if (parsedChainId !==
|
|
1165
|
+
if (parsedChainId !== checkout.config.l2ChainId) {
|
|
1166
1166
|
setShowNetworkSwitchDrawer(true);
|
|
1167
1167
|
return;
|
|
1168
1168
|
}
|
|
@@ -1273,7 +1273,7 @@ function SwapForm({ data, theme, cancelAutoProceed }) {
|
|
|
1273
1273
|
},
|
|
1274
1274
|
},
|
|
1275
1275
|
});
|
|
1276
|
-
}, onCloseDrawer: () => setShowNotEnoughImxDrawer(false) }), jsx(NetworkSwitchDrawer, { visible: showNetworkSwitchDrawer, targetChainId:
|
|
1276
|
+
}, onCloseDrawer: () => setShowNotEnoughImxDrawer(false) }), jsx(NetworkSwitchDrawer, { visible: showNetworkSwitchDrawer, targetChainId: checkout?.config.l2ChainId, provider: provider, checkout: checkout, onCloseDrawer: () => setShowNetworkSwitchDrawer(false) })] }));
|
|
1277
1277
|
}
|
|
1278
1278
|
|
|
1279
1279
|
const hasZeroBalance = (tokenBalances, symbol) => {
|
|
@@ -1315,7 +1315,7 @@ function SwapCoins({ theme, cancelAutoProceed, fromAmount, toAmount, fromTokenAd
|
|
|
1315
1315
|
}
|
|
1316
1316
|
}, [tokenBalances]);
|
|
1317
1317
|
return (jsxs(SimpleLayout, { header: !autoProceed ? (jsx(HeaderNavigation, { title: t('views.SWAP.header.title'), onCloseButtonClick: () => sendSwapWidgetCloseEvent(eventTarget), showBack: showBackButton, onBackButtonClick: () => {
|
|
1318
|
-
orchestrationEvents.sendRequestGoBackEvent(eventTarget,
|
|
1318
|
+
orchestrationEvents.sendRequestGoBackEvent(eventTarget, ro.IMTBL_SWAP_WIDGET_EVENT, {});
|
|
1319
1319
|
} })) : '', footer: jsx(QuickswapFooter, { environment: checkout?.config.environment, theme: theme }), children: [jsxs(Box, { sx: {
|
|
1320
1320
|
height: '100%',
|
|
1321
1321
|
display: 'flex',
|
|
@@ -1690,7 +1690,7 @@ const topUpBridgeOption = (isBridgeEnabled, isNotPassport) => {
|
|
|
1690
1690
|
return {
|
|
1691
1691
|
textKey: 'views.TOP_UP_VIEW.topUpOptions.bridge.heading',
|
|
1692
1692
|
action: () => {
|
|
1693
|
-
orchestrationEvents.sendRequestBridgeEvent(window,
|
|
1693
|
+
orchestrationEvents.sendRequestBridgeEvent(window, ro.IMTBL_BRIDGE_WIDGET_EVENT, {
|
|
1694
1694
|
tokenAddress: '',
|
|
1695
1695
|
amount: '',
|
|
1696
1696
|
});
|
|
@@ -1704,7 +1704,7 @@ const topUpOnRampOption = (isOnRampEnabled) => {
|
|
|
1704
1704
|
return {
|
|
1705
1705
|
textKey: 'views.TOP_UP_VIEW.topUpOptions.onramp.heading',
|
|
1706
1706
|
action: () => {
|
|
1707
|
-
orchestrationEvents.sendRequestOnrampEvent(window,
|
|
1707
|
+
orchestrationEvents.sendRequestOnrampEvent(window, ro.IMTBL_ONRAMP_WIDGET_EVENT, {
|
|
1708
1708
|
tokenAddress: '',
|
|
1709
1709
|
amount: '',
|
|
1710
1710
|
});
|
|
@@ -1818,7 +1818,7 @@ function SwapWidget({ amount, fromTokenAddress, toTokenAddress, config, autoProc
|
|
|
1818
1818
|
const network = await checkout.getNetworkInfo({ provider });
|
|
1819
1819
|
// If the provider's network is not the correct network, return out of this and let the
|
|
1820
1820
|
// connect loader handle the switch network functionality
|
|
1821
|
-
if (Number(network.chainId) !==
|
|
1821
|
+
if (Number(network.chainId) !== checkout.config.l2ChainId)
|
|
1822
1822
|
return;
|
|
1823
1823
|
swapDispatch({
|
|
1824
1824
|
payload: {
|
|
@@ -1842,7 +1842,7 @@ function SwapWidget({ amount, fromTokenAddress, toTokenAddress, config, autoProc
|
|
|
1842
1842
|
if (!address) {
|
|
1843
1843
|
return;
|
|
1844
1844
|
}
|
|
1845
|
-
const assessment = await
|
|
1845
|
+
const assessment = await Ot([address], checkout.config);
|
|
1846
1846
|
swapDispatch({
|
|
1847
1847
|
payload: {
|
|
1848
1848
|
type: SwapActions.SET_RISK_ASSESSMENT,
|
|
@@ -1856,7 +1856,7 @@ function SwapWidget({ amount, fromTokenAddress, toTokenAddress, config, autoProc
|
|
|
1856
1856
|
payload: {
|
|
1857
1857
|
type: SwapActions.SET_AUTO_PROCEED,
|
|
1858
1858
|
autoProceed: autoProceed ?? false,
|
|
1859
|
-
direction: direction ??
|
|
1859
|
+
direction: direction ?? yo.FROM,
|
|
1860
1860
|
},
|
|
1861
1861
|
});
|
|
1862
1862
|
}, [autoProceed, direction]);
|
|
@@ -1866,17 +1866,17 @@ function SwapWidget({ amount, fromTokenAddress, toTokenAddress, config, autoProc
|
|
|
1866
1866
|
payload: {
|
|
1867
1867
|
type: SwapActions.SET_AUTO_PROCEED,
|
|
1868
1868
|
autoProceed: false,
|
|
1869
|
-
direction:
|
|
1869
|
+
direction: yo.FROM,
|
|
1870
1870
|
},
|
|
1871
1871
|
});
|
|
1872
1872
|
}
|
|
1873
1873
|
}, [autoProceed, swapDispatch]);
|
|
1874
|
-
const fromAmount = direction ===
|
|
1875
|
-
const toAmount = direction ===
|
|
1874
|
+
const fromAmount = direction === yo.FROM || direction == null ? amount : undefined;
|
|
1875
|
+
const toAmount = direction === yo.TO ? amount : undefined;
|
|
1876
1876
|
const topUpOptions = reactExports.useMemo(() => {
|
|
1877
1877
|
const optionsArray = [];
|
|
1878
1878
|
const isNotPassport = !isPassportProvider(provider)
|
|
1879
|
-
|| walletProviderName !==
|
|
1879
|
+
|| walletProviderName !== fe.PASSPORT;
|
|
1880
1880
|
const isOnramp = topUpOnRampOption(isOnRampEnabled);
|
|
1881
1881
|
if (isOnramp) {
|
|
1882
1882
|
optionsArray.push({ ...isOnramp });
|
|
@@ -1921,6 +1921,7 @@ function SwapWidget({ amount, fromTokenAddress, toTokenAddress, config, autoProc
|
|
|
1921
1921
|
page({
|
|
1922
1922
|
userJourney: UserJourney.SWAP,
|
|
1923
1923
|
screen: 'PriceSurge',
|
|
1924
|
+
extras: viewState.view.data,
|
|
1924
1925
|
});
|
|
1925
1926
|
sendSwapRejectedEvent(eventTarget, 'Price surge');
|
|
1926
1927
|
}, onActionClick: () => {
|
|
@@ -1950,7 +1951,7 @@ function SwapWidget({ amount, fromTokenAddress, toTokenAddress, config, autoProc
|
|
|
1950
1951
|
viewDispatch({
|
|
1951
1952
|
payload: { type: ViewActions.UPDATE_VIEW, view: { type: SwapWidgetViews.SWAP } },
|
|
1952
1953
|
});
|
|
1953
|
-
} })), viewState.view.type === SharedViews.TOP_UP_VIEW && (jsx(TopUpView, { analytics: { userJourney: UserJourney.SWAP }, checkout: checkout, provider: provider, widgetEvent:
|
|
1954
|
+
} })), viewState.view.type === SharedViews.TOP_UP_VIEW && (jsx(TopUpView, { analytics: { userJourney: UserJourney.SWAP }, checkout: checkout, provider: provider, widgetEvent: ro.IMTBL_SWAP_WIDGET_EVENT, showOnrampOption: isOnRampEnabled, showSwapOption: isSwapEnabled, showBridgeOption: isBridgeEnabled, onCloseButtonClick: () => sendSwapWidgetCloseEvent(eventTarget) }))] }) })), serviceUnavailableView: (jsx(ServiceUnavailableToRegionErrorView, { service: ServiceType.SWAP, onCloseClick: () => sendSwapWidgetCloseEvent(window), primaryActionText: topUpOptions && topUpOptions?.length > 0
|
|
1954
1955
|
? t(topUpOptions[0].textKey)
|
|
1955
1956
|
: undefined, onPrimaryButtonClick: topUpOptions && topUpOptions?.length > 0
|
|
1956
1957
|
? topUpOptions[0].action
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as reactExports, K as getDefaultTokenImage, w as jsx } from './index-S9AO9JR0.js';
|
|
2
2
|
|
|
3
3
|
function TokenImage({ src, name, environment, theme, defaultImage, ...forwardedProps }) {
|
|
4
4
|
const [error, setError] = reactExports.useState(false);
|