-
Notifications
You must be signed in to change notification settings - Fork 0
/
9313.async.js
1 lines (1 loc) · 15.6 KB
/
9313.async.js
1
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[9313],{29313:function(e,a,t){t.r(a),t.d(a,{default:function(){return F}});var n=t(15009),s=t.n(n),r=t(99289),i=t.n(r),c=t(5574),o=t.n(c),l=t(52677),d=t.n(l),u=t(87603),m=t(92340),x=t(59530),h=t(66309),f=t(27484),p=t.n(f),v=t(70178),g=t.n(v),j=t(62435),b=t(86074);p().extend(g());var N=function(){var e=(0,x.useSelector)((function(e){return e.transaction.transaction})),a=(0,x.useSelector)((function(e){return e.transaction.loading})),t=(0,j.useState)([]),n=o()(t,2),s=n[0],r=n[1],i=(0,x.useNavigate)(),c=(0,x.useIntl)(),l=c.formatMessage({id:"contract.intlContract"}),f=c.formatMessage({id:"account.intlAction"}),p=c.formatMessage({id:"account.intlData"}),v=c.formatMessage({id:"transaction.intlAuthorization"}),g=(0,j.useCallback)((function(){var a=[];e.actions.forEach((function(e,t){a.push({key:t,contract:e.act.account,action:e.act.name,authorization:e.act.authorization.map((function(e){return e.actor+"@"+e.permission})),actors:e.act.authorization.map((function(e){return e.actor})),data:e.act.data,receivers:e.receipts.map((function(e){return e.receiver}))})})),r(a)}),[e]),N=(0,j.useCallback)((function(e){var a=e.action,t=Object.keys(e.data);if("transfer"===a){var n="";return e.data.quantity?n=e.data.quantity:e.data.assetid&&(n=e.data.assetid),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:" font-bold",children:[e.data.from," ",(0,b.jsx)(u.Z,{})," ",e.data.to," ",(0,b.jsx)(h.Z,{className:"ml-1",children:n})]}),!!e.data.memo&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:" font-bold",children:"memo: "}),e.data.memo]})]})}return(0,b.jsx)("div",{children:t.map((function(a,t){var n=e.data[a];return"object"===d()(n)&&null!=n?(n=(0,b.jsx)("pre",{children:JSON.stringify(e.data[a],null,2)}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("span",{className:" font-bold",children:[a,": "]})," ",n]},t)):(0,b.jsxs)("div",{children:[(0,b.jsxs)("span",{className:" font-bold",children:[a,": "]})," ",n]},t)}))})}),[]),y=(0,j.useMemo)((function(){return[{title:"#",dataIndex:"key",key:"key",fixed:!0,width:"10px",align:"center",render:function(e,a,t){return(0,b.jsx)("span",{children:t+1})}},{title:"".concat(l),dataIndex:"contract",key:"contract",render:function(e,a){return(0,b.jsx)("div",{children:(0,b.jsx)("a",{onClick:function(){return i("/query/contract?search=".concat(a.contract,"&tab=actions"))},children:a.contract})})}},{title:"".concat(f),dataIndex:"action",key:"action",render:function(e,a){return(0,b.jsx)("div",{children:a.action})}},{title:"".concat(v),dataIndex:"key",key:"key",render:function(e,a){return(0,b.jsx)("div",{children:a.authorization.map((function(e,a){return(0,b.jsx)("div",{className:"mb-1",children:(0,b.jsx)(h.Z,{color:"blue",children:e})},a)}))})}},{title:"".concat(p),dataIndex:"data",key:"data",render:function(e,a){return(0,b.jsx)("div",{children:N(a)})}}]}),[]);return(0,j.useEffect)((function(){g()}),[g]),(0,b.jsx)("div",{className:"tab-action",children:(0,b.jsx)("div",{className:"",children:(0,b.jsx)(m.Z,{scroll:{x:!0},size:"small",columns:y,dataSource:s,search:!1,options:!1,pagination:!1,tableAlertRender:!1,tableAlertOptionRender:!1,loading:{spinning:a,size:"large"}})})})},y=(0,j.memo)(N),w=t(57132),k=t(45360),M=t(57953),T=t(79123),S=(t(20034),function(){var e=k.ZP.useMessage(),a=o()(e,2),t=a[0],n=a[1],r=(0,x.useSelector)((function(e){return e.transaction.transaction})),c=(0,x.useSelector)((function(e){return e.transaction.loading})),l=(0,x.useIntl)().formatMessage({id:"common.intlCopySuccess"}),d=(0,j.useCallback)(i()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,window.navigator.clipboard.writeText(JSON.stringify(r));case 2:t.success("".concat(l));case 3:case"end":return e.stop()}}),e)}))),[r]);return(0,b.jsx)(M.Z,{size:"large",spinning:c,children:(0,b.jsxs)("div",{className:"",children:[(0,b.jsxs)("div",{className:"",children:[(0,b.jsx)(w.Z,{className:"cursor-pointer",style:{color:"#1677ff"},onClick:d}),(0,b.jsx)(T.ZP,{className:"text-lg",src:r,collapsed:!1,displaySize:!0,enableClipboard:!1})]}),n]})})}),Z=(0,j.memo)(S),q=t(64119),C=t(71230),_=t(15746);p().extend(g());var z=function(){var e=(0,x.useSelector)((function(e){return e.transaction.transaction})),a=(0,x.useSelector)((function(e){return e.transaction.txid})),t=(0,x.useSelector)((function(e){return e.transaction.loading})),n=(0,x.useIntl)(),s=n.formatMessage({id:"transaction.intlTransaction"}),r=n.formatMessage({id:"transaction.intlStatus"}),i=n.formatMessage({id:"transaction.intlBlockNumber"}),c=n.formatMessage({id:"transaction.intlBlockTime"}),o=n.formatMessage({id:"transaction.intlCpuUsage"}),l=n.formatMessage({id:"transaction.intlNetUsage"}),d=n.formatMessage({id:"transaction.intlRamUsage"}),u=(0,j.useMemo)((function(){return e.executed?"Executed":"Failed"}),[e]),m=(0,j.useMemo)((function(){var a=0,t=0,s={};e.actions.forEach((function(e){e.hasOwnProperty("cpu_usage_us")&&(a+=e.cpu_usage_us),e.hasOwnProperty("net_usage_words")&&(t+=e.net_usage_words),e.hasOwnProperty("account_ram_deltas")&&e.account_ram_deltas.length&&e.account_ram_deltas.forEach((function(e){var a=e.account,t=e.delta;s.hasOwnProperty(a)?s[a]+=Number(t):s[a]=Number(t)}))})),a>=1e3?a=(a/1e3).toFixed(2)+" ms":a+=" us";var r=function(e){return e>=1048576?(e/1024/1024).toFixed(3)+" MB":e>=1024?(e/1024).toFixed(3)+" KB":e+" Bytes"};t=r(t);var i=Object.keys(s);return s=i.length?i.map((function(e,a){return s[e]>0?(0,b.jsx)("div",{children:n.formatMessage({id:"transaction.intlConsumeRam"},{account:e,ram:r(s[e])})},a):(0,b.jsx)("div",{children:n.formatMessage({id:"transaction.intlReleaseRam"},{account:e,ram:r(-s[e])})},a)})):"NA",{cpuUsage:a,netUsage:t,ramUsage:s}}),[e,n]);return(0,b.jsx)(M.Z,{size:"large",spinning:t,children:(0,b.jsx)("div",{className:"",children:(0,b.jsxs)("div",{className:"",style:{overflowWrap:"anywhere"},children:[(0,b.jsx)(C.Z,{gutter:10,children:(0,b.jsx)(_.Z,{span:"24",children:(0,b.jsxs)("div",{className:"text-base ",children:[(0,b.jsxs)("span",{className:" font-semibold",children:[s,":"]}),a]})})}),(0,b.jsxs)(C.Z,{gutter:10,children:[(0,b.jsxs)(_.Z,{lg:{span:"14"},md:{span:"14"},sm:{span:"14"},xs:{span:"24"},children:[(0,b.jsxs)("div",{className:"text-base mt-1",children:[(0,b.jsxs)("span",{className:" font-semibold",children:[r,":"]}),u]}),(0,b.jsxs)("div",{className:"text-base mt-1",children:[(0,b.jsxs)("span",{className:" font-semibold",children:[i,":"]}),(0,q.CE)(e.last_indexed_block)]}),(0,b.jsxs)("div",{className:"text-base mt-1",children:[(0,b.jsxs)("span",{className:" font-semibold",children:[c,":"]}),p().utc(e.last_indexed_block_time).local().format()]})]}),(0,b.jsxs)(_.Z,{lg:{span:"10"},md:{span:"10"},sm:{span:"10"},xs:{span:"24"},children:[(0,b.jsxs)("div",{className:"text-base mt-1",children:[(0,b.jsxs)("span",{className:" font-semibold",children:[o,":"]}),m.cpuUsage]}),(0,b.jsxs)("div",{className:"text-base mt-1",children:[(0,b.jsxs)("span",{className:" font-semibold",children:[l,":"]}),m.netUsage]}),(0,b.jsxs)("div",{className:"text-base mt-1",children:[(0,b.jsxs)("span",{className:" font-semibold",children:[d,":"]}),m.ramUsage]})]})]})]})})})},A=(0,j.memo)(z);p().extend(g());var L=function(){var e=(0,x.useSelector)((function(e){return e.transaction.transaction})),a=(0,x.useSelector)((function(e){return e.transaction.loading})),t=(0,j.useState)([]),n=o()(t,2),s=n[0],r=n[1],i=(0,x.useNavigate)(),c=(0,x.useIntl)(),l=c.formatMessage({id:"transaction.intlLegend"}),m=c.formatMessage({id:"transaction.intlNotified"}),f=c.formatMessage({id:"transaction.intlReceiver"}),p=c.formatMessage({id:"transaction.intlAuthorized"}),v=(0,j.useCallback)((function(){var a=[];e.actions.forEach((function(e,t){a.push({key:t,contract:e.act.account,action:e.act.name,authorization:e.act.authorization.map((function(e){return e.actor+"@"+e.permission})),actors:e.act.authorization.map((function(e){return e.actor})),data:e.act.data,receivers:e.receipts.map((function(e){return e.receiver}))})})),r(a)}),[e]),g=(0,j.useCallback)((function(e){var a=e.action,t=Object.keys(e.data);if("transfer"===a){var n="";return e.data.quantity?n=e.data.quantity:e.data.assetid&&(n=e.data.assetid),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:" font-bold",children:[e.data.from," ",(0,b.jsx)(u.Z,{})," ",e.data.to," ",(0,b.jsx)(h.Z,{className:"ml-1",children:n})]}),!!e.data.memo&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:" font-bold",children:"memo: "}),e.data.memo]})]})}return(0,b.jsx)("div",{children:t.map((function(a,t){var n=e.data[a];return"object"===d()(n)&&null!=n?(n=(0,b.jsx)("pre",{children:JSON.stringify(e.data[a],null,2)}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("span",{className:" font-bold",children:[a,": "]})," ",n]},t)):(0,b.jsxs)("div",{children:[(0,b.jsxs)("span",{className:" font-bold",children:[a,": "]})," ",n]},t)}))})}),[]);return(0,j.useEffect)((function(){v()}),[v]),(0,b.jsx)(M.Z,{size:"large",spinning:a,children:(0,b.jsxs)("div",{className:"",children:[(0,b.jsxs)("div",{className:"font-semibold mb-3",children:[(0,b.jsx)("div",{children:l}),(0,b.jsxs)("div",{className:"flex",children:[(0,b.jsx)("div",{className:"pt-1 mr-1",children:(0,b.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{fill:"currentColor",d:"M5 19q-.425 0-.712-.288T4 18q0-.425.288-.712T5 17h1v-7q0-2.075 1.25-3.687T10.5 4.2v-.7q0-.625.438-1.062T12 2q.625 0 1.063.438T13.5 3.5v.7q2 .5 3.25 2.113T18 10v7h1q.425 0 .713.288T20 18q0 .425-.288.713T19 19zm7 3q-.825 0-1.412-.587T10 20h4q0 .825-.587 1.413T12 22"})})}),"- ",m," (",f,")"]}),(0,b.jsxs)("div",{className:"flex",children:[(0,b.jsx)("div",{className:"pt-1 mr-1",children:(0,b.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",children:(0,b.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M10.293 1.293a1 1 0 0 1 1.414 0l2 2a1 1 0 0 1-1.414 1.414L11 3.414L9.914 4.5l1.293 1.293a1 1 0 0 1-1.414 1.414L8.5 5.914L7.446 6.968a4 4 0 1 1-1.414-1.414l1.757-1.757l.004-.004l.004-.004zM2 9a2 2 0 1 1 4 0a2 2 0 0 1-4 0",clipRule:"evenodd"})})}),"- ",p]})]}),s.map((function(e,a){return(0,b.jsx)("div",{style:{border:"1px solid #e0e0e0",borderTop:0!==a?"0px solid #e0e0e0":"1px solid #e0e0e0",padding:"12px 0 12px 20px"},children:(0,b.jsxs)(C.Z,{gutter:10,className:"flex items-center",children:[(0,b.jsx)(_.Z,{lg:{span:"6"},md:{span:"6"},sm:{span:"24"},xs:{span:"24"},children:(0,b.jsx)("div",{className:"py-[6px]",children:e.receivers.map((function(a,t){return(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsxs)("div",{className:"w-[50px] flex",children:[(0,b.jsx)("div",{className:"pt-1 mr-1",children:(0,b.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{fill:"currentColor",d:"M5 19q-.425 0-.712-.288T4 18q0-.425.288-.712T5 17h1v-7q0-2.075 1.25-3.687T10.5 4.2v-.7q0-.625.438-1.062T12 2q.625 0 1.063.438T13.5 3.5v.7q2 .5 3.25 2.113T18 10v7h1q.425 0 .713.288T20 18q0 .425-.288.713T19 19zm7 3q-.825 0-1.412-.587T10 20h4q0 .825-.587 1.413T12 22"})})}),!!e.actors.includes(a)&&(0,b.jsx)("div",{className:"pt-1",children:(0,b.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",children:(0,b.jsx)("path",{fill:"currentColor",fillRule:"evenodd",d:"M10.293 1.293a1 1 0 0 1 1.414 0l2 2a1 1 0 0 1-1.414 1.414L11 3.414L9.914 4.5l1.293 1.293a1 1 0 0 1-1.414 1.414L8.5 5.914L7.446 6.968a4 4 0 1 1-1.414-1.414l1.757-1.757l.004-.004l.004-.004zM2 9a2 2 0 1 1 4 0a2 2 0 0 1-4 0",clipRule:"evenodd"})})})]}),(0,b.jsx)("a",{onClick:function(){return i("/query/account?search=".concat(a,"&tab=info"))},children:a})]},t)}))})}),(0,b.jsx)(_.Z,{lg:{span:"6"},md:{span:"6"},sm:{span:"24"},xs:{span:"24"},children:(0,b.jsx)("div",{className:"py-[6px]",children:(0,b.jsx)(h.Z,{color:"blue",children:e.contract+"-"+e.action})})}),(0,b.jsx)(_.Z,{lg:{span:"12"},md:{span:"12"},sm:{span:"24"},xs:{span:"24"},children:(0,b.jsx)("div",{className:"py-[6px]",children:g(e)})})]})},a)}))]})})},O=(0,j.memo)(L),R=t(90098),B=t(11774),E=t(38345),I=t(69677),P=t(92398),U=t(9669),K=t.n(U),F=(t(31145),function(){var e=k.ZP.useMessage(),a=o()(e,2),t=a[0],n=a[1],r=(0,x.useDispatch)(),c=(0,x.useSelector)((function(e){return e.transaction.activeKey})),l=(0,x.useSelector)((function(e){return e.transaction.txid})),d=(0,x.useSelector)((function(e){return e.transaction.transaction})),u=(0,x.useSelector)((function(e){return e.transaction.loading})),m=(0,x.useSelector)((function(e){return e.transaction.totalActions})),h=(0,x.useSelector)((function(e){return e.transaction.totalTraces})),f=(0,j.useState)(""),p=o()(f,2),v=p[0],g=p[1],N=(0,x.useSearchParams)(),w=o()(N,2),T=w[0],S=w[1],C=T.get("tab")?T.get("tab"):void 0,_=(0,x.useIntl)(),z=_.formatMessage({id:"transaction.intlTransaction"}),L=_.formatMessage({id:"transaction.intlSearch"}),U=_.formatMessage({id:"transaction.intlTransactionFormatError"}),F=_.formatMessage({id:"transaction.intlSearchTransaction"}),J=_.formatMessage({id:"transaction.intlActions"}),D=_.formatMessage({id:"transaction.intlSummary"}),$=_.formatMessage({id:"transaction.intlTraces"}),W=_.formatMessage({id:"transaction.intlRaw"}),G=(0,j.useMemo)((function(){return d?d.trx_id:""}),[d]),H=(0,j.useCallback)(function(){var e=i()(s()().mark((function e(a,n){var i,c,l,d;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(/^[a-f0-9]{64}$/.test(a)){e.next=8;break}if(a||n.hasOwnProperty("type")){e.next=6;break}return e.abrupt("return",!1);case 6:return t.error("".concat(U)),e.abrupt("return",!1);case 8:return r(R.N.setLoading(!0)),e.next=11,(0,q.zI)(K().get("https://api2.dfsmoon.com/v2/history/get_transaction?id=".concat(a)));case 11:if(i=e.sent,c=o()(i,2),l=c[0],d=c[1],l||200!==d.status){e.next=22;break}r(R.N.setTotalActions(d.data.actions.length)),r(R.N.setTotalTraces(d.data.actions.length)),r(R.N.setTransaction(d.data)),r(R.N.setTxid(d.data.trx_id)),e.next=25;break;case 22:return r(R.N.setLoading(!1)),t.error(l),e.abrupt("return");case 25:r(R.N.setLoading(!1));case 26:case"end":return e.stop()}}),e)})));return function(a,t){return e.apply(this,arguments)}}(),[t]),Q=(0,j.useCallback)(function(){var e=i()(s()().mark((function e(a){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=a.target.value,/^[a-f0-9]{64}$/.test(t)||0===t.trim().length?g(""):g("error");case 3:case"end":return e.stop()}}),e)})));return function(a){return e.apply(this,arguments)}}(),[]),V=[{key:"summary",label:(0,b.jsx)("span",{className:"text-lg font-semibold",children:D}),children:!!d&&(0,b.jsx)(A,{})},{key:"actions",label:(0,b.jsxs)("span",{className:"text-lg font-semibold",children:[J,"(".concat(m,")")]}),children:!!d&&(0,b.jsx)(y,{})},{key:"traces",label:(0,b.jsxs)("span",{className:"text-lg font-semibold",children:[$,"(".concat(h,")")]}),children:!!d&&(0,b.jsx)(O,{})},{key:"raw",label:(0,b.jsx)("span",{className:"text-lg font-semibold",children:W}),children:!!d&&(0,b.jsx)(Z,{})},{key:"tip",label:(0,b.jsx)("span",{className:"text-lg font-semibold",children:G}),disabled:!0}],X=(0,j.useCallback)((function(e,a){var t={};e&&(t.search=e),t.tab=a||c,S(t)}),[c]);return(0,j.useEffect)((function(){var e=T.get("search"),a=T.get("tab");a&&r(R.N.setActiveKey(a)),e&&H(e,""),X(e,a)}),[H]),(0,j.useEffect)((function(){X(l||"",c)}),[l,c,X]),(0,b.jsxs)(B._z,{className:"transaction",ghost:!0,children:[(0,b.jsxs)(E.Z,{title:(0,b.jsx)("div",{className:"hardline font-semibold text-lg mb-3",children:F}),children:[(0,b.jsx)(I.Z.Search,{className:"",loading:u,addonBefore:(0,b.jsx)(M.Z,{spinning:u,children:z}),placeholder:"Search...",allowClear:!0,enterButton:L,size:"large",status:v,onSearch:H,onChange:Q}),(0,b.jsx)(P.Z,{className:"mt-2",defaultActiveKey:"summary",items:V,activeKey:C,onChange:function(e){r(R.N.setActiveKey(e))}})]}),n]})})},20034:function(){},31145:function(){}}]);