@imtbl/checkout-widgets 2.4.10-alpha.4 → 2.4.11-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-lLor6W8j.js → AddTokensWidget-vuTqyZcs.js} +5 -5
- package/dist/browser/{BridgeWidget-CEqqJJq_.js → BridgeWidget-JFqMtClh.js} +8 -8
- package/dist/browser/{CommerceWidget-DAo6usU5.js → CommerceWidget-ChWwYa7k.js} +47 -13
- package/dist/browser/{FeesBreakdown-Do_4_tyu.js → FeesBreakdown-Bwrxqp6b.js} +1 -1
- package/dist/browser/{OnRampWidget-RG_OZXd4.js → OnRampWidget-C9pEXZV3.js} +5 -5
- package/dist/browser/{SaleWidget-DQftecn3.js → SaleWidget-B45sI5s0.js} +13 -13
- package/dist/browser/{SpendingCapHero-CoxLHpTE.js → SpendingCapHero-Bjd7B7th.js} +1 -1
- package/dist/browser/{SwapWidget-LSkbEq1g.js → SwapWidget-BMqAFFmD.js} +8 -8
- package/dist/browser/{TokenImage-CLH1d9BP.js → TokenImage-CAJyp4gf.js} +1 -1
- package/dist/browser/{TopUpView-DVWZQKM_.js → TopUpView-Bc7DQoFO.js} +1 -1
- package/dist/browser/{WalletApproveHero-DcXyF7Dn.js → WalletApproveHero-DZxdbz8b.js} +2 -2
- package/dist/browser/{WalletWidget-CZAV1XtM.js → WalletWidget-CVzsiw4L.js} +3 -3
- package/dist/browser/{auto-track-B4zEVwx6.js → auto-track-aZ2kFdGK.js} +1 -1
- package/dist/browser/{index-D4Sc97gb.js → index-A7uVdhnE.js} +1 -1
- package/dist/browser/{index-C9D-c80w.js → index-Bl-BPNcO.js} +1 -1
- package/dist/browser/{index-BXWS5QZV.js → index-CXCNU8XF.js} +1 -1
- package/dist/browser/{index-CrRYmsHp.js → index-Ccm0tWQA.js} +48 -46
- package/dist/browser/{index-cWaRkvDp.js → index-Ch4CgqXw.js} +1 -1
- package/dist/browser/{index-BhuuRvup.js → index-Cj2Da_uI.js} +1 -1
- package/dist/browser/{index-DULXpQ1E.js → index-D0xOO-zm.js} +1 -1
- package/dist/browser/{index-Bol4qEnj.js → index-o-l7Talb.js} +2 -2
- package/dist/browser/index.js +1 -1
- package/dist/browser/{index.umd-Bxn3k6Zk.js → index.umd-BIod9WXR.js} +1 -1
- package/dist/browser/{useInterval--aqrNrGa.js → useInterval-lE5hntN7.js} +1 -1
- package/package.json +7 -7
- package/src/widgets/immutable-commerce/functions/getCommerceWidgetEvent.ts +38 -0
- package/src/widgets/immutable-commerce/hooks/useWidgetEvents.ts +1 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r 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, v 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, o as oo, C as Co, ay as getDefaultExportFromCjs, az as commonjsGlobal, k as useTranslation, aA as Drawer, aB as Divider, H as Heading, y as Button, aC as useProvidersContext, D 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 Y, aR as SQUID_NATIVE_TOKEN, aS as commonjsRequire, X as getRemoteImage, aT as OnboardingPagination, aU as ViewContext, aV as useHandover, F as EventTargetContext, aW as HandoverTarget, V as ViewActions, q 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,
|
|
2
|
-
import { T as TokenImage } from './TokenImage-
|
|
3
|
-
import { F as FeesBreakdown } from './FeesBreakdown-
|
|
1
|
+
import { r 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, v 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, o as oo, C as Co, ay as getDefaultExportFromCjs, az as commonjsGlobal, k as useTranslation, aA as Drawer, aB as Divider, H as Heading, y as Button, aC as useProvidersContext, D 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 Y, aR as SQUID_NATIVE_TOKEN, aS as commonjsRequire, X as getRemoteImage, aT as OnboardingPagination, aU as ViewContext, aV as useHandover, F as EventTargetContext, aW as HandoverTarget, V as ViewActions, q 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, A 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 xt, bn as Ot, 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-Ccm0tWQA.js';
|
|
2
|
+
import { T as TokenImage } from './TokenImage-CAJyp4gf.js';
|
|
3
|
+
import { F as FeesBreakdown } from './FeesBreakdown-Bwrxqp6b.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The function `useInterval` sets up an interval that repeatedly calls a given callback function with
|
|
@@ -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 xt(addresses, config);
|
|
4444
|
+
return Ot(result);
|
|
4445
4445
|
};
|
|
4446
4446
|
|
|
4447
4447
|
function AddTokens({ checkout, toAmount, config, toTokenAddress, showOnrampOption = true, showSwapOption = true, showBridgeOption = true, onCloseButtonClick, showBackButton, onBackButtonClick, }) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { cq as toQuantity, cr as toBeHex, cs as getAddress, ct as keccak256, cu as AbiCoder, cv as concat, cw as axios, cx as ZeroAddress, d as Contract, _ as isAddress, bN as K$1, aQ as Y, cy as nt$1, cz as S, r as reactExports, o as oo, p as po, x as jsxs, v as jsx, cA as ShimmerBox, aP as MenuItem, S as Stack, k as useTranslation, A as Body, y as Button, B as Box, cB as PASSPORT_URL, L as Link, cC as getChainImage, b1 as FramedImage, b7 as EllipsizedText, bd as Icon, cD as getChainIdBySlug, aU as ViewContext, D as useAnalytics, aF as Fragment, aB as Divider, U as UserJourney, V as ViewActions, cE as useWalletConnect, cF as Logo, cG as RawImage, cH as isWalletConnectProvider, G as CryptoFiatContext, a$ as isNativeToken, b0 as getTokenImageByAddress, cI as getNativeSymbolByChainSlug, cc as formatUnits, j as calculateCryptoToFiat, F as EventTargetContext, e as ae$1, cJ as JsonRpcProvider, a1 as CryptoFiatActions, aJ as D$1, bp as useInjectedProviders, cK as retry,
|
|
2
|
-
import { B as BridgeWidgetViews, T as TopUpView } from './TopUpView-
|
|
3
|
-
import { T as TokenImage } from './TokenImage-
|
|
4
|
-
import { A as Accordion, S as SelectForm, T as TextInputForm, a as TransactionRejected, g as getAllowedBalances, b as gasAmountAccordionStyles, c as gasAmountHeadingStyles, N as NetworkSwitchDrawer, W as WalletApproveHero } from './WalletApproveHero-
|
|
5
|
-
import { u as useInterval } from './useInterval
|
|
6
|
-
import { F as FeesBreakdown } from './FeesBreakdown-
|
|
1
|
+
import { cq as toQuantity, cr as toBeHex, cs as getAddress, ct as keccak256, cu as AbiCoder, cv as concat, cw as axios, cx as ZeroAddress, d as Contract, _ as isAddress, bN as K$1, aQ as Y, cy as nt$1, cz as S, r as reactExports, o as oo, p as po, x as jsxs, v as jsx, cA as ShimmerBox, aP as MenuItem, S as Stack, k as useTranslation, A as Body, y as Button, B as Box, cB as PASSPORT_URL, L as Link, cC as getChainImage, b1 as FramedImage, b7 as EllipsizedText, bd as Icon, cD as getChainIdBySlug, aU as ViewContext, D as useAnalytics, aF as Fragment, aB as Divider, U as UserJourney, V as ViewActions, cE as useWalletConnect, cF as Logo, cG as RawImage, cH as isWalletConnectProvider, G as CryptoFiatContext, a$ as isNativeToken, b0 as getTokenImageByAddress, cI as getNativeSymbolByChainSlug, cc as formatUnits, j as calculateCryptoToFiat, F as EventTargetContext, e as ae$1, cJ as JsonRpcProvider, a1 as CryptoFiatActions, aJ as D$1, bp as useInjectedProviders, cK as retry, M as HeaderNavigation, c6 as FooterLogo, aD as WalletDrawer, z as SimpleLayout, cL as getChainSlugById, aK as isPassportProvider, cM as DEFAULT_TRANSACTIONS_RETRY_POLICY, aG as qt, a0 as LoadingView, Q as useTheme, H as Heading, cN as getChainNameById, cO as getWalletProviderNameByProvider, cP as isMetaMaskProvider, cQ as fe$1, aA as Drawer, b3 as ButtCon, cR as ButtonNavigationStyles, O as orchestrationEvents, J as tokenValueFormat, h as formatZeroAmount, cS as NATIVE, bm as xt, P as amountInputValidation, W as CloudImage, cT as ETH_TOKEN_SYMBOL, X as getRemoteImage, bH as PriceDisplay, b as parseUnits, cU as st, cV as DEFAULT_QUOTE_REFRESH_INTERVAL, cW as addChainChangedListener, cX as removeChainChangedListener, bn as Ot, cY as IMX_TOKEN_SYMBOL, a5 as SharedViews, cZ as DEFAULT_TOKEN_DECIMALS, l as dist, c_ as CHECKOUT_CDN_BASE_URL, c$ as heroBackGroundStyles, d0 as heroImageStyles, be as Badge, d1 as SimpleTextBody, d2 as FooterButton, d3 as getEthTokenImage, d4 as WITHDRAWAL_CLAIM_GAS_LIMIT, d5 as Ct, bI as viewReducer, bJ as initialViewState, d6 as r, d7 as StatusView, c7 as StatusType, a6 as ErrorView, bR as ServiceUnavailableErrorView, Y as CryptoFiatProvider, K as getDefaultTokenImage } from './index-Ccm0tWQA.js';
|
|
2
|
+
import { B as BridgeWidgetViews, T as TopUpView } from './TopUpView-Bc7DQoFO.js';
|
|
3
|
+
import { T as TokenImage } from './TokenImage-CAJyp4gf.js';
|
|
4
|
+
import { A as Accordion, S as SelectForm, T as TextInputForm, a as TransactionRejected, g as getAllowedBalances, b as gasAmountAccordionStyles, c as gasAmountHeadingStyles, N as NetworkSwitchDrawer, W as WalletApproveHero } from './WalletApproveHero-DZxdbz8b.js';
|
|
5
|
+
import { u as useInterval } from './useInterval-lE5hntN7.js';
|
|
6
|
+
import { F as FeesBreakdown } from './FeesBreakdown-Bwrxqp6b.js';
|
|
7
7
|
|
|
8
8
|
var ae=[{inputs:[{internalType:"address",name:"_gateway",type:"address"},{internalType:"address",name:"_initializerAddress",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"CallerNotBridge",type:"error"},{inputs:[],name:"InvalidAddress",type:"error"},{inputs:[],name:"InvalidChildBridgeAdaptor",type:"error"},{inputs:[],name:"InvalidChildChain",type:"error"},{inputs:[],name:"InvalidSourceAddress",type:"error"},{inputs:[],name:"InvalidSourceChain",type:"error"},{inputs:[],name:"NoGas",type:"error"},{inputs:[],name:"NotApprovedByGateway",type:"error"},{inputs:[],name:"UnauthorizedInitializer",type:"error"},{inputs:[],name:"UnsupportedOperation",type:"error"},{inputs:[],name:"ZeroAddresses",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"sourceChain",type:"string"},{indexed:!1,internalType:"string",name:"sourceAddress_",type:"string"},{indexed:!1,internalType:"bytes",name:"payload_",type:"bytes"}],name:"AdaptorExecute",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"string",name:"childChain",type:"string"},{indexed:!0,internalType:"string",name:"childBridgeAdaptor",type:"string"},{indexed:!0,internalType:"bytes",name:"payload",type:"bytes"}],name:"AxelarMessageSent",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"oldChildBridgeAdaptor",type:"string"},{indexed:!1,internalType:"string",name:"newChildBridgeAdaptor",type:"string"}],name:"ChildBridgeAdaptorUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"string",name:"oldChildChain",type:"string"},{indexed:!0,internalType:"string",name:"newChildChain",type:"string"}],name:"ChildChainUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldGasService",type:"address"},{indexed:!0,internalType:"address",name:"newGasService",type:"address"}],name:"GasServiceUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldRootBridge",type:"address"},{indexed:!0,internalType:"address",name:"newRootBridge",type:"address"}],name:"RootBridgeUpdated",type:"event"},{inputs:[],name:"BRIDGE_MANAGER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"GAS_SERVICE_MANAGER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"TARGET_MANAGER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"childBridgeAdaptor",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"childChainId",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"commandId",type:"bytes32"},{internalType:"string",name:"sourceChain",type:"string"},{internalType:"string",name:"sourceAddress",type:"string"},{internalType:"bytes",name:"payload",type:"bytes"}],name:"execute",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"commandId",type:"bytes32"},{internalType:"string",name:"sourceChain",type:"string"},{internalType:"string",name:"sourceAddress",type:"string"},{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"string",name:"tokenSymbol",type:"string"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"executeWithToken",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"gasService",outputs:[{internalType:"contract IAxelarGasService",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"gateway",outputs:[{internalType:"contract IAxelarGateway",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantBridgeManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantGasServiceManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantTargetManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"defaultAdmin",type:"address"},{internalType:"address",name:"bridgeManager",type:"address"},{internalType:"address",name:"gasServiceManager",type:"address"},{internalType:"address",name:"targetManager",type:"address"}],internalType:"struct IRootAxelarBridgeAdaptor.InitializationRoles",name:"_adaptorRoles",type:"tuple"},{internalType:"address",name:"_rootBridge",type:"address"},{internalType:"string",name:"_childChainId",type:"string"},{internalType:"string",name:"_childBridgeAdaptor",type:"string"},{internalType:"address",name:"_gasService",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"initializerAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokeBridgeManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokeGasServiceManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokeTargetManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rootBridge",outputs:[{internalType:"contract IRootERC20Bridge",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"payload",type:"bytes"},{internalType:"address",name:"refundRecipient",type:"address"}],name:"sendMessage",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"string",name:"newChildBridgeAdaptor",type:"string"}],name:"updateChildBridgeAdaptor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"newChildChain",type:"string"}],name:"updateChildChain",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newGasService",type:"address"}],name:"updateGasService",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newRootBridge",type:"address"}],name:"updateRootBridge",outputs:[],stateMutability:"nonpayable",type:"function"}];var ie=(i=>(i.SUCCESS="SUCCESS",i.PENDING="PENDING",i.FAILED="FAILED",i))(ie||{}),W=(i=>(i.DEPOSIT="DEPOSIT",i.WITHDRAW="WITHDRAW",i.FINALISE_WITHDRAWAL="FINALISE_WITHDRAWAL",i))(W||{}),G=(d=>(d[d.DEPOSIT_SOURCE=15e4]="DEPOSIT_SOURCE",d[d.DEPOSIT_DESTINATION=25e4]="DEPOSIT_DESTINATION",d[d.WITHDRAW_SOURCE=25e4]="WITHDRAW_SOURCE",d[d.WITHDRAW_DESTINATION=25e4]="WITHDRAW_DESTINATION",d[d.MAP_TOKEN_SOURCE=2e5]="MAP_TOKEN_SOURCE",d[d.MAP_TOKEN_DESTINATION=2e5]="MAP_TOKEN_DESTINATION",d[d.FINALISE_WITHDRAWAL=2e5]="FINALISE_WITHDRAWAL",d[d.APPROVE_TOKEN=55e3]="APPROVE_TOKEN",d))(G||{}),U=(s=>(s.PENDING="PENDING",s.PROCESSING="PROCESSING",s.COMPLETE="COMPLETE",s.RETRY="RETRY",s.ERROR="ERROR",s.NOT_ENOUGH_GAS="NOT_ENOUGH_GAS",s.FLOW_RATE_CONTROLLED="FLOW_RATE_CONTROLLED",s))(U||{});var R="NATIVE",re="11155111",Ze="1",H="15003",V="13473",X="13371",se="0x0000000000000000000000000000000000000eee",oe="0x7a8dc26796a1e50e6e190b70259f58f6a4edd5b22280ceecc82b687b8e982869",de="0x07b0d4304f82012bd3b70b1d531c160e326067c90829e2a3d386722ad10b89c3",pe="0x0000000000000000000000000000000000000000000000000000000000000004",ue={mainnet:"0x3a0c2ba54d6cbd3121f01b96dfd20e99d1696c9d",testnet:"0x1CcCa691501174B4A623CeDA58cC8f1a76dc3439",devnet:""},le={mainnet:"0xf57e7e7c23978c3caec3c3548e3d615c346e79ff",testnet:"0xe2629e08f4125d14e446660028bD98ee60EE69F2",devnet:""},ye={mainnet:"0x52a6c53869ce09a731cd772f245b97a4401d3348",testnet:"0xe9E96d1aad82562b7588F03f49aD34186f996478",devnet:""},ce={mainnet:"0x4f49b53928a71e553bb1b0f66a5bcb54fd4e8932",testnet:"0x6328Ac88ba8D466a0F551FC7C42C61d1aC7f92ab",devnet:""},me={mainnet:"0x4f49b53928a71e553bb1b0f66a5bcb54fd4e8932",testnet:"0x6328Ac88ba8D466a0F551FC7C42C61d1aC7f92ab",devnet:""},Te={mainnet:"immutable",testnet:"immutable",devnet:""},ge={mainnet:"0x4F4495243837681061C4743b74B3eEdf548D56A5",testnet:"0xe432150cce91c13a887f7D836923d5597adD8E31",devnet:""},$={rootChainID:re,childChainID:H},O={rootChainID:re,childChainID:V},P={rootChainID:Ze,childChainID:X},fe={mainnet:"https://api.gmp.axelarscan.io",testnet:"https://testnet.api.gmp.axelarscan.io",devnet:"https://stagenet.api.gmp.axelarscan.io"},he={mainnet:"https://bridge-api.immutable.com/v1/tenderly/estimate",testnet:"https://bridge-api.sandbox.immutable.com/v1/tenderly/estimate",devnet:"https://bridge-api.dev.immutable.com/v1/tenderly/estimate"},K={11155111:{id:"ethereum-sepolia",symbol:"ETH"},1:{id:"ethereum",symbol:"ETH"},15003:{id:"immutable",symbol:"IMX"},13473:{id:"immutable",symbol:"IMX"},13371:{id:"immutable",symbol:"IMX"}},Q={deposit:{token:"deposit",tokenTo:"depositTo",native:"depositETH",nativeTo:"depositToETH"},withdraw:{token:"withdraw",tokenTo:"withdrawTo",native:"withdrawIMX",nativeTo:"withdrawIMXTo"}};var _=(T=>(T.UNSUPPORTED_ERROR="UNSUPPORTED_ERROR",T.INVALID_ADDRESS="INVALID_ADDRESS",T.INVALID_AMOUNT="INVALID_AMOUNT",T.INTERNAL_ERROR="INTERNAL_ERROR",T.PROVIDER_ERROR="PROVIDER_ERROR",T.ROOT_PROVIDER_ERROR="ROOT_PROVIDER_ERROR",T.CHILD_PROVIDER_ERROR="CHILD_PROVIDER_ERROR",T.TRANSACTION_REVERTED="TRANSACTION_REVERTED",T.INVALID_TOKEN="INVALID_TOKEN",T.INVALID_TRANSACTION="INVALID_TRANSACTION",T.INVALID_SOURCE_CHAIN_ID="INVALID_SOURCE_CHAIN_ID",T.INVALID_DESTINATION_CHAIN_ID="INVALID_DESTINATION_CHAIN_ID",T.INVALID_SOURCE_OR_DESTINATION_CHAIN="INVALID_SOURCE_OR_DESTINATION_CHAIN",T.CHAIN_IDS_MATCH="CHAIN_IDS_MATCH",T.AXELAR_CHAIN_NOT_FOUND="AXELAR_CHAIN_NOT_FOUND",T.AXELAR_GAS_ESTIMATE_FAILED="AXELAR_GAS_ESTIMATE_FAILED",T.TENDERLY_GAS_ESTIMATE_FAILED="TENDERLY_GAS_ESTIMATE_FAILED",T.INVALID_RECIPIENT="INVALID_RECIPIENT",T.FLOW_RATE_ERROR="FLOW_RATE_ERROR",T.INVALID_FLOWRATE_INDEX="INVALID_FLOWRATE_INDEX",T))(_||{}),y=class extends Error{type;constructor(e,t){super(e),this.type=t;}},E=async(n,e,t)=>{try{return await n()}catch(i){let a=`${e}: ${i.message}`||"UnknownError";throw new y(a,e)}};async function I(n,e,t){return await E(async()=>new Contract(n,e,t),"PROVIDER_ERROR")}function C(n,e){let t;return n===P.rootChainID||n===P.childChainID?t=e.mainnet:n===O.rootChainID||n===O.childChainID?t=e.testnet:t=e.devnet,t}function je(n){return C(n,ye)}function be(n,e){return n.toUpperCase()===je(e).toUpperCase()}function z(n){return C(n,le)}function Re(n,e){return n.toUpperCase()===z(e).toUpperCase()}function Ie(n){return C(n,ce)}function Ae(n){return C(n,me)}function Ee(n){return C(n,Te)}function we(n){return C(n,ge)}function Z(n){return C(n,fe)}function xe(n){return C(n,he)}function qe(n){return C(n,ue)}function B(n,e){return n.toUpperCase()===qe(e).toUpperCase()}function v(n,e){return n.sourceChainId===e.rootChainID&&n.destinationChainId===e.childChainID&&n.action==="DEPOSIT"}function Ce(n,e){return n===e.rootChainID}function D(n,e){return n.sourceChainId===e.childChainID&&n.destinationChainId===e.rootChainID&&n.action==="WITHDRAW"}function ve(n,e,t){return D(e,t)&&!B(n,e.sourceChainId)}function _e(n){return !("token"in n)||n.token.toUpperCase()===R}function De(n,e,t){return D(e,t)&&B(n,e.sourceChainId)}async function Me(n){let e="Please upgrade to the latest version of the Bridge SDK or provide valid configuration",t=await E(async()=>n.rootProvider.getNetwork(),"ROOT_PROVIDER_ERROR");if(t.chainId.toString()!==n.bridgeInstance.rootChainID)throw new y(`Rootchain provider chainID ${t.chainId} does not match expected chainID ${n.bridgeInstance.rootChainID}. ${e}`,"UNSUPPORTED_ERROR");let i=await E(async()=>n.childProvider.getNetwork(),"CHILD_PROVIDER_ERROR");if(i.chainId.toString()!==n.bridgeInstance.childChainID)throw new y(`Childchain provider chainID ${i.chainId} does not match expected chainID ${n.bridgeInstance.childChainID}. ${e} `,"UNSUPPORTED_ERROR")}async function Ne(n,e,t,i){let a;if(e===i.bridgeInstance.rootChainID){if(!be(n,e))return;a=i.rootProvider;}else {if(!Re(n,e))return;a=i.childProvider;}if((await a.getCode(t)).length<=2)return;let s=await I(t,["function receive()"],a);try{await s.receive.estimateGas();}catch{try{await a.estimateGas({to:t});}catch{throw new y(`address ${t} is not a valid receipient`,"INVALID_RECIPIENT")}}}async function j(n,e,t){if(!(n===t.bridgeInstance.rootChainID||n===t.bridgeInstance.childChainID))throw new y(`the sourceChainId ${n} is not a valid`,"INVALID_SOURCE_CHAIN_ID");if(!(e===t.bridgeInstance.rootChainID||e===t.bridgeInstance.childChainID))throw new y(`the destinationChainId ${e} is not a valid`,"INVALID_DESTINATION_CHAIN_ID");if(n===e)throw new y(`the sourceChainId ${n} cannot be the same as the destinationChainId ${e}`,"CHAIN_IDS_MATCH")}async function Oe(n,e){if(await j(n.sourceChainId,n.destinationChainId,e),!isAddress(n.senderAddress)||!isAddress(n.recipientAddress))throw new y(`address ${n.senderAddress} or ${n.recipientAddress} is not a valid address`,"INVALID_ADDRESS");if(n.amount<=0n)throw new y(`deposit amount ${n.amount.toString()} is invalid`,"INVALID_AMOUNT");if(n.token.toUpperCase()!==R&&!isAddress(n.token))throw new y(`token address ${n.token} is not a valid address`,"INVALID_ADDRESS")}function Pe(n,e){if(n.action==="FINALISE_WITHDRAWAL"&&n.sourceChainId!==e.bridgeInstance.rootChainID)throw new y(`Finalised withdrawals must be on the root chain (${e.bridgeInstance.rootChainID})`,"INVALID_SOURCE_CHAIN_ID");if(!("destinationChainId"in n))throw new y("DEPOSIT or WITHDRAW used without destinationChainId","INVALID_DESTINATION_CHAIN_ID");let t={sourceChainId:n.sourceChainId,destinationChainId:n.destinationChainId,action:n.action};if(!v(t,e.bridgeInstance)&&!D(t,e.bridgeInstance))throw new y("This request is neither a valid deposit nor a valid withdrawal","INVALID_SOURCE_OR_DESTINATION_CHAIN")}var Je=n=>!!n.maxFeePerGas&&!!n.maxPriorityFeePerGas,et=n=>{if(Je(n)){let{maxFeePerGas:e,maxPriorityFeePerGas:t}=n;if(e===null||t===null)return null;let i=(e-t)/BigInt(2);return t+i}return n.gasPrice?n.gasPrice:null};function w(n,e){let t=et(n);return t?t*BigInt(e):BigInt(0)}var Be=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"userAddress",type:"address"},{indexed:!1,internalType:"address",name:"relayerAddress",type:"address"},{indexed:!1,internalType:"bytes",name:"functionSignature",type:"bytes"}],name:"MetaTransactionExecuted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"bridge",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"burn",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"userAddress",type:"address"},{internalType:"bytes",name:"functionSignature",type:"bytes"},{internalType:"bytes32",name:"sigR",type:"bytes32"},{internalType:"bytes32",name:"sigS",type:"bytes32"},{internalType:"uint8",name:"sigV",type:"uint8"}],name:"executeMetaTransaction",outputs:[{internalType:"bytes",name:"",type:"bytes"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"getNonce",outputs:[{internalType:"uint256",name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"rootToken_",type:"address"},{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"uint8",name:"decimals_",type:"uint8"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"offset",type:"uint256"}],name:"invalidateNext",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"rootToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];function Fe(n){return keccak256(AbiCoder.defaultAbiCoder().encode(["bytes","uint256"],[n,new Date().getTime()]))}function We(n,e,t,i){return AbiCoder.defaultAbiCoder().encode(["bytes32","address","address","address","uint256"],[oe,n,e,t,i])}async function nt(n,e){return I(n,Be,e)}async function ke(n,e,t){if(n.toUpperCase()===R||B(n,e))return z(e);let i=await nt(n,t);return E(()=>i.rootToken(),"PROVIDER_ERROR")}var it="0x84a3291a0";function rt(n){let e={};return n.forEach(t=>{let{contractAddress:i,stateDiff:a}=t,{storageSlot:r,value:o}=a;e[i]===void 0&&(e[i]={stateDiff:{}}),e[i].stateDiff[r]=o;}),e}async function q(n,e,t){let i,a=xe(n),r=t?rt(t):void 0;try{i=await axios.post(a,{jsonrpc:"2.0",id:0,method:"tenderly_simulateBundle",params:[e,"latest",r]},{headers:{"Content-Type":"application/json"}});}catch(g){i=g.response;}if(i.data.error)throw new y(`Estimating gas failed with the reason: ${i.data.error.message}`,"TENDERLY_GAS_ESTIMATE_FAILED");let o=i.data.result;if(o.length!==e.length)throw new y("Estimating gas failed with mismatched responses","TENDERLY_GAS_ESTIMATE_FAILED");let s=[],d=!1,p=!1,u=!1,l=0,m=!1,f=e.find(g=>g.data?.startsWith(it))!==void 0;for(let g=0;g<o.length;g++){if(o[g].error)throw new y(`Estimating deposit gas failed with the reason: ${o[g].error.message}`,"TENDERLY_GAS_ESTIMATE_FAILED");if(o[g].gasUsed===void 0)throw new y("Estimating gas did not return simulation results","TENDERLY_GAS_ESTIMATE_FAILED");if(f&&o[g].logs!==void 0){let c=o[g].logs.find(A=>A.name==="QueuedWithdrawal");if(c!==void 0){let A=new Map(c.inputs.map(x=>[x.name,x.value]));d=A.get("delayWithdrawalLargeAmount")||!1,p=A.get("delayWithdrawalUnknownToken")||!1,u=A.get("withdrawalQueueActivated")||!1;}}if(f&&o[g].trace!==void 0){let c=o[g].trace.find(A=>A.method==="largeTransferThresholds");c!==void 0&&(l=c.output,m=!0);}m||s.push(o[g].gasUsed);}return {gas:s,delayWithdrawalLargeAmount:d,delayWithdrawalUnknownToken:p,withdrawalQueueActivated:u,largeTransferThresholds:l}}var Le="0x0000000000000000000000000000000000000000000000000000000000000001";async function Ge(n,e,t,i,a,r){let o,s;if(i.toUpperCase()===R)n===e?(o=a.native,s=[t]):(o=a.nativeTo,s=[e,t]);else {let d=getAddress(i);n===e?(o=a.token,s=[d,t]):(o=a.tokenTo,s=[d,e,t]);}return await E(async()=>r.interface.encodeFunctionData(o,s),"INTERNAL_ERROR")}var M=[{inputs:[{internalType:"address",name:"_initializerAddress",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"AlreadyMapped",type:"error"},{inputs:[{internalType:"uint256",name:"actualBalance",type:"uint256"},{internalType:"uint256",name:"expectedBalance",type:"uint256"}],name:"BalanceInvariantCheckFailed",type:"error"},{inputs:[],name:"CantMapETH",type:"error"},{inputs:[],name:"CantMapIMX",type:"error"},{inputs:[],name:"CantMapWETH",type:"error"},{inputs:[],name:"ImxDepositLimitExceeded",type:"error"},{inputs:[],name:"ImxDepositLimitTooLow",type:"error"},{inputs:[{internalType:"uint256",name:"lengthOfQueue",type:"uint256"},{internalType:"uint256",name:"requestedIndex",type:"uint256"}],name:"IndexOutsideWithdrawalQueue",type:"error"},{inputs:[],name:"InsufficientValue",type:"error"},{inputs:[],name:"InvalidCapacity",type:"error"},{inputs:[],name:"InvalidChildChain",type:"error"},{inputs:[{internalType:"string",name:"reason",type:"string"}],name:"InvalidData",type:"error"},{inputs:[],name:"InvalidRefillRate",type:"error"},{inputs:[],name:"InvalidToken",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"actualToken",type:"address"}],name:"MixedTokens",type:"error"},{inputs:[],name:"NoGas",type:"error"},{inputs:[],name:"NonWrappedNativeTransfer",type:"error"},{inputs:[],name:"NotBridgeAdaptor",type:"error"},{inputs:[],name:"NotMapped",type:"error"},{inputs:[],name:"ProvideAtLeastOneIndex",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"TokenIsZero",type:"error"},{inputs:[],name:"TokenNotSupported",type:"error"},{inputs:[],name:"UnauthorizedInitializer",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"WithdrawalAlreadyProcessed",type:"error"},{inputs:[{internalType:"uint256",name:"timeNow",type:"uint256"},{internalType:"uint256",name:"currentWithdrawalTime",type:"uint256"}],name:"WithdrawalRequestTooEarly",type:"error"},{inputs:[],name:"WrongInitializer",type:"error"},{inputs:[],name:"ZeroAddress",type:"error"},{inputs:[],name:"ZeroAmount",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"who",type:"address"}],name:"ActivatedWithdrawalQueue",type:"event"},{anonymous:!1,inputs:[],name:"AutoActivatedWithdrawalQueue",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"childToken",type:"address"},{indexed:!1,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"ChildChainERC20Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"who",type:"address"}],name:"DeactivatedWithdrawalQueue",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token",type:"address"},{indexed:!0,internalType:"address",name:"withdrawer",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"timestamp",type:"uint256"},{indexed:!1,internalType:"uint256",name:"index",type:"uint256"}],name:"EnQueuedWithdrawal",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!1,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"IMXDeposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"childToken",type:"address"}],name:"L1TokenMapped",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"childToken",type:"address"},{indexed:!1,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"NativeEthDeposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"oldImxDepositLimit",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newImxDepositLimit",type:"uint256"}],name:"NewImxDepositLimit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token",type:"address"},{indexed:!0,internalType:"address",name:"withdrawer",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"timestamp",type:"uint256"},{indexed:!1,internalType:"uint256",name:"index",type:"uint256"}],name:"ProcessedWithdrawal",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token",type:"address"},{indexed:!0,internalType:"address",name:"withdrawer",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"bool",name:"delayWithdrawalLargeAmount",type:"bool"},{indexed:!1,internalType:"bool",name:"delayWithdrawalUnknownToken",type:"bool"},{indexed:!1,internalType:"bool",name:"withdrawalQueueActivated",type:"bool"}],name:"QueuedWithdrawal",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token",type:"address"},{indexed:!1,internalType:"uint256",name:"capacity",type:"uint256"},{indexed:!1,internalType:"uint256",name:"refillRate",type:"uint256"},{indexed:!1,internalType:"uint256",name:"largeTransferThreshold",type:"uint256"},{indexed:!1,internalType:"uint256",name:"previousCapacity",type:"uint256"},{indexed:!1,internalType:"uint256",name:"previousRefillRate",type:"uint256"},{indexed:!1,internalType:"uint256",name:"previousLargeTransferThreshold",type:"uint256"}],name:"RateControlThresholdSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldRootBridgeAdaptor",type:"address"},{indexed:!1,internalType:"address",name:"newRootBridgeAdaptor",type:"address"}],name:"RootBridgeAdaptorUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"childToken",type:"address"},{indexed:!1,internalType:"address",name:"withdrawer",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"RootChainERC20Withdraw",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"childToken",type:"address"},{indexed:!1,internalType:"address",name:"withdrawer",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"RootChainETHWithdraw",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"childToken",type:"address"},{indexed:!1,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"WETHDeposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"delay",type:"uint256"},{indexed:!1,internalType:"uint256",name:"previousDelay",type:"uint256"}],name:"WithdrawalDelayUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"token",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"WithdrawalForNonFlowRatedToken",type:"event"},{inputs:[],name:"ADAPTOR_MANAGER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DEPOSIT_SIG",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAP_TOKEN_SIG",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"NATIVE_ETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"NATIVE_IMX",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"PAUSER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"UNLIMITED_DEPOSIT",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"UNPAUSER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"VARIABLE_MANAGER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"WITHDRAW_SIG",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"activateWithdrawalQueue",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"childERC20Bridge",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"childETHToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"childTokenTemplate",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"deactivateWithdrawalQueue",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC20Metadata",name:"rootToken",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"deposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"depositETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"contract IERC20Metadata",name:"rootToken",type:"address"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"depositTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"depositToETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"finaliseQueuedWithdrawal",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256[]",name:"indices",type:"uint256[]"}],name:"finaliseQueuedWithdrawalsAggregated",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"startIndex",type:"uint256"},{internalType:"uint256",name:"stopIndex",type:"uint256"},{internalType:"uint256",name:"maxFind",type:"uint256"}],name:"findPendingWithdrawals",outputs:[{components:[{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"timestamp",type:"uint256"}],internalType:"struct FlowRateWithdrawalQueue.FindPendingWithdrawal[]",name:"found",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"flowRateBuckets",outputs:[{internalType:"uint256",name:"capacity",type:"uint256"},{internalType:"uint256",name:"depth",type:"uint256"},{internalType:"uint256",name:"refillTime",type:"uint256"},{internalType:"uint256",name:"refillRate",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256[]",name:"indices",type:"uint256[]"}],name:"getPendingWithdrawals",outputs:[{components:[{internalType:"address",name:"withdrawer",type:"address"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"uint256",name:"timestamp",type:"uint256"}],internalType:"struct FlowRateWithdrawalQueue.PendingWithdrawal[]",name:"pending",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"getPendingWithdrawalsLength",outputs:[{internalType:"uint256",name:"length",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantAdaptorManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantPauserRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantUnpauserRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantVariableManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"imxCumulativeDepositLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"defaultAdmin",type:"address"},{internalType:"address",name:"pauser",type:"address"},{internalType:"address",name:"unpauser",type:"address"},{internalType:"address",name:"variableManager",type:"address"},{internalType:"address",name:"adaptorManager",type:"address"}],internalType:"struct IRootERC20Bridge.InitializationRoles",name:"newRoles",type:"tuple"},{internalType:"address",name:"newRootBridgeAdaptor",type:"address"},{internalType:"address",name:"newChildERC20Bridge",type:"address"},{internalType:"address",name:"newChildTokenTemplate",type:"address"},{internalType:"address",name:"newRootIMXToken",type:"address"},{internalType:"address",name:"newRootWETHToken",type:"address"},{internalType:"uint256",name:"newImxCumulativeDepositLimit",type:"uint256"},{internalType:"address",name:"rateAdmin",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"defaultAdmin",type:"address"},{internalType:"address",name:"pauser",type:"address"},{internalType:"address",name:"unpauser",type:"address"},{internalType:"address",name:"variableManager",type:"address"},{internalType:"address",name:"adaptorManager",type:"address"}],internalType:"struct IRootERC20Bridge.InitializationRoles",name:"",type:"tuple"},{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"initialize",outputs:[],stateMutability:"pure",type:"function"},{inputs:[],name:"initializerAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"largeTransferThresholds",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC20Metadata",name:"rootToken",type:"address"}],name:"mapToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes",name:"data",type:"bytes"}],name:"onMessageReceive",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokeAdaptorManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokePauserRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokeUnpauserRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokeVariableManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rootBridgeAdaptor",outputs:[{internalType:"contract IRootBridgeAdaptor",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"rootIMXToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"rootTokenToChildToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"rootWETHToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"capacity",type:"uint256"},{internalType:"uint256",name:"refillRate",type:"uint256"},{internalType:"uint256",name:"largeTransferThreshold",type:"uint256"}],name:"setRateControlThreshold",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"delay",type:"uint256"}],name:"setWithdrawalDelay",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"newImxCumulativeDepositLimit",type:"uint256"}],name:"updateImxCumulativeDepositLimit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newRootBridgeAdaptor",type:"address"}],name:"updateRootBridgeAdaptor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"withdrawalDelay",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"withdrawalQueueActivated",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"}];var k=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];var J=[{inputs:[{internalType:"address",name:"_initializerAddress",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"AlreadyMapped",type:"error"},{inputs:[{internalType:"uint256",name:"actualBalance",type:"uint256"},{internalType:"uint256",name:"expectedBalance",type:"uint256"}],name:"BalanceInvariantCheckFailed",type:"error"},{inputs:[],name:"BridgeNotSet",type:"error"},{inputs:[],name:"BurnFailed",type:"error"},{inputs:[],name:"CantMapETH",type:"error"},{inputs:[],name:"CantMapIMX",type:"error"},{inputs:[],name:"EmptyTokenContract",type:"error"},{inputs:[],name:"IncorrectBridgeAddress",type:"error"},{inputs:[],name:"InsufficientIMX",type:"error"},{inputs:[],name:"InsufficientValue",type:"error"},{inputs:[{internalType:"string",name:"reason",type:"string"}],name:"InvalidData",type:"error"},{inputs:[],name:"MintFailed",type:"error"},{inputs:[],name:"NoGas",type:"error"},{inputs:[],name:"NonWrappedNativeTransfer",type:"error"},{inputs:[],name:"NotBridgeAdaptor",type:"error"},{inputs:[],name:"NotMapped",type:"error"},{inputs:[],name:"TransferWIMXFailed",type:"error"},{inputs:[],name:"UnauthorizedInitializer",type:"error"},{inputs:[],name:"ZeroAddress",type:"error"},{inputs:[],name:"ZeroAddressRootToken",type:"error"},{inputs:[],name:"ZeroAmount",type:"error"},{inputs:[],name:"ZeroValue",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldChildBridgeAdaptor",type:"address"},{indexed:!1,internalType:"address",name:"newChildBridgeAdaptor",type:"address"}],name:"ChildBridgeAdaptorUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"childToken",type:"address"},{indexed:!1,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"ChildChainERC20Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"childToken",type:"address"},{indexed:!1,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"ChildChainERC20Withdraw",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"ChildChainEthWithdraw",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"ChildChainNativeIMXWithdraw",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"ChildChainWrappedIMXWithdraw",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"IMXDeposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"rootToken",type:"address"},{indexed:!1,internalType:"address",name:"childToken",type:"address"}],name:"L2TokenMapped",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"rootToken",type:"address"},{indexed:!0,internalType:"address",name:"childToken",type:"address"},{indexed:!1,internalType:"address",name:"depositor",type:"address"},{indexed:!0,internalType:"address",name:"receiver",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"NativeEthDeposit",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"depositor",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"PrivilegedDeposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{inputs:[],name:"ADAPTOR_MANAGER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DEPOSIT_SIG",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAP_TOKEN_SIG",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"NATIVE_ETH",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"NATIVE_IMX",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"PAUSER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PRIVILEGED_DEPOSITOR_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"UNPAUSER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"WITHDRAW_SIG",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"childBridgeAdaptor",outputs:[{internalType:"contract IChildBridgeAdaptor",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"childETHToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"childTokenTemplate",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantAdaptorManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantPauserRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"grantUnpauserRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"defaultAdmin",type:"address"},{internalType:"address",name:"pauser",type:"address"},{internalType:"address",name:"unpauser",type:"address"},{internalType:"address",name:"adaptorManager",type:"address"},{internalType:"address",name:"initialDepositor",type:"address"},{internalType:"address",name:"treasuryManager",type:"address"}],internalType:"struct IChildERC20Bridge.InitializationRoles",name:"newRoles",type:"tuple"},{internalType:"address",name:"newBridgeAdaptor",type:"address"},{internalType:"address",name:"newChildTokenTemplate",type:"address"},{internalType:"address",name:"newRootIMXToken",type:"address"},{internalType:"address",name:"newWIMXToken",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"initializerAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"data",type:"bytes"}],name:"onMessageReceive",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"privilegedDeposit",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokeAdaptorManagerRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokePauserRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"revokeUnpauserRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"rootIMXToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"rootTokenToChildToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newBridgeAdaptor",type:"address"}],name:"updateChildBridgeAdaptor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"wIMXToken",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IChildERC20",name:"childToken",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdraw",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdrawETH",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdrawETHTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdrawIMX",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdrawIMXTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"contract IChildERC20",name:"childToken",type:"address"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdrawTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdrawWIMX",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"withdrawWIMXTo",outputs:[],stateMutability:"payable",type:"function"},{stateMutability:"payable",type:"receive"}];var ee=(c=>(c.SRC_GATEWAY_CALLED="source_gateway_called",c.DEST_GATEWAY_APPROVED="destination_gateway_approved",c.DEST_EXECUTED="destination_executed",c.EXPRESS_EXECUTED="express_executed",c.DEST_EXECUTE_ERROR="error",c.DEST_EXECUTING="executing",c.APPROVING="approving",c.FORECALLED="forecalled",c.FORECALLED_WITHOUT_GAS_PAID="forecalled_without_gas_paid",c.NOT_EXECUTED="not_executed",c.NOT_EXECUTED_WITHOUT_GAS_PAID="not_executed_without_gas_paid",c.INSUFFICIENT_FEE="insufficient_fee",c.UNKNOWN_ERROR="unknown_error",c.CANNOT_FETCH_STATUS="cannot_fetch_status",c.SRC_GATEWAY_CONFIRMED="confirmed",c))(ee||{}),Ue=(a=>(a.GAS_UNPAID="gas_unpaid",a.GAS_PAID="gas_paid",a.GAS_PAID_NOT_ENOUGH_GAS="gas_paid_not_enough_gas",a.GAS_PAID_ENOUGH_GAS="gas_paid_enough_gas",a))(Ue||{});var ot=n=>{let{error:e,status:t}=n;return t==="error"&&e?"error":t==="executed"?"destination_executed":t==="approved"?"destination_gateway_approved":t==="called"?"source_gateway_called":t==="executing"?"executing":t},dt=n=>{if(n.error)return {message:n.error.error.message,txHash:n.error.error.transactionHash,chain:n.error.chain};if(n.is_insufficient_fee)return {message:"Insufficient fee",txHash:n.call.transaction.hash,chain:n.call.chain}},pt=async(n,e)=>fetch(`${n}?${new URLSearchParams(e).toString()}`,{method:"GET",headers:{"Content-Type":"application/json"},cache:"no-store"}).then(t=>t.json()).then(t=>t.data),ut=async(n,e,t)=>pt(n,{method:"searchGMP",txHash:e,txLogIndex:t}).then(i=>i.find(a=>a.id.indexOf(e)>-1||a.call.transactionHash.indexOf(e)>-1)).catch(()=>{}),He=async(n,e,t)=>{let i=await ut(n,e,t);if(!i)return {status:"cannot_fetch_status"};let{call:a,gas_status:r,gas_paid:o,executed:s,express_executed:d,approved:p,callback:u}=i,l={status:r,details:o},m=i.time_spent;return m&&(m.total=m.total||Object.values(m).reduce((f,g)=>f+g,0)),{status:ot(i),error:dt(i),timeSpent:m,gasPaidInfo:l,callTx:a,executed:s,expressExecuted:d,approved:p,callback:u}};var Xe=class{config;initialised;constructor(e){this.config=e,this.initialised=!1;}async initialise(){this.initialised||(await Me(this.config),this.initialised=!0);}async getFee(e){let[,,t]=await Promise.all([this.initialise(),async()=>{e.action!=="FINALISE_WITHDRAWAL"&&await j(e.sourceChainId,e.destinationChainId,this.config);},this.getFeePrivate(e)]);return t}async getFinaliseWithdrawFee(){let e=await this.config.rootProvider.getFeeData();return w(e,2e5)}async getDepositOrWithdrawFee(e){let t;e.sourceChainId===this.config.bridgeInstance.rootChainID?t=await this.config.rootProvider.getFeeData():t=await this.config.childProvider.getFeeData();let i=BigInt(0),a=BigInt(0),r=BigInt(0),o;if(e.action==="DEPOSIT")o={sourceChainId:e.sourceChainId,destinationChainId:e.destinationChainId,action:"DEPOSIT"};else if(e.action==="WITHDRAW")o={sourceChainId:e.sourceChainId,destinationChainId:e.destinationChainId,action:"WITHDRAW"};else throw new y("Invalid action","INTERNAL_ERROR");if(!(v(o,this.config.bridgeInstance)||D(o,this.config.bridgeInstance)))throw new y("Invalid direction","INTERNAL_ERROR");_e(e)||(v(o,this.config.bridgeInstance)?a=w(t,55e3):"token"in e&&De(e.token,o,this.config.bridgeInstance)&&(a=w(t,55e3)));let s;return e.action==="DEPOSIT"?(i=w(t,15e4),s=25e4):(i=w(t,25e4),s=25e4),r=await this.getAxelarFee(e.sourceChainId,e.destinationChainId,s,e.gasMultiplier),{sourceChainFee:i,approvalFee:a,bridgeFee:r}}async getFeePrivate(e){Pe(e,this.config);let t=BigInt(0),i=BigInt(0),a=BigInt(0);if(e.action==="FINALISE_WITHDRAWAL")t=await this.getFinaliseWithdrawFee();else {let s=await this.getDepositOrWithdrawFee(e);t=s.sourceChainFee,i=s.approvalFee,a=s.bridgeFee;}let r=t+i+a,o=BigInt("0");return {sourceChainGas:t,approvalFee:i,bridgeFee:a,imtblFee:o,totalFees:r}}async getUnsignedApproveBridgeTx(e){let t=await this.getUnsignedBridgeBundledTx({senderAddress:e.senderAddress,recipientAddress:e.senderAddress,token:e.token,amount:e.amount,sourceChainId:e.sourceChainId,destinationChainId:e.destinationChainId,gasMultiplier:1.1});return {contractToApprove:t.contractToApprove,unsignedTx:t.unsignedApprovalTx}}async getBridgeMethods(e){let t;return v(e,this.config.bridgeInstance)?t=Q.deposit:t=Q.withdraw,t}async getBridgeContract(e){if(v(e,this.config.bridgeInstance)){let i=this.config.bridgeContracts.rootERC20BridgeFlowRate;return await I(i,M,this.config.rootProvider)}let t=this.config.bridgeContracts.childERC20Bridge;return await I(t,J,this.config.childProvider)}async getConfigAndBridgeTxCalldata(e,t,i,a,r){let o=await this.getBridgeMethods(r),s=await this.getBridgeContract(r);return Ge(e,t,i,a,o,s)}async getUnsignedBridgeTx(e){let t=await this.getUnsignedBridgeBundledTx({senderAddress:e.senderAddress,recipientAddress:e.senderAddress,token:e.token,amount:e.amount,sourceChainId:e.sourceChainId,destinationChainId:e.destinationChainId,gasMultiplier:e.gasMultiplier});return {feeData:t.feeData,unsignedTx:t.unsignedBridgeTx}}async getUnsignedBridgeBundledTx(e){let[,,,t]=await Promise.all([this.initialise(),Oe(e,this.config),Ne(e.token,e.destinationChainId,e.recipientAddress,this.config),this.getUnsignedBridgeBundledTxPrivate(e)]);return t}async getUnsignedBridgeBundledTxPrivate(e){let t;if(Ce(e.sourceChainId,this.config.bridgeInstance)?t={sourceChainId:e.sourceChainId,destinationChainId:e.destinationChainId,action:"DEPOSIT"}:t={sourceChainId:e.sourceChainId,destinationChainId:e.destinationChainId,action:"WITHDRAW"},v(t,this.config.bridgeInstance))return this.getUnsignedBridgeDepositBundledTxPrivate(t,e.senderAddress,e.recipientAddress,e.token,e.amount,e.gasMultiplier);if(D(t,this.config.bridgeInstance))return this.getUnsignedBridgeWithdrawBundledTxPrivate(t,e.senderAddress,e.recipientAddress,e.token,e.amount,e.gasMultiplier);throw new y("Invalid Bridge Bundled TX","INVALID_TRANSACTION")}async getUnsignedBridgeDepositBundledTxPrivate(e,t,i,a,r,o){let[s,d,p,u]=await Promise.all([this.getAllowance(e,a,t),this.config.rootProvider.getFeeData(),this.getDynamicDepositGas(this.config.bridgeInstance.rootChainID,t,i,a,r),this.getAxelarFee(this.config.bridgeInstance.rootChainID,this.config.bridgeInstance.childChainID,25e4,o)]),l,m,f=BigInt(0),g=BigInt(0),c=u,A=BigInt(0);if(a.toUpperCase()!==R&&s<r){l=a.startsWith("0x")?a:`0x${a}`;let F=await I(l,k,this.config.rootProvider);m={data:await E(async()=>F.interface.encodeFunctionData("approve",[this.config.bridgeContracts.rootERC20BridgeFlowRate,r]),"INTERNAL_ERROR"),to:l,value:0,from:t,chainId:parseInt(this.config.bridgeInstance.rootChainID,10)},g=w(d,p.approvalGas);}else l=null,m=null;let x=await this.getConfigAndBridgeTxCalldata(t,i,r,a,e),S=a.toUpperCase()===R?(r+c).toString():c.toString(),N={data:x,to:this.config.bridgeContracts.rootERC20BridgeFlowRate,value:S,from:t,chainId:parseInt(this.config.bridgeInstance.rootChainID,10)};f=w(d,p.sourceChainGas);let T=f+g+c+A;return {feeData:{sourceChainGas:f,approvalFee:g,bridgeFee:c,imtblFee:A,totalFees:T},contractToApprove:l,unsignedApprovalTx:m,unsignedBridgeTx:N,delayWithdrawalLargeAmount:null,delayWithdrawalUnknownToken:null,withdrawalQueueActivated:null,largeTransferThresholds:null}}async getUnsignedBridgeWithdrawBundledTxPrivate(e,t,i,a,r,o){let[s,d,p]=await Promise.all([this.getAllowance(e,a,t),this.config.childProvider.getFeeData(),await this.getDynamicWithdrawGasRootChain(e.destinationChainId,t,i,a,r)]),u=p.gas[0],l=await this.getAxelarFee(this.config.bridgeInstance.childChainID,this.config.bridgeInstance.rootChainID,u,o),m,f,g=BigInt(0),c=BigInt(0),A=l,x=BigInt(0);if(B(a,this.config.bridgeInstance.childChainID)&&s<r){m=a;let L=await I(a,k,this.config.childProvider);f={data:await E(async()=>L.interface.encodeFunctionData("approve",[this.config.bridgeContracts.childERC20Bridge,r]),"INTERNAL_ERROR"),to:a,value:0,from:t,chainId:parseInt(this.config.bridgeInstance.childChainID,10)},c=w(d,55e3);}else m=null,f=null;let S=await this.getConfigAndBridgeTxCalldata(t,i,r,a,e),N=a.toUpperCase()===R?(r+A).toString():A.toString(),T={data:S,to:this.config.bridgeContracts.rootERC20BridgeFlowRate,value:N,from:t,chainId:parseInt(this.config.bridgeInstance.rootChainID,10)};g=w(d,25e4);let F=g+c+A+x;return {feeData:{sourceChainGas:g,approvalFee:c,bridgeFee:A,imtblFee:x,totalFees:F},contractToApprove:m,unsignedApprovalTx:f,unsignedBridgeTx:T,delayWithdrawalLargeAmount:p.delayWithdrawalLargeAmount,delayWithdrawalUnknownToken:p.delayWithdrawalUnknownToken,withdrawalQueueActivated:p.withdrawalQueueActivated,largeTransferThresholds:p.largeTransferThresholds}}async getDynamicDepositGas(e,t,i,a,r){let o=[];if(a.toUpperCase()!==R){let m=await I(a,k,this.config.rootProvider),f=await E(async()=>m.interface.encodeFunctionData("approve",[this.config.bridgeContracts.rootERC20BridgeFlowRate,r]),"INTERNAL_ERROR");o.push({from:t,to:a,data:f});}let s={action:"DEPOSIT",sourceChainId:e,destinationChainId:this.config.bridgeInstance.childChainID},d=await this.getConfigAndBridgeTxCalldata(t,i,r,a,s),p=a.toUpperCase()!==R?"0x1":toQuantity(toBeHex(r+BigInt(1)));o.push({from:t,to:this.config.bridgeContracts.rootERC20BridgeFlowRate,data:d,value:p});let{gas:u}=await q(e,o),l={};return u.length===1?(l.approvalGas=0,[l.sourceChainGas]=u):[l.approvalGas,l.sourceChainGas]=u,l}async getDynamicWithdrawGasRootChain(e,t,i,a,r){let o=await ke(a,e,this.config.childProvider),s=We(o,t,i,r.toString()),d=Fe(s),p=Ee(e),u=getAddress(Ie(e)).toString(),l=Ae(e),m=keccak256(s),f=AbiCoder.defaultAbiCoder().encode(["bytes32","bytes32","string","string","address","bytes32"],[de,d,p,u,l,m]),g=keccak256(f),c=keccak256(concat([g,pe])),A=await I(l,ae,this.config.rootProvider),x=await E(async()=>A.interface.encodeFunctionData("execute",[d,p,u,s]),"INTERNAL_ERROR"),S=we(e),N=[{from:t,to:l,data:x}],T=this.config.bridgeContracts.rootERC20BridgeFlowRate,F=await I(T,M,this.config.rootProvider),L=await E(async()=>F.interface.encodeFunctionData("largeTransferThresholds",[o]),"INTERNAL_ERROR");return N.push({from:t,to:T,data:L}),await q(e,N,[{contractAddress:S,stateDiff:{storageSlot:c,value:Le}}])}async getAllowance(e,t,i){if(t.toUpperCase()===R||ve(t,e,this.config.bridgeInstance))return BigInt(0);let a,r;v(e,this.config.bridgeInstance)?(a=this.config.rootProvider,r=this.config.bridgeContracts.rootERC20BridgeFlowRate):(a=this.config.childProvider,r=this.config.bridgeContracts.childERC20Bridge);let o=await I(t,k,a);return await E(()=>o.allowance(i,r),"PROVIDER_ERROR")}async getAxelarFee(e,t,i,a="auto"){let r=K[e],o=K[t];if(!r)throw new y(`Source chainID ${e} can not be matched to an Axelar chain.`,"AXELAR_CHAIN_NOT_FOUND");if(!o)throw new y(`Destination chainID ${t} can not be matched to an Axelar chain.`,"AXELAR_CHAIN_NOT_FOUND");let s=Z(e),d={method:"estimateGasFee",sourceChain:r.id,destinationChain:o.id,symbol:r.symbol,gasLimit:i,gasMultiplier:a,minGasPrice:1e9},p;try{p=await axios.post(s,d);}catch(u){p=u.response;}if(p.data.error)throw new y(`Estimating Axelar Gas failed with the reason: ${p.data.message}`,"AXELAR_GAS_ESTIMATE_FAILED");try{return BigInt(`${p.data}`)}catch(u){throw new y(`Estimating Axelar Gas failed with the reason: ${u}`,"AXELAR_GAS_ESTIMATE_FAILED")}}async getTransactionStatus(e){let t={transactions:[]},i=await this.getAxelarStatus(e.transactions,e.sourceChainId),a=await this.getUniqueReceivers(i,e.sourceChainId),r=[];for(let s of a)r.push(this.getPendingWithdrawals({recipient:s}));let o=[];try{o=await Promise.all(r);}catch(s){throw new y(`Failed to fetch the pending withdrawals with: ${s}`,"FLOW_RATE_ERROR")}t.transactions=i;for(let s of t.transactions)s.status==="COMPLETE"&&(()=>{for(let d of o){let p=d.pending.findIndex(u=>u.amount.toString()===s.amount.toString()&&u.token===s.token&&u.withdrawer===s.sender&&u.recipient===s.recipient);if(p!==-1){s.status="FLOW_RATE_CONTROLLED",s.data={canWithdraw:d.pending[p].canWithdraw,timeoutStart:d.pending[p].timeoutStart,timeoutEnd:d.pending[p].timeoutEnd},d.pending.splice(p,1);return}}})();return t}async getUniqueReceivers(e,t){let i=[],a=[H,V,X].includes(t);for(let r=0,o=e.length;r<o;r++)e[r].status==="COMPLETE"&&a&&e[r].recipient&&i.findIndex(d=>d===e[r].recipient)===-1&&i.push(e[r].recipient);return i}async getAxelarStatus(e,t){let i=[],a=[],r=Z(t),o=["gas_unpaid","gas_paid_not_enough_gas"],s=new AbiCoder;for(let p of e)a.push(He(r,p.txHash));let d;try{d=await Promise.all(a);}catch(p){throw new y(`Failed to fetch the Axelar Status with the reason: ${p}`,"AXELAR_GAS_ESTIMATE_FAILED")}for(let p=0,u=d.length;p<u;p++){let l;switch(d[p].status){case"cannot_fetch_status":l="PENDING";break;case"source_gateway_called":case"destination_gateway_approved":case"executing":case"confirmed":case"approving":l="PROCESSING";break;case"not_executed":l="RETRY";break;case"not_executed_without_gas_paid":case"insufficient_fee":l="NOT_ENOUGH_GAS";break;case"destination_executed":l="COMPLETE";break;default:l="ERROR";}d[p].gasPaidInfo&&o.includes(d[p].gasPaidInfo.status)&&(l="NOT_ENOUGH_GAS");let m={txHash:e[p].txHash,status:l,data:{gmpResponse:d[p].status}},f;d[p]?.callTx?.returnValues?.payload&&(f=s.decode(["bytes32","address","address","address","uint256"],d[p].callTx.returnValues.payload),m={...m,token:f[1],sender:f[2],recipient:f[3],amount:f[4]}),i.push(m);}return i}async getFlowRateInfo(e){if(!e.tokens||e.tokens.length===0)throw new y(`invalid tokens array ${e.tokens}`,"INVALID_TOKEN");let t=this.config.bridgeContracts.rootERC20BridgeFlowRate,i=await I(t,M,this.config.rootProvider),a=[];a.push(i.withdrawalQueueActivated()),a.push(i.withdrawalDelay());for(let p of e.tokens)p.toUpperCase()===R&&(p=se),a.push(i.flowRateBuckets(p)),a.push(i.largeTransferThresholds(p));let r;try{r=await Promise.all(a);}catch{throw new y("unable to query contract for flowrate info","INTERNAL_ERROR")}let o={},s=r[0],d=Number(r[1]);r.splice(0,2);for(let p=0,u=e.tokens.length;p<u;p++){let l=p*2;o[e.tokens[p]]={capacity:r[l].capacity,depth:r[l].depth,refillTime:Number(r[l].refillTime),refillRate:r[l].refillRate,largeTransferThreshold:r[l+1]};}return {withdrawalQueueActivated:s,withdrawalDelay:d,tokens:o}}async getPendingWithdrawals(e){if(!e.recipient)throw new y(`invalid recipient ${e.recipient}`,"INVALID_RECIPIENT");let t=this.config.bridgeContracts.rootERC20BridgeFlowRate,i=await I(t,M,this.config.rootProvider),a=await i.getPendingWithdrawalsLength(e.recipient),r={pending:[]};if(Number(a)===0)return r;let o=[];for(let u=0;u<Number(a);u++)o.push(u);let s=await i.getPendingWithdrawals(e.recipient,o),d=Math.floor(Date.now()/1e3),p=await i.withdrawalDelay();for(let u=0,l=s.length;u<l;u++){let m=Number(s[u].timestamp+p);m>d?r.pending[u]={canWithdraw:!1}:r.pending[u]={canWithdraw:!0},r.pending[u].recipient=e.recipient,r.pending[u].withdrawer=s[u].withdrawer,r.pending[u].token=s[u].token,r.pending[u].amount=s[u].amount,r.pending[u].timeoutStart=Number(s[u].timestamp),r.pending[u].timeoutEnd=m;}return r}async getFlowRateWithdrawTx(e){if(!e.recipient)throw new y(`invalid recipient ${e.recipient}`,"INVALID_RECIPIENT");if(e.index<0)throw new y(`invalid index ${e.index}`,"INVALID_FLOWRATE_INDEX");let t=this.config.bridgeContracts.rootERC20BridgeFlowRate,i=await I(t,M,this.config.rootProvider),a=await i.getPendingWithdrawals(e.recipient,[e.index]);if(a[0].withdrawer===ZeroAddress||a[0].token===ZeroAddress||a[0].amount===BigInt(0)||a[0].timestamp===BigInt(0))throw new y(`pending withdrawal not found for ${e.recipient} at index ${e.index}`,"FLOW_RATE_ERROR");let r=await i.withdrawalDelay(),o=Number(a[0].timestamp+r),s=Math.floor(Date.now()/1e3);if(o>s)return {pendingWithdrawal:{canWithdraw:!1,withdrawer:a[0].withdrawer,recipient:e.recipient,token:a[0].token,amount:a[0].amount,timeoutStart:Number(a[0].timestamp),timeoutEnd:o},unsignedTx:null};let d=await E(async()=>i.interface.encodeFunctionData("finaliseQueuedWithdrawal",[e.recipient,e.index]),"INTERNAL_ERROR");return {pendingWithdrawal:{canWithdraw:!0,withdrawer:a[0].withdrawer,recipient:e.recipient,token:a[0].token,amount:a[0].amount,timeoutStart:Number(a[0].timestamp),timeoutEnd:o},unsignedTx:{data:d,to:this.config.bridgeContracts.rootERC20BridgeFlowRate,value:0,chainId:parseInt(this.config.bridgeInstance.rootChainID,10)}}}async getTokenMapping(e){if(e.rootToken.toUpperCase()===R||e.rootToken===this.config.bridgeContracts.rootChainWrappedETH){let r=this.config.bridgeContracts.childERC20Bridge,s=await(await I(r,J,this.config.childProvider)).childETHToken();return {rootToken:e.rootToken,childToken:s}}let t=this.config.bridgeContracts.rootERC20BridgeFlowRate,a=await(await I(t,M,this.config.rootProvider)).rootTokenToChildToken(e.rootToken);return a===ZeroAddress?{rootToken:e.rootToken,childToken:null}:a===e.rootToken?{rootToken:e.rootToken,childToken:R}:{rootToken:e.rootToken,childToken:a}}};var gt=[$,O],ft=[P],ht={[K$1.SANDBOX]:gt,[K$1.PRODUCTION]:ft},Ke=new Map().set($,{rootERC20BridgeFlowRate:"0x0",childERC20Bridge:"0x0",rootChainIMX:"0x0",rootChainWrappedETH:"0x0",childChainWrappedETH:"0x0",childChainWrappedIMX:"0x0"}).set(O,{rootERC20BridgeFlowRate:"0x0D3C59c779Fd552C27b23F723E80246c840100F5",childERC20Bridge:"0x0D3C59c779Fd552C27b23F723E80246c840100F5",rootChainIMX:"0xe2629e08f4125d14e446660028bD98ee60EE69F2",rootChainWrappedETH:"0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9",childChainWrappedETH:"0xe9E96d1aad82562b7588F03f49aD34186f996478",childChainWrappedIMX:"0x1CcCa691501174B4A623CeDA58cC8f1a76dc3439"}).set(P,{rootERC20BridgeFlowRate:"0xBa5E35E26Ae59c7aea6F029B68c6460De2d13eB6",childERC20Bridge:"0xBa5E35E26Ae59c7aea6F029B68c6460De2d13eB6",rootChainIMX:"0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF",rootChainWrappedETH:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",childChainWrappedETH:"0x52a6c53869ce09a731cd772f245b97a4401d3348",childChainWrappedIMX:"0x3a0c2ba54d6cbd3121f01b96dfd20e99d1696c9d"}),Qe=class{baseConfig;bridgeInstance;bridgeContracts;rootProvider;childProvider;constructor({bridgeInstance:e,rootProvider:t,childProvider:i,baseConfig:a,overrides:r}){if(this.baseConfig=a,this.bridgeInstance=e,this.rootProvider=t,this.childProvider=i,r){this.bridgeContracts=r.bridgeContracts;return}if(!ht[a.environment].includes(e))throw new Error(`Bridge instance with rootchain ${e.rootChainID} and childchain ${e.childChainID} is not supported in environment ${a.environment}`);if(!Ke.has(e))throw new Error(`Bridge instance with rootchain ${e.rootChainID} and childchain ${e.childChainID} is not supported in environment ${a.environment}`);let s=Ke.get(e);if(!s)throw new Error(`Bridge instance with rootchain ${e.rootChainID} and childchain ${e.childChainID} is not supported in environment ${a.environment}`);this.bridgeContracts=s;}};
|
|
9
9
|
|
|
@@ -1544,7 +1544,7 @@ function BridgeForm(props) {
|
|
|
1544
1544
|
if (to.walletAddress.toLowerCase() !== from.walletAddress.toLowerCase()) {
|
|
1545
1545
|
addresses.push(to.walletAddress);
|
|
1546
1546
|
}
|
|
1547
|
-
const assessment = await
|
|
1547
|
+
const assessment = await xt(addresses, checkout.config);
|
|
1548
1548
|
bridgeDispatch({
|
|
1549
1549
|
payload: {
|
|
1550
1550
|
type: BridgeActions.SET_RISK_ASSESSMENT,
|
|
@@ -2192,7 +2192,7 @@ function BridgeReviewSummary() {
|
|
|
2192
2192
|
return;
|
|
2193
2193
|
if (!from || !to)
|
|
2194
2194
|
return;
|
|
2195
|
-
if (riskAssessment &&
|
|
2195
|
+
if (riskAssessment && Ot(riskAssessment)) {
|
|
2196
2196
|
viewDispatch({
|
|
2197
2197
|
payload: {
|
|
2198
2198
|
type: ViewActions.UPDATE_VIEW,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { o as oo, w as wo, n as no, g as go, a as ao, E as Eo, f as fo, i as io, R as Ro, s as so, C as Co, p as po, m as mo, c as co, T as To, u as uo, r as reactExports, V as ViewActions, b as parseUnits, d as Contract, e as ae, h as formatZeroAmount, j as calculateCryptoToFiat, k as useTranslation, l as dist, q as getRemoteRive, t as tt, v as jsx, x as jsxs, B as Box, H as Heading, L as Link, y as Button, S as Stack, z as SimpleLayout, A as Body, D as useAnalytics, F as EventTargetContext, G as CryptoFiatContext,
|
|
2
|
-
import { S as SelectInput, a as SwapWidget } from './SwapWidget-
|
|
3
|
-
import { B as BridgeWidget } from './BridgeWidget-
|
|
4
|
-
import OnRampWidget from './OnRampWidget-
|
|
5
|
-
import WalletWidget from './WalletWidget-
|
|
6
|
-
import SaleWidget from './SaleWidget-
|
|
7
|
-
import AddTokensWidget from './AddTokensWidget-
|
|
8
|
-
import { g as getAllowedBalances, T as TextInputForm } from './WalletApproveHero-
|
|
9
|
-
import './useInterval
|
|
10
|
-
import './TopUpView-
|
|
11
|
-
import './FeesBreakdown-
|
|
12
|
-
import './SpendingCapHero-
|
|
13
|
-
import './TokenImage-
|
|
1
|
+
import { o as oo, w as wo, n as no, g as go, a as ao, E as Eo, f as fo, i as io, R as Ro, s as so, C as Co, p as po, m as mo, c as co, T as To, I as Io, u as uo, r as reactExports, V as ViewActions, b as parseUnits, d as Contract, e as ae, h as formatZeroAmount, j as calculateCryptoToFiat, k as useTranslation, l as dist, q as getRemoteRive, t as tt, v as jsx, x as jsxs, B as Box, H as Heading, L as Link, y as Button, S as Stack, z as SimpleLayout, A as Body, D as useAnalytics, F as EventTargetContext, G as CryptoFiatContext, J as tokenValueFormat, K as getDefaultTokenImage, U as UserJourney, M as HeaderNavigation, N as sendCloseWidgetEvent, O as orchestrationEvents$1, P as amountInputValidation, Q as useTheme, W as CloudImage, X as getRemoteImage, Y as CryptoFiatProvider, Z as ConnectLoaderContext, _ as isAddress, $ as isError, a0 as LoadingView, a1 as CryptoFiatActions, a2 as useViewState, a3 as useEventTargetState, a4 as commerceFlows, a5 as SharedViews, a6 as ErrorView, a7 as ConnectWidget, a8 as ProvidersContextProvider, a9 as PurchaseWidget, aa as ConnectLoader, ab as ViewContextProvider } from './index-Ccm0tWQA.js';
|
|
2
|
+
import { S as SelectInput, a as SwapWidget } from './SwapWidget-BMqAFFmD.js';
|
|
3
|
+
import { B as BridgeWidget } from './BridgeWidget-JFqMtClh.js';
|
|
4
|
+
import OnRampWidget from './OnRampWidget-C9pEXZV3.js';
|
|
5
|
+
import WalletWidget from './WalletWidget-CVzsiw4L.js';
|
|
6
|
+
import SaleWidget from './SaleWidget-B45sI5s0.js';
|
|
7
|
+
import AddTokensWidget from './AddTokensWidget-vuTqyZcs.js';
|
|
8
|
+
import { g as getAllowedBalances, T as TextInputForm } from './WalletApproveHero-DZxdbz8b.js';
|
|
9
|
+
import './useInterval-lE5hntN7.js';
|
|
10
|
+
import './TopUpView-Bc7DQoFO.js';
|
|
11
|
+
import './FeesBreakdown-Bwrxqp6b.js';
|
|
12
|
+
import './SpendingCapHero-Bjd7B7th.js';
|
|
13
|
+
import './TokenImage-CAJyp4gf.js';
|
|
14
14
|
|
|
15
15
|
const sendCheckoutEvent = (eventTarget, detail) => {
|
|
16
16
|
const event = new CustomEvent(oo.IMTBL_COMMERCE_WIDGET_EVENT, { detail });
|
|
@@ -345,6 +345,37 @@ function mapPurchaseWidgetEvent(event) {
|
|
|
345
345
|
throw new Error(`Unknown purchase event type "${event.detail.type}"`);
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
|
+
/**
|
|
349
|
+
* Map Transfer Widget Events
|
|
350
|
+
*/
|
|
351
|
+
function mapTransferWidgetEvent(event) {
|
|
352
|
+
const { type, data } = event.detail;
|
|
353
|
+
switch (type) {
|
|
354
|
+
case Io.SUCCESS:
|
|
355
|
+
return {
|
|
356
|
+
type: go.SUCCESS,
|
|
357
|
+
data: {
|
|
358
|
+
type: fo.TRANSFER_SUCCESS,
|
|
359
|
+
data,
|
|
360
|
+
},
|
|
361
|
+
};
|
|
362
|
+
case Io.FAILURE:
|
|
363
|
+
return {
|
|
364
|
+
type: go.FAILURE,
|
|
365
|
+
data: {
|
|
366
|
+
type: Eo.TRANSFER_FAILED,
|
|
367
|
+
data,
|
|
368
|
+
},
|
|
369
|
+
};
|
|
370
|
+
case Io.CLOSE_WIDGET:
|
|
371
|
+
return {
|
|
372
|
+
type: go.CLOSE,
|
|
373
|
+
data: {},
|
|
374
|
+
};
|
|
375
|
+
default:
|
|
376
|
+
throw new Error(`Unknown transfer event type "${event.detail.type}"`);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
348
379
|
/**
|
|
349
380
|
* Map widget events to commerce widget event detail
|
|
350
381
|
*/
|
|
@@ -372,6 +403,8 @@ function getCommerceWidgetEvent(event) {
|
|
|
372
403
|
return mapSaleWidgetEvent(event);
|
|
373
404
|
case oo.IMTBL_PURCHASE_WIDGET_EVENT:
|
|
374
405
|
return mapPurchaseWidgetEvent(event);
|
|
406
|
+
case oo.IMTBL_TRANSFER_WIDGET_EVENT:
|
|
407
|
+
return mapTransferWidgetEvent(event);
|
|
375
408
|
default:
|
|
376
409
|
throw new Error(`Unknown widget event type "${event.type}"`);
|
|
377
410
|
}
|
|
@@ -429,6 +462,7 @@ const widgetEvents = [
|
|
|
429
462
|
oo.IMTBL_SALE_WIDGET_EVENT,
|
|
430
463
|
oo.IMTBL_ADD_TOKENS_WIDGET_EVENT,
|
|
431
464
|
oo.IMTBL_PURCHASE_WIDGET_EVENT,
|
|
465
|
+
oo.IMTBL_TRANSFER_WIDGET_EVENT,
|
|
432
466
|
];
|
|
433
467
|
/**
|
|
434
468
|
* Subscribe and Handle widget events
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { x as jsxs, v as jsx, A as Body, bH as PriceDisplay, B as Box, k as useTranslation, aA as Drawer, aP as MenuItem, aF as Fragment, aB as Divider,
|
|
1
|
+
import { x as jsxs, v as jsx, A 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, c6 as FooterLogo } from './index-Ccm0tWQA.js';
|
|
2
2
|
|
|
3
3
|
const feesBreakdownContentStyles = {
|
|
4
4
|
display: 'flex',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as reactExports, Z as ConnectLoaderContext, F as EventTargetContext, k as useTranslation, aU as ViewContext, a5 as SharedViews, D as useAnalytics, bm as
|
|
2
|
-
import { O as OnRampWidgetViews, T as TopUpView } from './TopUpView-
|
|
3
|
-
import { S as SpendingCapHero } from './SpendingCapHero-
|
|
1
|
+
import { r as reactExports, Z as ConnectLoaderContext, F as EventTargetContext, k as useTranslation, aU as ViewContext, a5 as SharedViews, D as useAnalytics, bm as xt, bn as Ot, V as ViewActions, v as jsx, z as SimpleLayout, M as HeaderNavigation, d8 as sendOnRampWidgetCloseEvent, O as orchestrationEvents, o as oo, B as Box, d9 as Vt, da as url, db as TRANSAK_ORIGIN, U as UserJourney, aK as isPassportProvider, c6 as FooterLogo, x as jsxs, d1 as SimpleTextBody, bI as viewReducer, bJ as initialViewState, cS as NATIVE, a0 as LoadingView, dc as sendOnRampSuccessEvent, c7 as StatusType, d7 as StatusView, dd as sendOnRampFailedEvent, bR as ServiceUnavailableErrorView } from './index-Ccm0tWQA.js';
|
|
2
|
+
import { O as OnRampWidgetViews, T as TopUpView } from './TopUpView-Bc7DQoFO.js';
|
|
3
|
+
import { S as SpendingCapHero } from './SpendingCapHero-Bjd7B7th.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 xt([walletAddress], checkout.config);
|
|
192
|
+
if (Ot(assessment)) {
|
|
193
193
|
viewDispatch({
|
|
194
194
|
payload: {
|
|
195
195
|
type: ViewActions.UPDATE_VIEW,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { bN as K, d as Contract, r as reactExports, bS as errorToString, bT as hexToText, bU as compareStr, aU as ViewContext, V as ViewActions, bm as
|
|
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, r as reactExports, bS as errorToString, bT as hexToText, bU as compareStr, aU as ViewContext, V as ViewActions, bm as xt, bV as mn, v as jsx, bW as lo, k as useTranslation, bX as TransakIframe, j as calculateCryptoToFiat, D as useAnalytics, F as EventTargetContext, bY as toPascalCase, bZ as sendSaleWidgetCloseEvent, b_ as toStringifyTransactions, b$ as sendSaleSuccessEvent, c0 as sendSaleFailedEvent, c1 as sendSaleTransactionSuccessEvent, c2 as sendSalePaymentMethodEvent, c3 as sendSalePaymentTokenEvent, U as UserJourney, M as HeaderNavigation, x as jsxs, c4 as LoadingOverlay, B as Box, aF as Fragment, z as SimpleLayout, aV as useHandover, aW as HandoverTarget, q as getRemoteRive, H as Heading, c5 as HandoverDuration, aK as isPassportProvider, aZ as HandoverContent, aP as MenuItem, bj as motion, bi as listVariants, bk as listItemVariants, bn as Ot, a5 as SharedViews, c6 as FooterLogo, c7 as StatusType, c8 as prettyFormatNumber, J as tokenValueFormat, c9 as ShimmerCircle, y as Button, S as Stack, ca as Te, cb as abbreviateWalletAddress, cc as formatUnits, aA as Drawer, cd as Caption, aB as Divider, ce as tokenSymbolNameOverrides, cf as Re, cg as Ce, ch as M, ci as ct, a$ as isNativeToken, b0 as getTokenImageByAddress, cj as isGasFree, G as CryptoFiatContext, Z as ConnectLoaderContext, ck as eventTargetReducer, cl as initialEventTargetState, o as oo, cm as EventTargetActions, a0 as LoadingView, aQ as Y, cn as ConnectWidgetViews, a7 as ConnectWidget, m as mo, s as so, p as po, a as ao, co as ConnectLoaderActions, a1 as CryptoFiatActions, b3 as ButtCon, A as Body, cp as widgetTheme, bI as viewReducer, bJ as initialViewState, t as tt, bR as ServiceUnavailableErrorView, Y as CryptoFiatProvider } from './index-Ccm0tWQA.js';
|
|
2
|
+
import { u as useMount, T as TopUpView } from './TopUpView-Bc7DQoFO.js';
|
|
3
|
+
import { T as TokenImage } from './TokenImage-CAJyp4gf.js';
|
|
4
|
+
import { F as Fees, B as BridgeWidget } from './BridgeWidget-JFqMtClh.js';
|
|
5
|
+
import OnRampWidget from './OnRampWidget-C9pEXZV3.js';
|
|
6
|
+
import { a as SwapWidget } from './SwapWidget-BMqAFFmD.js';
|
|
7
|
+
import './WalletApproveHero-DZxdbz8b.js';
|
|
8
|
+
import './useInterval-lE5hntN7.js';
|
|
9
|
+
import './FeesBreakdown-Bwrxqp6b.js';
|
|
10
|
+
import './SpendingCapHero-Bjd7B7th.js';
|
|
11
11
|
|
|
12
12
|
var SaleWidgetViews;
|
|
13
13
|
(function (SaleWidgetViews) {
|
|
@@ -592,7 +592,7 @@ function SaleContextProvider(props) {
|
|
|
592
592
|
if (!address) {
|
|
593
593
|
return;
|
|
594
594
|
}
|
|
595
|
-
const assessment = await
|
|
595
|
+
const assessment = await xt([address], checkout.config);
|
|
596
596
|
setRiskAssessment(assessment);
|
|
597
597
|
})();
|
|
598
598
|
}, [checkout, provider]);
|
|
@@ -1333,7 +1333,7 @@ function PaymentMethods() {
|
|
|
1333
1333
|
}
|
|
1334
1334
|
if (paymentMethod
|
|
1335
1335
|
&& [lo.DEBIT, lo.CREDIT].includes(paymentMethod)) {
|
|
1336
|
-
if (riskAssessment &&
|
|
1336
|
+
if (riskAssessment && Ot(riskAssessment)) {
|
|
1337
1337
|
const error = new Error('Sanctioned address');
|
|
1338
1338
|
sendFailedEvent(error.message, {}, [], undefined, { riskAssessment, paymentMethod });
|
|
1339
1339
|
viewDispatch({
|
|
@@ -2451,7 +2451,7 @@ function OrderSummary({ subView }) {
|
|
|
2451
2451
|
signAndProceed(selectedCurrency?.address);
|
|
2452
2452
|
};
|
|
2453
2453
|
const onProceedToBuy = (fundingBalance) => {
|
|
2454
|
-
if (riskAssessment &&
|
|
2454
|
+
if (riskAssessment && Ot(riskAssessment)) {
|
|
2455
2455
|
const error = new Error('Sanctioned address');
|
|
2456
2456
|
sendFailedEvent(error.message, {}, [], undefined, { riskAssessment, paymentMethod });
|
|
2457
2457
|
viewDispatch({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as jsx, c$ as heroBackGroundStyles, B as Box, d0 as heroImageStyles, dF as heroImageBottomAlign, x as jsxs } from './index-
|
|
1
|
+
import { v as jsx, c$ as heroBackGroundStyles, B as Box, d0 as heroImageStyles, dF as heroImageBottomAlign, x as jsxs } from './index-Ccm0tWQA.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,9 +1,9 @@
|
|
|
1
|
-
import { k as useTranslation, x as jsxs, de as quickswapFooterStyles, B as Box, df as quickswapFooterLogoStyles, v as jsx, A as Body, dg as quickswapFooterDisclaimerTextStyles, dh as Po, X as getRemoteImage, r as reactExports, y as Button, aA as Drawer, W as CloudImage, H as Heading, cF as Logo, di as getImxTokenImage, cc as formatUnits, j as calculateCryptoToFiat,
|
|
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, v as jsx, A as Body, dg as quickswapFooterDisclaimerTextStyles, dh as Po, X as getRemoteImage, r as reactExports, y as Button, aA as Drawer, W as CloudImage, H as Heading, cF as Logo, di as getImxTokenImage, cc as formatUnits, j as calculateCryptoToFiat, J as tokenValueFormat, cj as isGasFree, b as parseUnits, h as formatZeroAmount, cA as ShimmerBox, bH as PriceDisplay, aF as Fragment, dj as getCryptoToUSDConversion, Z as ConnectLoaderContext, a$ as isNativeToken, cS as NATIVE, aU as ViewContext, D 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 Ot, cZ as DEFAULT_TOKEN_DECIMALS, F as EventTargetContext, dp as sendSwapWidgetCloseEvent, O as orchestrationEvents, o as oo, M as HeaderNavigation, a0 as LoadingView, z as SimpleLayout, cY as IMX_TOKEN_SYMBOL, cz as S, d1 as SimpleTextBody, d2 as FooterButton, dq as m, c$ as heroBackGroundStyles, d0 as heroImageStyles, bB as Trans, L as Link, c6 as FooterLogo, aV as useHandover, bI as viewReducer, bJ as initialViewState, dr as DEFAULT_BALANCE_RETRY_POLICY, bm as xt, ds as Ao, d7 as StatusView, dt as sendSwapSuccessEvent, c7 as StatusType, du as sendSwapFailedEvent, dv as sendSwapRejectedEvent, a6 as ErrorView, bR as ServiceUnavailableErrorView, e as ae, cQ as fe } from './index-Ccm0tWQA.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-DZxdbz8b.js';
|
|
3
|
+
import { u as useInterval } from './useInterval-lE5hntN7.js';
|
|
4
|
+
import { S as SwapWidgetViews, T as TopUpView } from './TopUpView-Bc7DQoFO.js';
|
|
5
|
+
import { F as FeesBreakdown } from './FeesBreakdown-Bwrxqp6b.js';
|
|
6
|
+
import { S as SpendingCapHero } from './SpendingCapHero-Bjd7B7th.js';
|
|
7
7
|
|
|
8
8
|
function QuickswapFooter({ theme, environment }) {
|
|
9
9
|
const { t } = useTranslation();
|
|
@@ -1132,7 +1132,7 @@ function SwapForm({ data, theme, cancelAutoProceed }) {
|
|
|
1132
1132
|
const sendTransaction = async () => {
|
|
1133
1133
|
if (!quote)
|
|
1134
1134
|
return;
|
|
1135
|
-
if (riskAssessment &&
|
|
1135
|
+
if (riskAssessment && Ot(riskAssessment)) {
|
|
1136
1136
|
viewDispatch({
|
|
1137
1137
|
payload: {
|
|
1138
1138
|
type: ViewActions.UPDATE_VIEW,
|
|
@@ -1860,7 +1860,7 @@ function SwapWidget({ amount, fromTokenAddress, toTokenAddress, config, autoProc
|
|
|
1860
1860
|
if (!address) {
|
|
1861
1861
|
return;
|
|
1862
1862
|
}
|
|
1863
|
-
const assessment = await
|
|
1863
|
+
const assessment = await xt([address], checkout.config);
|
|
1864
1864
|
swapDispatch({
|
|
1865
1865
|
payload: {
|
|
1866
1866
|
type: SwapActions.SET_RISK_ASSESSMENT,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as reactExports,
|
|
1
|
+
import { r as reactExports, K as getDefaultTokenImage, v as jsx } from './index-Ccm0tWQA.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, cc as formatUnits, v as jsx, x as jsxs, dG as isDualVariantIcon, aP as MenuItem, B as Box, k as useTranslation, aU as ViewContext, G as CryptoFiatContext, F as EventTargetContext, D as useAnalytics, a1 as CryptoFiatActions, dH as DEFAULT_TOKEN_SYMBOLS, cU as st,
|
|
1
|
+
import { r as reactExports, cc as formatUnits, v as jsx, x as jsxs, dG as isDualVariantIcon, aP as MenuItem, B as Box, k as useTranslation, aU as ViewContext, G as CryptoFiatContext, F as EventTargetContext, D as useAnalytics, a1 as CryptoFiatActions, dH as DEFAULT_TOKEN_SYMBOLS, cU as st, M as HeaderNavigation, H as Heading, A as Body, z as SimpleLayout, o as oo, V as ViewActions, O as orchestrationEvents, bN as K } from './index-Ccm0tWQA.js';
|
|
2
2
|
|
|
3
3
|
var BridgeWidgetViews;
|
|
4
4
|
(function (BridgeWidgetViews) {
|