@imtbl/checkout-widgets 2.24.1 → 2.24.3-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-2Bi-Ujnc.js → AddTokensWidget-DMrmDo2R.js} +25 -25
- package/dist/browser/{BridgeWidget-Bx20C7vJ.js → BridgeWidget-C3ZwEF5d.js} +50 -50
- package/dist/browser/{CommerceWidget-DfgYY_iW.js → CommerceWidget-CDGGJeeR.js} +183 -183
- package/dist/browser/{FeesBreakdown-BtJ0FKCM.js → FeesBreakdown-i_qxEQFt.js} +2 -2
- package/dist/browser/{OnRampWidget-DopM-_DG.js → OnRampWidget-BRx0TwzX.js} +6 -6
- package/dist/browser/{SaleWidget-k1Elo6I4.js → SaleWidget-gSxmV2g7.js} +65 -65
- package/dist/browser/{SpendingCapHero-D-F8nBny.js → SpendingCapHero-BxLJL-9Q.js} +1 -1
- package/dist/browser/{SwapWidget-DTKc_R13.js → SwapWidget-Bwd7fDVb.js} +23 -23
- package/dist/browser/{TokenImage-qjYDd3m2.js → TokenImage-DBv6iVIk.js} +1 -1
- package/dist/browser/{TopUpView-BoMjQTMh.js → TopUpView-Dl5z5cFC.js} +5 -5
- package/dist/browser/{WalletApproveHero-DXGuS7yb.js → WalletApproveHero-DnHtkM1S.js} +2 -2
- package/dist/browser/{WalletWidget-D2JWCMTL.js → WalletWidget-JrG6gxbu.js} +15 -15
- package/dist/browser/{auto-track-BE1V41qw.js → auto-track-BUUbNCUM.js} +1 -1
- package/dist/browser/{index-BYN_3eJq.js → index-B8BkPC1Y.js} +911 -235
- package/dist/browser/{index-DTyK6Hip.js → index-Bj-hPuPy.js} +2 -2
- package/dist/browser/{index-OfzQtXWB.js → index-C-YEXPDU.js} +1 -1
- package/dist/browser/{index-DgEkCEpw.js → index-CeWEdrkc.js} +1 -1
- package/dist/browser/{index-DQNCrGRv.js → index-CvzKMjLT.js} +1 -1
- package/dist/browser/{index-CGPllL2u.js → index-HuuqNyji.js} +1 -1
- package/dist/browser/{index-B5EIG7rU.js → index-R1ozmK7m.js} +1 -1
- package/dist/browser/{index-DfQ4K4tF.js → index-sF9vmGhg.js} +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/{index.umd-sc9SOjIm.js → index.umd-DY1kOxNW.js} +1 -1
- package/dist/browser/{useInterval-C13gRjLe.js → useInterval-B7l9NFy4.js} +1 -1
- package/package.json +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as reactExports,
|
|
1
|
+
import { r as reactExports, G as getDefaultTokenImage, q as jsx } from './index-B8BkPC1Y.js';
|
|
2
2
|
|
|
3
3
|
function TokenImage({ src, name, environment, theme, defaultImage, ...forwardedProps }) {
|
|
4
4
|
const [error, setError] = reactExports.useState(false);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as reactExports, cb as formatUnits, q as jsx,
|
|
1
|
+
import { r as reactExports, cb as formatUnits, q as jsx, s as jsxs, dH as isDualVariantIcon, aP as MenuItem, t as Box, u as useTranslation, aU as ViewContext, D as CryptoFiatContext, E as EventTargetContext, z as useAnalytics, a1 as CryptoFiatActions, dI as DEFAULT_TOKEN_SYMBOLS, cT as GasEstimateType, J as HeaderNavigation, H as Heading, y as Body, x as SimpleLayout, I as IMTBLWidgetEvents, V as ViewActions, M as orchestrationEvents, bM as r } from './index-B8BkPC1Y.js';
|
|
2
2
|
|
|
3
3
|
var BridgeWidgetViews;
|
|
4
4
|
(function (BridgeWidgetViews) {
|
|
@@ -190,7 +190,7 @@ showOnrampOption, showSwapOption, showBridgeOption, tokenAddress, amount, analyt
|
|
|
190
190
|
return;
|
|
191
191
|
(async () => {
|
|
192
192
|
const bridgeEstimate = await checkout.gasEstimate({
|
|
193
|
-
gasEstimateType:
|
|
193
|
+
gasEstimateType: GasEstimateType.BRIDGE_TO_L2,
|
|
194
194
|
});
|
|
195
195
|
const est = await getBridgeFeeEstimation(bridgeEstimate, conversions);
|
|
196
196
|
setBridgeFeesInFiat(est);
|
|
@@ -216,7 +216,7 @@ showOnrampOption, showSwapOption, showBridgeOption, tokenAddress, amount, analyt
|
|
|
216
216
|
});
|
|
217
217
|
};
|
|
218
218
|
const onClickSwap = () => {
|
|
219
|
-
if (widgetEvent ===
|
|
219
|
+
if (widgetEvent === IMTBLWidgetEvents.IMTBL_SWAP_WIDGET_EVENT) {
|
|
220
220
|
const data = {
|
|
221
221
|
toTokenAddress: '',
|
|
222
222
|
fromAmount: '',
|
|
@@ -243,7 +243,7 @@ showOnrampOption, showSwapOption, showBridgeOption, tokenAddress, amount, analyt
|
|
|
243
243
|
localTrack('Swap', { ...data, widgetEvent });
|
|
244
244
|
};
|
|
245
245
|
const onClickBridge = () => {
|
|
246
|
-
if (widgetEvent ===
|
|
246
|
+
if (widgetEvent === IMTBLWidgetEvents.IMTBL_BRIDGE_WIDGET_EVENT) {
|
|
247
247
|
const data = {
|
|
248
248
|
fromTokenAddress: '',
|
|
249
249
|
fromAmount: '',
|
|
@@ -268,7 +268,7 @@ showOnrampOption, showSwapOption, showBridgeOption, tokenAddress, amount, analyt
|
|
|
268
268
|
localTrack('Bridge', { ...data, widgetEvent });
|
|
269
269
|
};
|
|
270
270
|
const onClickOnRamp = () => {
|
|
271
|
-
if (widgetEvent ===
|
|
271
|
+
if (widgetEvent === IMTBLWidgetEvents.IMTBL_ONRAMP_WIDGET_EVENT) {
|
|
272
272
|
const data = {
|
|
273
273
|
tokenAddress: '',
|
|
274
274
|
amount: '',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ac as hFlex, q as jsx, dw as motion, ae as _objectWithoutProperties, Q as useTheme, r as reactExports, ag as _slicedToArray, aq as useGetSubcomponentChild, al as merge,
|
|
2
|
-
import { T as TokenImage } from './TokenImage-
|
|
1
|
+
import { ac as hFlex, q as jsx, dw as motion, ae as _objectWithoutProperties, Q as useTheme, r as reactExports, ag as _slicedToArray, aq as useGetSubcomponentChild, al as merge, s as jsxs, dx as BaseClickable, b3 as ButtCon, au as SmartClone, dy as AnimatePresence, t as Box, w as Stack, dz as ClassNames, ad as _defineProperty, dA as getTertiaryButtonStyles, ar as flattenChildren, dB as isChildSubcomponent, aB as Divider, b4 as TextInput, dC as FormControlWrapper, u as useTranslation, aP as MenuItem, aA as Drawer, y as Body, aF as Fragment, z as useAnalytics, dD as Select, bM as r, dE as DuoCon, H as Heading, v as Button, cJ as retry, cR as NATIVE, b0 as getTokenImageByAddress, a$ as isNativeToken, dr as DEFAULT_BALANCE_RETRY_POLICY, cO as isMetaMaskProvider, R as CloudImage, c5 as FooterLogo, X as getRemoteImage, cM as getChainNameById, cG as isWalletConnectProvider, c$ as heroBackGroundStyles, d0 as heroImageStyles, dF as heroImageBottomAlign } from './index-B8BkPC1Y.js';
|
|
2
|
+
import { T as TokenImage } from './TokenImage-DBv6iVIk.js';
|
|
3
3
|
|
|
4
4
|
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ae as _objectWithoutProperties, Q as useTheme, dJ as getStartingSize, dK as DEFAULT_BUTTON_SIZE, al as merge, r as reactExports, ar as flattenChildren, q as jsx, dB as isChildSubcomponent, au as SmartClone,
|
|
2
|
-
import { T as TokenImage } from './TokenImage-
|
|
3
|
-
import { u as useInterval } from './useInterval-
|
|
1
|
+
import { ae as _objectWithoutProperties, Q as useTheme, dJ as getStartingSize, dK as DEFAULT_BUTTON_SIZE, al as merge, r as reactExports, ar as flattenChildren, q as jsx, dB as isChildSubcomponent, au as SmartClone, t as Box, dL as getResponsiveSx, dM as BUTTON_SIZES, dN as setDefaultSxBackgroundColor, b3 as ButtCon, dz as ClassNames, v as Button, ad as _defineProperty, l as TokenFilterTypes, u as useTranslation, aU as ViewContext, s as jsxs, y as Body, V as ViewActions, Z as ConnectLoaderContext, z as useAnalytics, E as EventTargetContext, bM as r, aP as MenuItem, F as tokenValueFormat, U as UserJourney, M as orchestrationEvents, I as IMTBLWidgetEvents, i as formatZeroAmount, aK as isPassportProvider, dO as ZERO_BALANCE_STRING, a$ as isNativeToken, dP as sendNetworkSwitchEvent, cy as CheckoutErrorType, a5 as SharedViews, dQ as NetworkFilterTypes, dR as sortNetworksCompareFn, cB as getChainImage, cJ as retry, dr as DEFAULT_BALANCE_RETRY_POLICY, dS as sortTokensByAmount, b0 as getTokenImageByAddress, j as calculateCryptoToFiat, D as CryptoFiatContext, a1 as CryptoFiatActions, J as HeaderNavigation, cQ as ButtonNavigationStyles, dT as sendWalletWidgetCloseEvent, c5 as FooterLogo, x as SimpleLayout, cP as WalletProviderName, cN as getWalletProviderNameByProvider, dH as isDualVariantIcon, ca as abbreviateWalletAddress, H as Heading, aA as Drawer, cD as useWalletConnect, dU as sendDisconnectWalletEvent, cG as isWalletConnectProvider, c$ as heroBackGroundStyles, d0 as heroImageStyles, dF as heroImageBottomAlign, d1 as SimpleTextBody, dV as FAQS_LINK, L as Link, bH as viewReducer, bI as initialViewState, Y as CryptoFiatProvider, a0 as LoadingView, a6 as ErrorView } from './index-B8BkPC1Y.js';
|
|
2
|
+
import { T as TokenImage } from './TokenImage-DBv6iVIk.js';
|
|
3
|
+
import { u as useInterval } from './useInterval-B7l9NFy4.js';
|
|
4
4
|
|
|
5
5
|
var horizontalMenuSxProps = {
|
|
6
6
|
justifyContent: "stretch",
|
|
@@ -263,7 +263,7 @@ const walletReducer = (state, action) => {
|
|
|
263
263
|
|
|
264
264
|
const fetchTokenSymbols = async (checkout, chainId) => {
|
|
265
265
|
const tokenAllowList = await checkout.getTokenAllowList({
|
|
266
|
-
type:
|
|
266
|
+
type: TokenFilterTypes.ALL,
|
|
267
267
|
chainId,
|
|
268
268
|
});
|
|
269
269
|
const symbolSet = new Set();
|
|
@@ -339,11 +339,11 @@ function BalanceItem({ balanceInfo, theme, bridgeToL2OnClick, }) {
|
|
|
339
339
|
if (!checkout)
|
|
340
340
|
return;
|
|
341
341
|
const onRampTokens = checkout.getTokenAllowList({
|
|
342
|
-
type:
|
|
342
|
+
type: TokenFilterTypes.ONRAMP,
|
|
343
343
|
chainId: checkout.config.l2ChainId,
|
|
344
344
|
});
|
|
345
345
|
const swapTokens = checkout.getTokenAllowList({
|
|
346
|
-
type:
|
|
346
|
+
type: TokenFilterTypes.SWAP,
|
|
347
347
|
chainId: checkout.config.l2ChainId,
|
|
348
348
|
});
|
|
349
349
|
const [onRampAllowedTokensResult, swapAllowedTokensResult] = await Promise.all([onRampTokens, swapTokens]);
|
|
@@ -399,13 +399,13 @@ function BalanceItem({ balanceInfo, theme, bridgeToL2OnClick, }) {
|
|
|
399
399
|
},
|
|
400
400
|
});
|
|
401
401
|
if (isAddTokensEnabled) {
|
|
402
|
-
orchestrationEvents.sendRequestAddTokensEvent(eventTarget,
|
|
402
|
+
orchestrationEvents.sendRequestAddTokensEvent(eventTarget, IMTBLWidgetEvents.IMTBL_WALLET_WIDGET_EVENT, {
|
|
403
403
|
toAmount: '',
|
|
404
404
|
toTokenAddress: balanceInfo.address ?? '',
|
|
405
405
|
});
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
|
-
orchestrationEvents.sendRequestOnrampEvent(eventTarget,
|
|
408
|
+
orchestrationEvents.sendRequestOnrampEvent(eventTarget, IMTBLWidgetEvents.IMTBL_WALLET_WIDGET_EVENT, {
|
|
409
409
|
tokenAddress: balanceInfo.address ?? '',
|
|
410
410
|
amount: '',
|
|
411
411
|
});
|
|
@@ -432,7 +432,7 @@ function BalanceItem({ balanceInfo, theme, bridgeToL2OnClick, }) {
|
|
|
432
432
|
tokenAddress: balanceInfo.address,
|
|
433
433
|
},
|
|
434
434
|
});
|
|
435
|
-
orchestrationEvents.sendRequestSwapEvent(eventTarget,
|
|
435
|
+
orchestrationEvents.sendRequestSwapEvent(eventTarget, IMTBLWidgetEvents.IMTBL_WALLET_WIDGET_EVENT, {
|
|
436
436
|
fromTokenAddress: balanceInfo.address ?? '',
|
|
437
437
|
toTokenAddress: '',
|
|
438
438
|
amount: '',
|
|
@@ -528,7 +528,7 @@ function NetworkMenu() {
|
|
|
528
528
|
sendNetworkSwitchEvent(eventTarget, switchNetworkResult.provider, switchNetworkResult.network);
|
|
529
529
|
}
|
|
530
530
|
catch (err) {
|
|
531
|
-
if (err.type ===
|
|
531
|
+
if (err.type === CheckoutErrorType.USER_REJECTED_REQUEST_ERROR) ;
|
|
532
532
|
else {
|
|
533
533
|
viewDispatch({
|
|
534
534
|
payload: {
|
|
@@ -543,7 +543,7 @@ function NetworkMenu() {
|
|
|
543
543
|
(async () => {
|
|
544
544
|
if (checkout) {
|
|
545
545
|
const allowedNetworksResponse = await checkout.getNetworkAllowList({
|
|
546
|
-
type:
|
|
546
|
+
type: NetworkFilterTypes.ALL,
|
|
547
547
|
});
|
|
548
548
|
setNetworks(allowedNetworksResponse?.networks ?? []);
|
|
549
549
|
}
|
|
@@ -703,10 +703,10 @@ function WalletBalances({ balancesLoading, theme, showNetworkMenu, }) {
|
|
|
703
703
|
control: 'AddCoins',
|
|
704
704
|
controlType: 'Button',
|
|
705
705
|
});
|
|
706
|
-
orchestrationEvents.sendRequestAddTokensEvent(eventTarget,
|
|
706
|
+
orchestrationEvents.sendRequestAddTokensEvent(eventTarget, IMTBLWidgetEvents.IMTBL_WALLET_WIDGET_EVENT, {});
|
|
707
707
|
};
|
|
708
708
|
const handleBridgeToL2OnClick = (address) => {
|
|
709
|
-
orchestrationEvents.sendRequestBridgeEvent(eventTarget,
|
|
709
|
+
orchestrationEvents.sendRequestBridgeEvent(eventTarget, IMTBLWidgetEvents.IMTBL_WALLET_WIDGET_EVENT, {
|
|
710
710
|
tokenAddress: address ?? '',
|
|
711
711
|
amount: '',
|
|
712
712
|
});
|
|
@@ -729,8 +729,8 @@ function WalletBalances({ balancesLoading, theme, showNetworkMenu, }) {
|
|
|
729
729
|
|
|
730
730
|
function getWalletLogoByName(walletProviderName) {
|
|
731
731
|
switch (walletProviderName) {
|
|
732
|
-
case
|
|
733
|
-
case
|
|
732
|
+
case WalletProviderName.METAMASK: return 'MetaMaskSymbol';
|
|
733
|
+
case WalletProviderName.PASSPORT: return 'PassportSymbolOutlined';
|
|
734
734
|
case 'walletconnect': return 'WalletConnectSymbol';
|
|
735
735
|
default: return 'MetaMaskSymbol';
|
|
736
736
|
}
|