@dcl/auth-site 4.11.8-22578122545.commit-e9eeb71 → 4.11.8-22634160443.commit-5b1560f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{ConstantsUtil-Beb771Re.js → ConstantsUtil-C6xH9UyP.js} +1 -1
- package/assets/{ContentfulRichText-BT_jiRkj.js → ContentfulRichText-CvZFzzK_.js} +1 -1
- package/assets/{ExchangeController-CZUQfoIt.js → ExchangeController-FZnj4LxT.js} +1 -1
- package/assets/{HelpersUtil-C11O2AAO.js → HelpersUtil-BHTKFyTY.js} +1 -1
- package/assets/NetworkUtil-CiToBAqH.js +1 -0
- package/assets/{SwapController-DMXY5k5Q.js → SwapController-DIK3_Pq2.js} +1 -1
- package/assets/{biconomy-dpT8cHxB.js → biconomy-BLH4Umhx.js} +1 -1
- package/assets/ccip-DjAX3Bdw.js +1 -0
- package/assets/{data-capture-CpiGUgey.js → data-capture-BNDInnY2.js} +3 -3
- package/assets/{email-oX_m7Aa-.js → email-dhyjmszY.js} +6 -6
- package/assets/{embedded-wallet-Bl5i1CVx.js → embedded-wallet-70Hh47Ef.js} +6 -6
- package/assets/{engine-Di0gkU--.js → engine-Cm7828E0.js} +1 -1
- package/assets/extractIPFS-QEKpuDLZ.js +1 -0
- package/assets/{features-BazuRuhR.js → features-jSIGbet2.js} +2 -2
- package/assets/fortmatic-D4Nrstgq.js +13 -0
- package/assets/{getInstalledModules-4RtkG0t3.js → getInstalledModules-C0hChFxJ.js} +1 -1
- package/assets/{if-defined-abRe-w5Z.js → if-defined-D89My_ZP.js} +1 -1
- package/assets/in-app-wallet-calls-IsDTrLc7.js +1 -0
- package/assets/{index-Cj4wfhJc.js → index-4I9NzFJv.js} +4 -4
- package/assets/{index-PGvg6u0E.js → index-7Va013F9.js} +1 -1
- package/assets/{index-2TE95rJd.js → index-9peCPOrA.js} +1 -1
- package/assets/{index-Dpr_P0ct.js → index-B0HsKsDe.js} +3 -3
- package/assets/{index-BoXw98h4.js → index-BB6s2-It.js} +1 -1
- package/assets/{index-BLzSiw0W.js → index-BQ-sm_aL.js} +4 -4
- package/assets/{index-CyzXlQ91.js → index-BUM4MaNm.js} +1 -1
- package/assets/{index-CapZ79aD.js → index-BY-hlUy7.js} +1 -1
- package/assets/{index-BlqsQpQi.js → index-B_AZ5wDn.js} +225 -172
- package/assets/{index-89tjUcEb.js → index-B_Uq8T7O.js} +1 -1
- package/assets/{index-B6TdJyIm.js → index-BhRCRgqq.js} +1 -1
- package/assets/{index-D5H4cP2T.js → index-BiA2OKXm.js} +3 -3
- package/assets/{index-CeEwMUyg.js → index-Bm_9y4d7.js} +1 -1
- package/assets/{index-Dz4T9To4.js → index-Bvcttfx0.js} +3 -3
- package/assets/{index-CqzZX9DL.js → index-BylUKYVf.js} +1 -1
- package/assets/index-C-EGhobM.js +21 -0
- package/assets/{index-D4mhlXGJ.js → index-CEbf5QXy.js} +1 -1
- package/assets/{index-CAlOjqpf.js → index-CP2cHryG.js} +3 -3
- package/assets/{index-9QU7SDcQ.css → index-C_zlIEPk.css} +1 -1
- package/assets/{index-kL5rdP6y.js → index-ChXyq-Se.js} +19 -19
- package/assets/index-Ci6kXWGE.js +13 -0
- package/assets/index-Cjn948YY.js +4 -0
- package/assets/{index-DqO1Z0lD.js → index-D2-MyM60.js} +1 -1
- package/assets/{index-CtjRZuR4.js → index-D45rnhLA.js} +1 -1
- package/assets/{index-B0_tUN9P.js → index-D5Kr4XIM.js} +1 -1
- package/assets/{index-DouYiF09.js → index-D9Ojjvvg.js} +3 -3
- package/assets/index-D9ZXbxtp.js +5 -0
- package/assets/{index-BVZ_AL9I.js → index-DB0dbsZQ.js} +1 -1
- package/assets/index-DBY-jyYA.js +1 -0
- package/assets/{index-VAkQawUc.js → index-DFJXow4r.js} +2 -2
- package/assets/{index-vqOTS2d-.js → index-DJapa1rL.js} +1 -1
- package/assets/{index-DV--vmXV.js → index-DM81rvDu.js} +4 -4
- package/assets/{index-BZ3jIFM2.js → index-Dc3BxEVE.js} +1 -1
- package/assets/{index-BwvA90bd.js → index-DgQPUqhC.js} +1 -1
- package/assets/{index-1VtD7CLy.js → index-G7LJ1T06.js} +4 -4
- package/assets/index-TNWcYR4u.js +1 -0
- package/assets/index-ZaFiMYvX.js +2 -0
- package/assets/index-Zt5i2Oy-.js +14 -0
- package/assets/{index-D0RY8YDZ.js → index-bWp6345C.js} +1 -1
- package/assets/{index-BWIXvCB5.js → index-eq19eLN8.js} +1 -1
- package/assets/{index-DNzCjATa.js → index-oSVEqpLR.js} +1 -1
- package/assets/index-uvW5oC3m.js +1 -0
- package/assets/{index-a1X8Ebvm.js → index-yfF0dl2Q.js} +1 -1
- package/assets/networks-DvJ9hDdm.js +3 -0
- package/assets/{onramp-D3_7ZL82.js → onramp-DAHdHkh9.js} +1 -1
- package/assets/{openzeppelin-tu2wkN5F.js → openzeppelin--cyvYNdd.js} +1 -1
- package/assets/{parse-typed-data-DrWxA1Px.js → parse-typed-data-D_uwWtsO.js} +1 -1
- package/assets/passkeys-C02NitlT.js +1 -0
- package/assets/{pay-with-exchange-S8VsI0Gz.js → pay-with-exchange-qaM6jswB.js} +3 -3
- package/assets/{receive-CssfsmCg.js → receive-D1a8nATh.js} +3 -3
- package/assets/{ref-CpaAsnTm.js → ref-Ed0dvGxF.js} +1 -1
- package/assets/{resolveImplementation-ChAPi7Ai.js → resolveImplementation-DLIH3kSd.js} +1 -1
- package/assets/secp256k1-BkSYD3WR.js +1 -0
- package/assets/{send-Dn_R4Z4B.js → send-BaXR8N2H.js} +4 -4
- package/assets/send-eip712-transaction-BrJp8PDA.js +1 -0
- package/assets/{send-gasless-transaction-D2BATGmB.js → send-gasless-transaction-JsxjV1UQ.js} +2 -2
- package/assets/{socials-4QsnsTEq.js → socials-CWi5VKFt.js} +8 -8
- package/assets/successAnimation_Lottie-BpyTLLuX.js +1 -0
- package/assets/{swaps-wkdldL9M.js → swaps-D7c5xvns.js} +1 -1
- package/assets/thirdweb-ClXIkdqD.js +20 -0
- package/assets/{transactions-On-0hU_2.js → transactions-C0JnqWuq.js} +2 -2
- package/assets/ui-DHTUsjAL.js +741 -0
- package/assets/vendor-DrMguKq4.js +59 -0
- package/assets/{w3m-modal-CXj2S6eL.js → w3m-modal-B_18_udz.js} +1 -1
- package/assets/web-connector-T2s1CHyq.js +9 -0
- package/index.html +5 -5
- package/package.json +7 -7
- package/assets/NetworkUtil-BR1fA1nY.js +0 -7
- package/assets/ccip-sVcQHIcW.js +0 -1
- package/assets/extractIPFS-1dJDs4wc.js +0 -1
- package/assets/fortmatic-GmT951Dh.js +0 -13
- package/assets/in-app-wallet-calls-CwNOCAlj.js +0 -1
- package/assets/index-666qfDL3.js +0 -14
- package/assets/index-DQNENbqo.js +0 -1
- package/assets/index-DeOIg2Dk.js +0 -13
- package/assets/index-DmglfVgc.js +0 -7
- package/assets/index-XCBP3gpR.js +0 -3
- package/assets/index-lj-K-ZzU.js +0 -4
- package/assets/index-uhBF7NYr.js +0 -2
- package/assets/networks-i3C3SWYo.js +0 -4
- package/assets/passkeys-Bd71fvAp.js +0 -1
- package/assets/secp256k1-D2tq2LcV.js +0 -1
- package/assets/send-eip712-transaction-B28ux6z7.js +0 -1
- package/assets/thirdweb--fgBAAk6.js +0 -20
- package/assets/ui-BgRic9u_.js +0 -762
- package/assets/vendor-Cd_4SrvV.js +0 -59
- package/assets/verifyHash-mxdlcflY.js +0 -35
- package/assets/web-connector-DX5MbV8B.js +0 -9
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/in-app-wallet-calls-IsDTrLc7.js","assets/thirdweb-ClXIkdqD.js","assets/passkeys-C02NitlT.js","assets/index-B_AZ5wDn.js","assets/ui-DHTUsjAL.js","assets/vendor-DrMguKq4.js","assets/index-C_zlIEPk.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{K as w,ai as g,i as p,r as X,T as I,m as y,_ as k,aj as Z,b as P,A as M,ad as z,y as W,j as ee,ak as v,al as $,am as te}from"./thirdweb-ClXIkdqD.js";import{a as ne}from"./types-DC0Zmj1B.js";import{p as G}from"./parse-typed-data-D_uwWtsO.js";const x={async getItem(n){try{if(typeof window<"u"&&window.localStorage)return localStorage.getItem(n)}catch{}return null},async removeItem(n){typeof window<"u"&&window.localStorage&&localStorage.removeItem(n)},async setItem(n,e){try{typeof window<"u"&&window.localStorage&&localStorage.setItem(n,e)}catch{}}},ae="/sdk/2022-08-12/embedded-wallet",A=n=>`thirdwebEwsWalletUserId-${n}`,ie="walletToken",T=n=>`${ie}-${n}`,j=n=>`passkey-credential-id-${n}`,re="a",E=(n,e)=>`${re}-${n}-${e}`,D=n=>`walletConnectSessions-${n}`,U=n=>`thirdweb_guest_session_id_${n}`,F=new Map;class H{constructor({storage:e,clientId:t,ecosystem:a}){Object.defineProperty(this,"key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ecosystem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.storage=e,this.key=se(t,a==null?void 0:a.id),this.ecosystem=a}async getItem(e){return this.storage?this.storage.getItem(e):F.get(e)??null}async setItem(e,t){if(this.storage)return this.storage.setItem(e,t);F.set(e,t)}async removeItem(e){const t=await this.getItem(e);return this.storage&&t?(this.storage.removeItem(e),!0):!1}async getWalletConnectSessions(){return this.getItem(D(this.key))}async saveWalletConnectSessions(e){await this.setItem(D(this.key),e)}async savePasskeyCredentialId(e){await this.setItem(j(this.key),e)}async getPasskeyCredentialId(){return this.getItem(j(this.key))}async saveAuthCookie(e){await this.setItem(T(this.key),e)}async getAuthCookie(){return this.getItem(T(this.key))}async removeAuthCookie(){return this.removeItem(T(this.key))}async saveDeviceShare(e,t){await this.saveWalletUserId(t),await this.setItem(E(this.key,t),e)}async getDeviceShare(){const e=await this.getWalletUserId();return e?this.getItem(E(this.key,e)):null}async removeDeviceShare(){const e=await this.getWalletUserId();return e?this.removeItem(E(this.key,e)):!1}async getWalletUserId(){return this.getItem(A(this.key))}async saveWalletUserId(e){await this.setItem(A(this.key),e)}async removeWalletUserId(){return this.removeItem(A(this.key))}async getGuestSessionId(){return this.getItem(U(this.key))}async saveGuestSessionId(e){await this.setItem(U(this.key),e)}}const se=(n,e)=>`${n}${e?`-${e}`:""}`,L=new Map,oe={getItem:async n=>L.get(n)??null,removeItem:async n=>{L.delete(n)},setItem:async(n,e)=>{L.set(n,e)}};async function O({authToken:n,client:e,ecosystem:t}){const r=await w(e,t)(`${g("inAppWallet")}/api/2024-05-05/accounts`,{headers:{Authorization:`Bearer embedded-wallet-token:${n}`,"Content-Type":"application/json"},method:"GET"});if(!r.ok){const c=await r.text().catch(()=>"Unknown error");throw new Error(`Failed to get user info: ${c}`)}return await r.json()}const ce=g("inAppWallet"),le=`${ce}/`,V=`${le}api/2023-10-20`,ue=`${V}/embedded-wallet/validate-custom-jwt`,de=`${V}/embedded-wallet/validate-custom-auth-endpoint`,q=(n,e)=>e instanceof Error?`${n}: ${e.message}`:`${n}: ${p(e)}`;async function he(n){const t=await w(n.client,n.ecosystem)(de,{body:p({developerClientId:n.client.clientId,payload:n.payload}),headers:{"Content-Type":"application/json"},method:"POST"});if(!t.ok){const a=await t.json();throw new Error(`Custom auth endpoint authentication error: ${a.message}`)}try{const{verifiedToken:a}=await t.json();return{storedToken:a}}catch(a){throw new Error(q("Malformed response from post auth_endpoint authentication",a))}}const Q=n=>{if(!ne.includes(n))throw new Error(`Unknown auth option ${n}`);switch(n){case"wallet":return"siwe";default:return n}},b=({authOption:n,client:e,ecosystem:t,mode:a="popup",redirectUrl:r})=>{if(a==="popup"&&r)throw new Error("Redirect URL is not supported for popup mode");if(a==="window"&&!r)throw new Error("Redirect URL is required for window mode");const c=Q(n);let o=`${g("inAppWallet")}/api/2024-05-05/login/${c}?clientId=${e.clientId}`;if(t!=null&&t.partnerId?o=`${o}&ecosystemId=${t.id}&ecosystemPartnerId=${t.partnerId}`:t&&(o=`${o}&ecosystemId=${t.id}`),a!=="popup"){const i=new URL(r||window.location.href);i.searchParams.set("walletId",(t==null?void 0:t.id)||"inApp"),i.searchParams.set("authProvider",n),o=`${o}&redirectUrl=${encodeURIComponent(i.toString())}`}return o},C=({authOption:n,client:e,ecosystem:t})=>{const a=Q(n);let r=`${g("inAppWallet")}/api/2024-05-05/login/${a}/callback?clientId=${e.clientId}`;return t!=null&&t.partnerId?r=`${r}&ecosystemId=${t.id}&ecosystemPartnerId=${t.partnerId}`:t&&(r=`${r}&ecosystemId=${t.id}`),r};async function we(n){const e=w(n.client,n.ecosystem),t=b({authOption:"backend",client:n.client,ecosystem:n.ecosystem}),a=await e(`${t}`,{body:p({walletSecret:n.walletSecret}),headers:{"Content-Type":"application/json"},method:"POST"});if(!a.ok){const r=await a.text();throw new Error(`Failed to generate backend account: ${r}`)}return await a.json()}async function ge(n){let e=await n.storage.getGuestSessionId();e||(e=X(32),n.storage.saveGuestSessionId(e));const t=w(n.client,n.ecosystem),a=C({authOption:"guest",client:n.client,ecosystem:n.ecosystem}),r=await t(`${a}`,{body:p({sessionId:e}),headers:{"Content-Type":"application/json"},method:"POST"});if(!r.ok){const c=await r.text();throw new Error(`Failed to generate guest account: ${r.status} ${r.statusText} ${c}`)}return await r.json()}async function pe(n){const t=await w(n.client,n.ecosystem)(ue,{body:p({developerClientId:n.client.clientId,jwt:n.jwt}),headers:{"Content-Type":"application/json"},method:"POST"});if(!t.ok){const a=await t.json();throw new Error(`JWT authentication error: ${a.message}`)}try{const{verifiedToken:a}=await t.json();return{storedToken:a}}catch(a){throw new Error(q("Malformed response from post jwt authentication",a))}}async function me({client:n,ecosystem:e,tokenToLink:t,storage:a}){const r=w(n,e),c=g("inAppWallet"),o=await a.getAuthCookie();if(!o)throw new Error("Failed to link account, no user logged in");const i={Authorization:`Bearer iaw-auth-token:${o}`,"Content-Type":"application/json"},l=await r(`${c}/api/2024-05-05/account/connect`,{body:p({accountAuthTokenToConnect:t}),headers:i,method:"POST"});if(!l.ok){const u=await l.json();throw new Error(u.message||"Failed to link account.")}const{linkedAccounts:s}=await l.json();return s??[]}async function fe({client:n,ecosystem:e,profileToUnlink:t,allowAccountDeletion:a=!1,storage:r}){const c=w(n,e),o=g("inAppWallet"),i=await r.getAuthCookie();if(!i)throw new Error("Failed to unlink account, no user logged in");const l={Authorization:`Bearer iaw-auth-token:${i}`,"Content-Type":"application/json"},s=await c(`${o}/api/2024-05-05/account/disconnect`,{body:p({allowAccountDeletion:a,details:t.details,type:t.type}),headers:l,method:"POST"});if(!s.ok){const d=await s.json();throw new Error(d.message||"Failed to unlink account.")}const{linkedAccounts:u}=await s.json();return u??[]}async function ye({client:n,ecosystem:e,storage:t}){const a=w(n,e),r=g("inAppWallet"),c=await t.getAuthCookie();if(!c)throw new Error("Failed to get linked accounts, no user logged in");const o={Authorization:`Bearer iaw-auth-token:${c}`,"Content-Type":"application/json"},i=await a(`${r}/api/2024-05-05/accounts`,{headers:o,method:"GET"});if(!i.ok){const s=await i.json();throw new Error(s.message||"Failed to get linked accounts.")}const{linkedAccounts:l}=await i.json();return l??[]}function J(){return`${g("inAppWallet")}/api/2024-05-05/login/passkey/callback`}function K(n,e){return`${g("inAppWallet")}/api/2024-05-05/login/passkey?type=${n}${e?`&username=${e}`:""}`}async function Ie(n){var u,d,h;if(!n.passkeyClient.isAvailable())throw new Error("Passkeys are not available on this device");const e=w(n.client,n.ecosystem),t=n.username??ke(n.ecosystem),r=await(await e(K("sign-up",t))).json();if(!r.challenge)throw new Error("No challenge received");const c=r.challenge,o=await n.passkeyClient.register({challenge:c,name:t,rp:n.rp}),i={};(u=n.ecosystem)!=null&&u.partnerId&&(i["x-ecosystem-partner-id"]=n.ecosystem.partnerId),(d=n.ecosystem)!=null&&d.id&&(i["x-ecosystem-id"]=n.ecosystem.id);const s=await(await e(J(),{body:p({authenticatorData:o.authenticatorData,clientData:o.clientData,credential:{algorithm:o.credential.algorithm,publicKey:o.credential.publicKey},credentialId:o.credentialId,origin:o.origin,rpId:n.rp.id,serverVerificationId:r.serverVerificationId,type:"sign-up",username:t}),headers:{"Content-Type":"application/json",...i},method:"POST"})).json();if(!s||!s.storedToken)throw new Error(`Error verifying passkey: ${s.message??"unknown error"}`);return await((h=n.storage)==null?void 0:h.savePasskeyCredentialId(o.credentialId)),s}async function be(n){var s,u,d,h;if(!n.passkeyClient.isAvailable())throw new Error("Passkeys are not available on this device");const e=w(n.client,n.ecosystem),[t,a]=await Promise.all([e(K("sign-in")).then(f=>f.json()),(s=n.storage)==null?void 0:s.getPasskeyCredentialId()]);if(!t.challenge)throw new Error("No challenge received");const r=t.challenge,c=await n.passkeyClient.authenticate({challenge:r,credentialId:a??void 0,rp:n.rp}),o={};(u=n.ecosystem)!=null&&u.partnerId&&(o["x-ecosystem-partner-id"]=n.ecosystem.partnerId),(d=n.ecosystem)!=null&&d.id&&(o["x-ecosystem-id"]=n.ecosystem.id);const l=await(await e(J(),{body:p({authenticatorData:c.authenticatorData,clientData:c.clientData,credentialId:c.credentialId,origin:c.origin,rpId:n.rp.id,serverVerificationId:t.serverVerificationId,signature:c.signature,type:"sign-in"}),headers:{"Content-Type":"application/json",...o},method:"POST"})).json();if(!l||!l.storedToken)throw new Error(`Error verifying passkey: ${l.message??"unknown error"}`);return await((h=n.storage)==null?void 0:h.savePasskeyCredentialId(c.credentialId)),l}function ke(n){return`${(n==null?void 0:n.id)??"wallet"}-${new Date().toISOString()}`}function ve(n){let a=[`${n.domain} wants you to sign in with your Ethereum account:`,n.address].join(`
|
|
3
|
+
`);a=[a,n.statement].join(`
|
|
4
|
+
|
|
5
|
+
`),n.statement&&(a+=`
|
|
6
|
+
`);const r=[];if(n.uri){const u=`URI: ${n.uri}`;r.push(u)}const c=`Version: ${n.version}`;if(r.push(c),n.chain_id){const u=`Chain ID: ${n.chain_id}`||"1";r.push(u)}const o=`Nonce: ${n.nonce}`;r.push(o);const i=`Issued At: ${n.issued_at}`;r.push(i);const l=`Expiration Time: ${n.expiration_time}`;if(r.push(l),n.invalid_before){const u=`Not Before: ${n.invalid_before}`;r.push(u)}n.resources&&r.push(["Resources:",...n.resources.map(u=>`- ${u}`)].join(`
|
|
7
|
+
`));const s=r.join(`
|
|
8
|
+
`);return[a,s].join(`
|
|
9
|
+
`)}async function Ae(n){const{payload:e,account:t}=n,a=await t.signMessage({message:ve(e)});return{payload:e,signature:a}}const Te=["xyz.abs"];async function Ee(n){const{wallet:e,client:t,ecosystem:a,chain:r}=n,c=Te.includes(e.id)?r||I(1):I(1),o=e.getAccount()||await e.connect({chain:c,client:t}),i=w(t,a),l=await(async()=>{const d=b({authOption:"wallet",client:n.client,ecosystem:n.ecosystem}),h=await i(`${d}&address=${o.address}&chainId=${c.id}`);if(!h.ok)throw new Error("Failed to generate SIWE login payload");return await h.json()})(),{signature:s}=await Ae({account:o,payload:l});return await(async()=>{const d=C({authOption:"wallet",client:n.client,ecosystem:n.ecosystem}),h=await i(`${d}&signature=${s}&payload=${encodeURIComponent(l)}`,{body:p({payload:l,signature:s}),headers:{"Content-Type":"application/json"},method:"POST"});if(!h.ok)throw new Error("Failed to verify SIWE signature");return await h.json()})()}async function Le({client:n,payload:e,storage:t}){const a=await t.getAuthCookie(),r=t.ecosystem,c=w(n,r);if(!a)throw new Error("No auth token found when signing message");const o={address:e.address,chainId:e.chainId,nonce:Number(e.nonce)},i=await c(`${g("inAppWallet")}/api/v1/enclave-wallet/sign-authorization`,{body:p(o),headers:{Authorization:`Bearer embedded-wallet-token:${a}`,"Content-Type":"application/json","x-thirdweb-client-id":n.clientId},method:"POST"});if(!i.ok)throw new Error(`Failed to sign message - ${i.status} ${i.statusText}`);return await i.json()}async function Se({client:n,payload:{message:e,isRaw:t,originalMessage:a,chainId:r},storage:c}){const o=await c.getAuthCookie(),i=c.ecosystem,l=w(n,i);if(!o)throw new Error("No auth token found when signing message");const s=await l(`${g("inAppWallet")}/api/v1/enclave-wallet/sign-message`,{body:p({messagePayload:{chainId:r,isRaw:t,message:e,originalMessage:a}}),headers:{Authorization:`Bearer embedded-wallet-token:${o}`,"Content-Type":"application/json","x-thirdweb-client-id":n.clientId},method:"POST"});if(!s.ok)throw new Error(`Failed to sign message - ${s.status} ${s.statusText}`);return await s.json()}async function Pe({client:n,payload:e,storage:t}){const a=await t.getAuthCookie(),r=t.ecosystem,c=w(n,r);if(!a)throw new Error("No auth token found when signing transaction");const o=await c(`${g("inAppWallet")}/api/v1/enclave-wallet/sign-transaction`,{body:p({transactionPayload:e}),headers:{Authorization:`Bearer embedded-wallet-token:${a}`,"Content-Type":"application/json","x-thirdweb-client-id":n.clientId},method:"POST"});if(!o.ok)throw new Error(`Failed to sign transaction - ${o.status} ${o.statusText}`);return(await o.json()).signature}async function We({client:n,payload:e,storage:t}){const a=await t.getAuthCookie(),r=t.ecosystem,c=w(n,r);if(!a)throw new Error("No auth token found when signing typed data");const o=await c(`${g("inAppWallet")}/api/v1/enclave-wallet/sign-typed-data`,{body:p({...e}),headers:{Authorization:`Bearer embedded-wallet-token:${a}`,"Content-Type":"application/json","x-thirdweb-client-id":n.clientId},method:"POST"});if(!o.ok)throw new Error(`Failed to sign typed data - ${o.status} ${o.statusText}`);return await o.json()}class Oe{constructor({client:e,ecosystem:t,address:a,storage:r}){Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ecosystem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"address",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"localStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.client=e,this.ecosystem=t,this.address=a,this.localStorage=r}async postWalletSetUp(e){await this.localStorage.saveAuthCookie(e.storedToken.cookieString)}async getUserWalletStatus(){var c,o;const e=await this.localStorage.getAuthCookie();if(!e)return{status:"Logged Out"};const t=await O({authToken:e,client:this.client,ecosystem:this.ecosystem});if(!t)return{status:"Logged Out"};const a=t.wallets[0],r={email:(c=t.linkedAccounts.find(i=>i.details.email!==void 0))==null?void 0:c.details.email,phoneNumber:(o=t.linkedAccounts.find(i=>i.details.phone!==void 0))==null?void 0:o.details.phone,recoveryShareManagement:"ENCLAVE",userWalletId:t.id||""};return a?{account:await this.getAccount(),authDetails:r,status:"Logged In, Wallet Initialized",walletAddress:a.address}:{authDetails:r,status:"Logged In, Wallet Uninitialized"}}async getAccount(){const e=this.client,t=this.localStorage,a=this.address,r=this.ecosystem,c=async i=>{const l=P({chain:I(i.chainId),client:e}),s={chainId:W(i.chainId),data:i.data,gas:m(i.gas),nonce:m(i.nonce)||W(await k(async()=>{const{eth_getTransactionCount:u}=await import("./thirdweb-ClXIkdqD.js").then(d=>d.av);return{eth_getTransactionCount:u}},[]).then(({eth_getTransactionCount:u})=>u(l,{address:y(this.address),blockTag:"pending"}))),to:i.to?y(i.to):void 0,value:m(i.value)};return i.authorizationList&&i.authorizationList.length>0?(s.type=4,s.authorizationList=i.authorizationList,s.maxFeePerGas=m(i.maxFeePerGas),s.maxPriorityFeePerGas=m(i.maxPriorityFeePerGas)):m(i.maxFeePerGas)?(s.maxFeePerGas=m(i.maxFeePerGas),s.maxPriorityFeePerGas=m(i.maxPriorityFeePerGas),s.type=2):(s.gasPrice=m(i.gasPrice),s.type=0),Pe({client:e,payload:s,storage:t})},o={address:y(a),async sendTransaction(i){const l=P({chain:I(i.chainId),client:e}),s=await c(i),u=await M(l,s);return z({chainId:i.chainId,client:e,contractAddress:i.to??void 0,ecosystem:r,gasPrice:i.gasPrice,transactionHash:u,walletAddress:a,walletType:"inApp"}),{transactionHash:u}},async signAuthorization(i){const l=await Le({client:e,payload:i,storage:t});return{address:y(l.address),chainId:Number.parseInt(l.chainId),nonce:BigInt(l.nonce),r:BigInt(l.r),s:BigInt(l.s),yParity:Number.parseInt(l.yParity)}},async signMessage({message:i,originalMessage:l,chainId:s}){const u=typeof i=="string"?{chainId:s,isRaw:!1,message:i,originalMessage:l}:{chainId:s,isRaw:!0,message:typeof i.raw=="string"?i.raw:Z(i.raw),originalMessage:l},{signature:d}=await Se({client:e,payload:u,storage:t});return d},async signTransaction(i){if(!i.chainId)throw new Error("chainId required in tx to sign");return c({chainId:i.chainId,...i})},async signTypedData(i){const l=G(i),{signature:s}=await We({client:e,payload:l,storage:t});return s},sendCalls:async i=>{const{inAppWalletSendCalls:l}=await k(async()=>{const{inAppWalletSendCalls:f}=await import("./in-app-wallet-calls-IsDTrLc7.js");return{inAppWalletSendCalls:f}},__vite__mapDeps([0,1])),s=i.calls[0];if(!s)throw new Error("No calls to send");const u=s.client,d=s.chain||i.chain,h=await l({account:o,calls:i.calls,chain:d});return{chain:d,client:u,id:h}},getCallsStatus:async i=>{const{inAppWalletGetCallsStatus:l}=await k(async()=>{const{inAppWalletGetCallsStatus:s}=await import("./in-app-wallet-calls-IsDTrLc7.js");return{inAppWalletGetCallsStatus:s}},__vite__mapDeps([0,1]));return l(i)},getCapabilities:async i=>({[i.chainId??1]:{atomic:{status:"unsupported"},paymasterService:{supported:!1}}})};return o}}function m(n){return n===void 0||ee(n)?n:W(n)}const Ce={backgroundColor:"transparent",border:"none",colorScheme:"light",display:"none",height:"100%",pointerEvents:"all",position:"fixed",right:"0px",top:"0px",width:"100%",zIndex:"2147483646"},S=new Map;class _e{constructor({link:e,baseUrl:t,iframeId:a,container:r,onIframeInitialize:c,localStorage:o,clientId:i,ecosystem:l}){if(Object.defineProperty(this,"iframe",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"POLLING_INTERVAL_SECONDS",{enumerable:!0,configurable:!0,writable:!0,value:1.4}),Object.defineProperty(this,"iframeBaseUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"localStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ecosystem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.localStorage=o,this.clientId=i,this.ecosystem=l,this.iframeBaseUrl=t,typeof document>"u")return;r=r??document.body;let s=document.getElementById(a);const u=new URL(e);if(!s||s.src!==u.href){s=document.createElement("iframe");const d={...Ce};Object.assign(s.style,d),s.setAttribute("id",a),s.setAttribute("fetchpriority","high"),r.appendChild(s),s.src=u.href;const h=f=>{if(f.data.eventType==="ewsIframeLoaded"){if(window.removeEventListener("message",h),!s){console.warn("thirdweb iFrame not found");return}this.onIframeLoadHandler(s,c)()}};window.addEventListener("message",h)}this.iframe=s}async onIframeLoadedInitVariables(){var e,t;return{authCookie:await this.localStorage.getAuthCookie(),clientId:this.clientId,deviceShareStored:await this.localStorage.getDeviceShare(),ecosystemId:(e=this.ecosystem)==null?void 0:e.id,partnerId:(t=this.ecosystem)==null?void 0:t.partnerId,walletUserId:await this.localStorage.getWalletUserId()}}onIframeLoadHandler(e,t){return async()=>{var c;const a=new MessageChannel,r=new Promise((o,i)=>{a.port1.onmessage=l=>{const{data:s}=l;a.port1.close(),s.success||i(new Error(s.error)),S.set(e.src,!0),t&&t(),o(!0)}});(c=e==null?void 0:e.contentWindow)==null||c.postMessage({data:await this.onIframeLoadedInitVariables(),eventType:"initIframe"},this.iframeBaseUrl,[a.port2]),await r}}async call({procedureName:e,params:t,showIframe:a=!1}){var o;if(!this.iframe)throw new Error("Iframe not found. You are likely calling this from the backend where the DOM is not available.");for(;!S.get(this.iframe.src);)await v(this.POLLING_INTERVAL_SECONDS*1e3);a&&(this.iframe.style.display="block",await v(.005*1e3));const r=new MessageChannel,c=new Promise((i,l)=>{r.port1.onmessage=async s=>{const{data:u}=s;r.port1.close(),a&&(await v(.1*1e3),this.iframe&&(this.iframe.style.display="none")),u.success?i(u.data):l(new Error(u.error))}});return(o=this.iframe.contentWindow)==null||o.postMessage({data:{...t,...await this.onIframeLoadedInitVariables()},eventType:e},this.iframeBaseUrl,[r.port2]),c}destroy(){this.iframe&&S.delete(this.iframe.src)}}class $e extends _e{constructor({clientId:e,baseUrl:t,ecosystem:a}){super({baseUrl:t,clientId:e,container:typeof document>"u"?void 0:document.body,ecosystem:a,iframeId:De+((a==null?void 0:a.id)||""),link:je({baseUrl:t,clientId:e,ecosystem:a,path:ae}).href,localStorage:new H({clientId:e,ecosystem:a,storage:x})}),this.clientId=e,this.ecosystem=a}}function je({clientId:n,baseUrl:e,path:t,ecosystem:a,queryParams:r}){var o;const c=new URL(`${t}`,e);if(r)for(const i of Object.keys(r))c.searchParams.set(i,((o=r[i])==null?void 0:o.toString())||"");return c.searchParams.set("clientId",n),(a==null?void 0:a.partnerId)!==void 0&&c.searchParams.set("partnerId",a.partnerId),(a==null?void 0:a.id)!==void 0&&c.searchParams.set("ecosystemId",a.id),c}const De="thirdweb-in-app-wallet-iframe";async function Ue({client:n,ecosystem:e,authToken:t}){const r=await w(n,e)(`${g("inAppWallet")}/api/v1/enclave-wallet/generate`,{headers:{Authorization:`Bearer embedded-wallet-token:${t}`,"Content-Type":"application/json","x-thirdweb-client-id":n.clientId},method:"POST"});if(!r.ok)throw new Error(`Failed to generate wallet - ${r.status} ${r.statusText}`);const{wallet:c}=await r.json();return c}class Fe{constructor({baseUrl:e,querier:t,preLogin:a,postLogin:r,client:c,ecosystem:o}){Object.defineProperty(this,"LoginQuerier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"preLogin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"postLogin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"baseUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ecosystem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.baseUrl=e,this.LoginQuerier=t,this.preLogin=a,this.postLogin=r,this.client=c,this.ecosystem=o}async sendEmailLoginOtp({email:e}){return await this.LoginQuerier.call({params:{email:e},procedureName:"sendThirdwebEmailLoginOtp"})}async sendSmsLoginOtp({phoneNumber:e}){return await this.LoginQuerier.call({params:{phoneNumber:e},procedureName:"sendThirdwebSmsLoginOtp"})}}class Ne extends Fe{async authenticateWithModal(){return this.LoginQuerier.call({params:void 0,procedureName:"loginWithThirdwebModal",showIframe:!0})}async loginWithModal(){await this.preLogin();const e=await this.authenticateWithModal();return this.postLogin(e)}async authenticateWithIframe({email:e}){return this.LoginQuerier.call({params:{email:e},procedureName:"loginWithThirdwebModal",showIframe:!0})}async loginWithIframe({email:e}){await this.preLogin();const t=await this.authenticateWithIframe({email:e});return this.postLogin(t)}async authenticateWithCustomJwt({encryptionKey:e,jwt:t}){if(!e||e.length===0)throw new Error("Encryption key is required for custom jwt auth");return this.LoginQuerier.call({params:{encryptionKey:e,jwt:t},procedureName:"loginWithCustomJwt"})}async loginWithCustomJwt({encryptionKey:e,jwt:t}){if(!e||e.length===0)throw new Error("Encryption key is required for custom jwt auth");await this.preLogin();const a=await this.authenticateWithCustomJwt({encryptionKey:e,jwt:t});return this.postLogin(a)}async authenticateWithCustomAuthEndpoint({encryptionKey:e,payload:t}){return this.LoginQuerier.call({params:{encryptionKey:e,payload:t},procedureName:"loginWithCustomAuthEndpoint"})}async loginWithCustomAuthEndpoint({encryptionKey:e,payload:t}){if(!e||e.length===0)throw new Error("Encryption key is required for custom auth");await this.preLogin();const a=await this.authenticateWithCustomAuthEndpoint({encryptionKey:e,payload:t});return this.postLogin(a)}async authenticateWithEmailOtp({email:e,otp:t,recoveryCode:a}){return this.LoginQuerier.call({params:{email:e,otp:t,recoveryCode:a},procedureName:"verifyThirdwebEmailLoginOtp"})}async loginWithEmailOtp({email:e,otp:t,recoveryCode:a}){const r=await this.authenticateWithEmailOtp({email:e,otp:t,recoveryCode:a});return this.postLogin(r)}async authenticateWithSmsOtp({phoneNumber:e,otp:t,recoveryCode:a}){return this.LoginQuerier.call({params:{otp:t,phoneNumber:e,recoveryCode:a},procedureName:"verifyThirdwebSmsLoginOtp"})}async loginWithSmsOtp({phoneNumber:e,otp:t,recoveryCode:a}){const r=await this.authenticateWithSmsOtp({otp:t,phoneNumber:e,recoveryCode:a});return this.postLogin(r)}}class Re{constructor({client:e,querier:t,onAuthSuccess:a,ecosystem:r,baseUrl:c,localStorage:o}){Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ecosystem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"AuthQuerier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"localStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onAuthSuccess",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"BaseLogin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.client=e,this.ecosystem=r,this.AuthQuerier=t,this.localStorage=o,this.onAuthSuccess=a,this.BaseLogin=new Ne({baseUrl:c,client:e,ecosystem:r,postLogin:async i=>this.postLogin(i),preLogin:async()=>{await this.preLogin()},querier:t})}async preLogin(){await this.logout()}async postLogin({storedToken:e,walletDetails:t}){return e.shouldStoreCookieString&&await this.localStorage.saveAuthCookie(e.cookieString),await this.onAuthSuccess({storedToken:e,walletDetails:t})}async loginWithAuthToken(e,t){var c;e.storedToken.authProvider!=="Backend"&&await this.preLogin();const a=await O({authToken:e.storedToken.cookieString,client:this.client,ecosystem:this.ecosystem});if(!a)throw new Error("Cannot login, no user found for auth token");if(a.wallets.length>0&&((c=a.wallets[0])==null?void 0:c.type)==="enclave")return this.postLogin({storedToken:e.storedToken,walletDetails:{walletAddress:a.wallets[0].address}});if(a.wallets.length===0){const o=await Ue({authToken:e.storedToken.cookieString,client:this.client,ecosystem:this.ecosystem});return this.postLogin({storedToken:e.storedToken,walletDetails:{walletAddress:o.address}})}const r=await this.AuthQuerier.call({params:{recoveryCode:t,storedToken:e.storedToken},procedureName:"loginWithStoredTokenDetails"});return this.postLogin(r)}async loginWithModal(){return this.BaseLogin.loginWithModal()}async authenticateWithModal(){return this.BaseLogin.authenticateWithModal()}async loginWithIframe(e){return this.BaseLogin.loginWithIframe(e)}async authenticateWithIframe(e){return this.BaseLogin.authenticateWithIframe(e)}async loginWithCustomJwt(e){return this.BaseLogin.loginWithCustomJwt(e)}async authenticateWithCustomJwt(e){return this.BaseLogin.authenticateWithCustomJwt(e)}async loginWithCustomAuthEndpoint(e){return this.BaseLogin.loginWithCustomAuthEndpoint(e)}async authenticateWithCustomAuthEndpoint(e){return this.BaseLogin.authenticateWithCustomAuthEndpoint(e)}async sendEmailLoginOtp({email:e}){return this.BaseLogin.sendEmailLoginOtp({email:e})}async sendSmsLoginOtp({phoneNumber:e}){return this.BaseLogin.sendSmsLoginOtp({phoneNumber:e})}async loginWithEmailOtp(e){return await this.preLogin(),this.BaseLogin.loginWithEmailOtp(e)}async authenticateWithEmailOtp(e){return this.BaseLogin.authenticateWithEmailOtp(e)}async loginWithSmsOtp(e){return await this.preLogin(),this.BaseLogin.loginWithSmsOtp(e)}async authenticateWithSmsOtp(e){return this.BaseLogin.authenticateWithSmsOtp(e)}async logout(){const e=await this.localStorage.removeAuthCookie(),t=await this.localStorage.removeWalletUserId();return{success:e||t}}}const Be="width=350, height=500",N=({isWindowOpenedByFn:n,win:e,closeOpenedWindow:t})=>{n?e==null||e.close():e&&t?t(e):e&&e.close()};async function Me(n){const e=b({...n,mode:n.mode||"redirect"});n.mode==="redirect"?window.location.href=e:window.open(e),await new Promise(t=>setTimeout(t,5e3))}const ze=async n=>{let e=n.openedWindow,t=!1;if(e||(e=window.open(b({...n,mode:"popup"}),`Login to ${n.authOption}`,Be),t=!0),!e)throw new Error("Something went wrong opening pop-up");return await new Promise((r,c)=>{const o=window.setInterval(async()=>{e.closed&&(clearInterval(o),window.removeEventListener("message",i),c(new Error("User closed login window")))},1e3),i=async l=>{if(l.origin===g("inAppWallet")){if(typeof l.data!="object"){c(new Error("Invalid event data"));return}switch(l.data.eventType){case"oauthSuccessResult":{window.removeEventListener("message",i),clearInterval(o),N({closeOpenedWindow:n.closeOpenedWindow,isWindowOpenedByFn:t,win:e}),l.data.authResult&&r(l.data.authResult);break}case"oauthFailureResult":{window.removeEventListener("message",i),clearInterval(o),N({closeOpenedWindow:n.closeOpenedWindow,isWindowOpenedByFn:t,win:e}),c(new Error(l.data.errorString));break}}}};window.addEventListener("message",i)})},Ge=async n=>{const{client:e,ecosystem:t}=n,a=b({authOption:n.strategy,client:e,ecosystem:t}),r={"Content-Type":"application/json","x-client-id":e.clientId};t!=null&&t.id&&(r["x-ecosystem-id"]=t.id),t!=null&&t.partnerId&&(r["x-ecosystem-partner-id"]=t.partnerId);const c=(()=>{switch(n.strategy){case"email":return{email:n.email};case"phone":return{phone:n.phoneNumber}}})(),o=await fetch(a,{body:p(c),headers:r,method:"POST"});if(!o.ok)throw new Error("Failed to send verification code");return await o.json()},R=async n=>{const{client:e,ecosystem:t}=n,a=C({authOption:n.strategy,client:n.client,ecosystem:n.ecosystem}),r={"Content-Type":"application/json","x-client-id":e.clientId};t!=null&&t.id&&(r["x-ecosystem-id"]=t.id),t!=null&&t.partnerId&&(r["x-ecosystem-partner-id"]=t.partnerId);const c=(()=>{switch(n.strategy){case"email":return{code:n.verificationCode,email:n.email};case"phone":return{code:n.verificationCode,phone:n.phoneNumber}}})(),o=await fetch(a,{body:p(c),headers:r,method:"POST"});if(!o.ok)throw new Error("Failed to verify verification code");return await o.json()};class B{constructor({client:e,ecosystem:t,querier:a,localStorage:r}){Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ecosystem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"walletManagerQuerier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"localStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.client=e,this.ecosystem=t,this.walletManagerQuerier=a,this.localStorage=r}async postWalletSetUp(e){e.deviceShareStored&&await this.localStorage.saveDeviceShare(e.deviceShareStored,e.storedToken.authDetails.userWalletId)}async getUserWalletStatus(){const e=await this.walletManagerQuerier.call({params:void 0,procedureName:"getUserStatus"});return e.status==="Logged In, Wallet Initialized"?{status:"Logged In, Wallet Initialized",...e.user,account:await this.getAccount()}:e.status==="Logged In, New Device"?{status:"Logged In, New Device",...e.user}:e.status==="Logged In, Wallet Uninitialized"?{status:"Logged In, Wallet Uninitialized",...e.user}:{status:e.status}}async getAccount(){var o;const e=this.walletManagerQuerier,t=this.client,a=(o=this.ecosystem)==null?void 0:o.partnerId,{address:r}=await e.call({params:void 0,procedureName:"getAddress"}),c=async i=>{const l={chainId:i.chainId,data:i.data,gasLimit:i.gas,nonce:i.nonce,to:i.to??void 0,value:i.value};i.maxFeePerGas?(l.accessList=i.accessList,l.maxFeePerGas=i.maxFeePerGas,l.maxPriorityFeePerGas=i.maxPriorityFeePerGas,l.type=2):(l.gasPrice=i.gasPrice,l.type=0);const s=$().rpc,{signedTransaction:u}=await e.call({params:{chainId:i.chainId,partnerId:a,rpcEndpoint:`https://${i.chainId}.${s}`,transaction:l},procedureName:"signTransaction"});return u};return{address:y(r),async sendTransaction(i){const l=P({chain:I(i.chainId),client:t}),s=await c(i),u=await M(l,s);return z({chainId:i.chainId,client:t,contractAddress:i.to??void 0,gasPrice:i.gasPrice,transactionHash:u,walletAddress:r,walletType:"inApp"}),{transactionHash:u}},async signMessage({message:i}){const l=typeof i=="string"?i:i.raw instanceof Uint8Array?i.raw:te(i.raw),{signedMessage:s}=await e.call({params:{chainId:1,message:l,partnerId:a},procedureName:"signMessage"});return s},async signTransaction(i){if(!i.chainId)throw new Error("chainId required in tx to sign");return c({...i,chainId:i.chainId})},async signTypedData(i){var _;const l=G(i);(_=l.types)!=null&&_.EIP712Domain&&(l.types.EIP712Domain=void 0);const s=l.domain,u=s==null?void 0:s.chainId,h={...s!=null&&s.verifyingContract?{verifyingContract:s==null?void 0:s.verifyingContract}:{},name:s==null?void 0:s.name,version:s==null?void 0:s.version};u&&(h.chainId=u);const f=$().rpc,{signedTypedData:Y}=await e.call({params:{chainId:Number.parseInt(BigInt(u||1).toString()),domain:h,message:l.message,partnerId:a,rpcEndpoint:`https://${u}.${f}`,types:l.types},procedureName:"signTypedDataV4"});return Y}}}}class Je{isClientIdLegacyPaper(e){return e.indexOf("-")>0&&e.length===36}constructor({client:e,onAuthSuccess:t,ecosystem:a,passkeyDomain:r,storage:c}){if(Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ecosystem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"querier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"wallet",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"auth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"passkeyDomain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.isClientIdLegacyPaper(e.clientId))throw new Error("You are using a legacy clientId. Please use the clientId found on the thirdweb dashboard settings page");const o=g("inAppWallet");this.client=e,this.ecosystem=a,this.passkeyDomain=r,this.storage=new H({clientId:e.clientId,ecosystem:a,storage:c??He()}),this.querier=new $e({baseUrl:o,clientId:e.clientId,ecosystem:a}),this.auth=new Re({baseUrl:o,client:e,ecosystem:a,localStorage:this.storage,onAuthSuccess:async i=>{if(t==null||t(i),i.storedToken.authDetails.walletType==="sharded"&&(await this.querier.call({params:{storedToken:i.storedToken},procedureName:"migrateFromShardToEnclave"})||console.warn("Failed to migrate from sharded to enclave wallet, continuing with sharded wallet")),this.wallet=await this.initializeWallet(i.storedToken.cookieString),!this.wallet)throw new Error("Failed to initialize wallet");const l="deviceShareStored"in i.walletDetails?i.walletDetails.deviceShareStored:void 0;return await this.wallet.postWalletSetUp({deviceShareStored:l,storedToken:i.storedToken}),this.wallet instanceof B&&await this.querier.call({params:{authCookie:i.storedToken.cookieString,clientId:this.client.clientId,deviceShareStored:"deviceShareStored"in i.walletDetails?i.walletDetails.deviceShareStored:null,ecosystemId:a==null?void 0:a.id,partnerId:a==null?void 0:a.partnerId,walletUserId:i.storedToken.authDetails.userWalletId},procedureName:"initIframe"}),{user:{account:await this.wallet.getAccount(),authDetails:i.storedToken.authDetails,status:"Logged In, Wallet Initialized",walletAddress:i.walletDetails.walletAddress}}},querier:this.querier})}async initializeWallet(e){var r;const t=await this.storage.getAuthCookie();if(!e&&t===null)throw new Error("No auth token provided and no stored auth token found to initialize the wallet");const a=await O({authToken:e||t,client:this.client,ecosystem:this.ecosystem});if(!a)throw new Error("Cannot initialize wallet, no user logged in");if(a.wallets.length===0)throw new Error("Cannot initialize wallet, this user does not have a wallet generated yet");return((r=a.wallets[0])==null?void 0:r.type)==="enclave"?new Oe({address:a.wallets[0].address,client:this.client,ecosystem:this.ecosystem,storage:this.storage}):new B({client:this.client,ecosystem:this.ecosystem,localStorage:this.storage,querier:this.querier})}async getUser(){if(!this.wallet){const e=await this.storage.getAuthCookie();if(!e)return{status:"Logged Out"};this.wallet=await this.initializeWallet(e)}if(!this.wallet)throw new Error("Wallet not initialized");return await this.wallet.getUserWalletStatus()}getAccount(){if(!this.wallet)throw new Error("Wallet not initialized");return this.wallet.getAccount()}async preAuthenticate(e){return Ge({...e,client:this.client,ecosystem:this.ecosystem})}async authenticateWithRedirect(e,t,a){return Me({authOption:e,client:this.client,ecosystem:this.ecosystem,mode:t,redirectUrl:a})}async loginWithAuthToken(e,t){return this.auth.loginWithAuthToken(e,t)}async authenticate(e){const t=e.strategy;switch(t){case"email":return R({...e,client:this.client,ecosystem:this.ecosystem});case"phone":return R({...e,client:this.client,ecosystem:this.ecosystem});case"auth_endpoint":return he({client:this.client,ecosystem:this.ecosystem,payload:e.payload});case"jwt":return pe({client:this.client,ecosystem:this.ecosystem,jwt:e.jwt});case"passkey":return this.passkeyAuth(e);case"iframe_email_verification":return this.auth.authenticateWithIframe({email:e.email});case"iframe":return this.auth.authenticateWithModal();case"apple":case"facebook":case"google":case"telegram":case"github":case"twitch":case"farcaster":case"line":case"x":case"tiktok":case"epic":case"steam":case"coinbase":case"discord":return ze({authOption:t,client:this.client,closeOpenedWindow:e.closeOpenedWindow,ecosystem:this.ecosystem,openedWindow:e.openedWindow});case"guest":return ge({client:this.client,ecosystem:this.ecosystem,storage:this.storage});case"backend":return we({client:this.client,ecosystem:this.ecosystem,walletSecret:e.walletSecret});case"wallet":return Ee({client:this.client,ecosystem:this.ecosystem,wallet:e.wallet,chain:e.chain})}}async connect(e){const t=e.strategy;switch(t){case"auth_endpoint":case"jwt":{const a=await this.authenticate(e);return await this.loginWithAuthToken(a,e.encryptionKey)}case"iframe_email_verification":return this.auth.loginWithIframe({email:e.email});case"iframe":return this.auth.loginWithModal();case"passkey":{const a=await this.passkeyAuth(e);return this.loginWithAuthToken(a)}case"backend":case"phone":case"email":case"wallet":case"apple":case"facebook":case"google":case"farcaster":case"telegram":case"github":case"line":case"x":case"tiktok":case"epic":case"guest":case"coinbase":case"twitch":case"steam":case"discord":{const a=await this.authenticate(e);return await this.auth.loginWithAuthToken(a)}default:xe(t)}}async logout(){return await this.auth.logout()}async passkeyAuth(e){const{PasskeyWebClient:t}=await k(async()=>{const{PasskeyWebClient:i}=await import("./passkeys-C02NitlT.js");return{PasskeyWebClient:i}},__vite__mapDeps([2,3,1,4,5,6])),{passkeyName:a,storeLastUsedPasskey:r=!0}=e,c=new t,o=this.storage;return e.type==="sign-up"?Ie({client:this.client,ecosystem:this.ecosystem,passkeyClient:c,rp:{id:this.passkeyDomain??window.location.hostname,name:this.passkeyDomain??window.document.title},storage:r?o:void 0,username:a}):be({client:this.client,ecosystem:this.ecosystem,passkeyClient:c,rp:{id:this.passkeyDomain??window.location.hostname,name:this.passkeyDomain??window.document.title},storage:r?o:void 0})}async linkProfile(e){const{storedToken:t}=await this.authenticate(e);return await me({client:e.client,ecosystem:e.ecosystem||this.ecosystem,storage:this.storage,tokenToLink:t.cookieString})}async unlinkProfile(e,t){return await fe({allowAccountDeletion:t,client:this.client,ecosystem:this.ecosystem,profileToUnlink:e,storage:this.storage})}async getProfiles(){return ye({client:this.client,ecosystem:this.ecosystem,storage:this.storage})}}function xe(n,e){throw new Error(`Invalid param: ${n}`)}function He(){return typeof window<"u"&&window.localStorage?x:oe}export{Je as InAppWebConnector};
|
package/index.html
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
<link rel="shortcut icon" type="image/x-icon" href="https://decentraland.org/images/icons/favicon-32x32.png" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Decentraland | Authorization</title>
|
|
8
|
-
<script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/auth-site/4.11.8-
|
|
9
|
-
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/auth-site/4.11.8-
|
|
10
|
-
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/auth-site/4.11.8-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/auth-site/4.11.8-
|
|
12
|
-
<link rel="stylesheet" crossorigin href="https://cdn.decentraland.org/@dcl/auth-site/4.11.8-
|
|
8
|
+
<script type="module" crossorigin src="https://cdn.decentraland.org/@dcl/auth-site/4.11.8-22634160443.commit-5b1560f/assets/index-B_AZ5wDn.js"></script>
|
|
9
|
+
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/auth-site/4.11.8-22634160443.commit-5b1560f/assets/thirdweb-ClXIkdqD.js">
|
|
10
|
+
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/auth-site/4.11.8-22634160443.commit-5b1560f/assets/vendor-DrMguKq4.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="https://cdn.decentraland.org/@dcl/auth-site/4.11.8-22634160443.commit-5b1560f/assets/ui-DHTUsjAL.js">
|
|
12
|
+
<link rel="stylesheet" crossorigin href="https://cdn.decentraland.org/@dcl/auth-site/4.11.8-22634160443.commit-5b1560f/assets/index-C_zlIEPk.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/auth-site",
|
|
3
|
-
"version": "4.11.8-
|
|
3
|
+
"version": "4.11.8-22634160443.commit-5b1560f",
|
|
4
4
|
"description": "Auth website",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
8
|
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/decentraland/auth.git"
|
|
12
|
+
},
|
|
9
13
|
"keywords": [
|
|
10
14
|
"decentraland",
|
|
11
15
|
"profile",
|
|
@@ -13,10 +17,6 @@
|
|
|
13
17
|
],
|
|
14
18
|
"author": "Decentraland",
|
|
15
19
|
"license": "Apache-2.0",
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
"url": "https://github.com/decentraland/auth.git"
|
|
19
|
-
},
|
|
20
|
-
"homepage": "https://cdn.decentraland.org/@dcl/auth-site/4.11.8-22578122545.commit-e9eeb71",
|
|
21
|
-
"commit": "e9eeb71a923a515cf44bb6423e842fa02117585f"
|
|
20
|
+
"homepage": "https://cdn.decentraland.org/@dcl/auth-site/4.11.8-22634160443.commit-5b1560f",
|
|
21
|
+
"commit": "5b1560fdb7c3629ec184dcaa72061ff729bf956a"
|
|
22
22
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{p as Be}from"./thirdweb--fgBAAk6.js";const Ve="2.43.4";let j={getDocsUrl:({docsBaseUrl:s,docsPath:e="",docsSlug:t})=>e?`${s??"https://viem.sh"}${e}${t?`#${t}`:""}`:void 0,version:`viem@${Ve}`};class p extends Error{constructor(e,t={}){var i;const r=(()=>{var u;return t.cause instanceof p?t.cause.details:(u=t.cause)!=null&&u.message?t.cause.message:t.details})(),n=t.cause instanceof p&&t.cause.docsPath||t.docsPath,a=(i=j.getDocsUrl)==null?void 0:i.call(j,{...t,docsPath:n}),o=[e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...j.version?[`Version: ${j.version}`]:[]].join(`
|
|
2
|
-
`);super(o,t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=n,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=Ve}walk(e){return qe(this,e)}}function qe(s,e){return e!=null&&e(s)?s:s&&typeof s=="object"&&"cause"in s&&s.cause!==void 0?qe(s.cause,e):e?null:s}class ut extends p{constructor({max:e,min:t,signed:r,size:n,value:a}){super(`Number "${a}" is not in safe ${n?`${n*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class Es extends p{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class lt extends p{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}class dt extends p{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function ht(s,{strict:e=!0}={}){return!s||typeof s!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(s):s.startsWith("0x")}function $e(s){return ht(s,{strict:!1})?Math.ceil((s.length-2)/2):s.length}function re(s,{dir:e="left"}={}){let t=typeof s=="string"?s.replace("0x",""):s,r=0;for(let n=0;n<t.length-1&&t[e==="left"?n:t.length-n-1].toString()==="0";n++)r++;return t=e==="left"?t.slice(r):t.slice(0,t.length-r),typeof s=="string"?(t.length===1&&e==="right"&&(t=`${t}0`),`0x${t.length%2===1?`0${t}`:t}`):t}class ws extends p{constructor({offset:e,position:t,size:r}){super(`Slice ${t==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}}class Ke extends p{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}class As extends p{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${t} ${r} long, but is ${e} ${r} long.`,{name:"InvalidBytesLengthError"})}}function oe(s,{dir:e,size:t=32}={}){return typeof s=="string"?ft(s,{dir:e,size:t}):pt(s,{dir:e,size:t})}function ft(s,{dir:e,size:t=32}={}){if(t===null)return s;const r=s.replace("0x","");if(r.length>t*2)throw new Ke({size:Math.ceil(r.length/2),targetSize:t,type:"hex"});return`0x${r[e==="right"?"padEnd":"padStart"](t*2,"0")}`}function pt(s,{dir:e,size:t=32}={}){if(t===null)return s;if(s.length>t)throw new Ke({size:s.length,targetSize:t,type:"bytes"});const r=new Uint8Array(t);for(let n=0;n<t;n++){const a=e==="right";r[a?n:t-n-1]=s[a?n:s.length-n-1]}return r}const bt=Array.from({length:256},(s,e)=>e.toString(16).padStart(2,"0"));function Ns(s,e={}){return typeof s=="number"||typeof s=="bigint"?gt(s,e):typeof s=="string"?xt(s,e):typeof s=="boolean"?mt(s,e):Xe(s,e)}function mt(s,e={}){const t=`0x${Number(s)}`;return typeof e.size=="number"?(J(t,{size:e.size}),oe(t,{size:e.size})):t}function Xe(s,e={}){let t="";for(let n=0;n<s.length;n++)t+=bt[s[n]];const r=`0x${t}`;return typeof e.size=="number"?(J(r,{size:e.size}),oe(r,{dir:"right",size:e.size})):r}function gt(s,e={}){const{signed:t,size:r}=e,n=BigInt(s);let a;r?t?a=(1n<<BigInt(r)*8n-1n)-1n:a=2n**(BigInt(r)*8n)-1n:typeof s=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof a=="bigint"&&t?-a-1n:0;if(a&&n>a||n<o){const u=typeof s=="bigint"?"n":"";throw new ut({max:a?`${a}${u}`:void 0,min:`${o}${u}`,signed:t,size:r,value:`${s}${u}`})}const i=`0x${(t&&n<0?(1n<<BigInt(r*8))+BigInt(n):n).toString(16)}`;return r?oe(i,{size:r}):i}const yt=new TextEncoder;function xt(s,e={}){const t=yt.encode(s);return Xe(t,e)}function J(s,{size:e}){if($e(s)>e)throw new dt({givenSize:$e(s),maxSize:e})}function Et(s,e={}){const{signed:t}=e;e.size&&J(s,{size:e.size});const r=BigInt(s);if(!t)return r;const n=(s.length-2)/2,a=(1n<<BigInt(n)*8n-1n)-1n;return r<=a?r:r-BigInt(`0x${"f".padStart(n*2,"f")}`)-1n}function Ts(s,e={}){let t=s;if(e.size&&(J(t,{size:e.size}),t=re(t)),re(t)==="0x00")return!1;if(re(t)==="0x01")return!0;throw new lt(t)}function Os(s,e={}){return Number(Et(s,e))}const vs={gwei:9,wei:18},wt={ether:-9,wei:9};function At(s,e){let t=s.toString();const r=t.startsWith("-");r&&(t=t.slice(1)),t=t.padStart(e,"0");let[n,a]=[t.slice(0,t.length-e),t.slice(t.length-e)];return a=a.replace(/(0+)$/,""),`${r?"-":""}${n||"0"}${a?`.${a}`:""}`}function K(s,e="wei"){return At(s,wt[e])}const L=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Nt(s){return s instanceof Uint8Array||ArrayBuffer.isView(s)&&s.constructor.name==="Uint8Array"}function X(s){if(!Number.isSafeInteger(s)||s<0)throw new Error("positive integer expected, got "+s)}function P(s,...e){if(!Nt(s))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(s.length))throw new Error("Uint8Array expected of length "+e+", got length="+s.length)}function Tt(s){if(typeof s!="function"||typeof s.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");X(s.outputLen),X(s.blockLen)}function $(s,e=!0){if(s.destroyed)throw new Error("Hash instance has been destroyed");if(e&&s.finished)throw new Error("Hash#digest() has already been called")}function Je(s,e){P(s);const t=e.outputLen;if(s.length<t)throw new Error("digestInto() expects output buffer of length at least "+t)}function Ot(s){return new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4))}function H(...s){for(let e=0;e<s.length;e++)s[e].fill(0)}function ne(s){return new DataView(s.buffer,s.byteOffset,s.byteLength)}function N(s,e){return s<<32-e|s>>>e}const vt=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Ct(s){return s<<24&4278190080|s<<8&16711680|s>>>8&65280|s>>>24&255}function Mt(s){for(let e=0;e<s.length;e++)s[e]=Ct(s[e]);return s}const De=vt?s=>s:Mt;function St(s){if(typeof s!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(s))}function Y(s){return typeof s=="string"&&(s=St(s)),P(s),s}function Cs(...s){let e=0;for(let r=0;r<s.length;r++){const n=s[r];P(n),e+=n.length}const t=new Uint8Array(e);for(let r=0,n=0;r<s.length;r++){const a=s[r];t.set(a,n),n+=a.length}return t}class ie{}function Q(s){const e=r=>s().update(Y(r)).digest(),t=s();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>s(),e}function Ms(s=32){if(L&&typeof L.getRandomValues=="function")return L.getRandomValues(new Uint8Array(s));if(L&&typeof L.randomBytes=="function")return Uint8Array.from(L.randomBytes(s));throw new Error("crypto.getRandomValues must be defined")}function It(s,e,t,r){if(typeof s.setBigUint64=="function")return s.setBigUint64(e,t,r);const n=BigInt(32),a=BigInt(4294967295),o=Number(t>>n&a),i=Number(t&a),u=r?4:0,f=r?0:4;s.setUint32(e+u,o,r),s.setUint32(e+f,i,r)}function Rt(s,e,t){return s&e^~s&t}function _t(s,e,t){return s&e^s&t^e&t}class Ye extends ie{constructor(e,t,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=ne(this.buffer)}update(e){$(this),e=Y(e),P(e);const{view:t,buffer:r,blockLen:n}=this,a=e.length;for(let o=0;o<a;){const i=Math.min(n-this.pos,a-o);if(i===n){const u=ne(e);for(;n<=a-o;o+=n)this.process(u,o);continue}r.set(e.subarray(o,o+i),this.pos),this.pos+=i,o+=i,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){$(this),Je(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:a}=this;let{pos:o}=this;t[o++]=128,H(this.buffer.subarray(o)),this.padOffset>n-o&&(this.process(r,0),o=0);for(let c=o;c<n;c++)t[c]=0;It(r,n-8,BigInt(this.length*8),a),this.process(r,0);const i=ne(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const f=u/4,l=this.get();if(f>l.length)throw new Error("_sha2: outputLen bigger than state");for(let c=0;c<f;c++)i.setUint32(4*c,l[c],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:a,destroyed:o,pos:i}=this;return e.destroyed=o,e.finished=a,e.length=n,e.pos=i,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const S=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),g=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),y=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),z=BigInt(2**32-1),ke=BigInt(32);function Ht(s,e=!1){return e?{h:Number(s&z),l:Number(s>>ke&z)}:{h:Number(s>>ke&z)|0,l:Number(s&z)|0}}function Qe(s,e=!1){const t=s.length;let r=new Uint32Array(t),n=new Uint32Array(t);for(let a=0;a<t;a++){const{h:o,l:i}=Ht(s[a],e);[r[a],n[a]]=[o,i]}return[r,n]}const je=(s,e,t)=>s>>>t,Fe=(s,e,t)=>s<<32-t|e>>>t,U=(s,e,t)=>s>>>t|e<<32-t,B=(s,e,t)=>s<<32-t|e>>>t,V=(s,e,t)=>s<<64-t|e>>>t-32,q=(s,e,t)=>s>>>t-32|e<<64-t,Pt=(s,e,t)=>s<<t|e>>>32-t,Lt=(s,e,t)=>e<<t|s>>>32-t,Ut=(s,e,t)=>e<<t-32|s>>>64-t,Bt=(s,e,t)=>s<<t-32|e>>>64-t;function v(s,e,t,r){const n=(e>>>0)+(r>>>0);return{h:s+t+(n/2**32|0)|0,l:n|0}}const $t=(s,e,t)=>(s>>>0)+(e>>>0)+(t>>>0),Dt=(s,e,t,r)=>e+t+r+(s/2**32|0)|0,kt=(s,e,t,r)=>(s>>>0)+(e>>>0)+(t>>>0)+(r>>>0),jt=(s,e,t,r,n)=>e+t+r+n+(s/2**32|0)|0,Ft=(s,e,t,r,n)=>(s>>>0)+(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),Wt=(s,e,t,r,n,a)=>e+t+r+n+a+(s/2**32|0)|0,Gt=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),I=new Uint32Array(64);class zt extends Ye{constructor(e=32){super(64,e,8,!1),this.A=S[0]|0,this.B=S[1]|0,this.C=S[2]|0,this.D=S[3]|0,this.E=S[4]|0,this.F=S[5]|0,this.G=S[6]|0,this.H=S[7]|0}get(){const{A:e,B:t,C:r,D:n,E:a,F:o,G:i,H:u}=this;return[e,t,r,n,a,o,i,u]}set(e,t,r,n,a,o,i,u){this.A=e|0,this.B=t|0,this.C=r|0,this.D=n|0,this.E=a|0,this.F=o|0,this.G=i|0,this.H=u|0}process(e,t){for(let c=0;c<16;c++,t+=4)I[c]=e.getUint32(t,!1);for(let c=16;c<64;c++){const d=I[c-15],h=I[c-2],m=N(d,7)^N(d,18)^d>>>3,x=N(h,17)^N(h,19)^h>>>10;I[c]=x+I[c-7]+m+I[c-16]|0}let{A:r,B:n,C:a,D:o,E:i,F:u,G:f,H:l}=this;for(let c=0;c<64;c++){const d=N(i,6)^N(i,11)^N(i,25),h=l+d+Rt(i,u,f)+Gt[c]+I[c]|0,x=(N(r,2)^N(r,13)^N(r,22))+_t(r,n,a)|0;l=f,f=u,u=i,i=o+h|0,o=a,a=n,n=r,r=h+x|0}r=r+this.A|0,n=n+this.B|0,a=a+this.C|0,o=o+this.D|0,i=i+this.E|0,u=u+this.F|0,f=f+this.G|0,l=l+this.H|0,this.set(r,n,a,o,i,u,f,l)}roundClean(){H(I)}destroy(){this.set(0,0,0,0,0,0,0,0),H(this.buffer)}}const Ze=Qe(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(s=>BigInt(s))),Vt=Ze[0],qt=Ze[1],R=new Uint32Array(80),_=new Uint32Array(80);class et extends Ye{constructor(e=64){super(128,e,16,!1),this.Ah=y[0]|0,this.Al=y[1]|0,this.Bh=y[2]|0,this.Bl=y[3]|0,this.Ch=y[4]|0,this.Cl=y[5]|0,this.Dh=y[6]|0,this.Dl=y[7]|0,this.Eh=y[8]|0,this.El=y[9]|0,this.Fh=y[10]|0,this.Fl=y[11]|0,this.Gh=y[12]|0,this.Gl=y[13]|0,this.Hh=y[14]|0,this.Hl=y[15]|0}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:a,Cl:o,Dh:i,Dl:u,Eh:f,El:l,Fh:c,Fl:d,Gh:h,Gl:m,Hh:x,Hl:A}=this;return[e,t,r,n,a,o,i,u,f,l,c,d,h,m,x,A]}set(e,t,r,n,a,o,i,u,f,l,c,d,h,m,x,A){this.Ah=e|0,this.Al=t|0,this.Bh=r|0,this.Bl=n|0,this.Ch=a|0,this.Cl=o|0,this.Dh=i|0,this.Dl=u|0,this.Eh=f|0,this.El=l|0,this.Fh=c|0,this.Fl=d|0,this.Gh=h|0,this.Gl=m|0,this.Hh=x|0,this.Hl=A|0}process(e,t){for(let b=0;b<16;b++,t+=4)R[b]=e.getUint32(t),_[b]=e.getUint32(t+=4);for(let b=16;b<80;b++){const C=R[b-15]|0,M=_[b-15]|0,Z=U(C,M,1)^U(C,M,8)^je(C,M,7),ee=B(C,M,1)^B(C,M,8)^Fe(C,M,7),T=R[b-2]|0,O=_[b-2]|0,W=U(T,O,19)^V(T,O,61)^je(T,O,6),te=B(T,O,19)^q(T,O,61)^Fe(T,O,6),G=kt(ee,te,_[b-7],_[b-16]),se=jt(G,Z,W,R[b-7],R[b-16]);R[b]=se|0,_[b]=G|0}let{Ah:r,Al:n,Bh:a,Bl:o,Ch:i,Cl:u,Dh:f,Dl:l,Eh:c,El:d,Fh:h,Fl:m,Gh:x,Gl:A,Hh:D,Hl:k}=this;for(let b=0;b<80;b++){const C=U(c,d,14)^U(c,d,18)^V(c,d,41),M=B(c,d,14)^B(c,d,18)^q(c,d,41),Z=c&h^~c&x,ee=d&m^~d&A,T=Ft(k,M,ee,qt[b],_[b]),O=Wt(T,D,C,Z,Vt[b],R[b]),W=T|0,te=U(r,n,28)^V(r,n,34)^V(r,n,39),G=B(r,n,28)^q(r,n,34)^q(r,n,39),se=r&a^r&i^a&i,ct=n&o^n&u^o&u;D=x|0,k=A|0,x=h|0,A=m|0,h=c|0,m=d|0,{h:c,l:d}=v(f|0,l|0,O|0,W|0),f=i|0,l=u|0,i=a|0,u=o|0,a=r|0,o=n|0;const Ue=$t(W,G,ct);r=Dt(Ue,O,te,se),n=Ue|0}({h:r,l:n}=v(this.Ah|0,this.Al|0,r|0,n|0)),{h:a,l:o}=v(this.Bh|0,this.Bl|0,a|0,o|0),{h:i,l:u}=v(this.Ch|0,this.Cl|0,i|0,u|0),{h:f,l}=v(this.Dh|0,this.Dl|0,f|0,l|0),{h:c,l:d}=v(this.Eh|0,this.El|0,c|0,d|0),{h,l:m}=v(this.Fh|0,this.Fl|0,h|0,m|0),{h:x,l:A}=v(this.Gh|0,this.Gl|0,x|0,A|0),{h:D,l:k}=v(this.Hh|0,this.Hl|0,D|0,k|0),this.set(r,n,a,o,i,u,f,l,c,d,h,m,x,A,D,k)}roundClean(){H(R,_)}destroy(){H(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Kt extends et{constructor(){super(48),this.Ah=g[0]|0,this.Al=g[1]|0,this.Bh=g[2]|0,this.Bl=g[3]|0,this.Ch=g[4]|0,this.Cl=g[5]|0,this.Dh=g[6]|0,this.Dl=g[7]|0,this.Eh=g[8]|0,this.El=g[9]|0,this.Fh=g[10]|0,this.Fl=g[11]|0,this.Gh=g[12]|0,this.Gl=g[13]|0,this.Hh=g[14]|0,this.Hl=g[15]|0}}const Ss=Q(()=>new zt),Is=Q(()=>new et),Rs=Q(()=>new Kt);class tt extends p{constructor({cause:e,message:t}={}){var n;const r=(n=t==null?void 0:t.replace("execution reverted: ",""))==null?void 0:n.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(tt,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(tt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class Xt extends p{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${K(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(Xt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class Jt extends p{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${K(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(Jt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class Yt extends p{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(Yt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Qt extends p{constructor({cause:e,nonce:t}={}){super([`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
|
|
3
|
-
`),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(Qt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class Zt extends p{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(Zt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class es extends p{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
|
|
4
|
-
`),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(es,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class ts extends p{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(ts,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class ss extends p{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(ss,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class rs extends p{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(rs,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class ns extends p{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${K(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${K(r)} gwei`:""}).`].join(`
|
|
5
|
-
`),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(ns,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class _s extends p{constructor({cause:e}){super(`An error occurred while executing: ${e==null?void 0:e.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}class Hs extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const t=super.get(e);return super.has(e)&&t!==void 0&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const as=BigInt(0),F=BigInt(1),os=BigInt(2),is=BigInt(7),cs=BigInt(256),us=BigInt(113),st=[],rt=[],nt=[];for(let s=0,e=F,t=1,r=0;s<24;s++){[t,r]=[r,(2*t+3*r)%5],st.push(2*(5*r+t)),rt.push((s+1)*(s+2)/2%64);let n=as;for(let a=0;a<7;a++)e=(e<<F^(e>>is)*us)%cs,e&os&&(n^=F<<(F<<BigInt(a))-F);nt.push(n)}const at=Qe(nt,!0),ls=at[0],ds=at[1],We=(s,e,t)=>t>32?Ut(s,e,t):Pt(s,e,t),Ge=(s,e,t)=>t>32?Bt(s,e,t):Lt(s,e,t);function hs(s,e=24){const t=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let o=0;o<10;o++)t[o]=s[o]^s[o+10]^s[o+20]^s[o+30]^s[o+40];for(let o=0;o<10;o+=2){const i=(o+8)%10,u=(o+2)%10,f=t[u],l=t[u+1],c=We(f,l,1)^t[i],d=Ge(f,l,1)^t[i+1];for(let h=0;h<50;h+=10)s[o+h]^=c,s[o+h+1]^=d}let n=s[2],a=s[3];for(let o=0;o<24;o++){const i=rt[o],u=We(n,a,i),f=Ge(n,a,i),l=st[o];n=s[l],a=s[l+1],s[l]=u,s[l+1]=f}for(let o=0;o<50;o+=10){for(let i=0;i<10;i++)t[i]=s[o+i];for(let i=0;i<10;i++)s[o+i]^=~t[(i+2)%10]&t[(i+4)%10]}s[0]^=ls[r],s[1]^=ds[r]}H(t)}class ce extends ie{constructor(e,t,r,n=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=a,X(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Ot(this.state)}clone(){return this._cloneInto()}keccak(){De(this.state32),hs(this.state32,this.rounds),De(this.state32),this.posOut=0,this.pos=0}update(e){$(this),e=Y(e),P(e);const{blockLen:t,state:r}=this,n=e.length;for(let a=0;a<n;){const o=Math.min(t-this.pos,n-a);for(let i=0;i<o;i++)r[this.pos++]^=e[a++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,(t&128)!==0&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){$(this,!1),P(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,a=e.length;n<a;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,a-n);e.set(t.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return X(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Je(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,H(this.state)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:a,enableXOF:o}=this;return e||(e=new ce(t,r,n,o,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=r,e.outputLen=n,e.enableXOF=o,e.destroyed=this.destroyed,e}}const fs=(s,e,t)=>Q(()=>new ce(e,s,t)),Ps=fs(1,136,256/8),ue=(s,e,t)=>JSON.stringify(s,(r,n)=>typeof n=="bigint"?n.toString():n,t),Ls=s=>s,le=s=>s;class Us extends p{constructor({body:e,cause:t,details:r,headers:n,status:a,url:o}){super("HTTP request failed.",{cause:t,details:r,metaMessages:[a&&`Status: ${a}`,`URL: ${le(o)}`,e&&`Request body: ${ue(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=n,this.status=a,this.url=o}}class ps extends p{constructor({body:e,error:t,url:r}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${le(r)}`,`Request body: ${ue(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code,this.data=t.data,this.url=r}}class Bs extends p{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${le(t)}`,`Request body: ${ue(e)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=t}}const bs=-1;class E extends p{constructor(e,{code:t,docsPath:r,metaMessages:n,name:a,shortMessage:o}){super(o,{cause:e,docsPath:r,metaMessages:n||(e==null?void 0:e.metaMessages),name:a||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=a||e.name,this.code=e instanceof ps?e.code:t??bs}}class w extends E{constructor(e,t){super(e,t),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class de extends E{constructor(e){super(e,{code:de.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(de,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class he extends E{constructor(e){super(e,{code:he.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(he,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class fe extends E{constructor(e,{method:t}={}){super(e,{code:fe.code,name:"MethodNotFoundRpcError",shortMessage:`The method${t?` "${t}"`:""} does not exist / is not available.`})}}Object.defineProperty(fe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class pe extends E{constructor(e){super(e,{code:pe.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
|
|
6
|
-
`)})}}Object.defineProperty(pe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class be extends E{constructor(e){super(e,{code:be.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(be,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class me extends E{constructor(e){super(e,{code:me.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
|
|
7
|
-
`)})}}Object.defineProperty(me,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class ge extends E{constructor(e){super(e,{code:ge.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(ge,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class ye extends E{constructor(e){super(e,{code:ye.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(ye,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class xe extends E{constructor(e){super(e,{code:xe.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(xe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Ee extends E{constructor(e,{method:t}={}){super(e,{code:Ee.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${t?` "${t}"`:""} is not supported.`})}}Object.defineProperty(Ee,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class we extends E{constructor(e){super(e,{code:we.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(we,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Ae extends E{constructor(e){super(e,{code:Ae.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(Ae,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Ne extends w{constructor(e){super(e,{code:Ne.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(Ne,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class Te extends w{constructor(e){super(e,{code:Te.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(Te,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Oe extends w{constructor(e,{method:t}={}){super(e,{code:Oe.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${t?` " ${t}"`:""}.`})}}Object.defineProperty(Oe,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class ve extends w{constructor(e){super(e,{code:ve.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(ve,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class Ce extends w{constructor(e){super(e,{code:Ce.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(Ce,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Me extends w{constructor(e){super(e,{code:Me.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(Me,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class Se extends w{constructor(e){super(e,{code:Se.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(Se,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class Ie extends w{constructor(e){super(e,{code:Ie.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(Ie,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class Re extends w{constructor(e){super(e,{code:Re.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(Re,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class _e extends w{constructor(e){super(e,{code:_e.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(_e,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class He extends w{constructor(e){super(e,{code:He.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(He,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class Pe extends w{constructor(e){super(e,{code:Pe.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(Pe,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class Le extends w{constructor(e){super(e,{code:Le.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(Le,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class $s extends E{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}class ot extends ie{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Tt(e);const r=Y(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,a=new Uint8Array(n);a.set(r.length>n?e.create().update(r).digest():r);for(let o=0;o<a.length;o++)a[o]^=54;this.iHash.update(a),this.oHash=e.create();for(let o=0;o<a.length;o++)a[o]^=106;this.oHash.update(a),H(a)}update(e){return $(this),this.iHash.update(e),this}digestInto(e){$(this),P(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:a,blockLen:o,outputLen:i}=this;return e=e,e.finished=n,e.destroyed=a,e.blockLen=o,e.outputLen=i,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const ms=(s,e,t)=>new ot(s,e).update(t).digest();ms.create=(s,e)=>new ot(s,e);const Ds=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],ks=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],it=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],js=[...it,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],Fs=[...it,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],Ws=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],Gs=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],zs=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],Vs=[{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"}],qs=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}];function gs(){let s=()=>{},e=()=>{};return{promise:new Promise((r,n)=>{s=r,e=n}),resolve:s,reject:e}}const ae=new Map;function Ks({fn:s,id:e,shouldSplitBatch:t,wait:r=0,sort:n}){const a=async()=>{const l=u();o();const c=l.map(({args:d})=>d);c.length!==0&&s(c).then(d=>{n&&Array.isArray(d)&&d.sort(n);for(let h=0;h<l.length;h++){const{resolve:m}=l[h];m==null||m([d[h],d])}}).catch(d=>{for(let h=0;h<l.length;h++){const{reject:m}=l[h];m==null||m(d)}})},o=()=>ae.delete(e),i=()=>u().map(({args:l})=>l),u=()=>ae.get(e)||[],f=l=>ae.set(e,[...u(),l]);return{flush:o,async schedule(l){const{promise:c,resolve:d,reject:h}=gs();return(t==null?void 0:t([...i(),l]))&&a(),u().length>0?(f({args:l,resolve:d,reject:h}),c):(f({args:l,resolve:d,reject:h}),setTimeout(a,r),c)}}}var ze={};const ys={WC_NAME_SUFFIX:".reown.id",WC_NAME_SUFFIX_LEGACY:".wcn.id",BLOCKCHAIN_API_RPC_URL:"https://rpc.walletconnect.org",PULSE_API_URL:"https://pulse.walletconnect.org",W3M_API_URL:"https://api.web3modal.org",CONNECTOR_ID:{WALLET_CONNECT:"walletConnect",INJECTED:"injected",WALLET_STANDARD:"announced",COINBASE:"coinbaseWallet",COINBASE_SDK:"coinbaseWalletSDK",BASE_ACCOUNT:"baseAccount",SAFE:"safe",LEDGER:"ledger",OKX:"okx",EIP6963:"eip6963",AUTH:"AUTH"},CONNECTOR_NAMES:{AUTH:"Auth"},AUTH_CONNECTOR_SUPPORTED_CHAINS:["eip155","solana"],LIMITS:{PENDING_TRANSACTIONS:99},CHAIN:{EVM:"eip155",SOLANA:"solana",POLKADOT:"polkadot",BITCOIN:"bip122",TON:"ton"},CHAIN_NAME_MAP:{eip155:"EVM Networks",solana:"Solana",polkadot:"Polkadot",bip122:"Bitcoin",cosmos:"Cosmos",sui:"Sui",stacks:"Stacks",ton:"TON"},ADAPTER_TYPES:{BITCOIN:"bitcoin",SOLANA:"solana",WAGMI:"wagmi",ETHERS:"ethers",ETHERS5:"ethers5",TON:"ton"},USDT_CONTRACT_ADDRESSES:["0xdac17f958d2ee523a2206206994597c13d831ec7","0xc2132d05d31c914a87c6611c10748aeb04b58e8f","0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7","0x919C1c267BC06a7039e03fcc2eF738525769109c","0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e","0x55d398326f99059fF775485246999027B3197955","0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"],SOLANA_SPL_TOKEN_ADDRESSES:{SOL:"So11111111111111111111111111111111111111112"},HTTP_STATUS_CODES:{SERVER_ERROR:500,TOO_MANY_REQUESTS:429,SERVICE_UNAVAILABLE:503,FORBIDDEN:403},UNSUPPORTED_NETWORK_NAME:"Unknown Network",SECURE_SITE_SDK_ORIGIN:(typeof Be<"u"&&typeof ze<"u"?ze.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",REMOTE_FEATURES_ALERTS:{MULTI_WALLET_NOT_ENABLED:{DEFAULT:{displayMessage:"Multi-Wallet Not Enabled",debugMessage:"Multi-wallet support is not enabled. Please enable it in your AppKit configuration at cloud.reown.com."},CONNECTIONS_HOOK:{displayMessage:"Multi-Wallet Not Enabled",debugMessage:"Multi-wallet support is not enabled. Please enable it in your AppKit configuration at cloud.reown.com to use the useAppKitConnections hook."},CONNECTION_HOOK:{displayMessage:"Multi-Wallet Not Enabled",debugMessage:"Multi-wallet support is not enabled. Please enable it in your AppKit configuration at cloud.reown.com to use the useAppKitConnection hook."}},HEADLESS_NOT_ENABLED:{DEFAULT:{displayMessage:"",debugMessage:"Headless support is not enabled. Please enable it with the features.headless option in the AppKit configuration and make sure your current plan supports it."}}},IS_DEVELOPMENT:typeof Be<"u"&&!1,DEFAULT_ALLOWED_ANCESTORS:["http://localhost:*","https://localhost:*","http://127.0.0.1:*","https://127.0.0.1:*","https://*.pages.dev","https://*.vercel.app","https://*.ngrok-free.app","https://secure-mobile.walletconnect.com","https://secure-mobile.walletconnect.org"],METMASK_CONNECTOR_NAME:"MetaMask",TRUST_CONNECTOR_NAME:"Trust Wallet",SOLFLARE_CONNECTOR_NAME:"Solflare",PHANTOM_CONNECTOR_NAME:"Phantom",COIN98_CONNECTOR_NAME:"Coin98",MAGIC_EDEN_CONNECTOR_NAME:"Magic Eden",BACKPACK_CONNECTOR_NAME:"Backpack",BITGET_CONNECTOR_NAME:"Bitget Wallet",FRONTIER_CONNECTOR_NAME:"Frontier",XVERSE_CONNECTOR_NAME:"Xverse Wallet",LEATHER_CONNECTOR_NAME:"Leather",OKX_CONNECTOR_NAME:"OKX Wallet",BINANCE_CONNECTOR_NAME:"Binance Wallet",EIP155:"eip155",ADD_CHAIN_METHOD:"wallet_addEthereumChain",EIP6963_ANNOUNCE_EVENT:"eip6963:announceProvider",EIP6963_REQUEST_EVENT:"eip6963:requestProvider",CONNECTOR_RDNS_MAP:{coinbaseWallet:"com.coinbase.wallet",coinbaseWalletSDK:"com.coinbase.wallet"},CONNECTOR_TYPE_EXTERNAL:"EXTERNAL",CONNECTOR_TYPE_WALLET_CONNECT:"WALLET_CONNECT",CONNECTOR_TYPE_INJECTED:"INJECTED",CONNECTOR_TYPE_ANNOUNCED:"ANNOUNCED",CONNECTOR_TYPE_AUTH:"AUTH",CONNECTOR_TYPE_MULTI_CHAIN:"MULTI_CHAIN",CONNECTOR_TYPE_W3M_AUTH:"AUTH"},Xs={caipNetworkIdToNumber(s){return s?Number(s.split(":")[1]):void 0},parseEvmChainId(s){return typeof s=="string"?this.caipNetworkIdToNumber(s):s},getNetworksByNamespace(s,e){return(s==null?void 0:s.filter(t=>t.chainNamespace===e))||[]},getFirstNetworkByNamespace(s,e){return this.getNetworksByNamespace(s,e)[0]},getNetworkNameByCaipNetworkId(s,e){var n;if(!e)return;const t=s.find(a=>a.caipNetworkId===e);if(t)return t.name;const[r]=e.split(":");return((n=ys.CHAIN_NAME_MAP)==null?void 0:n[r])||void 0}},Js=["eip155","solana","polkadot","bip122","cosmos","sui","stacks"];export{be as $,lt as A,p as B,ys as C,dt as D,tt as E,Xt as F,Jt as G,Us as H,me as I,es as J,ts as K,Hs as L,ss as M,Zt as N,Yt as O,Qt as P,rs as Q,ps as R,Ke as S,ns as T,_s as U,Bs as V,Le as W,Pe as X,He as Y,Ce as Z,Re as _,Os as a,pe as a0,he as a1,Ae as a2,we as a3,fe as a4,Ee as a5,de as a6,ve as a7,w as a8,ge as a9,Ks as aA,zs as aB,Js as aC,Xs as aD,Rs as aE,Is as aF,ye as aa,E as ab,Me as ac,xe as ad,Te as ae,_e as af,$s as ag,Ie as ah,Se as ai,Oe as aj,Ne as ak,oe as al,pt as am,ft as an,Ts as ao,mt as ap,At as aq,J as ar,Ss as as,Ps as at,Ls as au,X as av,Ms as aw,ms as ax,Cs as ay,As as az,ks as b,$e as c,Xe as d,Gs as e,K as f,le as g,Et as h,ht as i,re as j,Ws as k,Fs as l,xt as m,gt as n,Ds as o,qs as p,Vs as q,vs as r,ue as s,Ns as t,js as u,wt as v,gs as w,ws as x,ut as y,Es as z};
|
package/assets/ccip-sVcQHIcW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as b,t as O,f as x,A as I,d as T,g as F,a as E,b as D,e as w,c as G,h as A,i as j,I as C,j as H,k as _,l as v,m as B,n as U}from"./verifyHash-mxdlcflY.js";import{b as m,B as y,g as L,s as M,H as R,i as z}from"./NetworkUtil-BR1fA1nY.js";function J(a){const{abi:n,data:e}=a,s=b(e,0,4),t=n.find(o=>o.type==="function"&&s===O(x(o)));if(!t)throw new I(s,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:t.name,args:"inputs"in t&&t.inputs&&t.inputs.length>0?T(t.inputs,b(e,4)):void 0}}const p="/docs/contract/encodeErrorResult";function k(a){const{abi:n,errorName:e,args:s}=a;let t=n[0];if(e){const u=F({abi:n,args:s,name:e});if(!u)throw new E(e,{docsPath:p});t=u}if(t.type!=="error")throw new E(void 0,{docsPath:p});const o=x(t),r=O(o);let c="0x";if(s&&s.length>0){if(!t.inputs)throw new D(t.name,{docsPath:p});c=w(t.inputs,s)}return G([r,c])}const h="/docs/contract/encodeFunctionResult";function W(a){const{abi:n,functionName:e,result:s}=a;let t=n[0];if(e){const r=F({abi:n,name:e});if(!r)throw new A(e,{docsPath:h});t=r}if(t.type!=="function")throw new A(void 0,{docsPath:h});if(!t.outputs)throw new j(t.name,{docsPath:h});const o=(()=>{if(t.outputs.length===0)return[];if(t.outputs.length===1)return[s];if(Array.isArray(s))return s;throw new C(s)})();return w(t.outputs,o)}const P="x-batch-gateway:true";async function S(a){const{data:n,ccipRequest:e}=a,{args:[s]}=J({abi:m,data:n}),t=[],o=[];return await Promise.all(s.map(async(r,c)=>{try{o[c]=r.urls.includes(P)?await S({data:r.data,ccipRequest:e}):await e(r),t[c]=!1}catch(u){t[c]=!0,o[c]=K(u)}})),W({abi:m,functionName:"query",result:[t,o]})}function K(a){return a.name==="HttpRequestError"&&a.status?k({abi:m,errorName:"HttpError",args:[a.status,a.shortMessage]}):k({abi:[H],errorName:"Error",args:["shortMessage"in a?a.shortMessage:a.message]})}class Q extends y{constructor({callbackSelector:n,cause:e,data:s,extraData:t,sender:o,urls:r}){var c;super(e.shortMessage||"An error occurred while fetching for an offchain result.",{cause:e,metaMessages:[...e.metaMessages||[],(c=e.metaMessages)!=null&&c.length?"":[],"Offchain Gateway Call:",r&&[" Gateway URL(s):",...r.map(u=>` ${L(u)}`)],` Sender: ${o}`,` Data: ${s}`,` Callback selector: ${n}`,` Extra data: ${t}`].flat(),name:"OffchainLookupError"})}}class V extends y{constructor({result:n,url:e}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${L(e)}`,`Response: ${M(n)}`],name:"OffchainLookupResponseMalformedError"})}}class X extends y{constructor({sender:n,to:e}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${e}`,`OffchainLookup sender address: ${n}`],name:"OffchainLookupSenderMismatchError"})}}const Y="0x556f1830",N={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function Z(a,{blockNumber:n,blockTag:e,data:s,to:t}){const{args:o}=_({data:s,abi:[N]}),[r,c,u,f,d]=o,{ccipRead:i}=a,g=i&&typeof(i==null?void 0:i.request)=="function"?i.request:q;try{if(!v(t,r))throw new X({sender:r,to:t});const l=c.includes(P)?await S({data:u,ccipRequest:g}):await g({data:u,sender:r,urls:c}),{data:$}=await B(a,{blockNumber:n,blockTag:e,data:U([f,w([{type:"bytes"},{type:"bytes"}],[l,d])]),to:t});return $}catch(l){throw new Q({callbackSelector:f,cause:l,data:s,extraData:d,sender:r,urls:c})}}async function q({data:a,sender:n,urls:e}){var t;let s=new Error("An unknown error occurred.");for(let o=0;o<e.length;o++){const r=e[o],c=r.includes("{data}")?"GET":"POST",u=c==="POST"?{data:a,sender:n}:void 0,f=c==="POST"?{"Content-Type":"application/json"}:{};try{const d=await fetch(r.replace("{sender}",n.toLowerCase()).replace("{data}",a),{body:JSON.stringify(u),headers:f,method:c});let i;if((t=d.headers.get("Content-Type"))!=null&&t.startsWith("application/json")?i=(await d.json()).data:i=await d.text(),!d.ok){s=new R({body:u,details:i!=null&&i.error?M(i.error):d.statusText,headers:d.headers,status:d.status,url:r});continue}if(!z(i)){s=new V({result:i,url:r});continue}return i}catch(d){s=new R({body:u,details:d.message,url:r})}}throw s}const at=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:q,offchainLookup:Z,offchainLookupAbiItem:N,offchainLookupSignature:Y},Symbol.toStringTag,{value:"Module"}));export{W as a,N as b,q as c,J as d,k as e,Y as f,at as g,P as l,Z as o};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as _,H as L}from"./thirdweb--fgBAAk6.js";const V="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",U=V.length,M=V.charAt(0),z=Math.log(256)/Math.log(U);function F(t){if(!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length===0)return"";let e=0,i=0,n=0;const s=t.length;for(;n!==s&&t[n]===0;)n++,e++;const c=(s-n)*z+1>>>0,a=new Uint8Array(c);for(;n!==s;){let d=t[n]||0,w=0;for(let h=c-1;(d!==0||w<i)&&h!==-1;h--,w++)d+=256*(a[h]||0)>>>0,a[h]=d%U>>>0,d=d/U>>>0;if(d!==0)throw new Error("Non-zero carry");i=w,n++}let l=c-i;for(;l!==c&&a[l]===0;)l++;let u=M.repeat(e);for(;l<c;++l)u+=V.charAt(a[l]||0);return u}let o,E,r=0,j={},b,N;const D=0;let C=0,S,R,H;const $={mapsAsObjects:!0,useRecords:!1};function I(t){let e;if(t<16&&(e=T(t)))return e;if(t>64&&decoder)return decoder.decode(o.subarray(r,r+=t));const i=r+t,n=[];for(e="";r<i;){const s=o[r++];if((s&128)===0)n.push(s);else if((s&224)===192){const c=o[r++]&63;n.push((s&31)<<6|c)}else if((s&240)===224){const c=o[r++]&63,a=o[r++]&63;n.push((s&31)<<12|c<<6|a)}else if((s&248)===240){const c=o[r++]&63,a=o[r++]&63,l=o[r++]&63;let u=(s&7)<<18|c<<12|a<<6|l;u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u)}else n.push(s);n.length>=4096&&(e+=x.apply(String,n),n.length=0)}return n.length>0&&(e+=x.apply(String,n)),e}class O{constructor(){Object.assign(this,$)}decodeKey(e){return e}decode(e,i=-1){E=i>-1?i:e.length,r=0,C=0,N=null,S=null,o=e;try{H=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){throw o=null,e instanceof Uint8Array?n:new Error(`Source must be a Uint8Array or Buffer but was a ${e&&typeof e=="object"?e.constructor.name:typeof e}`)}return this instanceof O?(j=this,this.sharedValues&&(this.pack?new Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),(!b||b.length>0)&&(b=[])):(j=$,(!b||b.length>0)&&(b=[])),v()}}function v(){try{const t=g();if(S){if(r>=S.postBundlePosition){const e=new Error("Unexpected bundle position");throw e.incomplete=!0,e}r=S.postBundlePosition,S=null}if(r===E)b=null,o=null,R&&(R=null);else if(r>E){const e=new Error("Unexpected end of CBOR data");throw e.incomplete=!0,e}else throw new Error("Data read, but end of buffer not reached");return t}catch(t){throw q(),(t instanceof RangeError||t.message.startsWith("Unexpected end of buffer"))&&(t.incomplete=!0),t}}function g(){let t=o[r++];const e=t>>5;if(t=t&31,t>23)switch(t){case 24:t=o[r++];break;default:throw new Error(`Unknown token ${t}`)}switch(e){case 0:return t;case 1:return~t;case 2:return W(t);case 3:if(C>=r)return N.slice(r-D,(r+=t)-D);if(C===0&&E<140&&t<32){const i=t<16?T(t):K(t);if(i!==null)return i}return I(t);case 4:{const i=new Array(t);for(let n=0;n<t;n++)i[n]=g();return i}case 5:{const i={};for(let n=0;n<t;n++)i[J(g())]=g();return i}default:if(Number.isNaN(t)){const i=new Error("Unexpected end of CBOR data");throw i.incomplete=!0,i}throw new Error(`Unknown CBOR token ${t}`)}}function J(t){if(typeof t=="string")return t==="__proto__"?"__proto_":t;if(typeof t!="object")return t.toString();throw new Error(`Invalid property name type ${typeof t}`)}const x=String.fromCharCode;function K(t){const e=r,i=new Array(t);for(let n=0;n<t;n++){const s=o[r++];if((s&128)>0){r=e;return}i[n]=s}return x.apply(String,i)}function T(t){if(t<4){if(t<2){if(t===0)return"";const k=o[r++];if((k&128)>1){r-=1;return}return x(k)}const f=o[r++],p=o[r++];if((f&128)>0||(p&128)>0){r-=2;return}if(t<3)return x(f,p);const y=o[r++];if((y&128)>0){r-=3;return}return x(f,p,y)}const e=o[r++],i=o[r++],n=o[r++],s=o[r++];if((e&128)>0||(i&128)>0||(n&128)>0||(s&128)>0){r-=4;return}if(t<6){if(t===4)return x(e,i,n,s);const f=o[r++];if((f&128)>0){r-=5;return}return x(e,i,n,s,f)}if(t<8){const f=o[r++],p=o[r++];if((f&128)>0||(p&128)>0){r-=6;return}if(t<7)return x(e,i,n,s,f,p);const y=o[r++];if((y&128)>0){r-=7;return}return x(e,i,n,s,f,p,y)}const c=o[r++],a=o[r++],l=o[r++],u=o[r++];if((c&128)>0||(a&128)>0||(l&128)>0||(u&128)>0){r-=8;return}if(t<10){if(t===8)return x(e,i,n,s,c,a,l,u);const f=o[r++];if((f&128)>0){r-=9;return}return x(e,i,n,s,c,a,l,u,f)}if(t<12){const f=o[r++],p=o[r++];if((f&128)>0||(p&128)>0){r-=10;return}if(t<11)return x(e,i,n,s,c,a,l,u,f,p);const y=o[r++];if((y&128)>0){r-=11;return}return x(e,i,n,s,c,a,l,u,f,p,y)}const d=o[r++],w=o[r++],h=o[r++],m=o[r++];if((d&128)>0||(w&128)>0||(h&128)>0||(m&128)>0){r-=12;return}if(t<14){if(t===12)return x(e,i,n,s,c,a,l,u,d,w,h,m);const f=o[r++];if((f&128)>0){r-=13;return}return x(e,i,n,s,c,a,l,u,d,w,h,m,f)}const A=o[r++],B=o[r++];if((A&128)>0||(B&128)>0){r-=14;return}if(t<15)return x(e,i,n,s,c,a,l,u,d,w,h,m,A,B);const P=o[r++];if((P&128)>0){r-=15;return}return x(e,i,n,s,c,a,l,u,d,w,h,m,A,B,P)}function W(t){return j.copyBuffers?Uint8Array.prototype.slice.call(o,r,r+=t):o.subarray(r,r+=t)}function q(){o=null,R=null,b=null}const G=new Array(147);for(let t=0;t<256;t++)G[t]=+`1e${Math.floor(45.15-t*.30103)}`;const Q=new O,X=Q.decode;function Y(t){return _(t,{strict:!1})?t:`0x${t}`}function tt(t){const e=L(Y(t)),i=e[e.length-2]*256+e[e.length-1],n=e.length-2-i;if(n<0||n>e.length)return;const s=e.slice(n,-2),c=X(s);if("ipfs"in c)return`ipfs://${F(c.ipfs)}`}export{tt as extractIPFSUri};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{g as $}from"./thirdweb--fgBAAk6.js";var V,J;function X(){return J||(J=1,V=(function(y){var b={};function a(r){if(b[r])return b[r].exports;var o=b[r]={i:r,l:!1,exports:{}};return y[r].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=y,a.c=b,a.d=function(r,o,l){a.o(r,o)||Object.defineProperty(r,o,{enumerable:!0,get:l})},a.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},a.t=function(r,o){if(1&o&&(r=a(r)),8&o||4&o&&typeof r=="object"&&r&&r.__esModule)return r;var l=Object.create(null);if(a.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:r}),2&o&&typeof r!="string")for(var u in r)a.d(l,u,(function(R){return r[R]}).bind(null,u));return l},a.n=function(r){var o=r&&r.__esModule?function(){return r.default}:function(){return r};return a.d(o,"a",o),o},a.o=function(r,o){return Object.prototype.hasOwnProperty.call(r,o)},a.p="",a(a.s=3)})([function(y,b){y.exports=function(a){return a&&a.__esModule?a:{default:a}}},function(y,b){y.exports=function(a,r){if(!(a instanceof r))throw new TypeError("Cannot call a class as a function")}},function(y,b,a){function r(){return Math.floor(9e4*Math.random())+1e4}Object.defineProperty(b,"__esModule",{value:!0}),b.sendAsyncWrapper=function(o,l){var u=this;return new Promise(function(R,x){u.sendAsync({jsonrpc:"2.0",id:r(),method:o,params:l||[]},function(T,A){T?x(T):R(A.result)})})},b.sendFortmaticAsyncWrapper=function(o){var l=this;return new Promise(function(u,R){l.getProvider().sendFortmaticAsync(o,function(x,T){x?R(x):u(T?T.result:{})})})},b.randomId=r,b.findExistingResponse=function(o,l){for(var u=0;u<o.length;u++)if(o[u].id===l)return o[u];return null}},function(y,b,a){y.exports=a(4)},function(y,b,a){var r=a(0),o=r(a(1)),l=r(a(5)),u=a(2),R="fm_composeSend",x="fm_logout",T="fm_get_balances",A="fm_get_transactions",w="fm_is_logged_in",P="fm_accountSettings",n="fm_deposit",s="fm_get_user",c="fm_configure",f={};y.exports=function g(_,O,I){var m=this;if((0,o.default)(this,g),this.fortmaticClient="https://x2.fortmatic.com",!_)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.apiKey=_,this.options=I,this.ethNetwork=O,this.queryParams=btoa(JSON.stringify({API_KEY:_,ETH_NETWORK:O})),this.transactions={send:function(h,M){var C=new v(R,{to:h.to,value:h.amount});m.getProvider().sendFortmaticAsync(C,M)}},this.getProvider=function(){return f["fortmatic-".concat(m.queryParams)]||(f["fortmatic-".concat(m.queryParams)]=new l.default(m.fortmaticClient,{API_KEY:_,ETH_NETWORK:O})),f["fortmatic-".concat(m.queryParams)]},this.user={login:function(){return m.getProvider().enable()},logout:function(){m.getProvider().account=null,m.getProvider().network=null;var h=new v(x);return u.sendFortmaticAsyncWrapper.call(m,h)},getUser:function(){var h=new v(s);return u.sendFortmaticAsyncWrapper.call(m,h)},getBalances:function(){var h=new v(T);return u.sendFortmaticAsyncWrapper.call(m,h)},getTransactions:function(){var h=new v(A);return u.sendFortmaticAsyncWrapper.call(m,h)},isLoggedIn:function(){var h=new v(w);return u.sendFortmaticAsyncWrapper.call(m,h)},settings:function(){var h=new v(P);return u.sendFortmaticAsyncWrapper.call(m,h)},deposit:function(h){var M=new v(n,h);return u.sendFortmaticAsyncWrapper.call(m,M)}},this.configure=function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=new v(c);return M.params=[h],u.sendFortmaticAsyncWrapper.call(m,M)}};var v=function g(_,O){(0,o.default)(this,g),this.id=(0,u.randomId)(),this.method=_,this.params=O?[O]:[{}]}},function(y,b,a){var r=a(0);Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var o=r(a(6)),l=r(a(9)),u=r(a(1)),R=r(a(10)),x=a(11),T=r(a(12)),A=a(2),w=(function(){function P(n,s){if((0,u.default)(this,P),this.fortmaticClient=n,this.requests={},this.queue=[],this.account=null,this.network=null,this.isFortmatic=!0,this.overlayReady=!1,this.isLoggedIn=!1,this.postMessages={FORTMATIC_HANDLE_BATCH_REQUEST:"FORTMATIC_HANDLE_BATCH_REQUEST",FORTMATIC_HANDLE_REQUEST:"FORTMATIC_HANDLE_REQUEST",FORTMATIC_HANDLE_FORTMATIC_REQUEST:"FORTMATIC_HANDLE_FORTMATIC_REQUEST",FORTMATIC_HANDLE_RESPONSE:"FORTMATIC_HANDLE_RESPONSE",FORTMATIC_OVERLAY_READY:"FORTMATIC_OVERLAY_READY",FORTMATIC_SHOW_OVERLAY:"FORTMATIC_SHOW_OVERLAY",FORTMATIC_HIDE_OVERLAY:"FORTMATIC_HIDE_OVERLAY",FORTMATIC_USER_DENIED:"FORTMATIC_USER_DENIED",FORTMATIC_USER_LOGOUT:"FORTMATIC_USER_LOGOUT",FORTMATIC_UNAUTHORIZED_API_KEY:"FORTMATIC_UNAUTHORIZED_API_KEY"},!s.API_KEY)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.options={API_KEY:s.API_KEY,ETH_NETWORK:s.ETH_NETWORK,DOMAIN_ORIGIN:window.location?window.location.origin:"",version:x.version},this.queryParams=btoa(JSON.stringify(this.options)),this.constructPostMessage(),this.overlay=this.createOverlay(),this.listenMessage()}return(0,R.default)(P,[{key:"constructPostMessage",value:function(){var n=this;Object.keys(this.postMessages).map(function(s){n.postMessages[s]+="-".concat(n.queryParams)})}},{key:"createOverlay",value:function(){var n=this;return new Promise(function(s,c){var f=function(){if((function(){var O=!0,I=!1,m=void 0;try{for(var h,M=document.getElementsByClassName("fortmatic-iframe")[Symbol.iterator]();!(O=(h=M.next()).done);O=!0)if(h.value.src.includes(n.queryParams))return!1}catch(C){I=!0,m=C}finally{try{O||M.return==null||M.return()}finally{if(I)throw m}}return!0})()){var v=document.createElement("style");v.innerHTML=T.default.css,v.type="text/css",document.head.appendChild(v);var g=document.createElement("iframe");g.className="fortmatic-iframe",g.src="".concat(n.fortmaticClient,"/send?params=").concat(n.queryParams),document.body.appendChild(g);var _=document.createElement("img");_.src="https://static.fortmatic.com/assets/trans.gif",document.body.appendChild(_),s({iframe:g})}else console.error("Fortmatic: Duplicate instances found.")};["loaded","interactive","complete"].indexOf(document.readyState)>-1?f():window.addEventListener("load",f.bind(n),!1)})}},{key:"showOverlay",value:(function(){var n=(0,l.default)(o.default.mark(function s(){return o.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.overlay;case 2:c.sent.iframe.style.display="block";case 4:case"end":return c.stop()}},s,this)}));return function(){return n.apply(this,arguments)}})()},{key:"hideOverlay",value:(function(){var n=(0,l.default)(o.default.mark(function s(){return o.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.overlay;case 2:c.sent.iframe.style.display="none";case 4:case"end":return c.stop()}},s,this)}));return function(){return n.apply(this,arguments)}})()},{key:"sendAsync",value:function(n,s){n.length>0?this.enqueue({payload:{id:(0,A.randomId)(),batch:n.map(function(c){return c.id=(0,A.randomId)(),c}),method:"eth_batchRequest"},cb:s}):this.enqueue({payload:n,cb:s})}},{key:"sendFortmaticAsync",value:function(n,s){this.enqueue({payload:n,cb:s,isNative:!0})}},{key:"send",value:function(n,s){if(typeof n=="string")return A.sendAsyncWrapper.call(this,n,s);if(!s){console.warn("Non-async web3 methods will be deprecated in web3 > 1.0, and are not supported by the Fortmatic provider. An async method to be used instead."),this.sendAsync(n,function(){});var c={};switch(n.method){case"eth_accounts":c=this.account?[this.account]:[];break;case"eth_coinbase":c=this.account;break;case"net_version":c=this.network||(this.options.API_KEY.startsWith("pk_live")?1:4);break;case"eth_uninstallFilter":c=!0;break;default:c={}}return{id:n.id,jsonrpc:n.jsonrpc,result:c}}this.sendAsync(n,s)}},{key:"enqueue",value:function(n){this.queue.push(n),this.overlayReady&&this.dequeue()}},{key:"dequeue",value:(function(){var n=(0,l.default)(o.default.mark(function s(){var c,f,v,g=this;return o.default.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(this.queue.length!==0){_.next=2;break}return _.abrupt("return");case 2:if(!(c=this.queue.shift())){_.next=11;break}return f=c.payload,v=c.cb,f.id=(0,A.randomId)(),_.next=9,this.postMessage(c.isNative?this.postMessages.FORTMATIC_HANDLE_FORTMATIC_REQUEST:this.postMessages.FORTMATIC_HANDLE_REQUEST,c.payload);case 9:f.batch&&f.batch.length>0?(f.batch.forEach(function(O){g.requests[O.id]={parentId:f.id,payload:O,cb:function(I,m){var h=g.requests[f.id].batchResponse;if(I&&I.response&&!(0,A.findExistingResponse)(h,I.response.id))throw h.push({jsonrpc:"2.0",id:I.response.id,error:{code:I.response.code,message:I.response.message}}),g.requests[f.id].cb(null,h),I.response;if(m&&m.result&&!(0,A.findExistingResponse)(h,m.id))return h.push(m);throw new Error("Fortmatic: unexpected callback behavior")}}}),this.requests[f.id]={payload:f,cb:v,batchResponse:[]}):this.requests[f.id]={payload:f,cb:v},this.dequeue();case 11:case"end":return _.stop()}},s,this)}));return function(){return n.apply(this,arguments)}})()},{key:"postMessage",value:(function(){var n=(0,l.default)(o.default.mark(function s(c,f){var v;return o.default.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,this.overlay;case 2:if(!(v=g.sent).iframe.contentWindow){g.next=7;break}v.iframe.contentWindow.postMessage({msgType:c,payload:f},"*"),g.next=8;break;case 7:throw new Error("Fortmatic: Modal is not ready.");case 8:case"end":return g.stop()}},s,this)}));return function(s,c){return n.apply(this,arguments)}})()},{key:"enable",value:function(){return A.sendAsyncWrapper.call(this,"eth_accounts")}},{key:"listenMessage",value:function(){var n=this;window.addEventListener("message",function(s){if(s.origin===n.fortmaticClient){var c=s.data.response?s.data.response.id:null;switch(s.data.msgType){case n.postMessages.FORTMATIC_OVERLAY_READY:n.overlayReady=!0,n.dequeue();break;case n.postMessages.FORTMATIC_HANDLE_RESPONSE:try{n.requests[c].cb(null,s.data.response);var f=n.requests[c].parentId;f&&n.requests[f].payload.batch.length===n.requests[f].batchResponse.length&&n.requests[f].cb(null,n.requests[f].batchResponse),n.requests[c].payload.method==="eth_accounts"?n.account=s.data.response.result[0]:n.requests[c].payload.method==="eth_coinbase"?n.account=s.data.response.result:n.requests[c].payload.method==="net_version"&&(n.network=s.data.response.result)}catch{}n.isLoggedIn=!0,n.dequeue();break;case n.postMessages.FORTMATIC_HIDE_OVERLAY:n.hideOverlay();break;case n.postMessages.FORTMATIC_SHOW_OVERLAY:n.showOverlay();break;case n.postMessages.FORTMATIC_USER_LOGOUT:n.account=null,n.network=null,n.isLoggedIn=!1;break;case n.postMessages.FORTMATIC_UNAUTHORIZED_API_KEY:throw n.overlayReady=!1,new Error("Given API key is not authorized to access the resource.");case n.postMessages.FORTMATIC_USER_DENIED:if(c){var v=s.data.response&&s.data.response.message?s.data.response.message:"Fortmatic: Modal was closed without executing action!",g=s.data.response&&s.data.response.code?s.data.response.code:1;n.requests[c].cb({message:v,code:g,response:s.data.response})}else n.queue.forEach(function(_){return _.cb({message:"Fortmatic: Modal was closed without executing action!",code:1})});n.dequeue()}}})}}]),P})();b.default=w},function(y,b,a){y.exports=a(7)},function(y,b,a){var r=(function(){return this||typeof self=="object"&&self})()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,l=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,y.exports=a(8),o)r.regeneratorRuntime=l;else try{delete r.regeneratorRuntime}catch{r.regeneratorRuntime=void 0}},function(y,b){(function(a){var r,o=Object.prototype,l=o.hasOwnProperty,u=typeof Symbol=="function"?Symbol:{},R=u.iterator||"@@iterator",x=u.asyncIterator||"@@asyncIterator",T=u.toStringTag||"@@toStringTag",A=typeof y=="object",w=a.regeneratorRuntime;if(w)A&&(y.exports=w);else{(w=a.regeneratorRuntime=A?y.exports:{}).wrap=I;var P="suspendedStart",n="suspendedYield",s="executing",c="completed",f={},v={};v[R]=function(){return this};var g=Object.getPrototypeOf,_=g&&g(g(G([])));_&&_!==o&&l.call(_,R)&&(v=_);var O=C.prototype=h.prototype=Object.create(v);M.prototype=O.constructor=C,C.constructor=M,C[T]=M.displayName="GeneratorFunction",w.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===M||(e.displayName||e.name)==="GeneratorFunction")},w.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,C):(t.__proto__=C,T in t||(t[T]="GeneratorFunction")),t.prototype=Object.create(O),t},w.awrap=function(t){return{__await:t}},B(U.prototype),U.prototype[x]=function(){return this},w.AsyncIterator=U,w.async=function(t,e,d,p){var i=new U(I(t,e,d,p));return w.isGeneratorFunction(e)?i:i.next().then(function(F){return F.done?F.value:i.next()})},B(O),O[T]="Generator",O[R]=function(){return this},O.toString=function(){return"[object Generator]"},w.keys=function(t){var e=[];for(var d in t)e.push(d);return e.reverse(),function p(){for(;e.length;){var i=e.pop();if(i in t)return p.value=i,p.done=!1,p}return p.done=!0,p}},w.values=G,K.prototype={constructor:K,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Y),!t)for(var e in this)e.charAt(0)==="t"&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function d(W,E){return F.type="throw",F.arg=t,e.next=W,E&&(e.method="next",e.arg=r),!!E}for(var p=this.tryEntries.length-1;p>=0;--p){var i=this.tryEntries[p],F=i.completion;if(i.tryLoc==="root")return d("end");if(i.tryLoc<=this.prev){var j=l.call(i,"catchLoc"),N=l.call(i,"finallyLoc");if(j&&N){if(this.prev<i.catchLoc)return d(i.catchLoc,!0);if(this.prev<i.finallyLoc)return d(i.finallyLoc)}else if(j){if(this.prev<i.catchLoc)return d(i.catchLoc,!0)}else{if(!N)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return d(i.finallyLoc)}}}},abrupt:function(t,e){for(var d=this.tryEntries.length-1;d>=0;--d){var p=this.tryEntries[d];if(p.tryLoc<=this.prev&&l.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var i=p;break}}i&&(t==="break"||t==="continue")&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var F=i?i.completion:{};return F.type=t,F.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(F)},complete:function(t,e){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var d=this.tryEntries[e];if(d.finallyLoc===t)return this.complete(d.completion,d.afterLoc),Y(d),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var d=this.tryEntries[e];if(d.tryLoc===t){var p=d.completion;if(p.type==="throw"){var i=p.arg;Y(d)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,d){return this.delegate={iterator:G(t),resultName:e,nextLoc:d},this.method==="next"&&(this.arg=r),f}}}function I(t,e,d,p){var i=e&&e.prototype instanceof h?e:h,F=Object.create(i.prototype),j=new K(p||[]);return F._invoke=(function(N,W,E){var k=P;return function(S,D){if(k===s)throw new Error("Generator is already running");if(k===c){if(S==="throw")throw D;return z()}for(E.method=S,E.arg=D;;){var H=E.delegate;if(H){var q=Q(H,E);if(q){if(q===f)continue;return q}}if(E.method==="next")E.sent=E._sent=E.arg;else if(E.method==="throw"){if(k===P)throw k=c,E.arg;E.dispatchException(E.arg)}else E.method==="return"&&E.abrupt("return",E.arg);k=s;var L=m(N,W,E);if(L.type==="normal"){if(k=E.done?c:n,L.arg===f)continue;return{value:L.arg,done:E.done}}L.type==="throw"&&(k=c,E.method="throw",E.arg=L.arg)}}})(t,d,j),F}function m(t,e,d){try{return{type:"normal",arg:t.call(e,d)}}catch(p){return{type:"throw",arg:p}}}function h(){}function M(){}function C(){}function B(t){["next","throw","return"].forEach(function(e){t[e]=function(d){return this._invoke(e,d)}})}function U(t){var e;this._invoke=function(d,p){function i(){return new Promise(function(F,j){(function N(W,E,k,S){var D=m(t[W],t,E);if(D.type!=="throw"){var H=D.arg,q=H.value;return q&&typeof q=="object"&&l.call(q,"__await")?Promise.resolve(q.__await).then(function(L){N("next",L,k,S)},function(L){N("throw",L,k,S)}):Promise.resolve(q).then(function(L){H.value=L,k(H)},function(L){return N("throw",L,k,S)})}S(D.arg)})(d,p,F,j)})}return e=e?e.then(i,i):i()}}function Q(t,e){var d=t.iterator[e.method];if(d===r){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=r,Q(t,e),e.method==="throw"))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var p=m(d,t.iterator,e.arg);if(p.type==="throw")return e.method="throw",e.arg=p.arg,e.delegate=null,f;var i=p.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=r),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function Z(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function Y(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function K(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(Z,this),this.reset(!0)}function G(t){if(t){var e=t[R];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var d=-1,p=function i(){for(;++d<t.length;)if(l.call(t,d))return i.value=t[d],i.done=!1,i;return i.value=r,i.done=!0,i};return p.next=p}}return{next:z}}function z(){return{value:r,done:!0}}})((function(){return this||typeof self=="object"&&self})()||Function("return this")())},function(y,b){function a(r,o,l,u,R,x,T){try{var A=r[x](T),w=A.value}catch(P){return void l(P)}A.done?o(w):Promise.resolve(w).then(u,R)}y.exports=function(r){return function(){var o=this,l=arguments;return new Promise(function(u,R){var x=r.apply(o,l);function T(w){a(x,u,R,T,A,"next",w)}function A(w){a(x,u,R,T,A,"throw",w)}T(void 0)})}}},function(y,b){function a(r,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(r,u.key,u)}}y.exports=function(r,o,l){return o&&a(r.prototype,o),l&&a(r,l),r}},function(y){y.exports={name:"fortmatic",version:"1.1.3",description:"Fortmatic Javascript SDK",main:"lib/fortmatic.js",scripts:{build:"WEBPACK_ENV=production webpack","build:dev":"WEBPACK_ENV=development BABEL_ENV=development webpack --progress --colors --watch",test:"nyc --reporter=lcov --reporter=text-summary ava"},author:"Fortmatic <team@fortmatic.com> (https://fortmatic.com/)",license:"MIT",repository:{type:"git",url:"https://github.com/fortmatic/fortmatic-js"},keywords:["Auth","Login","Web3","Crypto","Ethereum","MetaMask","Wallet","Blockchain","Dapp"],homepage:"https://www.fortmatic.com",ava:{require:["@babel/register"],files:["test/**/*.spec.js"],babel:{testOptions:{presets:["@babel/env"],plugins:["@babel/plugin-proposal-function-bind","@babel/plugin-transform-runtime"]}},verbose:!0},nyc:{all:!1,"check-coverage":!0,"per-file":!0,lines:80,statements:80,functions:80,branches:80,include:["src/**/*.js"],exclude:["*/style.js"],require:[],reporter:["html","lcov"]},dependencies:{"@babel/runtime":"7.3.4"},devDependencies:{"@babel/core":"7.3.4","@babel/plugin-proposal-function-bind":"7.2.0","@babel/plugin-transform-modules-commonjs":"7.2.0","@babel/plugin-transform-runtime":"7.3.4","@babel/preset-env":"7.3.4","@babel/register":"7.0.0",ava:"2.2.0","babel-eslint":"10.0.1","babel-loader":"8.0.5",eslint:"5.9.0",lodash:"4.17.11",nyc:"13.1.0",sinon:"7.1.1",webpack:"4.26.1","webpack-cli":"3.1.2"}}},function(y,b,a){b.css=`
|
|
2
|
-
.fortmatic-iframe {
|
|
3
|
-
display: none;
|
|
4
|
-
position: fixed;
|
|
5
|
-
top: 0;
|
|
6
|
-
right: 0;
|
|
7
|
-
width: 100%;
|
|
8
|
-
height: 100%;
|
|
9
|
-
border: none;
|
|
10
|
-
border-radius: 0;
|
|
11
|
-
z-index: 2147483647;
|
|
12
|
-
}
|
|
13
|
-
`}])),V}var ee=X();const te=$(ee),ne=Object.freeze(Object.defineProperty({__proto__:null,default:te},Symbol.toStringTag,{value:"Module"}));export{ne as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{L as b,b as h,e as p,r as g,s as f,d as m}from"./thirdweb--fgBAAk6.js";const u=new b(1e3);async function H(i){const{account:n,calls:l}=i,o=l.map(a=>({...a,chain:i.chain})),t=[],c=g(65);if(u.set(c,t),n.sendBatchTransaction){const a=await f({account:n,transactions:o});t.push(a.transactionHash),u.set(c,t)}else for(const a of o){const r=await m({account:n,transaction:a});t.push(r.transactionHash),u.set(c,t)}return c}async function k(i){const{chain:n,client:l,id:o}=i,t=u.get(o);if(!t)throw new Error("Failed to get calls status, unknown bundle id");const c=h({chain:n,client:l});let a="success";const r=await Promise.all(t.map(d=>p(c,{hash:d}).then(s=>({blockHash:s.blockHash,blockNumber:s.blockNumber,gasUsed:s.gasUsed,logs:s.logs.map(e=>({address:e.address,data:e.data,topics:e.topics})),status:s.status,transactionHash:s.transactionHash})).catch(()=>(a="pending",null))));return{atomic:!1,chainId:n.id,id:o,receipts:r.filter(d=>d!==null),status:a,statusCode:200,version:"2.0.0"}}async function x(i){const{chain:n,client:l,id:o}=i,t=u.get(o);if(!t)throw new Error("Failed to get calls status, unknown bundle id");const c=h({chain:n,client:l});let a=200;const r=[];for(const d of t)try{const s=await p(c,{hash:d});r.push({blockHash:s.blockHash,blockNumber:`0x${s.blockNumber.toString(16)}`,gasUsed:`0x${s.gasUsed.toString(16)}`,logs:s.logs.map(e=>({address:e.address,data:e.data,topics:e.topics})),status:s.status==="success"?"0x1":"0x0",transactionHash:s.transactionHash})}catch{a=100}return{atomic:!1,chainId:`0x${n.id.toString(16)}`,id:o,receipts:r,status:a,version:"2.0.0"}}export{k as inAppWalletGetCallsStatus,x as inAppWalletGetCallsStatusRaw,H as inAppWalletSendCalls};
|