-
Notifications
You must be signed in to change notification settings - Fork 0
/
src__pages__JIU__Holder2.async.js
1 lines (1 loc) · 15.3 KB
/
src__pages__JIU__Holder2.async.js
1
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[615],{6466:function(t,e,n){n.d(e,{Z:function(){return y}});var a=n(4942),r=n(1413),c=n(91),s=n(28459),o=n(93967),i=n.n(o),l=n(62435),u=n(63330),d=n(44962),p=n(98082),f=function(t){return(0,a.Z)({},t.componentCls,{display:"flex",flexDirection:"column",justifyContent:"flex-end",marginBlock:t.marginLG,marginInline:0,color:t.colorText,fontWeight:"500",fontSize:"20px",lineHeight:"38px"})};var x=n(86074),h=function(t){var e=t.className,n=t.style,a=void 0===n?{}:n,c=t.children,o=(0,(0,l.useContext)(s.ZP.ConfigContext).getPrefixCls)("pro-card-operation"),u=function(t){return(0,p.Xj)("ProCardOperation",(function(e){var n=(0,r.Z)((0,r.Z)({},e),{},{componentCls:".".concat(t)});return[f(n)]}))}(o),d=u.wrapSSR,h=u.hashId,m=i()(o,e,h);return d((0,x.jsx)("div",{className:m,style:a,children:c}))},m=n(10357),k=function(t){return(0,a.Z)({},t.componentCls,{"&-chart":{display:"flex",flexDirection:"column",marginBlockStart:8,marginBlockEnd:8,"&-left":{marginBlockStart:0,marginInlineEnd:"16px"},"&-right":{marginBlockStart:0,marginInlineStart:"16px"}},"&-content":{display:"flex",flexDirection:"column","&-horizontal":(0,a.Z)({flexDirection:"row"},"".concat(t.componentCls,"-chart"),{alignItems:"center",alignSelf:"flex-start"})},"&-footer":{marginBlockStart:8,paddingBlockStart:"16px",borderBlockStart:"rgba(0, 0, 0, 0.08) solid ".concat(t.colorBorder)}})};var v=["children","statistic","className","chart","chartPlacement","footer"],g=function(t){var e,n=t.children,o=t.statistic,d=t.className,f=t.chart,h=t.chartPlacement,g=t.footer,y=(0,c.Z)(t,v),j=(0,(0,l.useContext)(s.ZP.ConfigContext).getPrefixCls)("pro-statistic-card"),S=function(t){return(0,p.Xj)("StatisticCard",(function(e){var n=(0,r.Z)((0,r.Z)({},e),{},{componentCls:".".concat(t)});return[k(n)]}))}(j),C=S.wrapSSR,Z=S.hashId,b=i()(j,d,Z),w=o&&(0,x.jsx)(m.Z,(0,r.Z)({layout:"vertical"},o)),N=i()("".concat(j,"-chart"),Z,(e={},(0,a.Z)(e,"".concat(j,"-chart-left"),"left"===h&&f&&o),(0,a.Z)(e,"".concat(j,"-chart-right"),"right"===h&&f&&o),e)),P=f&&(0,x.jsx)("div",{className:N,children:f}),I=i()("".concat(j,"-content "),Z,(0,a.Z)({},"".concat(j,"-content-horizontal"),"left"===h||"right"===h)),B=(P||w)&&("left"===h?(0,x.jsxs)("div",{className:I,children:[P,w]}):(0,x.jsxs)("div",{className:I,children:[w,P]})),E=g&&(0,x.jsx)("div",{className:"".concat(j,"-footer ").concat(Z).trim(),children:g});return C((0,x.jsxs)(u.Z,(0,r.Z)((0,r.Z)({className:b},y),{},{children:[B,n,E]})))};g.Statistic=m.Z,g.Divider=d.Z,g.Operation=h,g.isProCard=!0,g.Group=function(t){return(0,x.jsx)(g,(0,r.Z)({bodyStyle:{padding:0}},t))};var y=g},10357:function(t,e,n){n.d(e,{Z:function(){return v}});var a=n(1413),r=n(4942),c=n(91),s=n(25035),o=n(28459),i=n(83062),l=n(40411),u=n(55054),d=n(93967),p=n.n(d),f=n(62435),x=n(98082),h=function(t){var e,n,a;return(0,r.Z)({},t.componentCls,(a={display:"flex",fontSize:t.fontSize,"& + &":{marginBlockStart:4},"&-tip":{marginInlineStart:4},"&-wrapper":(0,r.Z)({display:"flex",width:"100%"},"".concat(t.componentCls,"-status"),{width:"14px"}),"&-icon":{marginInlineEnd:16},"&-trend-icon":{width:0,height:0,borderInlineEnd:"3.5px solid transparent",borderBlockEnd:"9px solid #000",borderInlineStart:"3.5px solid transparent","&-up":{transform:"rotate(0deg)"},"&-down":{transform:"rotate(180deg)"}},"&-content":(0,r.Z)({width:"100%"},"".concat(t.antCls,"-statistic-content"),{"&-value-int":{fontSize:t.fontSizeHeading3}}),"&-description":{width:"100%"}},(0,r.Z)(a,"".concat(t.antCls,"-statistic-title"),{color:t.colorText}),(0,r.Z)(a,"&-trend-up",(0,r.Z)({},"".concat(t.antCls,"-statistic-content"),(0,r.Z)({color:"#f5222d"},"".concat(t.componentCls,"-trend-icon"),{borderBlockEndColor:"#f5222d"}))),(0,r.Z)(a,"&-trend-down",(0,r.Z)({},"".concat(t.antCls,"-statistic-content"),(0,r.Z)({color:"#389e0d"},"".concat(t.componentCls,"-trend-icon"),{borderBlockEndColor:"#52c41a"}))),(0,r.Z)(a,"& &-layout-horizontal",(e={display:"flex",justifyContent:"space-between"},(0,r.Z)(e,"".concat(t.antCls,"-statistic-title"),{marginBlockEnd:0}),(0,r.Z)(e,"".concat(t.antCls,"-statistic-content-value"),{fontWeight:500}),(0,r.Z)(e,"".concat(t.antCls,"-statistic-title,").concat(t.antCls,"-statistic-content,").concat(t.antCls,"-statistic-content-suffix,").concat(t.antCls,"-statistic-content-prefix,").concat(t.antCls,"-statistic-content-value-decimal"),{fontSize:t.fontSize}),e)),(0,r.Z)(a,"& &-layout-inline",(n={display:"inline-flex",color:t.colorTextSecondary},(0,r.Z)(n,"".concat(t.antCls,"-statistic-title"),{marginInlineEnd:"6px",marginBlockEnd:0}),(0,r.Z)(n,"".concat(t.antCls,"-statistic-content"),{color:t.colorTextSecondary}),(0,r.Z)(n,"".concat(t.antCls,"-statistic-title,").concat(t.antCls,"-statistic-content,").concat(t.antCls,"-statistic-content-suffix,").concat(t.antCls,"-statistic-content-prefix,").concat(t.antCls,"-statistic-content-value-decimal"),{fontSize:t.fontSizeSM}),n)),a))};var m=n(86074),k=["className","layout","style","description","children","title","tip","status","trend","prefix","icon"],v=function(t){var e,n=t.className,d=t.layout,v=void 0===d?"inline":d,g=t.style,y=t.description,j=(t.children,t.title),S=t.tip,C=t.status,Z=t.trend,b=t.prefix,w=t.icon,N=(0,c.Z)(t,k),P=(0,(0,f.useContext)(o.ZP.ConfigContext).getPrefixCls)("pro-card-statistic"),I=function(t){return(0,x.Xj)("Statistic",(function(e){var n=(0,a.Z)((0,a.Z)({},e),{},{componentCls:".".concat(t)});return[h(n)]}))}(P),B=I.wrapSSR,E=I.hashId,z=p()(P,n,E),D=p()("".concat(P,"-status"),E),M=p()("".concat(P,"-icon"),E),O=p()("".concat(P,"-wrapper"),E),_=p()("".concat(P,"-content"),E),R=p()(E,(e={},(0,r.Z)(e,"".concat(P,"-layout-").concat(v),v),(0,r.Z)(e,"".concat(P,"-trend-").concat(Z),Z),e)),q=S&&(0,m.jsx)(i.Z,{title:S,children:(0,m.jsx)(s.Z,{className:"".concat(P,"-tip ").concat(E).trim()})}),F=p()("".concat(P,"-trend-icon"),E,(0,r.Z)({},"".concat(P,"-trend-icon-").concat(Z),Z)),H=Z&&(0,m.jsx)("div",{className:F}),T=C&&(0,m.jsx)("div",{className:D,children:(0,m.jsx)(l.Z,{status:C,text:null})}),U=w&&(0,m.jsx)("div",{className:M,children:w});return B((0,m.jsxs)("div",{className:z,style:g,children:[U,(0,m.jsxs)("div",{className:O,children:[T,(0,m.jsxs)("div",{className:_,children:[(0,m.jsx)(u.Z,(0,a.Z)({title:(j||q)&&(0,m.jsxs)(m.Fragment,{children:[j,q]}),prefix:(H||b)&&(0,m.jsxs)(m.Fragment,{children:[H,b]}),className:R},N)),y&&(0,m.jsx)("div",{className:"".concat(P,"-description ").concat(E).trim(),children:y})]})]})]}))}},61144:function(t,e,n){n.r(e);var a=n(15009),r=n.n(a),c=n(99289),s=n.n(c),o=n(5574),i=n.n(o),l=n(81876),u=n(64119),d=n(11774),p=n(38345),f=n(6466),x=n(92340),h=n(59530),m=n(45360),k=n(71230),v=n(15746),g=n(15867),y=n(9669),j=n.n(y),S=n(27484),C=n.n(S),Z=n(70178),b=n.n(Z),w=n(62435),N=(n(39441),n(86074));C().extend(b());e.default=function(){var t=(0,h.useDispatch)(),e=m.ZP.useMessage(),n=i()(e,2),a=n[0],c=n[1],o=(0,h.useNavigate)(),y=(0,h.useSelector)((function(t){return t.global.host})),S=(0,h.useSelector)((function(t){return t.global.contractKit})),C=(0,w.useState)(!1),Z=i()(C,2),b=Z[0],P=Z[1],I=(0,h.useSelector)((function(t){return t.jiu.holderDataSource})),B=(0,h.useSelector)((function(t){return t.jiu.holderDataSourceReset})),E=(0,w.useState)(0),z=i()(E,2),D=z[0],M=z[1],O=(0,w.useState)(0),_=i()(O,2),R=_[0],q=_[1],F=(0,w.useState)(0),H=i()(F,2),T=H[0],U=H[1],J=(0,w.useState)(0),A=i()(J,2),G=A[0],L=A[1],W=(0,w.useState)(0),X=i()(W,2),$=X[0],K=X[1],V=(0,h.useIntl)(),Q=V.formatMessage({id:"jiu.intlHolder"}),Y=V.formatMessage({id:"jiu.intlHold"}),tt=V.formatMessage({id:"jiu.intlLiq"}),et=V.formatMessage({id:"jiu.intlTotalValue"}),nt=V.formatMessage({id:"jiu.intlRatio"}),at=V.formatMessage({id:"jiu.intlSupply"}),rt=V.formatMessage({id:"jiu.intlMarketCap"}),ct=V.formatMessage({id:"jiu.intlDestruction"}),st=V.formatMessage({id:"jiu.intlPrice"}),ot=V.formatMessage({id:"jiu.intlRank"}),it=V.formatMessage({id:"jiu.intlUpdate"}),lt=V.formatMessage({id:"jiu.intlTotalBal"}),ut=(0,w.useCallback)(s()(r()().mark((function t(){var e,n,c,s,o,l,d,p,f,x;return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=[],n=1e3,c="",s="";case 4:return t.next=7,(0,u.zI)(j().post("".concat(y,"/v2/chain/get_scope_rows"),{code:"jiutokenmain",table:"accounts",lower_bound:c,primary_lower_bound:s,limit:n,index_position:"primary",key_type:"name"}));case 7:if(o=t.sent,l=i()(o,2),d=l[0],p=l[1],d||200!==p.status){t.next=22;break}for(f=p.data.rows,x=0;x<f.length;++x)e.push({account:f[x].scope,balance:f[x].data.balance});if(!p.data.more){t.next=19;break}c=p.data.next_key,s=p.data.next_primary_key,t.next=20;break;case 19:return t.abrupt("break",26);case 20:t.next=24;break;case 22:return a.error(d),t.abrupt("break",26);case 24:t.next=4;break;case 26:return t.abrupt("return",e);case 27:case"end":return t.stop()}}),t)}))),[a]),dt=(0,w.useCallback)(s()(r()().mark((function t(){var e,n,a,c,s,o,i;return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,S.load("swapswapswap");case 2:return e=t.sent,n=e.table("markets"),t.next=6,n.all();case 6:return a=t.sent,c=a.find((function(t){return 24===t.mid.toNumber()})),"usdtusdtusdt-USDT",o="eosio.token-DFS",i=[],(s={})["usdtusdtusdt-USDT"]=1,s[o]=(0,u.ri)(a[0].reserve0)/(0,u.ri)(a[0].reserve1),a.forEach((function(t){var e=t.contract0.toString()+"-"+t.sym0.toString().split(",")[1],n=t.contract1.toString()+"-"+t.sym1.toString().split(",")[1],a=(0,u.ri)(t.reserve0),r=(0,u.ri)(t.reserve1);"eosio.token"===t.contract0.toString()?s.hasOwnProperty(n)||(s[n]=a/r*s[o]):"eosio.token"===t.contract1.toString()?s.hasOwnProperty(e)||(s[e]=r/a*s[o]):"usdtusdtusdt"===t.contract0.toString()?s.hasOwnProperty(n)||(s[n]=a/r):"usdtusdtusdt"===t.contract1.toString()?s.hasOwnProperty(e)||(s[e]=r/a):i.push({key0:e,key1:n,value0:a,value1:r})})),i.forEach((function(t){s.hasOwnProperty(t.key0)&&!s.hasOwnProperty(t.key1)?s[t.key1]=t.value0/t.value1*s[t.key0]:!s.hasOwnProperty(t.key0)&&s.hasOwnProperty(t.key1)?s[t.key0]=t.value1/t.value0*s[t.key1]:s.hasOwnProperty(t.key0)||s.hasOwnProperty(t.key1)||(s[t.key0]=0,s[t.key1]=0)})),t.abrupt("return",{tokenPriceMap:s,market24:c});case 17:case"end":return t.stop()}}),t)}))),[S]),pt=(0,w.useCallback)(s()(r()().mark((function t(){var e,n,a;return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,S.load("swapswapswap");case 2:return e=t.sent,n=e.table("liquidity"),t.next=6,n.all({scope:24});case 6:return a=t.sent,t.abrupt("return",a);case 8:case"end":return t.stop()}}),t)}))),[S]),ft=(0,w.useCallback)(s()(r()().mark((function t(){var e,n,a;return r()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,S.load("jiutokenmain");case 2:return e=t.sent,n=e.table("stat"),t.next=6,n.all({scope:"JIU"});case 6:return a=t.sent,t.abrupt("return",[a[0].supply.value,a[0].max_supply.value]);case 8:case"end":return t.stop()}}),t)}))),[S]),xt=(0,w.useCallback)(s()(r()().mark((function e(){var n,c,s,o,d,p,f,x,h,m,k,v,g,y;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n={},c={},s=[],e.next=6,dt();case 6:return o=e.sent,d=o.tokenPriceMap,p=o.market24,e.next=11,ut();case 11:return f=e.sent,e.next=14,pt();case 14:return x=e.sent,e.next=17,ft();case 17:for(h=e.sent,m=i()(h,2),k=m[0],v=m[1],f.forEach((function(t){n[t.account]=Number(t.balance.split(" ")[0])})),x.forEach((function(t){var e=parseFloat(p.liquidity_token.toString()),n=parseFloat(p.reserve1.value.toString())*(parseFloat(t.token.toString())/e),a=t.owner.toString();c[a]=n})),Object.keys(n).forEach((function(t,e){var a=n[t],r=c[t]?c[t]:0;a+r>0&&s.push({key:e,rank:e,account:t,hold:a,liq:r,totalBal:a+r,value:(a+r)*d["jiutokenmain-JIU"],ratio:(a+r)/k})})),g=s.sort((function(t,e){return e.value-t.value})),y=0;y<g.length;y++)g[y].rank=y;t(l.N.setHolderDataSource(g)),t(l.N.setHolderDataSourceReset(g)),M(g.length),q(k*d["jiutokenmain-JIU"]),U(v-k),L(k),K(d["jiutokenmain-JIU"]),P(!1),e.next=40;break;case 36:e.prev=36,e.t0=e.catch(0),P(!1),(0,u.Tv)(e.t0,a,"handleGetHolder");case 40:case"end":return e.stop()}}),e,null,[[0,36]])}))),[ut,dt,ft,pt]),ht=(0,w.useCallback)((function(e){var n=e.account,a=I.filter((function(t){return t.account===n}));t(l.N.setHolderDataSource(a))}),[I]),mt=(0,w.useCallback)((function(){t(l.N.setHolderDataSource(B))}),[B]),kt=(0,w.useMemo)((function(){return[{title:"".concat(ot),dataIndex:"key",key:"key",search:!1,render:function(t,e){return(0,N.jsx)("span",{children:e.rank+1})}},{title:"".concat(Q),dataIndex:"account",key:"account",render:function(t,e){var n="";return"crowdfunding"===e.account?n="众筹LP,永不撤市":"jiuoperation"===e.account?n="社区公共基金":"jiutothemoon"===e.account&&(n="韭菜天团DAO"),(0,N.jsxs)("a",{onClick:function(){return o("/query/account?search=".concat(e.account,"&tab=info"))},children:[e.account,(0,N.jsx)("div",{className:" text-red-600",children:n})]})}},{title:"".concat(Y),dataIndex:"hold",key:"hold",search:!1,sorter:function(t,e){return e.hold-t.hold},render:function(t,e){return(0,N.jsx)("span",{children:(0,u.CE)(e.hold)})}},{title:"".concat(tt),dataIndex:"liq",key:"liq",search:!1,sorter:function(t,e){return e.liq-t.liq},render:function(t,e){return(0,N.jsx)("span",{children:(0,u.CE)(e.liq)})}},{title:"".concat(lt),dataIndex:"totalBal",key:"totalBal",search:!1,sorter:function(t,e){return e.totalBal-t.totalBal},render:function(t,e){return(0,N.jsx)("span",{children:(0,u.CE)(e.totalBal)})}},{title:"".concat(et),dataIndex:"value",key:"value",search:!1,sorter:function(t,e){return e.value-t.value},render:function(t,e){return(0,N.jsx)("span",{children:(0,u.CE)(e.value,"$")})}},{title:"".concat(nt),dataIndex:"ratio",key:"ratio",search:!1,sorter:function(t,e){return e.ratio-t.ratio},render:function(t,e){return(0,N.jsxs)("span",{children:[(0,u.CE)(100*e.ratio),"%"]})}}]}),[]);return(0,w.useEffect)((function(){S?(I.length?P(!1):P(!0),xt()):P(!0)}),[S,xt]),(0,N.jsxs)(d._z,{className:"holder",ghost:!0,children:[(0,N.jsx)(p.Z,{headerBordered:!0,headStyle:{justifyContent:"center"},className:"mb-3",children:(0,N.jsxs)(k.Z,{gutter:10,children:[(0,N.jsx)(v.Z,{lg:{span:"6"},md:{span:"12"},sm:{span:"24"},xs:{span:"24"},children:(0,N.jsx)(f.Z,{layout:"center",statistic:{title:(0,N.jsx)("div",{className:"text-center",children:rt}),value:(0,u.CE)(R,"$")}})}),(0,N.jsx)(v.Z,{lg:{span:"4"},md:{span:"12"},sm:{span:"12"},xs:{span:"12"},children:(0,N.jsx)(f.Z,{layout:"center",statistic:{title:(0,N.jsx)("div",{className:"text-center",children:at}),value:"".concat((G/1e8).toFixed(2),"亿")}})}),(0,N.jsx)(v.Z,{lg:{span:"5"},md:{span:"8"},sm:{span:"12"},xs:{span:"12"},children:(0,N.jsx)(f.Z,{layout:"center",statistic:{title:(0,N.jsx)("div",{className:"text-center",children:ct}),value:"".concat((T/1e8).toFixed(2),"亿(").concat((T/1e11*100).toFixed(2),"%)")}})}),(0,N.jsx)(v.Z,{lg:{span:"5"},md:{span:"8"},sm:{span:"12"},xs:{span:"12"},children:(0,N.jsx)(f.Z,{layout:"center",statistic:{title:(0,N.jsx)("div",{className:"text-center",children:st}),value:(0,u.CE)($,"$")}})}),(0,N.jsx)(v.Z,{lg:{span:"4"},md:{span:"8"},sm:{span:"12"},xs:{span:"12"},children:(0,N.jsx)(f.Z,{layout:"center",statistic:{title:(0,N.jsx)("div",{className:"text-center",children:Q}),value:D}})})]})}),(0,N.jsx)(x.Z,{className:"mb-3",scroll:{x:!0},size:"small",columns:kt,dataSource:I,defaultData:[],search:{defaultCollapsed:!1,layout:"horizontal",labelWidth:"auto",collapseRender:!1,className:"p-[0px]",optionRender:function(t,e,n){return[n[1],(0,N.jsx)(g.ZP,{onClick:function(){P(!0),xt()},children:it},"update"),n[0]]}},onSubmit:ht,onReset:mt,options:!1,pagination:{pageSize:100},tableAlertRender:!1,tableAlertOptionRender:!1,loading:{spinning:b,size:"large"}}),c]})}},39441:function(){}}]);