PageSourceSearch

https://pikespeak.ai/assets/contracts-directory-Daj_mKxf.js

js pikespeak.ai collected 2026-09-25 20:25:46 UTC 4,507 bytes, 1 lines download raw bytes

1import{r as s,t as D,j as t,n as d}from"./index-C00YXtdW.js";import{P as A}from"./PaginatedTable-OU-WmyJk.js";import{C,b as E,a as F}from"./index-D4CetdtG.js";import{I as k}from"./tokenSearch-C2kHaUx1.js";import{L as T}from"./link-CLYtb3rv.js";import{S as L,a as P,b as R,c as I,d as B}from"./select-BEgzG3h1.js";import{m as K}from"./token-BUpNfDEx.js";import"./index-BzxNksKy.js";import"./pagination-B3z2sGcf.js";import"./subscriptionDisplay-1xpGVhrK.js";import"./icon-CTHVUv61.js";import"./useLocation-BD6tjkd3.js";import"./useDateMode-BrJ7imOU.js";import"./table-Np-B6xGr.js";import"./toolTipText-B6McCBkL.js";import"./index-SnuytDdP.js";import"./index-BvYIwy9c.js";import"./action-type-ivGSfB-Q.js";import"./rhea-DdOvxqHk.js";const M=600,j=r=>{const m={classification:"#EEE0DA",defi:"#F5E0E9",farming:"#E3E2E080",lending:"#FFE2DD",tooling:"#DBEDDB",daos:"#D3E5EF",domain:"#E8DEEE",marketplace:"#E8DEEE",amm:"#FDECC8",gaming:"#DBEDDB",exploit:"#FF4500",trading:"#FFD700",fungible_token:"#e3e3e3"},c=r.toLowerCase();return m[c]||"#EEE0DA"},$=()=>{const[r,m]=s.useState(""),[c,w]=s.useState("All"),n=s.useRef(null),x=s.useRef(new Set),o="contracts_directory",{data:i,isLoading:l,isError:u}=D.contractAnalysis.contractDirectory.useQuery();s.useEffect(()=>()=>{n.current&&window.clearTimeout(n.current)},[]);const y=(e,a)=>{n.current&&window.clearTimeout(n.current),n.current=window.setTimeout(()=>{d("dashboard_filter_applied",{dashboard_id:"near_world",panel:o,filter_type:e,has_filter:a})},M)},b=e=>{const a=e.target.value;m(a),y("contract_search",a.trim().length>0)},S=e=>{d("dashboard_filter_applied",{dashboard_id:"near_world",panel:o,filter_type:"classification",has_filter:e!=="All",selected_value_bucket:e==="All"?"all":"selected"}),w(e)},N=s.useMemo(()=>[{accessorKey:"classification",header:"Tags",cell:({row:e})=>{const a=e.original;return t.jsxs("div",{className:"flex gap-2",children:[a.classification&&t.jsx("span",{className:"rounded px-2 py-1 text-xs text-[rgb(28,31,38)]",style:{backgroundColor:j(a.classification)},children:a.classification}),a.sub_classification&&t.jsx("span",{className:"rounded px-2 py-1 text-xs text-[rgb(28,31,38)]",style:{backgroundColor:j(a.sub_classification)},children:a.sub_classification})]})}},{accessorKey:"name",header:"Projects"},{accessorKey:"account_id",header:"Addresses",cell:({row:e})=>{const a=e.original.account_id;return t.jsx(T,{to:"/account/$accountId",params:{accountId:a},target:"_blank",className:"text-primary hover:underline",onClick:()=>d("dashboard_drilldown_opened",{dashboard_id:"near_world",target_type:"contract_account",panel:"contracts_directory"}),children:K({text:a,maxLength:30})})}}],[]),v=s.useMemo(()=>{if(!i)return["All"];const e=i.reduce((a,h)=>(a.push(h.classification),a),[]);return["All",...new Set(e)]},[i]),g=s.useMemo(()=>i?i.filter(e=>{const a=r===""||e.name.toLowerCase().includes(r.toLowerCase())||e.account_id.toLowerCase().includes(r.toLowerCase()),h=c==="All"||e.classification===c;return a&&h}):[],[i,r,c]),p=s.useMemo(()=>g.map(e=>({...e,id:e.account_id})),[g]),f=r.trim().length>0||c!=="All",_=f?`${c}:${r.trim().toLowerCase()}`:"unfiltered";return s.useEffect(()=>{if(l||u||p.length>0)return;const e=`${o}:${_}`;x.current.has(e)||(x.current.add(e),d("dashboard_empty_state_shown",{dashboard_id:"near_world",panel:o,is_filtered:f}))},[_,f,u,l,o,p.length]),u?t.jsx("div",{className:"grid gap-4",id:"near-world",children:t.jsx("div",{className:"col-span-12",children:t.jsx(C,{children:t.jsx(E,{className:"flex items-center justify-center p-6",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-destructive font-medium",children:"Failed to load contract data"}),t.jsx("p",{className:"text-muted-foreground",children:"Please try again later"})]})})})})}):t.jsx("div",{className:"grid gap-4 w-full",children:t.jsx("div",{className:"col-span-12 w-full overflow-hidden",children:t.jsxs(C,{className:"w-full",children:[t.jsx(F,{}),t.jsxs(E,{className:"w-full",children:[t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(k,{className:"max-w-sm text-sm",placeholder:"Search by Project Name / Address",value:r,onChange:b}),t.jsxs(L,{value:c,onValueChange:S,disabled:l,children:[t.jsx(P,{className:"w-[180px]",children:t.jsx(R,{placeholder:"Select classification"})}),t.jsx(I,{children:v.map(e=>t.jsx(B,{value:e,children:e},e))})]})]}),t.jsx("div",{className:"mt-4",children:t.jsx(A,{columns:N,data:p,itemsPerPage:10,isLoading:l})})]})]})})})},ie=$;export{ie as component};

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.