PageSourceSearch

https://orderbook-frontend.vercel.app/assets/EmbeddedWalletOnAccountCreateScreen-B0EGaVLf-CRdIt4xA.js

js orderbook-frontend.vercel.app collected 2026-10-03 07:27:15 UTC 2,947 bytes, 1 lines download raw bytes

1import{d6 as W,d7 as F,d8 as b,db as u,dC as L,d9 as j,dm as D,eV as q,e1 as H,e2 as N,dV as z,eW as G,dN as Q,dW as X}from"./index-CIQz0BjK.js";import{n as _}from"./ScreenLayout-BHPjJ5Cm-BwJYu7CA.js";import{C as B}from"./circle-x-4bMJLW9w.js";import"./ModalHeader-Cmkl2H_I-CsUXfRyF.js";import"./Screen-BtitJMEE-zUn-R8d-.js";import"./index-Dq_xe9dz-BJ7onZ8w.js";import"./createLucideIcon-1xH3fanO.js";async function v(s,r){let t=`${s}-auto-${r==="ethereum"?"eth":"sol"}`,i=new TextEncoder().encode(t);return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",i))).map(a=>a.toString(16).padStart(2,"0")).join("")}const J=({errorMessage:s,onClose:r})=>W.jsx(_,s?{title:"Something went wrong",subtitle:s,icon:B,iconVariant:"error",primaryCta:{label:"Close",onClick:r},watermark:!0}:{title:"Creating your wallet",subtitle:"Please wait...",iconVariant:"loading",watermark:!1}),se={component:()=>{var S;let{setModalData:s,navigate:r,data:t,onUserCloseViaDialogOrKeybindRef:i}=F(),a=b(),[O,x]=u.useState(""),{embeddedWallets:A}=b(),{authenticated:m,user:e}=L(),{closePrivyModal:c,walletProxy:E,client:U}=j(),{onSuccess:P,onFailure:w,callAuthOnSuccessOnClose:h,shouldCreateEth:R,shouldCreateSol:$}=t.createWallet,I=D(),y=e?(S=I(q))==null?void 0:S.shouldCreateWallet({user:e}):void 0,T=!!e&&H(e,a.embeddedWallets.ethereum.createOnLogin,y),V=!!e&&N(e,a.embeddedWallets.solana.createOnLogin,y),C=a.embeddedWallets.mode==="legacy-embedded-wallets-only"&&(a==null?void 0:a.embeddedWallets.requireUserOwnedRecoveryOnCreate)===!0,[p,K]=u.useState(null),{create:o}=z(),n=R??T,d=$??V,M=new Q(async()=>{let k=await U.getAccessToken();if(e&&k&&E)try{let l,f=await v(e.id,"ethereum"),g=await v(e.id,"solana");if(n&&d)l=await o({chainType:"ethereum",walletIndex:0,latestUser:e,idempotencyKey:f}),l=await o({chainType:"solana",walletIndex:0,latestUser:l.user,idempotencyKey:g});else if(d)l=await o({chainType:"solana",walletIndex:0,latestUser:e,idempotencyKey:g});else{if(!n)return void c({shouldCallAuthOnSuccess:h});l=await o({chainType:"ethereum",walletIndex:0,latestUser:e,idempotencyKey:f})}K(l),r("EmbeddedWalletCreatedScreen")}catch(l){x(l.message)}});return u.useEffect(()=>m&&e?C?(s({...t,createWallet:{...t.createWallet,shouldCreateEth:n,shouldCreateSol:d},recoverySelection:{...t==null?void 0:t.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:n,shouldCreateSol:d}}),r(G({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:A.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void M.execute():(r("LandingScreen"),void w(Error("User must be authenticated before creating a Privy wallet"))),[C,m]),i.current=()=>null,W.jsx(J,{errorMessage:O||void 0,onClose:()=>{p?(P(p),c({shouldCallAuthOnSuccess:h})):(w(new X("User wallet creation failed")),c({shouldCallAuthOnSuccess:!1}))}})}};export{se as EmbeddedWalletOnAccountCreateScreen,J as EmbeddedWalletOnAccountCreateView,se as default};

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.