diff --git a/404.html b/404.html index 2454bfc..49dce39 100644 --- a/404.html +++ b/404.html @@ -1 +1 @@ -404: This page could not be found.

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.

404

This page could not be found.

\ No newline at end of file diff --git a/_next/static/vKS50s-SqSS05fQWU-TXS/_buildManifest.js b/_next/static/WyQ_gkUilFLI8ibobnbav/_buildManifest.js similarity index 100% rename from _next/static/vKS50s-SqSS05fQWU-TXS/_buildManifest.js rename to _next/static/WyQ_gkUilFLI8ibobnbav/_buildManifest.js diff --git a/_next/static/vKS50s-SqSS05fQWU-TXS/_ssgManifest.js b/_next/static/WyQ_gkUilFLI8ibobnbav/_ssgManifest.js similarity index 100% rename from _next/static/vKS50s-SqSS05fQWU-TXS/_ssgManifest.js rename to _next/static/WyQ_gkUilFLI8ibobnbav/_ssgManifest.js diff --git a/_next/static/chunks/503-311c908eac1df4f6.js b/_next/static/chunks/503-311c908eac1df4f6.js deleted file mode 100644 index 28c4901..0000000 --- a/_next/static/chunks/503-311c908eac1df4f6.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[503],{143:function(e,t,s){s.d(t,{N:function(){return r}});var n=s(3827),l=s(77658);let r=e=>{let{children:t,onSort:s,sort:r,sorting:i}=e,a=(i||[]).concat(["none"]),c=r?a.indexOf(r):-1;return(0,n.jsx)("div",{className:"text-[14px] font-normal leading-[14px] tracking-wider",children:(0,n.jsxs)("span",{className:"relative",children:[t," ",!!s&&!!r&&(0,n.jsx)("button",{className:"absolute right-[-16px] top-[6px] cursor-pointer",dangerouslySetInnerHTML:{__html:l.Sf},onClick:()=>{if(!s)return;let e=(1+a.indexOf(r))%a.length,t=a[e];null==s||s(t)},style:{rotate:0===c?"180deg":1===c?"0deg":"90deg"}})]})})}},80148:function(e,t,s){s.d(t,{B:function(){return l}});var n=s(22840);let l=(e,t,s)=>typeof e!=typeof t?0:"string"==typeof e?s?e.localeCompare(t):t.localeCompare(e):"number"==typeof e?Number.isNaN(e)||Number.isNaN(t)?0:s?e-t:t-e:e instanceof n.Z&&t instanceof n.Z?s?e.minus(t).toNumber():t.minus(e).toNumber():0},26605:function(e,t,s){var n=s(3827),l=s(30298);t.Z=e=>{let{address:t}=e;if(!t)return null;let s=[t.slice(0,5),t.slice(t.length-5)].join("...");return(0,n.jsx)("button",{className:"cursor-pointer text-left text-[12px] font-normal leading-[20px] text-typo-200",onClick:()=>{navigator.clipboard.writeText(t),(0,l.Am)("Copied to clipboard",{type:"info"})},children:s})}},62948:function(e,t,s){s.d(t,{S6:function(){return g},sv:function(){return N}});var n=s(3827),l=s(64090),r=s(98909),i=s(143),a=s(80148),c=s(88197),d=s(80469),o=s(62986),u=s(39730),x=s(89056),m=s(66803),h=s(77658),p=s(19807),j=s(67497),f=s(26605),v=s(48074);let g=e=>{let t=(0,u.jv)(e,null),s=(0,u.U2)(e,null);return(0,m.UO)(t)||(0,m.UO)(s)},N=e=>{let{isShowingDetails:t,setIsShowingDetails:s}=e;return(0,n.jsxs)("button",{className:"text-primary-500 flex flex-row items-center gap-2",onClick:()=>{s(!t)},children:[t?"Hide details":"Show details",(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:h.cx},style:{transform:"rotate(".concat(t?"0deg":"180deg",")")}})]})},b={gap:"16px",gridTemplateColumns:"60px 1.5fr repeat(4, 1fr)"},y="grid w-full items-center justify-between gap-2 p-2 mb-[24px] last:mb-[0px] bg-black rounded-[8px]",w="w-full overflow-hidden rounded-[24px] bg-bg-600 pb-4 text-typo-100 px-[16px]",k=()=>(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:h.GI}}),S=(0,l.memo)(e=>{let{delegation:t,disabled:s,index:i,staking:a,validator:d}=e,{validatorAddress:u}=t;(0,l.useEffect)(()=>{u&&(0,c.Dr)(u,a)},[u,a]);let m=(0,x.P)(null==d?void 0:d.description.identity);return(0,n.jsxs)("div",{className:y,style:b,children:[(0,n.jsx)("div",{className:"flex items-center justify-start",children:(0,n.jsx)("img",{alt:"Validator logo",className:"block w-[50px] rounded-full",src:m,style:{height:50,width:50}})}),(0,n.jsx)("div",{className:"flex flex-1 flex-row justify-start gap-4",children:(0,n.jsxs)("div",{className:"flex flex-col justify-start gap-2 text-left",children:[(0,n.jsx)("div",{className:"text-[14px] font-bold leading-[20px]",children:(null==d?void 0:d.description.moniker)||""}),(0,n.jsx)(f.Z,{address:(null==d?void 0:d.operatorAddress)||""})]})}),(0,n.jsx)("div",{className:"text-right",children:(0,n.jsx)(v.Z,{text:(0,j.Em)(t.balance)})}),(0,n.jsx)("div",{className:"text-right",children:d?(0,j.i)(d.commission.commissionRates.rate,0):""}),(0,n.jsx)("div",{className:"text-right",children:(0,n.jsx)(v.Z,{text:(0,j.Em)(t.rewards)})}),(0,n.jsxs)("div",{className:"flex flex-row items-center justify-end gap-[8px]",children:[(0,n.jsx)(r.hp,{disabled:s,onClick:()=>{d&&a.dispatch((0,o.ZG)({content:{validator:d},type:"delegate"}))},children:"Delegate"}),(0,n.jsx)(r.Rk,{Trigger:k,id:"delegation-".concat(i),children:(0,n.jsxs)("div",{className:"flex flex-col gap-[12px] rounded-[8px] bg-bg-600 py-[4px]",children:[(0,n.jsx)(r.ZP,{disabled:s,onClick:()=>{d&&a.dispatch((0,o.ZG)({content:{delegations:[t]},type:"rewards"}))},children:"Claim rewards"}),(0,n.jsx)(r.ZP,{disabled:s,onClick:()=>{d&&a.dispatch((0,o.ZG)({content:{validator:d},type:"undelegate"}))},variant:"danger",children:"Undelegate"})]})})]})]})}),C=e=>{let{disabled:t,stakingRef:s,unbonding:i,validator:a}=e,{account:d,client:o,staking:u}=s,m=(0,x.P)(null==a?void 0:a.description.identity),h=i.validator;return(0,l.useEffect)(()=>{h&&(0,c.Dr)(h,u)},[h,u]),(0,n.jsxs)("div",{className:y,style:b,children:[(0,n.jsx)("div",{className:"flex items-center justify-start",children:(0,n.jsx)("img",{alt:"Validator logo",className:"block w-[50px] rounded-full",src:m,style:{height:50,width:50}})}),(0,n.jsx)("div",{className:"flex flex-1 flex-row justify-start gap-4",children:(0,n.jsxs)("div",{className:"flex flex-col justify-start gap-2 text-left",children:[(0,n.jsx)("div",{className:"text-[14px] font-bold leading-[20px]",children:(null==a?void 0:a.description.moniker)||""}),(0,n.jsx)(f.Z,{address:(null==a?void 0:a.operatorAddress)||""})]})}),(0,n.jsx)("div",{className:"text-right",children:(0,n.jsx)(v.Z,{text:(0,j.Em)(i.balance)})}),(0,n.jsx)("div",{className:"text-right",children:"Unbonding"}),(0,n.jsx)("div",{className:"text-right",children:(0,j.ts)(i.completionTime)}),(0,n.jsx)("div",{className:"text-right",children:(0,n.jsx)(r.hp,{disabled:t,onClick:()=>{if(!o)return;let e={delegator:d.bech32Address||"",validator:i.validator};(0,p.rf)(e,o)},variant:"danger",children:"Cancel Unstake"})})]})},E=i.N,Z=i.N,I="grid w-full items-center justify-between gap-2 p-4 uppercase";t.ZP=(0,l.memo)(()=>{let e=(0,d.n)(),{staking:t}=e,[s,r]=(0,l.useState)("none"),[i,c]=(0,l.useState)("none"),o=(0,u.mM)(t.state),{delegations:x,unbondings:m}=t.state,h=!!(null==x?void 0:x.items.length),p=!!(null==m?void 0:m.items.length);return h||p?(0,n.jsxs)("div",{className:"flex h-full flex-1 flex-col items-end gap-[16px]",children:[h&&(()=>{let e=x.items.slice().sort((e,t)=>{switch(s){case"staked-asc":case"staked-desc":return(0,a.B)(e.balance.amount,t.balance.amount,"staked-asc"===s);case"rewards-asc":case"rewards-desc":return(0,a.B)(e.rewards.amount,t.rewards.amount,"rewards-asc"===s);case"commission-asc":case"commission-desc":{let n=o[e.validatorAddress],l=o[t.validatorAddress];return(0,a.B)(Number(null==n?void 0:n.commission.commissionRates.rate),Number(null==l?void 0:l.commission.commissionRates.rate),"commission-asc"===s)}default:return 0}});return(0,n.jsxs)("div",{className:w,children:[(0,n.jsxs)("div",{className:I,style:b,children:[(0,n.jsx)("div",{}),(0,n.jsx)(E,{children:"Delegations"}),(0,n.jsx)(E,{onSort:r,sort:s,sorting:["staked-asc","staked-desc"],children:(0,n.jsx)("div",{className:"text-right",children:"Staked Amount"})}),(0,n.jsx)(E,{onSort:r,sort:s,sorting:["commission-asc","commission-desc"],children:(0,n.jsx)("div",{className:"text-right",children:"Commission"})}),(0,n.jsx)(E,{onSort:r,sort:s,sorting:["rewards-asc","rewards-desc"],children:(0,n.jsx)("div",{className:"text-right",children:"Rewards"})})]}),e.map((e,s)=>(0,n.jsx)(S,{delegation:e,index:s,staking:t,validator:o[e.validatorAddress]},s))]})})(),p&&(()=>{let t=m.items.slice().sort((e,t)=>{switch(i){case"amount-asc":case"amount-desc":return(0,a.B)(Number(e.balance.amount),Number(t.balance.amount),"amount-asc"===i);case"completion-asc":case"completion-desc":return(0,a.B)(e.completionTime,t.completionTime,"completion-asc"===i);default:return 0}});return(0,n.jsxs)("div",{className:w,children:[(0,n.jsxs)("div",{className:I,style:b,children:[(0,n.jsx)("div",{}),(0,n.jsx)(Z,{children:"Unstakings"}),(0,n.jsx)(Z,{onSort:c,sort:i,sorting:["staked-asc","staked-desc"],children:(0,n.jsx)("div",{className:"text-right",children:"Staked Amount"})}),(0,n.jsx)(Z,{children:(0,n.jsx)("div",{className:"text-right",children:"Status"})}),(0,n.jsx)(Z,{onSort:c,sort:i,sorting:["date-asc","date-desc"],children:(0,n.jsx)("div",{className:"text-right",children:"Completion Time"})})]}),t.map((t,s)=>(0,n.jsx)(C,{stakingRef:e,unbonding:t,validator:o[t.validator]},s))]})})()]}):null})},42498:function(e,t,s){s.d(t,{I:function(){return l},i:function(){return r}});var n=s(3827);let l=()=>(0,n.jsx)("div",{className:"h-[1px] w-full bg-bg-400"}),r=()=>(0,n.jsx)("div",{className:"h-full w-[1px] bg-bg-400"})},71860:function(e,t,s){s.d(t,{Z:function(){return S}});var n=s(3827),l=s(64090),r=s(30298),i=s(98909),a=s(98245),c=s.n(a),d=s(77658);c().setAppElement(document.body);var o=e=>{let{children:t,...s}=e;return(0,l.useEffect)(()=>{if(s.isOpen){let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}},[s.isOpen]),(0,n.jsx)(c(),{...s,style:{content:{background:"rgba(0,0,0,0.8)",border:"none",borderRadius:"48px",bottom:"auto",boxShadow:"0px 0px 50px 0px #FFFFFF40",left:"50%",padding:"45px",right:"auto",top:"50%",transform:"translate(-50%, -50%)"},overlay:{backgroundColor:"rgba(0, 0, 0, 0.5)"}},children:(0,n.jsxs)("div",{className:"relative w-full",children:[(0,n.jsx)("button",{className:"absolute right-[-16px] top-[-16px] w-[36px] cursor-pointer",dangerouslySetInnerHTML:{__html:d.kC},onClick:s.onRequestClose}),t]})})},u=s(88197),x=s(80469),m=s(62986);let h=async(e,t)=>{let{client:s,staking:n}=e,{modal:l}=n.state,{delegations:i}=(null==l?void 0:l.content)||{};s&&(null==i?void 0:i.length)&&i.reduce(async(t,n)=>{await t;let l={delegator:e.account.bech32Address,validator:n.validatorAddress};return(0,u.sT)(l,s,e.staking)},Promise.resolve()).then(()=>{t("completed")}).catch(()=>{(0,r.Am)("There was an unexpected error claiming your rewards. Please try again later.",{type:"error"})})};var p=(0,l.memo)(()=>{let e=(0,x.n)(),[t,s]=(0,l.useState)("loading"),r=(0,l.useRef)(!1),{staking:a}=e,{modal:c}=a.state,d=(null==c?void 0:c.type)==="rewards";if((0,l.useEffect)(()=>{d&&!r.current&&(r.current=!0,h(e,s))},[d,e]),!d)return null;let u="loading"===t?(0,n.jsxs)("div",{className:"w-full text-center",children:[(0,n.jsx)("div",{className:"mb-[16px] uppercase",children:(0,n.jsx)(i.ls,{children:"CLAIMING"})}),(0,n.jsx)("div",{className:"mb-[16px] text-typo-100",children:"Wait until your rewards are withdrawn."}),(0,n.jsx)(i.zx,{isLoading:!0})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"mb-[16px] uppercase",children:(0,n.jsx)(i.ls,{children:"Success!"})}),(0,n.jsx)("div",{className:"mb-[16px] text-typo-100",children:"You have claimed your staking rewards successfully."})]}),(0,n.jsx)(i.zx,{onClick:()=>{e.staking.dispatch((0,m.ZG)(null))},children:"CLOSE"})]});return(0,n.jsx)(o,{isOpen:d,onRequestClose:()=>{"loading"!==t&&e.staking.dispatch((0,m.ZG)(null))},children:(0,n.jsx)("div",{className:"min-w-[390px]",children:u})})}),j=s(22840),f=s(39730),v=s(66803),g=s(9016),N=s(67497);let b="input";var y=()=>{let e=(0,x.n)(),{client:t}=e,[s,a]=(0,l.useState)(b),[c,d]=(0,l.useState)(!1),[h,p]=(0,l.useState)(""),[y,w]=(0,l.useState)(""),[k,S]=(0,l.useState)({amount:void 0,memo:void 0}),{account:C,staking:E}=e,{modal:Z}=E.state,I=(null==Z?void 0:Z.type)==="delegate";if((0,l.useEffect)(()=>()=>{a(b),S({}),p(""),w("")},[I]),!I)return null;let{validator:A}=null==Z?void 0:Z.content;if(!A)return null;let F=new j.Z(h),O=F.isNaN()?"":F.times(g.Ex),z=Object.values(k).some(e=>!!e),B=(0,f.ap)(E.state);return(0,n.jsx)(o,{isOpen:I,onRequestClose:()=>{c||e.staking.dispatch((0,m.ZG)(null))},children:(0,n.jsx)("div",{className:"min-w-[390px]",children:(()=>{let l=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"mb-[32px] mt-[32px] flex w-full flex-col items-center justify-center gap-[12px]",children:[(0,n.jsx)(i.Bz,{children:"Staked Amount (XION)"}),(0,n.jsx)(i.XJ,{children:F.toString()}),O&&(0,n.jsxs)(i.Bz,{children:["$",(0,N.HS)(O)]})]}),!!y&&(0,n.jsx)("div",{className:"mb-[32px] text-center italic",children:(0,n.jsx)("div",{children:y})})]});if("completed"===s)return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"mb-[16px]",children:(0,n.jsx)(i.ls,{children:"SUCCESS!"})}),(0,n.jsxs)("div",{className:"text-typo-100",children:["You have successfully staked on"," ",A.description.moniker,". Thank you for contributing in securing the XION network."]})]}),l(),(0,n.jsx)(i.zx,{disabled:c,onClick:()=>{e.staking.dispatch((0,m.ZG)(null))},children:"CLOSE"})]});if("review"===s)return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"mb-[16px]",children:(0,n.jsx)(i.ls,{children:"REVIEW"})}),(0,n.jsxs)("div",{className:"text-typo-100",children:["Get ready to stake your XION token with"," ",A.description.moniker,". Press 'Confirm' to proceed."]})]}),l(),(0,n.jsx)(i.zx,{isLoading:c,onClick:()=>{if(!t)return;d(!0);let e={delegator:C.bech32Address,validator:A.operatorAddress};(0,u._5)(e,(0,v.Jp)(F),y,t,E).then(e=>(a("completed"),e())).catch(()=>{(0,r.Am)("Staking error",{type:"error"})}).finally(()=>{d(!1)})},children:"CONFIRM"})]});let o=()=>{if(!O||!B||F.isNaN()||F.gt(B))return S({...k,amount:"Invalid amount"}),!0};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"text-center uppercase",children:(0,n.jsxs)(i.ls,{children:["Delegate To ",A.description.moniker]})}),B&&(()=>{let e=B.times(g.Ex);return(0,n.jsxs)("div",{className:"mt-[40px] flex w-full flex-col items-center justify-center gap-[12px] uppercase",children:[(0,n.jsx)(i.Bz,{children:"Available for delegation (XION)"}),(0,n.jsx)(i.XJ,{children:(0,N.HS)(B)}),(0,n.jsxs)(i.Bz,{children:["$",(0,N.HS)(e)]})]})})(),(0,n.jsxs)("div",{className:"mt-[40px] flex w-full flex-row justify-between",children:[(0,n.jsx)("div",{children:"Amount"}),!!O&&(0,n.jsxs)(i.Bz,{children:["= $",(0,N.HS)(O)]})]}),(0,n.jsxs)("form",{onSubmit:e=>{null==e||e.stopPropagation(),null==e||e.preventDefault(),!o()&&(!t||z||F.lt(0)||a("review"))},children:[(0,n.jsxs)("div",{className:"mt-[8px]",children:[(0,n.jsx)(i.Wz,{disabled:c,error:!!k.amount,onBlur:()=>{o()},onChange:e=>{k.amount&&S({...k,amount:void 0}),p(e.target.value)},value:h}),k.amount&&(0,n.jsx)("div",{children:(0,n.jsx)(i.Xq,{children:k.amount})})]}),(0,n.jsx)("div",{className:"mt-[40px] w-full",children:(0,n.jsx)(i.sr,{disabled:c,onChange:e=>{w(e.target.value)},placeholder:"Memo (Optional)",value:y})}),(0,n.jsx)("div",{className:"mt-[48px] w-full",children:(0,n.jsx)(i.zx,{disabled:c||z,type:"submit",children:"DELEGATE NOW"})})]})]})})()})})};let w="input";var k=()=>{let e=(0,x.n)(),{client:t}=e,[s,a]=(0,l.useState)(w),[c,d]=(0,l.useState)(!1),[h,p]=(0,l.useState)({amount:void 0,memo:void 0}),[b,y]=(0,l.useState)(""),[k,S]=(0,l.useState)(""),{account:C,staking:E}=e,{modal:Z}=E.state,I=(null==Z?void 0:Z.type)==="undelegate";if((0,l.useEffect)(()=>()=>{a(w),y(""),p({}),S("")},[I]),!I)return null;let{validator:A}=null==Z?void 0:Z.content;if(!A)return null;let F=new j.Z(b),O=F.isNaN()?"":F.times(g.Ex),z=(0,f.U2)(E.state,A.operatorAddress),B=()=>{if(!O||!z||F.lte(0)||F.gt(new j.Z(z.amount)))return p({...h,amount:"Invalid amount"}),!0},R=e=>{null==e||e.stopPropagation(),null==e||e.preventDefault(),!B()&&t&&F.gt(0)&&a("review")};return(0,n.jsx)(o,{isOpen:I,onRequestClose:()=>{c||e.staking.dispatch((0,m.ZG)(null))},children:(0,n.jsx)("div",{className:"min-w-[390px]",children:(()=>{let l=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"mb-[32px] mt-[32px] flex w-full flex-col items-center justify-center gap-[12px]",children:[(0,n.jsx)(i.Bz,{children:"Unstaking Amount (XION)"}),(0,n.jsx)(i.XJ,{children:(0,N.HS)(F)}),(0,n.jsx)(i.Bz,{children:(0,N.H_)((0,v.Jp)(F))})]}),!!k&&(0,n.jsx)("div",{className:"mb-[32px] text-center italic",children:(0,n.jsx)("div",{children:k})})]});return"completed"===s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"mb-[16px]",children:(0,n.jsx)(i.ls,{children:"SUCCESS!"})}),(0,n.jsxs)("div",{className:"text-typo-100",children:["You have successfully unstaked from"," ",A.description.moniker,". It takes ",g.Mx," ","days to complete the unstaking process"]})]}),l(),(0,n.jsx)(i.zx,{disabled:c,onClick:()=>{e.staking.dispatch((0,m.ZG)(null))},children:"CLOSE"})]}):"review"===s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"mb-[16px]",children:(0,n.jsx)(i.ls,{children:"REVIEW"})}),(0,n.jsxs)("div",{className:"text-typo-100",children:["Unstaking your XION Token means you'll stop earning rewards. Remember, it takes ",g.Mx," days to complete the unstaking process."]})]}),l(),(0,n.jsx)(i.zx,{isLoading:c,onClick:()=>{if(!t)return;d(!0);let e={delegator:C.bech32Address,validator:A.operatorAddress};(0,u.xu)(e,(0,v.Jp)(F),k,t,E).then(e=>(a("completed"),e())).catch(()=>{(0,r.Am)("Staking error",{type:"error"})}).finally(()=>{d(!1)})},children:"CONFIRM"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"text-center uppercase",children:(0,n.jsxs)(i.ls,{children:["Unstake From ",A.description.moniker]})}),z&&(()=>{let e=new j.Z(z.amount).times(g.Ex);return(0,n.jsxs)("div",{className:"mt-[40px] flex w-full flex-col items-center justify-center gap-[12px] uppercase",children:[(0,n.jsx)(i.Bz,{children:"Available amount (XION)"}),(0,n.jsx)(i.XJ,{children:(0,N.HS)(new j.Z(z.amount))}),(0,n.jsxs)(i.Bz,{children:["$",(0,N.HS)(e)]})]})})(),(0,n.jsxs)("div",{className:"mt-[40px] flex w-full flex-row justify-between",children:[(0,n.jsx)("div",{children:"Amount"}),!!O&&(0,n.jsxs)(i.Bz,{children:["=$",(0,N.HS)(O)]})]}),(0,n.jsxs)("form",{onSubmit:R,children:[(0,n.jsxs)("div",{className:"mt-[8px]",children:[(0,n.jsx)(i.Wz,{disabled:c,onBlur:()=>{B()},onChange:e=>{h.amount&&p({...h,amount:void 0}),y(e.target.value)},value:b}),h.amount&&(0,n.jsx)("div",{children:(0,n.jsx)(i.Xq,{children:h.amount})})]}),(0,n.jsx)("div",{className:"mt-[40px] w-full",children:(0,n.jsx)(i.sr,{disabled:c,onChange:e=>{S(e.target.value)},placeholder:"Memo (Optional)",value:k})}),(0,n.jsx)("div",{className:"mt-[48px] w-full",children:(0,n.jsx)(i.zx,{disabled:c,type:"submit",children:"Unstake Now"})})]})]})})()})})},S=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(y,{}),(0,n.jsx)(k,{}),(0,n.jsx)(p,{})]})},48074:function(e,t,s){var n=s(3827);t.Z=e=>{let{text:t}=e,[s,l]=t.split(" ");return(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{children:s})," ",(0,n.jsx)("span",{className:"text-typo-200",children:l})]})}},89056:function(e,t,s){s.d(t,{P:function(){return a}});var n=s(64090),l=s(9016);let r={},i={getIdentityLogo:e=>{if(r[e])return r[e];let t=fetch("https://keybase.io/_/api/1.0/user/lookup.json?key_suffix=".concat(e)).then(e=>e.json()).then(e=>{var t,s,n,l;return(null==e?void 0:null===(l=e.them)||void 0===l?void 0:null===(n=l[0])||void 0===n?void 0:null===(s=n.pictures)||void 0===s?void 0:null===(t=s.primary)||void 0===t?void 0:t.url)||null}).catch(()=>null);return r[e]=t,t}},a=e=>{let[t,s]=(0,n.useState)(null);return(0,n.useEffect)(()=>{(async()=>{e&&s(await i.getIdentityLogo(e))})()},[e]),t||l.c1}},67497:function(e,t,s){s.d(t,{Em:function(){return i},HS:function(){return c},H_:function(){return o},PV:function(){return x},gg:function(){return a},i:function(){return d},ts:function(){return u}});var n=s(22840),l=s(66803),r=s(9016);let i=(e,t)=>{let s=(0,l.bI)(e),r=new n.Z(s.amount);if(r.eq(0))return"".concat(r.toFormat()," ").concat(s.denom);if(r.lt(1e-4))return"<".concat(1e-4," ").concat(s.denom);if(t){let e=Intl.NumberFormat("en",{notation:"compact"});return"".concat(e.format(r.toNumber())," ").concat(s.denom)}return"".concat(r.toFormat(4)," ").concat(s.denom)},a=e=>{if("number"!=typeof e||Number.isNaN(e))return null;let t=e<1e-4?"<0.1":(100*e).toFixed(1);return"".concat(t,"%")},c=e=>Intl.NumberFormat("en",{notation:"compact"}).format(e.toNumber()),d=(e,t)=>{let s=new n.Z(e).div(new n.Z(10).pow(18)).toNumber();return"".concat((100*s).toFixed(t),"%")},o=(e,t)=>{let s=(0,l.bI)(e||(0,l.IB)()),i=new n.Z(e?s.amount:0).times(r.Ex);return i.eq(0)?"$0":!t&&i.lt(.01)?"<$0.01":"$".concat(t?c(i):i.toFormat(2))},u=e=>{let t=1e3*e,s=Math.floor((t-Date.now())/864e5),n=new Date(t).toLocaleString("default",{month:"short"}),l=new Date(t).getDate(),r=new Date(t).getFullYear();return"in ".concat(s," day").concat(1===s?"":"s",", ").concat(n," ").concat(l," ").concat(r)},x=e=>e?"".concat(e.times(100).toFixed(2),"%"):"-"}}]); \ No newline at end of file diff --git a/_next/static/chunks/503-6166f7bdb0bab8f4.js b/_next/static/chunks/503-6166f7bdb0bab8f4.js new file mode 100644 index 0000000..4b34eea --- /dev/null +++ b/_next/static/chunks/503-6166f7bdb0bab8f4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[503],{143:function(e,t,s){s.d(t,{N:function(){return r}});var n=s(3827),l=s(77658);let r=e=>{let{children:t,onSort:s,sort:r,sorting:i}=e,a=(i||[]).concat(["none"]),c=r?a.indexOf(r):-1;return(0,n.jsx)("div",{className:"text-[14px] font-normal leading-[14px] tracking-wider",children:(0,n.jsxs)("span",{className:"relative",children:[t," ",!!s&&!!r&&(0,n.jsx)("button",{className:"absolute right-[-16px] top-[6px] cursor-pointer",dangerouslySetInnerHTML:{__html:l.Sf},onClick:()=>{if(!s)return;let e=(1+a.indexOf(r))%a.length,t=a[e];null==s||s(t)},style:{rotate:0===c?"180deg":1===c?"0deg":"90deg"}})]})})}},80148:function(e,t,s){s.d(t,{B:function(){return l}});var n=s(22840);let l=(e,t,s)=>typeof e!=typeof t?0:"string"==typeof e?s?e.localeCompare(t):t.localeCompare(e):"number"==typeof e?Number.isNaN(e)||Number.isNaN(t)?0:s?e-t:t-e:e instanceof n.Z&&t instanceof n.Z?s?e.minus(t).toNumber():t.minus(e).toNumber():0},26605:function(e,t,s){var n=s(3827),l=s(30298);t.Z=e=>{let{address:t}=e;if(!t)return null;let s=[t.slice(0,5),t.slice(t.length-5)].join("...");return(0,n.jsx)("button",{className:"cursor-pointer text-left text-[12px] font-normal leading-[20px] text-typo-200",onClick:()=>{navigator.clipboard.writeText(t),(0,l.Am)("Copied to clipboard",{type:"info"})},children:s})}},62948:function(e,t,s){s.d(t,{S6:function(){return g},sv:function(){return N}});var n=s(3827),l=s(64090),r=s(98909),i=s(143),a=s(80148),c=s(88197),d=s(80469),o=s(62986),u=s(39730),x=s(89056),m=s(66803),h=s(77658),p=s(19807),j=s(67497),f=s(26605),v=s(48074);let g=e=>{let t=(0,u.jv)(e,null),s=(0,u.U2)(e,null);return(0,m.UO)(t)||(0,m.UO)(s)},N=e=>{let{isShowingDetails:t,setIsShowingDetails:s}=e;return(0,n.jsxs)("button",{className:"text-primary-500 flex flex-row items-center gap-2",onClick:()=>{s(!t)},children:[t?"Hide details":"Show details",(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:h.cx},style:{transform:"rotate(".concat(t?"0deg":"180deg",")")}})]})},b={gap:"16px",gridTemplateColumns:"60px 1.5fr repeat(4, 1fr)"},y="grid w-full items-center justify-between gap-2 p-2 mb-[24px] last:mb-[0px] bg-black rounded-[8px]",w="w-full overflow-hidden rounded-[24px] bg-bg-600 pb-4 text-typo-100 px-[16px]",k=()=>(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:h.GI}}),S=(0,l.memo)(e=>{let{delegation:t,disabled:s,index:i,staking:a,validator:d}=e,{validatorAddress:u}=t;(0,l.useEffect)(()=>{u&&(0,c.Dr)(u,a)},[u,a]);let m=(0,x.P)(null==d?void 0:d.description.identity);return(0,n.jsxs)("div",{className:y,style:b,children:[(0,n.jsx)("div",{className:"flex items-center justify-start",children:(0,n.jsx)("img",{alt:"Validator logo",className:"block w-[50px] rounded-full",src:m,style:{height:50,width:50}})}),(0,n.jsx)("div",{className:"flex flex-1 flex-row justify-start gap-4",children:(0,n.jsxs)("div",{className:"flex flex-col justify-start gap-2 text-left",children:[(0,n.jsx)("div",{className:"text-[14px] font-bold leading-[20px]",children:(null==d?void 0:d.description.moniker)||""}),(0,n.jsx)(f.Z,{address:(null==d?void 0:d.operatorAddress)||""})]})}),(0,n.jsx)("div",{className:"text-right",children:(0,n.jsx)(v.Z,{text:(0,j.Em)(t.balance)})}),(0,n.jsx)("div",{className:"text-right",children:d?(0,j.i)(d.commission.commissionRates.rate,0):""}),(0,n.jsx)("div",{className:"text-right",children:(0,n.jsx)(v.Z,{text:(0,j.Em)(t.rewards)})}),(0,n.jsxs)("div",{className:"flex flex-row items-center justify-end gap-[8px]",children:[(0,n.jsx)(r.hp,{disabled:s,onClick:()=>{d&&a.dispatch((0,o.ZG)({content:{validator:d},type:"delegate"}))},children:"Delegate"}),(0,n.jsx)(r.Rk,{Trigger:k,id:"delegation-".concat(i),children:(0,n.jsxs)("div",{className:"flex flex-col gap-[12px] rounded-[8px] bg-bg-600 py-[4px]",children:[(0,n.jsx)(r.ZP,{disabled:s,onClick:()=>{d&&a.dispatch((0,o.ZG)({content:{delegations:[t]},type:"rewards"}))},children:"Claim rewards"}),(0,n.jsx)(r.ZP,{disabled:s,onClick:()=>{d&&a.dispatch((0,o.ZG)({content:{validator:d},type:"undelegate"}))},variant:"danger",children:"Undelegate"})]})})]})]})}),C=e=>{let{disabled:t,stakingRef:s,unbonding:i,validator:a}=e,{account:d,client:o,staking:u}=s,m=(0,x.P)(null==a?void 0:a.description.identity),h=i.validator;return(0,l.useEffect)(()=>{h&&(0,c.Dr)(h,u)},[h,u]),(0,n.jsxs)("div",{className:y,style:b,children:[(0,n.jsx)("div",{className:"flex items-center justify-start",children:(0,n.jsx)("img",{alt:"Validator logo",className:"block w-[50px] rounded-full",src:m,style:{height:50,width:50}})}),(0,n.jsx)("div",{className:"flex flex-1 flex-row justify-start gap-4",children:(0,n.jsxs)("div",{className:"flex flex-col justify-start gap-2 text-left",children:[(0,n.jsx)("div",{className:"text-[14px] font-bold leading-[20px]",children:(null==a?void 0:a.description.moniker)||""}),(0,n.jsx)(f.Z,{address:(null==a?void 0:a.operatorAddress)||""})]})}),(0,n.jsx)("div",{className:"text-right",children:(0,n.jsx)(v.Z,{text:(0,j.Em)(i.balance)})}),(0,n.jsx)("div",{className:"text-right",children:"Unbonding"}),(0,n.jsx)("div",{className:"text-right",children:(0,j.ts)(i.completionTime)}),(0,n.jsx)("div",{className:"text-right",children:(0,n.jsx)(r.hp,{disabled:t,onClick:()=>{if(!o)return;let e={delegator:d.bech32Address||"",validator:i.validator};(0,p.rf)(e,o)},variant:"danger",children:"Cancel Unstake"})})]})},Z=i.N,E=i.N,I="grid w-full items-center justify-between gap-2 p-4 uppercase";t.ZP=(0,l.memo)(()=>{let e=(0,d.n)(),{staking:t}=e,[s,r]=(0,l.useState)("none"),[i,c]=(0,l.useState)("none"),o=(0,u.mM)(t.state),{delegations:x,unbondings:m}=t.state,h=!!(null==x?void 0:x.items.length),p=!!(null==m?void 0:m.items.length);return h||p?(0,n.jsxs)("div",{className:"flex h-full flex-1 flex-col items-end gap-[16px]",children:[h&&(()=>{let e=x.items.slice().sort((e,t)=>{switch(s){case"staked-asc":case"staked-desc":return(0,a.B)(e.balance.amount,t.balance.amount,"staked-asc"===s);case"rewards-asc":case"rewards-desc":return(0,a.B)(e.rewards.amount,t.rewards.amount,"rewards-asc"===s);case"commission-asc":case"commission-desc":{let n=o[e.validatorAddress],l=o[t.validatorAddress];return(0,a.B)(Number(null==n?void 0:n.commission.commissionRates.rate),Number(null==l?void 0:l.commission.commissionRates.rate),"commission-asc"===s)}default:return 0}});return(0,n.jsxs)("div",{className:w,children:[(0,n.jsxs)("div",{className:I,style:b,children:[(0,n.jsx)("div",{}),(0,n.jsx)(Z,{children:"Delegations"}),(0,n.jsx)(Z,{onSort:r,sort:s,sorting:["staked-asc","staked-desc"],children:(0,n.jsx)("div",{className:"text-right",children:"Staked Amount"})}),(0,n.jsx)(Z,{onSort:r,sort:s,sorting:["commission-asc","commission-desc"],children:(0,n.jsx)("div",{className:"text-right",children:"Commission"})}),(0,n.jsx)(Z,{onSort:r,sort:s,sorting:["rewards-asc","rewards-desc"],children:(0,n.jsx)("div",{className:"text-right",children:"Rewards"})})]}),e.map((e,s)=>(0,n.jsx)(S,{delegation:e,index:s,staking:t,validator:o[e.validatorAddress]},s))]})})(),p&&(()=>{let t=m.items.slice().sort((e,t)=>{switch(i){case"amount-asc":case"amount-desc":return(0,a.B)(Number(e.balance.amount),Number(t.balance.amount),"amount-asc"===i);case"completion-asc":case"completion-desc":return(0,a.B)(e.completionTime,t.completionTime,"completion-asc"===i);default:return 0}});return(0,n.jsxs)("div",{className:w,children:[(0,n.jsxs)("div",{className:I,style:b,children:[(0,n.jsx)("div",{}),(0,n.jsx)(E,{children:"Unstakings"}),(0,n.jsx)(E,{onSort:c,sort:i,sorting:["staked-asc","staked-desc"],children:(0,n.jsx)("div",{className:"text-right",children:"Staked Amount"})}),(0,n.jsx)(E,{children:(0,n.jsx)("div",{className:"text-right",children:"Status"})}),(0,n.jsx)(E,{onSort:c,sort:i,sorting:["date-asc","date-desc"],children:(0,n.jsx)("div",{className:"text-right",children:"Completion Time"})})]}),t.map((t,s)=>(0,n.jsx)(C,{stakingRef:e,unbonding:t,validator:o[t.validator]},s))]})})()]}):null})},42498:function(e,t,s){s.d(t,{I:function(){return l},i:function(){return r}});var n=s(3827);let l=()=>(0,n.jsx)("div",{className:"h-[1px] w-full bg-bg-400"}),r=()=>(0,n.jsx)("div",{className:"h-full w-[1px] bg-bg-400"})},71860:function(e,t,s){s.d(t,{Z:function(){return C}});var n=s(3827),l=s(64090),r=s(30298),i=s(98909),a=s(98245),c=s.n(a),d=s(77658);c().setAppElement(document.body);var o=e=>{let{children:t,...s}=e;return(0,l.useEffect)(()=>{if(s.isOpen){let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}},[s.isOpen]),(0,n.jsx)(c(),{...s,style:{content:{background:"rgba(0,0,0,0.8)",border:"none",borderRadius:"48px",bottom:"auto",boxShadow:"0px 0px 50px 0px #FFFFFF40",left:"50%",padding:"45px",right:"auto",top:"50%",transform:"translate(-50%, -50%)"},overlay:{backgroundColor:"rgba(0, 0, 0, 0.5)"}},children:(0,n.jsxs)("div",{className:"relative w-full",children:[(0,n.jsx)("button",{className:"absolute right-[-16px] top-[-16px] w-[36px] cursor-pointer",dangerouslySetInnerHTML:{__html:d.kC},onClick:s.onRequestClose}),t]})})},u=s(88197),x=s(80469),m=s(62986),h=s(19807);let p=async(e,t)=>{let{client:s,staking:n}=e,{modal:l}=n.state,{delegations:i}=(null==l?void 0:l.content)||{};if(!s||!(null==i?void 0:i.length))return;let a=e.account.bech32Address;i.reduce(async(e,t)=>{await e;let n={delegator:a,validator:t.validatorAddress};await (0,h.YY)(n,s)},Promise.resolve()).then(()=>(0,u.VZ)(a,n)).then(()=>{t("completed")}).catch(()=>{(0,r.Am)("There was an unexpected error claiming your rewards. Please try again later.",{type:"error"})})};var j=(0,l.memo)(()=>{let e=(0,x.n)(),[t,s]=(0,l.useState)("loading"),r=(0,l.useRef)(!1),{staking:a}=e,{modal:c}=a.state,d=(null==c?void 0:c.type)==="rewards";if((0,l.useEffect)(()=>{d&&!r.current&&(r.current=!0,p(e,s))},[d,e]),!d)return null;let u="loading"===t?(0,n.jsxs)("div",{className:"w-full text-center",children:[(0,n.jsx)("div",{className:"mb-[16px] uppercase",children:(0,n.jsx)(i.ls,{children:"CLAIMING"})}),(0,n.jsx)("div",{className:"mb-[16px] text-typo-100",children:"Wait until your rewards are withdrawn."}),(0,n.jsx)(i.zx,{isLoading:!0})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"mb-[16px] uppercase",children:(0,n.jsx)(i.ls,{children:"Success!"})}),(0,n.jsx)("div",{className:"mb-[16px] text-typo-100",children:"You have claimed your staking rewards successfully."})]}),(0,n.jsx)(i.zx,{onClick:()=>{e.staking.dispatch((0,m.ZG)(null))},children:"CLOSE"})]});return(0,n.jsx)(o,{isOpen:d,onRequestClose:()=>{"loading"!==t&&e.staking.dispatch((0,m.ZG)(null))},children:(0,n.jsx)("div",{className:"min-w-[390px]",children:u})})}),f=s(22840),v=s(39730),g=s(66803),N=s(9016),b=s(67497);let y="input";var w=()=>{let e=(0,x.n)(),{client:t}=e,[s,a]=(0,l.useState)(y),[c,d]=(0,l.useState)(!1),[h,p]=(0,l.useState)(""),[j,w]=(0,l.useState)(""),[k,S]=(0,l.useState)({amount:void 0,memo:void 0}),{account:C,staking:Z}=e,{modal:E}=Z.state,I=(null==E?void 0:E.type)==="delegate";if((0,l.useEffect)(()=>()=>{a(y),S({}),p(""),w("")},[I]),!I)return null;let{validator:A}=null==E?void 0:E.content;if(!A)return null;let F=new f.Z(h),O=F.isNaN()?"":F.times(N.Ex),z=Object.values(k).some(e=>!!e),B=(0,v.ap)(Z.state);return(0,n.jsx)(o,{isOpen:I,onRequestClose:()=>{c||e.staking.dispatch((0,m.ZG)(null))},children:(0,n.jsx)("div",{className:"min-w-[390px]",children:(()=>{let l=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"mb-[32px] mt-[32px] flex w-full flex-col items-center justify-center gap-[12px]",children:[(0,n.jsx)(i.Bz,{children:"Staked Amount (XION)"}),(0,n.jsx)(i.XJ,{children:F.toString()}),O&&(0,n.jsxs)(i.Bz,{children:["$",(0,b.HS)(O)]})]}),!!j&&(0,n.jsx)("div",{className:"mb-[32px] text-center italic",children:(0,n.jsx)("div",{children:j})})]});if("completed"===s)return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"mb-[16px]",children:(0,n.jsx)(i.ls,{children:"SUCCESS!"})}),(0,n.jsxs)("div",{className:"text-typo-100",children:["You have successfully staked on"," ",A.description.moniker,". Thank you for contributing in securing the XION network."]})]}),l(),(0,n.jsx)(i.zx,{disabled:c,onClick:()=>{e.staking.dispatch((0,m.ZG)(null))},children:"CLOSE"})]});if("review"===s)return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"mb-[16px]",children:(0,n.jsx)(i.ls,{children:"REVIEW"})}),(0,n.jsxs)("div",{className:"text-typo-100",children:["Get ready to stake your XION token with"," ",A.description.moniker,". Press 'Confirm' to proceed."]})]}),l(),(0,n.jsx)(i.zx,{isLoading:c,onClick:()=>{if(!t)return;d(!0);let e={delegator:C.bech32Address,validator:A.operatorAddress};(0,u._5)(e,(0,g.Jp)(F),j,t,Z).then(e=>(a("completed"),e())).catch(()=>{(0,r.Am)("Staking error",{type:"error"})}).finally(()=>{d(!1)})},children:"CONFIRM"})]});let o=()=>{if(!O||!B||F.isNaN()||F.gt(B))return S({...k,amount:"Invalid amount"}),!0};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"text-center uppercase",children:(0,n.jsxs)(i.ls,{children:["Delegate To ",A.description.moniker]})}),B&&(()=>{let e=B.times(N.Ex);return(0,n.jsxs)("div",{className:"mt-[40px] flex w-full flex-col items-center justify-center gap-[12px] uppercase",children:[(0,n.jsx)(i.Bz,{children:"Available for delegation (XION)"}),(0,n.jsx)(i.XJ,{children:(0,b.HS)(B)}),(0,n.jsxs)(i.Bz,{children:["$",(0,b.HS)(e)]})]})})(),(0,n.jsxs)("div",{className:"mt-[40px] flex w-full flex-row justify-between",children:[(0,n.jsx)("div",{children:"Amount"}),!!O&&(0,n.jsxs)(i.Bz,{children:["= $",(0,b.HS)(O)]})]}),(0,n.jsxs)("form",{onSubmit:e=>{null==e||e.stopPropagation(),null==e||e.preventDefault(),!o()&&(!t||z||F.lt(0)||a("review"))},children:[(0,n.jsxs)("div",{className:"mt-[8px]",children:[(0,n.jsx)(i.Wz,{disabled:c,error:!!k.amount,onBlur:()=>{o()},onChange:e=>{k.amount&&S({...k,amount:void 0}),p(e.target.value)},value:h}),k.amount&&(0,n.jsx)("div",{children:(0,n.jsx)(i.Xq,{children:k.amount})})]}),(0,n.jsx)("div",{className:"mt-[40px] w-full",children:(0,n.jsx)(i.sr,{disabled:c,onChange:e=>{w(e.target.value)},placeholder:"Memo (Optional)",value:j})}),(0,n.jsx)("div",{className:"mt-[48px] w-full",children:(0,n.jsx)(i.zx,{disabled:c||z,type:"submit",children:"DELEGATE NOW"})})]})]})})()})})};let k="input";var S=()=>{let e=(0,x.n)(),{client:t}=e,[s,a]=(0,l.useState)(k),[c,d]=(0,l.useState)(!1),[h,p]=(0,l.useState)({amount:void 0,memo:void 0}),[j,y]=(0,l.useState)(""),[w,S]=(0,l.useState)(""),{account:C,staking:Z}=e,{modal:E}=Z.state,I=(null==E?void 0:E.type)==="undelegate";if((0,l.useEffect)(()=>()=>{a(k),y(""),p({}),S("")},[I]),!I)return null;let{validator:A}=null==E?void 0:E.content;if(!A)return null;let F=new f.Z(j),O=F.isNaN()?"":F.times(N.Ex),z=(0,v.U2)(Z.state,A.operatorAddress),B=()=>{if(!O||!z||F.lte(0)||F.gt(new f.Z(z.amount)))return p({...h,amount:"Invalid amount"}),!0},R=e=>{null==e||e.stopPropagation(),null==e||e.preventDefault(),!B()&&t&&F.gt(0)&&a("review")};return(0,n.jsx)(o,{isOpen:I,onRequestClose:()=>{c||e.staking.dispatch((0,m.ZG)(null))},children:(0,n.jsx)("div",{className:"min-w-[390px]",children:(()=>{let l=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"mb-[32px] mt-[32px] flex w-full flex-col items-center justify-center gap-[12px]",children:[(0,n.jsx)(i.Bz,{children:"Unstaking Amount (XION)"}),(0,n.jsx)(i.XJ,{children:(0,b.HS)(F)}),(0,n.jsx)(i.Bz,{children:(0,b.H_)((0,g.Jp)(F))})]}),!!w&&(0,n.jsx)("div",{className:"mb-[32px] text-center italic",children:(0,n.jsx)("div",{children:w})})]});return"completed"===s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"mb-[16px]",children:(0,n.jsx)(i.ls,{children:"SUCCESS!"})}),(0,n.jsxs)("div",{className:"text-typo-100",children:["You have successfully unstaked from"," ",A.description.moniker,". It takes ",N.Mx," ","days to complete the unstaking process"]})]}),l(),(0,n.jsx)(i.zx,{disabled:c,onClick:()=>{e.staking.dispatch((0,m.ZG)(null))},children:"CLOSE"})]}):"review"===s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"mb-[16px]",children:(0,n.jsx)(i.ls,{children:"REVIEW"})}),(0,n.jsxs)("div",{className:"text-typo-100",children:["Unstaking your XION Token means you'll stop earning rewards. Remember, it takes ",N.Mx," days to complete the unstaking process."]})]}),l(),(0,n.jsx)(i.zx,{isLoading:c,onClick:()=>{if(!t)return;d(!0);let e={delegator:C.bech32Address,validator:A.operatorAddress};(0,u.xu)(e,(0,g.Jp)(F),w,t,Z).then(e=>(a("completed"),e())).catch(()=>{(0,r.Am)("Staking error",{type:"error"})}).finally(()=>{d(!1)})},children:"CONFIRM"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"text-center uppercase",children:(0,n.jsxs)(i.ls,{children:["Unstake From ",A.description.moniker]})}),z&&(()=>{let e=new f.Z(z.amount).times(N.Ex);return(0,n.jsxs)("div",{className:"mt-[40px] flex w-full flex-col items-center justify-center gap-[12px] uppercase",children:[(0,n.jsx)(i.Bz,{children:"Available amount (XION)"}),(0,n.jsx)(i.XJ,{children:(0,b.HS)(new f.Z(z.amount))}),(0,n.jsxs)(i.Bz,{children:["$",(0,b.HS)(e)]})]})})(),(0,n.jsxs)("div",{className:"mt-[40px] flex w-full flex-row justify-between",children:[(0,n.jsx)("div",{children:"Amount"}),!!O&&(0,n.jsxs)(i.Bz,{children:["=$",(0,b.HS)(O)]})]}),(0,n.jsxs)("form",{onSubmit:R,children:[(0,n.jsxs)("div",{className:"mt-[8px]",children:[(0,n.jsx)(i.Wz,{disabled:c,onBlur:()=>{B()},onChange:e=>{h.amount&&p({...h,amount:void 0}),y(e.target.value)},value:j}),h.amount&&(0,n.jsx)("div",{children:(0,n.jsx)(i.Xq,{children:h.amount})})]}),(0,n.jsx)("div",{className:"mt-[40px] w-full",children:(0,n.jsx)(i.sr,{disabled:c,onChange:e=>{S(e.target.value)},placeholder:"Memo (Optional)",value:w})}),(0,n.jsx)("div",{className:"mt-[48px] w-full",children:(0,n.jsx)(i.zx,{disabled:c,type:"submit",children:"Unstake Now"})})]})]})})()})})},C=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(w,{}),(0,n.jsx)(S,{}),(0,n.jsx)(j,{})]})},48074:function(e,t,s){var n=s(3827);t.Z=e=>{let{text:t}=e,[s,l]=t.split(" ");return(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{children:s})," ",(0,n.jsx)("span",{className:"text-typo-200",children:l})]})}},89056:function(e,t,s){s.d(t,{P:function(){return a}});var n=s(64090),l=s(9016);let r={},i={getIdentityLogo:e=>{if(r[e])return r[e];let t=fetch("https://keybase.io/_/api/1.0/user/lookup.json?key_suffix=".concat(e)).then(e=>e.json()).then(e=>{var t,s,n,l;return(null==e?void 0:null===(l=e.them)||void 0===l?void 0:null===(n=l[0])||void 0===n?void 0:null===(s=n.pictures)||void 0===s?void 0:null===(t=s.primary)||void 0===t?void 0:t.url)||null}).catch(()=>null);return r[e]=t,t}},a=e=>{let[t,s]=(0,n.useState)(null);return(0,n.useEffect)(()=>{(async()=>{e&&s(await i.getIdentityLogo(e))})()},[e]),t||l.c1}},67497:function(e,t,s){s.d(t,{Em:function(){return i},HS:function(){return c},H_:function(){return o},PV:function(){return x},gg:function(){return a},i:function(){return d},ts:function(){return u}});var n=s(22840),l=s(66803),r=s(9016);let i=(e,t)=>{let s=(0,l.bI)(e),r=new n.Z(s.amount);if(r.eq(0))return"".concat(r.toFormat()," ").concat(s.denom);if(r.lt(1e-4))return"<".concat(1e-4," ").concat(s.denom);if(t){let e=Intl.NumberFormat("en",{notation:"compact"});return"".concat(e.format(r.toNumber())," ").concat(s.denom)}return"".concat(r.toFormat(4)," ").concat(s.denom)},a=e=>{if("number"!=typeof e||Number.isNaN(e))return null;let t=e<1e-4?"<0.1":(100*e).toFixed(1);return"".concat(t,"%")},c=e=>Intl.NumberFormat("en",{notation:"compact"}).format(e.toNumber()),d=(e,t)=>{let s=new n.Z(e).div(new n.Z(10).pow(18)).toNumber();return"".concat((100*s).toFixed(t),"%")},o=(e,t)=>{let s=(0,l.bI)(e||(0,l.IB)()),i=new n.Z(e?s.amount:0).times(r.Ex);return i.eq(0)?"$0":!t&&i.lt(.01)?"<$0.01":"$".concat(t?c(i):i.toFormat(2))},u=e=>{let t=1e3*e,s=Math.floor((t-Date.now())/864e5),n=new Date(t).toLocaleString("default",{month:"short"}),l=new Date(t).getDate(),r=new Date(t).getFullYear();return"in ".concat(s," day").concat(1===s?"":"s",", ").concat(n," ").concat(l," ").concat(r)},x=e=>e?"".concat(e.times(100).toFixed(2),"%"):"-"}}]); \ No newline at end of file diff --git a/_next/static/chunks/816-cac8172353521c02.js b/_next/static/chunks/816-cac8172353521c02.js deleted file mode 100644 index b485b89..0000000 --- a/_next/static/chunks/816-cac8172353521c02.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[816],{46601:function(){},89214:function(){},42480:function(){},85568:function(){},69386:function(){},31616:function(){},20131:function(){},16026:function(){},33370:function(){},98909:function(t,e,n){"use strict";n.d(e,{Bz:function(){return m},Dx:function(){return g},M5:function(){return b},Mj:function(){return S},OL:function(){return v},Rk:function(){return O},Wz:function(){return y},XJ:function(){return f},Xq:function(){return N},ZP:function(){return x},hp:function(){return w},jr:function(){return h},ls:function(){return p},sr:function(){return _},zx:function(){return A}});var r=n(3827),a=n(20996),i=n(32283),o=n(8792),l=n(64090),s=n(30298),u=n(77658),d=n(6245),c=n(97573);let g=t=>{let{children:e,className:n=""}=t;return(0,r.jsx)("div",{className:["typo-title",n].join(" "),children:e})},p=t=>{let{children:e,className:n=""}=t;return(0,r.jsx)("div",{className:["typo-hero",n].join(" "),children:e})},f=t=>{let{children:e,className:n=""}=t;return(0,r.jsx)("div",{className:["heading2",n].join(" "),children:e})},m=t=>{let{children:e,className:n="",color:a="text-typo-150"}=t;return(0,r.jsx)("div",{className:["heading8",a,n].join(" "),children:e})},h=t=>{let{children:e,className:n=""}=t;return(0,r.jsx)("div",{className:["typo-body-medium",n].join(" "),children:e})},v=t=>{let{children:e,href:n}=t;return(0,r.jsx)(o.default,{className:"text-left font-normal leading-[24px] underline",href:n,children:e})},w=t=>{let{className:e,variant:n,...a}=t;return(0,r.jsx)("button",{...a,className:["cursor-pointer rounded-full bg-bg-550 px-[8px] py-[4px] text-white hover:bg-bg-600 disabled:cursor-not-allowed disabled:bg-bg-600 disabled:text-typo-150","danger"===n?"[&]:text-danger":"",e].join(" ")})},x=t=>{let{className:e,variant:n,...a}=t;return(0,r.jsx)("button",{...a,className:["cursor-pointer rounded-full bg-transparent px-[8px] py-[4px] text-white disabled:cursor-not-allowed disabled:bg-bg-600 disabled:text-typo-150","danger"===n?"[&]:text-danger":"",e].join(" ")})},b=t=>{let{textToCopy:e}=t;return(0,r.jsx)("button",{className:"cursor-pointer",dangerouslySetInnerHTML:{__html:u.BR},onClick:()=>{navigator.clipboard.writeText(e),(0,s.Am)("Copied to clipboard",{type:"info"})}})},y=t=>{let{error:e,...n}=t;return(0,r.jsxs)("span",{className:"relative block",children:[(0,r.jsx)("input",{...n,className:["h-[96px] w-full rounded-[16px] border-[1px] bg-black p-[16px] pr-[140px] text-[48px] focus:outline-none",e?"border-danger":"border-white"].join(" ")}),(0,r.jsx)("span",{className:"absolute bottom-0 right-[12px] top-0 flex h-full items-center text-[48px] text-typo-300",children:"XION"})]})},N=t=>{let{children:e}=t;return(0,r.jsx)("div",{className:"text-danger",children:e})},_=t=>(0,r.jsx)("input",{...t,className:"h-[50px] w-full bg-black py-[8px] focus:outline-none",style:{border:"none",borderBottom:"1px solid white"}}),A=t=>{let{className:e,isLoading:n,variant:a,...i}=t;return(0,r.jsx)("button",{...i,className:["w-full rounded-[8px] px-[12px] py-[16px] text-black disabled:cursor-not-allowed","danger"===a?"text-danger disabled:text-typo-150 bg-[#D745061A]":"success"===a?"bg-success text-black disabled:bg-green-400":"bg-white text-black disabled:bg-bg-400",e||""].join(" "),disabled:n||i.disabled,children:n?(0,r.jsx)("span",{className:"flex items-center justify-center",children:(0,r.jsx)("span",{className:"animate-spin",dangerouslySetInnerHTML:{__html:u._m}})}):i.children})},O=t=>{let{children:e,className:n,id:o,modalClass:s,offset:u,placement:g,Trigger:p}=t,[f,m]=(0,l.useState)(null),{core:h}=(0,d.l)(),v=h.state.popupOpenId===o;return(0,r.jsxs)("div",{className:[n].join(" "),children:[(0,r.jsx)("button",{onClick:t=>{t.stopPropagation(),h.dispatch((0,c.h)(o))},ref:m,children:(0,r.jsx)(p,{id:o})}),v&&(0,r.jsx)(a.d,{onClickAway:()=>{v&&h.dispatch((0,c.h)(null))},children:(0,r.jsx)(i.G,{anchor:f,className:[s].join(" "),offset:u,open:v,placement:g,withTransition:!0,children:e})})]})},S=t=>(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"z-5 absolute bottom-[5px] left-0",children:(0,r.jsx)("div",{dangerouslySetInnerHTML:{__html:u.yC}})}),(0,r.jsx)("input",{...t,className:"border-b-[1px] border-b-transparent bg-transparent pl-[24px] text-white outline-none hover:border-b-white focus:border-b-white"})]})},6245:function(t,e,n){"use strict";n.d(e,{l:function(){return i}});var r=n(64090),a=n(34417);let i=()=>{let t=(0,r.useRef)({}),e=(0,r.useContext)(a._);return t.current.state=e.state,t.current.dispatch=e.dispatch,{core:t.current}}},97573:function(t,e,n){"use strict";n.d(e,{I:function(){return a},h:function(){return r}});let r=t=>({content:t,type:"SET_POPUP_OPEN_ID"}),a=(t,e)=>{switch(e.type){case"SET_POPUP_OPEN_ID":return{...t,popupOpenId:e.content};case"SET_IS_LOADING_BLOCKING":return{...t,isLoadingBlocking:e.content};default:return t}}},34417:function(t,e,n){"use strict";n.d(e,{W:function(){return a},_:function(){return i}});var r=n(64090);let a={isLoadingBlocking:!1,popupOpenId:null},i=(0,r.createContext)({dispatch:()=>null,state:a})},88197:function(t,e,n){"use strict";n.d(e,{sT:function(){return A},wX:function(){return b},VZ:function(){return y},Dr:function(){return S},qp:function(){return O},_5:function(){return N},xu:function(){return _}});var r=n(22840),a=n(71694),i=n(66803);let o=null,l=async t=>o||(o=(await (0,a.C_)()).staking.validators(t).then(t=>(o=null,t))),s={},u=async t=>{let e=s[t];if(e)return e;let n=(await (0,a.C_)()).staking.validator(t).then(e=>(s[t]=void 0,e.validator));return s[t]=n,n},d=null,c=async()=>d||(d=(await (0,a.C_)()).staking.pool().then(t=>(d=null,t.pool))),g=async t=>{let e=await (0,a.N$)();return await e.getBalance(t,"uxion")},p=async t=>{let e=await (0,a.C_)();return await e.staking.delegatorDelegations(t)},f=async t=>{let e=await (0,a.C_)();return await e.staking.delegatorUnbondingDelegations(t)},m=async(t,e)=>{let n=await (0,a.C_)(),o=await n.distribution.delegationRewards(t,e);return(await Promise.all(o.rewards.map(async t=>{if(0==t.denom.indexOf("ibc/")){var e;let r=await n.ibc.transfer.denomTrace(t.denom.substring(4));t.denom=(null===(e=r.denomTrace)||void 0===e?void 0:e.baseDenom)||t.denom}return t}))).filter(t=>{var e;return(null===(e=t.denom)||void 0===e?void 0:e.toUpperCase())==="UXION"}).map(t=>({amount:new r.Z(t.amount).div(new r.Z(10).pow(18)).toString(),denom:t.denom})).map(t=>(0,i.bI)(t))},h=async()=>{let t=await (0,a.C_)(),e=await t.mint.params().catch(()=>null);return(null==e?void 0:e.inflationMax)||.2};var v=n(19807),w=n(62986),x=n(39730);let b=async t=>{try{t.dispatch((0,w.Kv)(!0));let[e,n,r,a,i]=await Promise.all([l("BOND_STATUS_BONDED"),l("BOND_STATUS_UNBONDED"),l("BOND_STATUS_UNBONDING"),h(),c()]);[[e,"bonded"],[n,"unbonded"],[r,"unbonding"]].forEach(e=>{var n,r;let[a,i]=e;t.dispatch((0,w.T2)({items:a.validators,nextKey:(null===(n=a.pagination)||void 0===n?void 0:n.nextKey)||null,total:(null===(r=a.pagination)||void 0===r?void 0:r.total)||null},!0,i))}),t.dispatch((0,w.DD)(i)),t.dispatch((0,w.Km)(a.toString())),t.dispatch((0,w.Kv)(!1))}catch(t){console.error("error fetching staking data:",t)}},y=async(t,e)=>{try{var n,r,a,o;e.dispatch((0,w.Kv)(!0));let[l,s,u]=await Promise.all([g(t),p(t).then(async e=>({items:await Promise.all(e.delegationResponses.map(async e=>({balance:e.balance,rewards:await m(t,e.delegation.validatorAddress).then(t=>(0,i.HJ)(t)),validatorAddress:e.delegation.validatorAddress}))),pagination:e.pagination})),f(t).then(t=>({items:t.unbondingResponses.reduce((t,e)=>(t.push(...e.entries.map(t=>({balance:{amount:t.balance,denom:"uxion"},completionTime:Number(t.completionTime.seconds),completionTimeNanos:t.completionTime.nanos,id:t.unbondingId.toString(),validator:e.validatorAddress}))),t),[]),pagination:t.pagination})).catch(()=>({items:[],pagination:null})).then(t=>({items:t.items,pagination:t.pagination}))]);e.dispatch((0,w.d0)(l)),e.dispatch((0,w.Qx)({items:s.items,nextKey:(null===(n=s.pagination)||void 0===n?void 0:n.nextKey)||null,total:(null===(r=s.pagination)||void 0===r?void 0:r.total)||null},!0)),e.dispatch((0,w.Kg)({items:u.items,nextKey:(null===(a=u.pagination)||void 0===a?void 0:a.nextKey)||null,total:(null===(o=u.pagination)||void 0===o?void 0:o.total)||null},!0)),e.dispatch((0,w.Kv)(!1))}catch(t){console.error("error fetching staking data:",t)}},N=async(t,e,n,r,a)=>(await (0,v.H0)(t,r,e,n),async()=>{await y(t.delegator,a)}),_=async(t,e,n,r,a)=>(await (0,v.vZ)(t,r,e,n),async()=>{await y(t.delegator,a)}),A=async(t,e,n)=>{await (0,v.YY)(t,e),await y(t.delegator,n)},O=async(t,e)=>{var n;if((null===(n=e.state.validatorDetails)||void 0===n?void 0:n.operatorAddress)===t)return e.state.validatorDetails;let r=(0,x.mM)(e.state)[t]||await u(t);return e.dispatch((0,w.gT)(r)),r},S=async(t,e)=>{let n=(0,x.mM)(e.state)[t];if(n)return n;let r=await u(t);return e.dispatch((0,w.N7)({[t]:r,...e.state.extraValidators})),r}},80469:function(t,e,n){"use strict";let r;n.d(e,{f:function(){return d},n:function(){return u}});var a=n(75615),i=n(64090),o=n(88197),l=n(62986),s=n(544);let u=()=>{let t=(0,i.useRef)({}),e=(0,i.useContext)(s.Y);t.current.state=e.state,t.current.dispatch=e.dispatch;let{data:n,isConnected:o}=(0,a.hT)(),l=null==n?void 0:n.bech32Address;return{account:n,address:l,client:o?r:void 0,isConnected:o,staking:t.current}},d=()=>{let{client:t}=(0,a.Hj)(),{address:e,isConnected:n,staking:s}=u();r=n?t:void 0,(0,i.useEffect)(()=>{(0,o.wX)(s)},[s]),(0,i.useEffect)(()=>{if(n&&e)return(0,o.VZ)(e,s),()=>{s.dispatch((0,l.kS)())}},[n,e,s])}},62986:function(t,e,n){"use strict";n.d(e,{DD:function(){return u},I6:function(){return v},Kg:function(){return l},Km:function(){return g},Kv:function(){return a},N7:function(){return p},Qx:function(){return o},T2:function(){return i},ZG:function(){return c},d0:function(){return r},gT:function(){return s},kS:function(){return d}});let r=t=>({content:t,type:"SET_TOKENS"}),a=t=>({content:t,type:"SET_IS_INFO_LOADING"}),i=(t,e,n)=>({content:t,reset:e,status:n,type:"ADD_VALIDATORS"}),o=(t,e)=>({content:t,reset:e,type:"ADD_DELEGATIONS"}),l=(t,e)=>({content:t,reset:e,type:"ADD_UNBONDINGS"}),s=t=>({content:t,type:"SET_VALIDATOR_DETAILS"}),u=t=>({content:t,type:"SET_POOL"}),d=()=>({content:null,type:"LOGOUT"}),c=t=>({content:t,type:"SET_MODAL"}),g=t=>({content:t,type:"SET_INFLATION"}),p=t=>({content:t,type:"SET_EXTRA_VALIDATORS"}),f=t=>{let e=new Set;return t.filter(t=>!e.has(t.operatorAddress)&&(e.add(t.operatorAddress),!0))},m=t=>{let e=new Set;return t.filter(t=>!e.has(t.validatorAddress)&&(e.add(t.validatorAddress),!0))},h=t=>{let e=new Set;return t.filter(t=>{let n=t.id;return!e.has(n)&&(e.add(n),!0)})},v=(t,e)=>{switch(e.type){case"SET_TOKENS":return{...t,tokens:e.content};case"ADD_VALIDATORS":{let n=!e.reset&&t.validators[e.status]||{items:[],nextKey:null,total:null};return n.total=e.content.total,n.nextKey=e.content.nextKey,n.items=f(n.items.concat(e.content.items)),{...t,validators:{...t.validators,[e.status]:n}}}case"ADD_DELEGATIONS":{let n=!e.reset&&t.delegations||{items:[],nextKey:null,total:null};return n.total=e.content.total,n.nextKey=e.content.nextKey,n.items=m(e.content.items.concat(n.items)),{...t,delegations:n}}case"ADD_UNBONDINGS":{let n=!e.reset&&t.unbondings||{items:[],nextKey:null,total:null};return n.total=e.content.total,n.nextKey=e.content.nextKey,n.items=h(e.content.items.concat(n.items)),{...t,unbondings:n}}case"SET_IS_INFO_LOADING":return{...t,isInfoLoading:e.content};case"SET_VALIDATOR_DETAILS":return{...t,validatorDetails:e.content};case"SET_POOL":return{...t,pool:e.content};case"SET_MODAL":return{...t,modal:e.content};case"LOGOUT":return{...t,delegations:null,unbondings:null};case"SET_EXTRA_VALIDATORS":return{...t,extraValidators:e.content};case"SET_INFLATION":return{...t,inflation:e.content};default:return t}}},39730:function(t,e,n){"use strict";n.d(e,{Cn:function(){return l},Sg:function(){return d},U2:function(){return i},ap:function(){return s},jc:function(){return g},jv:function(){return o},mM:function(){return c},zq:function(){return u}});var r=n(22840),a=n(66803);let i=(t,e)=>{let{delegations:n}=t;if(!(null==n?void 0:n.items.length))return null;let r=n.items.filter(t=>!e||t.validatorAddress===e).map(t=>t.balance);return(0,a.HJ)(r)},o=(t,e)=>{let{unbondings:n}=t;if(!(null==n?void 0:n.items.length))return null;let r=n.items.filter(t=>!e||t.validator===e).map(t=>t.balance);return(0,a.HJ)(r)},l=(t,e)=>{let{delegations:n}=e;if(!(null==n?void 0:n.items.length))return null;let r=n.items.filter(e=>!t||e.validatorAddress===t).map(t=>t.rewards);return(0,a.HJ)(r)},s=t=>{let{tokens:e}=t;return e?new r.Z((0,a.bI)(e).amount):null},u=(t,e)=>{var n;return!!(null===(n=e.delegations)||void 0===n?void 0:n.items.some(e=>e.validatorAddress===t))},d=(t,e)=>{let{pool:n}=e;return t&&"string"==typeof(null==n?void 0:n.bondedTokens)?new r.Z(t).div(new r.Z(n.bondedTokens)).toNumber():null},c=t=>Object.values(t.validators).map(t=>null==t?void 0:t.items).flat().reduce((t,e)=>e?{...t,[e.operatorAddress]:e}:t,t.extraValidators),g=t=>t.inflation?new r.Z(t.inflation):null},544:function(t,e,n){"use strict";n.d(e,{W:function(){return a},Y:function(){return i}});var r=n(64090);let a={delegations:null,extraValidators:{},inflation:null,isInfoLoading:!1,modal:null,pool:null,tokens:null,unbondings:null,validatorDetails:null,validators:{bonded:null,unbonded:null,unbonding:null}},i=(0,r.createContext)({dispatch:()=>null,state:a})},71694:function(t,e,n){"use strict";let r,a;n.d(e,{C_:function(){return u},N$:function(){return d},v4:function(){return c}});var i=n(18722),o=n(58015),l=n(43890),s=n(9016);let u=()=>(r||(r=(async()=>{let t=await l.Tendermint34Client.connect(s.Od);return o.QueryClient.withExtensions(t,o.setupStakingExtension,o.setupDistributionExtension,o.setupMintExtension,o.setupIbcExtension)})()),r),d=()=>(a||(a=(async()=>await o.StargateClient.connect(s.Od))()),a),c=async()=>{let t=localStorage.getItem("xion-authz-temp-account");if(!t)return;let e=await i.DirectSecp256k1HdWallet.deserialize(t,"abstraxion"),n=await e.getAccounts().then(t=>{var e;return null===(e=t[0])||void 0===e?void 0:e.address});return{client:await o.SigningStargateClient.connectWithSigner(s.Od,e),granteeAddress:n}}},66803:function(t,e,n){"use strict";n.d(e,{HJ:function(){return d},IB:function(){return i},Jp:function(){return o},UO:function(){return l},bI:function(){return a},bP:function(){return u},kw:function(){return s}});var r=n(22840);let a=t=>{var e,n,a;return(null===(e=t.denom)||void 0===e?void 0:e.toUpperCase())==="UXION"?{amount:new r.Z(t.amount).div(new r.Z(10).pow(6)).toString(),denom:"XION"}:(null===(n=t.denom)||void 0===n?void 0:n.toUpperCase())==="XION"?{amount:t.amount,denom:"XION"}:{...t,denom:null===(a=t.denom)||void 0===a?void 0:a.toUpperCase()}},i=()=>({amount:"0",denom:"XION"}),o=t=>({amount:t.toString(),denom:"XION"}),l=t=>t&&new r.Z(t.amount).gt(0),s=t=>({amount:t.div(new r.Z(10).pow(6)).toString(),denom:"XION"}),u=t=>({amount:t.times(new r.Z(10).pow(6)).toString(),denom:"UXION"}),d=t=>t.reduce((t,e)=>({amount:new r.Z(t.amount).plus(a(e).amount).toString(),denom:t.denom}),i())},9016:function(t,e,n){"use strict";n.d(e,{Ex:function(){return l},Jg:function(){return r},Mx:function(){return u},Od:function(){return i},T$:function(){return a},_H:function(){return d},c1:function(){return s},sb:function(){return o}});let r=!0,a=void 0,i="https://rpc.xion-testnet.forbole.com",o="/xion-staking",l=10,s="".concat(o,"/default-avatar.svg"),u=r?3:21,d=1e-4},77658:function(t,e,n){"use strict";n.d(e,{BR:function(){return a},GI:function(){return s},Sf:function(){return r},_m:function(){return u},cx:function(){return l},gU:function(){return i},kC:function(){return o},yC:function(){return d}});let r='',a='',i='',o='',l='',s='',u='',d=''},19807:function(t,e,n){"use strict";n.d(e,{rf:function(){return b},YY:function(){return w},sj:function(){return x},H0:function(){return h},vZ:function(){return v}});var r=n(22840),a=n(53856),i=n(62884),o=n(66803),l=n(9016),s=n(97481),u=n(71694);let d=async(t,e)=>{let{client:n,granteeAddress:r}=await (0,u.v4)()||{};if(!n||!r)return null;let a=[{typeUrl:"/cosmos.authz.v1beta1.MsgExec",value:s.MsgExec.fromPartial({grantee:r,msgs:t.map(t=>n.registry.encodeAsAny(t))})}];return await n.simulate(r,a,e).then(t=>Math.ceil(2*t).toString()).catch(t=>(console.log("debug: core/base.ts: Estimate error",t),null))},c=async t=>{let{address:e,amount:n=[{amount:"1000",denom:"uxion"}],gasLimit:r="400000",memo:a="",msgs:i}=t;return{amount:n,gas:await d(i,a).catch(()=>null)||r,granter:e}},g=t=>({amount:t.amount,denom:["UXION","XION"].includes(t.denom.toUpperCase())?t.denom.toLowerCase():t.denom}),p=t=>{if("UXION"===t.denom.toUpperCase())return g(t);if("XION"===t.denom.toUpperCase())return g((0,o.bP)(new r.Z(t.amount)));throw Error("Invalid coin denom")},f=t=>e=>{if(console.log("debug: base.ts: result",e),!e.events.find(e=>e.type===t))throw console.error(e),Error("Out of gas");return e},m=t=>{throw console.error(t),t},h=async(t,e,n,r)=>{let a=p(n),o={typeUrl:"/cosmos.staking.v1beta1.MsgDelegate",value:i.MsgDelegate.fromPartial({amount:a,delegatorAddress:t.delegator,validatorAddress:t.validator})},l=await c({address:t.delegator,memo:r,msgs:[o]});return await e.signAndBroadcast(t.delegator,[o],l,r).then(f("delegate")).catch(m)},v=async(t,e,n,r)=>{let a=p(n),o={typeUrl:"/cosmos.staking.v1beta1.MsgUndelegate",value:i.MsgUndelegate.fromPartial({amount:a,delegatorAddress:t.delegator,validatorAddress:t.validator})},l=await c({address:t.delegator,memo:r,msgs:[o]});return await e.signAndBroadcast(t.delegator,[o],l,r).then(f("unbond")).catch(m)},w=async(t,e)=>{let n=[{typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",value:a.MsgWithdrawDelegatorReward.fromPartial({delegatorAddress:t.delegator})}],r=await c({address:t.delegator,msgs:n});return await e.signAndBroadcast(t.delegator,n,r).then(f("withdraw_rewards")).catch(m)},x=t=>{let e=(0,o.bI)(t);return new r.Z(e.amount).gte(l._H)},b=async(t,e)=>{let n={typeUrl:"/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation",value:i.MsgCancelUnbondingDelegation.fromPartial({delegatorAddress:t.delegator,validatorAddress:t.validator})},r=await c({address:t.delegator,msgs:[n]});return await e.signAndBroadcast(t.delegator,[n],r,"").then(t=>(console.log("debug: tx.ts: cancelUnstake: result",t),t)).catch(m)}}}]); \ No newline at end of file diff --git a/_next/static/chunks/816-f354d55c4d7354c5.js b/_next/static/chunks/816-f354d55c4d7354c5.js new file mode 100644 index 0000000..a5b6ee4 --- /dev/null +++ b/_next/static/chunks/816-f354d55c4d7354c5.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[816],{46601:function(){},89214:function(){},42480:function(){},85568:function(){},69386:function(){},31616:function(){},20131:function(){},16026:function(){},33370:function(){},98909:function(t,e,n){"use strict";n.d(e,{Bz:function(){return m},Dx:function(){return g},M5:function(){return b},Mj:function(){return S},OL:function(){return v},Rk:function(){return O},Wz:function(){return y},XJ:function(){return f},Xq:function(){return N},ZP:function(){return x},hp:function(){return w},jr:function(){return h},ls:function(){return p},sr:function(){return _},zx:function(){return A}});var r=n(3827),a=n(20996),i=n(32283),o=n(8792),l=n(64090),s=n(30298),u=n(77658),d=n(6245),c=n(97573);let g=t=>{let{children:e,className:n=""}=t;return(0,r.jsx)("div",{className:["typo-title",n].join(" "),children:e})},p=t=>{let{children:e,className:n=""}=t;return(0,r.jsx)("div",{className:["typo-hero",n].join(" "),children:e})},f=t=>{let{children:e,className:n=""}=t;return(0,r.jsx)("div",{className:["heading2",n].join(" "),children:e})},m=t=>{let{children:e,className:n="",color:a="text-typo-150"}=t;return(0,r.jsx)("div",{className:["heading8",a,n].join(" "),children:e})},h=t=>{let{children:e,className:n=""}=t;return(0,r.jsx)("div",{className:["typo-body-medium",n].join(" "),children:e})},v=t=>{let{children:e,href:n}=t;return(0,r.jsx)(o.default,{className:"text-left font-normal leading-[24px] underline",href:n,children:e})},w=t=>{let{className:e,variant:n,...a}=t;return(0,r.jsx)("button",{...a,className:["cursor-pointer rounded-full bg-bg-550 px-[8px] py-[4px] text-white hover:bg-bg-600 disabled:cursor-not-allowed disabled:bg-bg-600 disabled:text-typo-150","danger"===n?"[&]:text-danger":"",e].join(" ")})},x=t=>{let{className:e,variant:n,...a}=t;return(0,r.jsx)("button",{...a,className:["cursor-pointer rounded-full bg-transparent px-[8px] py-[4px] text-white disabled:cursor-not-allowed disabled:bg-bg-600 disabled:text-typo-150","danger"===n?"[&]:text-danger":"",e].join(" ")})},b=t=>{let{textToCopy:e}=t;return(0,r.jsx)("button",{className:"cursor-pointer",dangerouslySetInnerHTML:{__html:u.BR},onClick:()=>{navigator.clipboard.writeText(e),(0,s.Am)("Copied to clipboard",{type:"info"})}})},y=t=>{let{error:e,...n}=t;return(0,r.jsxs)("span",{className:"relative block",children:[(0,r.jsx)("input",{...n,className:["h-[96px] w-full rounded-[16px] border-[1px] bg-black p-[16px] pr-[140px] text-[48px] focus:outline-none",e?"border-danger":"border-white"].join(" ")}),(0,r.jsx)("span",{className:"absolute bottom-0 right-[12px] top-0 flex h-full items-center text-[48px] text-typo-300",children:"XION"})]})},N=t=>{let{children:e}=t;return(0,r.jsx)("div",{className:"text-danger",children:e})},_=t=>(0,r.jsx)("input",{...t,className:"h-[50px] w-full bg-black py-[8px] focus:outline-none",style:{border:"none",borderBottom:"1px solid white"}}),A=t=>{let{className:e,isLoading:n,variant:a,...i}=t;return(0,r.jsx)("button",{...i,className:["w-full rounded-[8px] px-[12px] py-[16px] text-black disabled:cursor-not-allowed","danger"===a?"text-danger disabled:text-typo-150 bg-[#D745061A]":"success"===a?"bg-success text-black disabled:bg-green-400":"bg-white text-black disabled:bg-bg-400",e||""].join(" "),disabled:n||i.disabled,children:n?(0,r.jsx)("span",{className:"flex items-center justify-center",children:(0,r.jsx)("span",{className:"animate-spin",dangerouslySetInnerHTML:{__html:u._m}})}):i.children})},O=t=>{let{children:e,className:n,id:o,modalClass:s,offset:u,placement:g,Trigger:p}=t,[f,m]=(0,l.useState)(null),{core:h}=(0,d.l)(),v=h.state.popupOpenId===o;return(0,r.jsxs)("div",{className:[n].join(" "),children:[(0,r.jsx)("button",{onClick:t=>{t.stopPropagation(),h.dispatch((0,c.h)(o))},ref:m,children:(0,r.jsx)(p,{id:o})}),v&&(0,r.jsx)(a.d,{onClickAway:()=>{v&&h.dispatch((0,c.h)(null))},children:(0,r.jsx)(i.G,{anchor:f,className:[s].join(" "),offset:u,open:v,placement:g,withTransition:!0,children:e})})]})},S=t=>(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"z-5 absolute bottom-[5px] left-0",children:(0,r.jsx)("div",{dangerouslySetInnerHTML:{__html:u.yC}})}),(0,r.jsx)("input",{...t,className:"border-b-[1px] border-b-transparent bg-transparent pl-[24px] text-white outline-none hover:border-b-white focus:border-b-white"})]})},6245:function(t,e,n){"use strict";n.d(e,{l:function(){return i}});var r=n(64090),a=n(34417);let i=()=>{let t=(0,r.useRef)({}),e=(0,r.useContext)(a._);return t.current.state=e.state,t.current.dispatch=e.dispatch,{core:t.current}}},97573:function(t,e,n){"use strict";n.d(e,{I:function(){return a},h:function(){return r}});let r=t=>({content:t,type:"SET_POPUP_OPEN_ID"}),a=(t,e)=>{switch(e.type){case"SET_POPUP_OPEN_ID":return{...t,popupOpenId:e.content};case"SET_IS_LOADING_BLOCKING":return{...t,isLoadingBlocking:e.content};default:return t}}},34417:function(t,e,n){"use strict";n.d(e,{W:function(){return a},_:function(){return i}});var r=n(64090);let a={isLoadingBlocking:!1,popupOpenId:null},i=(0,r.createContext)({dispatch:()=>null,state:a})},88197:function(t,e,n){"use strict";n.d(e,{wX:function(){return b},VZ:function(){return y},Dr:function(){return O},qp:function(){return A},_5:function(){return N},xu:function(){return _}});var r=n(22840),a=n(71694),i=n(66803);let o=null,l=async t=>o||(o=(await (0,a.C_)()).staking.validators(t).then(t=>(o=null,t))),s={},u=async t=>{let e=s[t];if(e)return e;let n=(await (0,a.C_)()).staking.validator(t).then(e=>(s[t]=void 0,e.validator));return s[t]=n,n},d=null,c=async()=>d||(d=(await (0,a.C_)()).staking.pool().then(t=>(d=null,t.pool))),g=async t=>{let e=await (0,a.N$)();return await e.getBalance(t,"uxion")},p=async t=>{let e=await (0,a.C_)();return await e.staking.delegatorDelegations(t)},f=async t=>{let e=await (0,a.C_)();return await e.staking.delegatorUnbondingDelegations(t)},m=async(t,e)=>{let n=await (0,a.C_)(),o=await n.distribution.delegationRewards(t,e);return(await Promise.all(o.rewards.map(async t=>{if(0==t.denom.indexOf("ibc/")){var e;let r=await n.ibc.transfer.denomTrace(t.denom.substring(4));t.denom=(null===(e=r.denomTrace)||void 0===e?void 0:e.baseDenom)||t.denom}return t}))).filter(t=>{var e;return(null===(e=t.denom)||void 0===e?void 0:e.toUpperCase())==="UXION"}).map(t=>({amount:new r.Z(t.amount).div(new r.Z(10).pow(18)).toString(),denom:t.denom})).map(t=>(0,i.bI)(t))},h=async()=>{let t=await (0,a.C_)(),e=await t.mint.params().catch(()=>null);return(null==e?void 0:e.inflationMax)||.2};var v=n(19807),w=n(62986),x=n(39730);let b=async t=>{try{t.dispatch((0,w.Kv)(!0));let[e,n,r,a,i]=await Promise.all([l("BOND_STATUS_BONDED"),l("BOND_STATUS_UNBONDED"),l("BOND_STATUS_UNBONDING"),h(),c()]);[[e,"bonded"],[n,"unbonded"],[r,"unbonding"]].forEach(e=>{var n,r;let[a,i]=e;t.dispatch((0,w.T2)({items:a.validators,nextKey:(null===(n=a.pagination)||void 0===n?void 0:n.nextKey)||null,total:(null===(r=a.pagination)||void 0===r?void 0:r.total)||null},!0,i))}),t.dispatch((0,w.DD)(i)),t.dispatch((0,w.Km)(a.toString())),t.dispatch((0,w.Kv)(!1))}catch(t){console.error("error fetching staking data:",t)}},y=async(t,e)=>{try{var n,r,a,o;e.dispatch((0,w.Kv)(!0));let[l,s,u]=await Promise.all([g(t),p(t).then(async e=>({items:await Promise.all(e.delegationResponses.map(async e=>({balance:e.balance,rewards:await m(t,e.delegation.validatorAddress).then(t=>(0,i.HJ)(t)),validatorAddress:e.delegation.validatorAddress}))),pagination:e.pagination})),f(t).then(t=>({items:t.unbondingResponses.reduce((t,e)=>(t.push(...e.entries.map(t=>({balance:{amount:t.balance,denom:"uxion"},completionTime:Number(t.completionTime.seconds),completionTimeNanos:t.completionTime.nanos,id:t.unbondingId.toString(),validator:e.validatorAddress}))),t),[]),pagination:t.pagination})).catch(()=>({items:[],pagination:null})).then(t=>({items:t.items,pagination:t.pagination}))]);e.dispatch((0,w.d0)(l)),e.dispatch((0,w.Qx)({items:s.items,nextKey:(null===(n=s.pagination)||void 0===n?void 0:n.nextKey)||null,total:(null===(r=s.pagination)||void 0===r?void 0:r.total)||null},!0)),e.dispatch((0,w.Kg)({items:u.items,nextKey:(null===(a=u.pagination)||void 0===a?void 0:a.nextKey)||null,total:(null===(o=u.pagination)||void 0===o?void 0:o.total)||null},!0)),e.dispatch((0,w.Kv)(!1))}catch(t){console.error("error fetching staking data:",t)}},N=async(t,e,n,r,a)=>(await (0,v.H0)(t,r,e,n),async()=>{await y(t.delegator,a)}),_=async(t,e,n,r,a)=>(await (0,v.vZ)(t,r,e,n),async()=>{await y(t.delegator,a)}),A=async(t,e)=>{var n;if((null===(n=e.state.validatorDetails)||void 0===n?void 0:n.operatorAddress)===t)return e.state.validatorDetails;let r=(0,x.mM)(e.state)[t]||await u(t);return e.dispatch((0,w.gT)(r)),r},O=async(t,e)=>{let n=(0,x.mM)(e.state)[t];if(n)return n;let r=await u(t);return e.dispatch((0,w.N7)({[t]:r,...e.state.extraValidators})),r}},80469:function(t,e,n){"use strict";let r;n.d(e,{f:function(){return d},n:function(){return u}});var a=n(75615),i=n(64090),o=n(88197),l=n(62986),s=n(544);let u=()=>{let t=(0,i.useRef)({}),e=(0,i.useContext)(s.Y);t.current.state=e.state,t.current.dispatch=e.dispatch;let{data:n,isConnected:o}=(0,a.hT)(),l=null==n?void 0:n.bech32Address;return{account:n,address:l,client:o?r:void 0,isConnected:o,staking:t.current}},d=()=>{let{client:t}=(0,a.Hj)(),{address:e,isConnected:n,staking:s}=u();r=n?t:void 0,(0,i.useEffect)(()=>{(0,o.wX)(s)},[s]),(0,i.useEffect)(()=>{if(n&&e)return(0,o.VZ)(e,s),()=>{s.dispatch((0,l.kS)())}},[n,e,s])}},62986:function(t,e,n){"use strict";n.d(e,{DD:function(){return u},I6:function(){return v},Kg:function(){return l},Km:function(){return g},Kv:function(){return a},N7:function(){return p},Qx:function(){return o},T2:function(){return i},ZG:function(){return c},d0:function(){return r},gT:function(){return s},kS:function(){return d}});let r=t=>({content:t,type:"SET_TOKENS"}),a=t=>({content:t,type:"SET_IS_INFO_LOADING"}),i=(t,e,n)=>({content:t,reset:e,status:n,type:"ADD_VALIDATORS"}),o=(t,e)=>({content:t,reset:e,type:"ADD_DELEGATIONS"}),l=(t,e)=>({content:t,reset:e,type:"ADD_UNBONDINGS"}),s=t=>({content:t,type:"SET_VALIDATOR_DETAILS"}),u=t=>({content:t,type:"SET_POOL"}),d=()=>({content:null,type:"LOGOUT"}),c=t=>({content:t,type:"SET_MODAL"}),g=t=>({content:t,type:"SET_INFLATION"}),p=t=>({content:t,type:"SET_EXTRA_VALIDATORS"}),f=t=>{let e=new Set;return t.filter(t=>!e.has(t.operatorAddress)&&(e.add(t.operatorAddress),!0))},m=t=>{let e=new Set;return t.filter(t=>!e.has(t.validatorAddress)&&(e.add(t.validatorAddress),!0))},h=t=>{let e=new Set;return t.filter(t=>{let n=t.id;return!e.has(n)&&(e.add(n),!0)})},v=(t,e)=>{switch(e.type){case"SET_TOKENS":return{...t,tokens:e.content};case"ADD_VALIDATORS":{let n=!e.reset&&t.validators[e.status]||{items:[],nextKey:null,total:null};return n.total=e.content.total,n.nextKey=e.content.nextKey,n.items=f(n.items.concat(e.content.items)),{...t,validators:{...t.validators,[e.status]:n}}}case"ADD_DELEGATIONS":{let n=!e.reset&&t.delegations||{items:[],nextKey:null,total:null};return n.total=e.content.total,n.nextKey=e.content.nextKey,n.items=m(e.content.items.concat(n.items)),{...t,delegations:n}}case"ADD_UNBONDINGS":{let n=!e.reset&&t.unbondings||{items:[],nextKey:null,total:null};return n.total=e.content.total,n.nextKey=e.content.nextKey,n.items=h(e.content.items.concat(n.items)),{...t,unbondings:n}}case"SET_IS_INFO_LOADING":return{...t,isInfoLoading:e.content};case"SET_VALIDATOR_DETAILS":return{...t,validatorDetails:e.content};case"SET_POOL":return{...t,pool:e.content};case"SET_MODAL":return{...t,modal:e.content};case"LOGOUT":return{...t,delegations:null,unbondings:null};case"SET_EXTRA_VALIDATORS":return{...t,extraValidators:e.content};case"SET_INFLATION":return{...t,inflation:e.content};default:return t}}},39730:function(t,e,n){"use strict";n.d(e,{Cn:function(){return l},Sg:function(){return d},U2:function(){return i},ap:function(){return s},jc:function(){return g},jv:function(){return o},mM:function(){return c},zq:function(){return u}});var r=n(22840),a=n(66803);let i=(t,e)=>{let{delegations:n}=t;if(!(null==n?void 0:n.items.length))return null;let r=n.items.filter(t=>!e||t.validatorAddress===e).map(t=>t.balance);return(0,a.HJ)(r)},o=(t,e)=>{let{unbondings:n}=t;if(!(null==n?void 0:n.items.length))return null;let r=n.items.filter(t=>!e||t.validator===e).map(t=>t.balance);return(0,a.HJ)(r)},l=(t,e)=>{let{delegations:n}=e;if(!(null==n?void 0:n.items.length))return null;let r=n.items.filter(e=>!t||e.validatorAddress===t).map(t=>t.rewards);return(0,a.HJ)(r)},s=t=>{let{tokens:e}=t;return e?new r.Z((0,a.bI)(e).amount):null},u=(t,e)=>{var n;return!!(null===(n=e.delegations)||void 0===n?void 0:n.items.some(e=>e.validatorAddress===t))},d=(t,e)=>{let{pool:n}=e;return t&&"string"==typeof(null==n?void 0:n.bondedTokens)?new r.Z(t).div(new r.Z(n.bondedTokens)).toNumber():null},c=t=>Object.values(t.validators).map(t=>null==t?void 0:t.items).flat().reduce((t,e)=>e?{...t,[e.operatorAddress]:e}:t,t.extraValidators),g=t=>t.inflation?new r.Z(t.inflation):null},544:function(t,e,n){"use strict";n.d(e,{W:function(){return a},Y:function(){return i}});var r=n(64090);let a={delegations:null,extraValidators:{},inflation:null,isInfoLoading:!1,modal:null,pool:null,tokens:null,unbondings:null,validatorDetails:null,validators:{bonded:null,unbonded:null,unbonding:null}},i=(0,r.createContext)({dispatch:()=>null,state:a})},71694:function(t,e,n){"use strict";let r,a;n.d(e,{C_:function(){return u},N$:function(){return d},v4:function(){return c}});var i=n(18722),o=n(58015),l=n(43890),s=n(9016);let u=()=>(r||(r=(async()=>{let t=await l.Tendermint34Client.connect(s.Od);return o.QueryClient.withExtensions(t,o.setupStakingExtension,o.setupDistributionExtension,o.setupMintExtension,o.setupIbcExtension)})()),r),d=()=>(a||(a=(async()=>await o.StargateClient.connect(s.Od))()),a),c=async()=>{let t=localStorage.getItem("xion-authz-temp-account");if(!t)return;let e=await i.DirectSecp256k1HdWallet.deserialize(t,"abstraxion"),n=await e.getAccounts().then(t=>{var e;return null===(e=t[0])||void 0===e?void 0:e.address});return{client:await o.SigningStargateClient.connectWithSigner(s.Od,e),granteeAddress:n}}},66803:function(t,e,n){"use strict";n.d(e,{HJ:function(){return d},IB:function(){return i},Jp:function(){return o},UO:function(){return l},bI:function(){return a},bP:function(){return u},kw:function(){return s}});var r=n(22840);let a=t=>{var e,n,a;return(null===(e=t.denom)||void 0===e?void 0:e.toUpperCase())==="UXION"?{amount:new r.Z(t.amount).div(new r.Z(10).pow(6)).toString(),denom:"XION"}:(null===(n=t.denom)||void 0===n?void 0:n.toUpperCase())==="XION"?{amount:t.amount,denom:"XION"}:{...t,denom:null===(a=t.denom)||void 0===a?void 0:a.toUpperCase()}},i=()=>({amount:"0",denom:"XION"}),o=t=>({amount:t.toString(),denom:"XION"}),l=t=>t&&new r.Z(t.amount).gt(0),s=t=>({amount:t.div(new r.Z(10).pow(6)).toString(),denom:"XION"}),u=t=>({amount:t.times(new r.Z(10).pow(6)).toString(),denom:"UXION"}),d=t=>t.reduce((t,e)=>({amount:new r.Z(t.amount).plus(a(e).amount).toString(),denom:t.denom}),i())},9016:function(t,e,n){"use strict";n.d(e,{Ex:function(){return l},Jg:function(){return r},Mx:function(){return u},Od:function(){return i},T$:function(){return a},_H:function(){return d},c1:function(){return s},sb:function(){return o}});let r=!0,a=void 0,i="https://rpc.xion-testnet.forbole.com",o="/xion-staking",l=10,s="".concat(o,"/default-avatar.svg"),u=r?3:21,d=1e-4},77658:function(t,e,n){"use strict";n.d(e,{BR:function(){return a},GI:function(){return s},Sf:function(){return r},_m:function(){return u},cx:function(){return l},gU:function(){return i},kC:function(){return o},yC:function(){return d}});let r='',a='',i='',o='',l='',s='',u='',d=''},19807:function(t,e,n){"use strict";n.d(e,{rf:function(){return b},YY:function(){return w},sj:function(){return x},H0:function(){return h},vZ:function(){return v}});var r=n(22840),a=n(53856),i=n(62884),o=n(66803),l=n(9016),s=n(97481),u=n(71694);let d=async(t,e)=>{let{client:n,granteeAddress:r}=await (0,u.v4)()||{};if(!n||!r)return null;let a=[{typeUrl:"/cosmos.authz.v1beta1.MsgExec",value:s.MsgExec.fromPartial({grantee:r,msgs:t.map(t=>n.registry.encodeAsAny(t))})}];return await n.simulate(r,a,e).then(t=>Math.ceil(2*t).toString()).catch(t=>(console.log("debug: core/base.ts: Estimate error",t),null))},c=async t=>{let{address:e,amount:n=[{amount:"1000",denom:"uxion"}],gasLimit:r="400000",memo:a="",msgs:i}=t;return{amount:n,gas:await d(i,a).catch(()=>null)||r,granter:e}},g=t=>({amount:t.amount,denom:["UXION","XION"].includes(t.denom.toUpperCase())?t.denom.toLowerCase():t.denom}),p=t=>{if("UXION"===t.denom.toUpperCase())return g(t);if("XION"===t.denom.toUpperCase())return g((0,o.bP)(new r.Z(t.amount)));throw Error("Invalid coin denom")},f=t=>e=>{if(console.log("debug: base.ts: result",e),!e.events.find(e=>e.type===t))throw console.error(e),Error("Out of gas");return e},m=t=>{throw console.error(t),t},h=async(t,e,n,r)=>{let a=p(n),o={typeUrl:"/cosmos.staking.v1beta1.MsgDelegate",value:i.MsgDelegate.fromPartial({amount:a,delegatorAddress:t.delegator,validatorAddress:t.validator})},l=await c({address:t.delegator,memo:r,msgs:[o]});return await e.signAndBroadcast(t.delegator,[o],l,r).then(f("delegate")).catch(m)},v=async(t,e,n,r)=>{let a=p(n),o={typeUrl:"/cosmos.staking.v1beta1.MsgUndelegate",value:i.MsgUndelegate.fromPartial({amount:a,delegatorAddress:t.delegator,validatorAddress:t.validator})},l=await c({address:t.delegator,memo:r,msgs:[o]});return await e.signAndBroadcast(t.delegator,[o],l,r).then(f("unbond")).catch(m)},w=async(t,e)=>{let n=[{typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",value:a.MsgWithdrawDelegatorReward.fromPartial({delegatorAddress:t.delegator,validatorAddress:t.validator})}],r=await c({address:t.delegator,msgs:n});return await e.signAndBroadcast(t.delegator,n,r).then(f("withdraw_rewards")).catch(m)},x=t=>{let e=(0,o.bI)(t);return new r.Z(e.amount).gte(l._H)},b=async(t,e)=>{let n={typeUrl:"/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation",value:i.MsgCancelUnbondingDelegation.fromPartial({delegatorAddress:t.delegator,validatorAddress:t.validator})},r=await c({address:t.delegator,msgs:[n]});return await e.signAndBroadcast(t.delegator,[n],r,"").then(t=>(console.log("debug: tx.ts: cancelUnstake: result",t),t)).catch(m)}}}]); \ No newline at end of file diff --git a/_next/static/chunks/app/validator/page-e77375662743b728.js b/_next/static/chunks/app/validator/page-8e618c838be80245.js similarity index 100% rename from _next/static/chunks/app/validator/page-e77375662743b728.js rename to _next/static/chunks/app/validator/page-8e618c838be80245.js diff --git a/index.html b/index.html index 153faa0..7c9c464 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -XION Staking
Your Staking Overview
Please Log In To View
Validators
Validator
Staked Amount
Commission
Voting Power
\ No newline at end of file +XION Staking
Your Staking Overview
Please Log In To View
Validators
Validator
Staked Amount
Commission
Voting Power
\ No newline at end of file diff --git a/index.txt b/index.txt index cb746fd..f4e05f1 100644 --- a/index.txt +++ b/index.txt @@ -1,7 +1,7 @@ -2:I[64350,["350","static/chunks/68b159eb-f350a487f88c1bfb.js","218","static/chunks/aaea2bcf-4abc2b343ea41dae.js","147","static/chunks/6468630d-7fefcf7a3223f2f0.js","228","static/chunks/77693919-7b92b10f5ae0e31c.js","933","static/chunks/5ebe7343-e8d67ddb6cca8663.js","4","static/chunks/4-f9ab361db4f4f038.js","245","static/chunks/245-8266bc6575a22c44.js","816","static/chunks/816-cac8172353521c02.js","503","static/chunks/503-311c908eac1df4f6.js","931","static/chunks/app/page-5762d3667c36ba9b.js"],""] -3:I[56225,["350","static/chunks/68b159eb-f350a487f88c1bfb.js","218","static/chunks/aaea2bcf-4abc2b343ea41dae.js","147","static/chunks/6468630d-7fefcf7a3223f2f0.js","228","static/chunks/77693919-7b92b10f5ae0e31c.js","933","static/chunks/5ebe7343-e8d67ddb6cca8663.js","4","static/chunks/4-f9ab361db4f4f038.js","816","static/chunks/816-cac8172353521c02.js","185","static/chunks/app/layout-f8bb99b6df23ac99.js"],""] +2:I[64350,["350","static/chunks/68b159eb-f350a487f88c1bfb.js","218","static/chunks/aaea2bcf-4abc2b343ea41dae.js","147","static/chunks/6468630d-7fefcf7a3223f2f0.js","228","static/chunks/77693919-7b92b10f5ae0e31c.js","933","static/chunks/5ebe7343-e8d67ddb6cca8663.js","4","static/chunks/4-f9ab361db4f4f038.js","245","static/chunks/245-8266bc6575a22c44.js","816","static/chunks/816-f354d55c4d7354c5.js","503","static/chunks/503-6166f7bdb0bab8f4.js","931","static/chunks/app/page-5762d3667c36ba9b.js"],""] +3:I[56225,["350","static/chunks/68b159eb-f350a487f88c1bfb.js","218","static/chunks/aaea2bcf-4abc2b343ea41dae.js","147","static/chunks/6468630d-7fefcf7a3223f2f0.js","228","static/chunks/77693919-7b92b10f5ae0e31c.js","933","static/chunks/5ebe7343-e8d67ddb6cca8663.js","4","static/chunks/4-f9ab361db4f4f038.js","816","static/chunks/816-f354d55c4d7354c5.js","185","static/chunks/app/layout-f8bb99b6df23ac99.js"],""] 4:I[5613,[],""] 5:I[31778,[],""] -0:["vKS50s-SqSS05fQWU-TXS",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},["$L1",["$","$L2",null,{}],null]]},[null,["$","$L3",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}],"params":{}}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/xion-staking/_next/static/css/8e69049fa282e630.css","precedence":"next","crossOrigin":""}],["$","link","1",{"rel":"stylesheet","href":"/xion-staking/_next/static/css/9e20252c6882c039.css","precedence":"next","crossOrigin":""}]],"$L6"]]]] +0:["WyQ_gkUilFLI8ibobnbav",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},["$L1",["$","$L2",null,{}],null]]},[null,["$","$L3",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}],"params":{}}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/xion-staking/_next/static/css/8e69049fa282e630.css","precedence":"next","crossOrigin":""}],["$","link","1",{"rel":"stylesheet","href":"/xion-staking/_next/static/css/9e20252c6882c039.css","precedence":"next","crossOrigin":""}]],"$L6"]]]] 6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"XION Staking"}],["$","link","3",{"rel":"icon","href":"/xion-staking/favicon.ico","type":"image/x-icon","sizes":"16x16"}]] 1:null diff --git a/validator.html b/validator.html index 6a179dc..e35208e 100644 --- a/validator.html +++ b/validator.html @@ -1 +1 @@ -XION Validator Details
\ No newline at end of file +XION Validator Details
\ No newline at end of file diff --git a/validator.txt b/validator.txt index bae4e80..4b49d1a 100644 --- a/validator.txt +++ b/validator.txt @@ -1,8 +1,8 @@ 2:"$Sreact.suspense" -3:I[66355,["350","static/chunks/68b159eb-f350a487f88c1bfb.js","218","static/chunks/aaea2bcf-4abc2b343ea41dae.js","147","static/chunks/6468630d-7fefcf7a3223f2f0.js","228","static/chunks/77693919-7b92b10f5ae0e31c.js","933","static/chunks/5ebe7343-e8d67ddb6cca8663.js","4","static/chunks/4-f9ab361db4f4f038.js","245","static/chunks/245-8266bc6575a22c44.js","816","static/chunks/816-cac8172353521c02.js","503","static/chunks/503-311c908eac1df4f6.js","276","static/chunks/app/validator/page-e77375662743b728.js"],""] +3:I[66355,["350","static/chunks/68b159eb-f350a487f88c1bfb.js","218","static/chunks/aaea2bcf-4abc2b343ea41dae.js","147","static/chunks/6468630d-7fefcf7a3223f2f0.js","228","static/chunks/77693919-7b92b10f5ae0e31c.js","933","static/chunks/5ebe7343-e8d67ddb6cca8663.js","4","static/chunks/4-f9ab361db4f4f038.js","245","static/chunks/245-8266bc6575a22c44.js","816","static/chunks/816-f354d55c4d7354c5.js","503","static/chunks/503-6166f7bdb0bab8f4.js","276","static/chunks/app/validator/page-8e618c838be80245.js"],""] 4:I[5613,[],""] 5:I[31778,[],""] -6:I[56225,["350","static/chunks/68b159eb-f350a487f88c1bfb.js","218","static/chunks/aaea2bcf-4abc2b343ea41dae.js","147","static/chunks/6468630d-7fefcf7a3223f2f0.js","228","static/chunks/77693919-7b92b10f5ae0e31c.js","933","static/chunks/5ebe7343-e8d67ddb6cca8663.js","4","static/chunks/4-f9ab361db4f4f038.js","816","static/chunks/816-cac8172353521c02.js","185","static/chunks/app/layout-f8bb99b6df23ac99.js"],""] -0:["vKS50s-SqSS05fQWU-TXS",[[["",{"children":["validator",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["validator",{"children":["__PAGE__",{},["$L1",["$","$2",null,{"children":["$","$L3",null,{}]}],null]]},["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","validator","children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}]]},[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}],"params":{}}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/xion-staking/_next/static/css/8e69049fa282e630.css","precedence":"next","crossOrigin":""}],["$","link","1",{"rel":"stylesheet","href":"/xion-staking/_next/static/css/9e20252c6882c039.css","precedence":"next","crossOrigin":""}]],"$L7"]]]] +6:I[56225,["350","static/chunks/68b159eb-f350a487f88c1bfb.js","218","static/chunks/aaea2bcf-4abc2b343ea41dae.js","147","static/chunks/6468630d-7fefcf7a3223f2f0.js","228","static/chunks/77693919-7b92b10f5ae0e31c.js","933","static/chunks/5ebe7343-e8d67ddb6cca8663.js","4","static/chunks/4-f9ab361db4f4f038.js","816","static/chunks/816-f354d55c4d7354c5.js","185","static/chunks/app/layout-f8bb99b6df23ac99.js"],""] +0:["WyQ_gkUilFLI8ibobnbav",[[["",{"children":["validator",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["validator",{"children":["__PAGE__",{},["$L1",["$","$2",null,{"children":["$","$L3",null,{}]}],null]]},["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","validator","children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}]]},[null,["$","$L6",null,{"children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}],"params":{}}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/xion-staking/_next/static/css/8e69049fa282e630.css","precedence":"next","crossOrigin":""}],["$","link","1",{"rel":"stylesheet","href":"/xion-staking/_next/static/css/9e20252c6882c039.css","precedence":"next","crossOrigin":""}]],"$L7"]]]] 7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"XION Validator Details"}],["$","link","3",{"rel":"icon","href":"/xion-staking/favicon.ico","type":"image/x-icon","sizes":"16x16"}]] 1:null