@imtbl/checkout-widgets 2.24.2 → 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.
Files changed (25) hide show
  1. package/dist/browser/{AddTokensWidget-DfuhVxM_.js → AddTokensWidget-DMrmDo2R.js} +25 -25
  2. package/dist/browser/{BridgeWidget-DPGVaxwB.js → BridgeWidget-C3ZwEF5d.js} +50 -50
  3. package/dist/browser/{CommerceWidget-q9rMetzw.js → CommerceWidget-CDGGJeeR.js} +183 -183
  4. package/dist/browser/{FeesBreakdown-BearnE-z.js → FeesBreakdown-i_qxEQFt.js} +2 -2
  5. package/dist/browser/{OnRampWidget-uOeC1RaV.js → OnRampWidget-BRx0TwzX.js} +6 -6
  6. package/dist/browser/{SaleWidget-XJkxP0rC.js → SaleWidget-gSxmV2g7.js} +65 -65
  7. package/dist/browser/{SpendingCapHero-DYO48Xgn.js → SpendingCapHero-BxLJL-9Q.js} +1 -1
  8. package/dist/browser/{SwapWidget-Ds9Sc1MP.js → SwapWidget-Bwd7fDVb.js} +23 -23
  9. package/dist/browser/{TokenImage-Bv8Lexz9.js → TokenImage-DBv6iVIk.js} +1 -1
  10. package/dist/browser/{TopUpView-ClhdDleL.js → TopUpView-Dl5z5cFC.js} +5 -5
  11. package/dist/browser/{WalletApproveHero-dgeupmzI.js → WalletApproveHero-DnHtkM1S.js} +2 -2
  12. package/dist/browser/{WalletWidget-BTpEzbG5.js → WalletWidget-JrG6gxbu.js} +15 -15
  13. package/dist/browser/{auto-track-DbX_C4-P.js → auto-track-BUUbNCUM.js} +1 -1
  14. package/dist/browser/{index-taK8KsgT.js → index-B8BkPC1Y.js} +911 -235
  15. package/dist/browser/{index-D96x2b7m.js → index-Bj-hPuPy.js} +2 -2
  16. package/dist/browser/{index-BxoGgGF_.js → index-C-YEXPDU.js} +1 -1
  17. package/dist/browser/{index-Bhf8WaI7.js → index-CeWEdrkc.js} +1 -1
  18. package/dist/browser/{index-CCeP9wBE.js → index-CvzKMjLT.js} +1 -1
  19. package/dist/browser/{index-CJpZcr5g.js → index-HuuqNyji.js} +1 -1
  20. package/dist/browser/{index-Dw-s1YMM.js → index-R1ozmK7m.js} +1 -1
  21. package/dist/browser/{index-vCYAbOQs.js → index-sF9vmGhg.js} +1 -1
  22. package/dist/browser/index.js +1 -1
  23. package/dist/browser/{index.umd-cYI2vutp.js → index.umd-DY1kOxNW.js} +1 -1
  24. package/dist/browser/{useInterval-BMjqUNtV.js → useInterval-B7l9NFy4.js} +1 -1
  25. package/package.json +7 -7
