PageSourceSearch

https://solana.org/_next/static/chunks/6210-606b3015d7ff0594.js

js solana.org collected 2026-09-24 10:20:28 UTC 12,436 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6210],{8379:()=>{},19256:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>n,renderNetworkBadge:()=>d});var s=t(6029);t(55729);var r=t(33457),l=t(61017),i=t.n(l);let d=(e,a)=>{if(!e)return null;let t=r.BS[e];return t?(0,s.jsxs)("span",{className:`badge text-uppercase px-2 py-1 border-1 rounded-1 d-flex align-items-center justify-content-center ${i().networkBadge} ${t.className} ${a||""}`,children:[t.icon,t.label]}):null},n=({notifications:e=[],validators:a=[]})=>{let t=[...e].sort((e,a)=>new Date(a.timestamp).getTime()-new Date(e.timestamp).getTime());return(0,s.jsx)("div",{className:"card w-100",children:(0,s.jsxs)("div",{className:"card-body d-flex flex-column pb-0",children:[(0,s.jsxs)("h5",{className:"card-title",children:["Notifications \xa0",(0,s.jsx)("span",{className:"badge bg-secondary",children:t.length})]}),t.length>0?(0,s.jsx)("ul",{className:`list-unstyled overflow-auto flex-grow-1 ${i().notificationsList}`,children:t.map((e,t)=>{let l=a.find(a=>a.validatorPubkey===e?.validatorPubkey),n=d(l?.network)||null;return(0,s.jsxs)("li",{className:"d-flex gap-3 mb-3 border-bottom pb-2",children:[(0,s.jsx)("div",{className:"d-flex align-items-center",children:r.I9[e.action]?.icon??null}),(0,s.jsxs)("div",{className:"d-flex flex-column flex-grow-1 lh-1",children:[(0,s.jsxs)("div",{className:"d-flex justify-content-between align-items-center",children:[(0,s.jsx)("div",{className:"me-2",children:(e=>{let{action:a,reason:t,roleName:s="a"}=e,l=r.wz[t]||t;switch(a){case"role_assigned":return`Validator granted ${s} role on Discord`;case"role_removed":return l||"Role removed";case"role_not_assigned":return l||"Role not assigned";default:return r.I9[a]?.reason||r.wz[t]||t||"Notification"}})(e)}),(0,s.jsx)("span",{className:`badge badge-secondary bg-light text-dark text-truncate rounded-1 ${i().validatorPubkeyBadge}`,children:e.validatorPubkey})]}),(0,s.jsxs)("div",{className:"d-flex justify-content-between align-items-center mt-1",children:[(0,s.jsx)("small",{className:"text-secondary lh-1",children:new Date(e.timestamp).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})}),n]})]})]},`${e.validatorPubkey}-${e.timestamp}-${t}`)})}):(0,s.jsx)("p",{className:"card-text",children:"Add a validator to get notifications"})]})})}},71568:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>y});var s=t(6029),r=t(55729),l=t(2083),i=t(53860),d=t(234),n=t(95015),o=t(96723),c=t(19780),m=t(2342),u=t(61017),x=t.n(u),h=t(80851),v=t(33457),f=t(19256),j=t(45792),g=t(75325);let y=({initialData:e,onDataUpdate:a})=>{let[t,u]=(0,r.useState)(null),[y,p]=(0,r.useState)(!0),[N,b]=(0,r.useState)(!1),[w,k]=(0,r.useState)(""),[A,S]=(0,r.useState)(!1),[D,E]=(0,r.useState)(null),[I,P]=(0,r.useState)(null);(0,r.useEffect)(()=>{e?(u(e),p(!1)):_()},[e]);let _=async()=>{try{p(!0),k("");let e=await (0,o.A)("/validators-portal/validators/index",{withCredentials:!0});u(e),a&&a(e)}catch(e){console.error("Failed to load dashboard data:",e),k(e.responseData?.message||"Failed to load dashboard data")}finally{p(!1)}},R=async e=>{if(S(!1),e&&t)try{b(!0);let e=await (0,o.A)("/validators-portal/validators/index",{withCredentials:!0});u(e),a&&a(e)}catch(e){console.error("Failed to refresh dashboard data:",e),_()}finally{b(!1)}else _()},T=async e=>{P(e);try{await (0,o.A)("/validators-portal/validators/remove",{method:"DELETE",headers:{"Content-Type":"application/json"},body:{validatorPubkey:e},withCredentials:!0}),E(null);try{b(!0);let e=await (0,o.A)("/validators-portal/validators/index",{withCredentials:!0});u(e),a&&a(e)}catch(e){console.error("Failed to refresh dashboard data:",e),_()}finally{b(!1)}}catch(e){console.error("Failed to remove validator:",e),k(e.responseData?.message||"Failed to remove validator")}finally{P(null)}},B=async()=>{try{await (0,o.A)("/validators-portal/logout",{method:"POST",headers:{"Content-Type":"application/json"},withCredentials:!0}),window.location.href="/validators-portal"}catch(e){console.error("Logout error:",e),k("Failed to log out")}};if(y)return(0,s.jsx)("div",{className:"card my-5 p-5 w-50 mx-auto d-flex flex-column justify-content-center rounded-4",children:(0,s.jsxs)("div",{className:"d-flex flex-column align-items-center",children:[(0,s.jsx)(l.A,{animation:"border"}),(0,s.jsx)("p",{children:"Loading your validator dashboard..."})]})});if(w&&!t)return(0,s.jsx)("div",{className:"card my-5 p-5 w-50 mx-auto d-flex flex-column justify-content-center rounded-4",children:(0,s.jsxs)("div",{className:"d-flex flex-column align-items-center",children:[(0,s.jsxs)(i.A,{variant:"danger w-100 text-center p-2 pt-4 mb-5",children:[(0,s.jsx)("h5",{className:"mb-3",children:"Error Loading Dashboard"}),(0,s.jsx)("p",{children:w})]}),(0,s.jsx)(d.A,{onClick:_,className:"button primary",children:"Retry"})]})});if(!t)return null;let{user:C,validators:O}=t,$=O.map(e=>{var a,s;let r=Number(BigInt(e.activeStake))/m.Sr,l=C.currentDiscordRoles?.filter(a=>a.qualifiedBy.includes(e.validatorPubkey))||[],i=(C.currentDiscordRoles||[]).filter(a=>a.qualifiedBy?.includes(e.validatorPubkey)||a.lastQualifiedBy?.includes(e.validatorPubkey)).map(e=>{var a;let s,r;return a=t.gracePeriods?.[e.roleId]??t.gracePeriods?._default??24,s=new Date(e.lastQualifiedAt).getTime(),r=Math.max(0,a-(Date.now()-s)/36e5),{isInGracePeriod:0===e.qualifiedBy.length&&r>0,hoursRemaining:r}});return{...e,stakeSOL:(Number(BigInt(e.activeStake))/m.Sr).toLocaleStr
1ing("en-US",{minimumFractionDigits:0,maximumFractionDigits:0}),isBelowThreshold:r<v.oD,validatorsAppUrl:(a=e.validatorPubkey,"mainnet-beta"===(s=e.network)?`https://www.validators.app/validators/${a}?locale=en&network=mainnet`:"testnet"===s?`https://www.validators.app/validators/${a}?locale=en&network=testnet`:""),grantedRoles:l,graceStatus:i,status:(({stakeInSOL:e,grantedRoles:a,validator:t,graceStatus:s})=>{if("NOT_FOUND"===t.network)return"ERROR";if("unknown"===t.network)return"UNASSIGNED";let r=e<v.oD,l=s.some(e=>e.isInGracePeriod);return t.delinquent?l?"AT_RISK_DELINQUENT":"REMOVED_DELINQUENT":r?a.some(e=>e.everQualified)?"SOFT_REMOVED":l?"AT_RISK_BELOW_THRESHOLD":"ROLE_NOT_ASSIGNED_BELOW_THRESHOLD":a.length>0?"ASSIGNED":"ERROR"})({stakeInSOL:r,grantedRoles:l,validator:e,graceStatus:i})}}),L=t?.notifications||[],U=$.filter(e=>(e.delinquent||e.isBelowThreshold)&&e.graceStatus.some(e=>e.isInGracePeriod));return(0,s.jsxs)("div",{className:"my-4 position-relative",children:[(0,s.jsxs)("h4",{children:["Welcome, ",C.discordDisplayName||C.discordUsername,"!"]}),w&&(0,s.jsx)(i.A,{variant:"danger",dismissible:!0,onClose:()=>k(""),children:w}),(0,s.jsx)(g.default,{warnings:U}),N&&(0,s.jsx)("div",{className:`position-absolute top-0 start-0 w-100 h-100 d-flex align-items-center justify-content-center ${x().updateOverlay}`,children:(0,s.jsxs)("div",{className:"d-flex flex-column align-items-center",children:[(0,s.jsx)(l.A,{animation:"border",variant:"primary"}),(0,s.jsx)("p",{className:"mt-3 mb-0 text-dark",children:"Updating..."})]})}),(0,s.jsxs)("div",{className:"row my-4",children:[(0,s.jsx)("div",{className:"col-md-6 col-sm-12 d-flex",children:(0,s.jsx)(f.default,{notifications:L,validators:O})}),(0,s.jsxs)("div",{className:"col-md-6 col-sm-12 mt-4 mt-md-0 d-flex flex-column gap-4",children:[(0,s.jsx)("div",{className:"card",children:(0,s.jsx)("div",{className:"card-body",children:(0,s.jsxs)("div",{className:"d-flex align-items-center justify-content-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("h6",{className:"card-title d-flex align-items-center mb-1",children:[C.discordAvatarHash&&(0,s.jsx)("img",{src:((e,a,t=256)=>{if(a){let s=a.startsWith("a_");return`https://cdn.discordapp.com/avatars/${e}/${a}.${s?"gif":"png"}?size=${t}`}let s=Number(BigInt(e)>>22n)%6;return`https://cdn.discordapp.com/embed/avatars/${s}.png`})(C.discordId,C.discordAvatarHash),alt:`${C.discordUsername} avatar`,className:`rounded-circle me-2 ${x().discordAvatar}`}),C.discordDisplayName||C.discordUsername||"-"]}),C.discordUsername&&(0,s.jsx)("p",{className:"card-text mb-0",children:C.discordUsername})]}),(0,s.jsx)(d.A,{onClick:B,className:"button button-xs",children:"Sign out"})]})})}),(0,s.jsx)("div",{className:"card flex-grow-1",children:(0,s.jsxs)("div",{className:"card-body d-flex flex-column",children:[(0,s.jsx)("h6",{className:"card-title",children:"How to Use this Portal"}),(0,s.jsxs)("ol",{className:"card-text",children:[(0,s.jsx)("li",{children:"Add your validator to the portal."}),(0,s.jsx)("li",{children:"Verify ownership by signing the provided message."}),(0,s.jsx)("li",{children:"Maintain at least 50 SOL of active stake to qualify for Discord roles."}),(0,s.jsx)("li",{children:"Monitor your assigned roles and any alerts here. You can remove validators at any time."})]})]})})]})]}),(0,s.jsx)(j.default,{validators:$,onAddValidator:()=>S(!0),onRemoveValidator:e=>E(e),removingValidator:I}),(0,s.jsxs)(n.A,{show:A,onHide:()=>S(!1),size:"lg",centered:!0,contentClassName:"card p-2",className:"theme-v2",children:[(0,s.jsx)(n.A.Header,{closeButton:!0,className:"border-0",children:(0,s.jsx)(n.A.Title,{children:"Verify Your Validator Ownership"})}),(0,s.jsx)(n.A.Body,{children:(0,s.jsx)(c.default,{discordUser:{discordId:C.discordId,discordUsername:C.discordUsername},onVerificationSuccess:R})})]}),(0,s.jsx)(h.default,{show:!!D,data:{validatorName:O.find(e=>e.validatorPubkey===D)?.name||"No name",validatorKey:O.find(e=>e.validatorPubkey===D)?.validatorPubkey||""},onClose:()=>E(null),onConfirm:()=>{D&&T(D)},isDeleting:I===D})]})}},75325:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>i});var s=t(6029);t(55729);var r=t(53860),l=t(11112);let i=({warnings:e})=>e&&0!==e.length?(0,s.jsx)("div",{className:"mt-3",children:e.map(e=>{let a=(e.graceStatus||[]).filter(e=>e.isInGracePeriod),t=a.length>0?Math.ceil(Math.max(...a.map(e=>Math.max(0,e.hoursRemaining)))):null;return(0,s.jsxs)(r.A,{variant:"warning",className:"d-flex flex-row align-items-center gap-2",children:[(0,s.jsx)(l.A,{size:24,className:"mb-0 text-warning"}),(0,s.jsxs)("div",{className:"lh-1",children:[(0,s.jsx)("div",{children:(0,s.jsxs)("b",{children:[e.validatorPubkey," - Role at risk"]})}),(0,s.jsxs)("small",{className:"form-text text-muted",style:{fontSize:"0.75rem"},children:[e.delinquent?"Your validator is delinquent. Bring it back online within":"Your active stake is below the 50 SOL minimum. Increase it within","\xa0",t," hours to keep your role."]})]})]},e.validatorPubkey)})}):null},80851:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>d});var s=t(6029);t(55729);
1var r=t(95015),l=t(234),i=t(90377);let d=({show:e,data:a,onConfirm:t,onClose:d,isDeleting:n=!1})=>(0,s.jsxs)(r.A,{show:e,onHide:d,size:"lg",centered:!0,contentClassName:"card p-2",className:"theme-v2",children:[(0,s.jsx)(r.A.Header,{closeButton:!0,className:"border-0",children:(0,s.jsx)(r.A.Title,{children:"Are you sure you want to delete validator?"})}),(0,s.jsxs)(r.A.Body,{children:[(0,s.jsxs)("div",{className:"d-flex flex-column align-items-center py-3",children:[(0,s.jsx)(i.A,{size:64,className:"text-secondary mb-4"}),(0,s.jsx)("p",{className:"mb-0",children:"Deleting a validator is permanent and cannot be undone."})]}),(0,s.jsxs)("div",{className:"d-flex flex-column w-100 px-4",children:[(0,s.jsxs)("div",{className:"row mb-2",children:[(0,s.jsx)("h5",{className:"col-4 fw-semibold text-end",children:"Validator Name"}),(0,s.jsx)("div",{className:"col-8 text-break text-start",children:a?.validatorName||""})]}),(0,s.jsxs)("div",{className:"row",children:[(0,s.jsx)("h5",{className:"col-4 fw-semibold text-end",children:"Validator Identity"}),(0,s.jsx)("div",{className:"col-8 text-break text-start",children:a?.validatorKey||""})]})]})]}),(0,s.jsxs)(r.A.Footer,{className:"d-flex justify-content-center border-0 px-5 mb-2 gap-1",children:[(0,s.jsx)(l.A,{onClick:d,className:"button flex-fill",disabled:n,children:"Cancel"}),(0,s.jsx)(l.A,{onClick:t,className:"button reset bg-danger border-danger flex-fill",disabled:n,children:n?"Deleting...":"Delete Validator"})]})]})},90377:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});let s=(0,t(85229).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])}}]);

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.