PageSourceSearch

https://nfthive.io/_next/static/chunks/pages/cpu-574bc5af2d4084a1.js

js nfthive.io collected 2026-09-25 18:40:16 UTC 15,318 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5202],{5489:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/cpu",function(){return a(35923)}])},35923:function(e,t,a){"use strict";a.r(t);var n=a(30137),s=a(76341),l=a(67462),r=a(98732),c=a(97582),o=a(85893),i=a(50480),d=a(69368),u=a(34386),f=a(87109),x=a(83321),m=a(57922),h=a(46901),p=a(90837),v=a(93967),b=a.n(v),_=a(30381),j=a.n(_),y=a(80129),N=a.n(y),k=a(67294),w=a(22120),g=a(84271),W=a(69596),A=a(34772),P=a(14503),S=a(8163),F=a(32747),E=a(84723),X=a(70416),q=a(49785);a(59455),t.default=function(e){var t,a,v,_,y,C=(0,w.$G)("common").t,O="nfthivecpu4u",H="nfthivecpup1",Y="nfthivecpup2",Z="nfthivecpup3",T=(0,r._)((0,k.useState)(1),2),D=T[0],U=T[1],J=(0,r._)((0,k.useState)(1),2),R=J[0],$=J[1],B=(0,r._)((0,k.useState)(null),2),L=B[0],M=B[1],z=(0,r._)((0,k.useState)(null),2),I=z[0],V=z[1],G=(0,r._)((0,k.useState)(null),2),K=G[0],Q=G[1],ee=(0,r._)((0,k.useState)(!1),2),et=ee[0],ea=ee[1],en=(0,r._)((0,k.useState)(1),2),es=en[0],el=en[1],er=(0,r._)((0,k.useState)(1),2),ec=er[0],eo=er[1],ei=(0,r._)((0,k.useState)(null),2),ed=ei[0],eu=ei[1],ef=N().parse(window.location.search.substring(1,window.location.search.length)),ex=(0,r._)((0,q.Oc)(),1)[0],em=null==ex?void 0:ex.activeUser,eh=(null==em?void 0:em.accountName)?null==ex?void 0:ex.activeUser.accountName:null,ep=(0,r._)((0,k.useState)(ef&&ef.account?ef.account:""),2),ev=ep[0],eb=ep[1],e_=!eh||!ev||!D||!R||R*(et?ec:1)*(100/es)/D>1e4||R<.025||eW&&parseFloat(eW.balance)<R*(et?ec:1)*(100/es)/D;(0,k.useEffect)(function(){},[es]);var ej=(t=(0,n._)(function(){var e,t,a;return(0,c.Jh)(this,function(n){switch(n.label){case 0:return e={code:"nfthivecpu4u",index_position:"primary",json:"true",key_type:"i64",limit:1,lower_bound:"",upper_bound:"",reverse:"true",scope:"nfthivecpu4u",show_payer:"false",table:"honeyfactor",table_key:""},t=ex.api+"/v1/chain/get_table_rows",[4,(0,P.v_)(t,e)];case 1:return(a=n.sent())&&200===a.status&&a.data&&a.data.rows&&a.data.rows.length>0&&eo(parseFloat(a.data.rows[0].factor)),[2]}})}),function(){return t.apply(this,arguments)}),ey=(a=(0,n._)(function(){var e,t,a;return(0,c.Jh)(this,function(n){switch(n.label){case 0:return e={code:"nfthivecpu4u",index_position:"primary",json:"true",key_type:"i64",limit:1,lower_bound:"",upper_bound:"",reverse:"true",scope:"nfthivecpu4u",show_payer:"false",table:"fees",table_key:""},t=ex.api+"/v1/chain/get_table_rows",[4,(0,P.v_)(t,e)];case 1:return(a=n.sent())&&200===a.status&&a.data&&a.data.rows&&a.data.rows.length>0&&el(parseFloat(a.data.rows[0].fees)),[2]}})}),function(){return a.apply(this,arguments)}),eN=(0,r._)((0,k.useState)({cpu:{used:0,available:0,max:0},balance:0}),2),ek=eN[0],ew=eN[1],eg=(0,r._)((0,k.useState)({cpu:{used:0,available:0,max:0},balance:0}),2),eW=eg[0],eA=eg[1],eP=(0,r._)((0,k.useState)({cpu:{used:0,available:0,max:0},balance:0,refund:null}),2),eS=eP[0],eF=eP[1],eE=(0,r._)((0,k.useState)({cpu:{used:0,available:0,max:0},balance:0,refund:null}),2),eX=eE[0],eq=eE[1],eC=(0,r._)((0,k.useState)({cpu:{used:0,available:0,max:0},balance:0,refund:null}),2),eO=eC[0],eH=eC[1],eY=function(e,t){if(e&&200===e.status){var a=e.data,n=a.core_liquid_balance?a.core_liquid_balance.replace(" WAX",""):"0",s=a.cpu_limit,l=a.voter_info?a.voter_info.staked:0;t({cpu:s,balance:n,refund:a.refund_request?{refundDate:j().utc(a.refund_request.request_time).add(3,"days").local(),netAmount:a.refund_request.net_amount?parseFloat(a.refund_request.net_amount.replace(" WAX","")):0,cpuAmount:a.refund_request.cpu_amount?parseFloat(a.refund_request.cpu_amount.replace(" WAX","")):0}:null,staked:l})}},eZ=(v=(0,n._)(function(e,t){var a,n,s;return(0,c.Jh)(this,function(l){switch(l.label){case 0:Q(""),M(!0),(a=ev)||(a=eh),n=t*e/(100/es),l.label=1;case 1:return l.trys.push([1,3,4,5]),[4,em.session.transact({actions:[(0,F.vH)(em),{account:et?"nfthivehoney":"eosio.token",name:"transfer",authorization:[{actor:eh,permission:em.requestPermission?em.requestPermission:"active"}],data:{from:eh,to:O,quantity:et?"".concat(parseFloat(n).toFixed(4)," HONEY"):"".concat(parseFloat(n).toFixed(8)," WAX"),memo:"days:".concat(e,";receiver:").concat(a)}}]},{expireSeconds:300,blocksBehind:0})];
1case 2:return l.sent(),Q("♥ Thank you! Successfully rented ".concat((0,S.mW)(n*(et?ec:1)*(100/es)/e)," for ").concat(eh)),setTimeout(function(){eD(eh,ew),eD(O,eA)},1e3),[3,5];case 3:return console.error(s=l.sent()),V(s.message),[3,5];case 4:return M(!1),[7];case 5:return[2]}})}),function(e,t){return v.apply(this,arguments)}),eT=(_=(0,n._)(function(){var e;return(0,c.Jh)(this,function(t){switch(t.label){case 0:if(Q(""),M(!0),ev&&D&&R?"":"disabled")return[2];t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,em.session.transact({actions:[(0,F.vH)(em),{account:et?"nfthivehoney":"eosio.token",name:"transfer",authorization:[{actor:eh,permission:em.requestPermission?em.requestPermission:"active"}],data:{from:eh,to:O,quantity:et?"".concat(parseFloat(R).toFixed(4)," HONEY"):"".concat(parseFloat(R).toFixed(8)," WAX"),memo:"days:".concat(D,";receiver:").concat(ev)}}]},{expireSeconds:300,blocksBehind:0})];case 2:return t.sent(),Q("♥ Thank you! Successfully rented ".concat((0,S.mW)(R*(et?ec:1)*(100/es)/D)," for ").concat(ev)),setTimeout(function(){eD(eh,ew),eD(O,eA)},1e3),[3,5];case 3:return console.error(e=t.sent()),V(e.message),[3,5];case 4:return M(!1),[7];case 5:return[2]}})}),function(){return _.apply(this,arguments)}),eD=(y=(0,n._)(function(e,t){var a,n;return(0,c.Jh)(this,function(s){return a={account_name:e},n=ex.api+"/v1/chain/get_account",(0,P.v_)(n,a).then(function(e){return eY(e,t)}),[2]})}),function(e,t){return y.apply(this,arguments)}),eU=function(e){if(e&&200===e.status){var t=0,a=e.data;a&&Object.keys(a).includes("rows")&&a.rows.map(function(e){e.balance.includes(" HONEY")&&(t+=parseFloat(e.balance.replace(" HONEY","")))}),eu(t)}};(0,k.useEffect)(function(){eh&&(eD(eh,ew),ev||eb(eh)),eD(O,eA),eD(H,eF),eD(Y,eq),eD(Z,eH),ey(),ej(),(0,F.fg)(eh,ex).then(eU)},[eh]);var eJ=[{name:"Pool 1",pool:eS,contract:H},{name:"Pool 2",pool:eX,contract:Y},{name:"Pool 3",pool:eO,contract:Z}],eR=(0,r._)((0,q.Oc)(),3)[2].login;return(0,o.jsx)(X.Z,(0,l._)((0,s._)({id:"Cpu4uPage",title:"NFTHive.io WAX CPU Renting - 2 Million WAX available - 0.1% - 0.5% Fees",description:"Rent CPU from us! Power your WAX account to do unlimited transactions. Perfect for P2E, Bulk Selling NFTs and more. Most reliable renting Service on WAX!"},e),{children:(0,o.jsxs)("div",{className:"mx-3",children:[(0,o.jsx)("div",{className:"flex justify-center pt-10 pb-4 text-3xl font-bold text-black dark:text-white",children:C("cpu.rent_cpu_from_us")}),(0,o.jsx)("div",{className:"flex justify-center pb-10 font-bold text-black text-1xl dark:text-white",children:C("cpu.cheapest_cpu_renting")}),(0,o.jsxs)("div",{children:[eh?(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"flex justify-center pb-3",children:["Hey",(0,o.jsx)("b",{className:"ml-1 font-bold md:font-semibold",children:eh}),"!"]}),(0,o.jsx)("div",{className:"pb-3",children:(0,o.jsxs)("div",{className:" grid grid-cols-1 mx-auto",children:[(0,o.jsxs)("div",{className:"w-full flex justify-center",children:[C("cpu.your_balances_are"),":"]}),(0,o.jsx)("div",{className:"text-black dark:!text-neutral font-bold md:font-semibold flex justify-center",children:(0,S.mW)(ek.balance)}),ed?(0,o.jsx)("div",{className:"text-black dark:!text-neutral font-bold md:font-semibold flex justify-center",children:(0,S.V_)(ed)}):""]})}),(0,o.jsx)("div",{className:"flex justify-center ",children:(0,o.jsxs)("div",{className:"grid grid-cols-2",children:[(0,o.jsxs)("div",{className:"text-left px-5 pb-3",children:[C("cpu.your_cpu_usage"),":"]}),(0,o.jsx)("div",{className:"pb-3 ",children:(0,o.jsx)(function(e){var t=e.account,a=e.color,n=t.cpu.max>0?t.cpu.used/t.cpu.max:0;return(0,o.jsx)("div",{className:b()("px-5 h-full"),children:(0,o.jsx)("div",{className:b()("h-full w-32 bg-primaryt rounded overflow-hidden"),children:(0,o.jsx)("div",{style:{width:"".concat(100*n,"%")},className:b()("h-full dark:!text-white text-black font-bold",a),children:(0,o.jsx)("div",{className:b()("px-1 "),children:(0,S.rl)(n)})})})})},{account:ek,color:"bg-primary"})})]})})]}):(0,o.jsx)("div",{className:"flex",children:(0,o.jsx)("div",{onClick:function(){return eR()},className:b()("mx-auto text-primary text-2xl cursor-pointer underline hover:font-bold hover:underline pb-5"),children:C("cpu.please_log_in_to_continue")})}),(0,o.jsxs)("div",{className:"py-4",children:[(0,o.jsx)("div",{className:"flex justify-center",children:C("cpu.available_cpu_to_rent")}),(0,o.jsx)("div",{className:"flex justify-center dark:text-white text-black ml-2 font-bold text-2xl",children:(0,S.mW)(eW.balance)})]}),(0,o.jsx)("div",{className:"flex justify-center pb-3 mt-5",children:C("cpu.how_much_cpu_do_you_need")}),(0,o.jsx)("div",{className:b()("flex justify-center p-3"),children:(0,o.jsx)(i.Z,{control:(0,o.jsx)(d.Z,{checked:et,onChange:function(e){console.error(e),ea(e.target.checked)},disabled:!ed&&"disabled"}),label:C("cpu.pay_in_x",{x:"$HONEY"}),labelPlacement:"start"})}),(0,o.jsx)("div",{className:"flex justify-center pb-3 my-5",children:(0,o.jsxs)("div",{children:[(0,o.jsx)(u.Z,{title:C("cpu.earn_honey_by_trading_on_nfthive"),children:(0,o.jsx)("img",{className:"w-18 mx-auto pb-3",src:"/Logo_HONEY.png"})}),(0,o.jsx)(W.Z,{href:"https://swap.tacocrypto.io/swap?output=HONEY-nfthivehoney&input
1=WAX-eosio.token",external:!0,children:(0,o.jsxs)("div",{className:"w-full underline flex mb-2",children:[(0,o.jsx)("div",{className:"text-center",children:C("cpu.swap_honey_on_taco")}),(0,o.jsx)("div",{className:"ml-2 h-6 w-6",children:(0,o.jsx)("img",{src:"/tacoswap-logo-beta.svg"})})]})}),(0,o.jsx)(W.Z,{href:"https://wax.alcor.exchange/trade/honey-nfthivehoney_wax-eosio.token",external:!0,children:(0,o.jsxs)("div",{className:"w-full underline flex mb-2",children:[(0,o.jsx)("div",{className:"text-center",children:C("cpu.get_honey_on_alcor")}),(0,o.jsx)("div",{className:"ml-2 h-6 w-6",children:(0,o.jsx)("img",{src:"/alcor.svg"})})]})})]})}),(0,o.jsx)("div",{className:b()("flex justify-center p-3 font-bold"),children:C("cpu.honey_factor_get_x_times",{x:ec})}),(0,o.jsxs)("div",{className:"flex justify-center",children:[(0,o.jsx)("div",{className:"mx-1",children:(0,o.jsx)(p.Y,{variant:"faded",disabled:!eh,label:C("cpu.x_to_pay",et?{x:"HONEY"}:{x:"WAX"}),value:R,onChange:function(e){var t=e.target.value;/^\d*\.?\d*$/.test(t)&&$(t)},InputProps:{endAdornment:eh&&(0,o.jsx)(f.Z,{position:"end",children:et?"HONEY":"WAX"})},error:eh&&!A.wy.test(R)})}),(0,o.jsx)("div",{className:"mx-1",children:(0,o.jsx)(p.Y,{variant:"faded",disabled:!eh,label:C("cpu.days_to_rent"),type:"number",onWheel:function(e){return e.target.blur()},onChange:function(e){var t=e.target.value;/^\d*$/.test(t)&&U(t?Math.min(parseInt(t),10):t)},value:D,error:eh&&!D})}),(0,o.jsx)("div",{className:"mx-1",children:(0,o.jsx)(p.Y,{variant:"faded",disabled:!eh,label:C("cpu.receiver"),type:"text",onChange:function(e){eb(e.target.value)},value:ev,error:eh&&!ev})})]}),(0,o.jsx)("div",{className:"flex justify-center pb-3 mt-4 text-xl fond-semibold",children:(0,o.jsxs)("div",{children:["At"," ",(0,o.jsx)("b",{className:"font-bold md:font-semibold",children:(0,S.rl)(es/100)})," ","Fees, this will grant you:"]})}),(0,o.jsxs)("div",{className:"flex justify-center pb-3 text-black dark:text-white",children:[(0,o.jsx)("div",{className:"font-bold md:font-semibold dark:text-white text-black mx-1",children:(0,S.mW)(R&&D?R*(et?ec:1)*(100/es)/D:0)}),(0,o.jsx)("div",{children:"staked to CPU for"}),(0,o.jsx)("div",{className:"font-bold md:font-semibold dark:text-white text-black mx-1",children:D}),(0,o.jsx)("div",{children:"Days to"}),(0,o.jsx)("div",{className:"font-bold md:font-semibold dark:text-white text-black mx-1",children:ev})]}),(0,o.jsxs)("div",{className:"relative w-1/2 mx-auto",children:[(0,o.jsxs)("div",{className:"flex justify-center",children:[I?(0,o.jsx)(g.Z,{error:I,onClick:function(){V(null)}}):"",L?(0,o.jsx)(E.Z,{}):(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:"flex justify-center",children:(0,o.jsx)(x.Z,{variant:"outlined",onClick:eT,disabled:e_?"disabled":"",children:C("cpu.rent_now")})}),(0,o.jsx)(m.Z,{in:e_,children:(0,o.jsx)("div",{className:"my-5",children:(0,o.jsx)(h.Z,{severity:"error",children:eh?ev?D?R?R*(et?ec:1)*(100/es)/D>1e4?"You can only rent 10000 WAX or less":R<.025?"Need to rent for at least 0.025 WAX to avoid Spam":eW&&parseFloat(eW.balance)<R*(et?ec:1)*(100/es)/D?"Not enough CPU available to rent":"":"Please choose how much ".concat(et?"HONEY":"WAX"," you wish to pay"):"Please Enter Days to Rent":"Please Enter a Receiver":"Please Log in First"})})})]})]}),!L&&(0,o.jsx)("div",{className:"my-4 flex justify-center",children:C("cpu.or_quickly_buy_for_yourself")}),!L&&(0,o.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2",children:[{stake:100,days:1},{stake:100,days:3},{stake:100,days:6},{stake:200,days:1},{stake:200,days:3},{stake:200,days:6},{stake:500,days:1},{stake:500,days:3},{stake:500,days:6}].map(function(e){return(0,o.jsxs)(x.Z,{style:{textTransform:"none"},variant:"outlined",onClick:function(){return eZ(e.days,e.stake)},disabled:!eh,children:["Pay"," ",et?(0,S.V_)(e.stake*e.days/(100/es)):(0,S.mW)(e.stake*e.days/(100/es))," ","for ",(0,o.jsx)("br",{}),e.stake*(et?ec:1)," ","WAX - ",e.days," Day",e.days>1?"s":""]})})}),K&&(0,o.jsx)("div",{className:"my-2",children:(0,o.jsx)(h.Z,{severity:"success",children:K})})]}),(0,o.jsxs)("h1",{className:"text-base font-bold md:font-semibold mt-10 mb-5 flex justify-center",children:[C("cpu.current_pools"),":"]}),eJ.map(function(e){return(0,o.jsxs)("div",{className:"grid justify-center w-full grid-cols-3 pb-3 mx-auto md:w-1/2",children:[(0,o.jsx)("div",{className:"text-left",children:"Pool Name:"}),(0,o.jsxs)("div",{className:"dark:text-white text-black ml-2 font-bold md:font-semibold col-span-2 text-left",children:[e.name," / ",e.contract]}),(0,o.jsx)("div",{className:"text-left",children:"Staked:"}),(0,o.jsxs)("div",{className:"dark:text-white text-black ml-2 font-bold md:font-semibold col-span-2 text-left",children:[(0,S.uf)(e.pool.staked/1e8)," WAX"]}),e.pool.refund&&e.pool.refund.refundDate?(0,o.jsx)("div",{className:"text-left",children:"Refunding:"}):"",e.pool.refund&&e.pool.refund.refundDate?(0,o.jsxs)("div",{className:"dark:text-white text-black ml-2 font-bold md:font-semibold col-span-2 text-left",children:[(0,S.uf)(e.pool.refund.cpuAmount)," WAX ",e.pool.refund&&e.pool.refund.refundDate?" ~ ".concat(e.pool.refund.refundDate.toLocaleStr
1ing()):""]}):""]})}),(0,o.jsxs)("h1",{className:"text-base font-bold md:font-semibold mt-10 mb-5 flex justify-center",children:[C("cpu.total_pool_balance"),":"]}),(0,o.jsxs)("div",{className:"flex justify-center w-full pb-3 mx-auto md:w-1/2",children:[(0,S.mW)(eJ.map(function(e){return e.pool.staked/1e8+(e.pool.refund?e.pool.refund.cpuAmount:0)}).reduce(function(e,t){return e+t})+"")," / ",(0,S.mW)(eJ.map(function(e){return e.pool.staked/1e8+(e.pool.refund?e.pool.refund.cpuAmount:0)}).reduce(function(e,t){return e+t})+parseFloat(eW.balance)+"")]})]})]})}))}}},function(e){e.O(0,[5733,8802,7470,8426,9774,2888,179],function(){return e(e.s=5489)}),_N_E=e.O()}]);
2//# sourceMappingURL=cpu-574bc5af2d4084a1.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.