PageSourceSearch

https://atomichub.io/static/js/4796.7dd032a25d423c76.bundle.js

js atomichub.io collected 2026-10-02 05:58:23 UTC 9,549 bytes, 1 lines download raw bytes

1"use strict";(self.rspackChunk_atomichub_frontend=self.rspackChunk_atomichub_frontend||[]).push([[4796],{119(t,e,a){a.r(e),a.d(e,{InjectedProviderSigner:()=>I,InjectedProviderWallet:()=>f,InjectedWalletSource:()=>b,switchEip1193Chain:()=>p,toHexChainId:()=>w,walletLabel:()=>y});var i=a(31387),r=a(51978),n=a(72888),s=a(57920);function o(t){let e={};return null!=t.from&&(e.from=t.from),null!=t.to&&(e.to=t.to),null!=t.data&&(e.data=t.data),null!=t.value&&(e.value=(0,s.up)(t.value)),null!=t.nonce&&(e.nonce=(0,s.nD)(t.nonce)),null!=t.gasLimit&&(e.gas=(0,s.up)(t.gasLimit)),null!=t.gasPrice&&(e.gasPrice=(0,s.up)(t.gasPrice)),null!=t.maxFeePerGas&&(e.maxFeePerGas=(0,s.up)(t.maxFeePerGas)),null!=t.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=(0,s.up)(t.maxPriorityFeePerGas)),null!=t.chainId&&(e.chainId=(0,s.up)(t.chainId)),e}var c=a(991),l=a(88507),h=a(3088),u=a(50829);let m={metamask:"MetaMask",coinbase:"Coinbase Wallet"},d={"imx-zkevm-mainnet":{rpcUrl:"https://rpc.immutable.com",explorerUrl:"https://explorer.immutable.com",symbol:"IMX"},"imx-zkevm-testnet":{rpcUrl:"https://rpc.testnet.immutable.com",explorerUrl:"https://explorer.testnet.immutable.com",symbol:"tIMX"}};function w(t){return`0x${parseInt(t.chain_id,10).toString(16)}`}async function p(t,e){let a=w(e);try{await t.request({method:"wallet_switchEthereumChain",params:[{chainId:a}]})}catch(r){let i=d[e.identifier];if(!i||r?.code!==4902&&r?.data?.originalError?.code!==4902)throw r;await t.request({method:"wallet_addEthereumChain",params:[{chainId:a,chainName:"imx-zkevm-mainnet"===e.identifier?"Immutable zkEVM":"Immutable zkEVM Testnet",nativeCurrency:{name:i.symbol,symbol:i.symbol,decimals:18},rpcUrls:[i.rpcUrl],blockExplorerUrls:[i.explorerUrl]}]}),await t.request({method:"wallet_switchEthereumChain",params:[{chainId:a}]})}}class f{name;connect;api;constructor(t,e=()=>(0,u.X4)(t),a=()=>y(t),i){this.name=t,this.connect=i,this.api=new v(e,a)}getName(){return this.name}async getSigner(t,e,a){let i=n.u.get(t.identifier);if(e)return new I(this.api,i,t,e);await this.connect?.(t,a),await this.api.requireChain(t),await this.api.requestAccounts();let r=this.api.availableAccounts?.[0];if(r)return new I(this.api,i,t,r.toLowerCase());throw Error(`Cannot connect to ${this.api.label()}`)}async waitInitialization(){}async requireChain(t){await this.api.requireChain(t)}async signTypedData(t,e,a){return this.api.signTypedData(t,e,a)}async signTransaction(t,e,a){return this.api.signTransaction(t,e,a)}}let g={[u.Ci]:"MetaMask",[u.Pg]:"Coinbase Wallet",[u.fF]:"Your browser wallet",[h.qn]:"WalletConnect"};function y(t){if((0,u.ek)(t))return m[t]??t;let e=u.wt.find(t);return e?.info.name.trim()?(0,c.QC)(e.info):Object.prototype.hasOwnProperty.call(g,t)?g[t]??t:t}class b{getButtons;wallets=new Map;constructor(t=()=>[]){this.getButtons=t}get(t){let e=this.wallets.get(t);return e||(e=t===h.qn?new f(t,()=>(0,l.oU)(),()=>y(t),(t,e)=>(0,l.Kb)(t,{isCurrent:e})):new f(t),this.wallets.set(t,e)),e}forLogin(t){return this.get((0,u.uo)(t))}}class v{resolve;label;activeChainId;availableAccounts;ethereum;constructor(t,e){this.resolve=t,this.label=e}async requestAccounts(){let t=await this.getEthereumProvider();this.availableAccounts=await t.request({method:"eth_requestAccounts"})}async requireChain(t){let e=await this.getEthereumProvider(),a=w(t);this.activeChainId&&BigInt(this.activeChainId)===BigInt(a)||(await p(e,t),this.activeChainId=a,await this.requestAccounts())}async signMessage(t,e,a){let i=await this.getEthereumProvider();return await this.requireAccount(t,e),await i.request({method:"personal_sign",params:[a,e]})}async signTypedData(t,e,a){let i=await this.getEthereumProvider();return await this.requireAccount(t,e),await i.request({method:"eth_signTypedData_v4",params:[e,JSON.stringify(a)]})}async signTransaction(t,e,a){let i=await this.getEthereumProvider();return await this.requireAccount(t,e),await i.request({method:"eth_sendTransaction",params:[o(a)]})}async sendTransaction(t,e,a){let i=await this.getEthereumProvider();await this.requireAccount(t,e);let r=n.u.get(t.identifier),s=await i.request({method:"eth_sendTransaction",params:[o(a)]}),c=await E(r,s,1e4).catch(e=>{if("timeout"===e.message&&"polygon-mainnet"===t.identifier)throw Error(`Polygon Timeout Transaction ${s}`);throw Error(e.message)});if(!c)throw Error("Transaction not found");return c}async requireAccount(t,e){await this.requireChain(t),this.availableAccounts?.[0]||await this.requestAccounts();let a=this.availableAccounts?.[0];if(a?.toLowerCase()!==e.toLowerCase())throw Error(`Please switch to the correct address in ${this.label()}`)}async getEthereumProvider(){let t=await this.resolve();if(!t)throw Error(`${this.label()} is not available in this browser. Log in again to choose a wallet`);return t===this.ethereum||(this.ethereum=t,this.activeChainId=await t.request({method:"eth_chainId"}),this.availableAccounts=await t.request({method:"eth_accounts"}),t.on?.("accountsChanged",t=>{this.availableAccounts=t}),t.on?.("chainChanged",t=>{this.activeChainId=t})),t}}let C=/(\[[0-9]*\])+$/;class I extends i.Z{api;chain;address;constructor(t,e,a,i){super(e),this.api=t,this.chain=a,this.address=i}connect(t){return new I(this.api,t,this.chain,this.address)}async getAddress(){return(0,r.b)(this.address)}async signMessage(t){return this.api.signMessage(this.chain,this.address,t)}async signTransaction(t){return this.api.signMessage(this.chain,this.address,JSON.stringify(t))}async sendTransaction(t){return this.api.sendTransaction(this.chain,this.address,t)}async signTypedData(t,e,a,i){return this.api.signTypedData(this.chain,this.address,{domain:t,types:e,primaryType:i??function(t){let e=Object.keys(t).filter(t=>"EIP712Domain"!==t),a=new Set;for(let i of e)for(let r of t[i]??[]){let t=r.type.replace(C,"");t!==i&&e.includes(t)&&a.add(t)}let i=e.filter(t=>!a.has(t)),[r]=i;if(1!==i.length||!r)throw Error(`Cannot resolve an EIP-712 primary type: ${i.length} unreferenced struct types`);return r}(e),message:a})}}async function E(t,e,a){let i=Date.now();for(;Date.now()-i<a;){let a=await t.getTransaction(e);if(a)return a;await new Promise(t=>setTimeout(t,1e3))}throw Error("timeout")}},88507(t,e,a){let i;a.d(e,{Kb:()=>q,disconnectWalletConnect:()=>I,oU:()=>C});var r=a(10151),n=a(7913),s=a(86835),o=a(38382);function c(t){let e=o.r.chains[t];if(e?.protocol!=="pos")throw Error(`${t} has no Polygon endpoint config`);
1return r.R.getRequest(n.l.from(e.alchemy_network),(0,s.c)(e.alchemy_api_key)).url}let l=[{id:137,identifier:"polygon-mainnet",rpcUrl:c("polygon-mainnet")},{id:43114,identifier:"avax-mainnet",rpcUrl:"https://api.avax.network/ext/bc/C/rpc"},{id:13371,identifier:"imx-zkevm-mainnet",rpcUrl:"https://rpc.immutable.com"},{id:80002,identifier:"polygon-testnet",rpcUrl:c("polygon-testnet")},{id:43113,identifier:"avax-testnet",rpcUrl:"https://api.avax-test.network/ext/bc/C/rpc"},{id:13473,identifier:"imx-zkevm-testnet",rpcUrl:"https://rpc.testnet.immutable.com"}];var h=a(77958),u=a(3088);let m=()=>a.e(7083).then(a.bind(a,43222)),d=/Connection request reset/i,w=new Set([4001,5e3]),p=new WeakMap;function f(t=m){return i??=t().then(({EthereumProvider:t})=>t.init(function(){let[t,...e]=l,a=window.location.origin;return{projectId:"302e3b2f16ff1a30aae6f2497bf9c6f9",optionalChains:[t.id,...e.map(t=>t.id)],rpcMap:Object.fromEntries(l.map(t=>[t.id,t.rpcUrl])),showQrModal:!0,metadata:{name:"AtomicHub",description:"AtomicHub NFT marketplace",url:a,icons:[`${a}/logo192.png`]}}}()).catch(t=>{throw new u.In(t)})).catch(t=>{throw i=void 0,t})}function g(t){return w.has(t?.code)}async function y(t){await t.disconnect().catch(()=>void 0)}async function b(t,e){let a=await t.request({method:"eth_chainId"}).catch(()=>void 0),i=l.find(t=>t.id===Number(a))?.identifier,r="string"==typeof e?e.toLowerCase():"",n=(0,h.IO)().filter(t=>t?.chain!==i||String(t?.account).toLowerCase()!==r);return(0,u.IE)(n)}function v(t){let e=p.get(t);return e||(e={request:async e=>{if("personal_sign"!==e.method)return t.request(e);u._j.set(!0);try{return await t.request(e)}catch(i){let a=Array.isArray(e.params)?e.params:[];if(g(i)&&!await b(t,a[1]))throw await y(t),new u.Oo;throw i}finally{u._j.set(!1)}},on:(e,a)=>{t.on(e,a)}},p.set(t,e)),e}async function C(t){let e=await f(t);if(!e.session)throw Error("The WalletConnect session ended. Log in again to choose a wallet");return v(e)}async function I(t){let e=await f(t);e.session&&await y(e)}let E="walletconnect:pairing";async function q(t,e={}){let a,i=await f(e.loader);if(e.isCurrent&&!e.isCurrent())throw new u.mI;let r=!!i.session&&((0,u.IE)((0,h.IO)())||function(){try{let t=Number(localStorage.getItem(E));return t>0&&Date.now()-t<9e5}catch{return!1}}());if(!r&&i.session&&await y(i),!r){try{localStorage.setItem(E,String(Date.now()))}catch{}u.fJ.set(!0);try{await i.connect()}catch(t){if(t instanceof Error&&d.test(t.message))throw new u.mI;if(await y(i),g(t))throw Error("The wallet rejected the WalletConnect connection. Click WalletConnect to try again");throw new u.In(t)}finally{try{localStorage.removeItem(E)}catch{}u.fJ.set(!1)}}if(!(a=i.session?.namespaces?.eip155,new Set([...a?.chains??[],...a?.accounts??[]].map(t=>Number(t.split(":")[1])).filter(t=>Number.isFinite(t)))).has(Number(t.chain_id))){if(r)throw Error(`The WalletConnect wallet you use on another chain does not support ${t.name}. Choose another wallet, or remove that account to pair a different WalletConnect wallet`);throw await y(i),Error(`The connected wallet does not support ${t.name}. Choose a wallet that does`)}return v(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.