PageSourceSearch

https://app.valinity.io/assets/StakeDetail-CN4PhQh7.js

js valinity.io collected 2026-10-02 15:22:24 UTC 22,063 bytes, 1 lines download raw bytes

1import{i as be,bI as fe,ct as he,u as O,g as Se,Z as we,r as R,fy as Te,fz as De,aC as ze,fA as Ie,fB as He,fC as Ye,bp as Ce,m as e,am as ke,an as ve,T as t,o as j,F as r,bG as Ve,ck as Ge,I as ee,b1 as Be,S as ae,fg as ne,ap as Ee,B as Ae,f8 as Le,f7 as Qe,aE as We,c3 as qe,fD as $e,fh as _e,fE as Oe,fF as Ue,t as le,f as Ke,C as Xe,N as Ze,cj as pe,ff as Je,fG as et,fH as tt,cg as ot,c0 as it,H as rt,cm as se,fI as nt,co as st,cn as ge}from"./index-BVQYYB-n.js";import{I as at}from"./Instructions-oTSYELLt.js";import{F as lt}from"./FixedFooter-CsINn4-K.js";/* empty css                    */import{u as ct,f as dt,c as xt,s as ft,a as ht}from"./useStakeAssetPriceUsd-BQO71xAJ.js";import{D as L}from"./chunk-YGVX4ESO-Dj1uG1rc.js";import"./LogoReveal-De1ZP3__.js";import"./surfaces-Ckwcw1d_.js";import"./VyMark-D0Q_6QVY.js";const pt=7*24*60*60;function gt(o,n,g=!0){const{address:p}=be(),l=fe("ValinityStakingRouter"),b=fe("ValinityMarketMakerOfficer"),W=g&&!!p&&n!==void 0,d=he({...l,functionName:"stakes",args:[p,n??0n],query:{enabled:W&&o==="vy",staleTime:6e4}}),F=he({...b,functionName:"stakes",args:[p,n??0n],query:{enabled:W&&o==="asset",staleTime:6e4}}),S=o==="asset"?F:d,a=S.data,f=a?Number(a[o==="asset"?1:3]):void 0;return{unlocksAt:f===void 0?void 0:f>0?f+pt:0,isLoading:W&&S.isLoading}}const ue=o=>{const n=Math.max(0,Math.floor(o));return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`},ye=o=>{const n=Math.max(0,Math.floor(o)),g=Math.floor(n/86400),p=Math.floor(n%86400/3600),l=Math.floor(n%3600/60);return g>0?`${g}d ${p}h`:p>0?`${p}h ${l}m`:`${l}m ${n%60}s`},ut=o=>`${o.slice(0,10)}...${o.slice(-10)}`,me=({title:o,type:n,stakeId:g,stakeKind:p="vy",assetSymbol:l="VY",isMatured:b=!0,earlyPenaltyBps:W,principal:d=0,alreadyClaimedYield:F=0,pendingYield:S=0,displayDecimals:a=5,assetDecimals:f=18,levyBps:M=0,onClose:w,...E})=>{const{t:i}=O(void 0,{keyPrefix:"views.stake"}),{t:P,i18n:c}=O(),{address:G}=be(),z=Se(),T=we(),s=p==="asset",[h,H]=R.useState(()=>Math.floor(Date.now()/1e3));R.useEffect(()=>{const Re=setInterval(()=>H(Math.floor(Date.now()/1e3)),1e3);return()=>clearInterval(Re)},[]);const Q=Te(n==="claim"&&!s?g:void 0),q=De(n==="claim"&&s?g:void 0),I=s?q:Q,A=ze(I),k=Ie(n==="claim"&&!s?g:void 0),C=He(n==="withdraw"&&!s?g:void 0),y=Ye(n==="withdraw"&&s?g:void 0),N=s?y:C;R.useEffect(()=>{n==="claim"&&A.isSuccess&&(T.resetQueries({queryKey:["assetClaimsAllTime"]}),w())},[A.isSuccess]),R.useEffect(()=>{n==="claim"&&A.isError&&w()},[A.isError]);const v=n==="withdraw",$=s?y.remaining:void 0,D=s?y.withdrawing:!1,x=s?y.cooldownEndsAt:0,m=x>0?Math.max(0,x-h):0,u=s?y.deliverableNow:void 0,Y=s?y.closesStake:!1,U=D&&u===0n&&!Y,K=m>0||U,te=$!==void 0?Number(Ce($,f)):void 0;R.useEffect(()=>{n==="withdraw"&&!s&&C.isSuccess&&(w(),z("/stake/list"))},[C.isSuccess]),R.useEffect(()=>{n==="withdraw"&&s&&y.isComplete&&(T.resetQueries({queryKey:["assetClaimsAllTime"]}),w(),z("/stake/list"))},[y.isComplete]);const X=v&&!b&&(W??0)>0&&!D,V=gt(p,g,X),Z=V.unlocksAt?Math.max(0,V.unlocksAt-h):0,_=X&&Z>0,oe=V.unlocksAt?new Date(V.unlocksAt*1e3).toLocaleString(c.language,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):"",J=X&&!_&&!V.isLoading,ie=(W??0)/100,B=d*(W??0)/1e4,re=Math.max(0,F)*(1e4-(s?M:0))/1e4,ce=Math.max(0,S),Fe=Math.max(0,d-B-re),de=J&&s&&d-B-re<=0,xe=v?N.isConfirming||N.isPending||s&&y.isMining:I.isLoading||A.isPending,Pe=v?!N.isConfirming&&!N.isPending&&!de&&!_&&!(X&&V.isLoading)&&!(s&&(y.isMining||K)):!!A.request&&!A.isPending,Ne=s&&D?m>0?i("chunkNextIn",{time:ue(m)}):U?i("chunkNoCapacity",{defaultValue:"Waiting for liquidity…"}):i("withdrawNextChunk"):_?i("earlyExitHold.cta",{time:ye(Z)}):i(J?"withdrawEarly":"sendTransaction"),Me=()=>{v?N.confirm():A.confirm()};return e.jsxs(ke,{title:o,onClose:w,...E,children:[e.jsxs(ve,{px:0,py:0,children:[e.jsx(t,{fontSize:"14px",color:"gray.400",textAlign:"center",py:2,children:i(v?"confirmWithdraw":"confirmClaim")}),e.jsxs(j,{bg:"spaceGray.100",px:6,py:3,children:[e.jsxs(r,{justify:"space-between",align:"center",py:2,children:[e.jsx(t,{fontSize:"18px",fontWeight:"semibold",color:"gray.700",children:P("terms.to")}),e.jsxs(r,{align:"center",gap:2,children:[e.jsx(Ve,{src:Ge,alt:"VY",boxSize:"28px"}),e.jsx(t,{fontSize:"16px",color:"gray.700",children:s?"ValinityMarketMakerOfficer":n==="claim"?"ValinityYieldOfficer":"
1ValinityStakingRouter"})]})]}),e.jsx(L,{borderColor:"spaceGray.300"}),e.jsxs(r,{direction:"column",py:2,children:[e.jsxs(r,{justify:"space-between",align:"center",children:[e.jsx(t,{fontSize:"18px",fontWeight:"semibold",color:"gray.700",children:P("terms.from")}),e.jsx(t,{fontSize:"16px",color:"gray.700",children:G?ut(G):"—"})]}),e.jsx(t,{fontSize:"12px",color:"gray.500",textAlign:"right",children:i("myWallet")})]})]}),_&&e.jsxs(j,{mx:6,my:4,px:4,py:5,borderRadius:"12px",bg:"blue.100",border:"1px solid",borderColor:"blue.200",textAlign:"center",children:[e.jsx(r,{justify:"center",mb:3,children:e.jsx(r,{align:"center",justify:"center",boxSize:"44px",borderRadius:"full",bg:"white",border:"1px solid",borderColor:"blue.200",children:e.jsx(ee,{as:Be,boxSize:"24px",color:"blue.700"})})}),e.jsx(t,{fontSize:"15px",fontWeight:"semibold",color:"gray.800",children:i("earlyExitHold.title")}),e.jsx(t,{fontSize:"13px",color:"gray.600",mt:1,lineHeight:"1.45",children:i("earlyExitHold.body")}),e.jsx(t,{mt:3,fontSize:"22px",fontWeight:"bold",color:"blue.700",lineHeight:"1.2",sx:{fontVariantNumeric:"tabular-nums"},children:ye(Z)}),e.jsx(t,{fontSize:"11px",color:"gray.500",children:i("earlyExitHold.remaining")}),oe&&e.jsx(t,{fontSize:"12px",color:"gray.600",mt:2,children:i("earlyExitHold.opensOn",{date:oe})})]}),J&&e.jsxs(j,{px:6,py:3,children:[e.jsxs(r,{justify:"space-between",align:"center",py:1,children:[e.jsx(t,{fontSize:"14px",color:"gray.600",children:i("earlyExitPrincipal")}),e.jsxs(t,{fontSize:"14px",fontWeight:"semibold",color:"gray.700",children:[d.toFixed(a)," ",l]})]}),e.jsxs(r,{justify:"space-between",align:"center",py:1,children:[e.jsx(t,{fontSize:"14px",color:"red.500",children:i("earlyExitBadge",{pct:ie})}),e.jsxs(t,{fontSize:"14px",fontWeight:"semibold",color:"red.500",children:["-",B.toFixed(a)," ",l]})]}),re>0&&e.jsxs(r,{justify:"space-between",align:"center",py:1,children:[e.jsx(t,{fontSize:"14px",color:"red.500",children:i("earlyExitClawback")}),e.jsxs(t,{fontSize:"14px",fontWeight:"semibold",color:"red.500",children:["-",re.toFixed(a)," ",l]})]}),ce>0&&e.jsxs(r,{justify:"space-between",align:"center",py:1,children:[e.jsx(t,{fontSize:"12px",color:"orange.500",children:i("earlyExitForfeited")}),e.jsxs(t,{fontSize:"12px",fontWeight:"semibold",color:"orange.500",children:["-",ce.toFixed(a)," ",l]})]}),e.jsx(L,{borderColor:"spaceGray.300",my:1}),e.jsxs(r,{justify:"space-between",align:"center",py:1,children:[e.jsx(t,{fontSize:"14px",color:"gray.700",fontWeight:"semibold",children:i("earlyExitReceive")}),e.jsxs(t,{fontSize:"14px",fontWeight:"bold",color:"gray.800",children:[Fe.toFixed(a)," ",l]})]}),de?e.jsx(t,{fontSize:"11px",color:"red.500",fontStyle:"italic",mt:2,lineHeight:"1.4",children:i("errors.nothingToWithdraw")}):e.jsx(t,{fontSize:"11px",color:"gray.500",fontStyle:"italic",mt:2,lineHeight:"1.4",children:i("earlyExitNote",{pct:ie,penalty:B.toFixed(a),symbol:l})})]}),v&&s&&D&&e.jsxs(j,{px:6,py:3,children:[e.jsxs(r,{align:"center",justify:"center",gap:2,mb:2,children:[e.jsx(ae,{size:"xs",color:"blue.500"}),e.jsx(t,{fontSize:"13px",fontWeight:"semibold",color:"blue.700",children:i("chunkedTitle")})]}),te!==void 0&&e.jsxs(r,{justify:"space-between",align:"center",py:1,children:[e.jsx(t,{fontSize:"14px",color:"gray.600",children:i("chunkRemaining")}),e.jsxs(t,{fontSize:"14px",fontWeight:"bold",color:"gray.800",children:[te.toFixed(a)," ",l]})]}),(m>0||U)&&e.jsx(r,{justify:"center",align:"center",mt:1,children:e.jsx(t,{fontSize:"13px",fontWeight:"semibold",color:"blue.700",sx:{fontVariantNumeric:"tabular-nums"},children:m>0?i("chunkNextIn",{time:ue(m)}):i("chunkNoCapacity",{defaultValue:"Waiting for liquidity…"})})}),e.jsx(t,{fontSize:"11px",color:"gray.500",fontStyle:"italic",mt:2,lineHeight:"1.4",children:i("chunkNote")})]}),!v&&s&&e.jsx(j,{px:6,py:3,children:M>0?e.jsxs(e.Fragment,{children:[e.jsxs(r,{justify:"space-between",align:"center",py:1,children:[e.jsx(t,{fontSize:"14px",color:"gray.600",children:i("yieldEarned")}),e.jsxs(t,{fontSize:"14px",fontWeight:"semibold",color:"gray.700",children:[S.toFixed(a)," ",l]})]}),e.jsxs(r,{justify:"space-between",align:"center",py:1,children:[e.jsx(t,{fontSize:"14px",color:"gray.600",children:i("ecosystemFee",{pct:(M/100).toFixed(0)})}),e.jsxs(t,{fontSize:"14px",fontWeight:"semibold",color:"gray.700",children:["-",(S*M/1e4).toFixed(a)," ",l]})]}),e.jsx(L,{borderColor:"spaceGray.300",my:1}),e.jsxs(r,{justify:"space-between",align:"center",py:1,children:[e.jsx(t,{fontSize:"14px",color:"gray.700",fontWeight:"semibold",children:i("youReceive")}),e.jsxs(t,{fontSize:"14px",fontWeight:"bold",color:"gray.800",children:[(S*(1e4-M)/1e4).toFixed(a)," ",l]})]})]}):e.jsx(t,{fontSize:"13px",color:"gray.600",textAlign:"center",children:i("asset.claimAssetYield",{symbol:l})})}),!v&&!s&&k.data&&e.jsxs(j,{px:6,py:3,children:[e.jsxs(r,{justify:"space-between",align:"center",py:1,children:[e.jsx(t,{fontSize:"14px",color:"gray.600",children:i("yieldEarned")}),e.jsxs(t,{fontSize:"14px",fontWeight:"semibold",color:"gray.700",children:[k.data.gross.toFixed(5)," VY"]})]}),e.jsxs(r,{justify:"space-between",align:"center",py:1,children:[e.jsx(t,{fontSize:"14px",color:"gray.600",children:i("ecosystemFee",{pct:(k.data.feeBps/100).toFixed(0)})}),e.jsxs(t,{fontSize:"14px",fontWeight:"semibold",color:"gray.700",children:["-",k.data.fee.toFixed(5)," VY"]})]}),e.jsx(L,{borderColor:"spaceGray.300",my:1}),e.jsxs(r,{justify:"space-between",align:"center",py:1,children:[e.jsx(t,{fontSize:"14px",color:"gray.700",fontWeight:"semibold",children:i("youReceive")}),e.jsxs(t,{fontSize:"14px",fontWeight:"bold",color:"gray.800",children:[k.data.net.toFixed(5)," VY"]})]})]}),!v&&I.isError&&e.jsx(j,{px:6,py:3,children:e.jsx(t,{fontSize:"13px",color:"red.500",children:ne(I.error,P)})}),v&&N.isError&&N.txError&&e.jsx(j,{px:6,py:3,children:e.jsx(t,{fontSize:"13px",color:"red.500",children:ne(N.txError,P)})}),v&&N.preflightError&&e.jsx(j,{px:6,py:3,children:e.jsx(t,{fontSize:"13px",color:"red.500",children:ne(new Error(N.preflightError),P)})})]}),e.jsx(Ee,{children:e.jsx(Ae,{w:"full",size:"lg",borderRadius:"6px",bgGradient:"linear(to-r, #0b344a, #0f4563)",border:"2px s
1olid",borderColor:"blue.700",color:"white",fontSize:"16px",fontWeight:"normal",_hover:{bgGradient:"linear(to-r, #0f4563, #0b344a)"},isDisabled:!Pe,isLoading:xe,loadingText:P("actions.confirming"),onClick:Me,children:xe?e.jsx(ae,{size:"sm"}):v?Ne:i("sendTransaction")})})]})},yt="linear-gradient(120deg, #AE905D, #C4A76F, #D4B978, #C4A76F, #AE905D)";function mt(o,n){return n&&o?{bgImage:yt,color:"white",borderColor:"transparent"}:n?{bg:"white",color:"#AE905D",borderColor:"#C4A76F"}:o?{bg:"blue.700",color:"white",borderColor:"blue.700"}:{bg:"white",color:"gray.700",borderColor:"blackAlpha.200"}}const jt=({stakeId:o,stakeKind:n,symbol:g,displayDecimals:p=5,tokenDecimals:l=18,currentTier:b=3,unlockTimestamp:W=0,assetAddress:d,onClose:F,...S})=>{const{t:a}=O(void 0,{keyPrefix:"views.stake"}),{t:f}=O(),M=Se(),w=we(),E=n==="vy",i=Le().data===!0,P=Qe({isVY:E,address:d??We}),c=qe(i,P),G=Math.max(0,W-Math.floor(Date.now()/1e3)),z=x=>x*86400>=G,[T,s]=R.useState(()=>b||3);R.useEffect(()=>{if(!c.length)return;const x=c.find(u=>u.tierId===T);if(x&&z(x.period))return;const m=c.find(u=>z(u.period))??c[c.length-1];m&&s(m.tierId)},[c.length]);const h=c.find(x=>x.tierId===T),{compounded:H}=$e(o,n),Q=H!==void 0?Number(Ce(H,l)):void 0,q=_e(h==null?void 0:h.yieldBps),I=Oe(E?o:void 0,E?T:void 0),A=Ue(E?void 0:o,E?void 0:T,q),k=E?I:A,C=ze(k);R.useEffect(()=>{C.isSuccess&&(w.resetQueries({queryKey:["assetClaimsAllTime"]}),F(),M("/stake/list"))},[C.isSuccess]);const y=!!C.request&&!C.isPending,N=H!==void 0&&H===0n,v=(h==null?void 0:h.period)??0,$=(h==null?void 0:h.rate)??"",D=R.useMemo(()=>c.slice().sort((x,m)=>x.period-m.period),[c]);return e.jsxs(ke,{title:a("renewStake"),onClose:F,...S,children:[e.jsxs(ve,{px:5,py:4,children:[e.jsxs(j,{px:4,py:4,mb:3,borderRadius:"10px",bgGradient:"linear(to-b, white, #f1f3f5)",boxShadow:"0px 0px 20px 0px rgba(0,0,0,0.08)",children:[e.jsxs(r,{align:"center",gap:1.5,justify:"center",mb:2,children:[e.jsx(ee,{as:le,boxSize:"15px",color:"blue.700"}),e.jsx(t,{fontSize:"12.5px",fontWeight:"bold",color:"blue.800",children:a("renewStake")})]}),e.jsx(t,{fontSize:"12px",color:"gray.600",textAlign:"center",lineHeight:"1.5",children:a("renewCompound",{amount:Q!==void 0?Q.toFixed(p):"…",symbol:g})}),N&&e.jsx(t,{fontSize:"11px",color:"orange.500",textAlign:"center",mt:1.5,fontStyle:"italic",children:a("renewNothingToCompound")})]}),e.jsx(t,{fontSize:"12px",color:"gray.500",fontWeight:"semibold",mb:2,children:a("renewNewTerm")}),e.jsx(r,{gap:2,mb:3,children:D.map(x=>{const m=z(x.period),u=x.tierId===T,Y=!!x.isPremiumRate;return e.jsxs(r,{flex:1,direction:"column",align:"center",justify:"center",position:"relative",className:Y&&u?"vy-beam-border-light":void 0,py:"12px",borderRadius:"9px",cursor:m?"pointer":"not-allowed",opacity:m?1:.4,border:"1px solid",boxShadow:u?Y?"0 8px 20px -12px rgba(174,144,93,0.9)":"0 2px 10px rgba(11,52,74,0.25)":"0 1px 3px rgba(0,0,0,0.05)",onClick:()=>{m&&s(x.tierId)},...mt(u,Y),children:[e.jsx(t,{fontSize:"15px",fontWeight:"bold",children:x.period}),e.jsx(t,{fontSize:"10px",opacity:.85,children:a("days")}),e.jsx(t,{fontSize:"11px",fontWeight:"semibold",mt:1,className:Y&&!u?"vy-gold-text":void 0,children:x.rate}),Y&&e.jsx(t,{fontSize:"8px",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"0.05em",mt:"2px",opacity:u?.95:1,className:u?void 0:"vy-gold-text",children:a("vgcMember")})]},x.tierId)})}),h&&e.jsx(r,{justify:"center",mb:2,children:e.jsx(t,{fontSize:"12px",fontWeight:h.isPremiumRate?"bold":"normal",color:h.isPremiumRate?void 0:"gray.500",className:h.isPremiumRate?"vy-gold-text":void 0,filter:h.isPremiumRate?"brightness(0.7)":void 0,children:a("renewRelock",{days:v,rate:$})})}),k.isError&&e.jsx(j,{px:1,py:2,children:e.jsx(t,{fontSize:"13px",color:"red.500",textAlign:"center",children:ne(k.error,f)})})]}),e.jsxs(Ee,{children:[C.isSent&&!C.isSuccess&&!C.isError&&e.jsx(t,{fontSize:"13px",color:"gray.600",textAlign:"center",mb:2,children:a("awaitingConfirmation")}),C.isError&&e.jsx(t,{fontSize:"13px",color:"red.500",textAlign:"center",mb:2,children:a("errors.transactionReverted")}),e.jsx(Ae,{w:"full",size:"lg",borderRadius:"6px",bgGradient:"linear(to-r, #0b344a, #0f4563)",border:"2px s
1olid",borderColor:"blue.700",color:"white",fontSize:"16px",fontWeight:"normal",_hover:{bgGradient:"linear(to-r, #0f4563, #0b344a)"},isDisabled:!y,isLoading:C.isPending||k.isLoading,loadingText:f("actions.confirming"),onClick:()=>C.confirm(),children:k.isLoading?e.jsx(ae,{size:"sm"}):a("confirmRenew")})]})]})},bt=({stakeAmount:o,totalReward:n,periodDays:g,assetPriceUsd:p,currency:l,principal:b,aprPct:W})=>{const{t:d}=O(void 0,{keyPrefix:"views.stake.carry"}),{data:F}=ct(),S=l==="USD"?1:F==null?void 0:F.rates[l];if(p==null||S==null||b<=0)return null;const a=p*S,f=xt({stakeAmount:o,totalReward:n,periodDays:g,priceFiat:a,principal:b,aprPct:W}),M=f.net>=0,w=(E,i=!1)=>dt(E,l,i);return e.jsxs(j,{px:5,py:"15px",children:[e.jsx(t,{fontSize:"14px",color:"gray.700",fontWeight:"semibold",mb:2,children:d("toggle")}),e.jsxs(j,{bg:"spaceGray.100",rounded:"lg",px:4,py:3,children:[e.jsxs(r,{justify:"space-between",fontSize:"13px",color:"gray.600",children:[e.jsx(t,{children:d("positionAtMaturity")}),e.jsx(t,{fontWeight:"semibold",color:"gray.700",children:w(f.positionValue)})]}),e.jsxs(r,{justify:"space-between",fontSize:"13px",color:"gray.600",mt:1.5,children:[e.jsx(t,{children:d("loanPlusInterest")}),e.jsxs(t,{fontWeight:"semibold",color:"gray.700",children:["− ",w(f.loanOwed)]})]}),e.jsx(L,{borderColor:"spaceGray.300",my:2}),e.jsxs(r,{justify:"space-between",align:"center",children:[e.jsx(t,{fontSize:"14px",fontWeight:"bold",color:"gray.700",children:d("projectedPnl")}),e.jsxs(t,{fontSize:"16px",fontWeight:"bold",color:M?"green.500":"red.500",children:[M?"▲":"▼"," ",w(f.net,!0)]})]}),e.jsxs(t,{fontSize:"11px",color:"gray.500",mt:1,children:[d("yield")," ",w(f.yieldFiat,!0)," · ",d("price")," ",w(f.priceEffect,!0)," · ",d("funding")," ",w(-f.fundingCost,!0)]}),l!=="USD"&&S!=null&&e.jsx(t,{fontSize:"10px",color:"gray.400",mt:1.5,children:d("fxAt",{rate:S.toLocaleString(void 0,{maximumFractionDigits:4}),currency:l})})]})]})},je=130,Ft=()=>{var B;const{t:o}=O(void 0,{keyPrefix:"views.stake"}),n=Ke(),[g]=Xe(),p=Ze(),l=((B=n.state)==null?void 0:B.stakeData)??{kind:"vy",stakeId:"0",staked:1e3,period:30,apy:20,rate:"1.64%",totalReward:252,dailyAccrual:0,startDate:"Feb 15 2026, 7:00 AM",endDate:"Mar 15 2026, 7:00 AM",endTimestamp:0,claimedYield:.55,yieldAvailable:.19003,symbol:"VY",logo:pe,priceUsd:0,displayDecimals:5},{kind:b="vy",stakeId:W,staked:d,period:F,apy:S,rate:a,totalReward:f,startDate:M,endDate:w,endTimestamp:E,claimedYield:i,yieldAvailable:P,symbol:c="VY",logo:G=pe,displayDecimals:z=5,tier:T=0,assetAddress:s,isNative:h=!1,priceUsd:H=0,withdrawing:Q=!1,tokenDecimals:q=18,levyBps:I=0}=l,A=BigInt(W??"0"),[k]=Je("carryByStake"),C=ft(b,b==="vy"?"vy":s??"vy",T,Number(d)),y=k==null?void 0:k[C],$=ht({isVY:b==="vy",symbol:c==="BTC"?"WBTC":c,isNative:h,address:s??We,logo:G})??(H||void 0),D=E>0&&Date.now()/1e3>=E,x=P>0,m=Number(d)+Number(f),{bps:u}=et(),U=tt().data===!0,K=(u??0)>0,te=(u??0)/100,V=!D&&K?Number(d)*(u??0)/1e4:0,Z=!U&&(D||K),_=!Q,oe=()=>{p.open(me,{title:o("confirmClaim"),type:"claim",stakeId:A,stakeKind:b,assetSymbol:c,pendingYield:Number(P)||0,displayDecimals:z,levyBps:I})},J=()=>{p.open(me,{title:o("confirmWithdraw"),type:"withdraw",stakeId:A,stakeKind:b,assetSymbol:c,isMatured:D,earlyPenaltyBps:u,principal:Number(d),alreadyClaimedYield:Number(i)||0,pendingYield:Number(P)||0,displayDecimals:z,assetDecimals:Number(q),levyBps:I})},ie=()=>{p.open(jt,{stakeId:A,stakeKind:b,symbol:c,displayDecimals:z,tokenDecimals:Number(q),currentTier:Number(T),unlockTimestamp:Number(E),assetAddress:s,isNative:h})};return R.useRef(!1),R.useEffect(()=>{},[g,u]),e.jsxs(ot,{title:o("stakeDetail"),children:[e.jsx(at,{message:o("yieldAvailableSymbol",{amount:P.toFixed(z),symbol:c,defaultValue:"{{amount}} {{symbol}} Yield Available"}),borderBottom:"0.5px solid",borderColor:"gray.300"}),e.jsxs(r,{justify:"center",align:"center",gap:2,px:5,pt:3,children:[e.jsx(it,{symbol:c,src:G,boxSize:"22px"}),e.jsx(t,{fontSize:"14px",fontWeight:"bold",color:"gray.700",children:c})]}),e.jsxs(j,{px:5,children:[e.jsxs(r,{direction:"column",gap:"15px",py:"15px",pb:"15px",pt:"10px",fontSize:"14px",children:[e.jsxs(r,{justify:"space-between",align:"center",children:[e.jsx(t,{color:"gray.600",children:o("stakeAmount")}),e.jsxs(t,{fontWeight:"bold",color:"gray.700",children:[Number(d).toFixed(z)," ",c]})]}),e.jsxs(r,{justify:"space-between",align:"center",children:[e.jsx(t,{color:"gray.600",children:o("stakingPerio
1d")}),e.jsxs(t,{fontWeight:"bold",color:"gray.700",children:[F," ",o("days")]})]}),e.jsxs(r,{justify:"space-between",align:"center",children:[e.jsx(t,{color:"gray.600",children:o("startDate")}),e.jsx(t,{fontWeight:"bold",color:"gray.700",children:M})]}),e.jsxs(r,{justify:"space-between",align:"center",children:[e.jsx(t,{color:"gray.600",children:o("endDate")}),e.jsx(t,{fontWeight:"bold",color:"gray.700",children:w})]}),e.jsxs(r,{justify:"space-between",align:"center",children:[e.jsx(t,{color:"gray.600",children:o("fundRate")}),e.jsxs(t,{fontWeight:"bold",color:"gray.700",children:[S.toFixed(2),"% APY"]})]}),e.jsxs(r,{justify:"space-between",align:"center",children:[e.jsx(t,{color:"gray.600",children:o("claimedYield")}),e.jsxs(t,{fontWeight:"bold",color:"gray.700",children:[i.toFixed(z)," ",c]})]})]}),e.jsx(L,{borderColor:"spaceGray.300"}),e.jsxs(r,{justify:"space-between",align:"center",py:"15px",children:[e.jsxs(j,{children:[e.jsx(t,{fontSize:"14px",color:"gray.600",children:o("totalReward")}),e.jsx(t,{fontSize:"10px",color:"gray.500",children:o("rewardPercentage",{percentage:a,symbol:c})})]}),e.jsxs(t,{fontSize:"14px",fontWeight:"bold",color:"gray.700",children:[f.toFixed(z)," ",c]})]}),e.jsx(L,{borderColor:"spaceGray.300"}),e.jsxs(r,{justify:"space-between",align:"center",py:"15px",children:[e.jsx(t,{fontSize:"14px",color:"gray.600",fontWeight:"semibold",children:o("totalReturn")}),e.jsxs(t,{fontSize:"14px",fontWeight:"bold",color:"gray.700",children:[m.toFixed(z)," ",c]})]})]}),y&&e.jsx(bt,{stakeAmount:Number(d),totalReward:Number(f),periodDays:Number(F),assetPriceUsd:$,currency:y.currency??"USD",principal:Number.parseFloat(y.principal??"")||0,aprPct:Number.parseFloat(y.aprPct??"")||0}),e.jsx(j,{flex:1}),!D&&K?e.jsxs(r,{align:"start",gap:2,px:5,py:3,children:[e.jsx(ee,{as:le,boxSize:"16px",color:"gray.600",mt:"2px",flexShrink:0}),e.jsx(t,{fontSize:"11px",color:"gray.500",fontStyle:"italic",lineHeight:"1.4",children:o("earlyExitNote",{pct:te,penalty:V.toFixed(z),symbol:c})})]}):b!=="asset"&&e.jsxs(r,{align:"start",gap:2,px:5,py:3,children:[e.jsx(ee,{as:le,boxSize:"16px",color:"gray.600",mt:"2px",flexShrink:0}),e.jsx(t,{fontSize:"11px",color:"gray.500",fontStyle:"italic",lineHeight:"1.4",children:o("disclaimerStakeDetail")})]}),e.jsx(j,{h:`${je+16}px`,flexShrink:0}),e.jsx(lt,{h:je,children:e.jsxs(rt,{alignItems:"center",justifyContent:"space-around",w:"full",px:4,children:[e.jsx(se,{containerProps:{w:"84px"},icon:nt,text:o("withdraw"),iconColor:"blue.600",isDisabled:!Z,onClick:J}),e.jsx(se,{containerProps:{w:"84px"},icon:st,text:o("renew"),iconColor:"blue.600",isDisabled:!_,onClick:ie}),e.jsx(se,{containerProps:{w:"84px"},icon:ge,text:o("claimYield"),iconColor:"gold.500",gradientBorder:!0,textProps:{color:"gold.600"},isDisabled:!x,iconButtonProps:{icon:e.jsx(ee,{as:ge,color:"gold.500",boxSize:"30px"})},onClick:oe})]})})]})};export{Ft as StakeDetail};

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.