@@ -1,4 +1,4 @@
1
- import { r as reactExports, K as getDefaultTokenImage, q as jsx } from './index-taK8KsgT.js';
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, v as jsxs, dH as isDualVariantIcon, aP as MenuItem, x as Box, h as useTranslation, aU as ViewContext, I as CryptoFiatContext, G as EventTargetContext, F as useAnalytics, a1 as CryptoFiatActions, dI as DEFAULT_TOKEN_SYMBOLS, cT as Re, M as HeaderNavigation, H as Heading, A as Body, z as SimpleLayout, w, V as ViewActions, O as orchestrationEvents, bM as r } from './index-taK8KsgT.js';
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: Re.BRIDGE_TO_L2,
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 === w.IMTBL_SWAP_WIDGET_EVENT) {
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 === w.IMTBL_BRIDGE_WIDGET_EVENT) {
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 === w.IMTBL_ONRAMP_WIDGET_EVENT) {
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, v as jsxs, dx as BaseClickable, b3 as ButtCon, au as SmartClone, dy as AnimatePresence, x as Box, S 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, h as useTranslation, aP as MenuItem, aA as Drawer, A as Body, aF as Fragment, F as useAnalytics, dD as Select, bM as r, dE as DuoCon, H as Heading, y 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, W as getRemoteImage, cM as getChainNameById, cG as isWalletConnectProvider, c$ as heroBackGroundStyles, d0 as heroImageStyles, dF as heroImageBottomAlign } from './index-taK8KsgT.js';
2
- import { T as TokenImage } from './TokenImage-Bv8Lexz9.js';
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, x as Box, dL as getResponsiveSx, dM as BUTTON_SIZES, dN as setDefaultSxBackgroundColor, b3 as ButtCon, dz as ClassNames, y as Button, ad as _defineProperty, B as Be, h as useTranslation, aU as ViewContext, v as jsxs, A as Body, V as ViewActions, Y as ConnectLoaderContext, F as useAnalytics, G as EventTargetContext, bM as r, aP as MenuItem, J as tokenValueFormat, U as UserJourney, O as orchestrationEvents, w, e as formatZeroAmount, aK as isPassportProvider, dO as ZERO_BALANCE_STRING, a$ as isNativeToken, dP as sendNetworkSwitchEvent, cy as Se, a5 as SharedViews, dQ as ze, dR as sortNetworksCompareFn, cB as getChainImage, cJ as retry, dr as DEFAULT_BALANCE_RETRY_POLICY, dS as sortTokensByAmount, b0 as getTokenImageByAddress, g as calculateCryptoToFiat, I as CryptoFiatContext, a1 as CryptoFiatActions, M as HeaderNavigation, cQ as ButtonNavigationStyles, dT as sendWalletWidgetCloseEvent, c5 as FooterLogo, z as SimpleLayout, cP as He, 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, X as CryptoFiatProvider, a0 as LoadingView, a6 as ErrorView } from './index-taK8KsgT.js';
2
- import { T as TokenImage } from './TokenImage-Bv8Lexz9.js';
3
- import { u as useInterval } from './useInterval-BMjqUNtV.js';
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: Be.ALL,
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: Be.ONRAMP,
342
+ type: TokenFilterTypes.ONRAMP,
343
343
  chainId: checkout.config.l2ChainId,
344
344
  });
345
345
  const swapTokens = checkout.getTokenAllowList({
346
- type: Be.SWAP,
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, w.IMTBL_WALLET_WIDGET_EVENT, {
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, w.IMTBL_WALLET_WIDGET_EVENT, {
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, w.IMTBL_WALLET_WIDGET_EVENT, {
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 === Se.USER_REJECTED_REQUEST_ERROR) ;
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: ze.ALL,
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, w.IMTBL_WALLET_WIDGET_EVENT, {});
706
+ orchestrationEvents.sendRequestAddTokensEvent(eventTarget, IMTBLWidgetEvents.IMTBL_WALLET_WIDGET_EVENT, {});
707
707
  };
708
708
  const handleBridgeToL2OnClick = (address) => {
709
- orchestrationEvents.sendRequestBridgeEvent(eventTarget, w.IMTBL_WALLET_WIDGET_EVENT, {
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 He.METAMASK: return 'MetaMaskSymbol';
733
- case He.PASSPORT: return 'PassportSymbolOutlined';
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
  }
@@ -1,4 +1,4 @@
1
- import { ep as pTimeout } from './index-taK8KsgT.js';
1
+ import { ep as pTimeout } from './index-B8BkPC1Y.js';
2
2
 
3
3
  // Check if a user is opening the link in a new tab
4
4
  function userNewTab(event) {