conflux-devkit 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -0
- package/dist/cli.js +16338 -0
- package/package.json +55 -0
- package/ui/out/404/index.html +1 -0
- package/ui/out/404.html +1 -0
- package/ui/out/_next/static/--YsNpX1nEj74gOnGiYDR/_buildManifest.js +1 -0
- package/ui/out/_next/static/--YsNpX1nEj74gOnGiYDR/_ssgManifest.js +1 -0
- package/ui/out/_next/static/-7MZn09F75tC02XxCAzYQ/_buildManifest.js +1 -0
- package/ui/out/_next/static/-7MZn09F75tC02XxCAzYQ/_ssgManifest.js +1 -0
- package/ui/out/_next/static/-Yup9TU2qbfFuEoVK7cV3/_buildManifest.js +1 -0
- package/ui/out/_next/static/-Yup9TU2qbfFuEoVK7cV3/_ssgManifest.js +1 -0
- package/ui/out/_next/static/2FNwKfitLrla-BD4Pvi7U/_buildManifest.js +1 -0
- package/ui/out/_next/static/2FNwKfitLrla-BD4Pvi7U/_ssgManifest.js +1 -0
- package/ui/out/_next/static/3dg2q5Zn_zf7tMeBD4-2x/_buildManifest.js +1 -0
- package/ui/out/_next/static/3dg2q5Zn_zf7tMeBD4-2x/_ssgManifest.js +1 -0
- package/ui/out/_next/static/EMBrL2fIteEXHVOa9QqbR/_buildManifest.js +1 -0
- package/ui/out/_next/static/EMBrL2fIteEXHVOa9QqbR/_ssgManifest.js +1 -0
- package/ui/out/_next/static/HC9l66u-S82fZ45n1NJvV/_buildManifest.js +1 -0
- package/ui/out/_next/static/HC9l66u-S82fZ45n1NJvV/_ssgManifest.js +1 -0
- package/ui/out/_next/static/JDizq7Hn5WLnElAxCtqyg/_buildManifest.js +1 -0
- package/ui/out/_next/static/JDizq7Hn5WLnElAxCtqyg/_ssgManifest.js +1 -0
- package/ui/out/_next/static/KVufTmdF91v3IsRvyub2i/_buildManifest.js +1 -0
- package/ui/out/_next/static/KVufTmdF91v3IsRvyub2i/_ssgManifest.js +1 -0
- package/ui/out/_next/static/UVWp8ZgmXIqxga6tJZU2j/_buildManifest.js +1 -0
- package/ui/out/_next/static/UVWp8ZgmXIqxga6tJZU2j/_ssgManifest.js +1 -0
- package/ui/out/_next/static/WVZ0izyd9YpKZhSNF1OSe/_buildManifest.js +1 -0
- package/ui/out/_next/static/WVZ0izyd9YpKZhSNF1OSe/_ssgManifest.js +1 -0
- package/ui/out/_next/static/_jTgcoBsv_xqKZx36-jrD/_buildManifest.js +1 -0
- package/ui/out/_next/static/_jTgcoBsv_xqKZx36-jrD/_ssgManifest.js +1 -0
- package/ui/out/_next/static/_tUKGLiPpF-Ioygkq7-R9/_buildManifest.js +1 -0
- package/ui/out/_next/static/_tUKGLiPpF-Ioygkq7-R9/_ssgManifest.js +1 -0
- package/ui/out/_next/static/chunks/205-997c9580ac2ccb04.js +1 -0
- package/ui/out/_next/static/chunks/238-baf384d341a98f9f.js +1 -0
- package/ui/out/_next/static/chunks/363-11ecfe8307834c37.js +1 -0
- package/ui/out/_next/static/chunks/363-fd3f659dc66a2545.js +1 -0
- package/ui/out/_next/static/chunks/383-30e544e3db85d4b4.js +1 -0
- package/ui/out/_next/static/chunks/396-0d45f2627ca2432c.js +1 -0
- package/ui/out/_next/static/chunks/396-de3171781a3c5f52.js +1 -0
- package/ui/out/_next/static/chunks/476-1a499832716820dd.js +1 -0
- package/ui/out/_next/static/chunks/5b8f0dd8-7fc232be3e483640.js +1 -0
- package/ui/out/_next/static/chunks/5b8f0dd8-f9bbf8f44d8e6302.js +1 -0
- package/ui/out/_next/static/chunks/606-d510a7806cc50e18.js +1 -0
- package/ui/out/_next/static/chunks/628-ae8f2280d891101c.js +1 -0
- package/ui/out/_next/static/chunks/69-a23845cfa4a23071.js +1 -0
- package/ui/out/_next/static/chunks/706-142eb06ca4e1b468.js +1 -0
- package/ui/out/_next/static/chunks/749-27e561f3f17b1ad3.js +2 -0
- package/ui/out/_next/static/chunks/749-bd8c206e8e58f8b0.js +2 -0
- package/ui/out/_next/static/chunks/781-7af4662532da98ca.js +1 -0
- package/ui/out/_next/static/chunks/815-ab30cec2ff88e700.js +1 -0
- package/ui/out/_next/static/chunks/826-c38d836f8f2bac38.js +1 -0
- package/ui/out/_next/static/chunks/903-2887fe814dfa6d5e.js +1 -0
- package/ui/out/_next/static/chunks/app/_not-found/page-1a3d8ff7bd6fafe6.js +1 -0
- package/ui/out/_next/static/chunks/app/_not-found/page-fe94df087cbbeedb.js +1 -0
- package/ui/out/_next/static/chunks/app/accounts/page-21a02cc8bbbce9cf.js +1 -0
- package/ui/out/_next/static/chunks/app/accounts/page-2bf2eeddfcc46fd2.js +1 -0
- package/ui/out/_next/static/chunks/app/accounts/page-4fb77d9b03c79ef0.js +1 -0
- package/ui/out/_next/static/chunks/app/accounts/page-840e013892222293.js +1 -0
- package/ui/out/_next/static/chunks/app/accounts/page-8828d6c27ee45d5e.js +1 -0
- package/ui/out/_next/static/chunks/app/accounts/page-a5a4d066c57c6eba.js +1 -0
- package/ui/out/_next/static/chunks/app/accounts/page-cd6edb16de77e73a.js +1 -0
- package/ui/out/_next/static/chunks/app/accounts/page-ce44f544affcbb2e.js +1 -0
- package/ui/out/_next/static/chunks/app/accounts/page-f26a4c8967b60c31.js +1 -0
- package/ui/out/_next/static/chunks/app/accounts/page-fc53feb7e5bf6a0b.js +1 -0
- package/ui/out/_next/static/chunks/app/accounts/page-fe5a9daa4d22e115.js +1 -0
- package/ui/out/_next/static/chunks/app/contracts/page-091eba53f5dcb62b.js +1 -0
- package/ui/out/_next/static/chunks/app/contracts/page-265c4f26532b42ce.js +1 -0
- package/ui/out/_next/static/chunks/app/contracts/page-26c527bf8b829de6.js +1 -0
- package/ui/out/_next/static/chunks/app/contracts/page-53e2d2d715f76290.js +1 -0
- package/ui/out/_next/static/chunks/app/contracts/page-56d74025e6315a3d.js +1 -0
- package/ui/out/_next/static/chunks/app/contracts/page-844c9f55a6ec9218.js +1 -0
- package/ui/out/_next/static/chunks/app/contracts/page-88416cc33eabdddb.js +1 -0
- package/ui/out/_next/static/chunks/app/contracts/page-9361399f80e19ab7.js +1 -0
- package/ui/out/_next/static/chunks/app/contracts/page-afebd14c1ae73ec9.js +1 -0
- package/ui/out/_next/static/chunks/app/contracts/page-b0f74db982762c7e.js +1 -0
- package/ui/out/_next/static/chunks/app/contracts/page-d88227b11f5ac4f6.js +1 -0
- package/ui/out/_next/static/chunks/app/contracts/page-e454dad9b03f36df.js +1 -0
- package/ui/out/_next/static/chunks/app/contracts/page-f269686063be5d4b.js +1 -0
- package/ui/out/_next/static/chunks/app/layout-0bf0ed51d0d1d3e8.js +1 -0
- package/ui/out/_next/static/chunks/app/layout-56f011c6a6b2930f.js +1 -0
- package/ui/out/_next/static/chunks/app/layout-7422dc714ea7b763.js +1 -0
- package/ui/out/_next/static/chunks/app/layout-88938a963d68eb45.js +1 -0
- package/ui/out/_next/static/chunks/app/layout-a1d424de4fc1d283.js +1 -0
- package/ui/out/_next/static/chunks/app/layout-add77f8e78dbfbf5.js +1 -0
- package/ui/out/_next/static/chunks/app/layout-c087511efc77c1ef.js +1 -0
- package/ui/out/_next/static/chunks/app/layout-eaaaddaebabc1e84.js +1 -0
- package/ui/out/_next/static/chunks/app/layout-ecbbc3f527378bf4.js +1 -0
- package/ui/out/_next/static/chunks/app/layout-f8c5fec65e6ca0ff.js +1 -0
- package/ui/out/_next/static/chunks/app/mining/page-14579efdb2e8f6c3.js +1 -0
- package/ui/out/_next/static/chunks/app/mining/page-1e273a4949e2b650.js +1 -0
- package/ui/out/_next/static/chunks/app/mining/page-2d151bdd475474f6.js +1 -0
- package/ui/out/_next/static/chunks/app/mining/page-43cfe0d01f696e96.js +1 -0
- package/ui/out/_next/static/chunks/app/mining/page-4ab3daab428e05f1.js +1 -0
- package/ui/out/_next/static/chunks/app/mining/page-64c88d55a5788e20.js +1 -0
- package/ui/out/_next/static/chunks/app/mining/page-79e2f952fc54ff89.js +1 -0
- package/ui/out/_next/static/chunks/app/mining/page-8305d73847b829c9.js +1 -0
- package/ui/out/_next/static/chunks/app/mining/page-ab0458f12921230c.js +1 -0
- package/ui/out/_next/static/chunks/app/mining/page-ac2a555e62327efe.js +1 -0
- package/ui/out/_next/static/chunks/app/mining/page-bb3068075a8088dd.js +1 -0
- package/ui/out/_next/static/chunks/app/mining/page-d4bad0ff79dd463a.js +1 -0
- package/ui/out/_next/static/chunks/app/network/page-3d5fbcf1eb37e0c5.js +1 -0
- package/ui/out/_next/static/chunks/app/network/page-4b692d29a3e609a8.js +1 -0
- package/ui/out/_next/static/chunks/app/network/page-5e33fbeb3a40de20.js +1 -0
- package/ui/out/_next/static/chunks/app/network/page-62a4488ea3bc2526.js +1 -0
- package/ui/out/_next/static/chunks/app/network/page-97cebccc451eb5c6.js +1 -0
- package/ui/out/_next/static/chunks/app/network/page-a50ebf9988b322b5.js +1 -0
- package/ui/out/_next/static/chunks/app/network/page-d7c0ceaa242f38f9.js +1 -0
- package/ui/out/_next/static/chunks/app/network/page-e152fafa7a4d7361.js +1 -0
- package/ui/out/_next/static/chunks/app/network/page-eea297c1ae180bda.js +1 -0
- package/ui/out/_next/static/chunks/app/network/page-f3c51db982b5a388.js +1 -0
- package/ui/out/_next/static/chunks/app/network/page-f51d9ab619db1c20.js +1 -0
- package/ui/out/_next/static/chunks/app/network/page-f6b4c10c7d87957f.js +1 -0
- package/ui/out/_next/static/chunks/app/page-165b6a1747a64947.js +1 -0
- package/ui/out/_next/static/chunks/app/page-348c96e8d45c2559.js +1 -0
- package/ui/out/_next/static/chunks/app/page-3632f4f09f69c905.js +1 -0
- package/ui/out/_next/static/chunks/app/page-36afbe5e1cb8094f.js +1 -0
- package/ui/out/_next/static/chunks/app/page-557bd6270c5ad579.js +1 -0
- package/ui/out/_next/static/chunks/app/page-6d79f31ac0288bac.js +1 -0
- package/ui/out/_next/static/chunks/app/page-71fcaf2853c53e30.js +1 -0
- package/ui/out/_next/static/chunks/app/page-90d8520902c1a7b0.js +1 -0
- package/ui/out/_next/static/chunks/app/page-c430d30cb894c926.js +1 -0
- package/ui/out/_next/static/chunks/app/page-ce0f985468520dbc.js +1 -0
- package/ui/out/_next/static/chunks/app/page-f0dced734181e611.js +1 -0
- package/ui/out/_next/static/chunks/app/page-f27633bfbc515249.js +1 -0
- package/ui/out/_next/static/chunks/app/page-f7be59ea4e13f436.js +1 -0
- package/ui/out/_next/static/chunks/app/wallet/page-11fb46a5f4a8b0be.js +1 -0
- package/ui/out/_next/static/chunks/app/wallet/page-26003843604c7c8c.js +1 -0
- package/ui/out/_next/static/chunks/app/wallet/page-7041ba96cf94b9d6.js +1 -0
- package/ui/out/_next/static/chunks/app/wallet/page-716e9207662cbb13.js +1 -0
- package/ui/out/_next/static/chunks/app/wallet/page-74cdd3297d391701.js +1 -0
- package/ui/out/_next/static/chunks/app/wallet/page-766c3286d7fc1fbb.js +1 -0
- package/ui/out/_next/static/chunks/app/wallet/page-a3e3f3f091deed13.js +1 -0
- package/ui/out/_next/static/chunks/app/wallet/page-fb7030a6672345f4.js +1 -0
- package/ui/out/_next/static/chunks/app/wallet/page-feeafe9afcd3702d.js +1 -0
- package/ui/out/_next/static/chunks/framework-bef83a85c94ff7de.js +1 -0
- package/ui/out/_next/static/chunks/main-764c1d152dd64cdb.js +1 -0
- package/ui/out/_next/static/chunks/main-app-565ce517a559065d.js +1 -0
- package/ui/out/_next/static/chunks/pages/_app-32ee63fa91347547.js +1 -0
- package/ui/out/_next/static/chunks/pages/_error-79ee453ce9bad74d.js +1 -0
- package/ui/out/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/ui/out/_next/static/chunks/webpack-ea02740f160b546a.js +1 -0
- package/ui/out/_next/static/css/0f4a493f8c2c55db.css +3 -0
- package/ui/out/_next/static/css/4169c0d861da624d.css +3 -0
- package/ui/out/_next/static/css/42c642225833b63d.css +3 -0
- package/ui/out/_next/static/css/4ec6b37afd49be73.css +3 -0
- package/ui/out/_next/static/css/6a8f3e28ef1137c2.css +3 -0
- package/ui/out/_next/static/css/6bbaea3800a74df9.css +3 -0
- package/ui/out/_next/static/css/73f87001fc8b2a52.css +3 -0
- package/ui/out/_next/static/css/90ccf9db21744740.css +3 -0
- package/ui/out/_next/static/css/9f0d4e440a0f0806.css +3 -0
- package/ui/out/_next/static/css/b1a2c26b7bd10f8d.css +3 -0
- package/ui/out/_next/static/css/c97b9630f605a98b.css +3 -0
- package/ui/out/_next/static/css/e5751e31c7620a6e.css +3 -0
- package/ui/out/_next/static/ezlluEQnUi2an273EFR3C/_buildManifest.js +1 -0
- package/ui/out/_next/static/ezlluEQnUi2an273EFR3C/_ssgManifest.js +1 -0
- package/ui/out/_next/static/ghzWYfWuW8Y8XavA7qfLx/_buildManifest.js +1 -0
- package/ui/out/_next/static/ghzWYfWuW8Y8XavA7qfLx/_ssgManifest.js +1 -0
- package/ui/out/_next/static/hzvSbCbk7BhWq0LE5xqx1/_buildManifest.js +1 -0
- package/ui/out/_next/static/hzvSbCbk7BhWq0LE5xqx1/_ssgManifest.js +1 -0
- package/ui/out/_next/static/p4x_NRy3wdFgXa-RI9_BQ/_buildManifest.js +1 -0
- package/ui/out/_next/static/p4x_NRy3wdFgXa-RI9_BQ/_ssgManifest.js +1 -0
- package/ui/out/_next/static/uKnkegMpJr2nHM4qD8J3D/_buildManifest.js +1 -0
- package/ui/out/_next/static/uKnkegMpJr2nHM4qD8J3D/_ssgManifest.js +1 -0
- package/ui/out/_next/static/vAN91b7edxmzrsDueacJ6/_buildManifest.js +1 -0
- package/ui/out/_next/static/vAN91b7edxmzrsDueacJ6/_ssgManifest.js +1 -0
- package/ui/out/accounts/index.html +1 -0
- package/ui/out/accounts/index.txt +9 -0
- package/ui/out/contracts/index.html +1 -0
- package/ui/out/contracts/index.txt +9 -0
- package/ui/out/index.html +1 -0
- package/ui/out/index.txt +9 -0
- package/ui/out/mining/index.html +1 -0
- package/ui/out/mining/index.txt +9 -0
- package/ui/out/network/index.html +1 -0
- package/ui/out/network/index.txt +9 -0
- package/ui/out/wallet/index.html +1 -0
- package/ui/out/wallet/index.txt +9 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[617],{1415:function(e,t,s){Promise.resolve().then(s.bind(s,7828))},7828:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return x}});var n=s(5853),a=s(4852),i=s(8990),l=s(6632),r=s(4254),c=s(1494),o=s(6444),u=s(5175),d=s(2846),m=s(8144);function x(){var e,t;let s=(0,a.NL)(),[x,h]=(0,r.useState)("1"),[p,f]=(0,r.useState)("1000"),[g,v]=(0,r.useState)(""),{data:y}=(0,i.a)({queryKey:["mining","status"],queryFn:m.mI.status,refetchInterval:2e3}),N=(0,l.D)({mutationFn:()=>m.mI.mine(Number(x)),onSuccess:e=>{v("✓ Mined ".concat(e.mined," block(s)")),s.invalidateQueries({queryKey:["mining"]})},onError:e=>v("✗ ".concat(e.message))}),j=(0,l.D)({mutationFn:()=>m.mI.start(Number(p)),onSuccess:()=>s.invalidateQueries({queryKey:["mining"]})}),b=(0,l.D)({mutationFn:m.mI.stop,onSuccess:()=>s.invalidateQueries({queryKey:["mining"]})}),k=N.isPending||j.isPending||b.isPending;return(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Mining"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"Manually mine blocks or configure auto-mining"})]}),(0,n.jsxs)("div",{className:"card flex items-center gap-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"label",children:"Auto-mining"}),(0,n.jsx)("span",{className:(null==y?void 0:y.isRunning)?"badge-green":"badge-gray",children:(null==y?void 0:y.isRunning)?"On":"Off"})]}),(null==y?void 0:y.isRunning)&&void 0!==y.interval&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"label",children:"Block time"}),(0,n.jsxs)("span",{className:"text-sm text-slate-300",children:[y.interval," ms"]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"label",children:"Blocks mined"}),(0,n.jsx)("span",{className:"text-sm text-slate-300",children:null!==(e=null==y?void 0:y.blocksMined)&&void 0!==e?e:"—"})]})]}),(0,n.jsxs)("div",{className:"card space-y-3",children:[(0,n.jsxs)("h2",{className:"flex items-center gap-2 text-sm font-medium text-white",children:[(0,n.jsx)(c.Z,{className:"h-4 w-4 text-slate-400"})," Manual Mine"]}),(0,n.jsxs)("div",{className:"flex items-end gap-3",children:[(0,n.jsxs)("div",{className:"w-32",children:[(0,n.jsx)("label",{className:"label",children:"Blocks"}),(0,n.jsx)("input",{className:"input",type:"number",min:"1",max:"1000",value:x,onChange:e=>h(e.target.value)})]}),(0,n.jsxs)("button",{type:"button",className:"btn-primary",disabled:k,onClick:()=>N.mutate(),children:[(0,n.jsx)(o.Z,{className:"h-4 w-4"}),N.isPending?"Mining…":"Mine"]})]}),g&&(0,n.jsx)("p",{className:"text-sm ".concat(g.startsWith("✓")?"text-green-400":"text-red-400"),children:g})]}),(0,n.jsxs)("div",{className:"card space-y-3",children:[(0,n.jsxs)("h2",{className:"flex items-center gap-2 text-sm font-medium text-white",children:[(0,n.jsx)(u.Z,{className:"h-4 w-4 text-slate-400"})," Auto-mining"]}),(0,n.jsxs)("div",{className:"flex items-end gap-3",children:[(0,n.jsxs)("div",{className:"w-40",children:[(0,n.jsx)("label",{className:"label",children:"Interval (ms)"}),(0,n.jsx)("input",{className:"input",type:"number",min:"100",value:p,disabled:null==y?void 0:y.isRunning,onChange:e=>f(e.target.value)})]}),(null==y?void 0:y.isRunning)?(0,n.jsxs)("button",{type:"button",className:"btn-danger",disabled:k,onClick:()=>b.mutate(),children:[(0,n.jsx)(d.Z,{className:"h-4 w-4"})," Stop Auto-mine"]}):(0,n.jsxs)("button",{type:"button",className:"btn-success",disabled:k,onClick:()=>j.mutate(),children:[(0,n.jsx)(u.Z,{className:"h-4 w-4"})," Start Auto-mine"]})]}),(j.error||b.error)&&(0,n.jsx)("p",{className:"text-sm text-red-400",children:String(null!==(t=j.error)&&void 0!==t?t:b.error)})]})]})}},8144:function(e,t,s){"use strict";s.d(t,{N9:function(){return d},SC:function(){return f},SX:function(){return m},Vp:function(){return x},fA:function(){return p},mI:function(){return h}});var n,a=s(2608);let i="".concat(null!==(n=a.env.NEXT_PUBLIC_API_URL)&&void 0!==n?n:"","/api");async function l(e,t,s){let n=await fetch("".concat(i).concat(t),{method:e,headers:s?{"Content-Type":"application/json"}:void 0,body:s?JSON.stringify(s):void 0});if(!n.ok){var a;throw Error(null!==(a=(await n.json().catch(()=>({error:n.statusText}))).error)&&void 0!==a?a:n.statusText)}return n.json()}let r=e=>l("GET",e),c=(e,t)=>l("POST",e,t),o=(e,t)=>l("PUT",e,t),u=e=>l("DELETE",e),d={status:()=>r("/node/status"),start:()=>c("/node/start"),stop:()=>c("/node/stop"),restart:()=>c("/node/restart"),restartWipe:()=>c("/node/restart-wipe")},m={list:()=>r("/accounts"),faucet:()=>r("/accounts/faucet"),fund:(e,t,s)=>c("/accounts/fund",{address:e,amount:t,chain:s})},x={templates:()=>r("/contracts/templates"),template:e=>r("/contracts/templates/".concat(e)),compile:(e,t)=>c("/contracts/compile",{source:e,contractName:t}),deploy:e=>c("/contracts/deploy",e)},h={status:()=>r("/mining/status"),mine:e=>c("/mining/mine",{blocks:e}),start:e=>c("/mining/start",{intervalMs:e}),stop:()=>c("/mining/stop")},p={config:()=>r("/network/config"),updateConfig:e=>o("/network/config",e),rpcUrls:()=>r("/network/rpc-urls")},f={status:()=>r("/keystore/status"),generate:()=>c("/keystore/generate"),setup:e=>c("/keystore/setup",e),unlock:e=>c("/keystore/unlock",{password:e}),lock:()=>c("/keystore/lock"),wallets:()=>r("/keystore/wallets"),addWallet:(e,t)=>c("/keystore/wallets",{mnemonic:e,label:t}),activateWallet:e=>c("/keystore/wallets/".concat(e,"/activate")),deleteWallet:e=>u("/keystore/wallets/".concat(e))}},1494:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]])},5175:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},2846:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]])},6444:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])}},function(e){e.O(0,[363,285,749,744],function(){return e(e.s=1415)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[561],{9951:function(e,t,n){Promise.resolve().then(n.bind(n,484))},484:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return m}});var s=n(5853),r=n(4852),a=n(8990),c=n(6632),o=n(9928),i=n(3264),l=n(3737),d=n(4254),u=n(8144);function p(e){let{text:t}=e,[n,r]=(0,d.useState)(!1);return(0,s.jsx)("button",{type:"button",title:"Copy",className:"rounded p-1 text-slate-500 hover:text-slate-300",onClick:async()=>{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),1500)},children:n?(0,s.jsx)(o.Z,{className:"h-3.5 w-3.5 text-green-400"}):(0,s.jsx)(i.Z,{className:"h-3.5 w-3.5"})})}function m(){let e=(0,r.NL)(),[t,n]=(0,d.useState)(null),[o,i]=(0,d.useState)(""),{data:m}=(0,a.a)({queryKey:["node","status"],queryFn:u.N9.status,refetchInterval:3e3}),{data:h}=(0,a.a)({queryKey:["network","config"],queryFn:u.fA.config}),{data:f}=(0,a.a)({queryKey:["network","rpc-urls"],queryFn:u.fA.rpcUrls});(0,d.useEffect)(()=>{h&&!t&&n({coreRpcPort:String(h.coreRpcPort),evmRpcPort:String(h.evmRpcPort),wsPort:String(h.wsPort),evmWsPort:String(h.evmWsPort),chainId:String(h.chainId),evmChainId:String(h.evmChainId)})},[h,t]);let x=(0,c.D)({mutationFn:e=>u.fA.updateConfig({coreRpcPort:Number(e.coreRpcPort),evmRpcPort:Number(e.evmRpcPort),wsPort:Number(e.wsPort),evmWsPort:Number(e.evmWsPort),chainId:Number(e.chainId),evmChainId:Number(e.evmChainId)}),onSuccess:()=>{i("✓ Saved"),setTimeout(()=>i(""),2500),e.invalidateQueries({queryKey:["network"]})},onError:e=>i("✗ ".concat(e.message))}),v=(null==m?void 0:m.server)==="running",y=(e,r)=>{var a;return(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"label",children:e}),(0,s.jsx)("input",{className:"input",type:"number",disabled:v,value:null!==(a=null==t?void 0:t[r])&&void 0!==a?a:"",onChange:e=>n(t=>t?{...t,[r]:e.target.value}:t)})]},r)};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Network"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"RPC ports and chain IDs — editable only when node is stopped"})]}),v&&(0,s.jsx)("div",{className:"rounded-md border border-yellow-800 bg-yellow-950/50 px-4 py-2 text-sm text-yellow-400",children:"Stop the node before changing configuration."}),t&&(0,s.jsxs)("div",{className:"card space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3",children:[y("Core RPC Port","coreRpcPort"),y("EVM RPC Port","evmRpcPort"),y("Core WS Port","wsPort"),y("EVM WS Port","evmWsPort"),y("Core Chain ID","chainId"),y("EVM Chain ID","evmChainId")]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsxs)("button",{type:"button",className:"btn-primary",disabled:v||x.isPending,onClick:()=>t&&x.mutate(t),children:[(0,s.jsx)(l.Z,{className:"h-4 w-4"}),x.isPending?"Saving…":"Save"]}),o&&(0,s.jsx)("span",{className:"text-sm ".concat(o.startsWith("✓")?"text-green-400":"text-red-400"),children:o})]})]}),f&&(0,s.jsxs)("div",{className:"card space-y-3",children:[(0,s.jsx)("h2",{className:"text-sm font-medium text-slate-300",children:"Active RPC URLs"}),[["Core RPC",f.core],["EVM RPC",f.evm],["Core WebSocket",f.coreWs],["EVM WebSocket",f.evmWs]].map(e=>{let[t,n]=e;return(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("span",{className:"w-28 text-xs text-slate-500",children:t}),(0,s.jsxs)("div",{className:"flex flex-1 items-center overflow-hidden",children:[(0,s.jsx)("code",{className:"flex-1 truncate rounded bg-[#0e1117] px-2 py-1 text-xs text-blue-300",children:n}),(0,s.jsx)(p,{text:n})]})]},t)})]})]})}},8144:function(e,t,n){"use strict";n.d(t,{N9:function(){return u},SC:function(){return x},SX:function(){return p},Vp:function(){return m},fA:function(){return f},mI:function(){return h},pJ:function(){return v}});var s,r=n(2608);let a="".concat(null!==(s=r.env.NEXT_PUBLIC_API_URL)&&void 0!==s?s:"","/api");async function c(e,t,n){let s=await fetch("".concat(a).concat(t),{method:e,headers:n?{"Content-Type":"application/json"}:void 0,body:n?JSON.stringify(n):void 0});if(!s.ok){var r;throw Error(null!==(r=(await s.json().catch(()=>({error:s.statusText}))).error)&&void 0!==r?r:s.statusText)}return s.json()}let o=e=>c("GET",e),i=(e,t)=>c("POST",e,t),l=e=>c("DELETE",e),d=(e,t)=>c("PUT",e,t),u={status:()=>o("/node/status"),start:()=>i("/node/start"),stop:()=>i("/node/stop"),restart:()=>i("/node/restart"),restartWipe:()=>i("/node/restart-wipe"),wipe:()=>i("/node/wipe")},p={list:()=>o("/accounts"),faucet:()=>o("/accounts/faucet"),fund:(e,t,n)=>i("/accounts/fund",{address:e,amount:t,chain:n})},m={templates:()=>o("/contracts/templates"),template:e=>o("/contracts/templates/".concat(e)),compile:(e,t)=>i("/contracts/compile",{source:e,contractName:t}),deploy:e=>i("/contracts/deploy",e),deployed:e=>o("/contracts/deployed".concat(e?"?chain=".concat(e):"")),deleteDeployed:e=>l("/contracts/deployed/".concat(e)),call:(e,t,n,s)=>i("/contracts/".concat(e,"/call"),{functionName:t,args:n,accountIndex:s})},h={status:()=>o("/mining/status"),mine:e=>i("/mining/mine",{blocks:e}),start:e=>i("/mining/start",{intervalMs:e}),stop:()=>i("/mining/stop")},f={config:()=>o("/network/config"),updateConfig:e=>d("/network/config",e),rpcUrls:()=>o("/network/rpc-urls")},x={status:()=>o("/keystore/status"),generate:()=>i("/keystore/generate"),setup:e=>i("/keystore/setup",e),unlock:e=>i("/keystore/unlock",{password:e}),lock:()=>i("/keystore/lock"),wallets:()=>o("/keystore/wallets"),addWallet:(e,t)=>i("/keystore/wallets",{mnemonic:e,label:t}),activateWallet:e=>i("/keystore/wallets/".concat(e,"/activate")),deleteWallet:e=>l("/keystore/wallets/".concat(e))},v={get:()=>o("/settings")}},9928:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]])},3264:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},3737:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])}},function(e){e.O(0,[363,285,749,744],function(){return e(e.s=9951)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[561],{9951:function(e,t,n){Promise.resolve().then(n.bind(n,484))},484:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return m}});var s=n(5853),r=n(4852),a=n(8990),c=n(6632),o=n(4254),i=n(9928),l=n(3264),d=n(3737),u=n(8144);function p(e){let{text:t}=e,[n,r]=(0,o.useState)(!1);return(0,s.jsx)("button",{type:"button",title:"Copy",className:"rounded p-1 text-slate-500 hover:text-slate-300",onClick:async()=>{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),1500)},children:n?(0,s.jsx)(i.Z,{className:"h-3.5 w-3.5 text-green-400"}):(0,s.jsx)(l.Z,{className:"h-3.5 w-3.5"})})}function m(){let e=(0,r.NL)(),[t,n]=(0,o.useState)(null),[i,l]=(0,o.useState)(""),{data:m}=(0,a.a)({queryKey:["node","status"],queryFn:u.N9.status,refetchInterval:3e3}),{data:h}=(0,a.a)({queryKey:["network","config"],queryFn:u.fA.config}),{data:f}=(0,a.a)({queryKey:["network","rpc-urls"],queryFn:u.fA.rpcUrls});(0,o.useEffect)(()=>{h&&!t&&n({coreRpcPort:String(h.coreRpcPort),evmRpcPort:String(h.evmRpcPort),wsPort:String(h.wsPort),evmWsPort:String(h.evmWsPort),chainId:String(h.chainId),evmChainId:String(h.evmChainId)})},[h,t]);let x=(0,c.D)({mutationFn:e=>u.fA.updateConfig({coreRpcPort:Number(e.coreRpcPort),evmRpcPort:Number(e.evmRpcPort),wsPort:Number(e.wsPort),evmWsPort:Number(e.evmWsPort),chainId:Number(e.chainId),evmChainId:Number(e.evmChainId)}),onSuccess:()=>{l("✓ Saved"),setTimeout(()=>l(""),2500),e.invalidateQueries({queryKey:["network"]})},onError:e=>l("✗ ".concat(e.message))}),v=(null==m?void 0:m.server)==="running",y=(e,r)=>{var a;return(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"label",children:e}),(0,s.jsx)("input",{className:"input",type:"number",disabled:v,value:null!==(a=null==t?void 0:t[r])&&void 0!==a?a:"",onChange:e=>n(t=>t?{...t,[r]:e.target.value}:t)})]},r)};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Network"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"RPC ports and chain IDs — editable only when node is stopped"})]}),v&&(0,s.jsx)("div",{className:"rounded-md border border-yellow-800 bg-yellow-950/50 px-4 py-2 text-sm text-yellow-400",children:"Stop the node before changing configuration."}),t&&(0,s.jsxs)("div",{className:"card space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3",children:[y("Core RPC Port","coreRpcPort"),y("EVM RPC Port","evmRpcPort"),y("Core WS Port","wsPort"),y("EVM WS Port","evmWsPort"),y("Core Chain ID","chainId"),y("EVM Chain ID","evmChainId")]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsxs)("button",{type:"button",className:"btn-primary",disabled:v||x.isPending,onClick:()=>t&&x.mutate(t),children:[(0,s.jsx)(d.Z,{className:"h-4 w-4"}),x.isPending?"Saving…":"Save"]}),i&&(0,s.jsx)("span",{className:"text-sm ".concat(i.startsWith("✓")?"text-green-400":"text-red-400"),children:i})]})]}),f&&(0,s.jsxs)("div",{className:"card space-y-3",children:[(0,s.jsx)("h2",{className:"text-sm font-medium text-slate-300",children:"Active RPC URLs"}),[["Core RPC",f.core],["EVM RPC",f.evm],["Core WebSocket",f.coreWs],["EVM WebSocket",f.evmWs]].map(e=>{let[t,n]=e;return(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("span",{className:"w-28 text-xs text-slate-500",children:t}),(0,s.jsxs)("div",{className:"flex flex-1 items-center overflow-hidden",children:[(0,s.jsx)("code",{className:"flex-1 truncate rounded bg-[#0e1117] px-2 py-1 text-xs text-blue-300",children:n}),(0,s.jsx)(p,{text:n})]})]},t)})]})]})}},8144:function(e,t,n){"use strict";n.d(t,{N9:function(){return u},SC:function(){return x},SX:function(){return p},Vp:function(){return m},fA:function(){return f},mI:function(){return h},pJ:function(){return v}});var s,r=n(2608);let a="".concat(null!==(s=r.env.NEXT_PUBLIC_API_URL)&&void 0!==s?s:"","/api");async function c(e,t,n){let s=await fetch("".concat(a).concat(t),{method:e,headers:n?{"Content-Type":"application/json"}:void 0,body:n?JSON.stringify(n):void 0});if(!s.ok){var r;throw Error(null!==(r=(await s.json().catch(()=>({error:s.statusText}))).error)&&void 0!==r?r:s.statusText)}return s.json()}let o=e=>c("GET",e),i=(e,t)=>c("POST",e,t),l=e=>c("DELETE",e),d=(e,t)=>c("PUT",e,t),u={status:()=>o("/node/status"),start:()=>i("/node/start"),stop:()=>i("/node/stop"),restart:()=>i("/node/restart"),restartWipe:()=>i("/node/restart-wipe"),wipe:()=>i("/node/wipe")},p={list:()=>o("/accounts"),faucet:()=>o("/accounts/faucet"),fund:(e,t,n)=>i("/accounts/fund",{address:e,amount:t,chain:n})},m={templates:()=>o("/contracts/templates"),template:e=>o("/contracts/templates/".concat(e)),compile:(e,t)=>i("/contracts/compile",{source:e,contractName:t}),deploy:e=>i("/contracts/deploy",e),deployed:e=>o("/contracts/deployed".concat(e?"?chain=".concat(e):"")),deleteDeployed:e=>l("/contracts/deployed/".concat(e)),call:(e,t,n,s)=>i("/contracts/".concat(e,"/call"),{functionName:t,args:n,accountIndex:s})},h={status:()=>o("/mining/status"),mine:e=>i("/mining/mine",{blocks:e}),start:e=>i("/mining/start",{intervalMs:e}),stop:()=>i("/mining/stop")},f={config:()=>o("/network/config"),updateConfig:e=>d("/network/config",e),rpcUrls:()=>o("/network/rpc-urls")},x={status:()=>o("/keystore/status"),generate:()=>i("/keystore/generate"),setup:e=>i("/keystore/setup",e),unlock:e=>i("/keystore/unlock",{password:e}),lock:()=>i("/keystore/lock"),wallets:()=>o("/keystore/wallets"),addWallet:(e,t)=>i("/keystore/wallets",{mnemonic:e,label:t}),activateWallet:e=>i("/keystore/wallets/".concat(e,"/activate")),deleteWallet:e=>l("/keystore/wallets/".concat(e))},v={get:()=>o("/settings")}},9928:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]])},3264:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},3737:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])}},function(e){e.O(0,[363,285,749,744],function(){return e(e.s=9951)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[561],{9951:function(e,t,s){Promise.resolve().then(s.bind(s,484))},484:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return p}});var n=s(5853),r=s(4852),a=s(8990),o=s(6632),c=s(4254),i=s(9928),l=s(3264),u=s(3737),d=s(8144);function m(e){let{text:t}=e,[s,r]=(0,c.useState)(!1);return(0,n.jsx)("button",{type:"button",title:"Copy",className:"rounded p-1 text-slate-500 hover:text-slate-300",onClick:async()=>{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),1500)},children:s?(0,n.jsx)(i.Z,{className:"h-3.5 w-3.5 text-green-400"}):(0,n.jsx)(l.Z,{className:"h-3.5 w-3.5"})})}function p(){let e=(0,r.NL)(),[t,s]=(0,c.useState)(null),[i,l]=(0,c.useState)(""),{data:p}=(0,a.a)({queryKey:["node","status"],queryFn:d.N9.status,refetchInterval:3e3}),{data:h}=(0,a.a)({queryKey:["network","config"],queryFn:d.fA.config}),{data:x}=(0,a.a)({queryKey:["network","rpc-urls"],queryFn:d.fA.rpcUrls});(0,c.useEffect)(()=>{h&&!t&&s({coreRpcPort:String(h.coreRpcPort),evmRpcPort:String(h.evmRpcPort),wsPort:String(h.wsPort),evmWsPort:String(h.evmWsPort),chainId:String(h.chainId),evmChainId:String(h.evmChainId)})},[h,t]);let f=(0,o.D)({mutationFn:e=>d.fA.updateConfig({coreRpcPort:Number(e.coreRpcPort),evmRpcPort:Number(e.evmRpcPort),wsPort:Number(e.wsPort),evmWsPort:Number(e.evmWsPort),chainId:Number(e.chainId),evmChainId:Number(e.evmChainId)}),onSuccess:()=>{l("✓ Saved"),setTimeout(()=>l(""),2500),e.invalidateQueries({queryKey:["network"]})},onError:e=>l("✗ ".concat(e.message))}),v=(null==p?void 0:p.server)==="running",y=(e,r)=>{var a;return(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"label",children:e}),(0,n.jsx)("input",{className:"input",type:"number",disabled:v,value:null!==(a=null==t?void 0:t[r])&&void 0!==a?a:"",onChange:e=>s(t=>t?{...t,[r]:e.target.value}:t)})]},r)};return(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Network"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"RPC ports and chain IDs — editable only when node is stopped"})]}),v&&(0,n.jsx)("div",{className:"rounded-md border border-yellow-800 bg-yellow-950/50 px-4 py-2 text-sm text-yellow-400",children:"Stop the node before changing configuration."}),t&&(0,n.jsxs)("div",{className:"card space-y-4",children:[(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3",children:[y("Core RPC Port","coreRpcPort"),y("EVM RPC Port","evmRpcPort"),y("Core WS Port","wsPort"),y("EVM WS Port","evmWsPort"),y("Core Chain ID","chainId"),y("EVM Chain ID","evmChainId")]}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsxs)("button",{type:"button",className:"btn-primary",disabled:v||f.isPending,onClick:()=>t&&f.mutate(t),children:[(0,n.jsx)(u.Z,{className:"h-4 w-4"}),f.isPending?"Saving…":"Save"]}),i&&(0,n.jsx)("span",{className:"text-sm ".concat(i.startsWith("✓")?"text-green-400":"text-red-400"),children:i})]})]}),x&&(0,n.jsxs)("div",{className:"card space-y-3",children:[(0,n.jsx)("h2",{className:"text-sm font-medium text-slate-300",children:"Active RPC URLs"}),[["Core RPC",x.core],["EVM RPC",x.evm],["Core WebSocket",x.coreWs],["EVM WebSocket",x.evmWs]].map(e=>{let[t,s]=e;return(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsx)("span",{className:"w-28 text-xs text-slate-500",children:t}),(0,n.jsxs)("div",{className:"flex flex-1 items-center overflow-hidden",children:[(0,n.jsx)("code",{className:"flex-1 truncate rounded bg-[#0e1117] px-2 py-1 text-xs text-blue-300",children:s}),(0,n.jsx)(m,{text:s})]})]},t)})]})]})}},8144:function(e,t,s){"use strict";s.d(t,{N9:function(){return d},SC:function(){return f},SX:function(){return m},Vp:function(){return p},fA:function(){return x},mI:function(){return h}});var n,r=s(2608);let a="".concat(null!==(n=r.env.NEXT_PUBLIC_API_URL)&&void 0!==n?n:"","/api");async function o(e,t,s){let n=await fetch("".concat(a).concat(t),{method:e,headers:s?{"Content-Type":"application/json"}:void 0,body:s?JSON.stringify(s):void 0});if(!n.ok){var r;throw Error(null!==(r=(await n.json().catch(()=>({error:n.statusText}))).error)&&void 0!==r?r:n.statusText)}return n.json()}let c=e=>o("GET",e),i=(e,t)=>o("POST",e,t),l=(e,t)=>o("PUT",e,t),u=e=>o("DELETE",e),d={status:()=>c("/node/status"),start:()=>i("/node/start"),stop:()=>i("/node/stop"),restart:()=>i("/node/restart"),restartWipe:()=>i("/node/restart-wipe")},m={list:()=>c("/accounts"),faucet:()=>c("/accounts/faucet"),fund:(e,t,s)=>i("/accounts/fund",{address:e,amount:t,chain:s})},p={templates:()=>c("/contracts/templates"),template:e=>c("/contracts/templates/".concat(e)),compile:(e,t)=>i("/contracts/compile",{source:e,contractName:t}),deploy:e=>i("/contracts/deploy",e)},h={status:()=>c("/mining/status"),mine:e=>i("/mining/mine",{blocks:e}),start:e=>i("/mining/start",{intervalMs:e}),stop:()=>i("/mining/stop")},x={config:()=>c("/network/config"),updateConfig:e=>l("/network/config",e),rpcUrls:()=>c("/network/rpc-urls")},f={status:()=>c("/keystore/status"),generate:()=>i("/keystore/generate"),setup:e=>i("/keystore/setup",e),unlock:e=>i("/keystore/unlock",{password:e}),lock:()=>i("/keystore/lock"),wallets:()=>c("/keystore/wallets"),addWallet:(e,t)=>i("/keystore/wallets",{mnemonic:e,label:t}),activateWallet:e=>i("/keystore/wallets/".concat(e,"/activate")),deleteWallet:e=>u("/keystore/wallets/".concat(e))}},9928:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]])},3264:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},3737:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])}},function(e){e.O(0,[363,285,749,744],function(){return e(e.s=9951)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[561],{9951:function(e,t,s){Promise.resolve().then(s.bind(s,958))},958:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return p}});var n=s(5853),r=s(4852),a=s(8990),o=s(6632),c=s(4254),i=s(9928),l=s(3264);let u=(0,s(3035).Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var d=s(8144);function m(e){let{text:t}=e,[s,r]=(0,c.useState)(!1);return(0,n.jsx)("button",{type:"button",title:"Copy",className:"rounded p-1 text-slate-500 hover:text-slate-300",onClick:async()=>{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),1500)},children:s?(0,n.jsx)(i.Z,{className:"h-3.5 w-3.5 text-green-400"}):(0,n.jsx)(l.Z,{className:"h-3.5 w-3.5"})})}function p(){let e=(0,r.NL)(),[t,s]=(0,c.useState)(null),[i,l]=(0,c.useState)(""),{data:p}=(0,a.a)({queryKey:["node","status"],queryFn:d.N9.status,refetchInterval:3e3}),{data:h}=(0,a.a)({queryKey:["network","config"],queryFn:d.fA.config}),{data:x}=(0,a.a)({queryKey:["network","rpc-urls"],queryFn:d.fA.rpcUrls});(0,c.useEffect)(()=>{h&&!t&&s({coreRpcPort:String(h.coreRpcPort),evmRpcPort:String(h.evmRpcPort),wsPort:String(h.wsPort),evmWsPort:String(h.evmWsPort),chainId:String(h.chainId),evmChainId:String(h.evmChainId)})},[h,t]);let v=(0,o.D)({mutationFn:e=>d.fA.updateConfig({coreRpcPort:Number(e.coreRpcPort),evmRpcPort:Number(e.evmRpcPort),wsPort:Number(e.wsPort),evmWsPort:Number(e.evmWsPort),chainId:Number(e.chainId),evmChainId:Number(e.evmChainId)}),onSuccess:()=>{l("✓ Saved"),setTimeout(()=>l(""),2500),e.invalidateQueries({queryKey:["network"]})},onError:e=>l("✗ ".concat(e.message))}),f=(null==p?void 0:p.server)==="running",y=(e,r)=>{var a;return(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"label",children:e}),(0,n.jsx)("input",{className:"input",type:"number",disabled:f,value:null!==(a=null==t?void 0:t[r])&&void 0!==a?a:"",onChange:e=>s(t=>t?{...t,[r]:e.target.value}:t)})]},r)};return(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Network"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"RPC ports and chain IDs — editable only when node is stopped"})]}),f&&(0,n.jsx)("div",{className:"rounded-md border border-yellow-800 bg-yellow-950/50 px-4 py-2 text-sm text-yellow-400",children:"Stop the node before changing configuration."}),t&&(0,n.jsxs)("div",{className:"card space-y-4",children:[(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3",children:[y("Core RPC Port","coreRpcPort"),y("EVM RPC Port","evmRpcPort"),y("Core WS Port","wsPort"),y("EVM WS Port","evmWsPort"),y("Core Chain ID","chainId"),y("EVM Chain ID","evmChainId")]}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsxs)("button",{type:"button",className:"btn-primary",disabled:f||v.isPending,onClick:()=>t&&v.mutate(t),children:[(0,n.jsx)(u,{className:"h-4 w-4"}),v.isPending?"Saving…":"Save"]}),i&&(0,n.jsx)("span",{className:"text-sm ".concat(i.startsWith("✓")?"text-green-400":"text-red-400"),children:i})]})]}),x&&(0,n.jsxs)("div",{className:"card space-y-3",children:[(0,n.jsx)("h2",{className:"text-sm font-medium text-slate-300",children:"Active RPC URLs"}),[["Core RPC",x.core],["EVM RPC",x.evm],["Core WebSocket",x.coreWs],["EVM WebSocket",x.evmWs]].map(e=>{let[t,s]=e;return(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsx)("span",{className:"w-28 text-xs text-slate-500",children:t}),(0,n.jsxs)("div",{className:"flex flex-1 items-center overflow-hidden",children:[(0,n.jsx)("code",{className:"flex-1 truncate rounded bg-[#0e1117] px-2 py-1 text-xs text-blue-300",children:s}),(0,n.jsx)(m,{text:s})]})]},t)})]})]})}},8144:function(e,t,s){"use strict";s.d(t,{N9:function(){return d},SC:function(){return v},SX:function(){return m},Vp:function(){return p},fA:function(){return x},mI:function(){return h}});var n,r=s(2608);let a="".concat(null!==(n=r.env.NEXT_PUBLIC_API_URL)&&void 0!==n?n:"","/api");async function o(e,t,s){let n=await fetch("".concat(a).concat(t),{method:e,headers:s?{"Content-Type":"application/json"}:void 0,body:s?JSON.stringify(s):void 0});if(!n.ok){var r;throw Error(null!==(r=(await n.json().catch(()=>({error:n.statusText}))).error)&&void 0!==r?r:n.statusText)}return n.json()}let c=e=>o("GET",e),i=(e,t)=>o("POST",e,t),l=(e,t)=>o("PUT",e,t),u=e=>o("DELETE",e),d={status:()=>c("/node/status"),start:()=>i("/node/start"),stop:()=>i("/node/stop"),restart:()=>i("/node/restart")},m={list:()=>c("/accounts"),faucet:()=>c("/accounts/faucet"),fund:(e,t,s)=>i("/accounts/fund",{address:e,amount:t,chain:s})},p={templates:()=>c("/contracts/templates"),template:e=>c("/contracts/templates/".concat(e)),compile:(e,t)=>i("/contracts/compile",{source:e,contractName:t}),deploy:e=>i("/contracts/deploy",e)},h={status:()=>c("/mining/status"),mine:e=>i("/mining/mine",{blocks:e}),start:e=>i("/mining/start",{intervalMs:e}),stop:()=>i("/mining/stop")},x={config:()=>c("/network/config"),updateConfig:e=>l("/network/config",e),rpcUrls:()=>c("/network/rpc-urls")},v={status:()=>c("/keystore/status"),generate:()=>i("/keystore/generate"),setup:e=>i("/keystore/setup",e),unlock:e=>i("/keystore/unlock",{password:e}),lock:()=>i("/keystore/lock"),wallets:()=>c("/keystore/wallets"),addWallet:(e,t)=>i("/keystore/wallets",{mnemonic:e,label:t}),activateWallet:e=>i("/keystore/wallets/".concat(e,"/activate")),deleteWallet:e=>u("/keystore/wallets/".concat(e))}},9928:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]])},3264:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])}},function(e){e.O(0,[363,285,749,744],function(){return e(e.s=9951)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[561],{9951:function(e,t,n){Promise.resolve().then(n.bind(n,484))},484:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return p}});var s=n(5853),r=n(4852),a=n(8990),c=n(6632),o=n(4254),i=n(9928),l=n(3264),d=n(3737),u=n(8144);function m(e){let{text:t}=e,[n,r]=(0,o.useState)(!1);return(0,s.jsx)("button",{type:"button",title:"Copy",className:"rounded p-1 text-slate-500 hover:text-slate-300",onClick:async()=>{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),1500)},children:n?(0,s.jsx)(i.Z,{className:"h-3.5 w-3.5 text-green-400"}):(0,s.jsx)(l.Z,{className:"h-3.5 w-3.5"})})}function p(){let e=(0,r.NL)(),[t,n]=(0,o.useState)(null),[i,l]=(0,o.useState)(""),{data:p}=(0,a.a)({queryKey:["node","status"],queryFn:u.N9.status,refetchInterval:3e3}),{data:h}=(0,a.a)({queryKey:["network","config"],queryFn:u.fA.config}),{data:x}=(0,a.a)({queryKey:["network","rpc-urls"],queryFn:u.fA.rpcUrls});(0,o.useEffect)(()=>{h&&!t&&n({coreRpcPort:String(h.coreRpcPort),evmRpcPort:String(h.evmRpcPort),wsPort:String(h.wsPort),evmWsPort:String(h.evmWsPort),chainId:String(h.chainId),evmChainId:String(h.evmChainId)})},[h,t]);let f=(0,c.D)({mutationFn:e=>u.fA.updateConfig({coreRpcPort:Number(e.coreRpcPort),evmRpcPort:Number(e.evmRpcPort),wsPort:Number(e.wsPort),evmWsPort:Number(e.evmWsPort),chainId:Number(e.chainId),evmChainId:Number(e.evmChainId)}),onSuccess:()=>{l("✓ Saved"),setTimeout(()=>l(""),2500),e.invalidateQueries({queryKey:["network"]})},onError:e=>l("✗ ".concat(e.message))}),v=(null==p?void 0:p.server)==="running",y=(e,r)=>{var a;return(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"label",children:e}),(0,s.jsx)("input",{className:"input",type:"number",disabled:v,value:null!==(a=null==t?void 0:t[r])&&void 0!==a?a:"",onChange:e=>n(t=>t?{...t,[r]:e.target.value}:t)})]},r)};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Network"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"RPC ports and chain IDs — editable only when node is stopped"})]}),v&&(0,s.jsx)("div",{className:"rounded-md border border-yellow-800 bg-yellow-950/50 px-4 py-2 text-sm text-yellow-400",children:"Stop the node before changing configuration."}),t&&(0,s.jsxs)("div",{className:"card space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3",children:[y("Core RPC Port","coreRpcPort"),y("EVM RPC Port","evmRpcPort"),y("Core WS Port","wsPort"),y("EVM WS Port","evmWsPort"),y("Core Chain ID","chainId"),y("EVM Chain ID","evmChainId")]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsxs)("button",{type:"button",className:"btn-primary",disabled:v||f.isPending,onClick:()=>t&&f.mutate(t),children:[(0,s.jsx)(d.Z,{className:"h-4 w-4"}),f.isPending?"Saving…":"Save"]}),i&&(0,s.jsx)("span",{className:"text-sm ".concat(i.startsWith("✓")?"text-green-400":"text-red-400"),children:i})]})]}),x&&(0,s.jsxs)("div",{className:"card space-y-3",children:[(0,s.jsx)("h2",{className:"text-sm font-medium text-slate-300",children:"Active RPC URLs"}),[["Core RPC",x.core],["EVM RPC",x.evm],["Core WebSocket",x.coreWs],["EVM WebSocket",x.evmWs]].map(e=>{let[t,n]=e;return(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("span",{className:"w-28 text-xs text-slate-500",children:t}),(0,s.jsxs)("div",{className:"flex flex-1 items-center overflow-hidden",children:[(0,s.jsx)("code",{className:"flex-1 truncate rounded bg-[#0e1117] px-2 py-1 text-xs text-blue-300",children:n}),(0,s.jsx)(m,{text:n})]})]},t)})]})]})}},8144:function(e,t,n){"use strict";n.d(t,{N9:function(){return u},SC:function(){return f},SX:function(){return m},Vp:function(){return p},fA:function(){return x},mI:function(){return h}});var s,r=n(2608);let a="".concat(null!==(s=r.env.NEXT_PUBLIC_API_URL)&&void 0!==s?s:"","/api");async function c(e,t,n){let s=await fetch("".concat(a).concat(t),{method:e,headers:n?{"Content-Type":"application/json"}:void 0,body:n?JSON.stringify(n):void 0});if(!s.ok){var r;throw Error(null!==(r=(await s.json().catch(()=>({error:s.statusText}))).error)&&void 0!==r?r:s.statusText)}return s.json()}let o=e=>c("GET",e),i=(e,t)=>c("POST",e,t),l=e=>c("DELETE",e),d=(e,t)=>c("PUT",e,t),u={status:()=>o("/node/status"),start:()=>i("/node/start"),stop:()=>i("/node/stop"),restart:()=>i("/node/restart"),restartWipe:()=>i("/node/restart-wipe"),wipe:()=>i("/node/wipe")},m={list:()=>o("/accounts"),faucet:()=>o("/accounts/faucet"),fund:(e,t,n)=>i("/accounts/fund",{address:e,amount:t,chain:n})},p={templates:()=>o("/contracts/templates"),template:e=>o("/contracts/templates/".concat(e)),compile:(e,t)=>i("/contracts/compile",{source:e,contractName:t}),deploy:e=>i("/contracts/deploy",e),deployed:e=>o("/contracts/deployed".concat(e?"?chain=".concat(e):"")),deleteDeployed:e=>l("/contracts/deployed/".concat(e)),call:(e,t,n,s)=>i("/contracts/".concat(e,"/call"),{functionName:t,args:n,accountIndex:s})},h={status:()=>o("/mining/status"),mine:e=>i("/mining/mine",{blocks:e}),start:e=>i("/mining/start",{intervalMs:e}),stop:()=>i("/mining/stop")},x={config:()=>o("/network/config"),updateConfig:e=>d("/network/config",e),rpcUrls:()=>o("/network/rpc-urls")},f={status:()=>o("/keystore/status"),generate:()=>i("/keystore/generate"),setup:e=>i("/keystore/setup",e),unlock:e=>i("/keystore/unlock",{password:e}),lock:()=>i("/keystore/lock"),wallets:()=>o("/keystore/wallets"),addWallet:(e,t)=>i("/keystore/wallets",{mnemonic:e,label:t}),activateWallet:e=>i("/keystore/wallets/".concat(e,"/activate")),deleteWallet:e=>l("/keystore/wallets/".concat(e))}},9928:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]])},3264:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},3737:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])}},function(e){e.O(0,[363,285,749,744],function(){return e(e.s=9951)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[561],{9951:function(e,t,n){Promise.resolve().then(n.bind(n,484))},484:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return p}});var s=n(5853),r=n(4852),a=n(8990),c=n(6632),o=n(9928),i=n(3264),l=n(3737),d=n(4254),u=n(8144);function m(e){let{text:t}=e,[n,r]=(0,d.useState)(!1);return(0,s.jsx)("button",{type:"button",title:"Copy",className:"rounded p-1 text-slate-500 hover:text-slate-300",onClick:async()=>{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),1500)},children:n?(0,s.jsx)(o.Z,{className:"h-3.5 w-3.5 text-green-400"}):(0,s.jsx)(i.Z,{className:"h-3.5 w-3.5"})})}function p(){let e=(0,r.NL)(),[t,n]=(0,d.useState)(null),[o,i]=(0,d.useState)(""),{data:p}=(0,a.a)({queryKey:["node","status"],queryFn:u.N9.status,refetchInterval:3e3}),{data:h}=(0,a.a)({queryKey:["network","config"],queryFn:u.fA.config}),{data:f}=(0,a.a)({queryKey:["network","rpc-urls"],queryFn:u.fA.rpcUrls});(0,d.useEffect)(()=>{h&&!t&&n({coreRpcPort:String(h.coreRpcPort),evmRpcPort:String(h.evmRpcPort),wsPort:String(h.wsPort),evmWsPort:String(h.evmWsPort),chainId:String(h.chainId),evmChainId:String(h.evmChainId)})},[h,t]);let x=(0,c.D)({mutationFn:e=>u.fA.updateConfig({coreRpcPort:Number(e.coreRpcPort),evmRpcPort:Number(e.evmRpcPort),wsPort:Number(e.wsPort),evmWsPort:Number(e.evmWsPort),chainId:Number(e.chainId),evmChainId:Number(e.evmChainId)}),onSuccess:()=>{i("✓ Saved"),setTimeout(()=>i(""),2500),e.invalidateQueries({queryKey:["network"]})},onError:e=>i("✗ ".concat(e.message))}),y=(null==p?void 0:p.server)==="running",v=(e,r)=>{var a;return(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"label",children:e}),(0,s.jsx)("input",{className:"input",type:"number",disabled:y,value:null!==(a=null==t?void 0:t[r])&&void 0!==a?a:"",onChange:e=>n(t=>t?{...t,[r]:e.target.value}:t)})]},r)};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Network"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"RPC ports and chain IDs — editable only when node is stopped"})]}),y&&(0,s.jsx)("div",{className:"rounded-md border border-yellow-800 bg-yellow-950/50 px-4 py-2 text-sm text-yellow-400",children:"Stop the node before changing configuration."}),t&&(0,s.jsxs)("div",{className:"card space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3",children:[v("Core RPC Port","coreRpcPort"),v("EVM RPC Port","evmRpcPort"),v("Core WS Port","wsPort"),v("EVM WS Port","evmWsPort"),v("Core Chain ID","chainId"),v("EVM Chain ID","evmChainId")]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsxs)("button",{type:"button",className:"btn-primary",disabled:y||x.isPending,onClick:()=>t&&x.mutate(t),children:[(0,s.jsx)(l.Z,{className:"h-4 w-4"}),x.isPending?"Saving…":"Save"]}),o&&(0,s.jsx)("span",{className:"text-sm ".concat(o.startsWith("✓")?"text-green-400":"text-red-400"),children:o})]})]}),f&&(0,s.jsxs)("div",{className:"card space-y-3",children:[(0,s.jsx)("h2",{className:"text-sm font-medium text-slate-300",children:"Active RPC URLs"}),[["Core RPC",f.core],["EVM RPC",f.evm],["Core WebSocket",f.coreWs],["EVM WebSocket",f.evmWs]].map(e=>{let[t,n]=e;return(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("span",{className:"w-28 text-xs text-slate-500",children:t}),(0,s.jsxs)("div",{className:"flex flex-1 items-center overflow-hidden",children:[(0,s.jsx)("code",{className:"flex-1 truncate rounded bg-[#0e1117] px-2 py-1 text-xs text-blue-300",children:n}),(0,s.jsx)(m,{text:n})]})]},t)})]})]})}},8144:function(e,t,n){"use strict";n.d(t,{N9:function(){return m},SC:function(){return y},SX:function(){return p},Vp:function(){return h},fA:function(){return x},mI:function(){return f},pJ:function(){return v}});var s,r=n(2608);let a="".concat(null!==(s=r.env.NEXT_PUBLIC_API_URL)&&void 0!==s?s:"","/api");async function c(e,t,n){let s=await fetch("".concat(a).concat(t),{method:e,headers:n?{"Content-Type":"application/json"}:void 0,body:n?JSON.stringify(n):void 0});if(!s.ok){var r;throw Error(null!==(r=(await s.json().catch(()=>({error:s.statusText}))).error)&&void 0!==r?r:s.statusText)}return s.json()}let o=e=>c("GET",e),i=(e,t)=>c("POST",e,t),l=e=>c("DELETE",e),d=(e,t)=>c("PUT",e,t),u=(e,t)=>c("PATCH",e,t),m={status:()=>o("/node/status"),start:()=>i("/node/start"),stop:()=>i("/node/stop"),restart:()=>i("/node/restart"),restartWipe:()=>i("/node/restart-wipe"),wipe:()=>i("/node/wipe")},p={list:()=>o("/accounts"),faucet:()=>o("/accounts/faucet"),fund:(e,t,n)=>i("/accounts/fund",{address:e,amount:t,chain:n})},h={templates:()=>o("/contracts/templates"),template:e=>o("/contracts/templates/".concat(e)),compile:(e,t)=>i("/contracts/compile",{source:e,contractName:t}),deploy:e=>i("/contracts/deploy",e),deployed:e=>o("/contracts/deployed".concat(e?"?chain=".concat(e):"")),deleteDeployed:e=>l("/contracts/deployed/".concat(e)),call:(e,t,n,s)=>i("/contracts/".concat(e,"/call"),{functionName:t,args:n,accountIndex:s})},f={status:()=>o("/mining/status"),mine:e=>i("/mining/mine",{blocks:e}),start:e=>i("/mining/start",{intervalMs:e}),stop:()=>i("/mining/stop")},x={config:()=>o("/network/config"),updateConfig:e=>d("/network/config",e),rpcUrls:()=>o("/network/rpc-urls")},y={status:()=>o("/keystore/status"),generate:()=>i("/keystore/generate"),setup:e=>i("/keystore/setup",e),unlock:e=>i("/keystore/unlock",{password:e}),lock:()=>i("/keystore/lock"),wallets:()=>o("/keystore/wallets"),addWallet:(e,t)=>i("/keystore/wallets",{mnemonic:e,label:t}),activateWallet:e=>i("/keystore/wallets/".concat(e,"/activate")),renameWallet:(e,t)=>u("/keystore/wallets/".concat(e),{label:t}),deleteWallet:e=>l("/keystore/wallets/".concat(e))},v={get:()=>o("/settings")}},9928:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]])},3264:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},3737:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])}},function(e){e.O(0,[363,285,749,744],function(){return e(e.s=9951)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[561],{9951:function(e,t,s){Promise.resolve().then(s.bind(s,958))},958:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return p}});var n=s(5853),a=s(4852),r=s(8990),c=s(6632),o=s(4254),i=s(9928),l=s(3264);let u=(0,s(3035).Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var d=s(8144);function m(e){let{text:t}=e,[s,a]=(0,o.useState)(!1);return(0,n.jsx)("button",{type:"button",title:"Copy",className:"rounded p-1 text-slate-500 hover:text-slate-300",onClick:async()=>{await navigator.clipboard.writeText(t),a(!0),setTimeout(()=>a(!1),1500)},children:s?(0,n.jsx)(i.Z,{className:"h-3.5 w-3.5 text-green-400"}):(0,n.jsx)(l.Z,{className:"h-3.5 w-3.5"})})}function p(){let e=(0,a.NL)(),[t,s]=(0,o.useState)(null),[i,l]=(0,o.useState)(""),{data:p}=(0,r.a)({queryKey:["node","status"],queryFn:d.N9.status,refetchInterval:3e3}),{data:h}=(0,r.a)({queryKey:["network","config"],queryFn:d.fA.config}),{data:x}=(0,r.a)({queryKey:["network","rpc-urls"],queryFn:d.fA.rpcUrls});(0,o.useEffect)(()=>{h&&!t&&s({coreRpcPort:String(h.coreRpcPort),evmRpcPort:String(h.evmRpcPort),wsPort:String(h.wsPort),chainId:String(h.chainId),evmChainId:String(h.evmChainId)})},[h,t]);let f=(0,c.D)({mutationFn:e=>d.fA.updateConfig({coreRpcPort:Number(e.coreRpcPort),evmRpcPort:Number(e.evmRpcPort),wsPort:Number(e.wsPort),chainId:Number(e.chainId),evmChainId:Number(e.evmChainId)}),onSuccess:()=>{l("✓ Saved"),setTimeout(()=>l(""),2500),e.invalidateQueries({queryKey:["network"]})},onError:e=>l("✗ ".concat(e.message))}),y=(null==p?void 0:p.server)==="running",v=(e,a)=>{var r;return(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"label",children:e}),(0,n.jsx)("input",{className:"input",type:"number",disabled:y,value:null!==(r=null==t?void 0:t[a])&&void 0!==r?r:"",onChange:e=>s(t=>t?{...t,[a]:e.target.value}:t)})]},a)};return(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Network"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"RPC ports and chain IDs — editable only when node is stopped"})]}),y&&(0,n.jsx)("div",{className:"rounded-md border border-yellow-800 bg-yellow-950/50 px-4 py-2 text-sm text-yellow-400",children:"Stop the node before changing configuration."}),t&&(0,n.jsxs)("div",{className:"card space-y-4",children:[(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3",children:[v("Core RPC Port","coreRpcPort"),v("EVM RPC Port","evmRpcPort"),v("WS Port","wsPort"),v("Core Chain ID","chainId"),v("EVM Chain ID","evmChainId")]}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsxs)("button",{type:"button",className:"btn-primary",disabled:y||f.isPending,onClick:()=>t&&f.mutate(t),children:[(0,n.jsx)(u,{className:"h-4 w-4"}),f.isPending?"Saving…":"Save"]}),i&&(0,n.jsx)("span",{className:"text-sm ".concat(i.startsWith("✓")?"text-green-400":"text-red-400"),children:i})]})]}),x&&(0,n.jsxs)("div",{className:"card space-y-3",children:[(0,n.jsx)("h2",{className:"text-sm font-medium text-slate-300",children:"Active RPC URLs"}),[["Core RPC",x.core],["EVM RPC",x.evm],["WebSocket",x.ws]].map(e=>{let[t,s]=e;return(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsx)("span",{className:"w-28 text-xs text-slate-500",children:t}),(0,n.jsxs)("div",{className:"flex flex-1 items-center overflow-hidden",children:[(0,n.jsx)("code",{className:"flex-1 truncate rounded bg-[#0e1117] px-2 py-1 text-xs text-blue-300",children:s}),(0,n.jsx)(m,{text:s})]})]},t)})]})]})}},8144:function(e,t,s){"use strict";async function n(e,t,s){let n=await fetch("".concat("/api").concat(t),{method:e,headers:s?{"Content-Type":"application/json"}:void 0,body:s?JSON.stringify(s):void 0});if(!n.ok){var a;throw Error(null!==(a=(await n.json().catch(()=>({error:n.statusText}))).error)&&void 0!==a?a:n.statusText)}return n.json()}s.d(t,{N9:function(){return i},SC:function(){return p},SX:function(){return l},Vp:function(){return u},fA:function(){return m},mI:function(){return d}});let a=e=>n("GET",e),r=(e,t)=>n("POST",e,t),c=(e,t)=>n("PUT",e,t),o=e=>n("DELETE",e),i={status:()=>a("/node/status"),start:()=>r("/node/start"),stop:()=>r("/node/stop"),restart:()=>r("/node/restart")},l={list:()=>a("/accounts"),faucet:()=>a("/accounts/faucet"),fund:(e,t,s)=>r("/accounts/fund",{address:e,amount:t,chain:s})},u={templates:()=>a("/contracts/templates"),template:e=>a("/contracts/templates/".concat(e)),compile:(e,t)=>r("/contracts/compile",{source:e,contractName:t}),deploy:e=>r("/contracts/deploy",e)},d={status:()=>a("/mining/status"),mine:e=>r("/mining/mine",{blocks:e}),start:e=>r("/mining/start",{intervalMs:e}),stop:()=>r("/mining/stop")},m={config:()=>a("/network/config"),updateConfig:e=>c("/network/config",e),rpcUrls:()=>a("/network/rpc-urls")},p={status:()=>a("/keystore/status"),generate:()=>r("/keystore/generate"),setup:e=>r("/keystore/setup",e),unlock:e=>r("/keystore/unlock",{password:e}),lock:()=>r("/keystore/lock"),wallets:()=>a("/keystore/wallets"),addWallet:(e,t)=>r("/keystore/wallets",{mnemonic:e,label:t}),activateWallet:e=>r("/keystore/wallets/".concat(e,"/activate")),deleteWallet:e=>o("/keystore/wallets/".concat(e))}},9928:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]])},3264:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])}},function(e){e.O(0,[383,815,285,749,744],function(){return e(e.s=9951)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[561],{9951:function(e,t,n){Promise.resolve().then(n.bind(n,958))},958:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return p}});var s=n(5853),a=n(4852),r=n(8990),c=n(6632),o=n(4254),i=n(9928),l=n(3264);let u=(0,n(3035).Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var d=n(8144);function m(e){let{text:t}=e,[n,a]=(0,o.useState)(!1);return(0,s.jsx)("button",{type:"button",title:"Copy",className:"rounded p-1 text-slate-500 hover:text-slate-300",onClick:async()=>{await navigator.clipboard.writeText(t),a(!0),setTimeout(()=>a(!1),1500)},children:n?(0,s.jsx)(i.Z,{className:"h-3.5 w-3.5 text-green-400"}):(0,s.jsx)(l.Z,{className:"h-3.5 w-3.5"})})}function p(){let e=(0,a.NL)(),[t,n]=(0,o.useState)(null),[i,l]=(0,o.useState)(""),{data:p}=(0,r.a)({queryKey:["node","status"],queryFn:d.N9.status,refetchInterval:3e3}),{data:h}=(0,r.a)({queryKey:["network","config"],queryFn:d.fA.config}),{data:x}=(0,r.a)({queryKey:["network","rpc-urls"],queryFn:d.fA.rpcUrls});(0,o.useEffect)(()=>{h&&!t&&n({coreRpcPort:String(h.coreRpcPort),evmRpcPort:String(h.evmRpcPort),wsPort:String(h.wsPort),chainId:String(h.chainId),evmChainId:String(h.evmChainId)})},[h,t]);let f=(0,c.D)({mutationFn:e=>d.fA.updateConfig({coreRpcPort:Number(e.coreRpcPort),evmRpcPort:Number(e.evmRpcPort),wsPort:Number(e.wsPort),chainId:Number(e.chainId),evmChainId:Number(e.evmChainId)}),onSuccess:()=>{l("✓ Saved"),setTimeout(()=>l(""),2500),e.invalidateQueries({queryKey:["network"]})},onError:e=>l("✗ ".concat(e.message))}),y=(null==p?void 0:p.server)==="running",v=(e,a)=>{var r;return(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"label",children:e}),(0,s.jsx)("input",{className:"input",type:"number",disabled:y,value:null!==(r=null==t?void 0:t[a])&&void 0!==r?r:"",onChange:e=>n(t=>t?{...t,[a]:e.target.value}:t)})]},a)};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Network"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"RPC ports and chain IDs — editable only when node is stopped"})]}),y&&(0,s.jsx)("div",{className:"rounded-md border border-yellow-800 bg-yellow-950/50 px-4 py-2 text-sm text-yellow-400",children:"Stop the node before changing configuration."}),t&&(0,s.jsxs)("div",{className:"card space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3",children:[v("Core RPC Port","coreRpcPort"),v("EVM RPC Port","evmRpcPort"),v("WS Port","wsPort"),v("Core Chain ID","chainId"),v("EVM Chain ID","evmChainId")]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsxs)("button",{type:"button",className:"btn-primary",disabled:y||f.isPending,onClick:()=>t&&f.mutate(t),children:[(0,s.jsx)(u,{className:"h-4 w-4"}),f.isPending?"Saving…":"Save"]}),i&&(0,s.jsx)("span",{className:"text-sm ".concat(i.startsWith("✓")?"text-green-400":"text-red-400"),children:i})]})]}),x&&(0,s.jsxs)("div",{className:"card space-y-3",children:[(0,s.jsx)("h2",{className:"text-sm font-medium text-slate-300",children:"Active RPC URLs"}),[["Core RPC",x.core],["EVM RPC",x.evm],["WebSocket",x.ws]].map(e=>{let[t,n]=e;return(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("span",{className:"w-28 text-xs text-slate-500",children:t}),(0,s.jsxs)("div",{className:"flex flex-1 items-center overflow-hidden",children:[(0,s.jsx)("code",{className:"flex-1 truncate rounded bg-[#0e1117] px-2 py-1 text-xs text-blue-300",children:n}),(0,s.jsx)(m,{text:n})]})]},t)})]})]})}},8144:function(e,t,n){"use strict";n.d(t,{N9:function(){return d},SC:function(){return f},SX:function(){return m},Vp:function(){return p},fA:function(){return x},mI:function(){return h}});var s,a=n(2608);let r="".concat(null!==(s=a.env.NEXT_PUBLIC_API_URL)&&void 0!==s?s:"","/api");async function c(e,t,n){let s=await fetch("".concat(r).concat(t),{method:e,headers:n?{"Content-Type":"application/json"}:void 0,body:n?JSON.stringify(n):void 0});if(!s.ok){var a;throw Error(null!==(a=(await s.json().catch(()=>({error:s.statusText}))).error)&&void 0!==a?a:s.statusText)}return s.json()}let o=e=>c("GET",e),i=(e,t)=>c("POST",e,t),l=(e,t)=>c("PUT",e,t),u=e=>c("DELETE",e),d={status:()=>o("/node/status"),start:()=>i("/node/start"),stop:()=>i("/node/stop"),restart:()=>i("/node/restart")},m={list:()=>o("/accounts"),faucet:()=>o("/accounts/faucet"),fund:(e,t,n)=>i("/accounts/fund",{address:e,amount:t,chain:n})},p={templates:()=>o("/contracts/templates"),template:e=>o("/contracts/templates/".concat(e)),compile:(e,t)=>i("/contracts/compile",{source:e,contractName:t}),deploy:e=>i("/contracts/deploy",e)},h={status:()=>o("/mining/status"),mine:e=>i("/mining/mine",{blocks:e}),start:e=>i("/mining/start",{intervalMs:e}),stop:()=>i("/mining/stop")},x={config:()=>o("/network/config"),updateConfig:e=>l("/network/config",e),rpcUrls:()=>o("/network/rpc-urls")},f={status:()=>o("/keystore/status"),generate:()=>i("/keystore/generate"),setup:e=>i("/keystore/setup",e),unlock:e=>i("/keystore/unlock",{password:e}),lock:()=>i("/keystore/lock"),wallets:()=>o("/keystore/wallets"),addWallet:(e,t)=>i("/keystore/wallets",{mnemonic:e,label:t}),activateWallet:e=>i("/keystore/wallets/".concat(e,"/activate")),deleteWallet:e=>u("/keystore/wallets/".concat(e))}},9928:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]])},3264:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])}},function(e){e.O(0,[363,285,749,744],function(){return e(e.s=9951)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[561],{9951:function(e,t,n){Promise.resolve().then(n.bind(n,484))},484:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return m}});var s=n(5853),r=n(4852),a=n(8990),c=n(6632),o=n(9928),i=n(3264),l=n(3737),d=n(4254),u=n(8144);function p(e){let{text:t}=e,[n,r]=(0,d.useState)(!1);return(0,s.jsx)("button",{type:"button",title:"Copy",className:"rounded p-1 text-slate-500 hover:text-slate-300",onClick:async()=>{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),1500)},children:n?(0,s.jsx)(o.Z,{className:"h-3.5 w-3.5 text-green-400"}):(0,s.jsx)(i.Z,{className:"h-3.5 w-3.5"})})}function m(){let e=(0,r.NL)(),[t,n]=(0,d.useState)(null),[o,i]=(0,d.useState)(""),{data:m}=(0,a.a)({queryKey:["node","status"],queryFn:u.N9.status,refetchInterval:3e3}),{data:h}=(0,a.a)({queryKey:["network","config"],queryFn:u.fA.config}),{data:y}=(0,a.a)({queryKey:["network","rpc-urls"],queryFn:u.fA.rpcUrls});(0,d.useEffect)(()=>{h&&!t&&n({coreRpcPort:String(h.coreRpcPort),evmRpcPort:String(h.evmRpcPort),wsPort:String(h.wsPort),evmWsPort:String(h.evmWsPort),chainId:String(h.chainId),evmChainId:String(h.evmChainId)})},[h,t]);let f=(0,c.D)({mutationFn:e=>u.fA.updateConfig({coreRpcPort:Number(e.coreRpcPort),evmRpcPort:Number(e.evmRpcPort),wsPort:Number(e.wsPort),evmWsPort:Number(e.evmWsPort),chainId:Number(e.chainId),evmChainId:Number(e.evmChainId)}),onSuccess:()=>{i("✓ Saved"),setTimeout(()=>i(""),2500),e.invalidateQueries({queryKey:["network"]})},onError:e=>i("✗ ".concat(e.message))}),x=(null==m?void 0:m.server)==="running",v=(e,r)=>{var a;return(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"label",children:e}),(0,s.jsx)("input",{className:"input",type:"number",disabled:x,value:null!==(a=null==t?void 0:t[r])&&void 0!==a?a:"",onChange:e=>n(t=>t?{...t,[r]:e.target.value}:t)})]},r)};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Network"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"RPC ports and chain IDs — editable only when node is stopped"})]}),x&&(0,s.jsx)("div",{className:"rounded-md border border-yellow-800 bg-yellow-950/50 px-4 py-2 text-sm text-yellow-400",children:"Stop the node before changing configuration."}),t&&(0,s.jsxs)("div",{className:"card space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3",children:[v("Core RPC Port","coreRpcPort"),v("EVM RPC Port","evmRpcPort"),v("Core WS Port","wsPort"),v("EVM WS Port","evmWsPort"),v("Core Chain ID","chainId"),v("EVM Chain ID","evmChainId")]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsxs)("button",{type:"button",className:"btn-primary",disabled:x||f.isPending,onClick:()=>t&&f.mutate(t),children:[(0,s.jsx)(l.Z,{className:"h-4 w-4"}),f.isPending?"Saving…":"Save"]}),o&&(0,s.jsx)("span",{className:"text-sm ".concat(o.startsWith("✓")?"text-green-400":"text-red-400"),children:o})]})]}),y&&(0,s.jsxs)("div",{className:"card space-y-3",children:[(0,s.jsx)("h2",{className:"text-sm font-medium text-slate-300",children:"Active RPC URLs"}),[["Core RPC",y.core],["EVM RPC",y.evm],["Core WebSocket",y.coreWs],["EVM WebSocket",y.evmWs]].map(e=>{let[t,n]=e;return(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("span",{className:"w-28 text-xs text-slate-500",children:t}),(0,s.jsxs)("div",{className:"flex flex-1 items-center overflow-hidden",children:[(0,s.jsx)("code",{className:"flex-1 truncate rounded bg-[#0e1117] px-2 py-1 text-xs text-blue-300",children:n}),(0,s.jsx)(p,{text:n})]})]},t)})]})]})}},8144:function(e,t,n){"use strict";n.d(t,{N9:function(){return p},SC:function(){return x},SX:function(){return m},Vp:function(){return h},fA:function(){return f},mI:function(){return y},pJ:function(){return v}});var s,r=n(2608);let a="".concat(null!==(s=r.env.NEXT_PUBLIC_API_URL)&&void 0!==s?s:"","/api");async function c(e,t,n){let s=await fetch("".concat(a).concat(t),{method:e,headers:n?{"Content-Type":"application/json"}:void 0,body:n?JSON.stringify(n):void 0});if(!s.ok){var r;throw Error(null!==(r=(await s.json().catch(()=>({error:s.statusText}))).error)&&void 0!==r?r:s.statusText)}return s.json()}let o=e=>c("GET",e),i=(e,t)=>c("POST",e,t),l=e=>c("DELETE",e),d=(e,t)=>c("PUT",e,t),u=(e,t)=>c("PATCH",e,t),p={status:()=>o("/node/status"),start:()=>i("/node/start"),stop:()=>i("/node/stop"),restart:()=>i("/node/restart"),restartWipe:()=>i("/node/restart-wipe"),wipe:()=>i("/node/wipe")},m={list:()=>o("/accounts"),faucet:()=>o("/accounts/faucet"),fund:async(e,t,n)=>{let s=await fetch("/api/accounts/fund",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({address:e,amount:t,chain:n})});return await s.json()}},h={templates:()=>o("/contracts/templates"),template:e=>o("/contracts/templates/".concat(e)),compile:(e,t)=>i("/contracts/compile",{source:e,contractName:t}),deploy:e=>i("/contracts/deploy",e),deployed:e=>o("/contracts/deployed".concat(e?"?chain=".concat(e):"")),deleteDeployed:e=>l("/contracts/deployed/".concat(e)),call:(e,t,n,s)=>i("/contracts/".concat(e,"/call"),{functionName:t,args:n,accountIndex:s})},y={status:()=>o("/mining/status"),mine:e=>i("/mining/mine",{blocks:e}),start:e=>i("/mining/start",{intervalMs:e}),stop:()=>i("/mining/stop")},f={config:()=>o("/network/config"),updateConfig:e=>d("/network/config",e),rpcUrls:()=>o("/network/rpc-urls")},x={status:()=>o("/keystore/status"),generate:()=>i("/keystore/generate"),setup:e=>i("/keystore/setup",e),unlock:e=>i("/keystore/unlock",{password:e}),lock:()=>i("/keystore/lock"),wallets:()=>o("/keystore/wallets"),addWallet:(e,t)=>i("/keystore/wallets",{mnemonic:e,label:t}),activateWallet:e=>i("/keystore/wallets/".concat(e,"/activate")),renameWallet:(e,t)=>u("/keystore/wallets/".concat(e),{label:t}),deleteWallet:e=>l("/keystore/wallets/".concat(e))},v={get:()=>o("/settings")}},9928:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]])},3264:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},3737:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])}},function(e){e.O(0,[363,285,749,744],function(){return e(e.s=9951)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[561],{9951:function(e,t,n){Promise.resolve().then(n.bind(n,484))},484:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return p}});var s=n(5853),r=n(4852),a=n(8990),c=n(6632),o=n(4254),i=n(9928),l=n(3264),d=n(3737),u=n(8144);function m(e){let{text:t}=e,[n,r]=(0,o.useState)(!1);return(0,s.jsx)("button",{type:"button",title:"Copy",className:"rounded p-1 text-slate-500 hover:text-slate-300",onClick:async()=>{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),1500)},children:n?(0,s.jsx)(i.Z,{className:"h-3.5 w-3.5 text-green-400"}):(0,s.jsx)(l.Z,{className:"h-3.5 w-3.5"})})}function p(){let e=(0,r.NL)(),[t,n]=(0,o.useState)(null),[i,l]=(0,o.useState)(""),{data:p}=(0,a.a)({queryKey:["node","status"],queryFn:u.N9.status,refetchInterval:3e3}),{data:h}=(0,a.a)({queryKey:["network","config"],queryFn:u.fA.config}),{data:x}=(0,a.a)({queryKey:["network","rpc-urls"],queryFn:u.fA.rpcUrls});(0,o.useEffect)(()=>{h&&!t&&n({coreRpcPort:String(h.coreRpcPort),evmRpcPort:String(h.evmRpcPort),wsPort:String(h.wsPort),evmWsPort:String(h.evmWsPort),chainId:String(h.chainId),evmChainId:String(h.evmChainId)})},[h,t]);let f=(0,c.D)({mutationFn:e=>u.fA.updateConfig({coreRpcPort:Number(e.coreRpcPort),evmRpcPort:Number(e.evmRpcPort),wsPort:Number(e.wsPort),evmWsPort:Number(e.evmWsPort),chainId:Number(e.chainId),evmChainId:Number(e.evmChainId)}),onSuccess:()=>{l("✓ Saved"),setTimeout(()=>l(""),2500),e.invalidateQueries({queryKey:["network"]})},onError:e=>l("✗ ".concat(e.message))}),v=(null==p?void 0:p.server)==="running",y=(e,r)=>{var a;return(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"label",children:e}),(0,s.jsx)("input",{className:"input",type:"number",disabled:v,value:null!==(a=null==t?void 0:t[r])&&void 0!==a?a:"",onChange:e=>n(t=>t?{...t,[r]:e.target.value}:t)})]},r)};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Network"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"RPC ports and chain IDs — editable only when node is stopped"})]}),v&&(0,s.jsx)("div",{className:"rounded-md border border-yellow-800 bg-yellow-950/50 px-4 py-2 text-sm text-yellow-400",children:"Stop the node before changing configuration."}),t&&(0,s.jsxs)("div",{className:"card space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3",children:[y("Core RPC Port","coreRpcPort"),y("EVM RPC Port","evmRpcPort"),y("Core WS Port","wsPort"),y("EVM WS Port","evmWsPort"),y("Core Chain ID","chainId"),y("EVM Chain ID","evmChainId")]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsxs)("button",{type:"button",className:"btn-primary",disabled:v||f.isPending,onClick:()=>t&&f.mutate(t),children:[(0,s.jsx)(d.Z,{className:"h-4 w-4"}),f.isPending?"Saving…":"Save"]}),i&&(0,s.jsx)("span",{className:"text-sm ".concat(i.startsWith("✓")?"text-green-400":"text-red-400"),children:i})]})]}),x&&(0,s.jsxs)("div",{className:"card space-y-3",children:[(0,s.jsx)("h2",{className:"text-sm font-medium text-slate-300",children:"Active RPC URLs"}),[["Core RPC",x.core],["EVM RPC",x.evm],["Core WebSocket",x.coreWs],["EVM WebSocket",x.evmWs]].map(e=>{let[t,n]=e;return(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("span",{className:"w-28 text-xs text-slate-500",children:t}),(0,s.jsxs)("div",{className:"flex flex-1 items-center overflow-hidden",children:[(0,s.jsx)("code",{className:"flex-1 truncate rounded bg-[#0e1117] px-2 py-1 text-xs text-blue-300",children:n}),(0,s.jsx)(m,{text:n})]})]},t)})]})]})}},8144:function(e,t,n){"use strict";n.d(t,{N9:function(){return u},SC:function(){return f},SX:function(){return m},Vp:function(){return p},fA:function(){return x},mI:function(){return h}});var s,r=n(2608);let a="".concat(null!==(s=r.env.NEXT_PUBLIC_API_URL)&&void 0!==s?s:"","/api");async function c(e,t,n){let s=await fetch("".concat(a).concat(t),{method:e,headers:n?{"Content-Type":"application/json"}:void 0,body:n?JSON.stringify(n):void 0});if(!s.ok){var r;throw Error(null!==(r=(await s.json().catch(()=>({error:s.statusText}))).error)&&void 0!==r?r:s.statusText)}return s.json()}let o=e=>c("GET",e),i=(e,t)=>c("POST",e,t),l=e=>c("DELETE",e),d=(e,t)=>c("PUT",e,t),u={status:()=>o("/node/status"),start:()=>i("/node/start"),stop:()=>i("/node/stop"),restart:()=>i("/node/restart"),restartWipe:()=>i("/node/restart-wipe")},m={list:()=>o("/accounts"),faucet:()=>o("/accounts/faucet"),fund:(e,t,n)=>i("/accounts/fund",{address:e,amount:t,chain:n})},p={templates:()=>o("/contracts/templates"),template:e=>o("/contracts/templates/".concat(e)),compile:(e,t)=>i("/contracts/compile",{source:e,contractName:t}),deploy:e=>i("/contracts/deploy",e),deployed:e=>o("/contracts/deployed".concat(e?"?chain=".concat(e):"")),deleteDeployed:e=>l("/contracts/deployed/".concat(e)),call:(e,t,n,s)=>i("/contracts/".concat(e,"/call"),{functionName:t,args:n,accountIndex:s})},h={status:()=>o("/mining/status"),mine:e=>i("/mining/mine",{blocks:e}),start:e=>i("/mining/start",{intervalMs:e}),stop:()=>i("/mining/stop")},x={config:()=>o("/network/config"),updateConfig:e=>d("/network/config",e),rpcUrls:()=>o("/network/rpc-urls")},f={status:()=>o("/keystore/status"),generate:()=>i("/keystore/generate"),setup:e=>i("/keystore/setup",e),unlock:e=>i("/keystore/unlock",{password:e}),lock:()=>i("/keystore/lock"),wallets:()=>o("/keystore/wallets"),addWallet:(e,t)=>i("/keystore/wallets",{mnemonic:e,label:t}),activateWallet:e=>i("/keystore/wallets/".concat(e,"/activate")),deleteWallet:e=>l("/keystore/wallets/".concat(e))}},9928:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]])},3264:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},3737:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])}},function(e){e.O(0,[363,285,749,744],function(){return e(e.s=9951)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[561],{9951:function(e,t,s){Promise.resolve().then(s.bind(s,484))},484:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return p}});var n=s(5853),r=s(4852),a=s(8990),o=s(6632),c=s(4254),i=s(9928),l=s(3264),u=s(3737),d=s(8144);function m(e){let{text:t}=e,[s,r]=(0,c.useState)(!1);return(0,n.jsx)("button",{type:"button",title:"Copy",className:"rounded p-1 text-slate-500 hover:text-slate-300",onClick:async()=>{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),1500)},children:s?(0,n.jsx)(i.Z,{className:"h-3.5 w-3.5 text-green-400"}):(0,n.jsx)(l.Z,{className:"h-3.5 w-3.5"})})}function p(){let e=(0,r.NL)(),[t,s]=(0,c.useState)(null),[i,l]=(0,c.useState)(""),{data:p}=(0,a.a)({queryKey:["node","status"],queryFn:d.N9.status,refetchInterval:3e3}),{data:h}=(0,a.a)({queryKey:["network","config"],queryFn:d.fA.config}),{data:x}=(0,a.a)({queryKey:["network","rpc-urls"],queryFn:d.fA.rpcUrls});(0,c.useEffect)(()=>{h&&!t&&s({coreRpcPort:String(h.coreRpcPort),evmRpcPort:String(h.evmRpcPort),wsPort:String(h.wsPort),evmWsPort:String(h.evmWsPort),chainId:String(h.chainId),evmChainId:String(h.evmChainId)})},[h,t]);let f=(0,o.D)({mutationFn:e=>d.fA.updateConfig({coreRpcPort:Number(e.coreRpcPort),evmRpcPort:Number(e.evmRpcPort),wsPort:Number(e.wsPort),evmWsPort:Number(e.evmWsPort),chainId:Number(e.chainId),evmChainId:Number(e.evmChainId)}),onSuccess:()=>{l("✓ Saved"),setTimeout(()=>l(""),2500),e.invalidateQueries({queryKey:["network"]})},onError:e=>l("✗ ".concat(e.message))}),v=(null==p?void 0:p.server)==="running",y=(e,r)=>{var a;return(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"label",children:e}),(0,n.jsx)("input",{className:"input",type:"number",disabled:v,value:null!==(a=null==t?void 0:t[r])&&void 0!==a?a:"",onChange:e=>s(t=>t?{...t,[r]:e.target.value}:t)})]},r)};return(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Network"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"RPC ports and chain IDs — editable only when node is stopped"})]}),v&&(0,n.jsx)("div",{className:"rounded-md border border-yellow-800 bg-yellow-950/50 px-4 py-2 text-sm text-yellow-400",children:"Stop the node before changing configuration."}),t&&(0,n.jsxs)("div",{className:"card space-y-4",children:[(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3",children:[y("Core RPC Port","coreRpcPort"),y("EVM RPC Port","evmRpcPort"),y("Core WS Port","wsPort"),y("EVM WS Port","evmWsPort"),y("Core Chain ID","chainId"),y("EVM Chain ID","evmChainId")]}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsxs)("button",{type:"button",className:"btn-primary",disabled:v||f.isPending,onClick:()=>t&&f.mutate(t),children:[(0,n.jsx)(u.Z,{className:"h-4 w-4"}),f.isPending?"Saving…":"Save"]}),i&&(0,n.jsx)("span",{className:"text-sm ".concat(i.startsWith("✓")?"text-green-400":"text-red-400"),children:i})]})]}),x&&(0,n.jsxs)("div",{className:"card space-y-3",children:[(0,n.jsx)("h2",{className:"text-sm font-medium text-slate-300",children:"Active RPC URLs"}),[["Core RPC",x.core],["EVM RPC",x.evm],["Core WebSocket",x.coreWs],["EVM WebSocket",x.evmWs]].map(e=>{let[t,s]=e;return(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsx)("span",{className:"w-28 text-xs text-slate-500",children:t}),(0,n.jsxs)("div",{className:"flex flex-1 items-center overflow-hidden",children:[(0,n.jsx)("code",{className:"flex-1 truncate rounded bg-[#0e1117] px-2 py-1 text-xs text-blue-300",children:s}),(0,n.jsx)(m,{text:s})]})]},t)})]})]})}},8144:function(e,t,s){"use strict";s.d(t,{N9:function(){return d},SC:function(){return f},SX:function(){return m},Vp:function(){return p},fA:function(){return x},mI:function(){return h}});var n,r=s(2608);let a="".concat(null!==(n=r.env.NEXT_PUBLIC_API_URL)&&void 0!==n?n:"","/api");async function o(e,t,s){let n=await fetch("".concat(a).concat(t),{method:e,headers:s?{"Content-Type":"application/json"}:void 0,body:s?JSON.stringify(s):void 0});if(!n.ok){var r;throw Error(null!==(r=(await n.json().catch(()=>({error:n.statusText}))).error)&&void 0!==r?r:n.statusText)}return n.json()}let c=e=>o("GET",e),i=(e,t)=>o("POST",e,t),l=(e,t)=>o("PUT",e,t),u=e=>o("DELETE",e),d={status:()=>c("/node/status"),start:()=>i("/node/start"),stop:()=>i("/node/stop"),restart:()=>i("/node/restart")},m={list:()=>c("/accounts"),faucet:()=>c("/accounts/faucet"),fund:(e,t,s)=>i("/accounts/fund",{address:e,amount:t,chain:s})},p={templates:()=>c("/contracts/templates"),template:e=>c("/contracts/templates/".concat(e)),compile:(e,t)=>i("/contracts/compile",{source:e,contractName:t}),deploy:e=>i("/contracts/deploy",e)},h={status:()=>c("/mining/status"),mine:e=>i("/mining/mine",{blocks:e}),start:e=>i("/mining/start",{intervalMs:e}),stop:()=>i("/mining/stop")},x={config:()=>c("/network/config"),updateConfig:e=>l("/network/config",e),rpcUrls:()=>c("/network/rpc-urls")},f={status:()=>c("/keystore/status"),generate:()=>i("/keystore/generate"),setup:e=>i("/keystore/setup",e),unlock:e=>i("/keystore/unlock",{password:e}),lock:()=>i("/keystore/lock"),wallets:()=>c("/keystore/wallets"),addWallet:(e,t)=>i("/keystore/wallets",{mnemonic:e,label:t}),activateWallet:e=>i("/keystore/wallets/".concat(e,"/activate")),deleteWallet:e=>u("/keystore/wallets/".concat(e))}},9928:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]])},3264:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},3737:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])}},function(e){e.O(0,[363,285,749,744],function(){return e(e.s=9951)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[561],{9951:function(e,t,n){Promise.resolve().then(n.bind(n,484))},484:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return p}});var s=n(5853),r=n(4852),a=n(8990),c=n(6632),o=n(4254),i=n(9928),l=n(3264),d=n(3737),u=n(8144);function m(e){let{text:t}=e,[n,r]=(0,o.useState)(!1);return(0,s.jsx)("button",{type:"button",title:"Copy",className:"rounded p-1 text-slate-500 hover:text-slate-300",onClick:async()=>{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),1500)},children:n?(0,s.jsx)(i.Z,{className:"h-3.5 w-3.5 text-green-400"}):(0,s.jsx)(l.Z,{className:"h-3.5 w-3.5"})})}function p(){let e=(0,r.NL)(),[t,n]=(0,o.useState)(null),[i,l]=(0,o.useState)(""),{data:p}=(0,a.a)({queryKey:["node","status"],queryFn:u.N9.status,refetchInterval:3e3}),{data:h}=(0,a.a)({queryKey:["network","config"],queryFn:u.fA.config}),{data:x}=(0,a.a)({queryKey:["network","rpc-urls"],queryFn:u.fA.rpcUrls});(0,o.useEffect)(()=>{h&&!t&&n({coreRpcPort:String(h.coreRpcPort),evmRpcPort:String(h.evmRpcPort),wsPort:String(h.wsPort),evmWsPort:String(h.evmWsPort),chainId:String(h.chainId),evmChainId:String(h.evmChainId)})},[h,t]);let f=(0,c.D)({mutationFn:e=>u.fA.updateConfig({coreRpcPort:Number(e.coreRpcPort),evmRpcPort:Number(e.evmRpcPort),wsPort:Number(e.wsPort),evmWsPort:Number(e.evmWsPort),chainId:Number(e.chainId),evmChainId:Number(e.evmChainId)}),onSuccess:()=>{l("✓ Saved"),setTimeout(()=>l(""),2500),e.invalidateQueries({queryKey:["network"]})},onError:e=>l("✗ ".concat(e.message))}),v=(null==p?void 0:p.server)==="running",y=(e,r)=>{var a;return(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"label",children:e}),(0,s.jsx)("input",{className:"input",type:"number",disabled:v,value:null!==(a=null==t?void 0:t[r])&&void 0!==a?a:"",onChange:e=>n(t=>t?{...t,[r]:e.target.value}:t)})]},r)};return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Network"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"RPC ports and chain IDs — editable only when node is stopped"})]}),v&&(0,s.jsx)("div",{className:"rounded-md border border-yellow-800 bg-yellow-950/50 px-4 py-2 text-sm text-yellow-400",children:"Stop the node before changing configuration."}),t&&(0,s.jsxs)("div",{className:"card space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3",children:[y("Core RPC Port","coreRpcPort"),y("EVM RPC Port","evmRpcPort"),y("Core WS Port","wsPort"),y("EVM WS Port","evmWsPort"),y("Core Chain ID","chainId"),y("EVM Chain ID","evmChainId")]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsxs)("button",{type:"button",className:"btn-primary",disabled:v||f.isPending,onClick:()=>t&&f.mutate(t),children:[(0,s.jsx)(d.Z,{className:"h-4 w-4"}),f.isPending?"Saving…":"Save"]}),i&&(0,s.jsx)("span",{className:"text-sm ".concat(i.startsWith("✓")?"text-green-400":"text-red-400"),children:i})]})]}),x&&(0,s.jsxs)("div",{className:"card space-y-3",children:[(0,s.jsx)("h2",{className:"text-sm font-medium text-slate-300",children:"Active RPC URLs"}),[["Core RPC",x.core],["EVM RPC",x.evm],["Core WebSocket",x.coreWs],["EVM WebSocket",x.evmWs]].map(e=>{let[t,n]=e;return(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("span",{className:"w-28 text-xs text-slate-500",children:t}),(0,s.jsxs)("div",{className:"flex flex-1 items-center overflow-hidden",children:[(0,s.jsx)("code",{className:"flex-1 truncate rounded bg-[#0e1117] px-2 py-1 text-xs text-blue-300",children:n}),(0,s.jsx)(m,{text:n})]})]},t)})]})]})}},8144:function(e,t,n){"use strict";n.d(t,{N9:function(){return u},SC:function(){return f},SX:function(){return m},Vp:function(){return p},fA:function(){return x},mI:function(){return h}});var s,r=n(2608);let a="".concat(null!==(s=r.env.NEXT_PUBLIC_API_URL)&&void 0!==s?s:"","/api");async function c(e,t,n){let s=await fetch("".concat(a).concat(t),{method:e,headers:n?{"Content-Type":"application/json"}:void 0,body:n?JSON.stringify(n):void 0});if(!s.ok){var r;throw Error(null!==(r=(await s.json().catch(()=>({error:s.statusText}))).error)&&void 0!==r?r:s.statusText)}return s.json()}let o=e=>c("GET",e),i=(e,t)=>c("POST",e,t),l=e=>c("DELETE",e),d=(e,t)=>c("PUT",e,t),u={status:()=>o("/node/status"),start:()=>i("/node/start"),stop:()=>i("/node/stop"),restart:()=>i("/node/restart"),restartWipe:()=>i("/node/restart-wipe")},m={list:()=>o("/accounts"),faucet:()=>o("/accounts/faucet"),fund:(e,t,n)=>i("/accounts/fund",{address:e,amount:t,chain:n})},p={templates:()=>o("/contracts/templates"),template:e=>o("/contracts/templates/".concat(e)),compile:(e,t)=>i("/contracts/compile",{source:e,contractName:t}),deploy:e=>i("/contracts/deploy",e),deployed:e=>o("/contracts/deployed".concat(e?"?chain=".concat(e):"")),deleteDeployed:e=>l("/contracts/deployed/".concat(e))},h={status:()=>o("/mining/status"),mine:e=>i("/mining/mine",{blocks:e}),start:e=>i("/mining/start",{intervalMs:e}),stop:()=>i("/mining/stop")},x={config:()=>o("/network/config"),updateConfig:e=>d("/network/config",e),rpcUrls:()=>o("/network/rpc-urls")},f={status:()=>o("/keystore/status"),generate:()=>i("/keystore/generate"),setup:e=>i("/keystore/setup",e),unlock:e=>i("/keystore/unlock",{password:e}),lock:()=>i("/keystore/lock"),wallets:()=>o("/keystore/wallets"),addWallet:(e,t)=>i("/keystore/wallets",{mnemonic:e,label:t}),activateWallet:e=>i("/keystore/wallets/".concat(e,"/activate")),deleteWallet:e=>l("/keystore/wallets/".concat(e))}},9928:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]])},3264:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},3737:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});let s=(0,n(3035).Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])}},function(e){e.O(0,[363,285,749,744],function(){return e(e.s=9951)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{1134:function(e,t,s){Promise.resolve().then(s.bind(s,8172))},8172:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return C}});var n=s(5853),a=s(4852),i=s(6632),l=s(8990),r=s(4254),c=s(9928),d=s(3264),o=s(5175),u=s(9924);let x=(0,s(3035).Z)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);var m=s(2846),h=s(758),p=s(5710),v=s(8701),y=s(3737),j=s(6444),N=s(7201),g=s(3948),f=s(6804),b=s(8144),w=s(3634);function k(e){let{text:t,small:s}=e,[a,i]=(0,r.useState)(!1);return(0,n.jsx)("button",{type:"button",title:"Copy",className:"rounded text-slate-500 hover:text-slate-300 ".concat(s?"p-0.5":"ml-1.5 px-1.5 py-1 btn-secondary"),onClick:async()=>{await navigator.clipboard.writeText(t),i(!0),setTimeout(()=>i(!1),1600)},children:a?(0,n.jsx)(c.Z,{className:s?"h-3 w-3 text-green-400":"h-3.5 w-3.5 text-green-400"}):(0,n.jsx)(d.Z,{className:s?"h-3 w-3":"h-3.5 w-3.5"})})}function S(e){let{onClose:t}=e,s=(0,a.NL)(),[l,c]=(0,r.useState)(""),[d,o]=(0,r.useState)(""),[u,x]=(0,r.useState)(""),m=(0,i.D)({mutationFn:()=>b.SX.fund(l,d||void 0),onSuccess:e=>{x("✓ tx: ".concat(e.txHash)),s.invalidateQueries({queryKey:["accounts"]})},onError:e=>x("✗ ".concat(e.message))}),h=l.trim().toLowerCase().startsWith("0x")?"EVM (eSpace)":l.trim()?"Core Space":null;return(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",children:(0,n.jsxs)("div",{className:"card w-full max-w-md space-y-4",children:[(0,n.jsx)("h2",{className:"font-medium text-white",children:"Fund Address"}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"label",children:["Address",h&&(0,n.jsxs)("span",{className:"ml-2 text-xs text-slate-400",children:["— detected: ",h]})]}),(0,n.jsx)("input",{className:"input",value:l,onChange:e=>c(e.target.value),placeholder:"0x… or cfx:…"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"label",children:"Amount (optional)"}),(0,n.jsx)("input",{className:"input",value:d,onChange:e=>o(e.target.value),placeholder:"1000"})]}),u&&(0,n.jsx)("p",{className:"text-sm text-slate-300",children:u}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)("button",{type:"button",className:"btn-secondary",onClick:t,children:"Close"}),(0,n.jsx)("button",{type:"button",className:"btn-primary",disabled:!l||m.isPending,onClick:()=>m.mutate(),children:m.isPending?"Sending…":"Fund"})]})]})})}function C(){var e,t,s,c,d,C,P,Z,I,q,E,M,R;let F=(0,a.NL)(),[W,K]=(0,r.useState)(null),[A,D]=(0,r.useState)(null),[T,Q]=(0,r.useState)(""),[V,_]=(0,r.useState)(!1),[L,U]=(0,r.useState)(!1),[z,X]=(0,r.useState)(!1),[B,O]=(0,r.useState)("1"),[H,G]=(0,r.useState)("1000"),[J,Y]=(0,r.useState)(""),[$,ee]=(0,r.useState)(!1),{data:et}=(0,l.a)({queryKey:["node","status"],queryFn:b.N9.status}),{data:es=[]}=(0,l.a)({queryKey:["keystore","wallets"],queryFn:b.SC.wallets,refetchInterval:5e3}),{data:en}=(0,l.a)({queryKey:["network","config"],queryFn:b.fA.config}),ea=(null===(e=null!=W?W:et)||void 0===e?void 0:e.server)==="running",{data:ei=[],isLoading:el}=(0,l.a)({queryKey:["accounts"],queryFn:b.SX.list,enabled:ea,refetchInterval:!!ea&&8e3}),{data:er}=(0,l.a)({queryKey:["accounts","faucet"],queryFn:b.SX.faucet,enabled:ea}),{data:ec}=(0,l.a)({queryKey:["mining","status"],queryFn:b.mI.status,enabled:ea,refetchInterval:!!ea&&3e3});(0,r.useEffect)(()=>{let e=(0,w.h)(),t=e=>{K(e),F.setQueryData(["node","status"],e)};return e.on("node:status",t),()=>{e.off("node:status",t)}},[F]),(0,r.useEffect)(()=>{en&&!A&&D({coreRpcPort:String(en.coreRpcPort),evmRpcPort:String(en.evmRpcPort),wsPort:String(en.wsPort),evmWsPort:String(en.evmWsPort),chainId:String(en.chainId),evmChainId:String(en.evmChainId)})},[en,A]),(0,r.useEffect)(()=>{(null==ec?void 0:ec.isRunning)&&void 0!==ec.interval&&G(String(ec.interval))},[null==ec?void 0:ec.isRunning,null==ec?void 0:ec.interval]);let ed=(0,i.D)({mutationFn:b.N9.start,onSuccess:()=>F.invalidateQueries({queryKey:["node"]})}),eo=(0,i.D)({mutationFn:b.N9.stop,onSuccess:()=>F.invalidateQueries({queryKey:["node"]})}),eu=(0,i.D)({mutationFn:b.N9.restart,onSuccess:()=>F.invalidateQueries({queryKey:["node"]})}),ex=(0,i.D)({mutationFn:b.N9.restartWipe,onSuccess:()=>{F.invalidateQueries({queryKey:["node"]}),F.invalidateQueries({queryKey:["accounts"]}),F.invalidateQueries({queryKey:["mining"]})}}),em=(0,i.D)({mutationFn:b.N9.wipe,onSuccess:()=>{F.invalidateQueries({queryKey:["node"]}),F.invalidateQueries({queryKey:["accounts"]}),F.invalidateQueries({queryKey:["contracts","deployed"]}),F.invalidateQueries({queryKey:["mining"]})}}),eh=(0,i.D)({mutationFn:b.SC.activateWallet,onSuccess:()=>F.invalidateQueries({queryKey:["keystore","wallets"]})}),ep=(0,i.D)({mutationFn:e=>b.fA.updateConfig({coreRpcPort:Number(e.coreRpcPort),evmRpcPort:Number(e.evmRpcPort),wsPort:Number(e.wsPort),evmWsPort:Number(e.evmWsPort),chainId:Number(e.chainId),evmChainId:Number(e.evmChainId)}),onSuccess:()=>{Q("✓ Saved"),setTimeout(()=>Q(""),2500),F.invalidateQueries({queryKey:["network"]})},onError:e=>Q("✗ ".concat(e.message))}),ev=(0,i.D)({mutationFn:()=>b.mI.mine(Number(B)),onSuccess:e=>{Y("✓ Mined ".concat(e.mined," block(s)")),F.invalidateQueries({queryKey:["mining"]})},onError:e=>Y("✗ ".concat(e.message))}),ey=(0,i.D)({mutationFn:()=>b.mI.start(Number(H)),onSuccess:()=>F.invalidateQueries({queryKey:["mining"]})}),ej=(0,i.D)({mutationFn:b.mI.stop,onSuccess:()=>F.invalidateQueries({queryKey:["mining"]})}),eN=null!=W?W:et,eg=null!==(t=null==eN?void 0:eN.server)&&void 0!==t?t:"stopped",ef="starting"===eg||"stopping"===eg||ed.isPending||eo.isPending||eu.isPending||ex.isPending||em.isPending,eb=ea?"status-dot-green":ef?"status-dot-yellow":"status-dot-red",ew=ed.isPending?"Starting…":eo.isPending?"Stopping…":eu.isPending||ex.isPending?"Restarting…":em.isPending?"Wiping…":"starting"===eg?"Starting…":"stopping"===eg?"Stopping…":"running"===eg?"Running":"Stopped",ek=es.find(e=>e.isActive),eS=null==eN?void 0:eN.rpcUrls,eC=z?ei:ei.slice(0,5),eP=ev.isPending||ey.isPending||ej.isPending;async function eZ(){try{await ej.mutateAsync(),ey.mutate()}catch(e){}}return(0,n.jsxs)("div",{className:"space-y-6",children:[L&&(0,n.jsx)(S,{onClose:()=>U(!1)}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Dashboard"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"Local Conflux development node"})]}),(0,n.jsxs)("div",{className:"card space-y-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("span",{className:eb}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-sm font-medium text-white",children:ew}),ea&&(null==eN?void 0:eN.epochNumber)!==void 0&&(0,n.jsxs)("div",{className:"text-xs text-slate-400",children:["Epoch #",eN.epochNumber]})]})]}),(0,n.jsx)("div",{className:"flex gap-2",children:ea?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button",className:"btn-secondary",disabled:ef,onClick:()=>eu.mutate(),children:[(0,n.jsx)(x,{className:"h-4 w-4"})," Restart"]}),(0,n.jsxs)("button",{type:"button",className:"btn-warning",disabled:ef,title:"Wipe this wallet's data directory and restart from block 0",onClick:()=>{confirm("Wipe all chain data for this wallet and restart from block 0?")&&ex.mutate()},children:[(0,n.jsx)(u.Z,{className:"h-4 w-4"})," Wipe & Restart"]}),(0,n.jsxs)("button",{type:"button",className:"btn-danger",disabled:ef,onClick:()=>eo.mutate(),children:[(0,n.jsx)(m.Z,{className:"h-4 w-4"})," Stop"]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button",className:"btn-success",disabled:ef,onClick:()=>ed.mutate(),children:[(0,n.jsx)(o.Z,{className:"h-4 w-4"})," Start"]}),(0,n.jsxs)("button",{type:"button",className:"btn-warning",disabled:ef,title:"Delete all chain data for this wallet (cannot be undone)",onClick:()=>{confirm("Wipe all chain data for this wallet? This cannot be undone.")&&em.mutate()},children:[(0,n.jsx)(u.Z,{className:"h-4 w-4"})," Wipe Data"]})]})})]}),ea&&eS&&(0,n.jsxs)("div",{className:"border-t border-[#2a3147] pt-3",children:[(0,n.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between text-xs font-medium uppercase tracking-wider text-slate-500 hover:text-slate-300 transition-colors",onClick:()=>ee(e=>!e),children:[(0,n.jsx)("span",{children:"RPC Endpoints"}),$?(0,n.jsx)(h.Z,{className:"h-3.5 w-3.5"}):(0,n.jsx)(p.Z,{className:"h-3.5 w-3.5"})]}),$&&(0,n.jsxs)("div",{className:"mt-3 space-y-2",children:[[["Core RPC",eS.core],["EVM / ETH RPC",eS.evm],["Core WebSocket",null!==(s=eS.coreWs)&&void 0!==s?s:eS.ws],["EVM WebSocket",null!==(c=eS.evmWs)&&void 0!==c?c:""]].filter(e=>{let[,t]=e;return t}).map(e=>{let[t,s]=e;return(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("span",{className:"w-32 text-xs text-slate-500",children:t}),(0,n.jsxs)("div",{className:"flex flex-1 items-center overflow-hidden",children:[(0,n.jsx)("code",{className:"flex-1 truncate rounded bg-[#0e1117] px-2 py-1 text-xs text-blue-300",children:s}),(0,n.jsx)(k,{text:s})]})]},t)}),A&&(0,n.jsxs)("div",{className:"flex gap-8 border-t border-[#2a3147] pt-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-[10px] text-slate-500",children:"Core Chain ID"}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"text-xs text-slate-300",children:A.chainId}),(0,n.jsx)(k,{text:A.chainId,small:!0})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-[10px] text-slate-500",children:"EVM Chain ID"}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"text-xs text-slate-300",children:A.evmChainId}),(0,n.jsx)(k,{text:A.evmChainId,small:!0})]})]})]})]})]}),!ea&&es.length>0&&(0,n.jsxs)("div",{className:"border-t border-[#2a3147] pt-4",children:[(0,n.jsxs)("label",{className:"label flex items-center gap-1.5",children:[(0,n.jsx)(v.Z,{className:"h-3.5 w-3.5"})," Wallet"]}),1===es.length?(0,n.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,n.jsx)("code",{className:"text-xs text-blue-300",children:null!==(d=null==ek?void 0:ek.label)&&void 0!==d?d:es[0].label}),(0,n.jsx)("span",{className:"rounded bg-blue-600/20 px-1.5 py-0.5 text-[10px] text-blue-400",children:"active"})]}):(0,n.jsx)("select",{className:"input mt-1 w-full max-w-xs",value:null!==(C=null==ek?void 0:ek.id)&&void 0!==C?C:"",onChange:e=>eh.mutate(e.target.value),disabled:eh.isPending,children:es.map(e=>(0,n.jsxs)("option",{value:e.id,children:[e.label,e.isActive?" (active)":""]},e.id))})]}),!ea&&A&&(0,n.jsxs)("div",{className:"border-t border-[#2a3147] pt-4",children:[(0,n.jsx)("div",{className:"mb-3 text-xs font-medium uppercase tracking-wider text-slate-500",children:"Network Configuration"}),(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[["Core RPC Port","coreRpcPort"],["EVM RPC Port","evmRpcPort"],["Core WS Port","wsPort"],["EVM WS Port","evmWsPort"],["Core Chain ID","chainId"],["EVM Chain ID","evmChainId"]].map(e=>{var t;let[s,a]=e;return(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"label",children:s}),(0,n.jsx)("input",{className:"input",type:"number",value:null!==(t=A[a])&&void 0!==t?t:"",onChange:e=>D(t=>t?{...t,[a]:e.target.value}:t)})]},a)})}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsxs)("button",{type:"button",className:"btn-primary",disabled:ep.isPending||ef,onClick:()=>A&&ep.mutate(A),children:[(0,n.jsx)(y.Z,{className:"h-4 w-4"}),ep.isPending?"Saving…":"Save Config"]}),T&&(0,n.jsx)("span",{className:"text-sm ".concat(T.startsWith("✓")?"text-green-400":"text-red-400"),children:T})]})]})]})]}),ea&&(0,n.jsxs)("div",{className:"card space-y-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("h2",{className:"text-sm font-medium text-slate-300",children:"Mining"}),(0,n.jsxs)("span",{className:"text-xs text-slate-500",children:[null!==(P=null==ec?void 0:ec.blocksMined)&&void 0!==P?P:0," blocks mined"]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"text-xs font-medium ".concat((null==ec?void 0:ec.isRunning)?"text-green-400":"text-slate-500"),children:(null==ec?void 0:ec.isRunning)?"Auto":"Manual"}),(0,n.jsx)("button",{type:"button",disabled:eP,className:"relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus:outline-none ".concat((null==ec?void 0:ec.isRunning)?"bg-green-600":"bg-slate-600"),onClick:()=>(null==ec?void 0:ec.isRunning)?ej.mutate():ey.mutate(),title:(null==ec?void 0:ec.isRunning)?"Stop auto-mining":"Start auto-mining",children:(0,n.jsx)("span",{className:"inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat((null==ec?void 0:ec.isRunning)?"translate-x-[18px]":"translate-x-0.5")})})]})]}),(null==ec?void 0:ec.isRunning)?(0,n.jsxs)("div",{className:"flex items-end gap-3",children:[(0,n.jsxs)("div",{className:"w-36",children:[(0,n.jsx)("label",{className:"label",children:"Interval (ms)"}),(0,n.jsx)("input",{className:"input",type:"number",min:"100",value:H,onChange:e=>G(e.target.value)})]}),Number(H)!==(null!==(Z=ec.interval)&&void 0!==Z?Z:0)&&(0,n.jsx)("button",{type:"button",className:"btn-secondary",disabled:eP,onClick:eZ,children:"Update"})]}):(0,n.jsxs)("div",{className:"flex items-end gap-3",children:[(0,n.jsxs)("div",{className:"w-28",children:[(0,n.jsx)("label",{className:"label",children:"Blocks"}),(0,n.jsx)("input",{className:"input",type:"number",min:"1",max:"1000",value:B,onChange:e=>O(e.target.value)})]}),(0,n.jsxs)("button",{type:"button",className:"btn-primary",disabled:eP,onClick:()=>ev.mutate(),children:[(0,n.jsx)(j.Z,{className:"h-4 w-4"}),ev.isPending?"Mining…":"Mine"]})]}),J&&(0,n.jsx)("p",{className:"text-sm ".concat(J.startsWith("✓")?"text-green-400":"text-red-400"),children:J}),(ey.error||ej.error)&&(0,n.jsx)("p",{className:"text-sm text-red-400",children:String(null!==(I=ey.error)&&void 0!==I?I:ej.error)})]}),ea&&(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("h2",{className:"text-sm font-medium text-slate-300",children:"Accounts"}),er&&(0,n.jsx)("div",{className:"card",children:(0,n.jsxs)("div",{className:"flex items-start justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-1 text-xs font-medium uppercase tracking-wider text-slate-500",children:"Faucet Account"}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("code",{className:"max-w-[260px] truncate text-xs text-blue-300",children:er.coreAddress}),(0,n.jsx)(k,{text:er.coreAddress,small:!0})]}),(0,n.jsxs)("div",{className:"mt-0.5 text-sm text-slate-300",children:[er.coreBalance," CFX"]})]}),(0,n.jsxs)("div",{className:"flex shrink-0 gap-2",children:[(0,n.jsxs)("button",{type:"button",className:"btn-secondary",title:"Toggle private key visibility",onClick:()=>_(e=>!e),children:[V?(0,n.jsx)(N.Z,{className:"h-4 w-4"}):(0,n.jsx)(g.Z,{className:"h-4 w-4"}),"Keys"]}),(0,n.jsxs)("button",{type:"button",className:"btn-primary",onClick:()=>U(!0),children:[(0,n.jsx)(f.Z,{className:"h-4 w-4"})," Fund"]})]})]})}),el?(0,n.jsx)("p",{className:"text-sm text-slate-500",children:"Loading accounts…"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"overflow-x-auto rounded-lg border border-[#2a3147]",children:(0,n.jsxs)("table",{className:"w-full text-sm",children:[(0,n.jsx)("thead",{className:"bg-[#161b27] text-xs uppercase tracking-wider text-slate-500",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"px-3 py-2 text-left",children:"#"}),(0,n.jsx)("th",{className:"px-3 py-2 text-left",children:"Core Address"}),(0,n.jsx)("th",{className:"px-3 py-2 text-left",children:"EVM Address"}),(0,n.jsx)("th",{className:"px-3 py-2 text-right",children:"Core"}),(0,n.jsx)("th",{className:"px-3 py-2 text-right",children:"EVM"}),V&&(0,n.jsx)("th",{className:"px-3 py-2 text-left",children:"Private Key"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-[#2a3147]",children:eC.map(e=>(0,n.jsxs)("tr",{className:"bg-[#0e1117] hover:bg-[#161b27]",children:[(0,n.jsx)("td",{className:"px-3 py-2 text-slate-500",children:e.index}),(0,n.jsx)("td",{className:"px-3 py-2",children:(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("code",{className:"max-w-[180px] truncate text-xs text-blue-300",children:e.coreAddress}),(0,n.jsx)(k,{text:e.coreAddress,small:!0})]})}),(0,n.jsx)("td",{className:"px-3 py-2",children:(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("code",{className:"max-w-[140px] truncate text-xs text-blue-300",children:e.evmAddress}),(0,n.jsx)(k,{text:e.evmAddress,small:!0})]})}),(0,n.jsx)("td",{className:"px-3 py-2 text-right text-xs text-slate-300",children:e.coreBalance||"—"}),(0,n.jsx)("td",{className:"px-3 py-2 text-right text-xs text-slate-300",children:e.evmBalance||"—"}),V&&(0,n.jsx)("td",{className:"px-3 py-2",children:(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("code",{className:"max-w-[120px] truncate text-xs text-slate-400",children:e.privateKey}),(0,n.jsx)(k,{text:e.privateKey,small:!0})]})})]},e.index))})]})}),ei.length>5&&(0,n.jsx)("button",{type:"button",className:"btn-secondary w-full text-center text-xs",onClick:()=>X(e=>!e),children:z?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(h.Z,{className:"mr-1 inline h-3.5 w-3.5"}),"Show less"]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(p.Z,{className:"mr-1 inline h-3.5 w-3.5"}),"Show all ",ei.length," accounts"]})})]})]}),(ed.error||eo.error||eu.error||ex.error||em.error)&&(0,n.jsx)("div",{className:"rounded-md border border-red-800 bg-red-950/50 px-4 py-2 text-sm text-red-400",children:String(null!==(R=null!==(M=null!==(E=null!==(q=ed.error)&&void 0!==q?q:eo.error)&&void 0!==E?E:eu.error)&&void 0!==M?M:ex.error)&&void 0!==R?R:em.error)})]})}},8144:function(e,t,s){"use strict";s.d(t,{N9:function(){return u},SC:function(){return v},SX:function(){return x},Vp:function(){return m},fA:function(){return p},mI:function(){return h}});var n,a=s(2608);let i="".concat(null!==(n=a.env.NEXT_PUBLIC_API_URL)&&void 0!==n?n:"","/api");async function l(e,t,s){let n=await fetch("".concat(i).concat(t),{method:e,headers:s?{"Content-Type":"application/json"}:void 0,body:s?JSON.stringify(s):void 0});if(!n.ok){var a;throw Error(null!==(a=(await n.json().catch(()=>({error:n.statusText}))).error)&&void 0!==a?a:n.statusText)}return n.json()}let r=e=>l("GET",e),c=(e,t)=>l("POST",e,t),d=e=>l("DELETE",e),o=(e,t)=>l("PUT",e,t),u={status:()=>r("/node/status"),start:()=>c("/node/start"),stop:()=>c("/node/stop"),restart:()=>c("/node/restart"),restartWipe:()=>c("/node/restart-wipe"),wipe:()=>c("/node/wipe")},x={list:()=>r("/accounts"),faucet:()=>r("/accounts/faucet"),fund:(e,t,s)=>c("/accounts/fund",{address:e,amount:t,chain:s})},m={templates:()=>r("/contracts/templates"),template:e=>r("/contracts/templates/".concat(e)),compile:(e,t)=>c("/contracts/compile",{source:e,contractName:t}),deploy:e=>c("/contracts/deploy",e),deployed:e=>r("/contracts/deployed".concat(e?"?chain=".concat(e):"")),deleteDeployed:e=>d("/contracts/deployed/".concat(e)),call:(e,t,s,n)=>c("/contracts/".concat(e,"/call"),{functionName:t,args:s,accountIndex:n})},h={status:()=>r("/mining/status"),mine:e=>c("/mining/mine",{blocks:e}),start:e=>c("/mining/start",{intervalMs:e}),stop:()=>c("/mining/stop")},p={config:()=>r("/network/config"),updateConfig:e=>o("/network/config",e),rpcUrls:()=>r("/network/rpc-urls")},v={status:()=>r("/keystore/status"),generate:()=>c("/keystore/generate"),setup:e=>c("/keystore/setup",e),unlock:e=>c("/keystore/unlock",{password:e}),lock:()=>c("/keystore/lock"),wallets:()=>r("/keystore/wallets"),addWallet:(e,t)=>c("/keystore/wallets",{mnemonic:e,label:t}),activateWallet:e=>c("/keystore/wallets/".concat(e,"/activate")),deleteWallet:e=>d("/keystore/wallets/".concat(e))}},3634:function(e,t,s){"use strict";s.d(t,{h:function(){return l}});var n=s(7903),a=s(2608);let i=null;function l(){if(!i){var e;let t=null!==(e=a.env.NEXT_PUBLIC_WS_URL)&&void 0!==e?e:"";i=(0,n.io)(t||void 0,{path:"/socket.io",reconnectionDelay:1e3,reconnectionDelayMax:5e3,reconnectionAttempts:Number.POSITIVE_INFINITY})}return i}},5710:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},758:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},6804:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("Droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]])},7201:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},3948:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},5175:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},3737:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},2846:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]])},9924:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},6444:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});let n=(0,s(3035).Z)("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])}},function(e){e.O(0,[363,826,285,749,744],function(){return e(e.s=1134)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{1134:function(e,t,s){Promise.resolve().then(s.bind(s,506))},506:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return P}});var a=s(5853),n=s(4852),l=s(6632),i=s(8990),r=s(4254),c=s(9928),d=s(3264),o=s(5175),u=s(3035);let x=(0,u.Z)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);var m=s(2846),h=s(8701),p=s(3737),v=s(7201),j=s(3948),N=s(6804);let g=(0,u.Z)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),y=(0,u.Z)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var b=s(1494),f=s(6444),w=s(8144),k=s(3634);function C(e){let{text:t,small:s}=e,[n,l]=(0,r.useState)(!1);return(0,a.jsx)("button",{type:"button",title:"Copy",className:"rounded text-slate-500 hover:text-slate-300 ".concat(s?"p-0.5":"ml-1.5 px-1.5 py-1 btn-secondary"),onClick:async()=>{await navigator.clipboard.writeText(t),l(!0),setTimeout(()=>l(!1),1600)},children:n?(0,a.jsx)(c.Z,{className:s?"h-3 w-3 text-green-400":"h-3.5 w-3.5 text-green-400"}):(0,a.jsx)(d.Z,{className:s?"h-3 w-3":"h-3.5 w-3.5"})})}function S(e){let{onClose:t}=e,s=(0,n.NL)(),[i,c]=(0,r.useState)(""),[d,o]=(0,r.useState)(""),[u,x]=(0,r.useState)("evm"),[m,h]=(0,r.useState)(""),p=(0,l.D)({mutationFn:()=>w.SX.fund(i,d||void 0,u),onSuccess:e=>{h("✓ tx: ".concat(e.txHash)),s.invalidateQueries({queryKey:["accounts"]})},onError:e=>h("✗ ".concat(e.message))});return(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",children:(0,a.jsxs)("div",{className:"card w-full max-w-md space-y-4",children:[(0,a.jsx)("h2",{className:"font-medium text-white",children:"Fund Address"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"label",children:"Address"}),(0,a.jsx)("input",{className:"input",value:i,onChange:e=>c(e.target.value),placeholder:"0x… or cfx:…"})]}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("label",{className:"label",children:"Amount (optional)"}),(0,a.jsx)("input",{className:"input",value:d,onChange:e=>o(e.target.value),placeholder:"1000"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"label",children:"Chain"}),(0,a.jsxs)("select",{className:"input",value:u,onChange:e=>x(e.target.value),children:[(0,a.jsx)("option",{value:"evm",children:"EVM"}),(0,a.jsx)("option",{value:"core",children:"Core"})]})]})]}),m&&(0,a.jsx)("p",{className:"text-sm text-slate-300",children:m}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)("button",{type:"button",className:"btn-secondary",onClick:t,children:"Close"}),(0,a.jsx)("button",{type:"button",className:"btn-primary",disabled:!i||p.isPending,onClick:()=>p.mutate(),children:p.isPending?"Sending…":"Fund"})]})]})})}function P(){var e,t,s,c,d,u,P,Z,E,I;let M=(0,n.NL)(),[A,R]=(0,r.useState)(null),[F,q]=(0,r.useState)(null),[W,D]=(0,r.useState)(""),[K,V]=(0,r.useState)(!1),[T,L]=(0,r.useState)(!1),[_,Q]=(0,r.useState)(!1),[B,O]=(0,r.useState)("1"),[U,X]=(0,r.useState)("1000"),[z,H]=(0,r.useState)(""),{data:G}=(0,i.a)({queryKey:["node","status"],queryFn:w.N9.status}),{data:J=[]}=(0,i.a)({queryKey:["keystore","wallets"],queryFn:w.SC.wallets,refetchInterval:5e3}),{data:Y}=(0,i.a)({queryKey:["network","config"],queryFn:w.fA.config}),$=(null===(e=null!=A?A:G)||void 0===e?void 0:e.server)==="running",{data:ee=[],isLoading:et}=(0,i.a)({queryKey:["accounts"],queryFn:w.SX.list,enabled:$,refetchInterval:!!$&&8e3}),{data:es}=(0,i.a)({queryKey:["accounts","faucet"],queryFn:w.SX.faucet,enabled:$}),{data:ea}=(0,i.a)({queryKey:["mining","status"],queryFn:w.mI.status,enabled:$,refetchInterval:!!$&&3e3});(0,r.useEffect)(()=>{let e=(0,k.h)(),t=e=>{R(e),M.setQueryData(["node","status"],e)};return e.on("node:status",t),()=>{e.off("node:status",t)}},[M]),(0,r.useEffect)(()=>{Y&&!F&&q({coreRpcPort:String(Y.coreRpcPort),evmRpcPort:String(Y.evmRpcPort),wsPort:String(Y.wsPort),evmWsPort:String(Y.evmWsPort),chainId:String(Y.chainId),evmChainId:String(Y.evmChainId)})},[Y,F]);let en=(0,l.D)({mutationFn:w.N9.start,onSuccess:()=>M.invalidateQueries({queryKey:["node"]})}),el=(0,l.D)({mutationFn:w.N9.stop,onSuccess:()=>M.invalidateQueries({queryKey:["node"]})}),ei=(0,l.D)({mutationFn:w.N9.restart,onSuccess:()=>M.invalidateQueries({queryKey:["node"]})}),er=(0,l.D)({mutationFn:w.SC.activateWallet,onSuccess:()=>M.invalidateQueries({queryKey:["keystore","wallets"]})}),ec=(0,l.D)({mutationFn:e=>w.fA.updateConfig({coreRpcPort:Number(e.coreRpcPort),evmRpcPort:Number(e.evmRpcPort),wsPort:Number(e.wsPort),evmWsPort:Number(e.evmWsPort),chainId:Number(e.chainId),evmChainId:Number(e.evmChainId)}),onSuccess:()=>{D("✓ Saved"),setTimeout(()=>D(""),2500),M.invalidateQueries({queryKey:["network"]})},onError:e=>D("✗ ".concat(e.message))}),ed=(0,l.D)({mutationFn:()=>w.mI.mine(Number(B)),onSuccess:e=>{H("✓ Mined ".concat(e.mined," block(s)")),M.invalidateQueries({queryKey:["mining"]})},onError:e=>H("✗ ".concat(e.message))}),eo=(0,l.D)({mutationFn:()=>w.mI.start(Number(U)),onSuccess:()=>M.invalidateQueries({queryKey:["mining"]})}),eu=(0,l.D)({mutationFn:w.mI.stop,onSuccess:()=>M.invalidateQueries({queryKey:["mining"]})}),ex=null!=A?A:G,em=null!==(t=null==ex?void 0:ex.server)&&void 0!==t?t:"stopped",eh="starting"===em||"stopping"===em||en.isPending||el.isPending||ei.isPending,ep=$?"status-dot-green":eh?"status-dot-yellow":"status-dot-red",ev=en.isPending?"Starting…":el.isPending?"Stopping…":ei.isPending?"Restarting…":"starting"===em?"Starting…":"stopping"===em?"Stopping…":"running"===em?"Running":"Stopped",ej=J.find(e=>e.isActive),eN=null==ex?void 0:ex.rpcUrls,eg=_?ee:ee.slice(0,5),ey=ed.isPending||eo.isPending||eu.isPending;return(0,a.jsxs)("div",{className:"space-y-6",children:[T&&(0,a.jsx)(S,{onClose:()=>L(!1)}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Dashboard"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"Local Conflux development node"})]}),(0,a.jsxs)("div",{className:"card space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:ep}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm font-medium text-white",children:ev}),$&&(null==ex?void 0:ex.epochNumber)!==void 0&&(0,a.jsxs)("div",{className:"text-xs text-slate-400",children:["Epoch #",ex.epochNumber]})]})]}),(0,a.jsx)("div",{className:"flex gap-2",children:$?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("button",{type:"button",className:"btn-secondary",disabled:eh,onClick:()=>ei.mutate(),children:[(0,a.jsx)(x,{className:"h-4 w-4"})," Restart"]}),(0,a.jsxs)("button",{type:"button",className:"btn-danger",disabled:eh,onClick:()=>el.mutate(),children:[(0,a.jsx)(m.Z,{className:"h-4 w-4"})," Stop"]})]}):(0,a.jsxs)("button",{type:"button",className:"btn-success",disabled:eh,onClick:()=>en.mutate(),children:[(0,a.jsx)(o.Z,{className:"h-4 w-4"})," Start"]})})]}),!$&&J.length>0&&(0,a.jsxs)("div",{className:"border-t border-[#2a3147] pt-4",children:[(0,a.jsxs)("label",{className:"label flex items-center gap-1.5",children:[(0,a.jsx)(h.Z,{className:"h-3.5 w-3.5"})," Wallet"]}),1===J.length?(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,a.jsx)("code",{className:"text-xs text-blue-300",children:null!==(s=null==ej?void 0:ej.label)&&void 0!==s?s:J[0].label}),(0,a.jsx)("span",{className:"rounded bg-blue-600/20 px-1.5 py-0.5 text-[10px] text-blue-400",children:"active"})]}):(0,a.jsx)("select",{className:"input mt-1 w-full max-w-xs",value:null!==(c=null==ej?void 0:ej.id)&&void 0!==c?c:"",onChange:e=>er.mutate(e.target.value),disabled:er.isPending,children:J.map(e=>(0,a.jsxs)("option",{value:e.id,children:[e.label,e.isActive?" (active)":""]},e.id))})]}),F&&(0,a.jsxs)("div",{className:"border-t border-[#2a3147] pt-4",children:[(0,a.jsx)("div",{className:"mb-3 text-xs font-medium uppercase tracking-wider text-slate-500",children:"Network Configuration"}),$?(0,a.jsx)("div",{className:"grid grid-cols-3 gap-x-6 gap-y-2 sm:grid-cols-6",children:[["Core RPC",F.coreRpcPort],["EVM RPC",F.evmRpcPort],["Core WS",F.wsPort],["EVM WS",F.evmWsPort],["Core ID",F.chainId],["EVM ID",F.evmChainId]].map(e=>{let[t,s]=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[10px] text-slate-500",children:t}),(0,a.jsx)("div",{className:"text-xs text-slate-300",children:s})]},t)})}):(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[["Core RPC Port","coreRpcPort"],["EVM RPC Port","evmRpcPort"],["Core WS Port","wsPort"],["EVM WS Port","evmWsPort"],["Core Chain ID","chainId"],["EVM Chain ID","evmChainId"]].map(e=>{var t;let[s,n]=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"label",children:s}),(0,a.jsx)("input",{className:"input",type:"number",value:null!==(t=F[n])&&void 0!==t?t:"",onChange:e=>q(t=>t?{...t,[n]:e.target.value}:t)})]},n)})}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsxs)("button",{type:"button",className:"btn-primary",disabled:ec.isPending,onClick:()=>F&&ec.mutate(F),children:[(0,a.jsx)(p.Z,{className:"h-4 w-4"}),ec.isPending?"Saving…":"Save Config"]}),W&&(0,a.jsx)("span",{className:"text-sm ".concat(W.startsWith("✓")?"text-green-400":"text-red-400"),children:W})]})]})]})]}),$&&(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-sm font-medium text-slate-300",children:"Accounts"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)("button",{type:"button",className:"btn-secondary",title:"Toggle private key visibility",onClick:()=>V(e=>!e),children:[K?(0,a.jsx)(v.Z,{className:"h-4 w-4"}):(0,a.jsx)(j.Z,{className:"h-4 w-4"}),"Keys"]}),(0,a.jsxs)("button",{type:"button",className:"btn-primary",onClick:()=>L(!0),children:[(0,a.jsx)(N.Z,{className:"h-4 w-4"})," Fund"]})]})]}),es&&(0,a.jsxs)("div",{className:"card",children:[(0,a.jsx)("div",{className:"mb-2 text-xs font-medium uppercase tracking-wider text-slate-500",children:"Faucet Account"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-xs text-slate-500",children:"Core"}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("code",{className:"truncate text-xs text-blue-300",children:es.coreAddress}),(0,a.jsx)(C,{text:es.coreAddress,small:!0})]}),(0,a.jsxs)("div",{className:"text-sm text-slate-300",children:[es.coreBalance," CFX"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-xs text-slate-500",children:"EVM"}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("code",{className:"truncate text-xs text-blue-300",children:es.evmAddress}),(0,a.jsx)(C,{text:es.evmAddress,small:!0})]}),(0,a.jsxs)("div",{className:"text-sm text-slate-300",children:[es.evmBalance," CFX"]})]})]})]}),et?(0,a.jsx)("p",{className:"text-sm text-slate-500",children:"Loading accounts…"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"overflow-x-auto rounded-lg border border-[#2a3147]",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-[#161b27] text-xs uppercase tracking-wider text-slate-500",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 text-left",children:"#"}),(0,a.jsx)("th",{className:"px-3 py-2 text-left",children:"Core Address"}),(0,a.jsx)("th",{className:"px-3 py-2 text-left",children:"EVM Address"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Core"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"EVM"}),K&&(0,a.jsx)("th",{className:"px-3 py-2 text-left",children:"Private Key"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-[#2a3147]",children:eg.map(e=>(0,a.jsxs)("tr",{className:"bg-[#0e1117] hover:bg-[#161b27]",children:[(0,a.jsx)("td",{className:"px-3 py-2 text-slate-500",children:e.index}),(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("code",{className:"max-w-[180px] truncate text-xs text-blue-300",children:e.coreAddress}),(0,a.jsx)(C,{text:e.coreAddress,small:!0})]})}),(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("code",{className:"max-w-[140px] truncate text-xs text-blue-300",children:e.evmAddress}),(0,a.jsx)(C,{text:e.evmAddress,small:!0})]})}),(0,a.jsx)("td",{className:"px-3 py-2 text-right text-xs text-slate-300",children:e.coreBalance||"—"}),(0,a.jsx)("td",{className:"px-3 py-2 text-right text-xs text-slate-300",children:e.evmBalance||"—"}),K&&(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("code",{className:"max-w-[120px] truncate text-xs text-slate-400",children:e.privateKey}),(0,a.jsx)(C,{text:e.privateKey,small:!0})]})})]},e.index))})]})}),ee.length>5&&(0,a.jsx)("button",{type:"button",className:"btn-secondary w-full text-center text-xs",onClick:()=>Q(e=>!e),children:_?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g,{className:"mr-1 inline h-3.5 w-3.5"}),"Show less"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y,{className:"mr-1 inline h-3.5 w-3.5"}),"Show all ",ee.length," accounts"]})})]})]}),$&&(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("h2",{className:"text-sm font-medium text-slate-300",children:"Mining"}),(0,a.jsxs)("div",{className:"card flex flex-wrap items-center gap-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"label",children:"Auto-mining"}),(0,a.jsx)("span",{className:(null==ea?void 0:ea.isRunning)?"badge-green":"badge-gray",children:(null==ea?void 0:ea.isRunning)?"On":"Off"})]}),(null==ea?void 0:ea.isRunning)&&void 0!==ea.interval&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"label",children:"Block time"}),(0,a.jsxs)("span",{className:"text-sm text-slate-300",children:[ea.interval," ms"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"label",children:"Blocks mined"}),(0,a.jsx)("span",{className:"text-sm text-slate-300",children:null!==(d=null==ea?void 0:ea.blocksMined)&&void 0!==d?d:"—"})]})]}),(0,a.jsxs)("div",{className:"card space-y-3",children:[(0,a.jsxs)("h3",{className:"flex items-center gap-2 text-xs font-medium uppercase tracking-wider text-slate-500",children:[(0,a.jsx)(b.Z,{className:"h-3.5 w-3.5"})," Manual Mine"]}),(0,a.jsxs)("div",{className:"flex items-end gap-3",children:[(0,a.jsxs)("div",{className:"w-28",children:[(0,a.jsx)("label",{className:"label",children:"Blocks"}),(0,a.jsx)("input",{className:"input",type:"number",min:"1",max:"1000",value:B,onChange:e=>O(e.target.value)})]}),(0,a.jsxs)("button",{type:"button",className:"btn-primary",disabled:ey,onClick:()=>ed.mutate(),children:[(0,a.jsx)(f.Z,{className:"h-4 w-4"}),ed.isPending?"Mining…":"Mine"]})]}),z&&(0,a.jsx)("p",{className:"text-sm ".concat(z.startsWith("✓")?"text-green-400":"text-red-400"),children:z})]}),(0,a.jsxs)("div",{className:"card space-y-3",children:[(0,a.jsxs)("h3",{className:"flex items-center gap-2 text-xs font-medium uppercase tracking-wider text-slate-500",children:[(0,a.jsx)(o.Z,{className:"h-3.5 w-3.5"})," Auto-mining"]}),(0,a.jsxs)("div",{className:"flex items-end gap-3",children:[(0,a.jsxs)("div",{className:"w-36",children:[(0,a.jsx)("label",{className:"label",children:"Interval (ms)"}),(0,a.jsx)("input",{className:"input",type:"number",min:"100",value:U,disabled:null==ea?void 0:ea.isRunning,onChange:e=>X(e.target.value)})]}),(null==ea?void 0:ea.isRunning)?(0,a.jsxs)("button",{type:"button",className:"btn-danger",disabled:ey,onClick:()=>eu.mutate(),children:[(0,a.jsx)(m.Z,{className:"h-4 w-4"})," Stop Auto-mine"]}):(0,a.jsxs)("button",{type:"button",className:"btn-success",disabled:ey,onClick:()=>eo.mutate(),children:[(0,a.jsx)(o.Z,{className:"h-4 w-4"})," Start Auto-mine"]})]}),(eo.error||eu.error)&&(0,a.jsx)("p",{className:"text-sm text-red-400",children:String(null!==(u=eo.error)&&void 0!==u?u:eu.error)})]})]}),eN&&(0,a.jsxs)("div",{className:"card space-y-3",children:[(0,a.jsx)("h2",{className:"text-sm font-medium text-slate-300",children:"RPC Endpoints"}),[["Core RPC",eN.core],["EVM / ETH RPC",eN.evm],["Core WebSocket",null!==(P=eN.coreWs)&&void 0!==P?P:eN.ws],["EVM WebSocket",null!==(Z=eN.evmWs)&&void 0!==Z?Z:""]].filter(e=>{let[,t]=e;return t}).map(e=>{let[t,s]=e;return(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"w-32 text-xs text-slate-500",children:t}),(0,a.jsxs)("div",{className:"flex flex-1 items-center overflow-hidden",children:[(0,a.jsx)("code",{className:"flex-1 truncate rounded bg-[#0e1117] px-2 py-1 text-xs text-blue-300",children:s}),(0,a.jsx)(C,{text:s})]})]},t)})]}),(en.error||el.error||ei.error)&&(0,a.jsx)("div",{className:"rounded-md border border-red-800 bg-red-950/50 px-4 py-2 text-sm text-red-400",children:String(null!==(I=null!==(E=en.error)&&void 0!==E?E:el.error)&&void 0!==I?I:ei.error)})]})}},8144:function(e,t,s){"use strict";s.d(t,{N9:function(){return u},SC:function(){return v},SX:function(){return x},Vp:function(){return m},fA:function(){return p},mI:function(){return h}});var a,n=s(2608);let l="".concat(null!==(a=n.env.NEXT_PUBLIC_API_URL)&&void 0!==a?a:"","/api");async function i(e,t,s){let a=await fetch("".concat(l).concat(t),{method:e,headers:s?{"Content-Type":"application/json"}:void 0,body:s?JSON.stringify(s):void 0});if(!a.ok){var n;throw Error(null!==(n=(await a.json().catch(()=>({error:a.statusText}))).error)&&void 0!==n?n:a.statusText)}return a.json()}let r=e=>i("GET",e),c=(e,t)=>i("POST",e,t),d=(e,t)=>i("PUT",e,t),o=e=>i("DELETE",e),u={status:()=>r("/node/status"),start:()=>c("/node/start"),stop:()=>c("/node/stop"),restart:()=>c("/node/restart")},x={list:()=>r("/accounts"),faucet:()=>r("/accounts/faucet"),fund:(e,t,s)=>c("/accounts/fund",{address:e,amount:t,chain:s})},m={templates:()=>r("/contracts/templates"),template:e=>r("/contracts/templates/".concat(e)),compile:(e,t)=>c("/contracts/compile",{source:e,contractName:t}),deploy:e=>c("/contracts/deploy",e)},h={status:()=>r("/mining/status"),mine:e=>c("/mining/mine",{blocks:e}),start:e=>c("/mining/start",{intervalMs:e}),stop:()=>c("/mining/stop")},p={config:()=>r("/network/config"),updateConfig:e=>d("/network/config",e),rpcUrls:()=>r("/network/rpc-urls")},v={status:()=>r("/keystore/status"),generate:()=>c("/keystore/generate"),setup:e=>c("/keystore/setup",e),unlock:e=>c("/keystore/unlock",{password:e}),lock:()=>c("/keystore/lock"),wallets:()=>r("/keystore/wallets"),addWallet:(e,t)=>c("/keystore/wallets",{mnemonic:e,label:t}),activateWallet:e=>c("/keystore/wallets/".concat(e,"/activate")),deleteWallet:e=>o("/keystore/wallets/".concat(e))}},3634:function(e,t,s){"use strict";s.d(t,{h:function(){return i}});var a=s(7903),n=s(2608);let l=null;function i(){if(!l){var e;let t=null!==(e=n.env.NEXT_PUBLIC_WS_URL)&&void 0!==e?e:"";l=(0,a.io)(t||void 0,{path:"/socket.io",reconnectionDelay:1e3,reconnectionDelayMax:5e3,reconnectionAttempts:Number.POSITIVE_INFINITY})}return l}},6804:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(3035).Z)("Droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]])},7201:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(3035).Z)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},3948:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(3035).Z)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},1494:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(3035).Z)("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]])},5175:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(3035).Z)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},3737:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(3035).Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},2846:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(3035).Z)("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]])},6444:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(3035).Z)("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])}},function(e){e.O(0,[363,826,285,749,744],function(){return e(e.s=1134)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{1134:function(e,t,s){Promise.resolve().then(s.bind(s,8375))},8375:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return I}});var a=s(5853),n=s(8990),l=s(4852),i=s(6632),r=s(9928),c=s(3264),d=s(3035);let o=(0,d.Z)("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),u=(0,d.Z)("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var x=s(758),m=s(5710),h=s(5175),p=s(9924);let y=(0,d.Z)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);var v=s(2846),j=s(8701),b=s(3737),g=s(6444),N=s(7201),f=s(3948),w=s(6804),k=s(4254),S=s(8144),C=s(3634);function P(e){let{text:t,small:s}=e,[n,l]=(0,k.useState)(!1);return(0,a.jsx)("button",{type:"button",title:"Copy",className:"rounded text-slate-500 hover:text-slate-300 ".concat(s?"p-0.5":"ml-1.5 px-1.5 py-1 btn-secondary"),onClick:async()=>{await navigator.clipboard.writeText(t),l(!0),setTimeout(()=>l(!1),1600)},children:n?(0,a.jsx)(r.Z,{className:s?"h-3 w-3 text-green-400":"h-3.5 w-3.5 text-green-400"}):(0,a.jsx)(c.Z,{className:s?"h-3 w-3":"h-3.5 w-3.5"})})}function Z(){let{data:e}=(0,n.a)({queryKey:["settings"],queryFn:S.pJ.get,staleTime:3e4}),[t,s]=(0,k.useState)(!1);if(!e)return null;let l=!e.isPublic||e.authEnabled;return(0,a.jsxs)("div",{className:"card border ".concat(l?"border-[#2a3147]":"border-yellow-800"),children:[(0,a.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between",onClick:()=>s(e=>!e),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[e.isPublic&&!e.authEnabled?(0,a.jsx)(o,{className:"h-4 w-4 text-yellow-400"}):(0,a.jsx)(u,{className:"h-4 w-4 text-green-400"}),(0,a.jsx)("span",{className:"text-sm font-medium text-slate-300",children:"Security"}),e.isPublic&&!e.authEnabled&&(0,a.jsx)("span",{className:"rounded bg-yellow-900/50 px-1.5 py-0.5 text-[10px] text-yellow-400",children:"exposed without auth"})]}),t?(0,a.jsx)(x.Z,{className:"h-4 w-4 text-slate-500"}):(0,a.jsx)(m.Z,{className:"h-4 w-4 text-slate-500"})]}),t&&(0,a.jsxs)("div",{className:"mt-3 space-y-3 border-t border-[#2a3147] pt-3 text-xs",children:[(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:[["Bind address","".concat(e.host,":").concat(e.port)],["Public",e.isPublic?"Yes":"No (localhost)"],["API auth",e.authEnabled?"✓ Enabled":"✗ Disabled"],["Rate limit","".concat(e.rateLimit.maxRequests," req / min")],["CORS",Array.isArray(e.corsOrigins)?e.corsOrigins.join(", ")||"none":e.corsOrigins]].map(t=>{let[s,n]=t;return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-slate-500",children:s}),(0,a.jsx)("div",{className:"mt-0.5 font-medium ".concat("API auth"===s&&!e.authEnabled&&e.isPublic?"text-yellow-400":"text-slate-200"),children:n})]},s)})}),e.isPublic&&!e.authEnabled&&(0,a.jsxs)("div",{className:"rounded border border-yellow-800 bg-yellow-950/40 px-3 py-2 text-yellow-400",children:[(0,a.jsx)("p",{className:"font-semibold",children:"⚠ Running on a public interface without auth"}),(0,a.jsxs)("p",{className:"mt-1 text-yellow-500",children:["Anyone who can reach this host can control the node and read private keys. Restart with"," ",(0,a.jsx)("code",{className:"rounded bg-yellow-900/60 px-1",children:"--api-key <secret>"})," ","to enable Bearer token auth."]})]}),(0,a.jsxs)("div",{className:"rounded border border-[#2a3147] bg-[#0e1117] px-3 py-2 text-slate-400",children:[(0,a.jsx)("p",{className:"font-semibold text-slate-300",children:"Public-host hardening checklist"}),(0,a.jsxs)("ul",{className:"mt-1 list-inside list-disc space-y-0.5 text-slate-500",children:[(0,a.jsxs)("li",{children:["Pass"," ",(0,a.jsx)("code",{className:"text-slate-400",children:"--api-key <secret>"})," ","on startup"]}),(0,a.jsxs)("li",{children:["Restrict ",(0,a.jsx)("code",{className:"text-slate-400",children:"--cors-origin"})," ","to your frontend origin"]}),(0,a.jsx)("li",{children:"Put a TLS-terminating reverse proxy (nginx/caddy) in front"}),(0,a.jsxs)("li",{children:["Limit firewall ingress to port ",e.port," from known IPs"]}),(0,a.jsx)("li",{children:"Never expose a wallet that holds real funds"})]})]})]})]})}function E(e){let{onClose:t}=e,s=(0,l.NL)(),[n,r]=(0,k.useState)(""),[c,d]=(0,k.useState)(""),[o,u]=(0,k.useState)(""),x=(0,i.D)({mutationFn:()=>S.SX.fund(n,c||void 0),onSuccess:e=>{u("✓ tx: ".concat(e.txHash)),s.invalidateQueries({queryKey:["accounts"]})},onError:e=>u("✗ ".concat(e.message))}),m=n.trim().toLowerCase().startsWith("0x")?"EVM (eSpace)":n.trim()?"Core Space":null;return(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",children:(0,a.jsxs)("div",{className:"card w-full max-w-md space-y-4",children:[(0,a.jsx)("h2",{className:"font-medium text-white",children:"Fund Address"}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"label",children:["Address",m&&(0,a.jsxs)("span",{className:"ml-2 text-xs text-slate-400",children:["— detected: ",m]})]}),(0,a.jsx)("input",{className:"input",value:n,onChange:e=>r(e.target.value),placeholder:"0x… or cfx:…"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"label",children:"Amount (optional)"}),(0,a.jsx)("input",{className:"input",value:c,onChange:e=>d(e.target.value),placeholder:"1000"})]}),o&&(0,a.jsx)("p",{className:"text-sm text-slate-300",children:o}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)("button",{type:"button",className:"btn-secondary",onClick:t,children:"Close"}),(0,a.jsx)("button",{type:"button",className:"btn-primary",disabled:!n||x.isPending,onClick:()=>x.mutate(),children:x.isPending?"Sending…":"Fund"})]})]})})}function I(){var e,t,s,r,c,d,o,u,I,q,R,M,A;let F=(0,l.NL)(),[W,K]=(0,k.useState)(null),[D,T]=(0,k.useState)(null),[Q,V]=(0,k.useState)(""),[L,_]=(0,k.useState)(!1),[z,O]=(0,k.useState)(!1),[B,U]=(0,k.useState)(!1),[X,H]=(0,k.useState)("1"),[J,Y]=(0,k.useState)("1000"),[G,$]=(0,k.useState)(""),[ee,et]=(0,k.useState)(!1),{data:es}=(0,n.a)({queryKey:["node","status"],queryFn:S.N9.status}),{data:ea=[]}=(0,n.a)({queryKey:["keystore","wallets"],queryFn:S.SC.wallets,refetchInterval:5e3}),{data:en}=(0,n.a)({queryKey:["network","config"],queryFn:S.fA.config}),el=(null===(e=null!=W?W:es)||void 0===e?void 0:e.server)==="running",{data:ei=[],isLoading:er}=(0,n.a)({queryKey:["accounts"],queryFn:S.SX.list,enabled:el,refetchInterval:!!el&&8e3}),{data:ec}=(0,n.a)({queryKey:["accounts","faucet"],queryFn:S.SX.faucet,enabled:el}),{data:ed}=(0,n.a)({queryKey:["mining","status"],queryFn:S.mI.status,enabled:el,refetchInterval:!!el&&3e3});(0,k.useEffect)(()=>{let e=(0,C.h)(),t=e=>{K(e),F.setQueryData(["node","status"],e)};return e.on("node:status",t),()=>{e.off("node:status",t)}},[F]),(0,k.useEffect)(()=>{en&&!D&&T({coreRpcPort:String(en.coreRpcPort),evmRpcPort:String(en.evmRpcPort),wsPort:String(en.wsPort),evmWsPort:String(en.evmWsPort),chainId:String(en.chainId),evmChainId:String(en.evmChainId)})},[en,D]),(0,k.useEffect)(()=>{(null==ed?void 0:ed.isRunning)&&void 0!==ed.interval&&Y(String(ed.interval))},[null==ed?void 0:ed.isRunning,null==ed?void 0:ed.interval]);let eo=(0,i.D)({mutationFn:S.N9.start,onSuccess:()=>F.invalidateQueries({queryKey:["node"]})}),eu=(0,i.D)({mutationFn:S.N9.stop,onSuccess:()=>F.invalidateQueries({queryKey:["node"]})}),ex=(0,i.D)({mutationFn:S.N9.restart,onSuccess:()=>F.invalidateQueries({queryKey:["node"]})}),em=(0,i.D)({mutationFn:S.N9.restartWipe,onSuccess:()=>{F.invalidateQueries({queryKey:["node"]}),F.invalidateQueries({queryKey:["accounts"]}),F.invalidateQueries({queryKey:["mining"]})}}),eh=(0,i.D)({mutationFn:S.N9.wipe,onSuccess:()=>{F.invalidateQueries({queryKey:["node"]}),F.invalidateQueries({queryKey:["accounts"]}),F.invalidateQueries({queryKey:["contracts","deployed"]}),F.invalidateQueries({queryKey:["mining"]})}}),ep=(0,i.D)({mutationFn:S.SC.activateWallet,onSuccess:()=>F.invalidateQueries({queryKey:["keystore","wallets"]})}),ey=(0,i.D)({mutationFn:e=>S.fA.updateConfig({coreRpcPort:Number(e.coreRpcPort),evmRpcPort:Number(e.evmRpcPort),wsPort:Number(e.wsPort),evmWsPort:Number(e.evmWsPort),chainId:Number(e.chainId),evmChainId:Number(e.evmChainId)}),onSuccess:()=>{V("✓ Saved"),setTimeout(()=>V(""),2500),F.invalidateQueries({queryKey:["network"]})},onError:e=>V("✗ ".concat(e.message))}),ev=(0,i.D)({mutationFn:()=>S.mI.mine(Number(X)),onSuccess:e=>{$("✓ Mined ".concat(e.mined," block(s)")),F.invalidateQueries({queryKey:["mining"]})},onError:e=>$("✗ ".concat(e.message))}),ej=(0,i.D)({mutationFn:()=>S.mI.start(Number(J)),onSuccess:()=>F.invalidateQueries({queryKey:["mining"]})}),eb=(0,i.D)({mutationFn:S.mI.stop,onSuccess:()=>F.invalidateQueries({queryKey:["mining"]})}),eg=null!=W?W:es,eN=null!==(t=null==eg?void 0:eg.server)&&void 0!==t?t:"stopped",ef="starting"===eN||"stopping"===eN||eo.isPending||eu.isPending||ex.isPending||em.isPending||eh.isPending,ew=el?"status-dot-green":ef?"status-dot-yellow":"status-dot-red",ek=eo.isPending?"Starting…":eu.isPending?"Stopping…":ex.isPending||em.isPending?"Restarting…":eh.isPending?"Wiping…":"starting"===eN?"Starting…":"stopping"===eN?"Stopping…":"running"===eN?"Running":"Stopped",eS=ea.find(e=>e.isActive),eC=null==eg?void 0:eg.rpcUrls,eP=B?ei:ei.slice(0,5),eZ=ev.isPending||ej.isPending||eb.isPending;async function eE(){try{await eb.mutateAsync(),ej.mutate()}catch(e){}}return(0,a.jsxs)("div",{className:"space-y-6",children:[z&&(0,a.jsx)(E,{onClose:()=>O(!1)}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Dashboard"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-slate-400",children:"Local Conflux development node"})]}),(0,a.jsxs)("div",{className:"card space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:ew}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm font-medium text-white",children:ek}),el&&(null==eg?void 0:eg.epochNumber)!==void 0&&(0,a.jsxs)("div",{className:"text-xs text-slate-400",children:["Epoch #",eg.epochNumber]})]})]}),(0,a.jsx)("div",{className:"flex gap-2",children:el?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("button",{type:"button",className:"btn-secondary",disabled:ef,onClick:()=>ex.mutate(),children:[(0,a.jsx)(y,{className:"h-4 w-4"})," Restart"]}),(0,a.jsxs)("button",{type:"button",className:"btn-warning",disabled:ef,title:"Wipe this wallet's data directory and restart from block 0",onClick:()=>{confirm("Wipe all chain data for this wallet and restart from block 0?")&&em.mutate()},children:[(0,a.jsx)(p.Z,{className:"h-4 w-4"})," Wipe & Restart"]}),(0,a.jsxs)("button",{type:"button",className:"btn-danger",disabled:ef,onClick:()=>eu.mutate(),children:[(0,a.jsx)(v.Z,{className:"h-4 w-4"})," Stop"]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("button",{type:"button",className:"btn-success",disabled:ef,onClick:()=>eo.mutate(),children:[(0,a.jsx)(h.Z,{className:"h-4 w-4"})," Start"]}),(0,a.jsxs)("button",{type:"button",className:"btn-warning",disabled:ef,title:"Delete all chain data for this wallet (cannot be undone)",onClick:()=>{confirm("Wipe all chain data for this wallet? This cannot be undone.")&&eh.mutate()},children:[(0,a.jsx)(p.Z,{className:"h-4 w-4"})," Wipe Data"]})]})})]}),el&&eC&&(0,a.jsxs)("div",{className:"border-t border-[#2a3147] pt-3",children:[(0,a.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between text-xs font-medium uppercase tracking-wider text-slate-500 hover:text-slate-300 transition-colors",onClick:()=>et(e=>!e),children:[(0,a.jsx)("span",{children:"RPC Endpoints"}),ee?(0,a.jsx)(x.Z,{className:"h-3.5 w-3.5"}):(0,a.jsx)(m.Z,{className:"h-3.5 w-3.5"})]}),ee&&(0,a.jsxs)("div",{className:"mt-3 space-y-2",children:[[["Core RPC",eC.core],["EVM / ETH RPC",eC.evm],["Core WebSocket",null!==(s=eC.coreWs)&&void 0!==s?s:eC.ws],["EVM WebSocket",null!==(r=eC.evmWs)&&void 0!==r?r:""]].filter(e=>{let[,t]=e;return t}).map(e=>{let[t,s]=e;return(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"w-32 text-xs text-slate-500",children:t}),(0,a.jsxs)("div",{className:"flex flex-1 items-center overflow-hidden",children:[(0,a.jsx)("code",{className:"flex-1 truncate rounded bg-[#0e1117] px-2 py-1 text-xs text-blue-300",children:s}),(0,a.jsx)(P,{text:s})]})]},t)}),D&&(0,a.jsxs)("div",{className:"flex gap-8 border-t border-[#2a3147] pt-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[10px] text-slate-500",children:"Core Chain ID"}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"text-xs text-slate-300",children:D.chainId}),(0,a.jsx)(P,{text:D.chainId,small:!0})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[10px] text-slate-500",children:"EVM Chain ID"}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{className:"text-xs text-slate-300",children:D.evmChainId}),(0,a.jsx)(P,{text:D.evmChainId,small:!0})]})]})]})]})]}),!el&&ea.length>0&&(0,a.jsxs)("div",{className:"border-t border-[#2a3147] pt-4",children:[(0,a.jsxs)("label",{className:"label flex items-center gap-1.5",children:[(0,a.jsx)(j.Z,{className:"h-3.5 w-3.5"})," Wallet"]}),1===ea.length?(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,a.jsx)("code",{className:"text-xs text-blue-300",children:null!==(c=null==eS?void 0:eS.label)&&void 0!==c?c:ea[0].label}),(0,a.jsx)("span",{className:"rounded bg-blue-600/20 px-1.5 py-0.5 text-[10px] text-blue-400",children:"active"})]}):(0,a.jsx)("select",{className:"input mt-1 w-full max-w-xs",value:null!==(d=null==eS?void 0:eS.id)&&void 0!==d?d:"",onChange:e=>ep.mutate(e.target.value),disabled:ep.isPending,children:ea.map(e=>(0,a.jsxs)("option",{value:e.id,children:[e.label,e.isActive?" (active)":""]},e.id))})]}),!el&&D&&(0,a.jsxs)("div",{className:"border-t border-[#2a3147] pt-4",children:[(0,a.jsx)("div",{className:"mb-3 text-xs font-medium uppercase tracking-wider text-slate-500",children:"Network Configuration"}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[["Core RPC Port","coreRpcPort"],["EVM RPC Port","evmRpcPort"],["Core WS Port","wsPort"],["EVM WS Port","evmWsPort"],["Core Chain ID","chainId"],["EVM Chain ID","evmChainId"]].map(e=>{var t;let[s,n]=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"label",children:s}),(0,a.jsx)("input",{className:"input",type:"number",value:null!==(t=D[n])&&void 0!==t?t:"",onChange:e=>T(t=>t?{...t,[n]:e.target.value}:t)})]},n)})}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsxs)("button",{type:"button",className:"btn-primary",disabled:ey.isPending||ef,onClick:()=>D&&ey.mutate(D),children:[(0,a.jsx)(b.Z,{className:"h-4 w-4"}),ey.isPending?"Saving…":"Save Config"]}),Q&&(0,a.jsx)("span",{className:"text-sm ".concat(Q.startsWith("✓")?"text-green-400":"text-red-400"),children:Q})]})]})]})]}),el&&(0,a.jsxs)("div",{className:"card",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsx)("span",{className:"text-sm font-medium text-slate-300 shrink-0",children:"Mining"}),(0,a.jsxs)("span",{className:"rounded bg-[#1a2235] px-2 py-0.5 text-sm font-semibold tabular-nums text-white shrink-0",children:[(null!==(o=null==ed?void 0:ed.blocksMined)&&void 0!==o?o:0).toLocaleString(),(0,a.jsx)("span",{className:"ml-1 text-xs font-normal text-slate-400",children:"blocks"})]}),(0,a.jsx)("div",{className:"flex-1"}),(null==ed?void 0:ed.isRunning)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{className:"text-xs text-slate-500 shrink-0",children:"Interval (ms)"}),(0,a.jsx)("input",{className:"input w-24 shrink-0",type:"number",min:"100",value:J,onChange:e=>Y(e.target.value)}),Number(J)!==(null!==(u=ed.interval)&&void 0!==u?u:0)&&(0,a.jsx)("button",{type:"button",className:"btn-secondary shrink-0",disabled:eZ,onClick:eE,children:"Apply"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{className:"text-xs text-slate-500 shrink-0",children:"Blocks"}),(0,a.jsx)("input",{className:"input w-20 shrink-0",type:"number",min:"1",max:"1000",value:X,onChange:e=>H(e.target.value)}),(0,a.jsxs)("button",{type:"button",className:"btn-primary shrink-0",disabled:eZ,onClick:()=>ev.mutate(),children:[(0,a.jsx)(g.Z,{className:"h-4 w-4"}),ev.isPending?"Mining…":"Mine"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0 border-l border-[#2a3147] pl-3",children:[(0,a.jsx)("span",{className:"text-xs font-medium ".concat((null==ed?void 0:ed.isRunning)?"text-green-400":"text-slate-500"),children:"Auto"}),(0,a.jsx)("button",{type:"button",disabled:eZ,className:"relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors focus:outline-none ".concat((null==ed?void 0:ed.isRunning)?"bg-green-600":"bg-slate-600"),onClick:()=>(null==ed?void 0:ed.isRunning)?eb.mutate():ej.mutate(),title:(null==ed?void 0:ed.isRunning)?"Stop auto-mining":"Start auto-mining",children:(0,a.jsx)("span",{className:"inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat((null==ed?void 0:ed.isRunning)?"translate-x-[18px]":"translate-x-0.5")})})]})]}),(G||ej.error||eb.error)&&(0,a.jsx)("p",{className:"mt-2 text-xs ".concat((null==G?void 0:G.startsWith("✓"))?"text-green-400":"text-red-400"),children:G||String(null!==(I=ej.error)&&void 0!==I?I:eb.error)})]}),el&&(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("h2",{className:"text-sm font-medium text-slate-300",children:"Accounts"}),ec&&(0,a.jsx)("div",{className:"card",children:(0,a.jsxs)("div",{className:"flex items-start justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"mb-1 text-xs font-medium uppercase tracking-wider text-slate-500",children:"Faucet Account"}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("code",{className:"max-w-[260px] truncate text-xs text-blue-300",children:ec.coreAddress}),(0,a.jsx)(P,{text:ec.coreAddress,small:!0})]}),(0,a.jsxs)("div",{className:"mt-0.5 text-sm text-slate-300",children:[ec.coreBalance," CFX"]})]}),(0,a.jsxs)("div",{className:"flex shrink-0 gap-2",children:[(0,a.jsxs)("button",{type:"button",className:"btn-secondary",title:"Toggle private key visibility",onClick:()=>_(e=>!e),children:[L?(0,a.jsx)(N.Z,{className:"h-4 w-4"}):(0,a.jsx)(f.Z,{className:"h-4 w-4"}),"Keys"]}),(0,a.jsxs)("button",{type:"button",className:"btn-primary",onClick:()=>O(!0),children:[(0,a.jsx)(w.Z,{className:"h-4 w-4"})," Fund"]})]})]})}),er?(0,a.jsx)("p",{className:"text-sm text-slate-500",children:"Loading accounts…"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"overflow-x-auto rounded-lg border border-[#2a3147]",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{className:"bg-[#161b27] text-xs uppercase tracking-wider text-slate-500",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 text-left",children:"#"}),(0,a.jsx)("th",{className:"px-3 py-2 text-left",children:"Core Address"}),(0,a.jsx)("th",{className:"px-3 py-2 text-left",children:"EVM Address"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"Core"}),(0,a.jsx)("th",{className:"px-3 py-2 text-right",children:"EVM"}),L&&(0,a.jsx)("th",{className:"px-3 py-2 text-left",children:"Private Key"})]})}),(0,a.jsx)("tbody",{className:"divide-y divide-[#2a3147]",children:eP.map(e=>(0,a.jsxs)("tr",{className:"bg-[#0e1117] hover:bg-[#161b27]",children:[(0,a.jsx)("td",{className:"px-3 py-2 text-slate-500",children:e.index}),(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("code",{className:"max-w-[180px] truncate text-xs text-blue-300",children:e.coreAddress}),(0,a.jsx)(P,{text:e.coreAddress,small:!0})]})}),(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("code",{className:"max-w-[140px] truncate text-xs text-blue-300",children:e.evmAddress}),(0,a.jsx)(P,{text:e.evmAddress,small:!0})]})}),(0,a.jsx)("td",{className:"px-3 py-2 text-right text-xs text-slate-300",children:e.coreBalance||"—"}),(0,a.jsx)("td",{className:"px-3 py-2 text-right text-xs text-slate-300",children:e.evmBalance||"—"}),L&&(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("code",{className:"max-w-[120px] truncate text-xs text-slate-400",children:e.privateKey}),(0,a.jsx)(P,{text:e.privateKey,small:!0})]})})]},e.index))})]})}),ei.length>5&&(0,a.jsx)("button",{type:"button",className:"btn-secondary w-full text-center text-xs",onClick:()=>U(e=>!e),children:B?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.Z,{className:"mr-1 inline h-3.5 w-3.5"}),"Show less"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.Z,{className:"mr-1 inline h-3.5 w-3.5"}),"Show all ",ei.length," accounts"]})})]})]}),(0,a.jsx)(Z,{}),(eo.error||eu.error||ex.error||em.error||eh.error)&&(0,a.jsx)("div",{className:"rounded-md border border-red-800 bg-red-950/50 px-4 py-2 text-sm text-red-400",children:String(null!==(A=null!==(M=null!==(R=null!==(q=eo.error)&&void 0!==q?q:eu.error)&&void 0!==R?R:ex.error)&&void 0!==M?M:em.error)&&void 0!==A?A:eh.error)})]})}},8144:function(e,t,s){"use strict";s.d(t,{N9:function(){return u},SC:function(){return y},SX:function(){return x},Vp:function(){return m},fA:function(){return p},mI:function(){return h},pJ:function(){return v}});var a,n=s(2608);let l="".concat(null!==(a=n.env.NEXT_PUBLIC_API_URL)&&void 0!==a?a:"","/api");async function i(e,t,s){let a=await fetch("".concat(l).concat(t),{method:e,headers:s?{"Content-Type":"application/json"}:void 0,body:s?JSON.stringify(s):void 0});if(!a.ok){var n;throw Error(null!==(n=(await a.json().catch(()=>({error:a.statusText}))).error)&&void 0!==n?n:a.statusText)}return a.json()}let r=e=>i("GET",e),c=(e,t)=>i("POST",e,t),d=e=>i("DELETE",e),o=(e,t)=>i("PUT",e,t),u={status:()=>r("/node/status"),start:()=>c("/node/start"),stop:()=>c("/node/stop"),restart:()=>c("/node/restart"),restartWipe:()=>c("/node/restart-wipe"),wipe:()=>c("/node/wipe")},x={list:()=>r("/accounts"),faucet:()=>r("/accounts/faucet"),fund:(e,t,s)=>c("/accounts/fund",{address:e,amount:t,chain:s})},m={templates:()=>r("/contracts/templates"),template:e=>r("/contracts/templates/".concat(e)),compile:(e,t)=>c("/contracts/compile",{source:e,contractName:t}),deploy:e=>c("/contracts/deploy",e),deployed:e=>r("/contracts/deployed".concat(e?"?chain=".concat(e):"")),deleteDeployed:e=>d("/contracts/deployed/".concat(e)),call:(e,t,s,a)=>c("/contracts/".concat(e,"/call"),{functionName:t,args:s,accountIndex:a})},h={status:()=>r("/mining/status"),mine:e=>c("/mining/mine",{blocks:e}),start:e=>c("/mining/start",{intervalMs:e}),stop:()=>c("/mining/stop")},p={config:()=>r("/network/config"),updateConfig:e=>o("/network/config",e),rpcUrls:()=>r("/network/rpc-urls")},y={status:()=>r("/keystore/status"),generate:()=>c("/keystore/generate"),setup:e=>c("/keystore/setup",e),unlock:e=>c("/keystore/unlock",{password:e}),lock:()=>c("/keystore/lock"),wallets:()=>r("/keystore/wallets"),addWallet:(e,t)=>c("/keystore/wallets",{mnemonic:e,label:t}),activateWallet:e=>c("/keystore/wallets/".concat(e,"/activate")),deleteWallet:e=>d("/keystore/wallets/".concat(e))},v={get:()=>r("/settings")}},3634:function(e,t,s){"use strict";s.d(t,{h:function(){return i}});var a=s(7903),n=s(2608);let l=null;function i(){if(!l){var e;let t=null!==(e=n.env.NEXT_PUBLIC_WS_URL)&&void 0!==e?e:"";l=(0,a.io)(t||void 0,{path:"/socket.io",reconnectionDelay:1e3,reconnectionDelayMax:5e3,reconnectionAttempts:Number.POSITIVE_INFINITY})}return l}},5710:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(3035).Z)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},758:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(3035).Z)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},6804:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(3035).Z)("Droplets",[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]])},7201:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(3035).Z)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},3948:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(3035).Z)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},5175:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(3035).Z)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},3737:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(3035).Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},2846:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(3035).Z)("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]])},9924:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(3035).Z)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},6444:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(3035).Z)("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])}},function(e){e.O(0,[363,826,285,749,744],function(){return e(e.s=1134)}),_N_E=e.O()}]);
|