@nexus-cross/crossx-sdk-core 2.2.3-beta.1 → 2.2.3-beta.2
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/dist/index.cjs
CHANGED
|
@@ -2580,6 +2580,6 @@ button.__crossx-connect-other-block:active {
|
|
|
2580
2580
|
<path d="M1 4.5L4 7.5L10 1" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2581
2581
|
</svg>`,no=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2582
2582
|
<path d="M12 0C18.6274 0 24 5.37258 24 12C23.9999 18.6273 18.6274 24 12 24C5.37264 24 9.89594e-05 18.6273 0 12C0 5.37258 5.37258 0 12 0ZM10.875 15.127V17.377H13.125V15.127H10.875ZM10.875 6.62207V13.627H13.125V6.62207H10.875Z" fill="currentColor"/>
|
|
2583
|
-
</svg>`;function io(s,e,r){var i;const t=s.querySelectorAll(".__crossx-pin-input");t.forEach((o,a)=>{o.addEventListener("input",()=>{const c=o.value.replace(/\D/g,"");o.value=c?c[0]:"",c&&a<3&&t[a+1].focus();const l=Array.from(t).map(u=>u.value).join("");l.length===4&&setTimeout(()=>e(l),200)}),o.addEventListener("keydown",c=>{c.key==="Backspace"&&!o.value&&a>0&&(t[a-1].focus(),t[a-1].value=""),c.key==="Escape"&&r()}),o.addEventListener("keypress",c=>{/[0-9]/.test(c.key)||c.preventDefault()}),o.addEventListener("paste",c=>{var p;c.preventDefault();const l=(((p=c.clipboardData)==null?void 0:p.getData("text"))??"").replace(/\D/g,"").slice(0,4);if(!l)return;l.split("").forEach((g,_)=>{t[_]&&(t[_].value=g)});const u=Math.min(l.length,3);t[u].focus(),l.length===4&&setTimeout(()=>e(l),200)})});const n=s.querySelector(".__crossx-pin-inputs");n==null||n.addEventListener("click",o=>{if(!o.target.classList.contains("__crossx-pin-input")){const a=Array.from(t).find(c=>!c.value)??t[t.length-1];a==null||a.focus()}}),(i=t[0])==null||i.focus()}class oo{constructor(e="light",r,t=It,n){this.theme=e,this.overrides=r,this.tokens=hr(e,r),this.displayDecimals=t,this.pinKeyboard=n}setPinKeyboard(e){this.pinKeyboard=e}resolvePinKeyboardMode(){const e=this.pinKeyboard;if(typeof e=="function")try{return e()==="native"?"native":"virtual"}catch{return"virtual"}return e==="native"?"native":"virtual"}applyPinKeyboardMode(e){e&&e.classList.toggle("--native-keypad",this.resolvePinKeyboardMode()==="native")}setTheme(e,r){this.theme=e,r!==void 0&&(this.overrides=r),this.tokens=hr(e,this.overrides)}setMessages(e){this.messages=e}getTheme(){return this.theme}showWalletSelector(e,r,t){return new Promise((n,i)=>{var O;ae();const o=[...e],a=Wi(o,this.tokens,t,this.messages),c=Oe();ce(a);let l=!1;const u=()=>{l||(l=!0,a.remove(),c())};let p=null;const g=R=>{u(),n(R)},_=()=>{u(),p?i(p):n(null)};(()=>{a.querySelectorAll(".__crossx-wallet-item").forEach(R=>{R.addEventListener("click",()=>{const L=R.dataset.walletAddress??"",M=parseInt(R.dataset.walletIndex??"0",10),q=o.find(J=>J.index===M);g({address:L,index:M,name:q==null?void 0:q.name})})})})();const w=a.querySelector("#__crossx-add-wallet-error"),S=a.querySelector("#__crossx-add-wallet-btn");S&&S.addEventListener("click",async()=>{S.disabled=!0,w&&(w.hidden=!0,w.textContent="");try{const R=await r();o.push(R);const L=a.querySelector("#__crossx-wallet-list");if(L){const M=document.createElement("button");M.className="__crossx-wallet-item",M.dataset.walletIndex=String(R.index),M.dataset.walletAddress=R.address,M.innerHTML=`${ns(R.address,R.index,this.tokens.bg)}<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">${A(ss(R))}</span><span class="__crossx-wallet-addr">${de(R.address)}</span></span>`,M.addEventListener("click",()=>g(R)),L.appendChild(M);try{M.scrollIntoView({behavior:"smooth",block:"nearest"})}catch{}}S.disabled=!1}catch(R){const L=R instanceof f&&R.code===h.ADDRESS_LIMIT_EXCEEDED,M=this.resolveAddWalletErrorMessage(R);w&&(w.textContent=M,w.hidden=!1),L?(S.disabled=!0,S.setAttribute("aria-disabled","true")):S.disabled=!1,p=R}}),(O=a.querySelector("#__crossx-close-btn"))==null||O.addEventListener("click",_),a.addEventListener("click",R=>{R.target===a&&_()});const I=R=>{R.key==="Escape"&&(document.removeEventListener("keydown",I),_())};document.addEventListener("keydown",I)})}resolveAddWalletErrorMessage(e){const r=this.messages;if(e instanceof f&&e.code===h.ADDRESS_LIMIT_EXCEEDED){const n=e.details,i=typeof(n==null?void 0:n.limit)=="number"?n.limit:Ye;return((r==null?void 0:r.wallet_selector_add_error_limit_exceeded)??"Account limit reached. Maximum {limit} accounts allowed.").replace("{limit}",String(i))}return(r==null?void 0:r.wallet_selector_add_error_generic)??"Failed to add a new account. Please try again."}showLoginSelector(e){var t;const r=((t=e==null?void 0:e.connectOtherWallets)==null?void 0:t.filter(n=>Object.values(Pe).includes(n)&&String(n).trim()!==""))??[];return new Promise(n=>{var g,_,x,w;ae();const i=zi(this.tokens,r,this.messages),o=Oe();ce(i);const a=()=>{i.remove(),o()},c=S=>{a(),n({type:"oauth",provider:S})},l=S=>{a(),n({type:"external",walletId:S})},u=()=>{a(),n(null)};(g=i.querySelector("#__crossx-apple-btn"))==null||g.addEventListener("click",()=>c("apple")),(_=i.querySelector("#__crossx-google-btn"))==null||_.addEventListener("click",()=>c("google")),(x=i.querySelector("#__crossx-connect-other-wallet-btn"))==null||x.addEventListener("click",S=>{const O=S.currentTarget.dataset.walletId??"";O&&l(O)}),(w=i.querySelector("#__crossx-close-btn"))==null||w.addEventListener("click",u),i.addEventListener("click",S=>{S.target===i&&u()}),i.querySelectorAll(".__crossx-login-terms-link").forEach(S=>{S.addEventListener("click",I=>I.stopPropagation())});const p=S=>{S.key==="Escape"&&(document.removeEventListener("keydown",p),u())};document.addEventListener("keydown",p)})}showSessionAlert(e){return new Promise(r=>{var u,p,g;ae();const t=this.messages,n=ji(this.tokens,{title:e.title,message:e.message,email:e.email,accountLabel:(t==null?void 0:t.session_alert_account_label)??"Account",signOutLabel:(t==null?void 0:t.session_alert_sign_out_button)??"Sign out",signInAgainLabel:(t==null?void 0:t.session_alert_sign_in_again_button)??"Sign in again"}),i=Oe();ce(n);let o=!1;const a=()=>{o||(o=!0,n.remove(),i())},c=()=>{a(),r("signout")},l=()=>{a(),r("signin-again")};(u=n.querySelector("#__crossx-session-signout"))==null||u.addEventListener("click",c),(p=n.querySelector("#__crossx-session-signin"))==null||p.addEventListener("click",l),(g=n.querySelector("#__crossx-close-btn"))==null||g.addEventListener("click",c)})}showMigrationFoundPrompt(e){const r=(e==null?void 0:e.allowSkip)??!0;return new Promise(t=>{var a,c,l;ae();const n=Yi(this.tokens,r);ce(n);const i=()=>n.remove(),o=()=>{i(),t("recover")};if((a=n.querySelector("#__crossx-recover-btn"))==null||a.addEventListener("click",o),r){const u=()=>{i(),t("skip")};(c=n.querySelector("#__crossx-skip-btn"))==null||c.addEventListener("click",u),(l=n.querySelector("#__crossx-close-btn"))==null||l.addEventListener("click",u),n.addEventListener("click",g=>{g.target===n&&u()});const p=g=>{g.key==="Escape"&&(document.removeEventListener("keydown",p),u())};document.addEventListener("keydown",p)}})}showPinSetupPrompt(e){return new Promise(r=>{ae();const t=this.messages,n={title:(t==null?void 0:t.pin_setup_title)??"Create PIN",headerSubtitle:(t==null?void 0:t.pin_notice_header_subtitle)??"Required for transactions, PK/mnemonic export & account deletion.",noticeTitle:(t==null?void 0:t.pin_notice_title)??"PIN Setup Notice",noticeDesc:(t==null?void 0:t.pin_notice_description)??"For your security, this PIN cannot be reset or recovered. Please make sure you remember it or store it in a safe place.",check1:(t==null?void 0:t.pin_notice_check1)??"I understand that losing this PIN will result in permanent loss of access to my wallet and assets.",check2:(t==null?void 0:t.pin_notice_check2)??"I understand that no one, including the support team, can recover or reset this PIN on my behalf.",nextButton:(t==null?void 0:t.pin_notice_next_button)??"Next",submitButton:(t==null?void 0:t.pin_notice_submit_button)??"I Understand"},i={title:(t==null?void 0:t.pin_setup_title)??"Create PIN",headerSubtitle:(t==null?void 0:t.pin_setup_header_subtitle)??"This PIN is used to authorize your transactions.",subtitle:(t==null?void 0:t.pin_setup_subtitle)??"Set a 6-digit PIN to authorize transactions.",mismatchError:(t==null?void 0:t.pin_setup_mismatch_error)??"PINs do not match. Please try again."},o={title:(t==null?void 0:t.pin_setup_confirm_title)??"Confirm PIN",headerSubtitle:(t==null?void 0:t.pin_setup_confirm_subtitle)??"Enter your PIN again to confirm."},a=_r(this.tokens,Qi(n)),c=Oe();ce(a);let l=!1;const u=()=>{l||(l=!0,a.remove(),c())},p=O=>{u(),r(O)},g=()=>{u(),r(null)},_=a.querySelector(".__crossx-card"),x={tooShort:(t==null?void 0:t.pin_validation_too_short)??"Please enter a 6-digit PIN.",numbersOnly:(t==null?void 0:t.pin_validation_numbers_only)??"Only numbers (0-9) are allowed.",repeatingDigit:(t==null?void 0:t.pin_validation_repeating_digit)??"Cannot use the same number 3+ times in a row.",sequential:(t==null?void 0:t.pin_validation_sequential)??"Sequential numbers (e.g., 123456) are not allowed.",alternatingPattern:(t==null?void 0:t.pin_validation_alternating_pattern)??"Repeating patterns (e.g., 121212) are not allowed."},w=O=>{var R;_.innerHTML=gt({title:o.title,headerSubtitle:o.headerSubtitle}),this.applyPinKeyboardMode(_),(R=_.querySelector("#__crossx-close-btn"))==null||R.addEventListener("click",g),xt(_,L=>{L===O?p(O):S(i.mismatchError)},g)},S=O=>{var R;_.innerHTML=gt({title:i.title,headerSubtitle:i.headerSubtitle,subtitle:i.subtitle,errorMessage:O}),this.applyPinKeyboardMode(_),(R=_.querySelector("#__crossx-close-btn"))==null||R.addEventListener("click",g),xt(_,L=>{const M=eo(L,x);M?S(M):w(L)},g)};(()=>{var Q;const O=Array.from(_.querySelectorAll(".__crossx-pw-notice-item")),R=_.querySelector("#__crossx-pin-notice-next"),L=new Set;R.removeAttribute("disabled");const M=R.dataset.nextLabel??"Next",q=R.dataset.submitLabel??"I Understand",J=()=>{const H=L.size===O.length;R.classList.toggle("--disabled",!H),R.textContent=H?q:M},G=(H,D)=>{if(L.has(D))return;const F=H.querySelector(`#__crossx-notice-check-${D}`);L.add(D),F.classList.add("--checked"),H.setAttribute("aria-checked","true"),J()},X=(H,D)=>{if(!L.has(D))return;const F=H.querySelector(`#__crossx-notice-check-${D}`);L.delete(D),F.classList.remove("--checked"),H.setAttribute("aria-checked","false"),J()};O.forEach(H=>{const D=parseInt(H.dataset.checkIndex??"0",10);H.addEventListener("click",()=>{L.has(D)?X(H,D):G(H,D)}),H.addEventListener("keydown",F=>{(F.key===" "||F.key==="Enter")&&(F.preventDefault(),L.has(D)?X(H,D):G(H,D))})}),R.addEventListener("click",()=>{if(L.size===O.length){S(e==null?void 0:e.errorMessage);return}const H=O.find(F=>{const m=parseInt(F.dataset.checkIndex??"0",10);return!L.has(m)});if(!H)return;const D=parseInt(H.dataset.checkIndex??"0",10);H.scrollIntoView({behavior:"smooth",block:"nearest"}),H.classList.add("--highlight"),setTimeout(()=>{H.classList.remove("--highlight"),G(H,D)},400)}),(Q=_.querySelector("#__crossx-close-btn"))==null||Q.addEventListener("click",g)})(),a.addEventListener("click",O=>{O.target===a&&g()})})}showPinInputPrompt(e){return new Promise((r,t)=>{var I;ae();const n=this.messages,i=(e==null?void 0:e.verifyMode)===!0,o=i?(n==null?void 0:n.verify_pin_title)??"Verify Your PIN":(n==null?void 0:n.pin_input_title)??"Enter PIN",a=i?(n==null?void 0:n.verify_pin_subtitle)??"Enter your PIN to authorize this transaction.":(n==null?void 0:n.pin_input_subtitle)??"Enter your 6-digit PIN to continue.",c=(n==null?void 0:n.pin_locked_failure_warning)??"Your account will be locked after further failures.",l=_r(this.tokens,gt({title:o,headerSubtitle:a,errorMessage:e==null?void 0:e.errorMessage,warningMessage:c,lockExpiresAt:e==null?void 0:e.lockExpiresAt,attemptCount:e==null?void 0:e.attemptCount,maxAttempts:e==null?void 0:e.maxAttempts})),u=Oe();ce(l);let p=!1;const g=()=>{p||(p=!0,l.remove(),u())},_=O=>{g(),r(O)},x=()=>{g(),r(null)},w=O=>{g(),t(O)},S=l.querySelector(".__crossx-card");this.applyPinKeyboardMode(S),(I=S.querySelector("#__crossx-close-btn"))==null||I.addEventListener("click",x),xt(S,_,x,w,e==null?void 0:e.onSubmit,e==null?void 0:e.lockExpiresAt,c),l.addEventListener("click",O=>{O.target===l&&x()})})}showRecoveryPinInputPrompt(e){return new Promise(r=>{var c;ae();const t=Xi(this.tokens,e);ce(t);const n=()=>t.remove(),i=l=>{n(),r(l)},o=()=>{n(),r(null)},a=t.querySelector(".__crossx-card");a&&this.applyPinKeyboardMode(a),io(t,i,o),(c=t.querySelector("#__crossx-close-btn"))==null||c.addEventListener("click",o),t.addEventListener("click",l=>{l.target===t&&o()})})}showRecoveryPinLockedPrompt(e,r){return new Promise(t=>{var l;ae();const{overlay:n,startCountdown:i}=Zi(this.tokens,e,r);ce(n);const o=()=>{c(),n.remove()},a=()=>{o(),t()},c=i(a);(l=n.querySelector("#__crossx-close-btn"))==null||l.addEventListener("click",a),n.addEventListener("click",u=>{u.target===n&&a()})})}showTransactionComplete(e){return new Promise(r=>{var a,c;ae();const t=Ci(e,this.tokens,this.messages);ce(t);const n=()=>t.remove(),i=()=>{n(),r()};(a=t.querySelector("#__crossx-done-btn"))==null||a.addEventListener("click",i),(c=t.querySelector("#__crossx-close-btn"))==null||c.addEventListener("click",i),t.querySelectorAll(".__crossx-copy-btn").forEach(l=>{l.addEventListener("click",u=>{var g;u.stopPropagation();const p=l.dataset.copy;p&&((g=navigator.clipboard)==null||g.writeText(p).catch(()=>{}))})}),t.addEventListener("click",l=>{l.target===t&&i()});const o=l=>{l.key==="Escape"&&(document.removeEventListener("keydown",o),i())};document.addEventListener("keydown",o)})}showTransactionProgress(e,r){return new Promise(t=>{ae();const n=Pi(e,this.tokens,this.messages);ce(n);const i=()=>n.remove();let o=!1;const a=()=>{o||(o=!0,i(),t())},c=()=>{var u,p;(u=n.querySelector("#__crossx-done-btn"))==null||u.addEventListener("click",a),(p=n.querySelector("#__crossx-close-btn"))==null||p.addEventListener("click",a),n.addEventListener("click",g=>{g.target===n&&a()});const l=g=>{g.key==="Escape"&&(document.removeEventListener("keydown",l),a())};document.addEventListener("keydown",l)};r.then(l=>{o||(Li(n,l,this.tokens,this.messages),c())})})}requestConfirmation(e){return new Promise(r=>{var l,u,p;ae();let t;e.type==="sign-message"?t=Di(e,this.tokens,this.messages):e.type==="sign-typed-data"?t=$i(e,this.tokens,this.messages):e.type==="sign"?t=Ai(e,this.tokens,this.displayDecimals,this.messages):t=Ii(e,this.tokens,this.displayDecimals,this.messages);const n=Oe();ce(t);const i=()=>{t.remove(),n()},o=()=>{i(),r(!0)},a=()=>{i(),r(!1)};(l=t.querySelector("#__crossx-confirm-btn"))==null||l.addEventListener("click",o),(u=t.querySelector("#__crossx-cancel-btn"))==null||u.addEventListener("click",a),(p=t.querySelector("#__crossx-close-btn"))==null||p.addEventListener("click",a),t.querySelectorAll(".__crossx-copy-btn").forEach(g=>{g.addEventListener("click",_=>{var w;_.stopPropagation();const x=g.dataset.copy;x&&((w=navigator.clipboard)==null||w.writeText(x).catch(()=>{}))})}),_i(t),t.addEventListener("click",g=>{g.target===t&&a()});const c=g=>{g.key==="Escape"&&(document.removeEventListener("keydown",c),a())};document.addEventListener("keydown",c)})}}class ao{constructor(e,r,t,n=()=>!1){this.browserConfirmation=e,this.getBridge=r,this.getOrigin=t,this.isAuthenticatedViaRNBridge=n}shouldDelegateToBridge(){var e;return this.isAuthenticatedViaRNBridge()&&!!((e=this.getBridge())!=null&&e.isInstalled)}async requestConfirmation(e){return this.shouldDelegateToBridge()?!0:this.browserConfirmation.requestConfirmation(e)}async requestNativeConfirmation(e){const r=this.getBridge();if(!r)return{approved:!1,reason:"Bridge not available"};const{operation:t,payload:n,chainId:i}=this.mapToNativeParams(e),o={operation:t,payload:n,dappOrigin:this.getOrigin(),chainId:i};return await r.requestUserConfirmation(o)}mapToNativeParams(e){const r=e.type;switch(r){case"sign-message":{const t=e;return{operation:"signMessage",payload:{message:t.message,from:t.from,dappName:t.dappName,accountName:t.accountName},chainId:t.chainId}}case"sign-typed-data":{const t=e;return{operation:"signTypedData",payload:{typedData:t.typedData,from:t.from,dappName:t.dappName,accountName:t.accountName},chainId:t.chainId}}case"sign":{const t=e;return{operation:"signTransaction",payload:{from:t.from,to:t.to,value:t.value,data:t.data,gasLimit:t.gasLimit,gasPrice:t.gasPrice,maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas,nativeSymbol:t.nativeSymbol,nativeDecimals:t.nativeDecimals,dappName:t.dappName,accountName:t.accountName},chainId:t.chainId}}case"send":{const t=e;return{operation:"sendTransaction",payload:{from:t.from,to:t.to,value:t.value,data:t.data,gasLimit:t.gasLimit,gasPrice:t.gasPrice,maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas,nativeSymbol:t.nativeSymbol,nativeDecimals:t.nativeDecimals,dappName:t.dappName,accountName:t.accountName},chainId:t.chainId}}default:throw new f(h.INVALID_CONFIG,`Unknown confirmation type: ${String(r)}`)}}async showTransactionComplete(e){if(!this.shouldDelegateToBridge())return this.browserConfirmation.showTransactionComplete(e)}async showTransactionProgress(e,r){if(this.shouldDelegateToBridge()){try{await r}catch{}return}return this.browserConfirmation.showTransactionProgress(e,r)}async showLoginSelector(e){return this.browserConfirmation.showLoginSelector(e)}async showMigrationFoundPrompt(e){return this.browserConfirmation.showMigrationFoundPrompt(e)}async showRecoveryPinInputPrompt(e){return this.browserConfirmation.showRecoveryPinInputPrompt(e)}async showRecoveryPinLockedPrompt(e,r){return this.browserConfirmation.showRecoveryPinLockedPrompt(e,r)}async showWalletSelector(e,r,t){const n=this.getBridge();if(this.shouldDelegateToBridge()&&(n!=null&&n.showWalletSelector))try{const i=await n.showWalletSelector({requiredAddress:t}),o=e.find(a=>a.address.toLowerCase()===i.address.toLowerCase());return{address:i.address,index:(o==null?void 0:o.index)??i.index,name:o==null?void 0:o.name}}catch{return null}return this.browserConfirmation.showWalletSelector(e,r,t)}async showPinSetupPrompt(e){return this.browserConfirmation.showPinSetupPrompt(e)}async showPinInputPrompt(e){return this.browserConfirmation.showPinInputPrompt(e)}async showSessionAlert(e){return this.browserConfirmation.showSessionAlert(e)}setTheme(e,r){return this.browserConfirmation.setTheme(e,r)}setMessages(e){return this.browserConfirmation.setMessages(e)}}class os{constructor(){this._accessToken=null,this._expiresAt=0}set(e){this._accessToken=e;try{const r=JSON.parse(atob(e.split(".")[1]));this._expiresAt=typeof r.exp=="number"?r.exp*1e3:0}catch{this._expiresAt=0}}get(){return this._accessToken&&this._expiresAt>0&&Date.now()>=this._expiresAt?(this.clear(),null):this._accessToken}clear(){this._accessToken=null,this._expiresAt=0}has(){return this.get()!==null}isExpiringSoon(e=3e4){return!this._accessToken||this._expiresAt<=0?!0:Date.now()>=this._expiresAt-e}}function co(s,e){if(!s.projectId)throw new Error(`[CROSSx] Fatal: projectId is required but was not provided.
|
|
2583
|
+
</svg>`;function io(s,e,r){var i;const t=s.querySelectorAll(".__crossx-pin-input");t.forEach((o,a)=>{o.addEventListener("input",()=>{const c=o.value.replace(/\D/g,"");o.value=c?c[0]:"",c&&a<3&&t[a+1].focus();const l=Array.from(t).map(u=>u.value).join("");l.length===4&&setTimeout(()=>e(l),200)}),o.addEventListener("keydown",c=>{c.key==="Backspace"&&!o.value&&a>0&&(t[a-1].focus(),t[a-1].value=""),c.key==="Escape"&&r()}),o.addEventListener("keypress",c=>{/[0-9]/.test(c.key)||c.preventDefault()}),o.addEventListener("paste",c=>{var p;c.preventDefault();const l=(((p=c.clipboardData)==null?void 0:p.getData("text"))??"").replace(/\D/g,"").slice(0,4);if(!l)return;l.split("").forEach((g,_)=>{t[_]&&(t[_].value=g)});const u=Math.min(l.length,3);t[u].focus(),l.length===4&&setTimeout(()=>e(l),200)})});const n=s.querySelector(".__crossx-pin-inputs");n==null||n.addEventListener("click",o=>{if(!o.target.classList.contains("__crossx-pin-input")){const a=Array.from(t).find(c=>!c.value)??t[t.length-1];a==null||a.focus()}}),(i=t[0])==null||i.focus()}class oo{constructor(e="light",r,t=It,n){this.theme=e,this.overrides=r,this.tokens=hr(e,r),this.displayDecimals=t,this.pinKeyboard=n}setPinKeyboard(e){this.pinKeyboard=e}resolvePinKeyboardMode(){const e=this.pinKeyboard;if(typeof e=="function")try{return e()==="native"?"native":"virtual"}catch{return"virtual"}return e==="native"?"native":"virtual"}applyPinKeyboardMode(e){e&&e.classList.toggle("--native-keypad",this.resolvePinKeyboardMode()==="native")}setTheme(e,r){this.theme=e,r!==void 0&&(this.overrides=r),this.tokens=hr(e,this.overrides)}setMessages(e){this.messages=e}getTheme(){return this.theme}showWalletSelector(e,r,t){return new Promise((n,i)=>{var O;ae();const o=[...e],a=Wi(o,this.tokens,t,this.messages),c=Oe();ce(a);let l=!1;const u=()=>{l||(l=!0,a.remove(),c())};let p=null;const g=R=>{u(),n(R)},_=()=>{u(),p?i(p):n(null)};(()=>{a.querySelectorAll(".__crossx-wallet-item").forEach(R=>{R.addEventListener("click",()=>{const L=R.dataset.walletAddress??"",M=parseInt(R.dataset.walletIndex??"0",10),q=o.find(J=>J.index===M);g({address:L,index:M,name:q==null?void 0:q.name})})})})();const w=a.querySelector("#__crossx-add-wallet-error"),S=a.querySelector("#__crossx-add-wallet-btn");S&&S.addEventListener("click",async()=>{S.disabled=!0,w&&(w.hidden=!0,w.textContent="");try{const R=await r();o.push(R);const L=a.querySelector("#__crossx-wallet-list");if(L){const M=document.createElement("button");M.className="__crossx-wallet-item",M.dataset.walletIndex=String(R.index),M.dataset.walletAddress=R.address,M.innerHTML=`${ns(R.address,R.index,this.tokens.bg)}<span class="__crossx-wallet-info"><span class="__crossx-wallet-idx">${A(ss(R))}</span><span class="__crossx-wallet-addr">${de(R.address)}</span></span>`,M.addEventListener("click",()=>g(R)),L.appendChild(M);try{M.scrollIntoView({behavior:"smooth",block:"nearest"})}catch{}}S.disabled=!1}catch(R){const L=R instanceof f&&R.code===h.ADDRESS_LIMIT_EXCEEDED,M=this.resolveAddWalletErrorMessage(R);w&&(w.textContent=M,w.hidden=!1),L?(S.disabled=!0,S.setAttribute("aria-disabled","true")):S.disabled=!1,p=R}}),(O=a.querySelector("#__crossx-close-btn"))==null||O.addEventListener("click",_),a.addEventListener("click",R=>{R.target===a&&_()});const I=R=>{R.key==="Escape"&&(document.removeEventListener("keydown",I),_())};document.addEventListener("keydown",I)})}resolveAddWalletErrorMessage(e){const r=this.messages;if(e instanceof f&&e.code===h.ADDRESS_LIMIT_EXCEEDED){const n=e.details,i=typeof(n==null?void 0:n.limit)=="number"?n.limit:Ye;return((r==null?void 0:r.wallet_selector_add_error_limit_exceeded)??"Account limit reached. Maximum {limit} accounts allowed.").replace("{limit}",String(i))}return(r==null?void 0:r.wallet_selector_add_error_generic)??"Failed to add a new account. Please try again."}showLoginSelector(e){var t;const r=((t=e==null?void 0:e.connectOtherWallets)==null?void 0:t.filter(n=>Object.values(Pe).includes(n)&&String(n).trim()!==""))??[];return new Promise(n=>{var g,_,x,w;ae();const i=zi(this.tokens,r,this.messages),o=Oe();ce(i);const a=()=>{i.remove(),o()},c=S=>{a(),n({type:"oauth",provider:S})},l=S=>{a(),n({type:"external",walletId:S})},u=()=>{a(),n(null)};(g=i.querySelector("#__crossx-apple-btn"))==null||g.addEventListener("click",()=>c("apple")),(_=i.querySelector("#__crossx-google-btn"))==null||_.addEventListener("click",()=>c("google")),(x=i.querySelector("#__crossx-connect-other-wallet-btn"))==null||x.addEventListener("click",S=>{const O=S.currentTarget.dataset.walletId??"";O&&l(O)}),(w=i.querySelector("#__crossx-close-btn"))==null||w.addEventListener("click",u),i.addEventListener("click",S=>{S.target===i&&u()}),i.querySelectorAll(".__crossx-login-terms-link").forEach(S=>{S.addEventListener("click",I=>I.stopPropagation())});const p=S=>{S.key==="Escape"&&(document.removeEventListener("keydown",p),u())};document.addEventListener("keydown",p)})}showSessionAlert(e){return new Promise(r=>{var u,p,g;ae();const t=this.messages,n=ji(this.tokens,{title:e.title,message:e.message,email:e.email,accountLabel:(t==null?void 0:t.session_alert_account_label)??"Account",signOutLabel:(t==null?void 0:t.session_alert_sign_out_button)??"Sign out",signInAgainLabel:(t==null?void 0:t.session_alert_sign_in_again_button)??"Sign in again"}),i=Oe();ce(n);let o=!1;const a=()=>{o||(o=!0,n.remove(),i())},c=()=>{a(),r("signout")},l=()=>{a(),r("signin-again")};(u=n.querySelector("#__crossx-session-signout"))==null||u.addEventListener("click",c),(p=n.querySelector("#__crossx-session-signin"))==null||p.addEventListener("click",l),(g=n.querySelector("#__crossx-close-btn"))==null||g.addEventListener("click",c)})}showMigrationFoundPrompt(e){const r=(e==null?void 0:e.allowSkip)??!0;return new Promise(t=>{var a,c,l;ae();const n=Yi(this.tokens,r);ce(n);const i=()=>n.remove(),o=()=>{i(),t("recover")};if((a=n.querySelector("#__crossx-recover-btn"))==null||a.addEventListener("click",o),r){const u=()=>{i(),t("skip")};(c=n.querySelector("#__crossx-skip-btn"))==null||c.addEventListener("click",u),(l=n.querySelector("#__crossx-close-btn"))==null||l.addEventListener("click",u),n.addEventListener("click",g=>{g.target===n&&u()});const p=g=>{g.key==="Escape"&&(document.removeEventListener("keydown",p),u())};document.addEventListener("keydown",p)}})}showPinSetupPrompt(e){return new Promise(r=>{ae();const t=this.messages,n={title:(t==null?void 0:t.pin_setup_title)??"Create PIN",headerSubtitle:(t==null?void 0:t.pin_notice_header_subtitle)??"Required for transactions, PK/mnemonic export & account deletion.",noticeTitle:(t==null?void 0:t.pin_notice_title)??"PIN Setup Notice",noticeDesc:(t==null?void 0:t.pin_notice_description)??"For your security, this PIN cannot be reset or recovered. Please make sure you remember it or store it in a safe place.",check1:(t==null?void 0:t.pin_notice_check1)??"I understand that losing this PIN will result in permanent loss of access to my wallet and assets.",check2:(t==null?void 0:t.pin_notice_check2)??"I understand that no one, including the support team, can recover or reset this PIN on my behalf.",nextButton:(t==null?void 0:t.pin_notice_next_button)??"Next",submitButton:(t==null?void 0:t.pin_notice_submit_button)??"I Understand"},i={title:(t==null?void 0:t.pin_setup_title)??"Create PIN",headerSubtitle:(t==null?void 0:t.pin_setup_header_subtitle)??"This PIN is used to authorize your transactions.",subtitle:(t==null?void 0:t.pin_setup_subtitle)??"Set a 6-digit PIN to authorize transactions.",mismatchError:(t==null?void 0:t.pin_setup_mismatch_error)??"PINs do not match. Please try again."},o={title:(t==null?void 0:t.pin_setup_confirm_title)??"Confirm PIN",headerSubtitle:(t==null?void 0:t.pin_setup_confirm_subtitle)??"Enter your PIN again to confirm."},a=_r(this.tokens,Qi(n)),c=Oe();ce(a);let l=!1;const u=()=>{l||(l=!0,a.remove(),c())},p=O=>{u(),r(O)},g=()=>{u(),r(null)},_=a.querySelector(".__crossx-card"),x={tooShort:(t==null?void 0:t.pin_validation_too_short)??"Please enter a 6-digit PIN.",numbersOnly:(t==null?void 0:t.pin_validation_numbers_only)??"Only numbers (0-9) are allowed.",repeatingDigit:(t==null?void 0:t.pin_validation_repeating_digit)??"Cannot use the same number 3+ times in a row.",sequential:(t==null?void 0:t.pin_validation_sequential)??"Sequential numbers (e.g., 123456) are not allowed.",alternatingPattern:(t==null?void 0:t.pin_validation_alternating_pattern)??"Repeating patterns (e.g., 121212) are not allowed."},w=O=>{var R;_.innerHTML=gt({title:o.title,headerSubtitle:o.headerSubtitle}),this.applyPinKeyboardMode(_),(R=_.querySelector("#__crossx-close-btn"))==null||R.addEventListener("click",g),xt(_,L=>{L===O?p(O):S(i.mismatchError)},g)},S=O=>{var R;_.innerHTML=gt({title:i.title,headerSubtitle:i.headerSubtitle,subtitle:i.subtitle,errorMessage:O}),this.applyPinKeyboardMode(_),(R=_.querySelector("#__crossx-close-btn"))==null||R.addEventListener("click",g),xt(_,L=>{const M=eo(L,x);M?S(M):w(L)},g)};(()=>{var Q;const O=Array.from(_.querySelectorAll(".__crossx-pw-notice-item")),R=_.querySelector("#__crossx-pin-notice-next"),L=new Set;R.removeAttribute("disabled");const M=R.dataset.nextLabel??"Next",q=R.dataset.submitLabel??"I Understand",J=()=>{const H=L.size===O.length;R.classList.toggle("--disabled",!H),R.textContent=H?q:M},G=(H,D)=>{if(L.has(D))return;const F=H.querySelector(`#__crossx-notice-check-${D}`);L.add(D),F.classList.add("--checked"),H.setAttribute("aria-checked","true"),J()},X=(H,D)=>{if(!L.has(D))return;const F=H.querySelector(`#__crossx-notice-check-${D}`);L.delete(D),F.classList.remove("--checked"),H.setAttribute("aria-checked","false"),J()};O.forEach(H=>{const D=parseInt(H.dataset.checkIndex??"0",10);H.addEventListener("click",()=>{L.has(D)?X(H,D):G(H,D)}),H.addEventListener("keydown",F=>{(F.key===" "||F.key==="Enter")&&(F.preventDefault(),L.has(D)?X(H,D):G(H,D))})}),R.addEventListener("click",()=>{if(L.size===O.length){S(e==null?void 0:e.errorMessage);return}const H=O.find(F=>{const m=parseInt(F.dataset.checkIndex??"0",10);return!L.has(m)});if(!H)return;const D=parseInt(H.dataset.checkIndex??"0",10);H.scrollIntoView({behavior:"smooth",block:"nearest"}),H.classList.add("--highlight"),setTimeout(()=>{H.classList.remove("--highlight"),G(H,D)},400)}),(Q=_.querySelector("#__crossx-close-btn"))==null||Q.addEventListener("click",g)})(),a.addEventListener("click",O=>{O.target===a&&g()})})}showPinInputPrompt(e){return new Promise((r,t)=>{var I;ae();const n=this.messages,i=(e==null?void 0:e.verifyMode)===!0,o=i?(n==null?void 0:n.verify_pin_title)??"Verify Your PIN":(n==null?void 0:n.pin_input_title)??"Enter PIN",a=i?(n==null?void 0:n.verify_pin_subtitle)??"Enter your PIN to authorize this transaction.":(n==null?void 0:n.pin_input_subtitle)??"Enter your 6-digit PIN to continue.",c=(n==null?void 0:n.pin_locked_failure_warning)??"Your account will be locked after further failures.",l=_r(this.tokens,gt({title:o,headerSubtitle:a,errorMessage:e==null?void 0:e.errorMessage,warningMessage:c,lockExpiresAt:e==null?void 0:e.lockExpiresAt,attemptCount:e==null?void 0:e.attemptCount,maxAttempts:e==null?void 0:e.maxAttempts})),u=Oe();ce(l);let p=!1;const g=()=>{p||(p=!0,l.remove(),u())},_=O=>{g(),r(O)},x=()=>{g(),r(null)},w=O=>{g(),t(O)},S=l.querySelector(".__crossx-card");this.applyPinKeyboardMode(S),(I=S.querySelector("#__crossx-close-btn"))==null||I.addEventListener("click",x),xt(S,_,x,w,e==null?void 0:e.onSubmit,e==null?void 0:e.lockExpiresAt,c),l.addEventListener("click",O=>{O.target===l&&x()})})}showRecoveryPinInputPrompt(e){return new Promise(r=>{var c;ae();const t=Xi(this.tokens,e);ce(t);const n=()=>t.remove(),i=l=>{n(),r(l)},o=()=>{n(),r(null)},a=t.querySelector(".__crossx-card");a&&this.applyPinKeyboardMode(a),io(t,i,o),(c=t.querySelector("#__crossx-close-btn"))==null||c.addEventListener("click",o),t.addEventListener("click",l=>{l.target===t&&o()})})}showRecoveryPinLockedPrompt(e,r){return new Promise(t=>{var l;ae();const{overlay:n,startCountdown:i}=Zi(this.tokens,e,r);ce(n);const o=()=>{c(),n.remove()},a=()=>{o(),t()},c=i(a);(l=n.querySelector("#__crossx-close-btn"))==null||l.addEventListener("click",a),n.addEventListener("click",u=>{u.target===n&&a()})})}showTransactionComplete(e){return new Promise(r=>{var a,c;ae();const t=Ci(e,this.tokens,this.messages);ce(t);const n=()=>t.remove(),i=()=>{n(),r()};(a=t.querySelector("#__crossx-done-btn"))==null||a.addEventListener("click",i),(c=t.querySelector("#__crossx-close-btn"))==null||c.addEventListener("click",i),t.querySelectorAll(".__crossx-copy-btn").forEach(l=>{l.addEventListener("click",u=>{var g;u.stopPropagation();const p=l.dataset.copy;p&&((g=navigator.clipboard)==null||g.writeText(p).catch(()=>{}))})}),t.addEventListener("click",l=>{l.target===t&&i()});const o=l=>{l.key==="Escape"&&(document.removeEventListener("keydown",o),i())};document.addEventListener("keydown",o)})}showTransactionProgress(e,r){return new Promise(t=>{ae();const n=Pi(e,this.tokens,this.messages);ce(n);const i=()=>n.remove();let o=!1;const a=()=>{o||(o=!0,i(),t())},c=()=>{var u,p;(u=n.querySelector("#__crossx-done-btn"))==null||u.addEventListener("click",a),(p=n.querySelector("#__crossx-close-btn"))==null||p.addEventListener("click",a),n.addEventListener("click",g=>{g.target===n&&a()});const l=g=>{g.key==="Escape"&&(document.removeEventListener("keydown",l),a())};document.addEventListener("keydown",l)};r.then(l=>{o||(Li(n,l,this.tokens,this.messages),c())})})}requestConfirmation(e){return new Promise(r=>{var l,u,p;ae();let t;e.type==="sign-message"?t=Di(e,this.tokens,this.messages):e.type==="sign-typed-data"?t=$i(e,this.tokens,this.messages):e.type==="sign"?t=Ai(e,this.tokens,this.displayDecimals,this.messages):t=Ii(e,this.tokens,this.displayDecimals,this.messages);const n=Oe();ce(t);const i=()=>{t.remove(),n()},o=()=>{i(),r(!0)},a=()=>{i(),r(!1)};(l=t.querySelector("#__crossx-confirm-btn"))==null||l.addEventListener("click",o),(u=t.querySelector("#__crossx-cancel-btn"))==null||u.addEventListener("click",a),(p=t.querySelector("#__crossx-close-btn"))==null||p.addEventListener("click",a),t.querySelectorAll(".__crossx-copy-btn").forEach(g=>{g.addEventListener("click",_=>{var w;_.stopPropagation();const x=g.dataset.copy;x&&((w=navigator.clipboard)==null||w.writeText(x).catch(()=>{}))})}),_i(t),t.addEventListener("click",g=>{g.target===t&&a()});const c=g=>{g.key==="Escape"&&(document.removeEventListener("keydown",c),a())};document.addEventListener("keydown",c)})}}class ao{constructor(e,r,t,n=()=>!1){this.browserConfirmation=e,this.getBridge=r,this.getOrigin=t,this.isAuthenticatedViaRNBridge=n}shouldDelegateToBridge(){var e;return this.isAuthenticatedViaRNBridge()&&!!((e=this.getBridge())!=null&&e.isInstalled)}async requestConfirmation(e){return this.shouldDelegateToBridge()?!0:this.browserConfirmation.requestConfirmation(e)}async requestNativeConfirmation(e){const r=this.getBridge();if(!r)return{approved:!1,reason:"Bridge not available"};const{operation:t,payload:n,chainId:i}=this.mapToNativeParams(e),o={operation:t,payload:n,dappOrigin:this.getOrigin(),chainId:i};return await r.requestUserConfirmation(o)}mapToNativeParams(e){const r=e.type;switch(r){case"sign-message":{const t=e;return{operation:"signMessage",payload:{message:t.message,from:t.from,dappName:t.dappName,accountName:t.accountName},chainId:t.chainId}}case"sign-typed-data":{const t=e;return{operation:"signTypedData",payload:{typedData:t.typedData,from:t.from,dappName:t.dappName,accountName:t.accountName},chainId:t.chainId}}case"sign":{const t=e;return{operation:"signTransaction",payload:{from:t.from,to:t.to,value:t.value,data:t.data,gasLimit:t.gasLimit,gasPrice:t.gasPrice,maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas,nativeSymbol:t.nativeSymbol,nativeDecimals:t.nativeDecimals,dappName:t.dappName,accountName:t.accountName},chainId:t.chainId}}case"send":{const t=e;return{operation:"sendTransaction",payload:{from:t.from,to:t.to,value:t.value,data:t.data,gasLimit:t.gasLimit,gasPrice:t.gasPrice,maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas,nativeSymbol:t.nativeSymbol,nativeDecimals:t.nativeDecimals,dappName:t.dappName,accountName:t.accountName},chainId:t.chainId}}default:throw new f(h.INVALID_CONFIG,`Unknown confirmation type: ${String(r)}`)}}async showTransactionComplete(e){if(!this.shouldDelegateToBridge())return this.browserConfirmation.showTransactionComplete(e)}async showTransactionProgress(e,r){if(this.shouldDelegateToBridge()){try{await r}catch{}return}return this.browserConfirmation.showTransactionProgress(e,r)}async showLoginSelector(e){return this.browserConfirmation.showLoginSelector(e)}async showMigrationFoundPrompt(e){return this.browserConfirmation.showMigrationFoundPrompt(e)}async showRecoveryPinInputPrompt(e){return this.browserConfirmation.showRecoveryPinInputPrompt(e)}async showRecoveryPinLockedPrompt(e,r){return this.browserConfirmation.showRecoveryPinLockedPrompt(e,r)}async showWalletSelector(e,r,t){const n=this.getBridge();if(this.shouldDelegateToBridge()&&(n!=null&&n.showWalletSelector))try{const i=await n.showWalletSelector({requiredAddress:t}),o=e.find(a=>a.address.toLowerCase()===i.address.toLowerCase());return{address:i.address,index:(o==null?void 0:o.index)??i.index,name:o==null?void 0:o.name}}catch{return null}return this.browserConfirmation.showWalletSelector(e,r,t)}async showPinSetupPrompt(e){return this.browserConfirmation.showPinSetupPrompt(e)}async showPinInputPrompt(e){return this.browserConfirmation.showPinInputPrompt(e)}async showSessionAlert(e){return this.browserConfirmation.showSessionAlert(e)}setTheme(e,r){return this.browserConfirmation.setTheme(e,r)}setMessages(e){return this.browserConfirmation.setMessages(e)}setPinKeyboard(e){var r,t;(t=(r=this.browserConfirmation).setPinKeyboard)==null||t.call(r,e)}}class os{constructor(){this._accessToken=null,this._expiresAt=0}set(e){this._accessToken=e;try{const r=JSON.parse(atob(e.split(".")[1]));this._expiresAt=typeof r.exp=="number"?r.exp*1e3:0}catch{this._expiresAt=0}}get(){return this._accessToken&&this._expiresAt>0&&Date.now()>=this._expiresAt?(this.clear(),null):this._accessToken}clear(){this._accessToken=null,this._expiresAt=0}has(){return this.get()!==null}isExpiringSoon(e=3e4){return!this._accessToken||this._expiresAt<=0?!0:Date.now()>=this._expiresAt-e}}function co(s,e){if(!s.projectId)throw new Error(`[CROSSx] Fatal: projectId is required but was not provided.
|
|
2584
2584
|
Set the projectId field in SDKConfig when calling createCROSSxSDK().
|
|
2585
2585
|
Example: createCROSSxSDK({ projectId: "your-project-id", ... })`);s.debug;const r=Le.production,t={...s,oauthServiceUrl:r.oauthServiceUrl,authApiUrl:r.authApiUrl,walletGatewayUrl:r.walletGatewayUrl},n={gatewayUrl:r.walletGatewayUrl,projectId:s.projectId},i=t.authMode!=="cookie"&&jt.isAvailable();!i&&t.authMode!=="cookie"&&d.warn("[CROSSx] IndexedDB 사용 불가 — LocalStorage fallback 사용 중.","refresh_token이 평문 저장되지 않도록 세션 영속성이 제한됩니다.","IndexedDB를 지원하는 브라우저 사용을 권장합니다."),t.secureStorageAvailable=i;const o=i?new jt(s.projectId):new js,a=new si,c=new ai,l=new Ae,u=new os,p=new At;let g;s.useMockWallet?(d.log("[CROSSx] Mock Wallet Provider 사용"),g=new li(o,p)):(d.log("[CROSSx] Remote Wallet Provider 사용"),g=new Ie(n,o,c,u,p));let _=null;const x=()=>{var M;return((M=_==null?void 0:_.isAuthenticatedViaRNBridge)==null?void 0:M.call(_))??!1};g=new di(g,()=>{var M;return(M=_==null?void 0:_.getRNBridge)==null?void 0:M.call(_)},x);const w=new He(n,c),S=new oo(s.theme??"light",s.themeTokens,s.displayDecimals,s.pinKeyboard),I=new ao(S,()=>{var M;return(M=_==null?void 0:_.getRNBridge)==null?void 0:M.call(_)},()=>typeof window<"u"?window.location.origin:"http://localhost",x),O=e!=null&&e.wrapConfirmation?e.wrapConfirmation(I):I,R=new Xe(t,n,o,a,c,l,g,u,O,w,p);_=R;const L=R.signInUseCase;return L&&typeof L.setFreshTokenCallback=="function"&&L.setFreshTokenCallback(()=>R.requestFreshFirebaseIdTokenFromBridge()),typeof window<"u"&&(window.__crossxSDK=R),R}function lo(s){const e=uo(s),r=ho(e),t=JSON.parse(r);_o(t);const{data:n}=t;return{status:t.status,state:t.state,firebaseToken:n.accessToken,provider:n.provider,email:n.email,providerSub:n.sub,tokenType:n.tokenType,expiresIn:n.expiresIn,raw:t}}function uo(s){if(s.includes("://")&&s.includes("?")){const e=new URL(s),r=e.searchParams.get("crossx_oauth_result");if(r)return r;const t=e.searchParams.get("data");if(t)return t;throw new Error("Deeplink URL에 crossx_oauth_result 또는 data 파라미터가 없습니다")}return s}function ho(s){if(s.startsWith("{"))return s;if(s.startsWith("%7B")||s.startsWith("%7b"))return decodeURIComponent(s);const e=po(s);return decodeURIComponent(e)}function po(s){if(typeof atob=="function")return atob(s);if(typeof Buffer<"u")return Buffer.from(s,"base64").toString("utf-8");throw new Error("Base64 디코딩을 지원하는 환경이 아닙니다")}function _o(s){if(typeof s!="object"||s===null)throw new Error("Deeplink payload가 유효한 객체가 아닙니다");const e=s;if(typeof e.status!="string")throw new Error("Deeplink payload에 status 필드가 없습니다");if(typeof e.state!="string")throw new Error("Deeplink payload에 state 필드가 없습니다");if(typeof e.data!="object"||e.data===null)throw new Error("Deeplink payload에 data 필드가 없습니다");const r=e.data;if(typeof r.provider!="string")throw new Error("Deeplink data에 provider 필드가 없습니다");if(typeof r.accessToken!="string")throw new Error("Deeplink data에 accessToken 필드가 없습니다")}exports.CONNECT_OTHER_WALLET_DISPLAY_ORDER=fr;exports.CROSSxError=f;exports.CROSSxEthereumProvider=xr;exports.CROSSxSDK=Xe;exports.ChainId=us;exports.ConnectOtherWalletItem=Pe;exports.ErrorCode=h;exports.MNEMONIC_ADDRESS_LIMIT=Ye;exports.PinMemoryStore=At;exports.TokenMemoryStore=os;exports.createCROSSxSDK=co;exports.getConnectOtherWalletLabel=gr;exports.parseOAuthDeeplink=lo;
|