1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9a149249-8177-4bd3-abda-cc21f544e24b",e._sentryDebugIdIdentifier="sentry-dbid-9a149249-8177-4bd3-abda-cc21f544e24b")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[596],{596:(e,t,n)=>{n.d(t,{baseAccount:()=>o,safe:()=>u});var a=n(86241),i=n(92425),r=n(65969),c=n(41632),s=n(11849);function o(e={}){let t,d,h,u;return(0,a.U)(a=>({id:"baseAccount",name:"Base Account",rdns:"app.base.account",type:"baseAccount",async connect({chainId:e,withCapabilities:t,...n}={}){try{let o=await this.getProvider(),l=e??a.chains[0]?.id;if(!l)throw new i.nk;let{accounts:w,currentChainId:p}=await (async()=>{if(n.isReconnecting)return{accounts:(await o.request({method:"eth_accounts",params:[]})).map(e=>({address:(0,r.b)(e)})),currentChainId:await this.getChainId()};let e=await o.request({method:"wallet_connect",params:[{capabilities:"capabilities"in n&&n.capabilities?n.capabilities:{},chainIds:[(0,c.cK)(l),...a.chains.filter(e=>e.id!==l).map(e=>(0,c.cK)(e.id))]}]});return{accounts:(await o.request({method:"eth_accounts"})).map(t=>e.accounts.find(e=>e.address===t)??{address:t}).map(e=>({address:(0,r.b)(e.address),capabilities:e.capabilities??{}})),currentChainId:Number(e.chainIds[0])}})();if(d||(d=this.onAccountsChanged.bind(this),o.on("accountsChanged",d)),h||(h=this.onChainChanged.bind(this),o.on("chainChanged",h)),u||(u=this.onDisconnect.bind(this),o.on("disconnect",u)),e&&p!==e){let t=await this.switchChain({chainId:e}).catch(e=>{if(e.code===s.vx.code)throw e;return{id:p}});p=t?.id??p}return{accounts:t?w:w.map(e=>e.address),chainId:p}}catch(e){if(/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(e.message))throw new s.vx(e);throw e}},async disconnect(){let e=await this.getProvider();d&&(e.removeListener("accountsChanged",d),d=void 0),h&&(e.removeListener("chainChanged",h),h=void 0),u&&(e.removeListener("disconnect",u),u=void 0),e.disconnect()},async getAccounts(){let e=await this.getProvider();return(await e.request({method:"eth_accounts"})).map(e=>(0,r.b)(e))},async getChainId(){let e=await this.getProvider();return Number(await e.request({method:"eth_chainId"}))}
1,async getProvider(){if(!t){let i="string"==typeof e.preference?{options:e.preference}:{...e.preference,options:e.preference?.options??"all"},{createBaseAccountSDK:r}=await (()=>{try{return Promise.all([n.e(8852),n.e(2532)]).then(n.bind(n,82532))}catch{throw Error('dependency "@base-org/account" not found')}})();t=r({...e,appChainIds:a.chains.map(e=>e.id),preference:i}).getProvider()}return t},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:e,chainId:t}){let n=a.chains.find(e=>e.id===t);if(!n)throw new s.ch(new i.nk);let r=await this.getProvider();try{return await r.request({method:"wallet_switchEthereumChain",params:[{chainId:(0,c.cK)(n.id)}]}),n}catch(a){if(4902===a.code)try{let a,i;a=e?.blockExplorerUrls?e.blockExplorerUrls:n.blockExplorers?.default.url?[n.blockExplorers?.default.url]:[],i=e?.rpcUrls?.length?e.rpcUrls:[n.rpcUrls.default?.http[0]??""];let s={blockExplorerUrls:a,chainId:(0,c.cK)(t),chainName:e?.chainName??n.name,iconUrls:e?.iconUrls,nativeCurrency:e?.nativeCurrency??n.nativeCurrency,rpcUrls:i};return await r.request({method:"wallet_addEthereumChain",params:[s]}),n}catch(e){throw new s.vx(e)}throw new s.ch(a)}},onAccountsChanged(e){0===e.length?this.onDisconnect():a.emitter.emit("change",{accounts:e.map(e=>(0,r.b)(e))})},onChainChanged(e){let t=Number(e);a.emitter.emit("change",{chainId:t})},async onDisconnect(e){a.emitter.emit("disconnect");let t=await this.getProvider();d&&(t.removeListener("accountsChanged",d),d=void 0),h&&(t.removeListener("chainChanged",h),h=void 0),u&&(t.removeListener("disconnect",u),u=void 0)}}))}var d=n(99994),h=n(12585);function u(e={}){let t,i,{shimDisconnect:c=!1}=e;return(0,a.U)(a=>({id:"safe",name:"Safe",type:u.type,async connect({withCapabilities:e}={}){let t=await this.getProvider();if(!t)throw new d.N;let n=await this.getAccounts(),r=await this.getChainId();return i||(i=this.onDisconnect.bind(this),t.on("disconnect",i)),c&&await a.storage?.removeItem("safe.disconnected"),{accounts:e?n.map(e=>({address:e,capabilities:{}})):n,chainId:r}},async disconnect(){let e=await this.getProvider();if(!e)throw new d.N;i&&(e.removeListener("disconnect",i),i=void 0),c&&await a.storage?.setItem("safe.disconnected",!0)},async getAccounts(){let e=await this.getProvider();if(!e)throw new d.N;return(await e.request({method:"eth_accounts"})).map(r.b)}
1,async getProvider(){if("u">typeof window&&window?.parent!==window){if(!t){let{default:a}=await (()=>{try{return Promise.all([n.e(4087),n.e(2474)]).then(n.bind(n,92474))}catch{throw Error('dependency "@safe-global/safe-apps-sdk" not found')}})(),i=new a(e),r=await (0,h.w)(()=>i.safe.getInfo(),{timeout:e.unstable_getInfoTimeout??10});if(!r)throw Error("Could not load Safe information");t=new(await (async()=>{let e=await (()=>{try{return Promise.all([n.e(4087),n.e(3784)]).then(n.t.bind(n,11403,19))}catch{throw Error('dependency "@safe-global/safe-apps-provider" not found')}})();return"function"!=typeof e.SafeAppProvider&&"function"==typeof e.default.SafeAppProvider?e.default.SafeAppProvider:e.SafeAppProvider})())(r,i)}return t}},async getChainId(){let e=await this.getProvider();if(!e)throw new d.N;return Number(e.chainId)},async isAuthorized(){try{if(c&&await a.storage?.getItem("safe.disconnected"))return!1;return!!(await this.getAccounts()).length}catch{return!1}},onAccountsChanged(){},onChainChanged(){},onDisconnect(){a.emitter.emit("disconnect")}}))}u.type="safe"}}]);
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.