PageSourceSearch

https://www.passly.xyz/static/js/5969.a3d930b6.chunk.js

js passly.xyz collected 2026-10-02 02:11:52 UTC 6,544 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunksocial_passport=self.webpackChunksocial_passport||[]).push([[5969],{15969(e,t,s){s.d(t,{ReownAuthentication:()=>o.u});var o=s(81508)},81508(e,t,s){s.d(t,{u:()=>l});var o=s(5544),n=s(49477),r=s(80883),a=s(16496),i=s(65618),c=s(17321),u=s(60205),h=s(99632);class d{constructor(e){this.getNonce=e.getNonce}async createMessage(e){const t={accountAddress:e.accountAddress,chainId:e.chainId,version:"1",domain:"undefined"===typeof document?"Unknown Domain":document.location.host,uri:"undefined"===typeof document?"Unknown URI":document.location.href,resources:this.resources,nonce:await this.getNonce(e),issuedAt:this.stringifyDate(new Date),statement:void 0,expirationTime:void 0,notBefore:void 0},s={toString:()=>this.stringify(t)};return Object.assign(t,s)}stringify(e){var t;const s=this.getNetworkName(e.chainId);return["".concat(e.domain," wants you to sign in with your ").concat(s," account:"),e.accountAddress,e.statement?"\n".concat(e.statement,"\n"):"","URI: ".concat(e.uri),"Version: ".concat(e.version),"Chain ID: ".concat(e.chainId),"Nonce: ".concat(e.nonce),e.issuedAt&&"Issued At: ".concat(e.issuedAt),e.expirationTime&&"Expiration Time: ".concat(e.expirationTime),e.notBefore&&"Not Before: ".concat(e.notBefore),e.requestId&&"Request ID: ".concat(e.requestId),(null===(t=e.resources)||void 0===t?void 0:t.length)&&e.resources.reduce((e,t)=>"".concat(e,"\n- ").concat(t),"Resources:")].filter(e=>"string"===typeof e).join("\n").trim()}getNetworkName(e){const t=c.W.getAllRequestedCaipNetworks();return h.L.getNetworkNameByCaipNetworkId(t,e)}stringifyDate(e){return e.toISOString()}}class l{constructor(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.otpUuid=null,this.listeners={sessionChanged:[]},this.localAuthStorageKey=t.localAuthStorageKey||n.Ws.SIWX_AUTH_TOKEN,this.localNonceStorageKey=t.localNonceStorageKey||n.Ws.SIWX_NONCE_TOKEN,this.required=null===(e=t.required)||void 0===e||e,this.messenger=new d({getNonce:this.getNonce.bind(this)})}async createMessage(e){return this.messenger.createMessage(e)}async addSession(e){const t=await this.request({method:"POST",key:"authenticate",body:{data:e.data,message:e.message,signature:e.signature,clientId:this.getClientId(),walletInfo:this.getWalletInfo()},headers:["nonce","otp"]});this.setStorageToken(t.token,this.localAuthStorageKey),this.emit("sessionChanged",e),this.setAppKitAccountUser(function(e){const t=e.split(".");if(3!==t.length)throw new Error("Invalid token");const s=t[1];if("string"!==typeof s)throw new Error("Invalid token");const o=s.replace(/-/g,"+").replace(/_/g,"/"),n=o.padEnd(o.length+(4-o.length%4)%4,"=");return JSON.parse(atob(n))}(t.token)),this.otpUuid=null}async getSessions(e,t){try{if(!this.getStorageToken(this.localAuthStorageKey))return[];const s=await this.request({method:"GET",key:"me",query:{},headers:["auth"]});if(!s)return[];const o=s.address.toLowerCase()===t.toLowerCase(),n=s.caip2Network===e;if(!o||!n)return[];const r={data:{accountAddress:s.address,chainId:s.caip2Network},message:"",signature:""};return this.emit("sessionChanged",r),this.setAppKitAccountUser(s),[r]}catch(s){return[]}}async revokeSession(e,t){return Promise.resolve(this.clearStorageTokens())}async setSessions(e){if(0===e.length)this.clearStorageTokens();else{const t=e.find(e=>{var t;return e.data.chainId===(null===(t=(0,u.kg)())||void 0===t?void 0:t.caipNetworkId)})||e[0];await this.addSession(t)}}getRequired(){return this.required}async getSessionAccount(){if(!this.getStorageToken(this.localAuthStorageKey))throw new Error("Not authenticated");return this.request({method:"GET",key:"me",body:void 0,query:{includeAppKitAccount:!0},headers:["auth"]})}async setSessionAccountMetadata(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this.getStorageToken(this.localAuthStorageKey))throw new Error("Not authenticated");return this.request({method:"PUT",key:"account-metadata",body:{metadata:e},headers:["auth"]})}on(e,t){return this.listeners[e].push(t),()=>{this.listeners[e]=this.listeners[e].filter(e=>e!==t)}}
1removeAllListeners(){Object.keys(this.listeners).forEach(e=>{this.listeners[e]=[]})}async requestEmailOtp(e){let t=e.email,s=e.account;const o=await this.request({method:"POST",key:"otp",body:{email:t,account:s}});return this.otpUuid=o.uuid,this.messenger.resources=["email:".concat(t)],o}confirmEmailOtp(e){let t=e.code;return this.request({method:"PUT",key:"otp",body:{code:t},headers:["otp"]})}async request(e){var t;let s=e.method,n=e.key,a=e.query,i=e.body,c=e.headers;const u=this.getSDKProperties(),h=u.projectId,d=u.st,l=u.sv,g=new URL("".concat(r.o.W3M_API_URL,"/auth/v1/").concat(String(n)));g.searchParams.set("projectId",h),g.searchParams.set("st",d),g.searchParams.set("sv",l),a&&Object.entries(a).forEach(e=>{let t=(0,o.A)(e,2),s=t[0],n=t[1];return g.searchParams.set(s,String(n))});const m=await fetch(g,{method:s,body:i?JSON.stringify(i):void 0,headers:Array.isArray(c)?c.reduce((e,t)=>{switch(t){case"nonce":e["x-nonce-jwt"]="Bearer ".concat(this.getStorageToken(this.localNonceStorageKey));break;case"auth":e.Authorization="Bearer ".concat(this.getStorageToken(this.localAuthStorageKey));break;case"otp":this.otpUuid&&(e["x-otp"]=this.otpUuid)}return e},{}):void 0});if(!m.ok)throw new Error(await m.text());return null!==(t=m.headers.get("content-type"))&&void 0!==t&&t.includes("application/json")?m.json():null}getStorageToken(e){return n.Ud.getItem(e)}setStorageToken(e,t){n.Ud.setItem(t,e)}clearStorageTokens(){this.otpUuid=null,n.Ud.removeItem(this.localAuthStorageKey),n.Ud.removeItem(this.localNonceStorageKey),this.emit("sessionChanged",void 0)}async getNonce(){const e=await this.request({method:"GET",key:"nonce"}),t=e.nonce,s=e.token;return this.setStorageToken(s,this.localNonceStorageKey),t}getClientId(){return i.T.state.clientId}getWalletInfo(){var e;const t=null===(e=c.W.getAccountData())||void 0===e?void 0:e.connectedWalletInfo;if(!t)return;if("social"in t&&"identifier"in t){return{type:"social",social:t.social,identifier:t.identifier}}const s=t.name,o=t.icon;let n="unknown";switch(t.type){case"EXTERNAL":case"INJECTED":case"ANNOUNCED":n="extension";break;case"WALLET_CONNECT":n="walletconnect";break;default:n="unknown"}return{type:n,name:s,icon:o}}getSDKProperties(){return a.N._getSdkProperties()}emit(e,t){this.listeners[e].forEach(e=>e(t))}setAppKitAccountUser(e){const t=e.email;
1t&&Object.values(r.o.CHAIN).forEach(e=>{c.W.setAccountProp("user",{email:t},e)})}}}}]);
2//# sourceMappingURL=5969.a3d930b6.chunk.js.map

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