PageSourceSearch

https://www.arkade.games/assets/WalletTab-D-IktjAA.js

js arkade.games collected 2026-10-05 23:05:06 UTC 9,063 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DepositModal-Beq6ftmr.js","assets/react-vendor-BeNhjqeV.js","assets/index-BzPMbiYg.js","assets/supabase-CjalFBeo.js","assets/query-BbwQtxGU.js","assets/index-D7JdDUjZ.css","assets/components-C_KDuzvx.js","assets/index-DZyj4puU.js","assets/abis-BZBBmlO1.js","assets/dijkstra-D_NXgYpA.js","assets/createBatchScheduler-DLp1jvjN.js","assets/index.browser.esm-BhEQdKBQ.js","assets/use-solana-network-l4j268qD.js","assets/SolanaNetworkBadge-BuQ74vyY.js","assets/useSolanaBalance-D29YK1Tp.js","assets/WithdrawModal-Wgr3Ob-C.js","assets/arrow-up-right-aT_6ik0y.js","assets/reownConfig-BaBnrQhH.js"])))=>i.map(i=>d[i]);
2import{_ as b,s as X,L as i,B as m,g as G,ak as H,W as J,aF as Q,X as D}from"./index-BzPMbiYg.js";import{r as s,j as e}from"./react-vendor-BeNhjqeV.js";import{c as Z}from"./walletGeneration-Cu31_7sx.js";import{u as T,A as ee}from"./useSolanaBalance-D29YK1Tp.js";import{S as te}from"./SolanaNetworkBadge-BuQ74vyY.js";import{R as se}from"./refresh-cw-DDHByw7B.js";import{W as ae}from"./wallet-CAhAR2TK.js";import{A as ne}from"./arrow-up-right-aT_6ik0y.js";import"./supabase-CjalFBeo.js";import"./query-BbwQtxGU.js";import"./index.browser.esm-BhEQdKBQ.js";import"./use-solana-network-l4j268qD.js";const re=s.lazy(()=>D(()=>b(()=>import("./DepositModal-Beq6ftmr.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])),"DepositModal")),oe=s.lazy(()=>D(()=>b(()=>import("./WithdrawModal-Wgr3Ob-C.js"),__vite__mapDeps([15,1,2,3,4,5,6,7,8,9,10,16])),"WithdrawModal")),ce="@appkit/connection_status";function be({userId:u}){const[a,N]=s.useState(null),[B,$]=s.useState(!0),[v,C]=s.useState(!1),[F,y]=s.useState(!1),[z,S]=s.useState(!1),[I,k]=s.useState(!1),[d,M]=s.useState(null),[n,W]=s.useState(!1),[h,_]=s.useState(null),[c,E]=s.useState(!1),{toast:r}=Q(),{balance:p,loading:w,refetch:A}=T(a),{balance:f,loading:g,refetch:O}=T(h||null);s.useEffect(()=>{P()},[u]);const x=s.useCallback(async()=>{W(!0);try{const{initReown:t}=await b(async()=>{const{initReown:l}=await import("./reownConfig-BaBnrQhH.js");return{initReown:l}},__vite__mapDeps([17,2,1,3,4,5])),o=await t();return M(o),o}catch(t){return console.error("Error loading wallet connector:",t),r({title:"Error",description:"Failed to load the wallet connector",variant:"destructive"}),null}finally{W(!1)}},[r]);s.useEffect(()=>{if(!d)return;_(d.getAddress()??null),E(d.getIsConnectedState());const t=d.subscribeAccount(o=>{_(o.address??null),E(!!o.isConnected)});return()=>{t==null||t()}},[d]),s.useEffect(()=>{let t=null;try{t=window.localStorage.getItem(ce)}catch{t=null}t==="connected"&&x()},[x]);const P=async()=>{try{const{data:t,error:o}=await X.from("profiles").select("wallet_address").eq("user_id",u).maybeSingle();if(o)throw o;if(t!=null&&t.wallet_address)N(t.wallet_address);else{C(!0);const l=await Z(u);l.success&&l.walletAddress?(N(l.walletAddress),r({title:"Wallet Created!",description:"Your Solana testnet wallet has been generated"})):(console.error("Failed to create wallet:",l.error),r({title:"Error",description:l.error||"Failed to create wallet",variant:"destructive"})),C(!1)}}catch(t){console.error("Error fetching/creating wallet:",t)}finally{$(!1)}},K=async()=>{if(a)try{await navigator.clipboard.writeText(a),y(!0),r({title:"Copied!",description:"Wallet address copied to clipboard"}),setTimeout(()=>y(!1),2e3)}catch{r({title:"Error",description:"Failed to copy address",variant:"destructive"})}},L=async()=>{const t=await x();t&&t.open()},V=async()=>{const t=await x();t&&(t.getIsConnectedState()?S(!0):(t.open({view:"Connect"}),r({title:"Connect Wallet",description:"Connect your external wallet first to deposit SOL"})))},U=async()=>{const t=await x();t&&(t.getIsConnectedState()?k(!0):(t.open({view:"Connect"}),r({title:"Connect Wallet",description:"Connect your external wallet first to withdraw SOL"})))},j=s.useCallback(()=>{A(),O()},[A,O]),Y=()=>{j()},q=()=>{j()},R=t=>`${t.slice(0,6)}...${t.slice(-6)}`;return B||v?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-3",children:[e.jsx(i,{className:"w-6 h-6 animate-spin text-accent"}),e.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:v?"Creating your Solana wallet...":"Loading wallet..."})]}):e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h2",{className:"font-sans text-xl font-bold lowercase tracking-wide",children:"wallet"}),e.jsx(m,{variant:"ghost",size:"sm",onClick:j,disabled:w||g,children:e.jsx(se,{className:`w-4 h-4 ${w||g?"animate-spin":""}`})})]}),e.jsx("p",{className:"font-mono text-sm text-muted-foreground mb-8",children:"Manage your Solana wallet and transactions."}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"p-6 border border-border/30 bg-background/50",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-accent/10 flex items-center justify-center",children:e.jsx(ae,{className:"w-5 h-5 text-accent"})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-mono text-xs text-muted-foreground uppercase tracking-wider",children:"System Wallet"}),e.jsx("div",{className:"font-mono text-xs text-muted-foreground
2/60",children:e.jsx(te,{})})]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"font-mono text-xs text-muted-foreground uppercase tracking-wider",children:"Balance"}),e.jsx("div",{className:"font-mono text-xl text-accent font-bold",children:w?e.jsx(i,{className:"w-4 h-4 animate-spin inline"}):`${(p==null?void 0:p.toFixed(4))??"0.0000"} SOL`})]})]}),a?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-card/50 border border-border/20",children:[e.jsx("code",{className:"font-mono text-sm text-foreground flex-1",children:R(a)}),e.jsx(m,{variant:"ghost",size:"sm",onClick:K,className:"shrink-0",children:F?e.jsx(G,{className:"w-4 h-4 text-green-500"}):e.jsx(H,{className:"w-4 h-4"})})]}),e.jsx("div",{className:"font-mono text-xs text-muted-foreground/60 break-all",children:a})]}):e.jsx("div",{className:"p-4 border border-dashed border-border/50 text-center",children:e.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:"No wallet associated with this account"})})]}),e.jsxs("div",{className:`p-6 border ${c?"border-accent/30 bg-accent/5":"border-border/30 bg-background/50"}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`w-10 h-10 ${c?"bg-accent/20":"bg-muted/20"} flex items-center justify-center`,children:e.jsx(J,{className:`w-5 h-5 ${c?"text-accent":"text-muted-foreground"}`})}),e.jsxs("div",{children:[e.jsx("div",{className:`font-mono text-xs uppercase tracking-wider ${c?"text-accent":"text-muted-foreground"}`,children:"Connected Wallet"}),e.jsx("div",{className:"font-mono text-xs text-muted-foreground/60",children:"External Wallet"})]})]}),c&&e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"font-mono text-xs text-muted-foreground uppercase tracking-wider",children:"Balance"}),e.jsx("div",{className:"font-mono text-xl text-foreground font-bold",children:g?e.jsx(i,{className:"w-4 h-4 animate-spin inline"}):`${(f==null?void 0:f.toFixed(4))??"0.0000"} SOL`})]})]}),c&&h?e.jsx("code",{className:"font-mono text-sm text-foreground break-all",children:R(h)}):e.jsxs(m,{onClick:L,disabled:n,variant:"outline",size:"sm",className:"font-mono text-xs uppercase tracking-wider",children:[n&&e.jsx(i,{className:"w-3 h-3 animate-spin mr-2"}),"Connect Wallet"]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs(m,{onClick:V,disabled:n,className:"flex items-center justify-center gap-2 bg-accent/10 hover:bg-accent/20 text-accent border border-accent/30 h-12",variant:"outline",children:[n?e.jsx(i,{className:"w-4 h-4 animate-spin"}):e.jsx(ee,{className:"w-4 h-4"}),e.jsx("span",{className:"font-mono text-sm uppercase tracking-wider",children:"Deposit"})]}),e.jsxs(m,{onClick:U,disabled:n,className:"flex items-center justify-center gap-2 bg-primary/10 hover:bg-primary/20 text-primary border border-primary/30 h-12",variant:"outline",children:[n?e.jsx(i,{className:"w-4 h-4 animate-spin"}):e.jsx(ne,{className:"w-4 h-4"}),e.jsx("span",{className:"font-mono text-sm uppercase tracking-wider",children:"Withdraw"})]})]}),e.jsx("div",{className:"pt-4 border-t border-border/30",children:e.jsxs(m,{onClick:L,disabled:n,variant:"outline",className:"w-full font-mono text-sm uppercase tracking-wider",children:[n&&e.jsx(i,{className:"w-4 h-4 animate-spin mr-2"}
2),c?"Manage Connected Wallet":"Connect External Wallet"]})})]}),a&&d&&e.jsxs(s.Suspense,{fallback:null,children:[e.jsx(re,{open:z,onOpenChange:S,systemWalletAddress:a,connectedBalance:f,onSuccess:Y}),e.jsx(oe,{open:I,onOpenChange:k,userId:u,systemWalletAddress:a,systemBalance:p,onSuccess:q})]})]})}export{be as WalletTab};

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.