PageSourceSearch

https://crowdfundingweb3.vercel.app/_next/static/chunks/9525.cdf60feddc32ccf2.js

js crowdfundingweb3.vercel.app collected 2026-10-03 06:30:54 UTC 6,853 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9525],{8100:function(e,t,n){n.d(t,{W:function(){return o}});var i=n(33116),r=n(68819),s=n(12207);class o extends s.Z{constructor(e){let{chains:t=r.gL9,options:n}=e;super(),(0,i._)(this,"id",void 0),(0,i._)(this,"name",void 0),(0,i._)(this,"chains",void 0),(0,i._)(this,"options",void 0),(0,i._)(this,"ready",void 0),this.chains=t,this.options=n}getBlockExplorerUrls(e){let t=e.explorers?.map(e=>e.url)??[];return t.length>0?t:void 0}isChainUnsupported(e){return!this.chains.some(t=>t.chainId===e)}updateChains(e){this.chains=e}}},27064:function(e,t,n){n.d(t,{A:function(){return o},C:function(){return c},R:function(){return h},S:function(){return d},U:function(){return u},a:function(){return a}});var i=n(33116);class r extends Error{constructor(e,t){let{cause:n,code:r,data:s}=t;if(!Number.isInteger(r))throw Error('"code" must be an integer.');if(!e||"string"!=typeof e)throw Error('"message" must be a nonempty string.');super(`${e}. Cause: ${n}`),(0,i._)(this,"cause",void 0),(0,i._)(this,"code",void 0),(0,i._)(this,"data",void 0),this.cause=n,this.code=r,this.data=s}}class s extends r{constructor(e,t){let{cause:n,code:i,data:r}=t;if(!(Number.isInteger(i)&&i>=1e3&&i<=4999))throw Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,{cause:n,code:i,data:r})}}class o extends Error{constructor(){super(...arguments),(0,i._)(this,"name","AddChainError"),(0,i._)(this,"message","Error adding chain")}}class c extends Error{constructor(e){let{chainId:t,connectorId:n}=e;super(`Chain "${t}" not configured for connector "${n}".`),(0,i._)(this,"name","ChainNotConfigured")}}class a extends Error{constructor(){super(...arguments),(0,i._)(this,"name","ConnectorNotFoundError"),(0,i._)(this,"message","Connector not found")}}class h extends r{constructor(e){super("Resource unavailable",{cause:e,code:-32002}),(0,i._)(this,"name","ResourceUnavailable")}}class d extends s{constructor(e){super("Error switching chain",{cause:e,code:4902}),(0,i._)(this,"name","SwitchChainError")}}class u extends s{constructor(e){super("User rejected request",{cause:e,code:4001}),(0,i._)(this,"name","UserRejectedRequestError")}}},81214:function(e,t,n){n.d(t,{n:function(){return i}});function i(e){return"string"==typeof e?Number.parseInt(e,"0x"===e.trim().substring(0,2)?16:10):"bigint"==typeof e?Number(e):e}},49525:function(e,t,n){n.d(t,{FrameConnector:function(){return m}});var i=n(1867),r=n(33116),s=n(80840),o=n(89880),c=n(42630),a=n(8100),h=n(81214),d=n(27064);n(12207);var u=new WeakMap;class m extends a.W{constructor(e){let{chains:t,options:n,connectorStorage:o}=e,c={shimDisconnect:!0,...n};super({chains:t,options:c}),(0,r._)(this,"id","frame"),(0,r._)(this,"name","Frame"),(0,r._)(this,"ready",!0),(0,r._)(this,"shimDisconnectKey",`${this.id}.shimDisconnect`),(0,i._)(this,u,{writable:!0,value:void 0}),(0,r._)(this,"connectorStorage",void 0),(0,r._)(this,"onAccountsChanged",e=>{0===e.length?this.emit("disconnect"):this.emit("change",{account:s.getAddress(e[0])})}),(0,r._)(this,"onChainChanged",e=>{let t=(0,h.n)(e),n=this.isChainUnsupported(t);this.emit("change",{chain:{id:t,unsupported:n}})}),(0,r._)(this,"onDisconnect",()=>{this.emit("disconnect"),this.options.shimDisconnect&&this.connectorStorage.removeItem(this.shimDisconnectKey)}),this.connectorStorage=o}async connect(e){try{let t=await this.getProvider();if(!t)throw new d.a;this.setupListeners(),this.emit("message",{type:"connecting"});let n=await t.request({method:"eth_requestAccounts"}),i=s.getAddress(n[0]),r=await this.getChainId(),o=this.isChainUnsupported(r);if(e?.chainId&&r!==e?.chainId){let t=await this.switchChain(e?.chainId);r=t.chainId,o=this.isChainUnsupported(r)}return this.options.shimDisconnect&&this.connectorStorage.setItem(this.shimDisconnectKey,"true"),{account:i,provider:t,chain:{id:r,unsupported:o}}}catch(e){if(this.isUserRejectedRequestError(e))throw new d.U(e);if(-32002===e.code)throw new d.R(e);throw e}}async disconnect(){let e=await this.getProvider();e?.removeListener&&(e.removeListener("accountsChanged",this.onAccountsChanged),e.removeListener("chainChanged",this.onChainChanged),e.removeListener("disconnect",this.onDisconnect),this.isInjected()||e.close(),this.options.shimDisconnect&&this.connectorStorage.removeItem(this.shimDisconnectKey))}async getAccount(){let e=await this.getProvider();if(!e)throw new d.a;return s.getAddress((await e.request({method:"eth_accounts"}))[0])}async getChainId(){let e=await this.getProvider();if(!e)throw new d.a;let t=await e.request({method:"eth_chainId"});return(0,h.n)(t)}async getProvider(){return(0,i.a)(this,u,this.isInjected()?this.injectedProvider():await this.createProvider()),(0,i.b)(this,u)}async getSigner(){let{chainId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,n]=await Promise.all([this.getProvider(),this.getAccount()]);return new o.Q(t,e).getSigner(n)}async isAuthorized(){try{if(this.options.shimDisconnect&&!this.connectorStorage.getItem(this.shimDisconnectKey))return!1;let e=await this.getProvider();if(!e)throw new d.a;let t=await this.getAccount();return!!t}catch{return!1}}async switchChain(e){let t=await this.getProvider();if(!t)throw new d.a;let n=c.hexValue(e);try{return await Promise.all([t.request({method:"wallet_switchEthereumChain",params:[{chainId:n}]}),new Promise(t=>this.on("change",n=>{let{chain:i}=n;i?.id===e&&t()}))]),this.chains.find(t=>t.chainId===e)??{chainId:e,name:`Chain ${n}`,slug:`${n}
1`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpc:[""],chain:"",shortName:"",testnet:!0}}catch(r){let i=this.chains.find(t=>t.chainId===e);if(!i)throw new d.C({chainId:e,connectorId:this.id});if(4902===r.code)try{await t.request({method:"wallet_addEthereumChain",params:[{chainId:n,chainName:i.name,nativeCurrency:i.nativeCurrency,rpc:[i.rpc[0]??""],blockExplorerUrls:this.getBlockExplorerUrls(i)}]});let r=await this.getChainId();if(r!==e)throw new d.U(Error("User rejected switch after adding network."));return i}catch(e){if(this.isUserRejectedRequestError(e))throw new d.U(e);throw new d.A(e.message)}if(this.isUserRejectedRequestError(r))throw new d.U(r);throw new d.S(r)}}async watchAsset(e){let{address:t,decimals:n=18,image:i,symbol:r}=e,s=await this.getProvider();if(!s)throw new d.a;return s.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:t,decimals:n,image:i,symbol:r}}})}async setupListeners(){let e=await this.getProvider();e.on&&(e.on("accountsChanged",this.onAccountsChanged),e.on("chainChanged",this.onChainChanged),e.on("disconnect",this.onDisconnect))}isUserRejectedRequestError(e){return 4001===e.code}injectedProvider(){return window?.ethereum}isInjected(){return!!this.injectedProvider()?.isFrame}async createProvider(){let e=(await n.e(769).then(n.t.bind(n,20769,23))).default;return e("frame")}}}}]);

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.