PageSourceSearch

https://www.syraa.fun/assets/PumpfunLiveWirePage-rR7bs7HB.js

js syraa.fun collected 2026-10-07 23:55:14 UTC 6,484 bytes, 1 lines download raw bytes

1import{j as e}from"./remotion-D54tqFOj.js";import{x as r}from"./vendor-charts-CXpta1tX.js";import{cU as P,a7 as i,dq as D,dm as O,gD as l,u as W,cm as h,I,lW as T,cX as $,cV as B,aQ as F,jq as z,kY as G}from"./index-O9bDP4Mv.js";const y=G("x402-pumpfun-livewire"),E={launch:"Launch",graduation:"Graduation",whale_trade:"Whale trade"},U={launch:"bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",graduation:"bg-violet-500/15 text-violet-600 dark:text-violet-400",whale_trade:"bg-amber-500/15 text-amber-700 dark:text-amber-400"};function K(){return`${z().replace(/\/$/,"")}/pumpfun/livewire/stream`}function k(s){return s?s.length<=12?s:`${s.slice(0,4)}…${s.slice(-4)}`:"—"}function A(s){return s==null||!Number.isFinite(s)?null:`${s.toFixed(s>=10?1:3)} SOL`}function Y(){const[s,L]=r.useState([]),[S,g]=r.useState(0),[d,j]=r.useState(!1),[b,v]=r.useState(null),[c,_]=r.useState("all"),[R,q]=r.useState(!1),u=r.useRef(null);r.useEffect(()=>{const t=window.matchMedia("(prefers-reduced-motion: reduce)"),n=()=>q(t.matches);return n(),t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[]);const m=r.useCallback(()=>{var n;(n=u.current)==null||n.close(),v(null);const t=new EventSource(K());u.current=t,t.addEventListener("open",()=>j(!0)),t.addEventListener("error",()=>{j(!1),v("Live feed disconnected. Retrying…")}),t.addEventListener("ready",x=>{try{const a=JSON.parse(x.data);typeof a.latestSeq=="number"&&g(a.latestSeq)}catch{}}),t.addEventListener("livewire",x=>{try{const a=JSON.parse(x.data),o=Array.isArray(a.events)?a.events:[];if(o.length===0)return;g(typeof a.latestSeq=="number"?a.latestSeq:o[o.length-1].seq),L(C=>{const M=[...o,...C],w=new Set,f=[];for(const p of M)if(!w.has(p.seq)&&(w.add(p.seq),f.push(p),f.length>=80))break;return f})}catch{}})},[]);r.useEffect(()=>(m(),()=>{var t;return(t=u.current)==null?void 0:t.close()}),[m]);const N=r.useMemo(()=>c==="all"?s:s.filter(t=>t.kind===c),[s,c]);return e.jsxs("div",{className:"relative flex min-h-screen flex-col",children:[e.jsx(P,{}),e.jsx("div",{className:l(F,"relative flex flex-1 flex-col",B,$),children:e.jsxs("div",{className:"mx-auto w-full max-w-2xl space-y-8",children:[e.jsxs("header",{className:"relative space-y-3 pr-10 text-center sm:pr-12",children:[e.jsx(i,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-9 w-9 shrink-0 rounded-full text-muted-foreground hover:text-foreground","aria-label":"Reconnect live feed",onClick:m,children:e.jsx(D,{className:"h-4 w-4","aria-hidden":!0})}),e.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-border/50 bg-background/60 px-3 py-1 text-xs font-medium text-muted-foreground backdrop-blur-sm",children:[e.jsx(O,{className:l("h-3.5 w-3.5",d?"text-emerald-500":"text-muted-foreground"),"aria-hidden":!0}),"pump.fun · Live Wire"]}),e.jsx("h1",{className:"font-display text-2xl font-semibold tracking-tight sm:text-3xl",children:"Real-time launch feed"}),e.jsxs("p",{className:"mx-auto max-w-md text-sm leading-relaxed text-muted-foreground",children:["Free delayed demo of pump.fun launches, graduations, and large trades. Agents settle the full-speed cursor API"," ",e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 text-xs",children:"GET /pumpfun/livewire"})," in Marketplace."]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2 pt-1",children:[e.jsxs("span",{className:l("inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium",d?"bg-emerald-500/10 text-emerald-700 dark:text-emerald-400":"bg-muted text-muted-foreground"),children:[e.jsx(W,{className:"h-3 w-3","aria-hidden":!0}),d?"Connected":"Connecting"]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["cursor seq ",S]})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2 pt-2",children:[e.jsx(i,{asChild:!0,size:"sm",className:"rounded-full",children:e.jsx(h,{to:y,children:"Wire LiveWire for agents"})}),e.jsx(i,{asChild:!0,size:"sm",variant:"outline",className:"rounded-full",children:e.jsx(h,{to:"/marketplace?tab=syra",children:"Browse Marketplace"})})]})]}),e.jsx("div",{className:"flex flex-wrap justify-center gap-2",children:["all","launch","graduation","whale_trade"].map(t=>e.jsx(i,{type:"button",size:"sm",variant:c===t?"default":"outline",className:"rounded-full",onClick:()=>_(t),children:t==="all"?"All":E[t]},t))}),e.jsxs("section",{className:l(T,"space-y-3 p-4 sm:p-5"),children:[b?e.jsx("p",{className:"rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:b}):null,N.length===0?e.jsx("div",{className:"py-10 text-center text-sm text-muted-foreground",children:d?"Waiting for the next pump.fun event…":"Connecting to Live Wire…"}):e.jsx("ul",{className:"space-y-2","aria-live":"polite",children:N.map(t=>e.jsx("li",{className:l("rounded-xl border border-border/50 bg-background/50 px-3 py-3",!R&&"transition-colors hover:bg-background/80"),children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:l("rounded-full px-2 py-0.5 text-[11px] font-semibold uppercase tracking-wide",U[t.kind]),children:E[t.kind]}),e.jsx("span",{className:"text-sm font-medium",children:t.symbol||t.name||k(t.mint)}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["sev ",t.severity]})]}),e.jsx("p",{className:"font-mono text-[11px] text-muted-foreground",children:k(t.mint)}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[new Date(t.at).toLocaleTimeString(),A(t.solAmount)?` · ${A(t.solAmount)}`:""]})]}),t.mint?e.jsx(i,{asChild:!0,variant:"ghost",size:"sm",className:"shrink-0 rounded-full",children:e.jsxs("a",{href:`https://pump.fun/coin/${t.mint}`,target:"_blank",rel:"noreferrer","aria-label":`Open ${t.symbol||"token"} on pump.fun`,children:["pump.fun",e.jsx(I,{className:"ml-1 h-3.5 w-3.5","aria-hidden":!0})]})}):null]})},t.seq))})]}),e.jsxs("p",{className:"text-center text-xs text-muted-foreground",children:["Agent API:"," ",e.jsx(h,{to:y,className:"underline underline-offset-2 hover:text-foreground",children:"Marketplace · LiveWire"})," ","·"," ",e.jsx("a",{href:"https://syraa.fun/docs/api/pumpfun-livewire",className:"underline underline-offset-2 hover:text-foreground",children:"docs"})]})]})})]})}export{Y 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.