@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
|
@@ -14,7 +14,6 @@ import { ShowMenuItem } from './BalanceItemStyles';
|
|
|
14
14
|
import { BalanceInfo } from '../../functions/tokenBalances';
|
|
15
15
|
import { WalletContext } from '../../context/WalletContext';
|
|
16
16
|
import { orchestrationEvents } from '../../../../lib/orchestrationEvents';
|
|
17
|
-
import { getL1ChainId, getL2ChainId } from '../../../../lib/networkUtils';
|
|
18
17
|
import { formatZeroAmount, tokenValueFormat } from '../../../../lib/utils';
|
|
19
18
|
import { ConnectLoaderContext } from '../../../../context/connect-loader-context/ConnectLoaderContext';
|
|
20
19
|
import { isPassportProvider } from '../../../../lib/provider';
|
|
@@ -60,11 +59,11 @@ export function BalanceItem({
|
|
|
60
59
|
if (!checkout) return;
|
|
61
60
|
const onRampTokens = checkout.getTokenAllowList({
|
|
62
61
|
type: TokenFilterTypes.ONRAMP,
|
|
63
|
-
chainId:
|
|
62
|
+
chainId: checkout.config.l2ChainId,
|
|
64
63
|
});
|
|
65
64
|
const swapTokens = checkout.getTokenAllowList({
|
|
66
65
|
type: TokenFilterTypes.SWAP,
|
|
67
|
-
chainId:
|
|
66
|
+
chainId: checkout.config.l2ChainId,
|
|
68
67
|
});
|
|
69
68
|
|
|
70
69
|
const [onRampAllowedTokensResult, swapAllowedTokensResult] = await Promise.all([onRampTokens, swapTokens]);
|
|
@@ -84,18 +83,18 @@ export function BalanceItem({
|
|
|
84
83
|
setIsAddTokensEnabled(enableAddCoin);
|
|
85
84
|
|
|
86
85
|
const enableBuyCoin = !enableAddCoin
|
|
87
|
-
&& currentChainId ===
|
|
86
|
+
&& currentChainId === checkout.config.l2ChainId
|
|
88
87
|
&& (supportedTopUps?.isOnRampEnabled ?? true);
|
|
89
88
|
setIsOnRampEnabled(enableBuyCoin);
|
|
90
89
|
|
|
91
90
|
const enableMoveCoin = !enableAddCoin
|
|
92
|
-
&& (currentChainId ===
|
|
93
|
-
|| currentChainId ===
|
|
91
|
+
&& (currentChainId === checkout.config.l1ChainId
|
|
92
|
+
|| currentChainId === checkout.config.l2ChainId)
|
|
94
93
|
&& (supportedTopUps?.isBridgeEnabled ?? true);
|
|
95
94
|
setIsBridgeEnabled(enableMoveCoin);
|
|
96
95
|
|
|
97
96
|
const enableSwapCoin = !enableAddCoin
|
|
98
|
-
&& currentChainId ===
|
|
97
|
+
&& currentChainId === checkout.config.l2ChainId
|
|
99
98
|
&& (supportedTopUps?.isSwapEnabled ?? true)
|
|
100
99
|
&& (supportedTopUps?.isSwapAvailable ?? true);
|
|
101
100
|
setIsSwapEnabled(enableSwapCoin);
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
walletBalanceLoadingIconStyles,
|
|
22
22
|
walletBalanceListContainerStyles,
|
|
23
23
|
} from './WalletBalancesStyles';
|
|
24
|
-
import { getL2ChainId } from '../../../lib/networkUtils';
|
|
25
24
|
import { WalletWidgetViews } from '../../../context/view-context/WalletViewContextTypes';
|
|
26
25
|
import {
|
|
27
26
|
ViewActions,
|
|
@@ -111,7 +110,7 @@ export function WalletBalances({
|
|
|
111
110
|
const showAddCoins = useMemo(() => {
|
|
112
111
|
if (!checkout || !network) return false;
|
|
113
112
|
return (
|
|
114
|
-
Number(network.chainId) ===
|
|
113
|
+
Number(network.chainId) === checkout.config.l2ChainId
|
|
115
114
|
&& Boolean(
|
|
116
115
|
supportedTopUps?.isBridgeEnabled
|
|
117
116
|
|| supportedTopUps?.isSwapEnabled
|
package/src/lib/networkUtils.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ChainId, CheckoutConfiguration } from '@imtbl/checkout-sdk';
|
|
2
|
-
|
|
3
|
-
// **************************************************** //
|
|
4
|
-
// **************************************************** //
|
|
5
|
-
// This is duplicated in the sdk project. //
|
|
6
|
-
// We are not exposing these functions given that this //
|
|
7
|
-
// to keep the Checkout SDK interface as minimal as //
|
|
8
|
-
// possible. //
|
|
9
|
-
// **************************************************** //
|
|
10
|
-
export const getL1ChainId = (config: CheckoutConfiguration): ChainId => {
|
|
11
|
-
// DevMode and Sandbox will both use Sepolia.
|
|
12
|
-
if (!config.isProduction) return ChainId.SEPOLIA;
|
|
13
|
-
return ChainId.ETHEREUM;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const getL2ChainId = (config: CheckoutConfiguration): ChainId => {
|
|
17
|
-
if (config.isDevelopment) return ChainId.IMTBL_ZKEVM_DEVNET;
|
|
18
|
-
if (config.isProduction) return ChainId.IMTBL_ZKEVM_MAINNET;
|
|
19
|
-
return ChainId.IMTBL_ZKEVM_TESTNET;
|
|
20
|
-
};
|
|
21
|
-
// **************************************************** //
|
|
22
|
-
// **************************************************** //
|