PageSourceSearch

https://www.ufxproject.com/assets/EmbeddedWalletOnAccountCreateScreen-B7blEQwB-DmRVpaTz.js

js ufxproject.com collected 2026-10-08 23:22:44 UTC 2,649 bytes, 1 lines download raw bytes

1import{j as f,r as c}from"./react-vendor-36xutOou.js";import{d9 as P,da as y,de as R,db as M,df as T,dg as j,e8 as k,e0 as F,e9 as L}from"./index-WonNKP7K.js";import{t as V}from"./use-create-wallet-without-fallback-BLN3_KXw-B5Cc5woF.js";import{n as $}from"./ScreenLayout-DIdy7nhJ-Cpn73WZE.js";import{Z as D}from"./ui-vendor-ISMvyiob.js";import"./map-vendor-Cba94izB.js";import"./utils-vendor-CgZjKQg8.js";import"./solana-vendor-QxAl80ro.js";import"./ModalHeader-D5psNgrf-5hNhGSqP.js";import"./Screen-q8npRQhQ-BF1kPs89.js";import"./index-Dq_xe9dz-C9_ZzNPD.js";const q=({errorMessage:l,onClose:a})=>f.jsx($,l?{title:"Something went wrong",subtitle:l,icon:D,iconVariant:"error",primaryCta:{label:"Close",onClick:a},watermark:!0}:{title:"Creating your wallet",subtitle:"Please wait...",iconVariant:"loading",watermark:!1}),_={component:()=>{let{setModalData:l,navigate:a,data:r,onUserCloseViaDialogOrKeybindRef:p}=P(),s=y(),[g,b]=c.useState(""),{embeddedWallets:S}=y(),{authenticated:u,user:e}=R(),{closePrivyModal:d,walletProxy:v,client:O}=M(),{onSuccess:x,onFailure:m,callAuthOnSuccessOnClose:w,shouldCreateEth:W,shouldCreateSol:A}=r.createWallet,h=s.embeddedWallets.mode==="legacy-embedded-wallets-only"&&s?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,[C,E]=c.useState(null),{create:o}=V(),n=W??(!!e&&T(e,s.embeddedWallets.ethereum.createOnLogin)),i=A??(!!e&&j(e,s.embeddedWallets.solana.createOnLogin)),U=new F((async()=>{let I=await O.getAccessToken();if(e&&I&&v)try{let t;if(n&&i)t=await o({chainType:"ethereum",walletIndex:0,latestUser:e}),t=await o({chainType:"solana",walletIndex:0,latestUser:t.user});else if(i)t=await o({chainType:"solana",walletIndex:0,latestUser:e});else{if(!n)return void d({shouldCallAuthOnSuccess:w});t=await o({chainType:"ethereum",walletIndex:0,latestUser:e})}E(t),a("EmbeddedWalletCreatedScreen")}catch(t){b(t.message)}}));return c.useEffect((()=>u&&e?h?(l({...r,createWallet:{...r.createWallet,shouldCreateEth:n,shouldCreateSol:i},recoverySelection:{...r?.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:n,shouldCreateSol:i}}),a(k({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:S.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void U.execute():(a("LandingScreen"),void m(Error("User must be authenticated before creating a Privy wallet")))),[h,u]),p.current=()=>null,f.jsx(q,{errorMessage:g||void 0,onClose:()=>{C?(x(C),d({shouldCallAuthOnSuccess:w})):(m(new L("User wallet creation failed")),d({shouldCallAuthOnSuccess:!1}))}})}};export{_ as EmbeddedWalletOnAccountCreateScreen,q as EmbeddedWalletOnAccountCreateView,_ 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.