PageSourceSearch

https://app.coinfello.com/_next/static/chunks/ede9309549f271c4.js?dpl=dpl_DYhuNALGwgB3MzyqpaeZapPDJq44

js coinfello.com collected 2026-10-09 22:06:32 UTC 226,202 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,40156,e=>{"use strict";e.s(["useSnapshot",()=>o]);var t=e.i(534098),r=e.i(238055),n=e.i(459905);let i={get url(){return`file://${e.P("node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/valtio/esm/react.mjs")}`}},a=new WeakMap;function o(e,o){let s=null==o?void 0:o.sync,l=(0,t.useMemo)(()=>e&&new WeakMap,[e]),c=(0,t.useRef)(void 0),u=!0,d=(0,t.useSyncExternalStore)((0,t.useCallback)(t=>{let r=(0,n.subscribe)(e,t,s);return t(),r},[e,s]),()=>{let t=(0,n.snapshot)(e);try{if(!u&&c.current&&!(0,r.isChanged)(c.current,t,l,new WeakMap))return c.current}catch(e){}return t},()=>(0,n.snapshot)(e));u=!1,(0,t.useLayoutEffect)(()=>{c.current=d}),(i.env?i.env.MODE:void 0)!=="production"&&((e,n)=>{let i=(0,t.useRef)(void 0);(0,t.useEffect)(()=>{i.current=(0,r.affectedToPathList)(e,n,!0)}),(0,t.useDebugValue)(i.current)})(d,l);let p=(0,t.useMemo)(()=>new WeakMap,[]);return(0,r.createProxy)(d,l,p,a)}},41566,e=>{"use strict";e.s(["useAppKitAccount",()=>v,"useAppKitConnection",()=>b,"useAppKitConnections",()=>y,"useAppKitNetworkCore",()=>g,"useAppKitProvider",()=>m,"useDisconnect",()=>C]);var t=e.i(534098),r=e.i(40156),n=e.i(934472),i=e.i(639875),a=e.i(441277),o=e.i(651623),s=e.i(564170),l=e.i(293003),c=e.i(350464),u=e.i(220835),d=e.i(102732),p=e.i(958051),h=e.i(309422),f=e.i(834841);function m(e){let{providers:t,providerIds:n}=(0,r.useSnapshot)(u.ProviderController.state);return{walletProvider:t[e],walletProviderType:n[e]}}function g(){let{activeCaipNetwork:e}=(0,r.useSnapshot)(o.ChainController.state);return{caipNetwork:e,chainId:null==e?void 0:e.id,caipNetworkId:null==e?void 0:e.caipNetworkId}}function v(e){var t;let i=(0,r.useSnapshot)(o.ChainController.state),{activeConnectorIds:a}=(0,r.useSnapshot)(l.ConnectorController.state),c=(null==e?void 0:e.namespace)||i.activeChain;if(!c)return{allAccounts:[],address:void 0,caipAddress:void 0,status:void 0,isConnected:!1,embeddedWalletInfo:void 0};let u=null==(t=i.chains.get(c))?void 0:t.accountState,d=l.ConnectorController.getAuthConnector(c),h=a[c];return{allAccounts:s.ConnectionController.getConnections(c).flatMap(e=>e.accounts.map(e=>{let{address:t,type:r,publicKey:n}=e;return p.CoreHelperUtil.createAccount(c,t,r||"eoa",n)})),caipAddress:null==u?void 0:u.caipAddress,address:p.CoreHelperUtil.getPlainAddress(null==u?void 0:u.caipAddress),isConnected:!!(null==u?void 0:u.caipAddress),status:null==u?void 0:u.status,embeddedWalletInfo:d&&h===n.ConstantsUtil.CONNECTOR_ID.AUTH?{user:(null==u?void 0:u.user)?{...u.user,username:f.StorageUtil.getConnectedSocialUsername()}:void 0,authProvider:(null==u?void 0:u.socialProvider)||"email",accountType:null==u?void 0:u.preferredAccountType,isSmartAccountDeployed:!!(null==u?void 0:u.smartAccountDeployed)}:void 0}}function C(){return{disconnect:async function(e){await s.ConnectionController.disconnect(e)}}}function y(e){(0,r.useSnapshot)(s.ConnectionController.state),(0,r.useSnapshot)(l.ConnectorController.state),(0,r.useSnapshot)(a.AssetController.state);let{activeChain:u}=(0,r.useSnapshot)(o.ChainController.state),{remoteFeatures:p}=(0,r.useSnapshot)(c.OptionsController.state),f=null!=e?e:u,m=!!(null==p?void 0:p.multiWallet);if(!f)throw Error("No namespace found");if(!m)return i.AlertController.open(n.ConstantsUtil.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.CONNECTIONS_HOOK,"info"),{connections:[],recentConnections:[]};let{connections:g,recentConnections:v}=d.ConnectionControllerUtil.getConnectionsData(f),C=(0,t.useCallback)(e=>{let t=l.ConnectorController.getConnectorById(e.connectorId),r=l.ConnectorController.getConnectorName(null==t?void 0:t.name);return{name:r,icon:h.AssetUtil.getConnectorImage(t),networkIcon:h.AssetUtil.getNetworkImage(e.caipNetwork),...e}},[]);return{connections:g.map(C),recentConnections:v.map(C)}}function b(e){let{namespace:a,onSuccess:u,onError:d}=e,{connections:p,isSwitchingConnection:h}=(0,r.useSnapshot)(s.ConnectionController.state),{activeConnectorIds:m}=(0,r.useSnapshot)(l.ConnectorController.state),{activeChain:g}=(0,r.useSnapshot)(o.ChainController.state),{remoteFeatures:v}=(0,r.useSnapshot)(c.OptionsController.state),C=null!=a?a:g;if(!C)throw Error("No namespace found");if(!(null==v?void 0:v.multiWallet))return i.AlertController.open(n.ConstantsUtil.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.CONNECTION_HOOK,"info"),{connection:void 0,isPending:!1,switchConnection:()=>Promise.resolve(void 0),deleteConnection:()=>({})};let y=m[C],b=p.get(C),w=null==b?void 0:b.find(e=>e.connectorId.toLowerCase()===(null==y?void 0:y.toLowerCase()));return{connection:w,isPending:h,switchConnection:(0,t.useCallback)(async e=>{let{connection:t,address:r}=e;try{s.ConnectionController.setIsSwitchingConnection(!0),await s.ConnectionController.switchConnection({connection:t,address:r,namespace:C,onChange(e){let{address:t,namespace:r,hasSwitchedAccount:n,hasSwitchedWallet:i}=e;null==u||u({address:t,namespace:r,hasSwitchedAccount:n,hasSwitchedWallet:i,hasDeletedWallet:!1})}})}catch(t){let e=t instanceof Error?t:Error("Something went wrong");null==d||d(e)}finally{s.ConnectionController.setIsSwitchingConnection(!1)}},[C,u,d]),deleteConnection:(0,t.useCallback)(e=>{let{address:t,connectorId:r}=e;f.StorageUtil.deleteAddressFromConnection({connectorId:r,address:t,namespace:C}),s.ConnectionController.syncStorageConnections(),null==u||u({address:t,namespace:C,hasSwitchedAccount:!1,hasSwitchedWallet:!1,hasDeletedWallet:!0})},[C])}}},848692,e=>{"use strict";e.s([]),e.i(177210),e.i(297109),e.i(573400)},366557,e=>{"use strict";e.s(["LoggerUtil",()=>r]);var t=e.i(382119);let r={createLogger(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error",n=(0,t.getDefaultLoggerOptions)({level:r}),{logger:i}=(0,t.generatePlatformLogger)({opts:n}
1);return i.error=function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];for(let t of r)if(t instanceof Error)return void e(t,...r);e(void 0,...r)},i}}},870756,e=>{"use strict";e.s(["TokenUtil",()=>r]);var t=e.i(398445);let r={TOKEN_ADDRESSES_BY_SYMBOL:{USDC:{8453:t.baseUSDC.asset,84532:t.baseSepoliaUSDC.asset}},getTokenSymbolByAddress(e){var t;if(!e)return;let[n]=null!=(t=Object.entries(r.TOKEN_ADDRESSES_BY_SYMBOL).find(t=>{let[r,n]=t;return Object.values(n).includes(e)}))?t:[];return n}}},516379,e=>{"use strict";e.s(["WcConstantsUtil",()=>t]);let t={ERROR_CODE_UNRECOGNIZED_CHAIN_ID:4902,ERROR_CODE_DEFAULT:5e3,ERROR_INVALID_CHAIN_ID:32603}},608014,e=>{"use strict";e.s(["UniversalAdapter",()=>u]);var t=e.i(344048),r=e.i(444652),n=e.i(934472),i=e.i(651623),a=e.i(275158),o=e.i(958051),s=e.i(728746),l=e.i(133956),c=e.i(516379);class u extends s.AdapterBlueprint{async setUniversalProvider(e){if(!this.namespace)throw Error("UniversalAdapter:setUniversalProvider - namespace is required");return this.addConnector(new l.WalletConnectConnector({provider:e,caipNetworks:this.getCaipNetworks(),namespace:this.namespace})),Promise.resolve()}async connect(e){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:Number(e.chainId),provider:this.provider,address:""})}async disconnect(){try{let e=this.getWalletConnectConnector();await e.disconnect(),this.emit("disconnect")}catch(e){console.warn("UniversalAdapter:disconnect - error",e)}return{connections:[]}}syncConnections(){return Promise.resolve()}async getAccounts(e){var t,r,n,i;let{namespace:a}=e,s=this.provider;return Promise.resolve({accounts:((null==s||null==(i=s.session)||null==(n=i.namespaces)||null==(r=n[a])||null==(t=r.accounts)?void 0:t.map(e=>{let[,,t]=e.split(":");return t}).filter((e,t,r)=>r.indexOf(e)===t))||[]).map(e=>o.CoreHelperUtil.createAccount(a,e,"bip122"===a?"payment":"eoa"))})}async syncConnectors(){return Promise.resolve()}async getBalance(e){var t,r,n,o,s;if(!(e.caipNetwork&&a.ConstantsUtil.BALANCE_SUPPORTED_CHAINS.includes(null==(t=e.caipNetwork)?void 0:t.chainNamespace))||(null==(r=e.caipNetwork)?void 0:r.testnet))return{balance:"0.00",symbol:(null==(s=e.caipNetwork)?void 0:s.nativeCurrency.symbol)||""};let l=i.ChainController.getAccountData();if((null==l?void 0:l.balanceLoading)&&e.chainId===(null==(n=i.ChainController.state.activeCaipNetwork)?void 0:n.id))return{balance:(null==l?void 0:l.balance)||"0.00",symbol:(null==l?void 0:l.balanceSymbol)||""};let c=(await i.ChainController.fetchTokenBalance()).find(t=>{var r,n;return t.chainId==="".concat(null==(r=e.caipNetwork)?void 0:r.chainNamespace,":").concat(e.chainId)&&t.symbol===(null==(n=e.caipNetwork)?void 0:n.nativeCurrency.symbol)});return{balance:(null==c?void 0:c.quantity.numeric)||"0.00",symbol:(null==c?void 0:c.symbol)||(null==(o=e.caipNetwork)?void 0:o.nativeCurrency.symbol)||""}}async signMessage(e){var r,a,o;let{provider:s,message:l,address:c}=e;if(!s)throw Error("UniversalAdapter:signMessage - provider is undefined");return{signature:(null==(r=i.ChainController.state.activeCaipNetwork)?void 0:r.chainNamespace)===n.ConstantsUtil.CHAIN.SOLANA?(await s.request({method:"solana_signMessage",params:{message:t.default.encode(new TextEncoder().encode(l)),pubkey:c}},null==(a=i.ChainController.state.activeCaipNetwork)?void 0:a.caipNetworkId)).signature:await s.request({method:"personal_sign",params:[l,c]},null==(o=i.ChainController.state.activeCaipNetwork)?void 0:o.caipNetworkId)}}async estimateGas(){return Promise.resolve({gas:BigInt(0)})}async sendTransaction(){return Promise.resolve({hash:""})}walletGetAssets(e){return Promise.resolve({})}async writeContract(){return Promise.resolve({hash:""})}emitFirstAvailableConnection(){}parseUnits(){return 0n}formatUnits(){return"0"}async getCapabilities(){return Promise.resolve({})}async grantPermissions(){return Promise.resolve({})}async revokePermissions(){return Promise.resolve("0x")}async syncConnection(){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:1,provider:this.provider,address:""})}async switchNetwork(e){let{caipNetwork:t}=e,i=this.getWalletConnectConnector();if(t.chainNamespace===n.ConstantsUtil.CHAIN.EVM){var a,o,s,l,u,d;try{await (null==(a=i.provider)?void 0:a.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,r.toHex)(t.id)}]}))}catch(e){if(e.code===c.WcConstantsUtil.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||e.code===c.WcConstantsUtil.ERROR_INVALID_CHAIN_ID||e.code===c.WcConstantsUtil.ERROR_CODE_DEFAULT||(null==e||null==(s=e.data)||null==(o=s.originalError)?void 0:o.code)===c.WcConstantsUtil.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)try{await (null==(d=i.provider)?void 0:d.request({method:"wallet_addEthereumChain",params:[{chainId:(0,r.toHex)(t.id),rpcUrls:[null==t||null==(l=t.rpcUrls.chainDefault)?void 0:l.http],chainName:t.name,nativeCurrency:t.nativeCurrency,blockExplorerUrls:[null==(u=t.blockExplorers)?void 0:u.default.url]}]}))}catch(e){throw Error("Chain is not supported")}}}i.provider.setDefaultChain(t.caipNetworkId)}getWalletConnectProvider(){let e=this.connectors.find(e=>"WALLET_CONNECT"===e.type);return null==e?void 0:e.provider}}},656085,e=>{"use strict";e.s(["ConfigUtil",()=>s]);var t=e.i(639875),r=e.i(796296),n=e.i(275158),i=e.i(887301);let a=["email","socials","swaps","onramp","activity","reownBranding","multiWallet","emailCapture","payWithExchange","payments","reownAuthentication"],o={email:{apiFeatureName:"social_login",localFeatureName:"email",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>{if(!(null==e?void 0:e.config))return!1;let t=e.config;return!!e.isEnabled&&t.includes("email")},processFallback:e=>void 0===e?n.ConstantsUtil.DEFAULT_REMOTE_FEATURES.email:!!e},socials:{apiFeatureName:"social_login",localFeatureName:"socials",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>{if(!(null==e?void 0:e.config))return!1;let t=e.config;return!!e.isEnabled&&t.length>0&&t.filter(e=>"email"!==e)},processFallback:e=>void 0===e?n.ConstantsUtil.DEFAULT_REMOTE_FEATURES.socials:"boolean"==typeof e?!!e&&n.ConstantsUtil.DEFAULT_REMOTE_FEATURES.socials:e},swaps:{apiFeatureName:"swap",localFeatureName:"swaps",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>{if(!(null==e?void 0:e.config))return!1;let t=e.config;return!!e.isEnabled&&t.length>0&&t},processFallback:e=>void 0===e?n.ConstantsUtil.DEFAULT_REMOTE_FEATURES.swaps:"boolean"==typeof e?!!e&&n.ConstantsUtil.DEFAULT_REMOTE_FEATURES.swaps:e},onramp:{apiFeatureName:"onramp",localFeatureName:"onramp",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>{if(!(null==e?void 0:e.config))return!1;let t=e.config;return!!e.isEnabled&&t.length>0&&t},processFallback:e=>void 0===e?n.ConstantsUtil.DEFAULT_REMOTE_FEATURES.onramp:"boolean"==typeof e?!!e&&n.ConstantsUtil.DEFAULT_REMOTE_FEATURES.onramp:e},activity:{apiFeatureName:"activity",localFeatureName:"history",returnType:!1,isLegacy:!0,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:e=>void 0===e?n.ConstantsUtil.DEFAULT_REMOTE_FEATURES.activity:!!e},reownBranding:{apiFeatureName:"reown_branding",localFeatureName:"reownBranding",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:e=>void 0===e?n.ConstantsUtil.DEFAULT_REMOTE_FEATURES.reownBranding:!!e},emailCapture:{apiFeatureName:"email_capture",localFeatureName:"emailCapture",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>{var t;return e.isEnabled&&(null!=(t=e.config)?t:[])},processFallback:e=>!1},multiWallet:{apiFeatureName:"multi_wallet",localFeatureName:"multiWallet",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:()=>n.ConstantsUtil.DEFAULT_REMOTE_FEATURES.multiWallet},payWithExchange:{apiFeatureName:"fund_from_exchange",localFeatureName:"payWithExchange",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:()=>n.ConstantsUtil.DEFAULT_REMOTE_FEATURES.payWithExchange},payments:{apiFeatureName:"payments",localFeatureName:"payments",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:()=>n.ConstantsUtil.DEFAULT_REMOTE_FEATURES.payments},reownAuthentication:{apiFeatureName:"reown_authentication",localFeatureName:"reownAuthentication",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:e=>void 0===e?n.ConstantsUtil.DEFAULT_REMOTE_FEATURES.reownAuthentication:!!e}},s={localSettingsOverridden:new Set,getApiConfig:(e,t)=>
1null==t?void 0:t.find(t=>t.id===e),addWarning(e,t){if(void 0!==e){let e=o[t],r=e.isLegacy?'"features.'.concat(e.localFeatureName,'" (now "').concat(t,'")'):'"features.'.concat(t,'"');this.localSettingsOverridden.add(r)}},processFeature(e,t,r,n,i){let a=o[e],s=t[a.localFeatureName];if(i&&!a.isAvailableOnBasic)return!1;if(n){let t=this.getApiConfig(a.apiFeatureName,r);return(null==t?void 0:t.config)===null?this.processFallbackFeature(e,s):!!(null==t?void 0:t.config)&&(void 0!==s&&this.addWarning(s,e),this.processApiFeature(e,t))}return this.processFallbackFeature(e,s)},processApiFeature:(e,t)=>o[e].processApi(t),processFallbackFeature:(e,t)=>o[e].processFallback(t),async fetchRemoteFeatures(e){var o;let s=null!=(o=e.basic)&&o,l=e.features||{};this.localSettingsOverridden.clear();let c=null,u=!1;try{u=null!=(c=await r.ApiController.fetchProjectConfig())}catch(e){console.warn("[Reown Config] Failed to fetch remote project configuration. Using local/default values.",e)}let d=u&&!s?n.ConstantsUtil.DEFAULT_REMOTE_FEATURES:n.ConstantsUtil.DEFAULT_REMOTE_FEATURES_DISABLED;try{for(let e of a){let t=this.processFeature(e,l,c,u,s);Object.assign(d,{[e]:t})}}catch(e){return console.warn("[Reown Config] Failed to process the configuration from Cloud. Using default values.",e),n.ConstantsUtil.DEFAULT_REMOTE_FEATURES}if(u&&this.localSettingsOverridden.size>0){let e="Your local configuration for ".concat(Array.from(this.localSettingsOverridden).join(", ")," was ignored because a remote configuration was successfully fetched. Please manage these features via your project dashboard on dashboard.reown.com.");t.AlertController.open({debugMessage:i.ErrorUtil.ALERT_WARNINGS.LOCAL_CONFIGURATION_IGNORED.debugMessage(e)},"warning")}return d}}},390403,e=>{"use strict";e.s(["AppKitBaseClient",()=>H]);var t=e.i(912773),r=e.i(934472),n=e.i(580598),i=e.i(722500),a=e.i(142544),o=e.i(639875),s=e.i(796296),l=e.i(309422),c=e.i(511536),u=e.i(651623),d=e.i(564170),p=e.i(102732),h=e.i(293003),f=e.i(275158),m=e.i(958051),g=e.i(193321),v=e.i(532733),C=e.i(344662),y=e.i(26220),b=e.i(350464),w=e.i(220835),E=e.i(443420),A=e.i(80675),N=e.i(221170),T=e.i(558848),I=e.i(911264),P=e.i(834841),k=e.i(74199),U=e.i(780078),S=e.i(958597);e.i(848692);var R=e.i(573400);e.i(151557);var x=e.i(576519),O=e.i(80140),B=e.i(887301),F=e.i(89965),_=e.i(366557),L=e.i(870756),D=e.i(780991),M=e.i(608014),W=e.i(656085);class H{getChainNamespacesSet(e,t){let r=null==e?void 0:e.map(e=>e.namespace).filter(e=>!!e);return(null==r?void 0:r.length)?[...new Set(r)]:[...new Set(null==t?void 0:t.map(e=>e.chainNamespace))]}async initialize(t){var r,n,i,a,o;if(this.initializeProjectSettings(t),this.initControllers(t),await this.initChainAdapters(),this.sendInitializeEvent(t),b.OptionsController.state.enableReconnect?(await this.syncExistingConnection(),await this.syncAdapterConnections()):await this.unSyncExistingConnection(),t.basic||t.manualWCControl||(this.remoteFeatures=await W.ConfigUtil.fetchRemoteFeatures(t)),await s.ApiController.fetchUsage(),b.OptionsController.setRemoteFeatures(this.remoteFeatures),this.remoteFeatures.onramp&&y.OnRampController.setOnrampProviders(this.remoteFeatures.onramp),((null==(r=b.OptionsController.state.remoteFeatures)?void 0:r.email)||Array.isArray(null==(n=b.OptionsController.state.remoteFeatures)?void 0:n.socials)&&(null==(i=b.OptionsController.state.remoteFeatures)?void 0:i.socials.length)>0)&&await this.checkAllowedOrigins(),(null==(a=b.OptionsController.state.features)?void 0:a.reownAuthentication)||(null==(o=b.OptionsController.state.remoteFeatures)?void 0:o.reownAuthentication)){let{ReownAuthentication:t}=await e.A(538543),r=b.OptionsController.state.siwx;r instanceof t||(r&&console.warn("ReownAuthentication option is enabled, SIWX configuration will be overridden."),b.OptionsController.setSIWX(new t))}}async openSend(e){var t;let r=e.namespace||u.ChainController.state.activeChain,n=this.getCaipAddress(r),i=null==(t=this.getCaipNetwork(r))?void 0:t.id;if(!n)throw Error("openSend: caipAddress not found");if((null==i?void 0:i.toString())!==e.chainId.toString()){let t=u.ChainController.getCaipNetworkById(e.chainId,r);if(!t)throw Error("openSend: caipNetwork with chainId ".concat(e.chainId," not found"));await this.switchNetwork(t,{throwOnFailure:!0})}try{let t=L.TokenUtil.getTokenSymbolByAddress(e.assetAddress);t&&await s.ApiController.fetchTokenImages([t])}catch(e){}return await C.ModalController.open({view:"WalletSend",data:{send:e}}),new Promise((e,t)=>
1{let r=T.SendController.subscribeKey("hash",t=>{t&&(i(),e({hash:t}))}),n=C.ModalController.subscribe(e=>{e.open||(i(),t(Error("Modal closed")))}),i=this.createCleanupHandler([r,n])})}toModalOptions(){return{isSwap:function(e){return(null==e?void 0:e.view)==="Swap"},isSend:function(e){return(null==e?void 0:e.view)==="WalletSend"}}}async checkAllowedOrigins(){try{let e=await s.ApiController.fetchAllowedOrigins();if(!m.CoreHelperUtil.isClient())return;let t=window.location.origin;U.WcHelpersUtil.isOriginAllowed(t,e,r.ConstantsUtil.DEFAULT_ALLOWED_ANCESTORS)||o.AlertController.open(B.ErrorUtil.ALERT_ERRORS.ORIGIN_NOT_ALLOWED,"error")}catch(e){if(!(e instanceof Error))return;switch(e.message){case"RATE_LIMITED":o.AlertController.open(B.ErrorUtil.ALERT_ERRORS.RATE_LIMITED_APP_CONFIGURATION,"error");break;case"SERVER_ERROR":{let t=e.cause instanceof Error?e.cause:e;o.AlertController.open({displayMessage:B.ErrorUtil.ALERT_ERRORS.SERVER_ERROR_APP_CONFIGURATION.displayMessage,debugMessage:B.ErrorUtil.ALERT_ERRORS.SERVER_ERROR_APP_CONFIGURATION.debugMessage(t.message)},"error")}}}}createCleanupHandler(e){return()=>{e.forEach(e=>{try{e()}catch(e){}})}}sendInitializeEvent(e){var t;let{...r}=e;delete r.adapters,delete r.universalProvider,v.EventsController.sendEvent({type:"track",event:"INITIALIZE",properties:{...r,networks:e.networks.map(e=>e.id),siweConfig:{options:(null==(t=e.siweConfig)?void 0:t.options)||{}}}})}initControllers(e){this.initializeOptionsController(e),this.initializeChainController(e),this.initializeThemeController(e),this.initializeConnectionController(e),this.initializeConnectorController()}initAdapterController(){a.AdapterController.initialize(this.chainAdapters)}initializeThemeController(e){e.themeMode&&k.ThemeController.setThemeMode(e.themeMode),e.themeVariables&&k.ThemeController.setThemeVariables(e.themeVariables)}initializeChainController(e){var t;if(!this.connectionControllerClient)throw Error("ConnectionControllerClient must be set");u.ChainController.initialize(null!=(t=e.adapters)?t:[],this.caipNetworks,{connectionControllerClient:this.connectionControllerClient});let r=this.getDefaultNetwork();r&&u.ChainController.setActiveCaipNetwork(r)}initializeConnectionController(e){var t,r;d.ConnectionController.initialize(null!=(t=e.adapters)?t:[]),d.ConnectionController.setWcBasic(null!=(r=e.basic)&&r)}initializeConnectorController(){h.ConnectorController.initialize(this.chainNamespaces)}initializeProjectSettings(e){b.OptionsController.setProjectId(e.projectId),b.OptionsController.setSdkVersion(e.sdkVersion)}initializeOptionsController(e){var t,n;b.OptionsController.setDebug(!1!==e.debug),b.OptionsController.setEnableWalletGuide(!1!==e.enableWalletGuide),b.OptionsController.setEnableWallets(!1!==e.enableWallets),b.OptionsController.setEIP6963Enabled(!1!==e.enableEIP6963),b.OptionsController.setEnableNetworkSwitch(!1!==e.enableNetworkSwitch),b.OptionsController.setEnableReconnect(!1!==e.enableReconnect),b.OptionsController.setEnableMobileFullScreen(!0===e.enableMobileFullScreen),b.OptionsController.setCoinbasePreference(e.coinbasePreference),b.OptionsController.setEnableAuthLogger(!1!==e.enableAuthLogger),b.OptionsController.setCustomRpcUrls(e.customRpcUrls),b.OptionsController.setEnableEmbedded(e.enableEmbedded),b.OptionsController.setAllWallets(e.allWallets),b.OptionsController.setIncludeWalletIds(e.includeWalletIds),b.OptionsController.setExcludeWalletIds(e.excludeWalletIds),b.OptionsController.setFeaturedWalletIds(e.featuredWalletIds),b.OptionsController.setTokens(e.tokens),b.OptionsController.setTermsConditionsUrl(e.termsConditionsUrl),b.OptionsController.setPrivacyPolicyUrl(e.privacyPolicyUrl),b.OptionsController.setCustomWallets(e.customWallets),b.OptionsController.setFeatures(e.features),b.OptionsController.setAllowUnsupportedChain(e.allowUnsupportedChain),b.OptionsController.setUniversalProviderConfigOverride(e.universalProviderConfigOverride),b.OptionsController.setPreferUniversalLinks(e.experimental_preferUniversalLinks),b.OptionsController.setDefaultAccountTypes(e.defaultAccountTypes);let i=this.getDefaultMetaData();if(!e.metadata&&i&&(e.metadata=i),b.OptionsController.setMetadata(e.metadata),b.OptionsController.setDisableAppend(e.disableAppend),b.OptionsController.setEnableEmbedded(e.enableEmbedded),b.OptionsController.setSIWX(e.siwx),this.features=null!=(n=b.OptionsController.state.features)?n:{},!e.projectId)return void o.AlertController.open(B.ErrorUtil.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED,"error");
1if((null==(t=e.adapters)?void 0:t.find(e=>e.namespace===r.ConstantsUtil.CHAIN.EVM))&&e.siweConfig){if(e.siwx)throw Error("Cannot set both `siweConfig` and `siwx` options");b.OptionsController.setSIWX(e.siweConfig.mapToSIWX())}}getDefaultMetaData(){if(m.CoreHelperUtil.isClient()){var e,t,r,n;return{name:(null==(t=document.getElementsByTagName("title"))||null==(e=t[0])?void 0:e.textContent)||"",description:(null==(r=document.querySelector('meta[property="og:description"]'))?void 0:r.content)||"",url:window.location.origin,icons:[(null==(n=document.querySelector('link[rel~="icon"]'))?void 0:n.href)||""]}}return null}setUnsupportedNetwork(e){let t=this.getActiveChainNamespace();if(t){let r=O.CaipNetworksUtil.getUnsupportedNetwork("".concat(t,":").concat(e));u.ChainController.setActiveCaipNetwork(r)}}getDefaultNetwork(){return O.CaipNetworksUtil.getCaipNetworkFromStorage(this.defaultCaipNetwork)}extendCaipNetwork(e,t){return O.CaipNetworksUtil.extendCaipNetwork(e,{customNetworkImageUrls:t.chainImages,projectId:t.projectId})}extendCaipNetworks(e){return O.CaipNetworksUtil.extendCaipNetworks(e.networks,{customNetworkImageUrls:e.chainImages,customRpcUrls:e.customRpcUrls,projectId:e.projectId})}extendDefaultCaipNetwork(e){let t=e.networks.find(t=>{var r;return t.id===(null==(r=e.defaultNetwork)?void 0:r.id)});return t?O.CaipNetworksUtil.extendCaipNetwork(t,{customNetworkImageUrls:e.chainImages,customRpcUrls:e.customRpcUrls,projectId:e.projectId}):void 0}async disconnectConnector(e,t){try{var r,n;this.setLoading(!0,e);let i={connections:[]},a=this.getAdapter(e);return((null==(n=u.ChainController.state.chains.get(e))||null==(r=n.accountState)?void 0:r.caipAddress)||!b.OptionsController.state.enableReconnect)&&(null==a?void 0:a.disconnect)&&(i=await a.disconnect({id:t})),this.setLoading(!1,e),i}catch(t){throw this.setLoading(!1,e),Error("Failed to disconnect chains: ".concat(t.message))}}createClients(){this.connectionControllerClient={connectWalletConnect:async()=>{var e;let t=u.ChainController.state.activeChain,r=this.getAdapter(t),n=null==(e=this.getCaipNetwork(t))?void 0:e.id,i=d.ConnectionController.getConnections(t),a=this.remoteFeatures.multiWallet,o=i.length>0;if(!r)throw Error("Adapter not found");let s=await r.connectWalletConnect(n);o&&a||this.close(),this.setClientId((null==s?void 0:s.clientId)||null),P.StorageUtil.setConnectedNamespaces([...u.ChainController.state.chains.keys()]),await this.syncWalletConnectAccount(),await N.SIWXUtil.initializeIfEnabled()},connectExternal:async e=>{let t=await this.onConnectExternal(e);return await this.connectInactiveNamespaces(e,t),t?{address:t.address}:void 0},reconnectExternal:async e=>{let{id:t,info:r,type:n,provider:i}=e,a=u.ChainController.state.activeChain,o=this.getAdapter(a);if(!a)throw Error("reconnectExternal: namespace not found");if(!o)throw Error("reconnectExternal: adapter not found");if(null==o?void 0:o.reconnect){var s;await (null==o?void 0:o.reconnect({id:t,info:r,type:n,provider:i,chainId:null==(s=this.getCaipNetwork())?void 0:s.id})),P.StorageUtil.addConnectedNamespace(a),this.syncConnectedWalletInfo(a)}},disconnectConnector:async e=>{await this.disconnectConnector(e.namespace,e.id)},disconnect:async e=>{let{id:t,chainNamespace:n,initialDisconnect:i}=e||{},a=n||u.ChainController.state.activeChain,o=h.ConnectorController.getConnectorId(a),s=t===r.ConstantsUtil.CONNECTOR_ID.AUTH||o===r.ConstantsUtil.CONNECTOR_ID.AUTH,l=t===r.ConstantsUtil.CONNECTOR_ID.WALLET_CONNECT||o===r.ConstantsUtil.CONNECTOR_ID.WALLET_CONNECT;try{var c;let e=Array.from(u.ChainController.state.chains.keys()),r=n?[n]:e;(l||s)&&(r=e);let a=r.map(async e=>{let r=h.ConnectorController.getConnectorId(e),n=await this.disconnectConnector(e,t||r);n&&(s&&P.StorageUtil.deleteConnectedSocialProvider(),n.connections.forEach(t=>{P.StorageUtil.addDisconnectedConnectorId(t.connectorId,e)})),i&&this.onDisconnectNamespace({chainNamespace:e,closeModal:!1})}),o=await Promise.allSettled(a);T.SendController.resetSend(),d.ConnectionController.resetWcConnection(),(null==(c=N.SIWXUtil.getSIWX())?void 0:c.signOutOnDisconnect)&&await N.SIWXUtil.clearSessions(),h.ConnectorController.setFilterByNamespace(void 0),d.ConnectionController.syncStorageConnections();let p=o.filter(e=>"rejected"===e.status);if(p.length>0)throw Error(p.map(e=>e.reason.message).join(", "));v.EventsController.sendEvent({type:"track",event:"DISCONNECT_SUCCESS",properties:{namespace:n||"all"}})}catch(e){throw Error("Failed to disconnect chains: ".concat(e.message))}},checkInstalled:e=>e?e.some(e=>{var t;return!!(null==(t=window.ethereum)?void 0:t[String(e)])}):!!window.ethereum,signMessage:async e=>{let t=u.ChainController.state.activeChain,r=this.getAdapter(u.ChainController.state.activeChain);if(!t)throw Error("signMessage: namespace not found");if(!r)throw Error("signMessage: adapter not found");let n=this.getAddress(t);if(!n)throw Error("signMessage: address not found");let i=await (null==r?void 0:r.signMessage({message:e,address:n,provider:w.ProviderController.getProvider(t)}));return(null==i?void 0:i.signature)||""},sendTransaction:async e=>{let t=e.chainNamespace;if(!t)throw Error("sendTransaction: namespace not found");if(f.ConstantsUtil.SEND_SUPPORTED_NAMESPACES.includes(t)){let r=this.getAdapter(t);if(!r)throw Error("sendTransaction: adapter not found");let n=w.ProviderController.getProvider(t),i=await (null==r?void 0:r.sendTransaction({...e,caipNetwork:this.getCaipNetwork(),provider:n}));return(null==i?void 0:i.hash)||""}return""},estimateGas:async e=>{let t=e.chainNamespace;if(t===r.ConstantsUtil.CHAIN.EVM){let r=this.getAdapter(t);if(!r)throw Error("estimateGas: adapter is required but got undefined");let n=w.ProviderController.getProvider(t),i=this.getCaipNetwork();if(!i)throw Error("estimateGas: caipNetwork is required but got undefined");let a=await (null==r?void 0:r.estimateGas({...e,provider:n,caipNetwork:i}));return(null==a?void 0:a.gas)||0n}return 0n},getEnsAvatar:async()=>{var e;let t=u.ChainController.state.activeChain;if(!t)throw Error("getEnsAvatar: namespace is required but got undefined");let r=this.getAddress(t);if(!r)throw Error("getEnsAvatar: address not found");await this.syncIdentity({address:r,chainId:Number(null==(e=this.getCaipNetwork())?void 0:e.id),chainNamespace:t});let n=u.ChainController.getAccountData();return(null==n?void 0:n.profileImage)||!1},getEnsAddress:async e=>await U.WcHelpersUtil.resolveReownName(e),writeContract:async e=>{let t=u.ChainController.state.activeChain,r=this.getAdapter(t);if(!t)throw Error("writeContract: namespace is required but got undefined");if(!r)throw Error("writeContract: adapter is required but got undefined");let n=this.getCaipNetwork(),i=this.getCaipAddress(),a=w.ProviderController.getProvider(t);if(!n||!i)throw Error("writeContract: caipNetwork or caipAddress is required but got undefined");let o=await (null==r?void 0:r.writeContract({...e,caipNetwork:n,provider:a,caipAddress:i}));return null==o?void 0:o.hash},parseUnits:(e,t)=>{var r;let n=this.getAdapter(u.ChainController.state.activeChain);if(!n)throw Error("parseUnits: adapter is required but got undefined");return null!=(r=null==n?void 0:n.parseUnits({value:e,decimals:t}))?r:0n},formatUnits:(e,t)=>{var r;let n=this.getAdapter(u.ChainController.state.activeChain);if(!n)throw Error("formatUnits: adapter is required but got undefined");return null!=(r=null==n?void 0:n.formatUnits({value:e,decimals:t}))?r:"0"},getCapabilities:async e=>{let t=this.getAdapter(u.ChainController.state.activeChain);if(!t)throw Error("getCapabilities: adapter is required but got undefined");return await (null==t?void 0:t.getCapabilities(e))},grantPermissions:async e=>{let t=this.getAdapter(u.ChainController.state.activeChain);if(!t)throw Error("grantPermissions: adapter is required but got undefined");return await (null==t?void 0:t.grantPermissions(e))},revokePermissions:async e=>{let t=this.getAdapter(u.ChainController.state.activeChain);if(!t)throw Error("revokePermissions: adapter is required but got undefined");return(null==t?void 0:t.revokePermissions)?await t.revokePermissions(e):"0x"},walletGetAssets:async e=>{var t;let r=this.getAdapter(u.ChainController.state.activeChain);if(!r)throw Error("walletGetAssets: adapter is required but got undefined");return null!=(t=await (null==r?void 0:r.walletGetAssets(e)))?t:{}},updateBalance:e=>{let t=this.getAddress(e),r=this.getCaipNetwork(e);r&&t&&this.updateNativeBalance(t,null==r?void 0:r.id,e)}},d.ConnectionController.setClient(this.connectionControllerClient)}async onConnectExternal(e){var t,n,i,a,o,s,l,c;let d=u.ChainController.state.activeChain,p=e.chain||d,f=this.getAdapter(p),m=!0;if(e.type===D.ConstantsUtil.CONNECTOR_TYPE_AUTH&&r.ConstantsUtil.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(e=>h.ConnectorController.getConnectorId(e)===r.ConstantsUtil.CONNECTOR_ID.AUTH)&&e.chain!==d&&(m=!1),e.chain&&e.chain!==d&&!e.caipNetwork){let t=this.getCaipNetworks().find(t=>t.chainNamespace===e.chain);t&&m&&this.setCaipNetwork(t)}if(!p)throw Error("connectExternal: namespace not found");if(!f)throw Error("connectExternal: adapter not found");let g=this.getCaipNetwork(p),v=e.caipNetwork||g,C=await f.connect({id:e.id,address:e.address,info:e.info,type:e.type,provider:e.provider,socialUri:e.socialUri,chainId:(null==(t=e.caipNetwork)?void 0:t.id)||(null==g?void 0:g.id),rpcUrl:(null==(o=e.caipNetwork)||null==(a=o.rpcUrls)||null==(i=a.default)||null==(n=i.http)?void 0:n[0])||(null==g||null==(c=g.rpcUrls)||null==(l=c.default)||null==(s=l.http)?void 0:s[0])});
1if(C)return P.StorageUtil.addConnectedNamespace(p),this.syncProvider({...C,chainNamespace:p}),this.setStatus("connected",p),this.syncConnectedWalletInfo(p),P.StorageUtil.removeDisconnectedConnectorId(e.id,p),{address:C.address,connectedCaipNetwork:v}}async connectInactiveNamespaces(e,t){var r;let n=e.type===D.ConstantsUtil.CONNECTOR_TYPE_AUTH,i=F.HelpersUtil.getOtherAuthNamespaces(null==t||null==(r=t.connectedCaipNetwork)?void 0:r.chainNamespace),a=u.ChainController.state.activeCaipNetwork,s=this.getAdapter(null==a?void 0:a.chainNamespace);n&&(await Promise.all(i.map(async t=>{try{var r,n,i;let a=w.ProviderController.getProvider(t),o=this.getCaipNetwork(t),s=this.getAdapter(t);await (null==s?void 0:s.connect({...e,provider:a,socialUri:void 0,chainId:null==o?void 0:o.id,rpcUrl:null==o||null==(i=o.rpcUrls)||null==(n=i.default)||null==(r=n.http)?void 0:r[0]}))&&(P.StorageUtil.addConnectedNamespace(t),P.StorageUtil.removeDisconnectedConnectorId(e.id,t),this.setStatus("connected",t),this.syncConnectedWalletInfo(t))}catch(e){o.AlertController.warn(B.ErrorUtil.ALERT_WARNINGS.INACTIVE_NAMESPACE_NOT_CONNECTED.displayMessage,B.ErrorUtil.ALERT_WARNINGS.INACTIVE_NAMESPACE_NOT_CONNECTED.debugMessage(t,e instanceof Error?e.message:void 0),B.ErrorUtil.ALERT_WARNINGS.INACTIVE_NAMESPACE_NOT_CONNECTED.code)}})),a&&await (null==s?void 0:s.switchNetwork({caipNetwork:a})))}getApprovedCaipNetworksData(){if(w.ProviderController.getProviderId(u.ChainController.state.activeChain)===D.ConstantsUtil.CONNECTOR_TYPE_WALLET_CONNECT){var e,t,r,n,i;let a=null==(t=this.universalProvider)||null==(e=t.session)?void 0:e.namespaces;return{supportsAllNetworks:(null==(i=this.universalProvider)||null==(n=i.session)||null==(r=n.peer)?void 0:r.metadata.name)==="MetaMask Wallet",approvedCaipNetworkIds:this.getChainsFromNamespaces(a)}}return{supportsAllNetworks:!0,approvedCaipNetworkIds:[]}}async switchCaipNetwork(e){let t=e.chainNamespace;if(this.getAddressByChainNamespace(e.chainNamespace)){let r=w.ProviderController.getProviderId(t);if(e.chainNamespace===u.ChainController.state.activeChain){let r=this.getAdapter(t);await (null==r?void 0:r.switchNetwork({caipNetwork:e}))}else if(this.setCaipNetwork(e),r===D.ConstantsUtil.CONNECTOR_TYPE_WALLET_CONNECT)this.syncWalletConnectAccount();else{let r=this.getAddressByChainNamespace(t);r&&this.syncAccount({address:r,chainId:e.id,chainNamespace:t})}}else this.setCaipNetwork(e)}getChainsFromNamespaces(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.values(e).flatMap(e=>Array.from(new Set([...e.chains||[],...e.accounts.map(e=>{let{chainId:t,chainNamespace:r}=i.ParseUtil.parseCaipAddress(e);return"".concat(r,":").concat(t)})])))}createAdapters(e){return this.createClients(),this.chainNamespaces.reduce((t,r)=>{let n=null==e?void 0:e.find(e=>e.namespace===r);if(n){var i,a;n.construct({namespace:r,projectId:null==(i=this.options)?void 0:i.projectId,networks:null==(a=this.caipNetworks)?void 0:a.filter(e=>{let{chainNamespace:t}=e;return t===r})}),t[r]=n}else t[r]=new M.UniversalAdapter({namespace:r,networks:this.getCaipNetworks()});return t},{})}async initChainAdapter(e){this.onConnectors(e),this.listenAdapter(e);let t=this.getAdapter(e);if(!t)throw Error("adapter not found");await t.syncConnectors(),await this.createUniversalProviderForAdapter(e)}async initChainAdapters(){await Promise.all(this.chainNamespaces.map(async e=>{await this.initChainAdapter(e)})),this.initAdapterController()}onConnectors(e){let t=this.getAdapter(e);null==t||t.on("connectors",this.setConnectors.bind(this))}listenAdapter(e){let t=this.getAdapter(e);if(!t)return;let r=P.StorageUtil.getConnectionStatus();!1===b.OptionsController.state.enableReconnect?this.setStatus("disconnected",e):"connected"===r?this.setStatus("connecting",e):("disconnected"===r&&P.StorageUtil.clearAddressCache(),this.setStatus(r,e)),t.on("switchNetwork",t=>{var r,n;let{address:i,chainId:a}=t,o=this.getCaipNetworks().find(e=>e.id.toString()===a.toString()||e.caipNetworkId.toString()===a.toString()),s=u.ChainController.state.activeChain===e,l=null==(n=u.ChainController.state.chains.get(e))||null==(r=n.accountState)?void 0:r.address;if(o){let t=s&&i?i:l;t&&this.syncAccount({address:t,chainId:o.id,chainNamespace:e})}else this.setUnsupportedNetwork(a)}),t.on("disconnect",()=>{let t=this.remoteFeatures.multiWallet,r=Array.from(d.ConnectionController.state.connections.values()).flat();this.onDisconnectNamespace({chainNamespace:e,closeModal:!t||0===r.length})}),t.on("connections",t=>{this.setConnections(t,e)}),t.on("pendingTransactions",()=>{let t=this.getAddress(e),r=u.ChainController.state.activeCaipNetwork;t&&(null==r?void 0:r.id)&&this.updateNativeBalance(t,r.id,r.chainNamespace)}),t.on("accountChanged",t=>{var r,n;let{address:i,chainId:a,connector:o}=t;this.handlePreviousConnectorConnection(o);let s=u.ChainController.state.activeChain===e;(null==o?void 0:o.provider)&&(this.syncProvider({id:o.id,type:o.type,provider:null==o?void 0:o.provider,chainNamespace:e}),this.syncConnectedWalletInfo(e));let l=null==(n=u.ChainController.getNetworkData(e))||null==(r=n.caipNetwork)?void 0:r.id,c=a||l;s&&c?this.syncAccount({address:i,chainId:c,chainNamespace:e}):!s&&c?(this.syncAccountInfo(i,c,e),this.syncBalance({address:i,chainId:c,chainNamespace:e})):this.syncAccountInfo(i,a,e),P.StorageUtil.addConnectedNamespace(e)})}async handlePreviousConnectorConnection(e){var t;let r=null==e?void 0:e.chain,n=null==e?void 0:e.id,i=h.ConnectorController.getConnectorId(r),a=null==(t=b.OptionsController.state.remoteFeatures)?void 0:t.multiWallet,o=i!==n,s=r&&n&&i&&o&&!a;try{s&&await d.ConnectionController.disconnect({id:i,namespace:r})}catch(e){console.warn("Error disconnecting previous connector",e)}}async createUniversalProviderForAdapter(e){if(await this.getUniversalProvider(),this.universalProvider){var t,r,n;await (null==(n=this.chainAdapters)||null==(r=n[e])||null==(t=r.setUniversalProvider)?void 0:t.call(r,this.universalProvider))}}async syncExistingConnection(){await Promise.allSettled(this.chainNamespaces.map(e=>this.syncNamespaceConnection(e)))}async unSyncExistingConnection(){try{await Promise.allSettled(this.chainNamespaces.map(e=>
1d.ConnectionController.disconnect({namespace:e,initialDisconnect:!0})))}catch(e){console.error("Error disconnecting existing connections:",e)}}async reconnectWalletConnect(){await this.syncWalletConnectAccount();let e=this.getAddress();this.getCaipAddress()||P.StorageUtil.deleteRecentWallet();let t=P.StorageUtil.getRecentWallet();v.EventsController.sendEvent({type:"track",event:"CONNECT_SUCCESS",address:e,properties:{method:m.CoreHelperUtil.isMobile()?"mobile":"qrcode",name:(null==t?void 0:t.name)||"Unknown",reconnect:!0,view:A.RouterController.state.view,walletRank:null==t?void 0:t.order}})}async syncNamespaceConnection(e){try{e===r.ConstantsUtil.CHAIN.EVM&&m.CoreHelperUtil.isSafeApp()&&h.ConnectorController.setConnectorId(r.ConstantsUtil.CONNECTOR_ID.SAFE,e);let t=h.ConnectorController.getConnectorId(e);switch(this.setStatus("connecting",e),t){case r.ConstantsUtil.CONNECTOR_ID.WALLET_CONNECT:await this.reconnectWalletConnect();break;case r.ConstantsUtil.CONNECTOR_ID.AUTH:break;default:await this.syncAdapterConnection(e)}}catch(t){console.warn("AppKit couldn't sync existing connection",t),this.setStatus("disconnected",e)}}onDisconnectNamespace(e){let{chainNamespace:t,closeModal:r}=e||{};u.ChainController.resetAccount(t),u.ChainController.resetNetwork(t),P.StorageUtil.removeConnectedNamespace(t);let n=Array.from(u.ChainController.state.chains.keys());(t?[t]:n).forEach(e=>P.StorageUtil.addDisconnectedConnectorId(h.ConnectorController.getConnectorId(e)||"",e)),h.ConnectorController.removeConnectorId(t),w.ProviderController.resetChain(t),this.setUser(null,t),this.setStatus("disconnected",t),this.setConnectedWalletInfo(null,t),!1!==r&&C.ModalController.close()}async syncAdapterConnections(){await Promise.allSettled(this.chainNamespaces.map(e=>{let t=this.getAdapter(e),r=this.getCaipAddress(e),n=this.getCaipNetwork(e);return null==t?void 0:t.syncConnections({connectToFirstConnector:!r,caipNetwork:n})}))}async syncAdapterConnection(e){let t=this.getAdapter(e),r=this.getCaipNetwork(e),n=h.ConnectorController.getConnectorId(e),i=h.ConnectorController.getConnectors(e).find(e=>e.id===n);try{var a,o,s,l,c;if(!t||!i)throw Error("Adapter or connector not found for namespace ".concat(e));if(!(null==r?void 0:r.id))throw Error("CaipNetwork not found");let n=await (null==t?void 0:t.syncConnection({namespace:e,id:i.id,chainId:r.id,rpcUrl:null==r||null==(s=r.rpcUrls)||null==(o=s.default)||null==(a=o.http)?void 0:a[0]}));n?(this.syncProvider({...n,chainNamespace:e}),await this.syncAccount({...n,chainNamespace:e}),this.setStatus("connected",e),v.EventsController.sendEvent({type:"track",event:"CONNECT_SUCCESS",address:n.address,properties:{method:"browser",name:(null==(l=i.info)?void 0:l.name)||i.name||"Unknown",reconnect:!0,view:A.RouterController.state.view,walletRank:null==i||null==(c=i.explorerWallet)?void 0:c.order}})):this.setStatus("disconnected",e)}catch(t){this.onDisconnectNamespace({chainNamespace:e,closeModal:!1})}}async syncWalletConnectAccount(){var e,t;let n=Object.keys((null==(t=this.universalProvider)||null==(e=t.session)?void 0:e.namespaces)||{}),a=this.chainNamespaces.map(async e=>{var t,a,o,s,l;let c=this.getAdapter(e);if(!c)return;let d=(null==(s=this.universalProvider)||null==(o=s.session)||null==(a=o.namespaces)||null==(t=a[e])?void 0:t.accounts)||[],p=null==(l=u.ChainController.state.activeCaipNetwork)?void 0:l.id,f=d.find(e=>{let{chainId:t}=i.ParseUtil.parseCaipAddress(e);return t===(null==p?void 0:p.toString())})||d[0];if(f){let t=i.ParseUtil.validateCaipAddress(f),{chainId:n,address:a}=i.ParseUtil.parseCaipAddress(t);if(w.ProviderController.setProviderId(e,D.ConstantsUtil.CONNECTOR_TYPE_WALLET_CONNECT),this.caipNetworks&&u.ChainController.state.activeCaipNetwork&&c.namespace!==r.ConstantsUtil.CHAIN.EVM){let t=c.getWalletConnectProvider({caipNetworks:this.getCaipNetworks(),provider:this.universalProvider,activeCaipNetwork:u.ChainController.state.activeCaipNetwork});w.ProviderController.setProvider(e,t)}else w.ProviderController.setProvider(e,this.universalProvider);h.ConnectorController.setConnectorId(r.ConstantsUtil.CONNECTOR_ID.WALLET_CONNECT,e),P.StorageUtil.addConnectedNamespace(e),await this.syncAccount({address:a,chainId:n,chainNamespace:e})}else n.includes(e)&&this.setStatus("disconnected",e);let m=this.getApprovedCaipNetworksData();this.syncConnectedWalletInfo(e),u.ChainController.setApprovedCaipNetworksData(e,{approvedCaipNetworkIds:m.approvedCaipNetworkIds,supportsAllNetworks:m.supportsAllNetworks})});await Promise.all(a)}syncProvider(e){let{type:t,provider:r,id:n,chainNamespace:i}=e;w.ProviderController.setProviderId(i,t),w.ProviderController.setProvider(i,r),h.ConnectorController.setConnectorId(n,i)}async syncAccount(e){var t,n;let a=e.chainNamespace===u.ChainController.state.activeChain,o=u.ChainController.getCaipNetworkByNamespace(e.chainNamespace,e.chainId),{address:s,chainId:l,chainNamespace:c}=e,{chainId:d}=P.StorageUtil.getActiveNetworkProps(),p=(null==o?void 0:o.id)||d,h=(null==(t=u.ChainController.state.activeCaipNetwork)?void 0:t.name)===r.ConstantsUtil.UNSUPPORTED_NETWORK_NAME,f=u.ChainController.getNetworkProp("supportsAllNetworks",c);if(this.setStatus("connected",c),(!h||f)&&p){let e=this.getCaipNetworks().find(e=>e.id.toString()===p.toString()),t=this.getCaipNetworks().find(e=>e.chainNamespace===c);if(!f&&!e&&!t){let r=this.getApprovedCaipNetworkIds()||[],n=r.find(e=>{var t;return(null==(t=i.ParseUtil.parseCaipNetworkId(e))?void 0:t.chainId)===p.toString()}),a=r.find(e=>{var t;return(null==(t=i.ParseUtil.parseCaipNetworkId(e))?void 0:t.chainNamespace)===c});e=this.getCaipNetworks().find(e=>e.caipNetworkId===n),t=this.getCaipNetworks().find(e=>e.caipNetworkId===a||"deprecatedCaipNetworkId"in e&&e.deprecatedCaipNetworkId===a)}let d=e||t;(null==d?void 0:d.chainNamespace)===u.ChainController.state.activeChain?b.OptionsController.state.enableNetworkSwitch&&!b.OptionsController.state.allowUnsupportedChain&&(null==(n=u.ChainController.state.activeCaipNetwork)?void 0:n.name)===r.ConstantsUtil.UNSUPPORTED_NETWORK_NAME?u.ChainController.showUnsupportedChainUI():this.setCaipNetwork(d):!a&&o&&this.setCaipNetworkOfNamespace(o,c),this.syncConnectedWalletInfo(c);let h=this.getAddress(c);F.HelpersUtil.isLowerCaseMatch(s,h)||this.syncAccountInfo(s,null==d?void 0:d.id,c),a?await this.syncBalance({address:s,chainId:null==d?void 0:d.id,chainNamespace:c}):await this.syncBalance({address:s,chainId:null==o?void 0:o.id,chainNamespace:c}),this.syncIdentity({address:s,chainId:l,chainNamespace:c})}}async syncAccountInfo(e,t,r){let n=this.getCaipAddress(r),i=t||(null==n?void 0:n.split(":")[1]);if(!i)return;let a="".concat(r,":").concat(i,":").concat(e);this.setCaipAddress(a,r,!0),await this.syncIdentity({address:e,chainId:i,chainNamespace:r})}async syncReownName(e,t){try{let r=await this.getReownName(e);
1if(r[0]){let e=r[0];this.setProfileName(e.name,t)}else this.setProfileName(null,t)}catch(e){this.setProfileName(null,t)}}syncConnectedWalletInfo(e){let t=h.ConnectorController.getConnectorId(e),n=w.ProviderController.getProviderId(e);if(n===D.ConstantsUtil.CONNECTOR_TYPE_ANNOUNCED||n===D.ConstantsUtil.CONNECTOR_TYPE_INJECTED){if(t){let r=this.getConnectors().find(e=>{var r,n;let i=e.id===t,a=(null==(r=e.info)?void 0:r.rdns)===t,o=null==(n=e.connectors)?void 0:n.some(e=>{var r;return e.id===t||(null==(r=e.info)?void 0:r.rdns)===t});return i||a||!!o});if(r){let{info:t,name:n,imageUrl:i}=r,a=i||this.getConnectorImage(r);this.setConnectedWalletInfo({name:n,icon:a,...t},e)}}}else if(n===D.ConstantsUtil.CONNECTOR_TYPE_WALLET_CONNECT){let t=w.ProviderController.getProvider(e);if(null==t?void 0:t.session){var i;this.setConnectedWalletInfo({...t.session.peer.metadata,name:t.session.peer.metadata.name,icon:null==(i=t.session.peer.metadata.icons)?void 0:i[0]},e)}}else if(t&&(t===r.ConstantsUtil.CONNECTOR_ID.COINBASE_SDK||t===r.ConstantsUtil.CONNECTOR_ID.COINBASE)){let r=this.getConnectors().find(e=>e.id===t),n=(null==r?void 0:r.name)||"Coinbase Wallet",i=(null==r?void 0:r.imageUrl)||this.getConnectorImage(r),a=null==r?void 0:r.info;this.setConnectedWalletInfo({...a,name:n,icon:i},e)}}async syncBalance(e){n.NetworkUtil.getNetworksByNamespace(this.getCaipNetworks(),e.chainNamespace).find(t=>{var r;return t.id.toString()===(null==(r=e.chainId)?void 0:r.toString())})&&e.chainId&&await this.updateNativeBalance(e.address,e.chainId,e.chainNamespace)}async ready(){await this.readyPromise}async updateNativeBalance(e,t,r){let n=this.getAdapter(r),i=u.ChainController.getCaipNetworkByNamespace(r,t);if(n){let a=await n.getBalance({address:e,chainId:t,caipNetwork:i,tokens:this.options.tokens});return this.setBalance(a.balance,a.symbol,r),a}}async initializeUniversalAdapter(){var e,r,n,i,a,o,s,l,c,u,d,p=this;let h=_.LoggerUtil.createLogger(function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];e&&p.handleAlertError(e),console.error(...r)}),f={projectId:null==(e=this.options)?void 0:e.projectId,metadata:{name:(null==(r=this.options)?void 0:r.metadata)?null==(n=this.options)?void 0:n.metadata.name:"",description:(null==(i=this.options)?void 0:i.metadata)?null==(a=this.options)?void 0:a.metadata.description:"",url:(null==(o=this.options)?void 0:o.metadata)?null==(s=this.options)?void 0:s.metadata.url:"",icons:(null==(l=this.options)?void 0:l.metadata)?null==(c=this.options)?void 0:c.metadata.icons:[""]},logger:h};b.OptionsController.setManualWCControl(!!(null==(u=this.options)?void 0:u.manualWCControl)),this.universalProvider=null!=(d=this.options.universalProvider)?d:await t.default.init(f);let m=this.universalProvider.disconnect.bind(this.universalProvider);this.universalProvider.disconnect=async()=>{try{return await m()}catch(e){if(e instanceof Error&&e.message.includes("Missing or invalid. Record was recently deleted"))return;throw e}},!1===b.OptionsController.state.enableReconnect&&this.universalProvider.session&&await this.universalProvider.disconnect(),this.listenWalletConnect()}listenWalletConnect(){this.universalProvider&&this.chainNamespaces.forEach(e=>{U.WcHelpersUtil.listenWcProvider({universalProvider:this.universalProvider,namespace:e,onDisplayUri:e=>{d.ConnectionController.setUri(e)},onConnect:e=>{let{address:t}=m.CoreHelperUtil.getAccount(e[0]);d.ConnectionController.finalizeWcConnection(t)},onDisconnect:()=>{u.ChainController.state.noAdapters&&this.resetAccount(e),d.ConnectionController.resetWcConnection()},onChainChanged:t=>{let n=u.ChainController.state.activeChain,i=n&&h.ConnectorController.state.activeConnectorIds[n]===r.ConstantsUtil.CONNECTOR_ID.WALLET_CONNECT;if(n===e&&(u.ChainController.state.noAdapters||i)){let e=this.getCaipNetworks().find(e=>e.id.toString()===t.toString()||e.caipNetworkId.toString()===t.toString()),r=this.getCaipNetwork();if(!e)return void this.setUnsupportedNetwork(t);(null==r?void 0:r.id.toString())!==(null==e?void 0:e.id.toString())&&(null==r?void 0:r.chainNamespace)===(null==e?void 0:e.chainNamespace)&&this.setCaipNetwork(e)}},onAccountsChanged:t=>{let n=u.ChainController.state.activeChain,i=n&&h.ConnectorController.state.activeConnectorIds[n]===r.ConstantsUtil.CONNECTOR_ID.WALLET_CONNECT;if(n===e&&(u.ChainController.state.noAdapters||i)){let e=null==t?void 0:t[0];e&&this.syncAccount({address:e.address,chainId:e.chainId,chainNamespace:e.chainNamespace})}}})})}createUniversalProvider(){var e;return!this.universalProviderInitPromise&&m.CoreHelperUtil.isClient()&&(null==(e=this.options)?void 0:e.projectId)&&(this.universalProviderInitPromise=this.initializeUniversalAdapter()),this.universalProviderInitPromise}
1async getUniversalProvider(){if(!this.universalProvider)try{await this.createUniversalProvider()}catch(e){v.EventsController.sendEvent({type:"error",event:"INTERNAL_SDK_ERROR",properties:{errorType:"UniversalProviderInitError",errorMessage:e instanceof Error?e.message:"Unknown",uncaught:!1}}),console.error("AppKit:getUniversalProvider - Cannot create provider",e)}return this.universalProvider}getDisabledCaipNetworks(){let e=u.ChainController.getAllApprovedCaipNetworkIds(),t=u.ChainController.getAllRequestedCaipNetworks();return m.CoreHelperUtil.sortRequestedNetworks(e,t).filter(e=>u.ChainController.isCaipNetworkDisabled(e))}handleAlertError(e){let t=Object.entries(B.ErrorUtil.UniversalProviderErrors).find(t=>{let[,{message:r}]=t;return e.message.includes(r)}),[r,n]=null!=t?t:[],{message:i,alertErrorKey:a}=null!=n?n:{};if(r&&i&&!this.reportedAlertErrors[r]){let e=B.ErrorUtil.ALERT_ERRORS[a];e&&(o.AlertController.open(e,"error"),this.reportedAlertErrors[r]=!0)}}getAdapter(e){var t;if(e)return null==(t=this.chainAdapters)?void 0:t[e]}createAdapter(e){var t,r;if(!e)return;let n=e.namespace;n&&(this.createClients(),e.namespace=n,e.construct({namespace:n,projectId:null==(t=this.options)?void 0:t.projectId,networks:null==(r=this.caipNetworks)?void 0:r.filter(e=>{let{chainNamespace:t}=e;return t===n})}),this.chainNamespaces.includes(n)||this.chainNamespaces.push(n),this.chainAdapters&&(this.chainAdapters[n]=e))}async open(e){await this.injectModalUi(),(null==e?void 0:e.uri)&&d.ConnectionController.setUri(e.uri);let{isSwap:t,isSend:r}=this.toModalOptions();return t(e)?C.ModalController.open({...e,data:{swap:e.arguments}}):r(e)&&e.arguments?this.openSend(e.arguments):C.ModalController.open(e)}async close(){await this.injectModalUi(),C.ModalController.close()}setLoading(e,t){C.ModalController.setLoading(e,t)}async disconnect(e){await d.ConnectionController.disconnect({namespace:e})}getSIWX(){return b.OptionsController.state.siwx}getError(){return""}getChainId(){var e;return null==(e=u.ChainController.state.activeCaipNetwork)?void 0:e.id}async switchNetwork(e){let{throwOnFailure:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getCaipNetworks().find(t=>t.id===e.id);if(!r)return void o.AlertController.open(B.ErrorUtil.ALERT_ERRORS.SWITCH_NETWORK_NOT_FOUND,"error");await u.ChainController.switchActiveNetwork(r,{throwOnFailure:t})}getWalletProvider(){return u.ChainController.state.activeChain?w.ProviderController.state.providers[u.ChainController.state.activeChain]:null}getWalletProviderType(){return w.ProviderController.getProviderId(u.ChainController.state.activeChain)}subscribeProviders(e){return w.ProviderController.subscribeProviders(e)}getThemeMode(){return k.ThemeController.state.themeMode}getThemeVariables(){return k.ThemeController.state.themeVariables}setThemeMode(e){k.ThemeController.setThemeMode(e),(0,x.setColorTheme)(k.ThemeController.state.themeMode)}setTermsConditionsUrl(e){b.OptionsController.setTermsConditionsUrl(e)}setPrivacyPolicyUrl(e){b.OptionsController.setPrivacyPolicyUrl(e)}setThemeVariables(e){k.ThemeController.setThemeVariables(e),(0,x.setThemeVariables)(k.ThemeController.state.themeVariables)}subscribeTheme(e){return k.ThemeController.subscribe(e)}subscribeConnections(e){return this.remoteFeatures.multiWallet?d.ConnectionController.subscribe(e):(o.AlertController.open(r.ConstantsUtil.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info"),()=>void 0)}getWalletInfo(e){if(e){var t,r;return null==(r=u.ChainController.state.chains.get(e))||null==(t=r.accountState)?void 0:t.connectedWalletInfo}let n=u.ChainController.getAccountData();return null==n?void 0:n.connectedWalletInfo}getAccount(e){let t=e||u.ChainController.state.activeChain,n=h.ConnectorController.getAuthConnector(t),i=u.ChainController.getAccountData(t),a=P.StorageUtil.getConnectedConnectorId(u.ChainController.state.activeChain),o=d.ConnectionController.getConnections(t);if(!t)throw Error("AppKit:getAccount - namespace is required");let s=o.flatMap(e=>e.accounts.map(e=>{let{address:r,type:n,publicKey:i}=e;return m.CoreHelperUtil.createAccount(t,r,n||"eoa",i)}));if(i)return{allAccounts:s,caipAddress:i.caipAddress,address:m.CoreHelperUtil.getPlainAddress(i.caipAddress),isConnected:!!i.caipAddress,status:i.status,embeddedWalletInfo:n&&a===r.ConstantsUtil.CONNECTOR_ID.AUTH?{user:i.user?{...i.user,username:P.StorageUtil.getConnectedSocialUsername()}:void 0,authProvider:i.socialProvider||"email",accountType:(0,S.getPreferredAccountType)(t),isSmartAccountDeployed:!!i.smartAccountDeployed}:void 0}}subscribeAccount(e,t){let r=()=>{let r=this.getAccount(t);r&&e(r)};t?u.ChainController.subscribeChainProp("accountState",r,t):u.ChainController.subscribe(r),h.ConnectorController.subscribe(r)}
1subscribeNetwork(e){return u.ChainController.subscribe(t=>{let{activeCaipNetwork:r}=t;e({caipNetwork:r,chainId:null==r?void 0:r.id,caipNetworkId:null==r?void 0:r.caipNetworkId})})}subscribeWalletInfo(e,t){return t?u.ChainController.subscribeChainProp("accountState",t=>e(null==t?void 0:t.connectedWalletInfo),t):u.ChainController.subscribeChainProp("accountState",t=>e(null==t?void 0:t.connectedWalletInfo))}subscribeShouldUpdateToAddress(e){u.ChainController.subscribeChainProp("accountState",t=>e(null==t?void 0:t.shouldUpdateToAddress))}subscribeCaipNetworkChange(e){u.ChainController.subscribeKey("activeCaipNetwork",e)}getState(){return E.PublicStateController.state}getRemoteFeatures(){return b.OptionsController.state.remoteFeatures}subscribeState(e){return E.PublicStateController.subscribe(e)}subscribeRemoteFeatures(e){return b.OptionsController.subscribeKey("remoteFeatures",e)}showErrorMessage(e){I.SnackController.showError(e)}showSuccessMessage(e){I.SnackController.showSuccess(e)}getEvent(){return{...v.EventsController.state}}subscribeEvents(e){return v.EventsController.subscribe(e)}replace(e){A.RouterController.replace(e)}redirect(e){A.RouterController.push(e)}popTransactionStack(e){A.RouterController.popTransactionStack(e)}isOpen(){return C.ModalController.state.open}isTransactionStackEmpty(){return 0===A.RouterController.state.transactionStack.length}static getInstance(){return this.instance}updateFeatures(e){b.OptionsController.setFeatures(e)}updateRemoteFeatures(e){b.OptionsController.setRemoteFeatures(e)}updateOptions(e){let t={...b.OptionsController.state||{},...e};b.OptionsController.setOptions(t)}setConnectMethodsOrder(e){b.OptionsController.setConnectMethodsOrder(e)}setWalletFeaturesOrder(e){b.OptionsController.setWalletFeaturesOrder(e)}setCollapseWallets(e){b.OptionsController.setCollapseWallets(e)}setSocialsOrder(e){b.OptionsController.setSocialsOrder(e)}getConnectMethodsOrder(){return R.WalletUtil.getConnectOrderMethod(b.OptionsController.state.features,h.ConnectorController.getConnectors())}addNetwork(e,t){if(this.chainAdapters&&!this.chainAdapters[e])throw Error("Adapter for namespace ".concat(e," doesn't exist"));let r=this.extendCaipNetwork(t,this.options);this.getCaipNetworks().find(e=>e.id===r.id)||u.ChainController.addNetwork(r)}removeNetwork(e,t){if(this.chainAdapters&&!this.chainAdapters[e])throw Error("Adapter for namespace ".concat(e," doesn't exist"));this.getCaipNetworks().find(e=>e.id===t)&&u.ChainController.removeNetwork(e,t)}constructor(e){this.chainNamespaces=[],this.features={},this.remoteFeatures={},this.reportedAlertErrors={},this.getCaipNetwork=(e,t)=>{if(e){var r,n,i;let a=null==(r=u.ChainController.getCaipNetworks(e))?void 0:r.find(e=>e.id===t);if(a)return a;let o=null==(n=u.ChainController.getNetworkData(e))?void 0:n.caipNetwork;return o||(null==(i=u.ChainController.getRequestedCaipNetworks(e).filter(t=>t.chainNamespace===e))?void 0:i[0])}return u.ChainController.state.activeCaipNetwork||this.defaultCaipNetwork},this.getCaipNetworkId=()=>{let e=this.getCaipNetwork();if(e)return e.id},this.getCaipNetworks=e=>u.ChainController.getCaipNetworks(e),this.getActiveChainNamespace=()=>u.ChainController.state.activeChain,this.setRequestedCaipNetworks=(e,t)=>{u.ChainController.setRequestedCaipNetworks(e,t)},this.getApprovedCaipNetworkIds=()=>u.ChainController.getAllApprovedCaipNetworkIds(),this.getCaipAddress=e=>{var t,r;return u.ChainController.state.activeChain!==e&&e?null==(r=u.ChainController.state.chains.get(e))||null==(t=r.accountState)?void 0:t.caipAddress:u.ChainController.state.activeCaipAddress},this.setClientId=e=>{c.BlockchainApiController.setClientId(e)},this.getProvider=e=>w.ProviderController.getProvider(e),this.getProviderType=e=>w.ProviderController.getProviderId(e),this.getPreferredAccountType=e=>(0,S.getPreferredAccountType)(e),this.setCaipAddress=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];u.ChainController.setAccountProp("caipAddress",e,t,r),u.ChainController.setAccountProp("address",m.CoreHelperUtil.getPlainAddress(e),t,r)},this.setBalance=(e,t,r)=>{u.ChainController.setAccountProp("balance",e,r),u.ChainController.setAccountProp("balanceSymbol",t,r)},this.setProfileName=(e,t)=>
1{u.ChainController.setAccountProp("profileName",e,t)},this.setProfileImage=(e,t)=>{u.ChainController.setAccountProp("profileImage",e,t)},this.setUser=(e,t)=>{u.ChainController.setAccountProp("user",e,t)},this.resetAccount=e=>{u.ChainController.resetAccount(e)},this.setCaipNetwork=e=>{u.ChainController.setActiveCaipNetwork(e)},this.setCaipNetworkOfNamespace=(e,t)=>{u.ChainController.setChainNetworkData(t,{caipNetwork:e})},this.setStatus=(e,t)=>{u.ChainController.setAccountProp("status",e,t),h.ConnectorController.isConnected()?P.StorageUtil.setConnectionStatus("connected"):P.StorageUtil.setConnectionStatus("disconnected")},this.getAddressByChainNamespace=e=>{var t;return null==(t=u.ChainController.getAccountData(e))?void 0:t.address},this.setConnectors=e=>{let t=[...h.ConnectorController.state.allConnectors,...e];h.ConnectorController.setConnectors(t)},this.setConnections=(e,t)=>{P.StorageUtil.setConnections(e,t),d.ConnectionController.setConnections(e,t)},this.fetchIdentity=e=>c.BlockchainApiController.fetchIdentity(e),this.getReownName=e=>g.EnsController.getNamesForAddress(e),this.getConnectors=()=>h.ConnectorController.getConnectors(),this.getConnectorImage=e=>l.AssetUtil.getConnectorImage(e),this.getConnections=e=>this.remoteFeatures.multiWallet?p.ConnectionControllerUtil.getConnectionsData(e).connections:(o.AlertController.open(r.ConstantsUtil.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info"),[]),this.getRecentConnections=e=>this.remoteFeatures.multiWallet?p.ConnectionControllerUtil.getConnectionsData(e).recentConnections:(o.AlertController.open(r.ConstantsUtil.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info"),[]),this.switchConnection=async e=>{if(!this.remoteFeatures.multiWallet)return void o.AlertController.open(r.ConstantsUtil.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info");await d.ConnectionController.switchConnection(e)},this.deleteConnection=e=>{if(!this.remoteFeatures.multiWallet)return void o.AlertController.open(r.ConstantsUtil.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info");P.StorageUtil.deleteAddressFromConnection(e),d.ConnectionController.syncStorageConnections()},this.setConnectedWalletInfo=(e,t)=>{let r=w.ProviderController.getProviderId(t),n=e?{...e,type:r}:void 0;u.ChainController.setAccountProp("connectedWalletInfo",n,t)},this.getIsConnectedState=()=>!!u.ChainController.state.activeCaipAddress,this.addAddressLabel=(e,t,r)=>{var n;let i=(null==(n=u.ChainController.getAccountData(r))?void 0:n.addressLabels)||{};u.ChainController.setAccountProp("addressLabels",{...i,[e]:t},r)},this.removeAddressLabel=(e,t)=>
1{var r;let n=(null==(r=u.ChainController.getAccountData(t))?void 0:r.addressLabels)||{};u.ChainController.setAccountProp("addressLabels",{...n,[e]:void 0},t)},this.getAddress=e=>{var t;let r=e||u.ChainController.state.activeChain;return null==(t=u.ChainController.getAccountData(r))?void 0:t.address},this.resetNetwork=e=>{u.ChainController.resetNetwork(e)},this.addConnector=e=>{h.ConnectorController.addConnector(e)},this.resetWcConnection=()=>{d.ConnectionController.resetWcConnection()},this.setAddressExplorerUrl=(e,t)=>{u.ChainController.setAccountProp("addressExplorerUrl",e,t)},this.setSmartAccountDeployed=(e,t)=>{u.ChainController.setAccountProp("smartAccountDeployed",e,t)},this.setPreferredAccountType=(e,t)=>{u.ChainController.setAccountProp("preferredAccountType",e,t)},this.setEIP6963Enabled=e=>{b.OptionsController.setEIP6963Enabled(e)},this.handleUnsafeRPCRequest=()=>{this.isOpen()?this.isTransactionStackEmpty()||this.redirect("ApproveTransaction"):this.open({view:"ApproveTransaction"})},this.options=e,this.version=e.sdkVersion,this.caipNetworks=this.extendCaipNetworks(e),this.chainNamespaces=this.getChainNamespacesSet(e.adapters,this.caipNetworks),this.defaultCaipNetwork=this.extendDefaultCaipNetwork(e),this.chainAdapters=this.createAdapters(e.adapters),this.readyPromise=this.initialize(e)}}},904498,e=>{"use strict";e.s(["AppKit",()=>P]);var t=e.i(934472),r=e.i(217946),n=e.i(796296),i=e.i(564170),a=e.i(293003),o=e.i(275158),s=e.i(532733),l=e.i(443420),c=e.i(80675),u=e.i(221170),d=e.i(958597),p=e.i(639875),h=e.i(651623),f=e.i(958051),m=e.i(350464),g=e.i(220835),v=e.i(834841),C=e.i(74199),y=e.i(887301),b=e.i(89965),w=e.i(780991),E=e.i(435545),A=e.i(747290),N=e.i(622841),T=e.i(390403);let I=!1;class P extends T.AppKitBaseClient{async onAuthProviderConnected(e){let r=b.HelpersUtil.userChainIdToChainNamespace(null==e?void 0:e.chainId);if(e.message&&e.signature&&e.siwxMessage&&await u.SIWXUtil.addEmbeddedWalletSession({chainId:e.siwxMessage.chainId,accountAddress:e.address,notBefore:e.siwxMessage.notBefore,statement:e.siwxMessage.statement,resources:e.siwxMessage.resources,requestId:e.siwxMessage.requestId,issuedAt:e.siwxMessage.issuedAt,domain:e.siwxMessage.domain,uri:e.siwxMessage.uri,version:e.siwxMessage.version,nonce:e.siwxMessage.nonce},e.message,e.signature),!r)throw Error("AppKit:onAuthProviderConnected - namespace is required");let n=r===t.ConstantsUtil.CHAIN.EVM?"eip155:".concat(e.chainId,":").concat(e.address):"".concat(e.chainId,":").concat(e.address),i=m.OptionsController.state.defaultAccountTypes[r],a=(0,d.getPreferredAccountType)(r),o=e.preferredAccountType||a||i;this.setCaipAddress(n,r);let{signature:s,siwxMessage:l,message:c,...p}=e,f=h.ChainController.getAccountData(r);this.setUser({...(null==f?void 0:f.user)||{},...p},r),this.setSmartAccountDeployed(!!e.smartAccountDeployed,r),this.setPreferredAccountType(o,r),await Promise.all([this.syncAuthConnectorTheme(this.authProvider),this.syncAccount({address:e.address,chainId:e.chainId,chainNamespace:r})]),this.setLoading(!1,r)}setupAuthConnectorListeners(e){e.onRpcRequest(t=>{E.W3mFrameHelpers.checkIfRequestExists(t)?E.W3mFrameHelpers.checkIfRequestIsSafe(t)||this.handleUnsafeRPCRequest():(this.open(),console.error(A.W3mFrameRpcConstants.RPC_METHOD_NOT_ALLOWED_MESSAGE,{method:t.method}),setTimeout(()=>{this.showErrorMessage(A.W3mFrameRpcConstants.RPC_METHOD_NOT_ALLOWED_UI_MESSAGE)},300),e.rejectRpcRequests())}),e.onRpcError(()=>{this.isOpen()&&(this.isTransactionStackEmpty()?this.close():this.popTransactionStack("error"))}),e.onRpcSuccess((e,t)=>{let r=E.W3mFrameHelpers.checkIfRequestIsSafe(t),n=this.getAddress(),i=h.ChainController.state.activeCaipNetwork;r||(n&&(null==i?void 0:i.id)&&this.updateNativeBalance(n,i.id,i.chainNamespace),this.isTransactionStackEmpty()?this.close():this.popTransactionStack("success"))}),e.onNotConnected(()=>{let e=h.ChainController.state.activeChain;if(!e)throw Error("AppKit:onNotConnected - namespace is required");a.ConnectorController.getConnectorId(e)===t.ConstantsUtil.CONNECTOR_ID.AUTH&&(this.setCaipAddress(null,e),this.setLoading(!1,e))}),e.onConnect(this.onAuthProviderConnected.bind(this)),e.onSocialConnected(this.onAuthProviderConnected.bind(this)),e.onSetPreferredAccount(e=>{let{address:t,type:r}=e,n=h.ChainController.state.activeChain;if(!n)throw Error("AppKit:onSetPreferredAccount - namespace is required");t&&this.setPreferredAccountType(r,n)})}async syncAuthConnectorTheme(e){if(!e)return;let t=C.ThemeController.getSnapshot();await e.syncTheme({themeMode:t.themeMode,themeVariables:t.themeVariables,w3mThemeVariables:(0,r.getW3mThemeV
1ariables)(t.themeVariables,t.themeMode)})}async syncAuthConnector(e,r){var n,i,o,l,u,d,p,f,m;let g=t.ConstantsUtil.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(r),C=r===h.ChainController.state.activeChain;if(!g)return;this.setLoading(!0,r);let y=e.getLoginEmailUsed();this.setLoading(y,r),y&&this.setStatus("connecting",r);let b=e.getEmail(),E=e.getUsername(),A=(null==(n=h.ChainController.getAccountData(r))?void 0:n.user)||{};this.setUser({...A,username:E,email:b},r),this.setupAuthConnectorListeners(e);let{isConnected:N}=await e.isConnected();if(r&&g&&C)if(N&&(null==(i=this.connectionControllerClient)?void 0:i.connectExternal)){await e.init(),await this.syncAuthConnectorTheme(e),await (null==(u=this.connectionControllerClient)?void 0:u.connectExternal({id:t.ConstantsUtil.CONNECTOR_ID.AUTH,info:{name:t.ConstantsUtil.CONNECTOR_ID.AUTH},type:w.ConstantsUtil.CONNECTOR_TYPE_AUTH,provider:e,chainId:null==(l=h.ChainController.getNetworkData(r))||null==(o=l.caipNetwork)?void 0:o.id,chain:r})),this.setStatus("connected",r);let n=v.StorageUtil.getConnectedSocialProvider();n?s.EventsController.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",address:this.getAddress(),properties:{provider:n,reconnect:!0}}):s.EventsController.sendEvent({type:"track",event:"CONNECT_SUCCESS",address:this.getAddress(),properties:{method:"email",name:(null==(m=this.universalProvider)||null==(f=m.session)||null==(p=f.peer)||null==(d=p.metadata)?void 0:d.name)||"Unknown",reconnect:!0,view:c.RouterController.state.view,walletRank:void 0}})}else a.ConnectorController.getConnectorId(r)===t.ConstantsUtil.CONNECTOR_ID.AUTH&&(this.setStatus("disconnected",r),v.StorageUtil.removeConnectedNamespace(r));this.setLoading(!1,r)}async checkExistingTelegramSocialConnection(e){try{var t;if(!f.CoreHelperUtil.isTelegram())return;let r=v.StorageUtil.getTelegramSocialProvider();if(!r||!f.CoreHelperUtil.isClient())return;let n=new URL(window.location.href).searchParams.get("result_uri");if(!n)return;r&&h.ChainController.setAccountProp("socialProvider",r,e),await (null==(t=this.authProvider)?void 0:t.init());let o=a.ConnectorController.getAuthConnector();r&&o&&(this.setLoading(!0,e),await i.ConnectionController.connectExternal({id:o.id,type:o.type,socialUri:n},o.chain),v.StorageUtil.setConnectedSocialProvider(r),v.StorageUtil.removeTelegramSocialProvider(),s.EventsController.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:r}}))}catch(t){this.setLoading(!1,e),console.error("checkExistingSTelegramocialConnection error",t)}try{let e=new URL(window.location.href);e.searchParams.delete("result_uri"),window.history.replaceState({},document.title,e.toString())}catch(e){console.error("tma social login failed",e)}}createAuthProvider(e){var r,n,i,a;if(!t.ConstantsUtil.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(e))return;let o=null==(r=this.remoteFeatures)?void 0:r.email,s=Array.isArray(null==(n=this.remoteFeatures)?void 0:n.socials)&&this.remoteFeatures.socials.length>0,c=b.HelpersUtil.getActiveNamespaceConnectedToAuth()||e;!this.authProvider&&(null==(i=this.options)?void 0:i.projectId)&&(o||s)&&(this.authProvider=N.W3mFrameProviderSingleton.getInstance({projectId:this.options.projectId,enableLogger:this.options.enableAuthLogger,chainId:null==(a=this.getCaipNetwork(c))?void 0:a.caipNetworkId,abortController:y.ErrorUtil.EmbeddedWalletAbortController,onTimeout:e=>{"iframe_load_failed"===e?p.AlertController.open(y.ErrorUtil.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):"iframe_request_timeout"===e?p.AlertController.open(y.ErrorUtil.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):"unverified_domain"===e&&p.AlertController.open(y.ErrorUtil.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},getActiveCaipNetwork:e=>(0,d.getActiveCaipNetwork)(e),getCaipNetworks:e=>h.ChainController.getCaipNetworks(e)}),l.PublicStateController.subscribeOpen(e=>{if(!e&&this.isTransactionStackEmpty()){var t;null==(t=this.authProvider)||t.rejectRpcRequests()}}));let u=e===h.ChainController.state.activeChain&&m.OptionsController.state.enableReconnect;!1===m.OptionsController.state.enableReconnect?this.syncAuthConnectorTheme(this.authProvider):this.authProvider&&u&&(this.syncAuthConnector(this.authProvider,e),this.checkExistingTelegramSocialConnection(e))}createAuthProviderForAdapter(e){if(this.createAuthProvider(e),this.authProvider){var t,r,n;null==(n=this.chainAdapters)||null==(r=n[e])||null==(t=r.setAuthProvider)||t.call(r,this.authProvider)}}initControllers(e){super.initControllers(e),this.options.excludeWalletIds&&n.ApiController.initializeExcludedWallets({ids:this.options.excludeWalletIds})}async switchCaipNetwork(e){var r,n,i;if(!e)return;let a=h.ChainController.state.activeChain,o=e.chainNamespace,s=this.getAddressByChainNamespace(o);if(o===a&&(null==(r=h.ChainController.getAccountData(o))?void 0:r.caipAddress)){let t=this.getAdapter(o);await (null==t?void 0:t.switchNetwork({caipNetwork:e})),this.setCaipNetwork(e)}else{let r=g.ProviderController.getProviderId(a)===w.ConstantsUtil.CONNECTOR_TYPE_AUTH,l=g.ProviderController.getProviderId(o),c=l===w.ConstantsUtil.CONNECTOR_TYPE_AUTH,u=t.ConstantsUtil.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(o);if(!o)throw Error("AppKit:switchCaipNetwork - networkNamespace is required");if((r&&void 0===l||c)&&u)try{if(h.ChainController.state.activeChain=e.chainNamespace,s){let t=this.getAdapter(o);await (null==t?void 0:t.switchNetwork({caipNetwork:e}))}else await (null==(i=this.connectionControllerClient)||null==(n=i.connectExternal)?void 0:n.call(i,{id:t.ConstantsUtil.CONNECTOR_ID.AUTH,provider:this.authProvider,chain:o,chainId:e.id,type:w.ConstantsUtil.CONNECTOR_TYPE_AUTH,caipNetwork:e}));this.setCaipNetwork(e)}catch(r){let t=this.getAdapter(o);await (null==t?void 0:t.switchNetwork({caipNetwork:e}))}else if(l===w.ConstantsUtil.CONNECTOR_TYPE_WALLET_CONNECT){if(!h.ChainController.state.noAdapters){let t=this.getAdapter(o);await (null==t?void 0:t.switchNetwork({caipNetwork:e}))}this.setCaipNetwork(e),this.syncWalletConnectAccount()}else this.setCaipNetwork(e),s&&this.syncAccount({address:s,chainId:e.id,chainNamespace:o})}}async initialize(e){var t;await super.initialize(e),null==(t=this.chainNamespaces)||t.forEach(e
1=>{this.createAuthProviderForAdapter(e)}),await this.injectModalUi(),l.PublicStateController.set({initialized:!0})}async syncIdentity(e){var r;let{address:n,chainId:i,chainNamespace:o}=e,s="".concat(o,":").concat(i),l=null==(r=this.caipNetworks)?void 0:r.find(e=>e.caipNetworkId===s);if(null==l?void 0:l.testnet){this.setProfileName(null,o),this.setProfileImage(null,o);return}let c=a.ConnectorController.getConnectorId(o)===t.ConstantsUtil.CONNECTOR_ID.AUTH;try{let{name:e,avatar:t}=await this.fetchIdentity({address:n});!e&&c?await this.syncReownName(n,o):(this.setProfileName(e,o),this.setProfileImage(t,o))}catch(e){1!==i&&this.setProfileImage(null,o)}}syncConnectedWalletInfo(e){let t=g.ProviderController.getProviderId(e);if(t===w.ConstantsUtil.CONNECTOR_TYPE_AUTH){let i=this.authProvider;if(i){var r,n;let a=null!=(r=v.StorageUtil.getConnectedSocialProvider())?r:"email",o=null!=(n=i.getEmail())?n:i.getUsername();this.setConnectedWalletInfo({name:t,identifier:o,social:a},e)}}else super.syncConnectedWalletInfo(e)}async injectModalUi(){if(f.CoreHelperUtil.isClient()&&!I)try{let e={...o.ConstantsUtil.DEFAULT_FEATURES,...this.options.features},t=this.remoteFeatures;if(await this.loadModalComponents(e,t),f.CoreHelperUtil.isClient()&&!document.querySelector("w3m-modal")){let e=document.createElement("w3m-modal");m.OptionsController.state.disableAppend||m.OptionsController.state.enableEmbedded||document.body.insertAdjacentElement("beforeend",e)}I=!0}catch(e){console.error("Error injecting modal UI:",e)}}async loadModalComponents(t,r){if(!f.CoreHelperUtil.isClient())return;let n=[];(r.email||r.socials&&r.socials.length>0)&&n.push(e.A(119417)),r.email&&n.push(e.A(841421)),r.socials&&n.push(e.A(974575)),r.swaps&&r.swaps.length>0&&n.push(e.A(833012)),t.send&&n.push(e.A(789155)),t.receive&&n.push(e.A(939503)),r.onramp&&r.onramp.length>0&&n.push(e.A(613617)),r.payWithExchange&&n.push(e.A(583603)),r.activity&&n.push(e.A(471661)),(t.pay||r.payments)&&n.push(e.A(510229)),r.emailCapture&&n.push(e.A(353188)),await Promise.all([...n,e.A(966788),e.A(866317)])}}},927328,e=>{"use strict";let t;e.s(["getAppKit",()=>n,"useAppKit",()=>a,"useAppKitEvents",()=>l,"useAppKitState",()=>s,"useAppKitTheme",()=>i,"useWalletInfo",()=>o]);var r=e.i(534098);function n(e){e&&(t=e)}function i(){if(!t)throw Error('Please call "createAppKit" before using "useAppKitTheme" hook');let[e,n]=(0,r.useState)(t.getThemeMode()),[i,a]=(0,r.useState)(t.getThemeVariables());return(0,r.useEffect)(()=>{let e=null==t?void 0:t.subscribeTheme(e=>{n(e.themeMode),a(e.themeVariables)});return()=>{null==e||e()}},[]),{themeMode:e,themeVariables:i,setThemeMode:function(e){e&&(null==t||t.setThemeMode(e))},setThemeVariables:function(e){e&&(null==t||t.setThemeVariables(e))}}}function a(){if(!t)throw Error('Please call "createAppKit" before using "useAppKit" hook');return{open:async function(e){return null==t?void 0:t.open(e)},close:async function(){await (null==t?void 0:t.close())}}}function o(e){if(!t)throw Error('Please call "createAppKit" before using "useWalletInfo" hook');let[n,i]=(0,r.useState)(()=>null==t?void 0:t.getWalletInfo(e));return(0,r.useEffect)(()=>{i(null==t?void 0:t.getWalletInfo(e));let r=null==t?void 0:t.subscribeWalletInfo(e=>{i(e)},e);return()=>null==r?void 0:r()},[e]),{walletInfo:n}}function s(){if(!t)throw Error('Please call "createAppKit" before using "useAppKitState" hook');let[e,n]=(0,r.useState)({...t.getState(),initialized:!1}),[i,a]=(0,r.useState)(t.getRemoteFeatures());return(0,r.useEffect)(()=>{if(t){n({...t.getState()}),a(t.getRemoteFeatures());let e=null==t?void 0:t.subscribeState(e=>{n({...e})}),r=null==t?void 0:t.subscribeRemoteFeatures(e=>{a(e)});return()=>{null==e||e(),null==r||r()}}return()=>null},[]),{...e,...null!=i?i:{}}}function l(){if(!t)throw Error('Please call "createAppKit" before using "useAppKitEvents" hook');let[e,n]=(0,r.useState)(t.getEvent());return(0,r.useEffect)(()=>{let e=null==t?void 0:t.subscribeEvents(e=>{n({...e})});return()=>{null==e||e()}},[]),e}},694739,e=>{"use strict";async function t(e){if(!e)throw Error("AppKit not initialized when  fetchBalance was called.");return await r(e)}async function r(e){var t;let r=e.getAddress(),n=e.getActiveChainNamespace(),i=null==(t=e.getCaipNetwork())?void 0:t.id;if(!r||!n||!i)return{data:void 0,error:"Not able to retrieve balance",isSuccess:!1,isError:!0};let a=await e.updateNativeBalance(r,i,n);return{data:a,error:a?null:"No balance found",isSuccess:!!a,isError:!a}}e.s(["_internalFetchBalance",()=>t])},12399,e=>{"use strict";e.s(["PACKAGE_VERSION",()=>t]);let t="1.8.14"},592618,e=>{"use strict";e.s([])},488078,e=>{"use strict";e.s([]),e.i(516379),e.i(592618)},435916,e=>{"use strict";e.s(["createComponent",()=>i]);let t=new Set(["children","localName","ref","style","className"]),r=new WeakMap,n=(e,t,n,i,a)=>{let o=null==a?void 0:a[t];void 0===o?(e[t]=n,null==n&&t in HTMLElement.prototype&&e.removeAttribute(t)):n!==i&&((e,t,n)=>{let i=r.get(e);void 0===i&&r.set(e,i=new Map);let a=i.get(t);void 0!==n?void 0===a?(i.set(t,a={handleEvent:n}),e.addEventListener(t,a)):a.handleEvent=n:void 0!==a&&(i.delete(t),e.removeEventListener(t,a))})(e,o,n)},i=e=>{let{react:r,tagName:i,elementClass:a,events:o,displayName:s}=e,l=new Set(Object.keys(null!=o?o:{})),c=r.forwardRef((e,s)=>{let c=r.useRef(new Map),u=r.useRef(null),d={},p={};for(let[r,n]of Object.entries(e))t.has(r)?d["className"===r?"class":r]=n:l.has(r)||r in a.prototype?p[r]=n:d[r]=n;return r.useLayoutEffect(()=>{if(null===u.current)return;let t=new Map;for(let r in p)n(u.current,r,e[r],c.current.get(r),o),c.current.delete(r),t.set(r,e[r]);for(let[e,t]of c.current)n(u.current,e,void 0,t,o);c.current=t}),r.useLayoutEffect(()=>{var e;null==(e=u.current)||e.removeAttribute("defer-hydration")},[]),d.suppressHydrationWarning=!0,r.createElement(i,{...d,ref:r.useCallback(e=>{u.current=e,"function"==typeof s?s(e):null!==s&&(s.current=e)},[s])})});return c.displayName=null!=s?s:a.name,c}},968395,e=>{"use strict";e.s([]),e.i(435916)},432908,e=>{"use strict";e.s([]);var t=e.i(534098);e.i(968395);var r=e.i(435916);e.i(990368);var n=e.i(85495),i=e.i(294160),a=e.i(427940),o=e.i(797465);(0,r.createComponent)({tagName:"appkit-button",elementClass:i.Ap
1pKitButton,react:t.default}),(0,r.createComponent)({tagName:"appkit-network-button",elementClass:o.AppKitNetworkButton,react:t.default}),(0,r.createComponent)({tagName:"appkit-connect-button",elementClass:a.AppKitConnectButton,react:t.default}),(0,r.createComponent)({tagName:"appkit-account-button",elementClass:n.AppKitAccountButton,react:t.default})},384266,e=>{"use strict";e.s([]),e.i(534098),e.i(127614)},127614,e=>{"use strict";let t;e.s(["createAppKit",()=>o]);var r=e.i(958051);e.i(41566);var n=e.i(904498),i=e.i(927328);e.i(694739);var a=e.i(12399);function o(e){if(!t){var o;t=new n.AppKit({...e,sdkVersion:r.CoreHelperUtil.generateSdkVersion(null!=(o=e.adapters)?o:[],"react",a.PACKAGE_VERSION)}),(0,i.getAppKit)(t)}return t}e.i(488078),e.i(432908),e.i(384266)},72494,e=>{"use strict";e.s(["ConstantsUtil",()=>t]);let t={FIVE_MINUTES_IN_MS:3e5}},961382,e=>{"use strict";e.s(["mapToSIWX",()=>l]);var t=e.i(934472),r=e.i(580598),n=e.i(651623),i=e.i(958051),a=e.i(958597),o=e.i(89965);let s=[];function l(e){let l;async function c(){try{let t=await e.methods.getSession();if(!t)return;if(!(null==t?void 0:t.address))throw Error("SIWE session is missing address");if(!(null==t?void 0:t.chainId))throw Error("SIWE session is missing chainId");return t}catch(e){console.warn("AppKit:SIWE:getSession - error:",e);return}}async function u(){return l||(l=(async()=>{try{var t,r;await e.methods.signOut(),null==(t=(r=e.methods).onSignOut)||t.call(r)}finally{l=void 0}})())}return s.forEach(e=>e()),s.push(n.ChainController.subscribeKey("activeCaipAddress",async t=>{if(e.options.signOutOnDisconnect&&!t){await c()&&await u();return}if(t){let r=await c();if(r&&e.options.signOutOnAccountChange){let e=null==r?void 0:r.address,n=null===i.CoreHelperUtil||void 0===i.CoreHelperUtil?void 0:i.CoreHelperUtil.getPlainAddress(t);o.HelpersUtil.isLowerCaseMatch(e,n)||await u()}}})),{async createMessage(t){var n,i;let a=await (null==(n=(i=e.methods).getMessageParams)?void 0:n.call(i));if(!a)throw Error("Failed to get message params!");let o=await e.getNonce(t.accountAddress),s=a.iat||new Date().toISOString();return{nonce:o,version:"1",requestId:a.requestId,accountAddress:t.accountAddress,chainId:t.chainId,domain:a.domain,uri:a.uri,notBefore:a.nbf,resources:a.resources,statement:a.statement,expirationTime:a.exp,issuedAt:s,toString:()=>e.createMessage({...a,chainId:r.NetworkUtil.caipNetworkIdToNumber(t.chainId)||1,address:"did:pkh:".concat(t.chainId,":").concat(t.accountAddress),nonce:o,version:"1",iat:s})}},async addSession(t){if(!r.NetworkUtil.parseEvmChainId(t.data.chainId))return Promise.resolve();if(await e.methods.verifyMessage(t)){var n,i;let a=t.data.accountAddress,o=r.NetworkUtil.parseEvmChainId(t.data.chainId);return null==(n=(i=e.methods).onSignIn)||n.call(i,{address:a,chainId:o}),Promise.resolve()}throw Error("Failed to verify message")},async revokeSession(e,t){try{await u()}catch(e){console.warn("AppKit:SIWE:revokeSession - signOut error",e)}},async setSessions(e){if(0===e.length)try{await u()}catch(e){console.warn("AppKit:SIWE:setSessions - signOut error",e)}else{let t=e.find(e=>{var t;return e.data.chainId===(null==(t=(0,a.getActiveCaipNetwork)())?void 0:t.caipNetworkId)})||e[0];await this.addSession(t)}},async getSessions(r,n){try{if(!r.startsWith("eip155:"))return[{data:{accountAddress:n,chainId:r},message:"",signature:""}];let i=await c(),a="".concat(t.ConstantsUtil.CHAIN.EVM,":").concat(null==i?void 0:i.chainId),s=null==i?void 0:i.address,l=e.options.signOutOnNetworkChange,u=e.options.signOutOnAccountChange,d=l&&a!==r,p=u&&!o.HelpersUtil.isLowerCaseMatch(s,n);if(!i||d||p)return[];return[{data:{accountAddress:i.address,chainId:a},message:"",signature:""}]}catch(e){return console.warn("AppKit:SIWE:getSessions - error:",e),[]}},getRequired(){var t;return null==(t=e.options.required)||t},signOutOnDisconnect:e.options.signOutOnDisconnect}}},435752,e=>{"use strict";e.s(["AppKitSIWEClient",()=>i]);var t=e.i(221170),r=e.i(72494),n=e.i(961382);class i{mapToSIWX(){return(0,n.mapToSIWX)(this)}async getNonce(e){let t=await this.methods.getNonce(e);if(!t)throw Error("siweControllerClient:getNonce - nonce is undefined");return t}
1async getMessageParams(){var e,t;return await (null==(e=(t=this.methods).getMessageParams)?void 0:e.call(t))||{}}createMessage(e){let t=this.methods.createMessage(e);if(!t)throw Error("siweControllerClient:createMessage - message is undefined");return t}async verifyMessage(e){return await this.methods.verifyMessage(e)}async getSession(){let e=await this.methods.getSession();if(!e)throw Error("siweControllerClient:getSession - session is undefined");return e}async signIn(){await t.SIWXUtil.requestSignMessage();let e=await this.methods.getSession();if(!e)throw Error("Error verifying SIWE signature");return e}async signOut(){let e=t.SIWXUtil.getSIWX();return!!e&&(await e.setSessions([]),!0)}constructor(e){let{required:t=!0,enabled:n=!0,nonceRefetchIntervalMs:i=r.ConstantsUtil.FIVE_MINUTES_IN_MS,sessionRefetchIntervalMs:a=r.ConstantsUtil.FIVE_MINUTES_IN_MS,signOutOnAccountChange:o=!0,signOutOnDisconnect:s=!0,signOutOnNetworkChange:l=!0,...c}=e;this.options={required:t,enabled:n,nonceRefetchIntervalMs:i,sessionRefetchIntervalMs:a,signOutOnDisconnect:s,signOutOnAccountChange:o,signOutOnNetworkChange:l},this.methods=c}}},701166,e=>{"use strict";e.s(["createSIWEConfig",()=>r]);var t=e.i(435752);function r(e){return new t.AppKitSIWEClient(e)}},46596,e=>{"use strict";let t;e.s(["uid",()=>n]);let r=256;function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:11;if(!t||r+e>512){t="",r=0;for(let e=0;e<256;e++)t+=(256+256*Math.random()|0).toString(16).substring(1)}return t.substring(r,r+++e)}},608165,e=>{"use strict";e.s(["createClient",()=>n]);var t=e.i(935999),r=e.i(46596);function n(e){var n,i,a,o;let{batch:s,chain:l,ccipRead:c,key:u="base",name:d="Base Client",type:p="base"}=e,h=null!=(n=e.experimental_blockTag)?n:"number"==typeof(null==l?void 0:l.experimental_preconfirmationTime)?"pending":void 0,f=Math.min(Math.max(Math.floor((null!=(i=null==l?void 0:l.blockTime)?i:12e3)/2),500),4e3),m=null!=(a=e.pollingInterval)?a:f,g=null!=(o=e.cacheTime)?o:m,v=e.account?(0,t.parseAccount)(e.account):void 0,{config:C,request:y,value:b}=e.transport({chain:l,pollingInterval:m}),w={account:v,batch:s,cacheTime:g,ccipRead:c,chain:l,key:u,name:d,pollingInterval:m,request:y,transport:{...C,...b},type:p,uid:(0,r.uid)(),...h?{experimental_blockTag:h}:{}};return Object.assign(w,{extend:function e(t){return r=>{let n=r(t);for(let e in w)delete n[e];let i={...t,...n};return Object.assign(i,{extend:e(i)})}}(w)})}},623834,e=>{"use strict";e.s(["isNullUniversalResolverError",()=>n]);var t=e.i(768366),r=e.i(824542);function n(e){var n,i,a,o,s,l;if(!(e instanceof t.BaseError))return!1;let c=e.walk(e=>e instanceof r.ContractFunctionRevertedError);return c instanceof r.ContractFunctionRevertedError&&((null==(n=c.data)?void 0:n.errorName)==="HttpError"||(null==(i=c.data)?void 0:i.errorName)==="ResolverError"||(null==(a=c.data)?void 0:a.errorName)==="ResolverNotContract"||(null==(o=c.data)?void 0:o.errorName)==="ResolverNotFound"||(null==(s=c.data)?void 0:s.errorName)==="ReverseAddressMismatch"||(null==(l=c.data)?void 0:l.errorName)==="UnsupportedResolverProfile")}},82617,e=>{"use strict";e.s(["encodedLabelToLabelhash",()=>r]);var t=e.i(158137);function r(e){if(66!==e.length||0!==e.indexOf("[")||65!==e.indexOf("]"))return null;let r="0x".concat(e.slice(1,65));return(0,t.isHex)(r)?r:null}},397161,e=>{"use strict";e.s(["namehash",()=>o]);var t=e.i(179926),r=e.i(720289),n=e.i(172804),i=e.i(244733),a=e.i(82617);function o(e){let o=new Uint8Array(32).fill(0);if(!e)return(0,n.bytesToHex)(o);let s=e.split(".");for(let e=s.length-1;e>=0;e-=1){let n=(0,a.encodedLabelToLabelhash)(s[e]),l=n?(0,r.toBytes)(n):(0,i.keccak256)((0,r.stringToBytes)(s[e]),"bytes");o=(0,i.keccak256)((0,t.concat)([o,l]),"bytes")}return(0,n.bytesToHex)(o)}},239354,e=>{"use strict";function t(e){return"[".concat(e.slice(2),"]")}e.s(["encodeLabelhash",()=>t])},341614,e=>{"use strict";e.s(["labelhash",()=>a]);var t=e.i(720289),r=e.i(172804),n=e.i(244733),i=e.i(82617);function a(e){let a=new Uint8Array(32).fill(0);return e?(0,i.encodedLabelToLabelhash)(e)||(0,n.keccak256)((0,t.stringToBytes)(e)):(0,r.bytesToHex)(a)}},535472,e=>{"use strict";e.s(["packetToBytes",()=>i]);var t=e.i(720289),r=e.i(239354),n=e.i(341614);function i(e){let i=e.replace(/^\.|\.$/gm,"");if(0===i.length)return new Uint8Array(1);let a=new Uint8Array((0,t.stringToBytes)(i).byteLength+2),o=0,s=i.split(".");for(let e=0;e<s.length;e++){let i=(0,t.stringToBytes)(s[e]);i.byteLength>255&&(i=(0,t.stringToBytes)((0,r.encodeLabelhash)((0,n.labelhash)(s[e])))),a[o]=i.length,a.set(i,o+1),o+=i.length+1}return a.byteLength!==o+1?a.slice(0,o+1):a}},24449,e=>{"use strict";function t(e,t,r){let n=e[t.name];if("function"==typeof n)return n;let i=e[r];return"function"==typeof i?i:r=>t(e,r)}e.s(["getAction",()=>t])},574041,e=>{"use strict";e.s(["getContractError",()=>o]);var t=e.i(38176),r=e.i(768366),n=e.i(824542),i=e.i(197957),a=e.i(109057);function o(e,o){let{abi:s,address:l,args:c,docsPath:u,functionName:d,sender:p}=o,h=e instanceof n.RawContractError?e:e instanceof r.BaseError?e.walk(e=>"data"in e)||e.walk():{},{code:f,data:m,details:g,message:v,shortMessage:C}=h,y=e instanceof t.AbiDecodingZeroDataError?new n.ContractFunctionZeroDataError({functionName:d}):[3,a.InternalRpcError.code].includes(f)&&(m||g||v||C)?new n.ContractFunctionRevertedError({abi:s,data:"object"==typeof m?m.data:m,functionName:d,message:h instanceof i.RpcRequestError?g:null!=C?C:v}):e;return new n.ContractFunctionExecutionError(y,{abi:s,args:c,contractAddress:l,docsPath:u,functionName:d,sender:p})}},721200,e=>{"use strict";e.s(["readContract",()=>o]);var t=e.i(827122),r=e.i(254712),n=e.i(574041),i=e.i(24449),a=e.i(355534);async function o(e,o){let{abi:s,address:l,args:c,functionName:u,...d}=o,p=(0,r.encodeFunctionData)({abi:s,args:c,functionName:u});try{let{data:r}=await (0,i.getAction)(e,a.call,"call")({...d,data:p,to:l});return(0,t.decodeFunctionResult)({abi:s,args:c,functionName:u,data:r||"0x"})}catch(e){throw(0,n.getContractError)(e,{abi:s,address:l,args:c,docsPath:"/docs/contract/readContract",functionName:u})}}},292456,e=>{"use strict";e.s(["getEnsAddress",()=>h]);var t=e.i(3339),r=e.i(827122),n=e.i(254712),i=e.i(474984),a=e.i(327856),o=e.i(172804),s=e.i(623834),l=e.i(306925),c=e.i(397161),u=e.i(535472),d=e.i(24449),p=e.i(721200);async function h(e,h){let{blockNumber:f,blockTag:m,coinType:g,name:v,gatewayUrls:C,strict:y}=h,{chain:b}=e,w=(()=>
1{if(h.universalResolverAddress)return h.universalResolverAddress;if(!b)throw Error("client chain not configured. universalResolverAddress is required.");return(0,i.getChainContractAddress)({blockNumber:f,chain:b,contract:"ensUniversalResolver"})})(),E=null==b?void 0:b.ensTlds;if(E&&!E.some(e=>v.endsWith(e)))return null;let A=null!=g?[(0,c.namehash)(v),BigInt(g)]:[(0,c.namehash)(v)];try{let i=(0,n.encodeFunctionData)({abi:t.addressResolverAbi,functionName:"addr",args:A}),s={address:w,abi:t.universalResolverResolveAbi,functionName:"resolveWithGateways",args:[(0,o.toHex)((0,u.packetToBytes)(v)),i,null!=C?C:[l.localBatchGatewayUrl]],blockNumber:f,blockTag:m},c=(0,d.getAction)(e,p.readContract,"readContract"),h=await c(s);if("0x"===h[0])return null;let g=(0,r.decodeFunctionResult)({abi:t.addressResolverAbi,args:A,functionName:"addr",data:h[0]});if("0x"===g||"0x00"===(0,a.trim)(g))return null;return g}catch(e){if(y)throw e;if((0,s.isNullUniversalResolverError)(e))return null;throw e}}},846541,e=>{"use strict";e.s(["EnsAvatarInvalidMetadataError",()=>r,"EnsAvatarInvalidNftUriError",()=>n,"EnsAvatarUnsupportedNamespaceError",()=>a,"EnsAvatarUriResolutionError",()=>i]);var t=e.i(768366);class r extends t.BaseError{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","","Provided data: ".concat(JSON.stringify(e))],name:"EnsAvatarInvalidMetadataError"})}}class n extends t.BaseError{constructor({reason:e}){super("ENS NFT avatar URI is invalid. ".concat(e),{name:"EnsAvatarInvalidNftUriError"})}}class i extends t.BaseError{constructor({uri:e}){super('Unable to resolve ENS avatar URI "'.concat(e,'". The URI may be malformed, invalid, or does not respond with a valid image.'),{name:"EnsAvatarUriResolutionError"})}}class a extends t.BaseError{constructor({namespace:e}){super('ENS NFT avatar namespace "'.concat(e,'" is not supported. Must be "erc721" or "erc1155".'),{name:"EnsAvatarUnsupportedNamespaceError"})}}t.BaseError},582534,e=>{"use strict";e.s(["getJsonImage",()=>u,"getMetadataAvatarUri",()=>d,"getNftTokenUri",()=>f,"parseAvatarUri",()=>p,"parseNftUri",()=>h,"resolveAvatarUri",()=>c]);var t=e.i(721200),r=e.i(846541);let n=RegExp("(?<protocol>https?:\\/\\/[^/]*|ipfs:\\/|ipns:\\/|ar:\\/)?(?<root>\\/)?(?<subpath>ipfs\\/|ipns\\/)?(?<target>[\\w\\-.]+)(?<subtarget>\\/.*)?"),i=RegExp("^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\\/(?<target>[\\w\\-.]+))?(?<subtarget>\\/.*)?$"),a=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,o=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function s(e){try{let t=await fetch(e,{method:"HEAD"});if(200===t.status){let e=t.headers.get("content-type");return null==e?void 0:e.startsWith("image/")}return!1}catch(t){if("object"==typeof t&&void 0!==t.response||!Object.hasOwn(globalThis,"Image"))return!1;return new Promise(t=>{let r=new Image;r.onload=()=>{t(!0)},r.onerror=()=>{t(!1)},r.src=e})}}function l(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function c(e){let{uri:t,gatewayUrls:s}=e,c=a.test(t);if(c)return{uri:t,isOnChain:!0,isEncoded:c};let u=l(null==s?void 0:s.ipfs,"https://ipfs.io"),d=l(null==s?void 0:s.arweave,"https://arweave.net"),p=t.match(n),{protocol:h,subpath:f,target:m,subtarget:g=""}=(null==p?void 0:p.groups)||{},v="ipns:/"===h||"ipns/"===f,C="ipfs:/"===h||"ipfs/"===f||i.test(t);if(t.startsWith("http")&&!v&&!C){let e=t;return(null==s?void 0:s.arweave)&&(e=t.replace(/https:\/\/arweave.net/g,null==s?void 0:s.arweave)),{uri:e,isOnChain:!1,isEncoded:!1}}if((v||C)&&m)return{uri:"".concat(u,"/").concat(v?"ipns":"ipfs","/").concat(m).concat(g),isOnChain:!1,isEncoded:!1};if("ar:/"===h&&m)return{uri:"".concat(d,"/").concat(m).concat(g||""),isOnChain:!1,isEncoded:!1};let y=t.replace(o,"");if(y.startsWith("<svg")&&(y="data:image/svg+xml;base64,".concat(btoa(y))),y.startsWith("data:")||y.startsWith("{"))return{uri:y,isOnChain:!0,isEncoded:!1};throw new r.EnsAvatarUriResolutionError({uri:t})}function u(e){if("object"!=typeof e||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new r.EnsAvatarInvalidMetadataError({data:e});return e.image||e.image_url||e.image_data}async function d(e){let{gatewayUrls:t,uri:n}=e;try{let e=await fetch(n).then(e=>e.json());return await p({gatewayUrls:t,uri:u(e)})}catch(e){throw new r.EnsAvatarUriResolutionError({uri:n})}}async function p(e){let{gatewayUrls:t,uri:n}=e,{uri:i,isOnChain:a}=c({uri:n,gatewayUrls:t});if(a||await s(i))return i;throw new r.EnsAvatarUriResolutionError({uri:n})}function h(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));let[n,i,a]=t.split("/"),[o,s]=n.split(":"),[l,c]=i.split(":");if(!o||"eip155"!==o.toLowerCase())throw new r.EnsAvatarInvalidNftUriError({reason:"Only EIP-155 supported"});if(!s)throw new r.EnsAvatarInvalidNftUriError({reason:"Chain ID not found"});if(!c)throw new r.EnsAvatarInvalidNftUriError({reason:"Contract address not found"});if(!a)throw new r.EnsAvatarInvalidNftUriError({reason:"Token ID not found"});if(!l)throw new r.EnsAvatarInvalidNftUriError({reason:"ERC namespace not found"});return{chainID:Number.parseInt(s,10),namespace:l.toLowerCase(),contractAddress:c,tokenID:a}}async function f(e,n){let{nft:i}=n;if("erc721"===i.namespace)return(0,t.readContract)(e,{address:i.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(i.tokenID)]});if("erc1155"===i.namespace)return(0,t.readContract)(e,{address:i.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(i.tokenID)]});throw new r.EnsAvatarUnsupportedNamespaceError({namespace:i.namespace})}},43283,e=>{"use strict";e.s(["parseAvatarRecord",()=>r]);var t=e.i(582534);async function r(e,r){let{gatewayUrls:i,record:a}=r;return/eip155:/i.test(a)?n(e,{gatewayUrls:i,record:a}):(0,t.parseAvatarUri)({uri:a,gatewayUrls:i})}async function n(e,r){let{gatewayUrls:n,record:i}=r,a=(0,t.parseNftUri)(i),o=await (0,t.getNftTokenUri)(e,{nft:a}),{uri:s,isOnChain:l,isEncoded:c}=(0,t.resolveAvatarUri)({uri:o,gatewayUrls:n});if(l&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){let e=JSON.parse(c?atob(s.replace("data:application/json;base64,","")):s);return(0,t.parseAvatarUri)({uri:(0,t.getJsonImage)(e),gatewayUrls:n})}let u=a.tokenID;return"erc1155"===a.namespace&&(u=u.replace("0x","").padStart(64,"0")),(0,t.getMetadataAvatarUri)({gatewayUrls:n,uri:s.replace(/(?:0x)?{id}/,u)})}},145959,e=>{"use strict";e.s(["getEnsText",()=>p]);var t=e.i(3339),r=e.i(827122),n=e.i(254712),i=e.i(474984),a=e.i(172804),o=e.i(623834),s=e.i(306925),l=e.i(397161),c=e.i(535472),u=e.i(24449),d=e.i(721200);async function p(e,p){let{blockNumber:h,blockTag:f,key:m,name:g,gatewayUrls:v,strict:C}=p,{chain:y}=e,b=(()=>
1{if(p.universalResolverAddress)return p.universalResolverAddress;if(!y)throw Error("client chain not configured. universalResolverAddress is required.");return(0,i.getChainContractAddress)({blockNumber:h,chain:y,contract:"ensUniversalResolver"})})(),w=null==y?void 0:y.ensTlds;if(w&&!w.some(e=>g.endsWith(e)))return null;try{let i={address:b,abi:t.universalResolverResolveAbi,args:[(0,a.toHex)((0,c.packetToBytes)(g)),(0,n.encodeFunctionData)({abi:t.textResolverAbi,functionName:"text",args:[(0,l.namehash)(g),m]}),null!=v?v:[s.localBatchGatewayUrl]],functionName:"resolveWithGateways",blockNumber:h,blockTag:f},o=(0,u.getAction)(e,d.readContract,"readContract"),p=await o(i);if("0x"===p[0])return null;let C=(0,r.decodeFunctionResult)({abi:t.textResolverAbi,functionName:"text",data:p[0]});return""===C?null:C}catch(e){if(C)throw e;if((0,o.isNullUniversalResolverError)(e))return null;throw e}}},872682,e=>{"use strict";e.s(["getEnsAvatar",()=>i]);var t=e.i(43283),r=e.i(24449),n=e.i(145959);async function i(e,i){let{blockNumber:a,blockTag:o,assetGatewayUrls:s,name:l,gatewayUrls:c,strict:u,universalResolverAddress:d}=i,p=await (0,r.getAction)(e,n.getEnsText,"getEnsText")({blockNumber:a,blockTag:o,key:"avatar",name:l,universalResolverAddress:d,gatewayUrls:c,strict:u});if(!p)return null;try{return await (0,t.parseAvatarRecord)(e,{record:p,gatewayUrls:s})}catch(e){return null}}},737257,e=>{"use strict";e.s(["getEnsName",()=>s]);var t=e.i(3339),r=e.i(474984),n=e.i(623834),i=e.i(306925),a=e.i(24449),o=e.i(721200);async function s(e,s){let{address:l,blockNumber:c,blockTag:u,coinType:d=60n,gatewayUrls:p,strict:h}=s,{chain:f}=e,m=(()=>{if(s.universalResolverAddress)return s.universalResolverAddress;if(!f)throw Error("client chain not configured. universalResolverAddress is required.");return(0,r.getChainContractAddress)({blockNumber:c,chain:f,contract:"ensUniversalResolver"})})();try{let r={address:m,abi:t.universalResolverReverseAbi,args:[l,d,null!=p?p:[i.localBatchGatewayUrl]],functionName:"reverseWithGateways",blockNumber:c,blockTag:u},n=(0,a.getAction)(e,o.readContract,"readContract"),[s]=await n(r);return s||null}catch(e){if(h)throw e;if((0,n.isNullUniversalResolverError)(e))return null;throw e}}},142518,e=>{"use strict";e.s(["getEnsResolver",()=>o]);var t=e.i(474984),r=e.i(172804),n=e.i(535472),i=e.i(24449),a=e.i(721200);async function o(e,o){let{blockNumber:s,blockTag:l,name:c}=o,{chain:u}=e,d=(()=>{if(o.universalResolverAddress)return o.universalResolverAddress;if(!u)throw Error("client chain not configured. universalResolverAddress is required.");return(0,t.getChainContractAddress)({blockNumber:s,chain:u,contract:"ensUniversalResolver"})})(),p=null==u?void 0:u.ensTlds;if(p&&!p.some(e=>c.endsWith(e)))throw Error("".concat(c," is not a valid ENS TLD (").concat(null==p?void 0:p.join(", "),') for chain "').concat(u.name,'" (id: ').concat(u.id,")."));let[h]=await (0,i.getAction)(e,a.readContract,"readContract")({address:d,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[(0,r.toHex)((0,n.packetToBytes)(c))],blockNumber:s,blockTag:l});return h}},901467,e=>{"use strict";e.s(["createAccessList",()=>s]);var t=e.i(935999),r=e.i(172804),n=e.i(949944),i=e.i(191691),a=e.i(233596),o=e.i(98422);async function s(e,s){let{account:l=e.account,blockNumber:c,blockTag:u="latest",blobs:d,data:p,gas:h,gasPrice:f,maxFeePerBlobGas:m,maxFeePerGas:g,maxPriorityFeePerGas:v,to:C,value:y,...b}=s,w=l?(0,t.parseAccount)(l):void 0;try{var E,A,N;(0,o.assertRequest)(s);let t="bigint"==typeof c?(0,r.numberToHex)(c):void 0,n=null==(N=e.chain)||null==(A=N.formatters)||null==(E=A.transactionRequest)?void 0:E.format,l=(n||a.formatTransactionRequest)({...(0,i.extract)(b,{format:n}),from:null==w?void 0:w.address,blobs:d,data:p,gas:h,gasPrice:f,maxFeePerBlobGas:m,maxFeePerGas:g,maxPriorityFeePerGas:v,to:C,value:y}),T=await e.request({method:"eth_createAccessList",params:[l,t||u]});return{accessList:T.accessList,gasUsed:BigInt(T.gasUsed)}}catch(t){throw(0,n.getCallError)(t,{...s,account:w,chain:e.chain})}}},8775,e=>{"use strict";function t(e,t){var r,n;let{method:i}=t,a={};return"fallback"===e.transport.type&&(null==(r=(n=e.transport).onResponse)||r.call(n,e=>{let{method:t,response:r,status:n,transport:o}=e;"success"===n&&i===t&&(a[r]=o.request)})),t=>a[t]||e.request}e.s(["createFilterRequestScope",()=>t])},151239,e=>{"use strict";e.s(["createBlockFilter",()=>r]);var t=e.i(8775);async function r(e){let r=(0,t.createFilterRequestScope)(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:r(n),type:"block"}}},929065,e=>{"use strict";e.s(["FilterTypeNotSupportedError",()=>r]);var t=e.i(768366);class r extends t.BaseError{constructor(e){super('Filter type "'.concat(e,'" is not supported.'),{name:"FilterTypeNotSupportedError"})}}},855260,e=>{"use strict";e.s(["encodeEventTopics",()=>u]);var t=e.i(38176),r=e.i(929065),n=e.i(720289),i=e.i(244733),a=e.i(883188),o=e.i(630930),s=e.i(742e3),l=e.i(344574);let c="/docs/contract/encodeEventTopics";function u(e){let{abi:r,eventName:n,args:i}=e,o=r[0];if(n){let e=(0,l.getAbiItem)({abi:r,name:n});if(!e)throw new t.AbiEventNotFoundError(n,{docsPath:c});o=e}if("event"!==o.type)throw new t.AbiEventNotFoundError(void 0,{docsPath:c});let u=(0,s.formatAbiItem)(o),p=(0,a.toEventSelector)(u),h=[];
1if(i&&"inputs"in o){var f,m,g;let e=null==(f=o.inputs)?void 0:f.filter(e=>"indexed"in e&&e.indexed),t=Array.isArray(i)?i:Object.values(i).length>0&&null!=(m=null==e?void 0:e.map(e=>i[e.name]))?m:[];t.length>0&&(h=null!=(g=null==e?void 0:e.map((e,r)=>Array.isArray(t[r])?t[r].map((n,i)=>d({param:e,value:t[r][i]})):void 0!==t[r]&&null!==t[r]?d({param:e,value:t[r]}):null))?g:[])}return[p,...h]}function d(e){let{param:t,value:a}=e;if("string"===t.type||"bytes"===t.type)return(0,i.keccak256)((0,n.toBytes)(a));if("tuple"===t.type||t.type.match(/^(.*)\[(\d+)?\]$/))throw new r.FilterTypeNotSupportedError(t.type);return(0,o.encodeAbiParameters)([t],[a])}},410437,e=>{"use strict";e.s(["createContractEventFilter",()=>i]);var t=e.i(855260),r=e.i(172804),n=e.i(8775);async function i(e,i){let{address:a,abi:o,args:s,eventName:l,fromBlock:c,strict:u,toBlock:d}=i,p=(0,n.createFilterRequestScope)(e,{method:"eth_newFilter"}),h=l?(0,t.encodeEventTopics)({abi:o,args:s,eventName:l}):void 0,f=await e.request({method:"eth_newFilter",params:[{address:a,fromBlock:"bigint"==typeof c?(0,r.numberToHex)(c):c,toBlock:"bigint"==typeof d?(0,r.numberToHex)(d):d,topics:h}]});return{abi:o,args:s,eventName:l,id:f,request:p(f),strict:!!u,type:"event"}}},807769,e=>{"use strict";e.s(["createEventFilter",()=>i]);var t=e.i(855260),r=e.i(172804),n=e.i(8775);async function i(e){let{address:i,args:a,event:o,events:s,fromBlock:l,strict:c,toBlock:u}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=null!=s?s:o?[o]:void 0,p=(0,n.createFilterRequestScope)(e,{method:"eth_newFilter"}),h=[];d&&(h=[d.flatMap(e=>(0,t.encodeEventTopics)({abi:[e],eventName:e.name,args:a}))],o&&(h=h[0]));let f=await e.request({method:"eth_newFilter",params:[{address:i,fromBlock:"bigint"==typeof l?(0,r.numberToHex)(l):l,toBlock:"bigint"==typeof u?(0,r.numberToHex)(u):u,...h.length?{topics:h}:{}}]});return{abi:d,args:a,eventName:o?o.name:void 0,fromBlock:l,id:f,request:p(f),strict:!!c,toBlock:u,type:"event"}}},217437,e=>{"use strict";e.s(["createPendingTransactionFilter",()=>r]);var t=e.i(8775);async function r(e){let r=(0,t.createFilterRequestScope)(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:r(n),type:"transaction"}}},67940,e=>{"use strict";e.s(["publicKeyToAddress",()=>n]);var t=e.i(85721),r=e.i(244733);function n(e){let n=(0,r.keccak256)("0x".concat(e.substring(4))).substring(26);return(0,t.checksumAddress)("0x".concat(n))}},594576,e=>{"use strict";e.s(["recoverPublicKey",()=>a]);var t=e.i(158137),r=e.i(295150),n=e.i(627391),i=e.i(172804);async function a(a){let{hash:s,signature:l}=a,c=(0,t.isHex)(s)?s:(0,i.toHex)(s),{secp256k1:u}=await e.A(313886),d=(()=>{if("object"==typeof l&&"r"in l&&"s"in l){let{r:e,s:t,v:r,yParity:i}=l,a=o(Number(null!=i?i:r));return new u.Signature((0,n.hexToBigInt)(e),(0,n.hexToBigInt)(t)).addRecoveryBit(a)}let e=(0,t.isHex)(l)?l:(0,i.toHex)(l);if(65!==(0,r.size)(e))throw Error("invalid signature length");let a=o((0,n.hexToNumber)("0x".concat(e.slice(130))));return u.Signature.fromCompact(e.substring(2,130)).addRecoveryBit(a)})().recoverPublicKey(c.substring(2)).toHex(!1);return"0x".concat(d)}function o(e){if(0===e||1===e)return e;if(27===e)return 0;if(28===e)return 1;throw Error("Invalid yParityOrV value")}},287129,e=>{"use strict";e.s(["recoverAddress",()=>n]);var t=e.i(67940),r=e.i(594576);async function n(e){let{hash:n,signature:i}=e;return(0,t.publicKeyToAddress)(await (0,r.recoverPublicKey)({hash:n,signature:i}))}},234496,e=>{"use strict";e.s(["toRlp",()=>a]);var t=e.i(768366),r=e.i(413160),n=e.i(720289),i=e.i(172804);function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hex",a=function e(t){return Array.isArray(t)?function(e){let t=e.reduce((e,t)=>e+t.length,0),r=o(t);return{length:t<=55?1+t:1+r+t,encode(n){for(let{encode:i}of(t<=55?n.pushByte(192+t):(n.pushByte(247+r),1===r?n.pushUint8(t):2===r?n.pushUint16(t):3===r?n.pushUint24(t):n.pushUint32(t)),e))i(n)}}}(t.map(t=>e(t))):function(e){let t="string"==typeof e?(0,n.hexToBytes)(e):e,r=o(t.length);return{length:1===t.length&&t[0]<128?1:t.length<=55?1+t.length:1+r+t.length,encode(e){1===t.length&&t[0]<128||(t.length<=55?e.pushByte(128+t.length):(e.pushByte(183+r),1===r?e.pushUint8(t.length):2===r?e.pushUint16(t.length):3===r?e.pushUint24(t.length):e.pushUint32(t.length))),e.pushBytes(t)}}}(t)}(e),s=(0,r.createCursor)(new Uint8Array(a.length));return(a.encode(s),"hex"===t)?(0,i.bytesToHex)(s.bytes):s.bytes}function o(e){if(e<256)return 1;if(e<65536)return 2;if(e<0x1000000)return 3;if(e<0x100000000)return 4;throw new t.BaseError("Length is too large.")}},325268,e=>{"use strict";e.s(["hashAuthorization",()=>o]);var t=e.i(179926),r=e.i(720289),n=e.i(172804),i=e.i(234496),a=e.i(244733);function o(e){var o;let{chainId:s,nonce:l,to:c}=e,u=null!=(o=e.contractAddress)?o:e.address,d=(0,a.keccak256)((0,t.concatHex)(["0x05",(0,i.toRlp)([s?(0,n.numberToHex)(s):"0x",u,l?(0,n.numberToHex)(l):"0x"])]));return"bytes"===c?(0,r.hexToBytes)(d):d}},404436,e=>{"use strict";e.s(["recoverAuthorizationAddress",()=>n]);var t=e.i(287129),r=e.i(325268);async function n(e){let{authorization:n,signature:i}=e;return(0,t.recoverAddress)({hash:(0,r.hashAuthorization)(n),signature:null!=i?i:n})}},214061,e=>{"use strict";e.s(["EstimateGasExecutionError",()=>
1a]);var t=e.i(338266),r=e.i(797163),n=e.i(768366),i=e.i(317907);class a extends n.BaseError{constructor(e,{account:n,docsPath:a,chain:o,data:s,gas:l,gasPrice:c,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:p,to:h,value:f}){var m;super(e.shortMessage,{cause:e,docsPath:a,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",(0,i.prettyPrint)({from:null==n?void 0:n.address,to:h,value:void 0!==f&&"".concat((0,t.formatEther)(f)," ").concat((null==o||null==(m=o.nativeCurrency)?void 0:m.symbol)||"ETH"),data:s,gas:l,gasPrice:void 0!==c&&"".concat((0,r.formatGwei)(c)," gwei"),maxFeePerGas:void 0!==u&&"".concat((0,r.formatGwei)(u)," gwei"),maxPriorityFeePerGas:void 0!==d&&"".concat((0,r.formatGwei)(d)," gwei"),nonce:p})].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}},859794,e=>{"use strict";e.s(["getEstimateGasError",()=>i]);var t=e.i(214061),r=e.i(453650),n=e.i(908336);function i(e,i){let{docsPath:a,...o}=i,s=(()=>{let t=(0,n.getNodeError)(e,o);return t instanceof r.UnknownNodeError?e:t})();return new t.EstimateGasExecutionError(s,{docsPath:a,...o})}},155390,e=>{"use strict";e.s(["BaseFeeScalarError",()=>n,"Eip1559FeesNotSupportedError",()=>i,"MaxFeePerGasTooLowError",()=>a]);var t=e.i(797163),r=e.i(768366);class n extends r.BaseError{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class i extends r.BaseError{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class a extends r.BaseError{constructor({maxPriorityFeePerGas:e}){super("`maxFeePerGas` cannot be less than the `maxPriorityFeePerGas` (".concat((0,t.formatGwei)(e)," gwei)."),{name:"MaxFeePerGasTooLowError"})}}},819374,e=>{"use strict";e.s(["BlockNotFoundError",()=>r]);var t=e.i(768366);class r extends t.BaseError{constructor({blockHash:e,blockNumber:t}){let r="Block";e&&(r='Block at hash "'.concat(e,'"')),t&&(r='Block at number "'.concat(t,'"')),super("".concat(r," could not be found."),{name:"BlockNotFoundError"})}}},50380,e=>{"use strict";e.s(["formatTransaction",()=>n,"transactionType",()=>r]);var t=e.i(627391);e.i(967168);let r={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function n(e){let n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?(0,t.hexToNumber)(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?(0,t.hexToNumber)(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?r[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=e.authorizationList.map(e=>({address:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)}))),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if("bigint"==typeof n.v){if(0n===n.v||27n===n.v)return 0;if(1n===n.v||28n===n.v)return 1;if(n.v>=35n)return+(n.v%2n===0n)}})(),"legacy"===n.type&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),"eip2930"===n.type&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),"eip1559"===n.type&&delete n.maxFeePerBlobGas,n}},738621,e=>{"use strict";e.s(["formatBlock",()=>r]),e.i(967168);var t=e.i(50380);function r(e){var r;let n=(null!=(r=e.transactions)?r:[]).map(e=>"string"==typeof e?e:(0,t.formatTransaction)(e));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLim
1it?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}},357007,e=>{"use strict";e.s(["getBlock",()=>a]);var t,r=e.i(819374),n=e.i(172804),i=e.i(738621);async function a(e){var a,o,s;let{blockHash:l,blockNumber:c,blockTag:u=null!=(t=e.experimental_blockTag)?t:"latest",includeTransactions:d}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},p=null!=d&&d,h=void 0!==c?(0,n.numberToHex)(c):void 0,f=null;if(!(f=l?await e.request({method:"eth_getBlockByHash",params:[l,p]},{dedupe:!0}):await e.request({method:"eth_getBlockByNumber",params:[h||u,p]},{dedupe:!!h})))throw new r.BlockNotFoundError({blockHash:l,blockNumber:c});return((null==(s=e.chain)||null==(o=s.formatters)||null==(a=o.block)?void 0:a.format)||i.formatBlock)(f)}},778036,e=>{"use strict";async function t(e){return BigInt(await e.request({method:"eth_gasPrice"}))}e.s(["getGasPrice",()=>t])},686269,e=>{"use strict";e.s(["estimateMaxPriorityFeePerGas",()=>o,"internal_estimateMaxPriorityFeePerGas",()=>s]);var t=e.i(155390),r=e.i(627391),n=e.i(24449),i=e.i(357007),a=e.i(778036);async function o(e,t){return s(e,t)}async function s(e,o){let{block:s,chain:l=e.chain,request:c}=o||{};try{var u,d,p;let t=null!=(p=null==l||null==(u=l.fees)?void 0:u.maxPriorityFeePerGas)?p:null==l||null==(d=l.fees)?void 0:d.defaultPriorityFee;if("function"==typeof t){let r=s||await (0,n.getAction)(e,i.getBlock,"getBlock")({}),a=await t({block:r,client:e,request:c});if(null===a)throw Error();return a}if(void 0!==t)return t;let a=await e.request({method:"eth_maxPriorityFeePerGas"});return(0,r.hexToBigInt)(a)}catch(c){let[r,o]=await Promise.all([s?Promise.resolve(s):(0,n.getAction)(e,i.getBlock,"getBlock")({}),(0,n.getAction)(e,a.getGasPrice,"getGasPrice")({})]);if("bigint"!=typeof r.baseFeePerGas)throw new t.Eip1559FeesNotSupportedError;let l=o-r.baseFeePerGas;if(l<0n)return 0n;return l}}},715798,e=>{"use strict";e.s(["estimateFeesPerGas",()=>o,"internal_estimateFeesPerGas",()=>s]);var t=e.i(155390),r=e.i(24449),n=e.i(686269),i=e.i(357007),a=e.i(778036);async function o(e,t){return s(e,t)}async function s(e,o){var s,l,c,u,d;let{block:p,chain:h=e.chain,request:f,type:m="eip1559"}=o||{},g=await (async()=>{var t,r,n;return"function"==typeof(null==h||null==(t=h.fees)?void 0:t.baseFeeMultiplier)?h.fees.baseFeeMultiplier({block:p,client:e,request:f}):null!=(n=null==h||null==(r=h.fees)?void 0:r.baseFeeMultiplier)?n:1.2})();if(g<1)throw new t.BaseFeeScalarError;let v=null!=(c=null==(s=g.toString().split(".")[1])?void 0:s.length)?c:0,C=10**v,y=e=>e*BigInt(Math.ceil(g*C))/BigInt(C),b=p||await (0,r.getAction)(e,i.getBlock,"getBlock")({});if("function"==typeof(null==h||null==(l=h.fees)?void 0:l.estimateFeesPerGas)){let t=await h.fees.estimateFeesPerGas({block:p,client:e,multiply:y,request:f,type:m});if(null!==t)return t}if("eip1559"===m){if("bigint"!=typeof b.baseFeePerGas)throw new t.Eip1559FeesNotSupportedError;let r="bigint"==typeof(null==f?void 0:f.maxPriorityFeePerGas)?f.maxPriorityFeePerGas:await (0,n.internal_estimateMaxPriorityFeePerGas)(e,{block:b,chain:h,request:f}),i=y(b.baseFeePerGas);return{maxFeePerGas:null!=(u=null==f?void 0:f.maxFeePerGas)?u:i+r,maxPriorityFeePerGas:r}}return{gasPrice:null!=(d=null==f?void 0:f.gasPrice)?d:y(await (0,r.getAction)(e,a.getGasPrice,"getGasPrice")({}))}}},411606,e=>{"use strict";e.s(["getTransactionCount",()=>n]);var t=e.i(627391),r=e.i(172804);async function n(e,n){let{address:i,blockTag:a="latest",blockNumber:o}=n,s=await e.request({method:"eth_getTransactionCount",params:[i,"bigint"==typeof o?(0,r.numberToHex)(o):a]},{dedupe:!!o});return(0,t.hexToNumber)(s)}},58568,e=>{"use strict";e.s(["blobsToCommitments",()=>n]);var t=e.i(720289),r=e.i(172804);function n(e){var n;let{kzg:i}=e,a=null!=(n=e.to)?n:"string"==typeof e.blobs[0]?"hex":"bytes",o="string"==typeof e.blobs[0]?e.blobs.map(e=>(0,t.hexToBytes)(e)):e.blobs,s=[];for(let e of o)s.push(Uint8Array.from(i.blobToKzgCommitment(e)));return"bytes"===a?s:s.map(e=>(0,r.bytesToHex)(e))}},883053,e=>{"use strict";e.s(["blobsToProofs",()=>n]);var t=e.i(720289),r=e.i(172804);function n(e){var n;let{kzg:i}
1=e,a=null!=(n=e.to)?n:"string"==typeof e.blobs[0]?"hex":"bytes",o="string"==typeof e.blobs[0]?e.blobs.map(e=>(0,t.hexToBytes)(e)):e.blobs,s="string"==typeof e.commitments[0]?e.commitments.map(e=>(0,t.hexToBytes)(e)):e.commitments,l=[];for(let e=0;e<o.length;e++){let t=o[e],r=s[e];l.push(Uint8Array.from(i.computeBlobKzgProof(t,r)))}return"bytes"===a?l:l.map(e=>(0,r.bytesToHex)(e))}},241840,e=>{"use strict";e.s(["sha256",()=>a]);var t=e.i(403893),r=e.i(158137),n=e.i(720289),i=e.i(172804);function a(e,a){let o=(0,t.sha256)((0,r.isHex)(e,{strict:!1})?(0,n.toBytes)(e):e);return"bytes"===(a||"hex")?o:(0,i.toHex)(o)}},216593,e=>{"use strict";e.s(["commitmentToVersionedHash",()=>n]);var t=e.i(172804),r=e.i(241840);function n(e){var n;let{commitment:i,version:a=1}=e,o=null!=(n=e.to)?n:"string"==typeof i?"hex":"bytes",s=(0,r.sha256)(i,"bytes");return s.set([a],0),"bytes"===o?s:(0,t.bytesToHex)(s)}},973580,e=>{"use strict";e.s(["commitmentsToVersionedHashes",()=>r]);var t=e.i(216593);function r(e){var r;let{commitments:n,version:i}=e,a=null!=(r=e.to)?r:"string"==typeof n[0]?"hex":"bytes",o=[];for(let e of n)o.push((0,t.commitmentToVersionedHash)({commitment:e,to:a,version:i}));return o}},785969,e=>{"use strict";e.s(["bytesPerBlob",()=>n,"bytesPerFieldElement",()=>t,"fieldElementsPerBlob",()=>r,"maxBytesPerTransaction",()=>i]);let t=32,r=4096,n=131072,i=761855},74164,e=>{"use strict";e.s(["versionedHashVersionKzg",()=>t]);let t=1},305641,e=>{"use strict";e.s(["BlobSizeTooLargeError",()=>r,"EmptyBlobError",()=>n]),e.i(74164);var t=e.i(768366);class r extends t.BaseError{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:["Max: ".concat(e," bytes"),"Given: ".concat(t," bytes")],name:"BlobSizeTooLargeError"})}}class n extends t.BaseError{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}t.BaseError,t.BaseError},329131,e=>{"use strict";e.s(["toBlobs",()=>s]);var t=e.i(785969),r=e.i(305641),n=e.i(413160),i=e.i(295150),a=e.i(720289),o=e.i(172804);function s(e){var s;let l=null!=(s=e.to)?s:"string"==typeof e.data?"hex":"bytes",c="string"==typeof e.data?(0,a.hexToBytes)(e.data):e.data,u=(0,i.size)(c);if(!u)throw new r.EmptyBlobError;if(u>t.maxBytesPerTransaction)throw new r.BlobSizeTooLargeError({maxSize:t.maxBytesPerTransaction,size:u});let d=[],p=!0,h=0;for(;p;){let e=(0,n.createCursor)(new Uint8Array(t.bytesPerBlob)),r=0;for(;r<t.fieldElementsPerBlob;){let n=c.slice(h,h+(t.bytesPerFieldElement-1));if(e.pushByte(0),e.pushBytes(n),n.length<31){e.pushByte(128),p=!1;break}r++,h+=31}d.push(e)}return"bytes"===l?d.map(e=>e.bytes):d.map(e=>(0,o.bytesToHex)(e.bytes))}},340967,e=>{"use strict";e.s(["toBlobSidecars",()=>i]);var t=e.i(58568),r=e.i(883053),n=e.i(329131);function i(e){var i,a,o;let{data:s,kzg:l,to:c}=e,u=null!=(i=e.blobs)?i:(0,n.toBlobs)({data:s,to:c}),d=null!=(a=e.commitments)?a:(0,t.blobsToCommitments)({blobs:u,kzg:l,to:c}),p=null!=(o=e.proofs)?o:(0,r.blobsToProofs)({blobs:u,commitments:d,kzg:l,to:c}),h=[];for(let e=0;e<u.length;e++)h.push({blob:u[e],commitment:d[e],proof:p[e]});return h}},155917,e=>{"use strict";e.s(["getTransactionType",()=>r]);var t=e.i(317907);function r(e){if(e.type)return e.type;if(void 0!==e.authorizationList)return"eip7702";if(void 0!==e.blobs||void 0!==e.blobVersionedHashes||void 0!==e.maxFeePerBlobGas||void 0!==e.sidecars)return"eip4844";if(void 0!==e.maxFeePerGas||void 0!==e.maxPriorityFeePerGas)return"eip1559";if(void 0!==e.gasPrice)return void 0!==e.accessList?"eip2930":"legacy";throw new t.InvalidSerializableTransactionError({transaction:e})}},942573,e=>{"use strict";e.s(["getChainId",()=>r]);var t=e.i(627391);async function r(e){let r=await e.request({method:"eth_chainId"},{dedupe:!0});return(0,t.hexToNumber)(r)}},276130,e=>{"use strict";e.s(["prepareTransactionRequest",()=>v]);var t=e.i(935999),r=e.i(715798),n=e.i(277997),i=e.i(357007),a=e.i(411606),o=e.i(155390),s=e.i(58568),l=e.i(883053),c=e.i(973580),u=e.i(340967),d=e.i(24449),p=e.i(98422),h=e.i(155917),f=e.i(942573);let m=["blobVersionedHashes","chainId","fees","gas","nonce","type"],g=new Map;async function v(e,v){let C,y,{account:b=e.account,blobs:w,chain:E,gas:A,kzg:N,nonce:T,nonceManager:I,parameters:P=m,type:k}=v,U=b?(0,t.parseAccount)(b):b,S={...v,...U?{from:null==U?void 0:U.address}:{}};async function R(){return C||(C=await (0,d.getAction)(e,i.getBlock,"getBlock")({blockTag:"latest"}))}async function x(){return y||(E?E.id:void 0!==v.chainId?v.chainId:y=await (0,d.getAction)(e,f.getChainId,"getChainId")({}))}if(P.includes("nonce")&&void 0===T&&U)if(I){let t=await x();S.nonce=await I.consume({address:U.address,chainId:t,client:e})}else S.nonce=await (0,d.getAction)(e,a.getTransactionCount,"getTransactionCount")({address:U.address,blockTag:"pending"});if((P.includes("blobVersionedHashes")||P.includes("sidecars"))&&w&&N){let e=(0,s.blobsToCommitments)({blobs:w,kzg:N});if(P.includes("blobVersionedHashes")&&(S.blobVersionedHashes=(0,c.commitmentsToVersionedHashes)({commitments:e,to:"hex"})),P.includes("sidecars")){let t=(0,l.blobsToProofs)({blobs:w,commitments:e,kzg:N});S.sidecars=(0,u.toBlobSidecars)({blobs:w,commitments:e,proofs:t,to:"hex"})}}if(P.includes("chainId")&&(S.chainId=await x()),(P.includes("fees")||P.includes("type"))&&void 0===k)try{S.type=(0,h.getTransactionType)(S)}catch(r){let t=g.get(e.uid);if(void 0===t){let r=await R();t="bigint"==typeof(null==r?void 0:r.baseFeePerGas),g.set(e.uid,t)}S.type=t?"eip1559":"legacy"}if(P.includes("fees"))if("legacy"!==S.type&&"eip2930"!==S.type){if(void 0===S.maxFeePerGas||void 0===S.maxPriorityFeePerGas){let t=await R(),{maxFeePerGas:n,maxPriorityFeePerGas:i}=await (0,r.internal_estimateFeesPerGas)(e,{block:t,chain:E,request:S});if(void 0===v.maxPriorityFeePerGas&&v.maxFeePerGas&&v.maxFeePerGas<i)throw new o.MaxFeePerGasTooLowError({maxPriorityFeePerGas:i});S.maxPriorityFeePerGas=i,S.maxFeePerGas=n}}else{if(void 0!==v.maxFeePerGas||void 0!==v.maxPriorityFeePerGas)throw new o.Eip1559FeesNotSupportedError;if(void 0===v.gasPrice){let t=await R(),{gasPrice:n}=await (0,r.internal_estimateFeesPerGas)(e,{block:t,chain:E,request:S,type:"legacy"});S.gasPrice=n}}return P.includes("gas")&&void 0===A&&(S.gas=await (0,d.getAction)(e,n.estimateGas,"estimateGas")({...S,account:U?{address:U.address,type:"json-rpc"}:U})),(0,p.assertRequest)(S),delete S.parameters,S}},277997,e=>{"use strict";e.s(["estimateGas",()=>d]);var t=e.i(935999),r=e.i(768366),n=e.i(404436),i=e.i(172804),a=e.i(859794),o=e.i(191691),s=e.i(233596),l=e.i(867012),c=e.i(98422),u=e.i(276130);async function d(e,d){let{account:p=e.account}=d,h=p?(0,t.parseAccount)(p):void 0;try{var f,m,g,v;let{accessList:t,authorizationList:a,blobs:p,blobVersionedHashes:C,blockNumber:y,blockTag:b,data:w,gas:E,gasPrice:A,maxFeePerBlobGas:N,maxFeePerGas:T,maxPriorityFeePerGas:I,nonce:P,value:k,stateOverride:U,...S}=await (0,u.prepareTransactionRequest)(e,{...d,parameters:(null==h?void 0:h.type)==="local"?void 0:["blobVersionedHashes"]}),R=("bigint"==typeof y?(0,i.numberToHex)(y):void 0)||b,x=(0,l.serializeStateOverride)(U),O=await (async()=>S.to?S.to:a&&a.length>0?await (0,n.recoverAuthorizationAddress)({authorization:a[0]}).catch(()=>{throw new r.BaseError("`to` is required. Could not infer from `authorizationList`")}):void 0)();(0,c.assertRequest)(d);
1let B=null==(g=e.chain)||null==(m=g.formatters)||null==(f=m.transactionRequest)?void 0:f.format,F=(B||s.formatTransactionRequest)({...(0,o.extract)(S,{format:B}),from:null==h?void 0:h.address,accessList:t,authorizationList:a,blobs:p,blobVersionedHashes:C,data:w,gas:E,gasPrice:A,maxFeePerBlobGas:N,maxFeePerGas:T,maxPriorityFeePerGas:I,nonce:P,to:O,value:k});return BigInt(await e.request({method:"eth_estimateGas",params:x?[F,null!=(v=null!=R?R:e.experimental_blockTag)?v:"latest",x]:R?[F,R]:[F]}))}catch(t){throw(0,a.getEstimateGasError)(t,{...d,account:h,chain:e.chain})}}},968980,e=>{"use strict";e.s(["estimateContractGas",()=>o]);var t=e.i(935999),r=e.i(254712),n=e.i(574041),i=e.i(24449),a=e.i(277997);async function o(e,o){let{abi:s,address:l,args:c,functionName:u,dataSuffix:d,...p}=o,h=(0,r.encodeFunctionData)({abi:s,args:c,functionName:u});try{return await (0,i.getAction)(e,a.estimateGas,"estimateGas")({data:"".concat(h).concat(d?d.replace("0x",""):""),to:l,...p})}catch(r){let e=p.account?(0,t.parseAccount)(p.account):void 0;throw(0,n.getContractError)(r,{abi:s,address:l,args:c,docsPath:"/docs/contract/estimateContractGas",functionName:u,sender:null==e?void 0:e.address})}}},236599,e=>{"use strict";e.s(["getBalance",()=>n]);var t,r=e.i(172804);async function n(e,n){let{address:i,blockNumber:a,blockTag:o=null!=(t=e.experimental_blockTag)?t:"latest"}=n,s="bigint"==typeof a?(0,r.numberToHex)(a):void 0;return BigInt(await e.request({method:"eth_getBalance",params:[i,s||o]}))}},157166,e=>{"use strict";async function t(e){return BigInt(await e.request({method:"eth_blobBaseFee"}))}e.s(["getBlobBaseFee",()=>t])},192678,e=>{"use strict";e.s(["getCache",()=>n,"withCache",()=>i]);let t=new Map,r=new Map;function n(e){let n=(e,t)=>({clear:()=>t.delete(e),get:()=>t.get(e),set:r=>t.set(e,r)}),i=n(e,t),a=n(e,r);return{clear:()=>{i.clear(),a.clear()},promise:i,response:a}}async function i(e,t){let{cacheKey:r,cacheTime:i=1/0}=t,a=n(r),o=a.response.get();if(o&&i>0&&Date.now()-o.created.getTime()<i)return o.data;let s=a.promise.get();s||(s=e(),a.promise.set(s));try{let e=await s;return a.response.set({created:new Date,data:e}),e}finally{a.promise.clear()}}},330974,e=>{"use strict";e.s(["getBlockNumber",()=>r]);var t=e.i(192678);async function r(e){let r,{cacheTime:n=e.cacheTime}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return BigInt(await (0,t.withCache)(()=>e.request({method:"eth_blockNumber"}),{cacheKey:(r=e.uid,"blockNumber.".concat(r)),cacheTime:n}))}},344223,e=>{"use strict";e.s(["getBlockTransactionCount",()=>n]);var t=e.i(627391),r=e.i(172804);async function n(e){let n,{blockHash:i,blockNumber:a,blockTag:o="latest"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=void 0!==a?(0,r.numberToHex)(a):void 0;return n=i?await e.request({method:"eth_getBlockTransactionCountByHash",params:[i]},{dedupe:!0}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||o]},{dedupe:!!s}),(0,t.hexToNumber)(n)}},898089,e=>{"use strict";e.s(["getCode",()=>r]);var t=e.i(172804);async function r(e,r){let{address:n,blockNumber:i,blockTag:a="latest"}=r,o=void 0!==i?(0,t.numberToHex)(i):void 0,s=await e.request({method:"eth_getCode",params:[n,o||a]},{dedupe:!!o});if("0x"!==s)return s}},748603,e=>{"use strict";e.s(["decodeEventLog",()=>l]);var t=e.i(38176),r=e.i(42786),n=e.i(295150),i=e.i(883188),a=e.i(812909),o=e.i(742e3);let s="/docs/contract/decodeEventLog";function l(e){let{abi:l,data:c,strict:u,topics:d}=e,p=null==u||u,[h,...f]=d;if(!h)throw new t.AbiEventSignatureEmptyTopicsError({docsPath:s});let m=l.find(e=>"event"===e.type&&h===(0,i.toEventSelector)((0,o.formatAbiItem)(e)));if(!(m&&"name"in m)||"event"!==m.type)throw new t.AbiEventSignatureNotFoundError(h,{docsPath:s});let{name:g,inputs:v}=m,C=null==v?void 0:v.some(e=>!("name"in e&&e.name)),y=C?[]:{},b=v.map((e,t)=>[e,t]).filter(e=>{let[t]=e;return"indexed"in t&&t.indexed});for(let e=0;e<b.length;e++){let[r,n]=b[e],i=f[e];if(!i)throw new t.DecodeLogTopicsMismatch({abiItem:m,param:r});y[C?n:r.name||n]=function(e){let{param:t,value:r}=e;return"string"===t.type||"bytes"===t.type||"tuple"===t.type||t.type.match(/^(.*)\[(\d+)?\]$/)?r:((0,a.decodeAbiParameters)([t],r)||[])[0]}({param:r,value:i})}let w=v.filter(e=>
1!("indexed"in e&&e.indexed));if(w.length>0){if(c&&"0x"!==c)try{let e=(0,a.decodeAbiParameters)(w,c);if(e){var E;if(C)for(let t=0;t<v.length;t++)y[t]=null!=(E=y[t])?E:e.shift();else for(let t=0;t<w.length;t++)y[w[t].name]=e[t]}}catch(e){if(p){if(e instanceof t.AbiDecodingDataSizeTooSmallError||e instanceof r.PositionOutOfBoundsError)throw new t.DecodeLogDataMismatch({abiItem:m,data:c,params:w,size:(0,n.size)(c)});throw e}}else if(p)throw new t.DecodeLogDataMismatch({abiItem:m,data:"0x",params:w,size:0})}return{eventName:g,args:Object.values(y).length>0?y:void 0}}},219901,e=>{"use strict";e.s(["parseEventLogs",()=>s]);var t=e.i(38176),r=e.i(798972),n=e.i(720289),i=e.i(244733),a=e.i(883188),o=e.i(748603);function s(e){let{abi:s,args:l,logs:c,strict:u=!0}=e,d=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return c.map(e=>{try{let t=s.find(t=>"event"===t.type&&e.topics[0]===(0,a.toEventSelector)(t));if(!t)return null;let c=(0,o.decodeEventLog)({...e,abi:[t],strict:u});if(d&&!d.includes(c.eventName)||!function(e){let{args:t,inputs:a,matchArgs:o}=e;if(!o)return!0;if(!t)return!1;function s(e,t,a){try{if("address"===e.type)return(0,r.isAddressEqual)(t,a);if("string"===e.type||"bytes"===e.type)return(0,i.keccak256)((0,n.toBytes)(t))===a;return t===a}catch(e){return!1}}return Array.isArray(t)&&Array.isArray(o)?o.every((e,r)=>{if(null==e)return!0;let n=a[r];return!!n&&(Array.isArray(e)?e:[e]).some(e=>s(n,e,t[r]))}):!("object"!=typeof t||Array.isArray(t)||"object"!=typeof o||Array.isArray(o))&&Object.entries(o).every(e=>{let[r,n]=e;if(null==n)return!0;let i=a.find(e=>e.name===r);return!!i&&(Array.isArray(n)?n:[n]).some(e=>s(i,e,t[r]))})}({args:c.args,inputs:t.inputs,matchArgs:l}))return null;return{...c,...e}}catch(i){let r,n;if(i instanceof t.AbiEventSignatureNotFoundError)return null;if(i instanceof t.DecodeLogDataMismatch||i instanceof t.DecodeLogTopicsMismatch){var c;if(u)return null;r=i.abiItem.name,n=null==(c=i.abiItem.inputs)?void 0:c.some(e=>!("name"in e&&e.name))}return{...e,args:n?[]:{},eventName:r}}}).filter(Boolean)}},143113,e=>{"use strict";function t(e){let{args:t,eventName:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...r?{args:t,eventName:r}:{}}}e.s(["formatLog",()=>t])},211758,e=>{"use strict";e.s(["getLogs",()=>a]);var t=e.i(855260),r=e.i(219901),n=e.i(172804),i=e.i(143113);async function a(e){let{address:a,blockHash:o,fromBlock:s,toBlock:l,event:c,events:u,args:d,strict:p}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},h=null!=u?u:c?[c]:void 0,f=[];h&&(f=[h.flatMap(e=>(0,t.encodeEventTopics)({abi:[e],eventName:e.name,args:u?void 0:d}))],c&&(f=f[0]));let m=(o?await e.request({method:"eth_getLogs",params:[{address:a,topics:f,blockHash:o}]}):await e.request({method:"eth_getLogs",params:[{address:a,topics:f,fromBlock:"bigint"==typeof s?(0,n.numberToHex)(s):s,toBlock:"bigint"==typeof l?(0,n.numberToHex)(l):l}]})).map(e=>(0,i.formatLog)(e));return h?(0,r.parseEventLogs)({abi:h,args:d,logs:m,strict:null!=p&&p}):m}},647998,e=>{"use strict";e.s(["getContractEvents",()=>i]);var t=e.i(344574),r=e.i(24449),n=e.i(211758);async function i(e,i){let{abi:a,address:o,args:s,blockHash:l,eventName:c,fromBlock:u,toBlock:d,strict:p}=i,h=c?(0,t.getAbiItem)({abi:a,name:c}):void 0,f=h?void 0:a.filter(e=>"event"===e.type);return(0,r.getAction)(e,n.getLogs,"getLogs")({address:o,args:s,blockHash:l,event:h,events:f,fromBlock:u,toBlock:d,strict:p})}},582011,e=>{"use strict";e.s(["Eip712DomainNotFoundError",()=>r]);var t=e.i(768366);class r extends t.BaseError{constructor({address:e}){super('No EIP-712 domain found on contract "'.concat(e,'".'),{metaMessages:["Ensure that:",'- The contract is deployed at the address "'.concat(e,'".'),"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}},450496,e=>{"use strict";e.s(["getEip712Domain",()=>i]);var t=e.i(582011),r=e.i(24449),n=e.i(721200);async function i(e,i){let{address:o,factory:s,factoryData:l}=i;try{let[t,i,c,u,d,p,h]=await (0,r.getAction)(e,n.readContract,"readContract")({abi:a,address:o,functionName:"eip712Domain",factory:s,factoryData:l});return{domain:{name:i,version:c,chainId:Number(u),verifyingContract:d,salt:p},extensions:h,fields:t}}catch(e){if("ContractFunctionExecutionError"===e.name&&"ContractFunctionZeroDataError"===e.cause.name)throw new t.Eip712DomainNotFoundError({address:o});throw e}}let a=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}]},397184,e=>{"use strict";function t(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(e=>BigInt(e)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.olde
1stBlock),reward:null==(t=e.reward)?void 0:t.map(e=>e.map(e=>BigInt(e)))}}e.s(["formatFeeHistory",()=>t])},912032,e=>{"use strict";e.s(["getFeeHistory",()=>n]);var t=e.i(172804),r=e.i(397184);async function n(e,n){let{blockCount:i,blockNumber:a,blockTag:o="latest",rewardPercentiles:s}=n,l="bigint"==typeof a?(0,t.numberToHex)(a):void 0,c=await e.request({method:"eth_feeHistory",params:[(0,t.numberToHex)(i),l||o,s]},{dedupe:!!l});return(0,r.formatFeeHistory)(c)}},348578,e=>{"use strict";e.s(["getFilterChanges",()=>n]);var t=e.i(219901),r=e.i(143113);async function n(e,n){let{filter:i}=n,a="strict"in i&&i.strict,o=await i.request({method:"eth_getFilterChanges",params:[i.id]});if("string"==typeof o[0])return o;let s=o.map(e=>(0,r.formatLog)(e));return"abi"in i&&i.abi?(0,t.parseEventLogs)({abi:i.abi,logs:s,strict:a}):s}},491076,e=>{"use strict";e.s(["getFilterLogs",()=>n]);var t=e.i(219901),r=e.i(143113);async function n(e,n){var i;let{filter:a}=n,o=null!=(i=a.strict)&&i,s=(await a.request({method:"eth_getFilterLogs",params:[a.id]})).map(e=>(0,r.formatLog)(e));return a.abi?(0,t.parseEventLogs)({abi:a.abi,logs:s,strict:o}):s}},922054,e=>{"use strict";e.s(["formatProof",()=>r]);var t=e.i(627391);function r(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?(0,t.hexToNumber)(e.nonce):void 0,storageProof:e.storageProof?e.storageProof.map(e=>({...e,value:BigInt(e.value)})):void 0}}},611012,e=>{"use strict";e.s(["getProof",()=>n]);var t=e.i(172804),r=e.i(922054);async function n(e,n){let{address:i,blockNumber:a,blockTag:o,storageKeys:s}=n,l=void 0!==a?(0,t.numberToHex)(a):void 0,c=await e.request({method:"eth_getProof",params:[i,s,l||(null!=o?o:"latest")]});return(0,r.formatProof)(c)}},874127,e=>{"use strict";e.s(["getStorageAt",()=>r]);var t=e.i(172804);async function r(e,r){let{address:n,blockNumber:i,blockTag:a="latest",slot:o}=r,s=void 0!==i?(0,t.numberToHex)(i):void 0;return await e.request({method:"eth_getStorageAt",params:[n,o,s||a]})}},409210,e=>{"use strict";e.s(["getTransaction",()=>i]);var t=e.i(317907),r=e.i(172804),n=e.i(50380);async function i(e,i){var a,o,s;let{blockHash:l,blockNumber:c,blockTag:u,hash:d,index:p}=i,h=u||"latest",f=void 0!==c?(0,r.numberToHex)(c):void 0,m=null;if(!(m=d?await e.request({method:"eth_getTransactionByHash",params:[d]},{dedupe:!0}):l?await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[l,(0,r.numberToHex)(p)]},{dedupe:!0}):await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[f||h,(0,r.numberToHex)(p)]},{dedupe:!!f})))throw new t.TransactionNotFoundError({blockHash:l,blockNumber:c,blockTag:h,hash:d,index:p});return((null==(s=e.chain)||null==(o=s.formatters)||null==(a=o.transaction)?void 0:a.format)||n.formatTransaction)(m)}},590354,e=>{"use strict";e.s(["getTransactionConfirmations",()=>i]);var t=e.i(24449),r=e.i(330974),n=e.i(409210);async function i(e,i){let{hash:a,transactionReceipt:o}=i,[s,l]=await Promise.all([(0,t.getAction)(e,r.getBlockNumber,"getBlockNumber")({}),a?(0,t.getAction)(e,n.getTransaction,"getTransaction")({hash:a}):void 0]),c=(null==o?void 0:o.blockNumber)||(null==l?void 0:l.blockNumber);return c?s-c+1n:0n}},972346,e=>{"use strict";e.s(["formatTransactionReceipt",()=>a]);var t=e.i(627391);e.i(967168);var r=e.i(143113),n=e.i(50380);let i={"0x0":"reverted","0x1":"success"};function a(e){let a={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(e=>(0,r.formatLog)(e)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?(0,t.hexToNumber)(e.transactionIndex):null,status:e.status?i[e.status]:null,type:e.type?n.transactionType[e.type]||e.type:null};return e.blobGasPrice&&(a.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(a.blobGasUsed=BigInt(e.blobGasUsed)),a}},805539,e=>{"use strict";e.s(["getTransactionReceipt",()=>n]);var t=e.i(317907),r=e.i(972346);async function n(e,n){var i,a,o;let{hash:s}=n,l=await e.request({method:"eth_getTransactionReceipt",params:[s]},{dedupe:!0});if(!l)throw new t.TransactionReceiptNotFoundError({hash:s});return((null==(o=e.chain)||null==(a=o.formatters)||null==(i=a.transactionReceipt)?void 0:i.format)||r.formatTransactionReceipt)(l)}},202246,e=>{"use strict";e.s(["multicall",()=>p]);var t=e.i(3339),r=e.i(361861),n=e.i(38176),i=e.i(768366),a=e.i(824542),o=e.i(827122),s=e.i(254712),l=e.i(474984),c=e.i(574041),u=e.i(24449),d=e.i(721200);async function p(e,p){var h,f,m;let{account:g,authorizationList:v,allowFailure:C=!0,blockNumber:y,blockOverrides:b,blockTag:w,stateOverride:E}=p,A=p.contracts,{batchSize:N=null!=(f=p.batchSize)?f:1024,deployless:T=null!=(m=p.deployless)&&m}="object"==typeof(null==(h=e.batch)?void 0:h.multicall)?e.batch.multicall:{},I=(()=>
1{if(p.multicallAddress)return p.multicallAddress;if(T)return null;if(e.chain)return(0,l.getChainContractAddress)({blockNumber:y,chain:e.chain,contract:"multicall3"});throw Error("client chain not configured. multicallAddress is required.")})(),P=[[]],k=0,U=0;for(let e=0;e<A.length;e++){let{abi:t,address:r,args:n,functionName:i}=A[e];try{let e=(0,s.encodeFunctionData)({abi:t,args:n,functionName:i});U+=(e.length-2)/2,N>0&&U>N&&P[k].length>0&&(k++,U=(e.length-2)/2,P[k]=[]),P[k]=[...P[k],{allowFailure:!0,callData:e,target:r}]}catch(a){let e=(0,c.getContractError)(a,{abi:t,address:r,args:n,docsPath:"/docs/contract/multicall",functionName:i,sender:g});if(!C)throw e;P[k]=[...P[k],{allowFailure:!0,callData:"0x",target:r}]}}let S=await Promise.allSettled(P.map(n=>(0,u.getAction)(e,d.readContract,"readContract")({...null===I?{code:r.multicall3Bytecode}:{address:I},abi:t.multicall3Abi,account:g,args:[n],authorizationList:v,blockNumber:y,blockOverrides:b,blockTag:w,functionName:"aggregate3",stateOverride:E}))),R=[];for(let e=0;e<S.length;e++){let t=S[e];if("rejected"===t.status){if(!C)throw t.reason;for(let r=0;r<P[e].length;r++)R.push({status:"failure",error:t.reason,result:void 0});continue}let r=t.value;for(let t=0;t<r.length;t++){let{returnData:i,success:s}=r[t],{callData:l}=P[e][t],{abi:u,address:d,functionName:p,args:h}=A[R.length];try{if("0x"===l)throw new n.AbiDecodingZeroDataError;if(!s)throw new a.RawContractError({data:i});let e=(0,o.decodeFunctionResult)({abi:u,args:h,data:i,functionName:p});R.push(C?{result:e,status:"success"}:e)}catch(t){let e=(0,c.getContractError)(t,{abi:u,address:d,args:h,docsPath:"/docs/contract/multicall",functionName:p});if(!C)throw e;R.push({error:e,result:void 0,status:"failure"})}}}if(R.length!==A.length)throw new i.BaseError("multicall results mismatch");return R}},855626,e=>{"use strict";e.s(["simulateBlocks",()=>v]);var t=e.i(590614),r=e.i(935999),n=e.i(38176),i=e.i(824542),a=e.i(453650),o=e.i(827122),s=e.i(254712),l=e.i(179926),c=e.i(172804),u=e.i(574041),d=e.i(908336),p=e.i(738621),h=e.i(143113),f=e.i(233596),m=e.i(867012),g=e.i(98422);async function v(e,v){var C;let{blockNumber:y,blockTag:b=null!=(C=e.experimental_blockTag)?C:"latest",blocks:w,returnFullTransactions:E,traceTransfers:A,validation:N}=v;try{let a=[];for(let e of w){let n=e.blockOverrides?t.toRpc(e.blockOverrides):void 0,i=e.calls.map(e=>{var t;let n=e.account?(0,r.parseAccount)(e.account):void 0,i=e.abi?(0,s.encodeFunctionData)(e):e.data,a={...e,data:e.dataSuffix?(0,l.concat)([i||"0x",e.dataSuffix]):i,from:null!=(t=e.from)?t:null==n?void 0:n.address};return(0,g.assertRequest)(a),(0,f.formatTransactionRequest)(a)}),o=e.stateOverrides?(0,m.serializeStateOverride)(e.stateOverrides):void 0;a.push({blockOverrides:n,calls:i,stateOverrides:o})}let d="bigint"==typeof y?(0,c.numberToHex)(y):void 0;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:a,returnFullTransactions:E,traceTransfers:A,validation:N},d||b]})).map((e,t)=>({...(0,p.formatBlock)(e),calls:e.calls.map((e,r)=>{var a,s,l;let{abi:c,args:d,functionName:p,to:f}=w[t].calls[r],m=null!=(l=null==(a=e.error)?void 0:a.data)?l:e.returnData,g=BigInt(e.gasUsed),v=null==(s=e.logs)?void 0:s.map(e=>(0,h.formatLog)(e)),C="0x1"===e.status?"success":"failure",y=c&&"success"===C&&"0x"!==m?(0,o.decodeFunctionResult)({abi:c,data:m,functionName:p}):null,b=(()=>{var t;let r;if("success"!==C&&((null==(t=e.error)?void 0:t.data)==="0x"?r=new n.AbiDecodingZeroDataError:e.error&&(r=new i.RawContractError(e.error)),r))return(0,u.getContractError)(r,{abi:null!=c?c:[],address:null!=f?f:"0x",args:d,functionName:null!=p?p:"<unknown>"})})();return{data:m,gasUsed:g,logs:v,status:C,..."success"===C?{result:y}:{error:b}}})}))}catch(t){let e=(0,d.getNodeError)(t,{});if(e instanceof a.UnknownNodeError)throw t;throw e}}},632801,e=>{"use strict";e.s(["keccak256",()=>i]),e.i(70492);var t=e.i(626014);e.i(403893);var r=e.i(638573),n=e.i(412790);function i(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{as:a="string"==typeof e?"Hex":"Bytes"}=i,o=(0,t.keccak_256)(r.from(e));return"Bytes"===a?o:n.fromBytes(o)}},647868,e=>{"use strict";e.s(["LruMap",()=>t]);class t extends Map{get(e){let t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=this.keys().next().value;e&&this.delete(e)}return this}constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}}},334724,e=>{"use strict";e.s(["checksum",()=>t]);let t={checksum:new(e.i(647868)).LruMap(8192)}.checksum},64425,e=>{"use strict";e.s(["from",()=>o,"toBytes",()=>l,"toHex",()=>c]);var t=e.i(638573),r=e.i(37010),n=e.i(412790),i=e.i(614740);function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{compressed:r}=t,{prefix:n,x:i,y:a}=e;if(!1===r||"bigint"==typeof i&&"bigint"==typeof a){if(4!==n)throw new d({prefix:n,cause:new h});return}if(!0===r||"bigint"==typeof i&&void 0===a){if(3!==n&&2!==n)throw new d({prefix:n,cause:new p});return}throw new u({publicKey:e})}function o(e){let r=(()=>
1{if(n.validate(e))return s(e);if(t.validate(e)){var r;return r=e,s(n.fromBytes(r))}let{prefix:i,x:a,y:o}=e;return"bigint"==typeof a&&"bigint"==typeof o?{prefix:null!=i?i:4,x:a,y:o}:{prefix:i,x:a}})();return a(r),r}function s(e){if(132!==e.length&&130!==e.length&&68!==e.length)throw new f({publicKey:e});if(130===e.length)return{prefix:4,x:BigInt(n.slice(e,0,32)),y:BigInt(n.slice(e,32,64))};if(132===e.length){let t=Number(n.slice(e,0,1));return{prefix:t,x:BigInt(n.slice(e,1,33)),y:BigInt(n.slice(e,33,65))}}return{prefix:Number(n.slice(e,0,1)),x:BigInt(n.slice(e,1,33))}}function l(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.fromHex(c(e,r))}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(e);let{prefix:r,x:i,y:o}=e,{includePrefix:s=!0}=t;return n.concat(s?n.fromNumber(r,{size:1}):"0x",n.fromNumber(i,{size:32}),"bigint"==typeof o?n.fromNumber(o,{size:32}):"0x")}class u extends r.BaseError{constructor({publicKey:e}){super("Value `".concat(i.stringify(e),"` is not a valid public key."),{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class d extends r.BaseError{constructor({prefix:e,cause:t}){super('Prefix "'.concat(e,'" is invalid.'),{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class p extends r.BaseError{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class h extends r.BaseError{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}class f extends r.BaseError{constructor({publicKey:e}){super("Value `".concat(e,"` is an invalid public key size."),{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).","Received ".concat(n.size(n.from(e))," bytes.")]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}}},318024,e=>{"use strict";e.s(["assert",()=>s,"checksum",()=>l,"fromPublicKey",()=>c,"isEqual",()=>u,"validate",()=>d]);var t=e.i(638573),r=e.i(334724),n=e.i(37010),i=e.i(632801),a=e.i(64425);let o=/^0x[a-fA-F0-9]{40}$/;function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{strict:r=!0}=t;if(!o.test(e))throw new p({address:e,cause:new h});if(r){if(e.toLowerCase()===e)return;if(l(e)!==e)throw new p({address:e,cause:new f})}}function l(e){if(r.checksum.has(e))return r.checksum.get(e);s(e,{strict:!1});let n=e.substring(2).toLowerCase(),a=i.keccak256(t.fromString(n),{as:"Bytes"}),o=n.split("");for(let e=0;e<40;e+=2)a[e>>1]>>4>=8&&o[e]&&(o[e]=o[e].toUpperCase()),(15&a[e>>1])>=8&&o[e+1]&&(o[e+1]=o[e+1].toUpperCase());let l="0x".concat(o.join(""));return r.checksum.set(e,l),l}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.keccak256("0x".concat(a.toHex(e).slice(4))).substring(26);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{checksum:r=!1}=t;return(s(e),r)?l(e):e}("0x".concat(r),t)}function u(e,t){return s(e,{strict:!1}),s(t,{strict:!1}),e.toLowerCase()===t.toLowerCase()}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{strict:r=!0}=null!=t?t:{};try{return s(e,{strict:r}),!0}catch(e){return!1}}class p extends n.BaseError{constructor({address:e,cause:t}){super('Address "'.concat(e,'" is invalid.'),{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class h extends n.BaseError{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class f extends n.BaseError{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}},894142,e=>{"use strict";e.s(["getAmbiguousTypes",()=>function e(r,n,i){for(let a in r){let o=r[a],s=n[a];if("tuple"===o.type&&"tuple"===s.type&&"components"in o&&"components"in s)return e(o.components,s.components,i[a]);let l=[o.type,s.type];if(l.includes("address")&&l.includes("bytes20")||(l.includes("address")&&l.includes("string")||l.includes("address")&&l.includes("bytes"))&&t.validate(i[a],{strict:!1}))return l}},"isArgOfType",()=>function e(r,n){let i=typeof r,a=n.type;
1switch(a){case"address":return t.validate(r,{strict:!1});case"bool":return"boolean"===i;case"function":case"string":return"string"===i;default:if("tuple"===a&&"components"in n)return Object.values(n.components).every((t,n)=>e(Object.values(r)[n],t));if(/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(a))return"number"===i||"bigint"===i;if(/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(a))return"string"===i||r instanceof Uint8Array;if(/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(a))return Array.isArray(r)&&r.every(t=>e(t,{...n,type:a.replace(/(\[[0-9]{0,}\])$/,"")}));return!1}},"normalizeSignature",()=>n]);var t=e.i(318024),r=e.i(37010);function n(e){let t=!0,n="",i=0,a="",o=!1;for(let r=0;r<e.length;r++){let s=e[r];if(["(",")",","].includes(s)&&(t=!0),"("===s&&i++,")"===s&&i--,t){if(0===i){if(" "===s&&["event","function","error",""].includes(a))a="";else if(a+=s,")"===s){o=!0;break}continue}if(" "===s){","!==e[r-1]&&","!==n&&",("!==n&&(n="",t=!1);continue}a+=s,n+=s}}if(!o)throw new r.BaseError("Unable to normalize signature.");return a}},685937,e=>{"use strict";e.s(["InvalidSelectorSizeError",()=>h,"NotFoundError",()=>p,"from",()=>s,"fromAbi",()=>l,"getSelector",()=>c]);var t=e.i(542668),r=e.i(540653),n=e.i(37010),i=e.i(632801),a=e.i(412790),o=e.i(894142);function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{prepare:n=!0}=t,i=Array.isArray(e)||"string"==typeof e?r.parseAbiItem(e):e;return{...i,...n?{hash:u(i)}:{}}}function l(e,t,r){let n,{args:i=[],prepare:s=!0}=null!=r?r:{},l=a.validate(t,{strict:!1}),h=e.filter(e=>l?"function"===e.type||"error"===e.type?c(e)===a.slice(t,0,4):"event"===e.type&&u(e)===t:"name"in e&&e.name===t);if(0===h.length)throw new p({name:t});if(1===h.length)return{...h[0],...s?{hash:u(h[0])}:{}};for(let e of h){if("inputs"in e){if(!i||0===i.length){if(!e.inputs||0===e.inputs.length)return{...e,...s?{hash:u(e)}:{}};continue}if(e.inputs&&0!==e.inputs.length&&e.inputs.length===i.length&&i.every((t,r)=>{let n="inputs"in e&&e.inputs[r];return!!n&&o.isArgOfType(t,n)})){if(n&&"inputs"in n&&n.inputs){let t=o.getAmbiguousTypes(e.inputs,n.inputs,i);if(t)throw new d({abiItem:e,type:t[0]},{abiItem:n,type:t[1]})}n=e}}}let f=(()=>{if(n)return n;let[e,...t]=h;return{...e,overloads:t}})();if(!f)throw new p({name:t});return{...f,...s?{hash:u(f)}:{}}}function c(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let n=(()=>{if(Array.isArray(t[0])){let[e,r]=t;return l(e,r)}return t[0]})();return a.slice(u(n),0,4)}function u(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];let s=(()=>{if(Array.isArray(r[0])){let[e,t]=r;return l(e,t)}return r[0]})();return"string"!=typeof s&&"hash"in s&&s.hash?s.hash:i.keccak256(a.fromString(function(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];let i=(()=>{if(Array.isArray(r[0])){let[e,t]=r;return l(e,t)}return r[0]})(),a="string"==typeof i?i:t.formatAbiItem(i);return o.normalizeSignature(a)}(s)))}class d extends n.BaseError{constructor(e,r){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:["`".concat(e.type,"` in `").concat(o.normalizeSignature(t.formatAbiItem(e.abiItem)),"`, and"),"`".concat(r.type,"` in `").concat(o.normalizeSignature(t.formatAbiItem(r.abiItem)),"`"),"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class p extends n.BaseError{constructor({name:e,data:t,type:r="item"}){super("ABI ".concat(r).concat(e?' with name "'.concat(e,'"'):t?' with data "'.concat(t,'"'):""," not found.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}class h extends n.BaseError{constructor({data:e}){super("Selector size is invalid. Expected 4 bytes. Received ".concat(a.size(e),' bytes ("').concat(e,'").')),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.InvalidSelectorSizeError"})}}},1248,e=>{"use strict";e.s(["arrayRegex",()=>t,"bytesRegex",()=>r,"integerRegex",()=>n,"maxUint256",()=>i]);let t=/^(.*)\[([0-9]*)\]$/,r=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,n=/^(u?int)(8|
116|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,i=2n**256n-1n},645932,e=>{"use strict";e.s(["decodeParameter",()=>function e(i,o,s){let{checksumAddress:l,staticPosition:d}=s,p=c(o.type);if(p){let[t,r]=p;return function(t,r,i){let{checksumAddress:a,length:o,staticPosition:s}=i;if(!o){let i=s+n.toNumber(t.readBytes(32)),o=i+32;t.setPosition(i);let l=n.toNumber(t.readBytes(32)),c=u(r),d=0,p=[];for(let n=0;n<l;++n){t.setPosition(o+(c?32*n:d));let[i,s]=e(t,r,{checksumAddress:a,staticPosition:o});d+=s,p.push(i)}return t.setPosition(s+32),[p,32]}if(u(r)){let i=s+n.toNumber(t.readBytes(32)),l=[];for(let n=0;n<o;++n){t.setPosition(i+32*n);let[o]=e(t,r,{checksumAddress:a,staticPosition:i});l.push(o)}return t.setPosition(s+32),[l,32]}let l=0,c=[];for(let n=0;n<o;++n){let[n,i]=e(t,r,{checksumAddress:a,staticPosition:s+l});l+=i,c.push(n)}return[c,l]}(i,{...o,type:r},{checksumAddress:l,length:t,staticPosition:d})}if("tuple"===o.type)return function(t,r,i){let{checksumAddress:a,staticPosition:o}=i,s=0===r.components.length||r.components.some(e=>{let{name:t}=e;return!t}),l=s?[]:{},c=0;if(u(r)){let i=o+n.toNumber(t.readBytes(32));for(let n=0;n<r.components.length;++n){let o=r.components[n];t.setPosition(i+c);let[u,d]=e(t,o,{checksumAddress:a,staticPosition:i});c+=d,l[s?n:null==o?void 0:o.name]=u}return t.setPosition(o+32),[l,32]}for(let n=0;n<r.components.length;++n){let i=r.components[n],[u,d]=e(t,i,{checksumAddress:a,staticPosition:o});l[s?n:null==i?void 0:i.name]=u,c+=d}return[l,c]}(i,o,{checksumAddress:l,staticPosition:d});if("address"===o.type)return function(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{checksum:o=!1}=i,s=e.readBytes(32);return[(t=a.fromBytes(n.slice(s,-20)),o?r.checksum(t):t),32]}(i,{checksum:l});if("bool"===o.type){var h;return h=i,[n.toBoolean(h.readBytes(32),{size:32}),32]}if(o.type.startsWith("bytes"))return function(e,t,r){let{staticPosition:i}=r,[o,s]=t.type.split("bytes");if(!s){let t=n.toNumber(e.readBytes(32));e.setPosition(i+t);let r=n.toNumber(e.readBytes(32));if(0===r)return e.setPosition(i+32),["0x",32];let o=e.readBytes(r);return e.setPosition(i+32),[a.fromBytes(o),32]}return[a.fromBytes(e.readBytes(Number.parseInt(s,10),32)),32]}(i,o,{staticPosition:d});if(o.type.startsWith("uint")||o.type.startsWith("int")){var f=i,m=o;let e=m.type.startsWith("int"),t=Number.parseInt(m.type.split("int")[1]||"256",10),r=f.readBytes(32);return[t>48?n.toBigInt(r,{signed:e}):n.toNumber(r,{signed:e}),32]}if("string"===o.type)return function(e,t){let{staticPosition:r}=t,i=n.toNumber(e.readBytes(32));e.setPosition(r+i);let a=n.toNumber(e.readBytes(32));if(0===a)return e.setPosition(r+32),["",32];let o=e.readBytes(a,32),s=n.toString(n.trimLeft(o));return e.setPosition(r+32),[s,32]}(i,{staticPosition:d});throw new t.InvalidTypeError(o.type)},"encode",()=>l,"prepareParameters",()=>s]);var t=e.i(46100),r=e.i(318024),n=e.i(638573),i=e.i(37010),a=e.i(412790),o=e.i(1248);function s(e){let{checksumAddress:n,parameters:s,values:u}=e,d=[];for(let e=0;e<s.length;e++)d.push(function e(n){let{checksumAddress:s=!1,parameter:u,value:d}=n,p=c(u.type);if(p){let[r,n]=p;return function(r,n){let{checksumAddress:i,length:o,parameter:s}=n,c=null===o;if(!Array.isArray(r))throw new t.InvalidArrayError(r);if(!c&&r.length!==o)throw new t.ArrayLengthMismatchError({expectedLength:o,givenLength:r.length,type:"".concat(s.type,"[").concat(o,"]")});let u=!1,d=[];for(let t=0;t<r.length;t++){let n=e({checksumAddress:i,parameter:s,value:r[t]});n.dynamic&&(u=!0),d.push(n)}if(c||u){let e=l(d);if(c){let t=a.fromNumber(d.length,{size:32});return{dynamic:!0,encoded:d.length>0?a.concat(t,e):t}}if(u)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:a.concat(...d.map(e=>{let{encoded:t}=e;return t}))}}(d,{checksumAddress:s,length:r,parameter:{...u,type:n}})}if("tuple"===u.type)return function(t,r){let{checksumAddress:n,parameter:i}=r,o=!1,s=[];for(let r=0;r<i.components.length;r++){let a=i.components[r],l=Array.isArray(t)?r:a.name,c=e({checksumAddress:n,parameter:a,value:t[l]});s.push(c),c.dynamic&&(o=!0)}return{dynamic:o,encoded:o?l(s):a.concat(...s.map(e=>{let{encoded:t}=e;return t}))}}(d,{checksumAddress:s,parameter:u});if("address"===u.type){var h,f=d,m={checksum:s};let{checksum:e=!1}=m;return r.assert(f,{strict:e}),{dynamic:!1,encoded:a.padLeft(f.toLowerCase())}}if("bool"===u.type){var g=d;if("boolean"!=typeof g)throw new i.BaseError('Invalid boolean value: "'.concat(g,'" (type: ').concat(typeof g,"). Expected: `true` or `false`."));return{dynamic:!1,encoded:a.padLeft(a.fromBoolean(g))}}if(u.type.startsWith("uint")||u.type.startsWith("int")){let e=u.type.startsWith("int"),[,,t="256"]=null!=(h=o.integerRegex.exec(u.type))?h:[];return function(e,t){let{signed:r,size:n}=t;if("number"==typeof n){let t=2n**(BigInt(n)-(r?1n:0n))-1n,i=r?-t-1n:0n;if(e>t||e<i)throw new a.IntegerOutOfRangeError({max:t.toString(),min:i.toString(),signed:r,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:a.fromNumber(e,{size:32,signed:r})}}(d,{signed:e,size:Number(t)})}if(u.type.startsWith("bytes"))return function(e,r){let{type:n}=r,[,i]=n.split("bytes"),o=a.size(e);if(!i){let t=e;return o%32!=0&&(t=a.padRight(t,32*Math.ceil((e.length-2)/2/32))),{dynamic:!0,encoded:a.concat(a.padLeft(a.fromNumber(o,{size:32})),t)}}if(o!==Number.parseInt(i,10))throw new t.BytesSizeMismatchError({expectedSize:Number.parseInt(i,10),value:e});return{dynamic:!1,encoded:a.padRight(e)}}(d,{type:u.type});if("string"===u.type){var v=d;let e=a.fromString(v),t=Math.ceil(a.size(e)/32),r=[];for(let n=0;n<t;n++)r.push(a.padRight(a.slice(e,32*n,(n+1)*32)));return{dynamic:!0,encoded:a.concat(a.padRight(a.fromNumber(a.size(e),{size:32})),...r)}}throw new t.InvalidTypeError(u.type)}({checksumAddress:n,parameter:s[e],value:u[e]}
vendor: 5,899 bytes, line 1
1));return d}function l(e){let t=0;for(let r=0;r<e.length;r++){let{dynamic:n,encoded:i}=e[r];n?t+=32:t+=a.size(i)}let r=[],n=[],i=0;for(let o=0;o<e.length;o++){let{dynamic:s,encoded:l}=e[o];s?(r.push(a.fromNumber(t+i,{size:32})),n.push(l),i+=a.size(l)):r.push(l)}return a.concat(...r,...n)}function c(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function u(e){var t;let{type:r}=e;if("string"===r||"bytes"===r||r.endsWith("[]"))return!0;if("tuple"===r)return null==(t=e.components)?void 0:t.some(u);let n=c(e.type);return!!(n&&u({...e,type:n[1]}))}},910955,e=>{"use strict";e.s(["create",()=>n]);var t=e.i(37010);let r={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:1/0,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new o({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new a({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new i({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new i({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=null!=e?e:this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=null!=t?t:this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=null!=e?e:this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=null!=e?e:this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=null!=e?e:this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=null!=e?e:this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=null!=t?t:e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===1/0)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function n(e){let{recursiveReadLimit:t=8192}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object.create(r);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class i extends t.BaseError{constructor({offset:e}){super("Offset `".concat(e,"` cannot be negative.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class a extends t.BaseError{constructor({length:e,position:t}){super("Position `".concat(t,"` is out of bounds (`0 < position < ").concat(e,"`).")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class o extends t.BaseError{constructor({count:e,limit:t}){super("Recursive read limit of `".concat(t,"` exceeded (recursive read count: `").concat(e,"`).")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}},46100,e=>{"use strict";e.s(["ArrayLengthMismatchError",()=>g,"BytesSizeMismatchError",()=>v,"InvalidArrayError",()=>y,"InvalidTypeError",()=>b,"decode",()=>u,"encode",()=>d,"from",()=>h]);var t=e.i(78749),r=e.i(568688),n=e.i(318024),i=e.i(638573),a=e.i(37010),o=e.i(412790),s=e.i(645932),l=e.i(910955),c=e.i(1248);function u(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{as:n="Array",checksumAddress:a=!1}=r,c="string"==typeof t?i.fromHex(t):t,u=l.create(c);if(0===i.size(c)&&e.length>0)throw new m;if(i.size(c)&&32>i.size(c))throw new f({data:"string"==typeof t?t:o.fromBytes(t),parameters:e,size:i.size(c)});let d=0,p="Array"===n?[]:{};for(let t=0;t<e.length;++t){var h;let r=e[t];u.setPosition(d);let[i,o]=s.decodeParameter(u,r,{checksumAddress:a,staticPosition:0});d+=o,"Array"===n?p.push(i):p[null!=(h=r.name)?h:t]=i}return p}function d(e,t,r){let{checksumAddress:n=!1}=null!=r?r:{};if(e.length!==t.length)throw new C({expectedLength:e.length,givenLength:t.length});let i=s.prepareParameters({checksumAddress:n,parameters:e,values:t}),a=s.encode(i);return 0===a.length?"0x":a}function p(e,t){if(e.length!==t.length)throw new C({expectedLength:e.length,givenLength:t.length});let r=[];for(let n=0;n<e.length;n++){let i=e[n],a=t[n];
1r.push(p.encode(i,a))}return o.concat(...r)}function h(e){return Array.isArray(e)&&"string"==typeof e[0]||"string"==typeof e?r.parseAbiParameters(e):e}(p||(p={})).encode=function e(t,r){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("address"===t)return n.assert(r),o.padLeft(r.toLowerCase(),32*!!i);if("string"===t)return o.fromString(r);if("bytes"===t)return r;if("bool"===t)return o.padLeft(o.fromBoolean(r),i?32:1);let a=t.match(c.integerRegex);if(a){let[e,t,n="256"]=a,s=Number.parseInt(n,10)/8;return o.fromNumber(r,{size:i?32:s,signed:"int"===t})}let s=t.match(c.bytesRegex);if(s){let[e,t]=s;if(Number.parseInt(t,10)!==(r.length-2)/2)throw new v({expectedSize:Number.parseInt(t,10),value:r});return o.padRight(r,32*!!i)}let l=t.match(c.arrayRegex);if(l&&Array.isArray(r)){let[t,n]=l,i=[];for(let t=0;t<r.length;t++)i.push(e(n,r[t],!0));return 0===i.length?"0x":o.concat(...i)}throw new b(t)};class f extends a.BaseError{constructor({data:e,parameters:r,size:n}){super("Data size of ".concat(n," bytes is too small for given parameters."),{metaMessages:["Params: (".concat(t.formatAbiParameters(r),")"),"Data:   ".concat(e," (").concat(n," bytes)")]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class m extends a.BaseError{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class g extends a.BaseError{constructor({expectedLength:e,givenLength:t,type:r}){super("Array length mismatch for type `".concat(r,"`. Expected: `").concat(e,"`. Given: `").concat(t,"`.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class v extends a.BaseError{constructor({expectedSize:e,value:t}){super('Size of bytes "'.concat(t,'" (bytes').concat(o.size(t),") does not match expected size (bytes").concat(e,").")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class C extends a.BaseError{constructor({expectedLength:e,givenLength:t}){super(["ABI encoding parameters/values length mismatch.","Expected length (parameters): ".concat(e),"Given length (values): ".concat(t)].join("\n")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class y extends a.BaseError{constructor(e){super("Value `".concat(e,"` is not a valid array.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class b extends a.BaseError{constructor(e){super("Type `".concat(e,"` is not a valid ABI Type.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}},117247,e=>{"use strict";e.s(["encode",()=>i,"from",()=>a]),e.i(542668);var t=e.i(685937),r=e.i(46100),n=e.i(412790);function i(){for(var e,i=arguments.length,a=Array(i),o=0;o<i;o++)a[o]=arguments[o];let[s,l]=(()=>
1{if(Array.isArray(a[0])){let[e,r]=a;return[function(e){let r=e.find(e=>"constructor"===e.type);if(!r)throw new t.NotFoundError({name:"constructor"});return r}(e),r]}return a})(),{bytecode:c,args:u}=l;return n.concat(c,(null==(e=s.inputs)?void 0:e.length)&&(null==u?void 0:u.length)?r.encode(s.inputs,u):"0x")}function a(e){return t.from(e)}},896216,e=>{"use strict";e.s(["encodeData",()=>i,"from",()=>a]),e.i(542668);var t=e.i(685937),r=e.i(46100),n=e.i(412790);function i(){for(var e,i=arguments.length,a=Array(i),s=0;s<i;s++)a[s]=arguments[s];let[l,c=[]]=(()=>{if(Array.isArray(a[0])){let[e,t,r]=a;return[o(e,t,{args:r}),r]}let[e,t]=a;return[e,t]})(),{overloads:u}=l,d=u?o([l,...u],l.name,{args:c}):l,p=(e=d,t.getSelector(e)),h=c.length>0?r.encode(d.inputs,c):void 0;return h?n.concat(p,h):p}function a(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.from(e,r)}function o(e,r,n){let i=t.fromAbi(e,r,n);if("function"!==i.type)throw new t.NotFoundError({name:r,type:"function"});return i}},775421,e=>{"use strict";e.s(["ethAddress",()=>t,"zeroAddress",()=>r]);let t="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",r="0x0000000000000000000000000000000000000000"},939536,e=>{"use strict";e.s(["simulateCalls",()=>d]);var t=e.i(117247),r=e.i(896216),n=e.i(935999),i=e.i(775421),a=e.i(361861),o=e.i(768366),s=e.i(254712),l=e.i(627391),c=e.i(901467),u=e.i(855626);async function d(e,d){var p,h,f,m,g,v,C,y;let{blockNumber:b,blockTag:w,calls:E,stateOverrides:A,traceAssetChanges:N,traceTransfers:T,validation:I}=d,P=d.account?(0,n.parseAccount)(d.account):void 0;if(N&&!P)throw new o.BaseError("`account` is required when `traceAssetChanges` is true");let k=P?t.encode(t.from("constructor(bytes, bytes)"),{bytecode:a.deploylessCallViaBytecodeBytecode,args:["0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033",r.encodeData(r.from("function getBalance(address)"),[P.address])]}):void 0,U=N?await Promise.all(d.calls.map(async t=>{if(!t.data&&!t.abi)return;let{accessList:r}=await (0,c.createAccessList)(e,{account:P.address,...t,data:t.abi?(0,s.encodeFunctionData)(t):t.data});return r.map(e=>{let{address:t,storageKeys:r}=e;return r.length>0?t:null})})).then(e=>e.flat().filter(Boolean)):[],S=await (0,u.simulateBlocks)(e,{blockNumber:b,blockTag:w,blocks:[...N?[{calls:[{data:k}],stateOverrides:A},{calls:U.map((e,t)=>({abi:[r.from("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[P.address],to:e,from:i.zeroAddress,nonce:t})),stateOverrides:[{address:i.zeroAddress,nonce:0}]}]:[],{calls:[...E,{}].map(e=>({...e,from:null==P?void 0:P.address})),stateOverrides:A},...N?[{calls:[{data:k}]},{calls:U.map((e,t)=>({abi:[r.from("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[P.address],to:e,from:i.zeroAddress,nonce:t})),stateOverrides:[{address:i.zeroAddress,nonce:0}]},{calls:U.map((e,t)=>({to:e,abi:[r.from("function decimals() returns (uint256)")],functionName:"decimals",from:i.zeroAddress,nonce:t})),stateOverrides:[{address:i.zeroAddress,nonce:0}]},{calls:U.map((e,t)=>({to:e,abi:[r.from("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:i.zeroAddress,nonce:t})),stateOverrides:[{address:i.zeroAddress,nonce:0}]},{calls:U.map((e,t)=>({to:e,abi:[r.from("function symbol() returns (string)")],functionName:"symbol",from:i.zeroAddress,nonce:t})),stateOverrides:[{address:i.zeroAddress,nonce:0}]}]:[]],traceTransfers:T,validation:I}),R=N?S[2]:S[0],[x,O,,B,F,_,L,D]=N?S:[],{calls:M,...W}=R,H=null!=(p=M.slice(0,-1))?p:[],z=[...null!=(h=null==x?void 0:x.calls)?h:[],...null!=(f=null==O?void 0:O.calls)?f:[]].map(e=>"success"===e.status?(0,l.hexToBigInt)(e.data):null),q=[...null!=(m=null==B?void 0:B.calls)?m:[],...null!=(g=null==F?void 0:F.calls)?g:[]].map(e=>"success"===e.status?(0,l.hexToBigInt)(e.data):null),G=(null!=(v=null==_?void 0:_.calls)?v:[]).map(e=>"success"===e.status?e.result:null),j=(null!=(C=null==D?void 0:D.calls)?C:[]).map(e=>"success"===e.status?e.result:null),V=(null!=(y=null==L?void 0:L.calls)?y:[]).map(e=>"success"===e.status?e.result:null),K=[];for(let[e,t]of q.entries()){let r=z[e];if("bigint"!=typeof t||"bigint"!=typeof r)continue;let n=G[e-1],a=j[e-1],o=V[e-1],s=0===e?{address:i.ethAddress,decimals:18,symbol
1:"ETH"}:{address:U[e-1],decimals:o||n?Number(null!=n?n:1):void 0,symbol:null!=a?a:void 0};K.some(e=>e.token.address===s.address)||K.push({token:s,value:{pre:r,post:t,diff:t-r}})}return{assetChanges:K,block:W,results:H}}},110449,e=>{"use strict";e.s(["simulateContract",()=>s]);var t=e.i(935999),r=e.i(827122),n=e.i(254712),i=e.i(574041),a=e.i(24449),o=e.i(355534);async function s(e,s){let{abi:l,address:c,args:u,dataSuffix:d,functionName:p,...h}=s,f=h.account?(0,t.parseAccount)(h.account):e.account,m=(0,n.encodeFunctionData)({abi:l,args:u,functionName:p});try{let{data:t}=await (0,a.getAction)(e,o.call,"call")({batch:!1,data:"".concat(m).concat(d?d.replace("0x",""):""),to:c,...h,account:f}),n=(0,r.decodeFunctionResult)({abi:l,args:u,functionName:p,data:t||"0x"}),i=l.filter(e=>"name"in e&&e.name===s.functionName);return{result:n,request:{abi:i,address:c,args:u,dataSuffix:d,functionName:p,...h,account:f}}}catch(e){throw(0,i.getContractError)(e,{abi:l,address:c,args:u,docsPath:"/docs/contract/simulateContract",functionName:p,sender:null==f?void 0:f.address})}}},556173,e=>{"use strict";async function t(e,t){let{filter:r}=t;return r.request({method:"eth_uninstallFilter",params:[r.id]})}e.s(["uninstallFilter",()=>t])},714848,e=>{"use strict";e.s(["InvalidWrappedSignatureError",()=>p,"assert",()=>s,"from",()=>l,"magicBytes",()=>i,"universalSignatureValidatorAbi",()=>o,"universalSignatureValidatorBytecode",()=>a,"unwrap",()=>c,"validate",()=>d,"wrap",()=>u]);var t=e.i(46100),r=e.i(37010),n=e.i(412790);let i="0x6492649264926492649264926492649264926492649264926492649264926492",a="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848
1603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",o=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}];function s(e){if(n.slice(e,-32)!==i)throw new p(e)}function l(e){return"string"==typeof e?c(e):e}function c(e){s(e);let[r,n,i]=t.decode(t.from("address, bytes, bytes"),e);return{data:n,signature:i,to:r}}function u(e){let{data:r,signature:a,to:o}=e;return n.concat(t.encode(t.from("address, bytes, bytes"),[o,r,a]),i)}function d(e){try{return s(e),!0}catch(e){return!1}}class p extends r.BaseError{constructor(e){super("Value `".concat(e,"` is an invalid ERC-6492 wrapped signature.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}},70901,e=>{"use strict";e.s(["SignatureErc6492",()=>t]);var t=e.i(714848)},358631,e=>{"use strict";e.s(["fromHex",()=>a]);var t=e.i(638573),r=e.i(37010),n=e.i(412790),i=e.i(910955);function a(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{as:a="Hex"}=r;return function(e,r){let{as:a}=r,s=function e(r){return Array.isArray(r)?function(e){let t=e.reduce((e,t)=>e+t.length,0),r=o(t);return{length:t<=55?1+t:1+r+t,encode(n){for(let{encode:i}of(t<=55?n.pushByte(192+t):(n.pushByte(247+r),1===r?n.pushUint8(t):2===r?n.pushUint16(t):3===r?n.pushUint24(t):n.pushUint32(t)),e))i(n)}}}(r.map(t=>e(t))):function(e){let r="string"==typeof e?t.fromHex(e):e,n=o(r.length);return{length:1===r.length&&r[0]<128?1:r.length<=55?1+r.length:1+n+r.length,encode(e){1===r.length&&r[0]<128||(r.length<=55?e.pushByte(128+r.length):(e.pushByte(183+n),1===n?e.pushUint8(r.length):2===n?e.pushUint16(r.length):3===n?e.pushUint24(r.length):e.pushUint32(r.length))),e.pushBytes(r)}}}(r)}(e),l=i.create(new Uint8Array(s.length));return(s.encode(l),"Hex"===a)?n.fromBytes(l.bytes):l.bytes}(e,{as:a})}function o(e){if(e<256)return 1;if(e<65536)return 2;if(e<0x1000000)return 3;if(e<0x100000000)return 4;throw new r.BaseError("Length is too large.")}},795997,e=>{"use strict";e.s(["assert",()=>a,"extract",()=>s,"from",()=>l,"fromTuple",()=>c,"toRpc",()=>u,"toTuple",()=>d]),e.i(300059),e.i(638573);var t=e.i(37010),r=e.i(412790),n=e.i(614740),i=e.i(1248);function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{recovered:r}=t;if(void 0===e.r||void 0===e.s||r&&void 0===e.yParity)throw new f({signature:e});if(e.r<0n||e.r>i.maxUint256)throw new m({value:e.r});if(e.s<0n||e.s>i.maxUint256)throw new g({value:e.s});if("number"==typeof e.yParity&&0!==e.yParity&&1!==e.yParity)throw new v({value:e.yParity})}function o(e){if(130!==e.length&&132!==e.length)throw new h({signature:e});let t=BigInt(r.slice(e,0,32)),n=BigInt(r.slice(e,32,64)),i=(()=>{let t=Number("0x".concat(e.slice(130)));if(!Number.isNaN(t))try{return p(t)}catch(e){throw new v({value:t})}})();return void 0===i?{r:t,s:n}:{r:t,s:n,yParity:i}}function s(e){if(void 0!==e.r&&void 0!==e.s)return l(e)}function l(e){let t=(()=>{var t;if("string"==typeof e)return o(e);if(e instanceof Uint8Array)return o(r.fromBytes(e));return"string"==typeof e.r?function(e){let t=(()=>{let t=e.v?Number(e.v):void 0,r=e.yParity?Number(e.yParity):void 0;if("number"==typeof t&&"number"!=typeof r&&(r=p(t)),"number"!=typeof r)throw new v({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}(e):e.v?{r:(t=e).r,s:t.s,yParity:p(t.v)}:{r:e.r,s:e.s,...void 0!==e.yParity?{yParity:e.yParity}:{}}})();return a(t),t}function c(e){let[t,r,n]=e;return l({r:"0x"===r?0n:BigInt(r),s:"0x"===n?0n:BigInt(n),yParity:"0x"===t?0:Number(t)})}function u(e){let{r:t,s:n,yParity:i}=e;return{r:r.fromNumber(t,{size:32}),s:r.fromNumber(n,{size:32}),yParity:0===i?"0x0":"0x1"}}function d(e){let{r:t,s:n,yParity:i}=e;return[i?"0x01":"0x",0n===t?"0x":r.trimLeft(r.fromNumber(t)),0n===n?"0x":r.trimLeft(r.fromNumber(n))]}function p(e){if(0===e||27===e)return 0;if(1===e||28===e)return 1;if(e>=35)return+(e%2==0);throw new C({value:e})}class h extends t.BaseError{constructor({signature:e}
1){super("Value `".concat(e,"` is an invalid signature size."),{metaMessages:["Expected: 64 bytes or 65 bytes.","Received ".concat(r.size(r.from(e))," bytes.")]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class f extends t.BaseError{constructor({signature:e}){super("Signature `".concat(n.stringify(e),"` is missing either an `r`, `s`, or `yParity` property.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class m extends t.BaseError{constructor({value:e}){super("Value `".concat(e,"` is an invalid r value. r must be a positive integer less than 2^256.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class g extends t.BaseError{constructor({value:e}){super("Value `".concat(e,"` is an invalid s value. s must be a positive integer less than 2^256.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class v extends t.BaseError{constructor({value:e}){super("Value `".concat(e,"` is an invalid y-parity value. Y-parity must be 0 or 1.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class C extends t.BaseError{constructor({value:e}){super("Value `".concat(e,"` is an invalid v value. v must be 27, 28 or >=35.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}},983581,e=>{"use strict";e.s(["from",()=>a,"getSignPayload",()=>o]);var t=e.i(632801),r=e.i(412790),n=e.i(358631),i=e.i(795997);function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e.chainId?function(e){let{address:t,chainId:r,nonce:n}=e,a=i.extract(e);return{address:t,chainId:Number(r),nonce:BigInt(n),...a}}(e):{...e,...t.signature}}function o(e){return function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{presign:o}=a;return t.keccak256(r.concat("0x05",n.fromHex(function(e){let{address:t,chainId:n,nonce:a}=e,o=i.extract(e);return[n?r.fromNumber(n):"0x",t,a?r.fromNumber(a):"0x",...o?i.toTuple(o):[]]}(o?{address:e.address,chainId:e.chainId,nonce:e.nonce}:e))))}(e,{presign:!0})}},343115,e=>{"use strict";e.s(["extraEntropy",()=>t]);let t=!1},706572,e=>{"use strict";e.s(["recoverAddress",()=>a]);var t=e.i(300059),r=e.i(318024);e.i(638573);var n=e.i(412790);e.i(343115);var i=e.i(64425);function a(e){return r.fromPublicKey(function(e){let{payload:r,signature:a}=e,{r:o,s,yParity:l}=a,c=new t.secp256k1.Signature(BigInt(o),BigInt(s)).addRecoveryBit(l).recoverPublicKey(n.from(r).substring(2));return i.from(c)}(e))}t.secp256k1},507994,e=>{"use strict";e.s(["InvalidWrappedSignatureError",()=>f,"assert",()=>c,"from",()=>u,"magicBytes",()=>s,"suffixParameters",()=>l,"unwrap",()=>d,"validate",()=>h,"wrap",()=>p]);var t=e.i(46100),r=e.i(983581),n=e.i(37010),i=e.i(412790),a=e.i(706572),o=e.i(795997);let s="0x8010801080108010801080108010801080108010801080108010801080108010",l=t.from("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function c(e){if("string"==typeof e){if(i.slice(e,-32)!==s)throw new f(e)}else o.assert(e.authorization)}function u(e){return"string"==typeof e?d(e):e}function d(e){c(e);let n=i.toNumber(i.slice(e,-64,-32)),a=i.slice(e,-n-64,-64),o=i.slice(e,0,-n-64),[s,u,d]=t.decode(l,a);return{authorization:r.from({address:s.delegation,chainId:Number(s.chainId),nonce:s.nonce,yParity:s.yParity,r:s.r,s:s.s}),signature:o,...d&&"0x"!==d?{data:d,to:u}:{}}}function p(e){var n;let{data:u,signature:d}=e;c(e);let p=a.recoverAddress({payload:r.getSignPayload(e.authorization),signature:o.from(e.authorization)}),h=t.encode(l,[{...e.authorization,delegation:e.authorization.address,chainId:BigInt(e.authorization.chainId)},null!=(n=e.to)?n:p,null!=u?u:"0x"]),f=i.fromNumber(i.size(h),{size:32});return i.concat(d,h,f,s)}function h(e){try{return c(e),!0}catch(e){return!1}}class f extends n.BaseError{constructor(e){super("Value `".concat(e,"` is an invali
1d ERC-8010 wrapped signature.")),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}},607038,e=>{"use strict";e.s(["SignatureErc8010",()=>t]);var t=e.i(507994)},301949,e=>{"use strict";e.s(["verifyAuthorization",()=>i]);var t=e.i(85721),r=e.i(798972),n=e.i(404436);async function i(e){let{address:i,authorization:a,signature:o}=e;return(0,r.isAddressEqual)((0,t.getAddress)(i),await (0,n.recoverAuthorizationAddress)({authorization:a,signature:o}))}},694206,e=>{"use strict";e.s(["serializeSignature",()=>i]);var t=e.i(300059),r=e.i(627391),n=e.i(720289);function i(e){let{r:i,s:a,to:o="hex",v:s,yParity:l}=e,c=(()=>{if(0===l||1===l)return l;if(s&&(27n===s||28n===s||s>=35n))return+(s%2n===0n);throw Error("Invalid `v` or `yParity` value")})(),u="0x".concat(new t.secp256k1.Signature((0,r.hexToBigInt)(i),(0,r.hexToBigInt)(a)).toCompactHex()).concat(0===c?"1b":"1c");return"hex"===o?u:(0,n.hexToBytes)(u)}},517128,e=>{"use strict";e.s(["verifyHash",()=>w]);var t=e.i(70901),r=e.i(607038),n=e.i(3339),i=e.i(361861),a=e.i(824542),o=e.i(563988),s=e.i(254712),l=e.i(85721),c=e.i(798972),u=e.i(301949),d=e.i(179926),p=e.i(158137),h=e.i(627391),f=e.i(172804),m=e.i(24449),g=e.i(287129),v=e.i(694206),C=e.i(355534),y=e.i(898089),b=e.i(721200);async function w(e,t){var n,i,a,o,s,u,d,h;let{address:m,hash:C,erc6492VerifierAddress:y=null!=(o=t.universalSignatureVerifierAddress)?o:null==(h=e.chain)||null==(d=h.contracts)||null==(u=d.erc6492Verifier)?void 0:u.address,multicallAddress:b=null!=(s=t.multicallAddress)?s:null==(a=e.chain)||null==(i=a.contracts)||null==(n=i.multicall3)?void 0:n.address}=t,w=(()=>{let e=t.signature;return(0,p.isHex)(e)?e:"object"==typeof e&&"r"in e&&"s"in e?(0,v.serializeSignature)(e):(0,f.bytesToHex)(e)})();try{if(r.SignatureErc8010.validate(w))return await E(e,{...t,multicallAddress:b,signature:w});return await A(e,{...t,verifierAddress:y,signature:w})}catch(e){try{if((0,c.isAddressEqual)((0,l.getAddress)(m),await (0,g.recoverAddress)({hash:C,signature:w})))return!0}catch(e){}if(e instanceof T)return!1;throw e}}async function E(e,t){var a;let{address:o,blockNumber:l,blockTag:c,hash:p,multicallAddress:h}=t,{authorization:g,data:v,signature:C,to:w}=r.SignatureErc8010.unwrap(t.signature);if(await (0,y.getCode)(e,{address:o,blockNumber:l,blockTag:c})===(0,d.concatHex)(["0xef0100",g.address]))return await N(e,{address:o,blockNumber:l,blockTag:c,hash:p,signature:C});let E={address:g.address,chainId:Number(g.chainId),nonce:Number(g.nonce),r:(0,f.numberToHex)(g.r,{size:32}),s:(0,f.numberToHex)(g.s,{size:32}),yParity:g.yParity};if(!await (0,u.verifyAuthorization)({address:o,authorization:E}))throw new T;let A=await (0,m.getAction)(e,b.readContract,"readContract")({...h?{address:h}:{code:i.multicall3Bytecode},authorizationList:[E],abi:n.multicall3Abi,blockNumber:l,blockTag:"pending",functionName:"aggregate3",args:[[...v?[{allowFailure:!0,target:null!=w?w:o,callData:v}]:[],{allowFailure:!0,target:o,callData:(0,s.encodeFunctionData)({abi:n.erc1271Abi,functionName:"isValidSignature",args:[p,C]})}]]}),I=null==(a=A[A.length-1])?void 0:a.returnData;if(null==I?void 0:I.startsWith("0x1626ba7e"))return!0;throw new T}async function A(e,r){let{address:l,factory:c,factoryData:u,hash:d,signature:p,verifierAddress:f,...g}=r,v=await (async()=>!c&&!u||t.SignatureErc6492.validate(p)?p:t.SignatureErc6492.wrap({data:u,signature:p,to:c}))(),y=f?{to:f,data:(0,s.encodeFunctionData)({abi:n.erc6492SignatureValidatorAbi,functionName:"isValidSig",args:[l,d,v]}),...g}:{data:(0,o.encodeDeployData)({abi:n.erc6492SignatureValidatorAbi,args:[l,d,v],bytecode:i.erc6492SignatureValidatorByteCode}),...g},{data:b}=await (0,m.getAction)(e,C.call,"call")(y).catch(e=>{if(e instanceof a.CallExecutionError)throw new T;throw e});if((0,h.hexToBool)(null!=b?b:"0x0"))return!0;throw new T}async function N(e,t){let{address:r,blockNumber:i,blockTag:o,hash:s,signature:l}=t;if((await (0,m.getAction)(e,b.readContract,"readContract")({address:r,abi:n.erc1271Abi,args:[s,l],blockNumber:i,blockTag:o,functionName:"isValidSignature"}).catch(e=>{if(e instanceof a.ContractFunctionExecutionError)throw new T;throw e})).startsWith("0x1626ba7e"))return!0;throw new T}
1class T extends Error{}},378720,e=>{"use strict";e.s(["presignMessagePrefix",()=>t]);let t="\x19Ethereum Signed Message:\n"},196060,e=>{"use strict";e.s(["toPrefixedMessage",()=>a]);var t=e.i(378720),r=e.i(179926),n=e.i(295150),i=e.i(172804);function a(e){let a="string"==typeof e?(0,i.stringToHex)(e):"string"==typeof e.raw?e.raw:(0,i.bytesToHex)(e.raw),o=(0,i.stringToHex)("".concat(t.presignMessagePrefix).concat((0,n.size)(a)));return(0,r.concat)([o,a])}},819648,e=>{"use strict";e.s(["hashMessage",()=>n]);var t=e.i(244733),r=e.i(196060);function n(e,n){return(0,t.keccak256)((0,r.toPrefixedMessage)(e),n)}},89167,e=>{"use strict";e.s(["verifyMessage",()=>n]);var t=e.i(819648),r=e.i(517128);async function n(e,n){let{address:i,message:a,factory:o,factoryData:s,signature:l,...c}=n,u=(0,t.hashMessage)(a);return(0,r.verifyHash)(e,{address:i,factory:o,factoryData:s,hash:u,signature:l,...c})}},794807,e=>{"use strict";e.s(["InvalidDomainError",()=>n,"InvalidPrimaryTypeError",()=>i,"InvalidStructTypeError",()=>a]);var t=e.i(68884),r=e.i(768366);class n extends r.BaseError{constructor({domain:e}){super('Invalid domain "'.concat((0,t.stringify)(e),'".'),{metaMessages:["Must be a valid EIP-712 domain."]})}}class i extends r.BaseError{constructor({primaryType:e,types:t}){super("Invalid primary type `".concat(e,"` must be one of `").concat(JSON.stringify(Object.keys(t)),"`."),{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class a extends r.BaseError{constructor({type:e}){super('Struct type "'.concat(e,'" is invalid.'),{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}},183494,e=>{"use strict";e.s(["getTypesForEIP712Domain",()=>c,"validateTypedData",()=>l]);var t=e.i(38176),r=e.i(728990),n=e.i(794807),i=e.i(515178),a=e.i(295150),o=e.i(172804),s=e.i(779857);function l(e){let{domain:l,message:c,primaryType:u,types:d}=e,p=(e,l)=>{for(let c of e){let{name:e,type:u}=c,h=l[e],f=u.match(s.integerRegex);if(f&&("number"==typeof h||"bigint"==typeof h)){let[e,t,r]=f;(0,o.numberToHex)(h,{signed:"int"===t,size:Number.parseInt(r,10)/8})}if("address"===u&&"string"==typeof h&&!(0,i.isAddress)(h))throw new r.InvalidAddressError({address:h});let m=u.match(s.bytesRegex);if(m){let[e,r]=m;if(r&&(0,a.size)(h)!==Number.parseInt(r,10))throw new t.BytesSizeMismatchError({expectedSize:Number.parseInt(r,10),givenSize:(0,a.size)(h)})}let g=d[u];g&&(function(e){if("address"===e||"bool"===e||"string"===e||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new n.InvalidStructTypeError({type:e})}(u),p(g,h))}};if(d.EIP712Domain&&l){if("object"!=typeof l)throw new n.InvalidDomainError({domain:l});p(d.EIP712Domain,l)}if("EIP712Domain"!==u)if(d[u])p(d[u],c);else throw new n.InvalidPrimaryTypeError({primaryType:u,types:d})}function c(e){let{domain:t}=e;return["string"==typeof(null==t?void 0:t.name)&&{name:"name",type:"string"},(null==t?void 0:t.version)&&{name:"version",type:"string"},("number"==typeof(null==t?void 0:t.chainId)||"bigint"==typeof(null==t?void 0:t.chainId))&&{name:"chainId",type:"uint256"},(null==t?void 0:t.verifyingContract)&&{name:"verifyingContract",type:"address"},(null==t?void 0:t.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}e.i(29633),e.i(68884)},29633,e=>{"use strict";e.s(["hashDomain",()=>s,"hashTypedData",()=>o]);var t=e.i(630930),r=e.i(179926),n=e.i(172804),i=e.i(244733),a=e.i(183494);function o(e){let{domain:t={},message:n,primaryType:o}=e,c={EIP712Domain:(0,a.getTypesForEIP712Domain)({domain:t}),...e.types};(0,a.validateTypedData)({domain:t,message:n,primaryType:o,types:c});let u=["0x1901"];return t&&u.push(s({domain:t,types:c})),"EIP712Domain"!==o&&u.push(l({data:n,primaryType:o,types:c})),(0,i.keccak256)((0,r.concat)(u))}function s(e){let{domain:t,types:r}=e;return l({data:t,primaryType:"EIP712Domain",types:r})}function l(e){let{data:r,primaryType:a,types:o}=e,s=function e(r){let{data:a,primaryType:o,types:s}=r,l=[{type:"bytes32"}],c=[function(e){let{primaryType:t,types:r}=e,a=(0,n.toHex)(function(e){let{primaryType:t,types:r}=e,n="",i=function e(t){let{primaryType:r,types:n}=t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Set,a=r.match(/^\w*/u),o=null==a?void 0:a[0];if(i.has(o)||void 0===n[o])return i;for(let t of(i.add(o),n[o]))e({primaryType:t.type,types:n},i);return i}({primaryType:t,types:r});for(let e of(i.delete(t),[t,...Array.from(i).sort()]))n+="".concat(e,"(").concat(r[e].map(e=>{let{name:t,type:r}=e;return"".concat(r," ").concat(t)}).join(","),")");return n}({primaryType:t,types:r}));return(0,i.keccak256)(a)}({primaryType:o,types:s})];for(let r of s[o]){let[o,u]=function r(a){let{types:o,name:s,type:l,value:c}=a;if(void 0!==o[l])return[{type:"bytes32"},(0,i.keccak256)(e({data:c,primaryType:l,types:o}))];if("bytes"===l){let e=c.length%2?"0":"";return c="0x".concat(e+c.slice(2)),[{type:"bytes32"},(0,i.keccak256)(c)]}if("string"===l)return[{type:"bytes32"},(0,i.keccak256)((0,n.toHex)(c))];if(l.lastIndexOf("]")===l.length-1){let e=l.slice(0,l.lastIndexOf("[")),n=c.map(t=>r({name:s,type:e,types:o,value:t}));return[{type:"bytes32"},(0,i.keccak256)((0,t.encodeAbiParameters)(n.map(e=>{let[t]=e;return t}),n.map(e=>{let[,t]=e;return t})))]}return[{type:l},c]}({types:s,name:r.name,type:r.type,value:a[r.name]});l.push(o),c.push(u)}return(0,t.encodeAbiParameters)(l,c)}({data:r,primaryType:a,types:o});return(0,i.keccak256)(s)}},628704,e=>{"use strict";e.s(["verifyTypedData",()=>n]);
1var t=e.i(29633),r=e.i(517128);async function n(e,n){let{address:i,factory:a,factoryData:o,signature:s,message:l,primaryType:c,types:u,domain:d,...p}=n,h=(0,t.hashTypedData)({message:l,primaryType:c,types:u,domain:d});return(0,r.verifyHash)(e,{address:i,factory:a,factoryData:o,hash:h,signature:s,...p})}},311857,e=>{"use strict";e.s(["observe",()=>i]);let t=new Map,r=new Map,n=0;function i(e,i,a){let o=++n,s=()=>t.get(e)||[],l=()=>{let n=s();if(!n.some(e=>e.id===o))return;let i=r.get(e);if(1===n.length&&i){let e=i();e instanceof Promise&&e.catch(()=>{})}let a=s();t.set(e,a.filter(e=>e.id!==o))},c=s();if(t.set(e,[...c,{id:o,fns:i}]),c&&c.length>0)return l;let u={};for(let e in i)u[e]=function(){for(var t,r,n=arguments.length,i=Array(n),a=0;a<n;a++)i[a]=arguments[a];let o=s();if(0!==o.length)for(let n of o)null==(t=(r=n.fns)[e])||t.call(r,...i)};let d=a(u);return"function"==typeof d&&r.set(e,d),l}},429272,e=>{"use strict";async function t(e){return new Promise(t=>setTimeout(t,e))}e.s(["wait",()=>t])},409690,e=>{"use strict";e.s(["withRetry",()=>r]);var t=e.i(429272);function r(e){let{delay:r=100,retryCount:n=2,shouldRetry:i=()=>!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((a,o)=>{let s=async function(){let{count:l=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=async e=>{let{error:n}=e,i="function"==typeof r?r({count:l,error:n}):r;i&&await (0,t.wait)(i),s({count:l+1})};try{let t=await e();a(t)}catch(e){if(l<n&&await i({count:l,error:e}))return c({error:e});o(e)}};s()})}},192204,e=>{"use strict";e.s(["poll",()=>r]);var t=e.i(429272);function r(e,r){let{emitOnBegin:n,initialWaitTime:i,interval:a}=r,o=!0,s=()=>o=!1;return(async()=>{var r;let l;n&&(l=await e({unpoll:s}));let c=null!=(r=await (null==i?void 0:i(l)))?r:a;await (0,t.wait)(c);let u=async()=>{o&&(await e({unpoll:s}),await (0,t.wait)(a),u())};u()})(),s}},752488,e=>{"use strict";e.s(["watchBlockNumber",()=>s]);var t=e.i(627391),r=e.i(24449),n=e.i(311857),i=e.i(192204),a=e.i(68884),o=e.i(330974);function s(e,s){let l,{emitOnBegin:c=!1,emitMissed:u=!1,onBlockNumber:d,onError:p,poll:h,pollingInterval:f=e.pollingInterval}=s;return(void 0!==h?h:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
1onfig.type&&"ipc"!==e.transport.transports[0].config.type))?(()=>{let t=(0,a.stringify)(["watchBlockNumber",e.uid,c,u,f]);return(0,n.observe)(t,{onBlockNumber:d,onError:p},t=>(0,i.poll)(async()=>{try{let n=await (0,r.getAction)(e,o.getBlockNumber,"getBlockNumber")({cacheTime:0});if(void 0!==l){if(n===l)return;if(n-l>1&&u)for(let e=l+1n;e<n;e++)t.onBlockNumber(e,l),l=e}(void 0===l||n>l)&&(t.onBlockNumber(n,l),l=n)}catch(e){var n;null==(n=t.onError)||n.call(t,e)}},{emitOnBegin:c,interval:f}))})():(()=>{let r=(0,a.stringify)(["watchBlockNumber",e.uid,c,u]);return(0,n.observe)(r,{onBlockNumber:d,onError:p},r=>{let n=!0,i=()=>n=!1;return(async()=>{try{let a=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:o}=await a.subscribe({params:["newHeads"],onData(e){var i;if(!n)return;let a=(0,t.hexToBigInt)(null==(i=e.result)?void 0:i.number);r.onBlockNumber(a,l),l=a},onError(e){var t;null==(t=r.onError)||t.call(r,e)}});i=o,n||i()}catch(e){null==p||p(e)}})(),()=>i()})})()}},885160,e=>{"use strict";e.s(["waitForTransactionReceipt",()=>p]);var t=e.i(819374),r=e.i(317907),n=e.i(24449),i=e.i(311857),a=e.i(804727),o=e.i(409690),s=e.i(68884),l=e.i(357007),c=e.i(409210),u=e.i(805539),d=e.i(752488);async function p(e,p){var h;let f,m,g,v,C,{checkReplacement:y=!0,confirmations:b=1,hash:w,onReplaced:E,retryCount:A=6,retryDelay:N=e=>{let{count:t}=e;return 200*~~(1<<t)},timeout:T=18e4}=p,I=(0,s.stringify)(["waitForTransactionReceipt",e.uid,w]),P=p.pollingInterval?p.pollingInterval:(null==(h=e.chain)?void 0:h.experimental_preconfirmationTime)?e.chain.experimental_preconfirmationTime:e.pollingInterval,k=!1,{promise:U,resolve:S,reject:R}=(0,a.withResolvers)(),x=T?setTimeout(()=>{null==C||C(),null==v||v(),R(new r.WaitForTransactionReceiptTimeoutError({hash:w}))},T):void 0;return v=(0,i.observe)(I,{onReplaced:E,resolve:S,reject:R},async i=>{if((g=await (0,n.getAction)(e,u.getTransactionReceipt,"getTransactionReceipt")({hash:w}).catch(()=>void 0))&&b<=1){clearTimeout(x),i.resolve(g),null==v||v();return}C=(0,n.getAction)(e,d.watchBlockNumber,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:P,async onBlockNumber(a){let s=e=>{clearTimeout(x),null==C||C(),e(),null==v||v()},d=a;if(!k)try{if(g){if(b>1&&(!g.blockNumber||d-g.blockNumber+1n<b))return;s(()=>i.resolve(g));return}if(y&&!f&&(k=!0,await (0,o.withRetry)(async()=>{(f=await (0,n.getAction)(e,c.getTransaction,"getTransaction")({hash:w})).blockNumber&&(d=f.blockNumber)},{delay:N,retryCount:A}),k=!1),g=await (0,n.getAction)(e,u.getTransactionReceipt,"getTransactionReceipt")({hash:w}),b>1&&(!g.blockNumber||d-g.blockNumber+1n<b))return;s(()=>i.resolve(g))}catch(a){if(a instanceof r.TransactionNotFoundError||a instanceof r.TransactionReceiptNotFoundError){if(!f){k=!1;return}try{m=f,k=!0;let r=await (0,o.withRetry)(()=>(0,n.getAction)(e,l.getBlock,"getBlock")({blockNumber:d,includeTransactions:!0}),{delay:N,retryCount:A,shouldRetry:e=>{let{error:r}=e;return r instanceof t.BlockNotFoundError}});k=!1;let a=r.transactions.find(e=>{let{from:t,nonce:r}=e;return t===m.from&&r===m.nonce});if(!a||(g=await (0,n.getAction)(e,u.getTransactionReceipt,"getTransactionReceipt")({hash:a.hash}),b>1&&(!g.blockNumber||d-g.blockNumber+1n<b)))return;let c="replaced";a.to===m.to&&a.value===m.value&&a.input===m.input?c="repriced":a.from===a.to&&0n===a.value&&(c="cancelled"),s(()=>{var e;null==(e=i.onReplaced)||e.call(i,{reason:c,replacedTransaction:m,transaction:a,transactionReceipt:g}),i.resolve(g)})}catch(e){s(()=>i.reject(e))}}else s(()=>i.reject(a))}}})}),U}},321341,e=>{"use strict";e.s(["watchBlocks",()=>s]);var t,r=e.i(24449),n=e.i(311857),i=e.i(192204),a=e.i(68884),o=e.i(357007);function s(e,s){let l,c,u,d,{blockTag:p=null!=(t=e.experimental_blockTag)?t:"latest",emitMissed:h=!1,emitOnBegin:f=!1,onBlock:m,onError:g,includeTransactions:v,poll:C,pollingInterval:y=e.pollingInterval}=s,b=void 0!==C?C:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
1onfig.type&&"ipc"!==e.transport.transports[0].config.type),w=null!=v&&v;return b?(()=>{let t=(0,a.stringify)(["watchBlocks",e.uid,p,h,f,w,y]);return(0,n.observe)(t,{onBlock:m,onError:g},t=>(0,i.poll)(async()=>{try{let n=await (0,r.getAction)(e,o.getBlock,"getBlock")({blockTag:p,includeTransactions:w});if(null!==n.number&&(null==d?void 0:d.number)!=null){if(n.number===d.number)return;if(n.number-d.number>1&&h)for(let i=(null==d?void 0:d.number)+1n;i<n.number;i++){let n=await (0,r.getAction)(e,o.getBlock,"getBlock")({blockNumber:i,includeTransactions:w});t.onBlock(n,d),d=n}}((null==d?void 0:d.number)==null||"pending"===p&&(null==n?void 0:n.number)==null||null!==n.number&&n.number>d.number)&&(t.onBlock(n,d),d=n)}catch(e){var n;null==(n=t.onError)||n.call(t,e)}},{emitOnBegin:f,interval:y}))})():(l=!0,c=!0,u=()=>l=!1,(async()=>{try{f&&(0,r.getAction)(e,o.getBlock,"getBlock")({blockTag:p,includeTransactions:w}).then(e=>{l&&c&&(m(e,void 0),c=!1)}).catch(g);let t=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:n}=await t.subscribe({params:["newHeads"],async onData(t){var n;if(!l)return;let i=await (0,r.getAction)(e,o.getBlock,"getBlock")({blockNumber:null==(n=t.result)?void 0:n.number,includeTransactions:w}).catch(()=>{});l&&(m(i,d),c=!1,d=i)},onError(e){null==g||g(e)}});u=n,l||u()}catch(e){null==g||g(e)}})(),()=>u())}},263453,e=>{"use strict";e.s(["watchContractEvent",()=>m]);var t=e.i(38176),r=e.i(109057),n=e.i(748603),i=e.i(855260),a=e.i(143113),o=e.i(24449),s=e.i(311857),l=e.i(192204),c=e.i(68884),u=e.i(410437),d=e.i(330974),p=e.i(647998),h=e.i(348578),f=e.i(556173);function m(e,m){let{abi:g,address:v,args:C,batch:y=!0,eventName:b,fromBlock:w,onError:E,onLogs:A,poll:N,pollingInterval:T=e.pollingInterval,strict:I}=m;return(void 0!==N?N:"bigint"==typeof w||"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
1onfig.type&&"ipc"!==e.transport.transports[0].config.type))?(()=>{let t=null!=I&&I,n=(0,c.stringify)(["watchContractEvent",v,C,y,e.uid,b,T,t,w]);return(0,s.observe)(n,{onLogs:A,onError:E},n=>{let i,a;void 0!==w&&(i=w-1n);let s=!1,c=(0,l.poll)(async()=>{if(!s){try{a=await (0,o.getAction)(e,u.createContractEventFilter,"createContractEventFilter")({abi:g,address:v,args:C,eventName:b,strict:t,fromBlock:w})}catch(e){}s=!0;return}try{let r;if(a)r=await (0,o.getAction)(e,h.getFilterChanges,"getFilterChanges")({filter:a});else{let n=await (0,o.getAction)(e,d.getBlockNumber,"getBlockNumber")({});r=i&&i<n?await (0,o.getAction)(e,p.getContractEvents,"getContractEvents")({abi:g,address:v,args:C,eventName:b,fromBlock:i+1n,toBlock:n,strict:t}):[],i=n}if(0===r.length)return;if(y)n.onLogs(r);else for(let e of r)n.onLogs([e])}catch(e){var l;a&&e instanceof r.InvalidInputRpcError&&(s=!1),null==(l=n.onError)||l.call(n,e)}},{emitOnBegin:!0,interval:T});return async()=>{a&&await (0,o.getAction)(e,f.uninstallFilter,"uninstallFilter")({filter:a}),c()}})})():(()=>{let r=(0,c.stringify)(["watchContractEvent",v,C,y,e.uid,b,T,null!=I&&I]),o=!0,l=()=>o=!1;return(0,s.observe)(r,{onLogs:A,onError:E},r=>((async()=>{try{let s=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),c=b?(0,i.encodeEventTopics)({abi:g,eventName:b,args:C}):[],{unsubscribe:u}=await s.subscribe({params:["logs",{address:v,topics:c}],onData(e){if(!o)return;let i=e.result;try{let{eventName:e,args:t}=(0,n.decodeEventLog)({abi:g,data:i.data,topics:i.topics,strict:I}),o=(0,a.formatLog)(i,{args:t,eventName:e});r.onLogs([o])}catch(l){let e,n;if(l instanceof t.DecodeLogDataMismatch||l instanceof t.DecodeLogTopicsMismatch){var s;if(I)return;e=l.abiItem.name,n=null==(s=l.abiItem.inputs)?void 0:s.some(e=>!("name"in e&&e.name))}let o=(0,a.formatLog)(i,{args:n?[]:{},eventName:e});r.onLogs([o])}},onError(e){var t;null==(t=r.onError)||t.call(r,e)}});l=u,o||l()}catch(e){null==E||E(e)}})(),()=>l()))})()}},166222,e=>{"use strict";e.s(["watchEvent",()=>m]);var t=e.i(38176),r=e.i(109057),n=e.i(748603),i=e.i(855260),a=e.i(143113),o=e.i(24449),s=e.i(311857),l=e.i(192204),c=e.i(68884),u=e.i(807769),d=e.i(330974),p=e.i(348578),h=e.i(211758),f=e.i(556173);function m(e,m){let g,v,{address:C,args:y,batch:b=!0,event:w,events:E,fromBlock:A,onError:N,onLogs:T,poll:I,pollingInterval:P=e.pollingInterval,strict:k}=m,U=void 0!==I?I:"bigint"==typeof A||"webSocket"!==e.transport.type&&"ipc"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].c
1onfig.type&&"ipc"!==e.transport.transports[0].config.type),S=null!=k&&k;return U?(()=>{let t=(0,c.stringify)(["watchEvent",C,y,b,e.uid,w,P,A]);return(0,s.observe)(t,{onLogs:T,onError:N},t=>{let n,i;void 0!==A&&(n=A-1n);let a=!1,s=(0,l.poll)(async()=>{if(!a){try{i=await (0,o.getAction)(e,u.createEventFilter,"createEventFilter")({address:C,args:y,event:w,events:E,strict:S,fromBlock:A})}catch(e){}a=!0;return}try{let r;if(i)r=await (0,o.getAction)(e,p.getFilterChanges,"getFilterChanges")({filter:i});else{let t=await (0,o.getAction)(e,d.getBlockNumber,"getBlockNumber")({});r=n&&n!==t?await (0,o.getAction)(e,h.getLogs,"getLogs")({address:C,args:y,event:w,events:E,fromBlock:n+1n,toBlock:t}):[],n=t}if(0===r.length)return;if(b)t.onLogs(r);else for(let e of r)t.onLogs([e])}catch(e){var s;i&&e instanceof r.InvalidInputRpcError&&(a=!1),null==(s=t.onError)||s.call(t,e)}},{emitOnBegin:!0,interval:P});return async()=>{i&&await (0,o.getAction)(e,f.uninstallFilter,"uninstallFilter")({filter:i}),s()}})})():(g=!0,v=()=>g=!1,(async()=>{try{let r=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type||"ipc"===e.config.type);return t?t.value:e.transport}return e.transport})(),o=null!=E?E:w?[w]:void 0,s=[];o&&(s=[o.flatMap(e=>(0,i.encodeEventTopics)({abi:[e],eventName:e.name,args:y}))],w&&(s=s[0]));let{unsubscribe:l}=await r.subscribe({params:["logs",{address:C,topics:s}],onData(e){if(!g)return;let r=e.result;try{let{eventName:e,args:t}=(0,n.decodeEventLog)({abi:null!=o?o:[],data:r.data,topics:r.topics,strict:S}),i=(0,a.formatLog)(r,{args:t,eventName:e});T([i])}catch(s){let e,n;if(s instanceof t.DecodeLogDataMismatch||s instanceof t.DecodeLogTopicsMismatch){var i;if(k)return;e=s.abiItem.name,n=null==(i=s.abiItem.inputs)?void 0:i.some(e=>!("name"in e&&e.name))}let o=(0,a.formatLog)(r,{args:n?[]:{},eventName:e});T([o])}},onError(e){null==N||N(e)}});v=l,g||v()}catch(e){null==N||N(e)}})(),()=>v())}},42055,e=>{"use strict";e.s(["watchPendingTransactions",()=>l]);var t=e.i(24449),r=e.i(311857),n=e.i(192204),i=e.i(68884),a=e.i(217437),o=e.i(348578),s=e.i(556173);function l(e,l){let c,u,{batch:d=!0,onError:p,onTransactions:h,poll:f,pollingInterval:m=e.pollingInterval}=l;return(void 0!==f?f:"webSocket"!==e.transport.type&&"ipc"!==e.transport.type)?(()=>{let l=(0,i.stringify)(["watchPendingTransactions",e.uid,d,m]);return(0,r.observe)(l,{onTransactions:h,onError:p},r=>{let i,l=(0,n.poll)(async()=>{try{if(!i)try{i=await (0,t.getAction)(e,a.createPendingTransactionFilter,"createPendingTransactionFilter")({});return}catch(e){throw l(),e}let n=await (0,t.getAction)(e,o.getFilterChanges,"getFilterChanges")({filter:i});if(0===n.length)return;if(d)r.onTransactions(n);else for(let e of n)r.onTransactions([e])}catch(e){var n;null==(n=r.onError)||n.call(r,e)}},{emitOnBegin:!0,interval:m});return async()=>{i&&await (0,t.getAction)(e,s.uninstallFilter,"uninstallFilter")({filter:i}),l()}})})():(c=!0,u=()=>c=!1,(async()=>{try{let{unsubscribe:t}=await e.transport.subscribe({params:["newPendingTransactions"],onData(e){if(!c)return;let t=e.result;h([t])},onError(e){null==p||p(e)}});u=t,c||u()}catch(e){null==p||p(e)}})(),()=>u())}},641063,e=>{"use strict";function t(e){var t,i,a,o,s;let{scheme:l,statement:c,...u}=null!=(o=null==(t=e.match(r))?void 0:t.groups)?o:{},{chainId:d,expirationTime:p,issuedAt:h,notBefore:f,requestId:m,...g}=null!=(s=null==(i=e.match(n))?void 0:i.groups)?s:{},v=null==(a=e.split("Resources:")[1])?void 0:a.split("\n- ").slice(1);return{...u,...g,...d?{chainId:Number(d)}:{},...p?{expirationTime:new Date(p)}:{},...h?{issuedAt:new Date(h)}:{},...f?{notBefore:new Date(f)}:{},...m?{requestId:m}:{},...v?{resources:v}:{},...l?{scheme:l}:{},...c?{statement:c}:{}}}e.s(["parseSiweMessage",()=>t]);let r=RegExp("^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\\/\\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\\n)(?<address>0x[a-fA-F0-9]{40})\\n\\n(?:(?<statement>.*)\\n\\n)?"),n=RegExp("(?:URI: (?<uri>.+))\\n(?:Version: (?<version>.+))\\n(?:Chain ID: (?<chainId>
1\\d+))\\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\\n(?:Issued At: (?<issuedAt>.+))(?:\\nExpiration Time: (?<expirationTime>.+))?(?:\\nNot Before: (?<notBefore>.+))?(?:\\nRequest ID: (?<requestId>.+))?")},617513,e=>{"use strict";e.s(["validateSiweMessage",()=>n]);var t=e.i(515178),r=e.i(798972);function n(e){let{address:n,domain:i,message:a,nonce:o,scheme:s,time:l=new Date}=e;if(i&&a.domain!==i||o&&a.nonce!==o||s&&a.scheme!==s||a.expirationTime&&l>=a.expirationTime||a.notBefore&&l<a.notBefore)return!1;try{if(!a.address||!(0,t.isAddress)(a.address,{strict:!1})||n&&!(0,r.isAddressEqual)(a.address,n))return!1}catch(e){return!1}return!0}},926509,e=>{"use strict";e.s(["verifySiweMessage",()=>a]);var t=e.i(819648),r=e.i(641063),n=e.i(617513),i=e.i(517128);async function a(e,a){let{address:o,domain:s,message:l,nonce:c,scheme:u,signature:d,time:p=new Date,...h}=a,f=(0,r.parseSiweMessage)(l);if(!f.address||!(0,n.validateSiweMessage)({address:o,domain:s,message:f,nonce:c,scheme:u,time:p}))return!1;let m=(0,t.hashMessage)(l);return(0,i.verifyHash)(e,{address:f.address,hash:m,signature:d,...h})}},456595,e=>{"use strict";async function t(e,t){let{serializedTransaction:r}=t;return e.request({method:"eth_sendRawTransaction",params:[r]},{retryCount:0})}e.s(["sendRawTransaction",()=>t])},452845,e=>{"use strict";e.s(["publicActions",()=>ee]);var t=e.i(292456),r=e.i(872682),n=e.i(737257),i=e.i(142518),a=e.i(145959),o=e.i(355534),s=e.i(901467),l=e.i(151239),c=e.i(410437),u=e.i(807769),d=e.i(217437),p=e.i(968980),h=e.i(715798),f=e.i(277997),m=e.i(686269),g=e.i(236599),v=e.i(157166),C=e.i(357007),y=e.i(330974),b=e.i(344223),w=e.i(942573),E=e.i(898089),A=e.i(647998),N=e.i(450496),T=e.i(912032),I=e.i(348578),P=e.i(491076),k=e.i(778036),U=e.i(211758),S=e.i(611012),R=e.i(874127),x=e.i(409210),O=e.i(590354),B=e.i(411606),F=e.i(805539),_=e.i(202246),L=e.i(721200),D=e.i(855626),M=e.i(939536),W=e.i(110449),H=e.i(556173),z=e.i(517128),q=e.i(89167),G=e.i(628704),j=e.i(885160),V=e.i(752488),K=e.i(321341),X=e.i(263453),Y=e.i(166222),Z=e.i(42055),$=e.i(926509),J=e.i(276130),Q=e.i(456595);function ee(e){return{call:t=>(0,o.call)(e,t),createAccessList:t=>(0,s.createAccessList)(e,t),createBlockFilter:()=>(0,l.createBlockFilter)(e),createContractEventFilter:t=>(0,c.createContractEventFilter)(e,t),createEventFilter:t=>(0,u.createEventFilter)(e,t),createPendingTransactionFilter:()=>(0,d.createPendingTransactionFilter)(e),estimateContractGas:t=>(0,p.estimateContractGas)(e,t),estimateGas:t=>(0,f.estimateGas)(e,t),getBalance:t=>(0,g.getBalance)(e,t),getBlobBaseFee:()=>(0,v.getBlobBaseFee)(e),getBlock:t=>(0,C.getBlock)(e,t),getBlockNumber:t=>(0,y.getBlockNumber)(e,t),getBlockTransactionCount:t=>(0,b.getBlockTransactionCount)(e,t),getBytecode:t=>(0,E.getCode)(e,t),getChainId:()=>(0,w.getChainId)(e),getCode:t=>(0,E.getCode)(e,t),getContractEvents:t=>(0,A.getContractEvents)(e,t),getEip712Domain:t=>(0,N.getEip712Domain)(e,t),getEnsAddress:r=>(0,t.getEnsAddress)(e,r),getEnsAvatar:t=>(0,r.getEnsAvatar)(e,t),getEnsName:t=>(0,n.getEnsName)(e,t),getEnsResolver:t=>(0,i.getEnsResolver)(e,t),getEnsText:t=>(0,a.getEnsText)(e,t),getFeeHistory:t=>(0,T.getFeeHistory)(e,t),estimateFeesPerGas:t=>(0,h.estimateFeesPerGas)(e,t),getFilterChanges:t=>(0,I.getFilterChanges)(e,t),getFilterLogs:t=>(0,P.getFilterLogs)(e,t),getGasPrice:()=>(0,k.getGasPrice)(e),getLogs:t=>(0,U.getLogs)(e,t),getProof:t=>(0,S.getProof)(e,t),estimateMaxPriorityFeePerGas:t=>(0,m.estimateMaxPriorityFeePerGas)(e,t),getStorageAt:t=>(0,R.getStorageAt)(e,t),getTransaction:t=>(0,x.getTransaction)(e,t),getTransactionConfirmations:t=>(0,O.getTransactionConfirmations)(e,t),getTransactionCount:t=>(0,B.getTransactionCount)(e,t),getTransactionReceipt:t=>(0,F.getTransactionReceipt)(e,t),multicall:t=>(0,_.multicall)(e,t),prepareTransactionRequest:t=>(0,J.prepareTransactionRequest)(e,t),readContract:t=>(0,L.readContract)(e,t),sendRawTransaction:t=>(0,Q.sendRawTransaction)(e,t),simulate:t=>(0,D.simulateBlocks)(e,t),simulateBlocks:t=>(0,D.simulateBlocks)(e,t),simulateCalls:t=>(0,M.simulateCalls)(e,t),simulateContract:t=>(0,W.simulateContract)(e,t),verifyHash:t=>(0,z.verifyHash)(e,t),verifyMessage:t=>(0,q.verifyMessage)(e,t),verifySiweMessage:t=>(0,$.verifySiweMessage)(e,t),verifyTypedData:t=>(0,G.verifyTypedData)(e,t),uninstallFilter:t=>(0,H.uninstallFilter)(e,t),waitForTransactionReceipt:t=>(0,j.waitForTransactionReceipt)(e,t),watchBlocks:t=>(0,K.watchBlocks)(e,t),watchBlockNumber:t=>(0,V.watchBlockNumber)(e,t),watchContractEvent:t=>(0,X.watchContractEvent)(e,t),watchEvent:t=>(0,Y.watchEvent)(e,t),watchPendingTransactions:t=>(0,Z.watchPendingTransactions)(e,t)}}},837074,e=>{"use strict";e.s(["createPublicClient",()=>n]);var t=e.i(608165),r=e.i(452845);function n(e){let{key:n="public",name:i="Public Client"}=e;return(0,t.createClient)({...e,key:n,name:i,type:"publicClient"}).extend(r.publicActions)}},692968,e=>{"use strict";e.s(["UrlRequiredError",()=>r]);var t=e.i(768366);class r extends t.BaseError{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}},625763,e=>{"use strict";function t(e,t){let{errorInstance:r=Error("timed out"),timeout:n,signal:i}=t;return new Promise((t,a)=>{(async()=>{let o;try{let s=new AbortController;n>0&&(o=setTimeout(()=>{i?s.abort():a(r)},n)),t(await e({signal:(null==s?void 0:s.signal)||null}))}catch(e){(null==e?void 0:e.name)==="AbortError"&&a(r),a(e)}finally{clearTimeout(o)}})()})}e.s(["withTimeout",()=>t])},223755,e=>{"use strict";e.s(["idCache",()=>t]);let t={current:0,take(){return this.current++},reset(){this.current=0}}},414902,e=>{"use strict";e.s(["getHttpRpcClient",()=>
1a]);var t=e.i(197957),r=e.i(625763),n=e.i(68884),i=e.i(223755);function a(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{async request(o){var s,l,c,u,d;let{body:p,fetchFn:h=null!=(s=a.fetchFn)?s:fetch,onRequest:f=a.onRequest,onResponse:m=a.onResponse,timeout:g=null!=(l=a.timeout)?l:1e4}=o,v={...null!=(c=a.fetchOptions)?c:{},...null!=(u=o.fetchOptions)?u:{}},{headers:C,method:y,signal:b}=v;try{let a,o=await (0,r.withTimeout)(async t=>{var r,a,o;let{signal:s}=t,l={...v,body:Array.isArray(p)?(0,n.stringify)(p.map(e=>{var t;return{jsonrpc:"2.0",id:null!=(t=e.id)?t:i.idCache.take(),...e}})):(0,n.stringify)({jsonrpc:"2.0",id:null!=(r=p.id)?r:i.idCache.take(),...p}),headers:{"Content-Type":"application/json",...C},method:y||"POST",signal:b||(g>0?s:null)},c=new Request(e,l),u=null!=(a=await (null==f?void 0:f(c,l)))?a:{...l,url:e};return await h(null!=(o=u.url)?o:e,u)},{errorInstance:new t.TimeoutError({body:p,url:e}),timeout:g,signal:!0});if(m&&await m(o),null==(d=o.headers.get("Content-Type"))?void 0:d.startsWith("application/json"))a=await o.json();else{a=await o.text();try{a=JSON.parse(a||"{}")}catch(e){if(o.ok)throw e;a={error:a}}}if(!o.ok)throw new t.HttpRequestError({body:p,details:(0,n.stringify)(a.error)||o.statusText,headers:o.headers,status:o.status,url:e});return a}catch(r){if(r instanceof t.HttpRequestError||r instanceof t.TimeoutError)throw r;throw new t.HttpRequestError({body:p,cause:r,url:e})}}}}},907371,e=>{"use strict";e.s(["withDedupe",()=>r]);let t=new(e.i(390377)).LruMap(8192);function r(e,r){let{enabled:n=!0,id:i}=r;if(!n||!i)return e();if(t.get(i))return t.get(i);let a=e().finally(()=>t.delete(i));return t.set(i,a),a}},370415,e=>{"use strict";e.s(["buildRequest",()=>l]);var t=e.i(768366),r=e.i(197957),n=e.i(109057),i=e.i(172804),a=e.i(907371),o=e.i(409690),s=e.i(68884);function l(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async function(c){var u;let d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{dedupe:p=!1,methods:h,retryDelay:f=150,retryCount:m=3,uid:g}={...l,...d},{method:v}=c;if((null==h||null==(u=h.exclude)?void 0:u.includes(v))||(null==h?void 0:h.include)&&!h.include.includes(v))throw new n.MethodNotSupportedRpcError(Error("method not supported"),{method:v});let C=p?(0,i.stringToHex)("".concat(g,".").concat((0,s.stringify)(c))):void 0;return(0,a.withDedupe)(()=>(0,o.withRetry)(async()=>{try{return await e(c)}catch(e){switch(e.code){case n.ParseRpcError.code:throw new n.ParseRpcError(e);case n.InvalidRequestRpcError.code:throw new n.InvalidRequestRpcError(e);case n.MethodNotFoundRpcError.code:throw new n.MethodNotFoundRpcError(e,{method:c.method});case n.InvalidParamsRpcError.code:throw new n.InvalidParamsRpcError(e);case n.InternalRpcError.code:throw new n.InternalRpcError(e);case n.InvalidInputRpcError.code:throw new n.InvalidInputRpcError(e);case n.ResourceNotFoundRpcError.code:throw new n.ResourceNotFoundRpcError(e);case n.ResourceUnavailableRpcError.code:throw new n.ResourceUnavailableRpcError(e);case n.TransactionRejectedRpcError.code:throw new n.TransactionRejectedRpcError(e);case n.MethodNotSupportedRpcError.code:throw new n.MethodNotSupportedRpcError(e,{method:c.method});case n.LimitExceededRpcError.code:throw new n.LimitExceededRpcError(e);case n.JsonRpcVersionUnsupportedError.code:throw new n.JsonRpcVersionUnsupportedError(e);case n.UserRejectedRequestError.code:throw new n.UserRejectedRequestError(e);case n.UnauthorizedProviderError.code:throw new n.UnauthorizedProviderError(e);case n.UnsupportedProviderMethodError.code:throw new n.UnsupportedProviderMethodError(e);case n.ProviderDisconnectedError.code:throw new n.ProviderDisconnectedError(e);case n.ChainDisconnectedError.code:throw new n.ChainDisconnectedError(e);case n.SwitchChainError.code:throw new n.SwitchChainError(e);case n.UnsupportedNonOptionalCapabilityError.code:throw new n.UnsupportedNonOptionalCapabilityError(e);case n.UnsupportedChainIdError.code:throw new n.UnsupportedChainIdError(e);case n.DuplicateIdError.code:throw new n.DuplicateIdError(e);case n.UnknownBundleIdError.code:throw new n.UnknownBundleIdError(e);case n.BundleTooLargeError.code:throw new n.BundleTooLargeError(e);case n.AtomicReadyWalletRejectedUpgradeError.code:throw new n.AtomicReadyWalletRejectedUpgradeError(e);case n.AtomicityNotSupportedError.code:throw new n.AtomicityNotSupportedError(e);case 5e3:throw new n.UserRejectedRequestError(e);default:if(e instanceof t.BaseError)throw e;throw new n.UnknownRpcError(e)}}},{delay:e=>{let{count:t,error:n}=e;if(n&&n instanceof r.HttpRequestError){var i;let e=null==n||null==(i=n.headers)?void 0:i.get("Retry-After");if(null==e?void 0:e.match(/\d/))return 1e3*Number.parseInt(e,10)}return~~(1<<t)*f},retryCount:m,shouldRetry:e=>{var t;let{error:i}=e;return"code"in(t=i)&&"number"==typeof t.code?-1===t.code||t.code===n.LimitExceededRpcError.code||t.code===n.InternalRpcError.code:!(t instanceof r.HttpRequestError)||!t.status||403===t.status||408===t.status||413===t.status||429===t.status||500===t.status||502===t.status||503===t.status||504===t.status||!1}}),{enabled:p,id:C})}}},349211,e=>{"use strict";e.s(["createTransport",()=>n]);var t=e.i(370415),r=e.i(46596);function n(e,n){let{key:i,methods:a,name:o,request:s,retryCount:l=3,retryDelay:c=150,timeout:u,type:d}=e,p=(0,r.uid)();return{config:{key:i,methods:a,name:o,request:s,retryCount:l,retryDelay:c,timeout:u,type:d},request:(0,t.buildRequest)(s,{methods:a,retryCount:l,retryDelay:c,uid:p}),value:n}}},47795,e=>{"use strict";e.s(["http",()=>o]);var t=e.i(197957),r=e.i(692968),n=e.i(920025),i=e.i(414902),a=e.i(349211);function o(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{batch:s,fetchFn:l,fetchOptions:c,key:u="http",methods:d,name:p="HTTP JSON-RPC",onFetchRequest:h,onFetchResponse:f,retryDelay:m,raw:g}=o;return v=>{var C,y;let{chain:b,retryCount:w,timeout:E}=v,{batchSize:A=1e3,wait:N=0}="object"==typeof s?s:{},T=null!=(C=o.retryCount)?C:w,I=null!=(y=null!=E?E:o.timeout)?y:1e4,P=e||(null==b?void 0:b.rpcUrls.default.http[0]);if(!P)throw new r.UrlRequiredError;let k=(0,i.getHttpRpcClient)(P,{fetchFn:l,fetchOptions:c,onRequest:h,onResponse:f,timeout:I});return(0,a.createTransport)({key:u,methods:d,name:p,async request(e){let{method:r,params:i}=e,a={method:r,params:i},{schedule:o}=(0,n.createBatchScheduler)({id:P,wait:N,shouldSplitBatch:e=>e.length>A,fn:e=>k.request({body:e}),sort:(e,t)=>e.id-t.id}),l=async e=>s?o(e):[await k.request({body:e})],[{error:c,result:u}]=await l(a);if(g)return{error:c,result:u};if(c)throw new t.RpcRequestError({body:a,error:c,url:P});return u},retryCount:T,retryDelay:m,timeout:I,type:"http"},{fetchOptions:c,url:P})}}},232914,e=>{"use strict";e.s(["getAddressFromMessage",()=>r]),e.i(837074),e.i(47795),e.i(80140);let t=/0x[a-fA-F0-9]{40}/u;function r(e){var r;return(null==(r=e.match(t))?void 0:r[0])||""}RegExp("Chain ID: (?<temp1>\\d+)","u")},296296,e=>{"use strict";e.s(["siweConfig",()=>p]);var t=e.i(449438),r=e.i(370172),n=e.i(220861),i=e.i(720473),a=e.i(889664),o=e.i(550101),s=e.i(701166),l=e.i(238160),c=e.i(232914),u=e.i(517178);function d(){["/login"].includes(window.location.pathname)||(window.location.href="/login")}let p=(0,s.createSIWEConfig)({signOutOnDisconnect:!0,signOutOnAccountChange:!1,signOutOnNetworkChange:!1,getMessageParams:async()=>({domain:window.location.host,uri:window.location.origin,chains:[u.mainnet.id],statement:"Sign in with Ethereum to CoinFello"}),createMessage:e=>{let{address:t,...r}=e;return(0,l.formatMessage)(r,t.replace(/^(did:pkh:eip155:)\d+(:)/,"$1".concat(u.mainnet.id,"$2")))},getNonce:async e=>{let{data:r,error:n}
1=await t.authClient.siwe.nonce({...e?{walletAddress:e}:{},chainId:u.mainnet.id});if(n||!(null==r?void 0:r.nonce))throw Error((null==n?void 0:n.message)||"Failed to get nonce from server");return r.nonce},getSession:async()=>{try{let e=await fetch("/api/wallet_address");if(!e.ok)return d(),null;let t=await e.json();if(!t)return d(),null;if(t&&t.length&&"string"==typeof t[0].address&&t[0].address.startsWith("0x"))return t[0];d()}catch(e){return console.error("Failed to fetch wallet addresses:",e),d(),null}},verifyMessage:async e=>{let{message:r,signature:n}=e,i=(0,c.getAddressFromMessage)(r),{error:a}=await t.authClient.siwe.verify({message:r,signature:n,walletAddress:i,chainId:u.mainnet.id});return!a||(console.error("[SIWE Client] verify failed:",a.message),!1)},onSignIn:void 0,signOut:async()=>{try{return await t.authClient.signOut(),(0,n.notifyPrivyLogoutRequested)(),(0,a.resetActiveAccountType)(),(0,o.clearSmartWalletAddress)(),await (0,i.safeClearRecentWagmiConnector)(r.config.wagmiConfig.storage),d(),!0}catch(e){return console.error("".concat(e)),!1}}})},188930,e=>{"use strict";e.s(["X_PIXEL_IDS",()=>s,"trackXEmailSmsSignIn",()=>p,"trackXWalletConnect",()=>d,"useXPixelPageTracking",()=>h]);var t=e.i(534098),r=e.i(53422),n=e.i(278621),i=e.i(407858),a=e.i(374613);function o(e){return e?e.split(",").map(e=>e.trim()).filter(Boolean):[]}let s=o("relnc,rboaq"),l=o("tw-rboaq-rcfsp"),c=o("tw-rboaq-rcfsv");function u(e,t,r){if(!a.isCapacitor&&"granted"===(0,i.readConsentSync)()){if(s.length&&e.length&&window.twq)for(let t of e)window.twq("event",t,{value:null,currency:"USD"})}}function d(){u(l,"wallet","NEXT_PUBLIC_X_PIXEL_CONVERSION_EVENT_ID")}function p(){u(c,"email/SMS","NEXT_PUBLIC_X_PIXEL_EMAIL_SMS_EVENT_ID")}function h(){let e=(0,r.usePathname)(),{isGranted:i}=(0,n.useCookieConsent)(),o=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(!a.isCapacitor&&i){if(!o.current){o.current=!0;return}!a.isCapacitor&&s.length&&window.twq&&window.twq("event","PageView")}},[e,i])}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.