@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,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { T as TokenImage } from './TokenImage-
|
|
3
|
-
import { F as FeesBreakdown } from './FeesBreakdown-
|
|
1
|
+
import { b as reactExports, ac as hFlex, ad as _defineProperty, ae as _objectWithoutProperties, af as useForwardLocalDomRef, ag as _slicedToArray, ah as useResizeObserver, Q as useTheme, ai as usePrevious, aj as useGetMotionProfile, ak as useBrowserEffect, al as merge, am as getHeadingTextStyles, an as getMotionProfileSx, ao as useConvertSxToEmotionStyles, ap as DUMMY_WIDTH_PUSHER_TEXT, x as jsxs, w as jsx, B as Box, aq as useGetSubcomponentChild, ar as flattenChildren, as as vFlex, at as centerFlexChildren, au as SmartClone, av as FormControlLabel, aw as FormControlValidation, ax as FormControlCaption, r as ro, R as Ro, ay as getDefaultExportFromCjs, az as commonjsGlobal, k as useTranslation, aA as Drawer, aB as Divider, H as Heading, y as Button, aC as useProvidersContext, F as useAnalytics, aD as WalletDrawer, aE as UnableToConnectDrawer, aF as Fragment, aG as qt, U as UserJourney, aH as removeSpace, aI as getProviderSlugFromRdns, aJ as D, aK as isPassportProvider, aL as connectEIP6963Provider, aM as identifyUser, aN as ConnectEIP6963ProviderError, aO as ProvidersContextActions, aP as MenuItem, aQ as J, aR as SQUID_NATIVE_TOKEN, aS as commonjsRequire, X as getRemoteImage, aT as OnboardingPagination, aU as ViewContext, aV as useHandover, G as EventTargetContext, aW as HandoverTarget, V as ViewActions, t as getRemoteRive, aX as APPROVE_TXN_ANIMATION, aY as RiveStateMachineInput, aZ as HandoverContent, a_ as keyframes, e as ae, a$ as isNativeToken, b0 as getTokenImageByAddress, b1 as FramedImage, b2 as FramedIcon, b3 as ButtCon, b4 as TextInput, b5 as VerticalMenu, K as getDefaultTokenImage, b6 as TOKEN_PRIORITY_ORDER, D as Body, b7 as EllipsizedText, b8 as Tooltip, b9 as Sticker, ba as getDurationFormatted, bb as getTotalRouteFees, bc as getRouteAndTokenBalances, S as Stack, bd as Icon, be as Badge, bf as getFormattedAmounts, bg as getRemoteVideo, bh as FramedVideo, bi as listVariants, bj as motion, bk as listItemVariants, bl as Banner, bm as Ot, bn as xt, bo as useRoutes, bp as useInjectedProviders, bq as hn, br as RouteError, z as SimpleLayout, bs as dist, a5 as SharedViews, O as orchestrationEvents, bt as SquidFooter, bu as TOOLKIT_SQUID_URL, bv as merge$1, bw as SvgIcon, bx as WalletWarningHero, by as getFormattedNumber, bz as FIXED_HANDOVER_DURATION, bA as EXECUTE_TXN_ANIMATION, L as Link, bB as Trans, bC as useExecute, bD as getRouteChains, bE as t, bF as convertToNetworkChangeableProvider, bG as verifyAndSwitchChain, bH as PriceDisplay, a0 as LoadingView, bI as viewReducer, bJ as initialViewState, bK as useSquid, bL as useTokens, bM as v4, bN as K, bO as isValidAddress, P as amountInputValidation, bP as fetchChains, bQ as fetchBalances, W as CloudImage, a6 as ErrorView, bR as ServiceUnavailableErrorView } from './index-S9AO9JR0.js';
|
|
2
|
+
import { T as TokenImage } from './TokenImage-AbfB1fSa.js';
|
|
3
|
+
import { F as FeesBreakdown } from './FeesBreakdown-BJbAIdyp.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The function `useInterval` sets up an interval that repeatedly calls a given callback function with
|
|
@@ -292,9 +292,9 @@ HeroFormControl.inputs = SUPPORTED_INPUT_COMPONENTS_MAP;
|
|
|
292
292
|
|
|
293
293
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
294
294
|
function sendAddTokensCloseEvent(eventTarget) {
|
|
295
|
-
const closeWidgetEvent = new CustomEvent(
|
|
295
|
+
const closeWidgetEvent = new CustomEvent(ro.IMTBL_ADD_TOKENS_WIDGET_EVENT, {
|
|
296
296
|
detail: {
|
|
297
|
-
type:
|
|
297
|
+
type: Ro.CLOSE_WIDGET,
|
|
298
298
|
data: {},
|
|
299
299
|
},
|
|
300
300
|
});
|
|
@@ -305,9 +305,9 @@ function sendAddTokensCloseEvent(eventTarget) {
|
|
|
305
305
|
eventTarget.dispatchEvent(closeWidgetEvent);
|
|
306
306
|
}
|
|
307
307
|
function sendConnectProviderSuccessEvent(eventTarget, providerType, provider, providerInfo) {
|
|
308
|
-
const successEvent = new CustomEvent(
|
|
308
|
+
const successEvent = new CustomEvent(ro.IMTBL_ADD_TOKENS_WIDGET_EVENT, {
|
|
309
309
|
detail: {
|
|
310
|
-
type:
|
|
310
|
+
type: Ro.CONNECT_SUCCESS,
|
|
311
311
|
data: {
|
|
312
312
|
provider,
|
|
313
313
|
providerType,
|
|
@@ -321,9 +321,9 @@ function sendConnectProviderSuccessEvent(eventTarget, providerType, provider, pr
|
|
|
321
321
|
eventTarget.dispatchEvent(successEvent);
|
|
322
322
|
}
|
|
323
323
|
const sendAddTokensSuccessEvent = (eventTarget, transactionHash) => {
|
|
324
|
-
const successEvent = new CustomEvent(
|
|
324
|
+
const successEvent = new CustomEvent(ro.IMTBL_ADD_TOKENS_WIDGET_EVENT, {
|
|
325
325
|
detail: {
|
|
326
|
-
type:
|
|
326
|
+
type: Ro.SUCCESS,
|
|
327
327
|
data: {
|
|
328
328
|
transactionHash,
|
|
329
329
|
},
|
|
@@ -335,9 +335,9 @@ const sendAddTokensSuccessEvent = (eventTarget, transactionHash) => {
|
|
|
335
335
|
eventTarget.dispatchEvent(successEvent);
|
|
336
336
|
};
|
|
337
337
|
const sendAddTokensFailedEvent = (eventTarget, reason) => {
|
|
338
|
-
const failedEvent = new CustomEvent(
|
|
338
|
+
const failedEvent = new CustomEvent(ro.IMTBL_ADD_TOKENS_WIDGET_EVENT, {
|
|
339
339
|
detail: {
|
|
340
|
-
type:
|
|
340
|
+
type: Ro.FAILURE,
|
|
341
341
|
data: {
|
|
342
342
|
reason,
|
|
343
343
|
timestamp: new Date().getTime(),
|
|
@@ -929,7 +929,7 @@ function ConnectWalletDrawer({ heading, visible, onClose, onConnect, onError, pr
|
|
|
929
929
|
walletRdns: info.rdns,
|
|
930
930
|
},
|
|
931
931
|
});
|
|
932
|
-
if (info.rdns ===
|
|
932
|
+
if (info.rdns === qt.PASSPORT) {
|
|
933
933
|
const { isConnected } = await checkout.checkIsWalletConnected({
|
|
934
934
|
provider: new D(providerDetail.provider),
|
|
935
935
|
});
|
|
@@ -975,7 +975,7 @@ function ConnectWalletDrawer({ heading, visible, onClose, onConnect, onError, pr
|
|
|
975
975
|
// Keep prev wallet change event
|
|
976
976
|
prevWalletChangeEvent.current = event;
|
|
977
977
|
const { info } = event.providerDetail;
|
|
978
|
-
if (providerType === 'to' && info.rdns !==
|
|
978
|
+
if (providerType === 'to' && info.rdns !== qt.PASSPORT) {
|
|
979
979
|
setShowEOAWarningDrawer(true);
|
|
980
980
|
return;
|
|
981
981
|
}
|
|
@@ -1046,7 +1046,7 @@ function convertToUsd(tokens, amount, token) {
|
|
|
1046
1046
|
}
|
|
1047
1047
|
const address = token.address === 'native' ? SQUID_NATIVE_TOKEN : token.address;
|
|
1048
1048
|
const toToken = tokens.find((value) => value.address.toLowerCase() === address.toLowerCase()
|
|
1049
|
-
&& value.chainId ===
|
|
1049
|
+
&& value.chainId === J.IMTBL_ZKEVM_MAINNET.toString());
|
|
1050
1050
|
if (!toToken) {
|
|
1051
1051
|
return 0;
|
|
1052
1052
|
}
|
|
@@ -4155,7 +4155,7 @@ function TokenDrawerMenu({ checkout, config, toTokenAddress, addTokensState, add
|
|
|
4155
4155
|
try {
|
|
4156
4156
|
const tokenResponse = await checkout.getTokenAllowList({
|
|
4157
4157
|
type: ae.SWAP,
|
|
4158
|
-
chainId:
|
|
4158
|
+
chainId: checkout.config.l2ChainId,
|
|
4159
4159
|
});
|
|
4160
4160
|
if (tokenResponse?.tokens.length > 0) {
|
|
4161
4161
|
const updatedTokens = tokenResponse.tokens.map((token) => {
|
|
@@ -4440,8 +4440,8 @@ function SelectedRouteOption({ checkout, routeData, chains, loading = false, wit
|
|
|
4440
4440
|
}
|
|
4441
4441
|
|
|
4442
4442
|
const checkSanctionedAddresses = async (addresses, config) => {
|
|
4443
|
-
const result = await
|
|
4444
|
-
return
|
|
4443
|
+
const result = await Ot(addresses, config);
|
|
4444
|
+
return xt(result);
|
|
4445
4445
|
};
|
|
4446
4446
|
|
|
4447
4447
|
function AddTokens({ checkout, toAmount, config, toTokenAddress, showOnrampOption = true, showSwapOption = true, showBridgeOption = true, onCloseButtonClick, showBackButton, onBackButtonClick, }) {
|
|
@@ -4548,7 +4548,7 @@ function AddTokens({ checkout, toAmount, config, toTokenAddress, showOnrampOptio
|
|
|
4548
4548
|
const walletOptions = reactExports.useMemo(() => providers
|
|
4549
4549
|
// TODO: Check if must filter passport on L1
|
|
4550
4550
|
.map((detail) => {
|
|
4551
|
-
if (detail.info.rdns ===
|
|
4551
|
+
if (detail.info.rdns === qt.PASSPORT) {
|
|
4552
4552
|
return {
|
|
4553
4553
|
...detail,
|
|
4554
4554
|
info: {
|
|
@@ -4569,7 +4569,7 @@ function AddTokens({ checkout, toAmount, config, toTokenAddress, showOnrampOptio
|
|
|
4569
4569
|
await identifyUser(identify, toProvider, { anonymousId });
|
|
4570
4570
|
})();
|
|
4571
4571
|
}, [toProvider, lockedToProvider]);
|
|
4572
|
-
const toChain = reactExports.useMemo(() => chains?.find((chain) => chain.id ===
|
|
4572
|
+
const toChain = reactExports.useMemo(() => chains?.find((chain) => chain.id === J.IMTBL_ZKEVM_MAINNET.toString()), [chains]);
|
|
4573
4573
|
reactExports.useEffect(() => {
|
|
4574
4574
|
if (!id || isSwapAvailable === undefined) {
|
|
4575
4575
|
return;
|
|
@@ -4610,7 +4610,7 @@ function AddTokens({ checkout, toAmount, config, toTokenAddress, showOnrampOptio
|
|
|
4610
4610
|
&& isValidAmount) {
|
|
4611
4611
|
setFetchingRoutes(true);
|
|
4612
4612
|
try {
|
|
4613
|
-
const availableRoutes = await fetchRoutes(squid, tokens, balances,
|
|
4613
|
+
const availableRoutes = await fetchRoutes(squid, tokens, balances, J.IMTBL_ZKEVM_MAINNET.toString(), selectedToken.address === 'native'
|
|
4614
4614
|
? SQUID_NATIVE_TOKEN
|
|
4615
4615
|
: selectedToken.address, selectedAmount, 5, 1000, isSwapAvailable);
|
|
4616
4616
|
addTokensDispatch({
|
|
@@ -4665,7 +4665,7 @@ function AddTokens({ checkout, toAmount, config, toTokenAddress, showOnrampOptio
|
|
|
4665
4665
|
try {
|
|
4666
4666
|
const tokenResponse = await checkout.getTokenAllowList({
|
|
4667
4667
|
type: ae.ONRAMP,
|
|
4668
|
-
chainId:
|
|
4668
|
+
chainId: checkout.config.l2ChainId,
|
|
4669
4669
|
});
|
|
4670
4670
|
if (tokenResponse?.tokens.length > 0) {
|
|
4671
4671
|
setOnRampAllowedTokens(tokenResponse.tokens);
|
|
@@ -4708,7 +4708,7 @@ function AddTokens({ checkout, toAmount, config, toTokenAddress, showOnrampOptio
|
|
|
4708
4708
|
showBackButton: true,
|
|
4709
4709
|
provider: toProvider,
|
|
4710
4710
|
};
|
|
4711
|
-
orchestrationEvents.sendRequestOnrampEvent(eventTarget,
|
|
4711
|
+
orchestrationEvents.sendRequestOnrampEvent(eventTarget, ro.IMTBL_ADD_TOKENS_WIDGET_EVENT, data);
|
|
4712
4712
|
};
|
|
4713
4713
|
const handleCardClick = () => {
|
|
4714
4714
|
setPayWithCardClicked(true);
|
|
@@ -4774,7 +4774,7 @@ function AddTokens({ checkout, toAmount, config, toTokenAddress, showOnrampOptio
|
|
|
4774
4774
|
type: AddTokensWidgetViews.REVIEW,
|
|
4775
4775
|
data: {
|
|
4776
4776
|
balance: selectedRouteData.amountData.balance,
|
|
4777
|
-
toChainId:
|
|
4777
|
+
toChainId: J.IMTBL_ZKEVM_MAINNET.toString(),
|
|
4778
4778
|
toTokenAddress: selectedToken.address,
|
|
4779
4779
|
toAmount: selectedAmount,
|
|
4780
4780
|
additionalBuffer: selectedRouteData.amountData.additionalBuffer,
|
|
@@ -5302,9 +5302,9 @@ function Review({ data, showBackButton = false, onBackButtonClick, onCloseButton
|
|
|
5302
5302
|
action: 'Succeeded',
|
|
5303
5303
|
extras: {
|
|
5304
5304
|
contextId: id,
|
|
5305
|
-
...(route.route.params.fromChain !==
|
|
5305
|
+
...(route.route.params.fromChain !== J.IMTBL_ZKEVM_MAINNET.toString()
|
|
5306
5306
|
&& { txHash: executeTxnReceipt.hash }),
|
|
5307
|
-
...(route.route.params.fromChain ===
|
|
5307
|
+
...(route.route.params.fromChain === J.IMTBL_ZKEVM_MAINNET.toString()
|
|
5308
5308
|
&& { immutableZkEVMTxHash: executeTxnReceipt.hash }),
|
|
5309
5309
|
toTokenAddress: route.route.params.toToken,
|
|
5310
5310
|
toTokenChainId: route.route.params.toChain,
|
|
@@ -5557,7 +5557,7 @@ function AddTokensWidget({ showOnrampOption = true, showSwapOption = true, showB
|
|
|
5557
5557
|
objectFit: 'cover',
|
|
5558
5558
|
objectPosition: 'center',
|
|
5559
5559
|
} }), viewState.view.type === AddTokensWidgetViews.ADD_TOKENS && (jsx(AddTokens, { config: config, checkout: checkout, toTokenAddress: toTokenAddress, toAmount: toAmount, showBackButton: showBackButton, showOnrampOption: showOnrampOption, showSwapOption: showSwapOption, showBridgeOption: showBridgeOption, onCloseButtonClick: () => sendAddTokensCloseEvent(eventTarget), onBackButtonClick: () => {
|
|
5560
|
-
orchestrationEvents.sendRequestGoBackEvent(eventTarget,
|
|
5560
|
+
orchestrationEvents.sendRequestGoBackEvent(eventTarget, ro.IMTBL_ADD_TOKENS_WIDGET_EVENT, {});
|
|
5561
5561
|
} })), viewState.view.type === AddTokensWidgetViews.REVIEW && (jsx(Review, { data: viewState.view.data, onCloseButtonClick: () => sendAddTokensCloseEvent(eventTarget), onBackButtonClick: () => {
|
|
5562
5562
|
viewDispatch({
|
|
5563
5563
|
payload: {
|