PageSourceSearch

https://gempad.app/_next/static/chunks/pages/admin/legendary-1d3f347ad5dee8a5.js

js gempad.app collected 2026-10-03 19:39:24 UTC 7,734 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5154],{19498:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/legendary",function(){return t(47238)}])},56121:function(e,n,t){"use strict";var r=t(60762);let i=(0,t(77527).ZP)(r.Z)(e=>{let{theme:n}=e;return{borderRadius:12,transition:"all .5s",padding:n.spacing(3),overflow:"visible",position:"relative"}});n.Z=i},47238:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return M}});var r=t(85893),i=t(67294),s=t(8506),a=t(21485),l=t(84166),o=t(88747),c=t(19929),d=t(75896),x=t(86977),u=t(29496),p=t(94888),m=t(62851),h=t(83327),F=t(92321),g=t(92526),j=t(89810),P=t(22882),b=t(39625),v=t(15229),f=t(49321),Z=t(33305),y=t(48120);function k(){let{chain:e,address:n}=(0,F.m)(),[t,k]=(0,i.useState)({fixedFees:[0,0],raiseTokenPercentFee:0,projectTokenPercentFee:0,penaltyFee:0}),[T,w]=(0,i.useState)(""),{writeContractAsync:S,isPending:C}=(0,g.S)(P.gb),{writeContractAsync:M,isPending:_}=(0,g.S)(P.gb),{data:I,refetch:L,isFetching:O,isFetched:N}=(0,j.u)({abi:h,address:m.wr[null==e?void 0:e.id],functionName:"getLegendarySaleConfigurations"}),W=(0,i.useMemo)(()=>N&&t.fixedFees[0]===(0,b.d)(I[0][0])&&t.fixedFees[1]===(0,b.d)(I[0][1])&&t.raiseTokenPercentFee===(0,v.b)(I[1],4)&&t.projectTokenPercentFee===(0,v.b)(I[2],4)&&t.penaltyFee===(0,v.b)(I[3],4),[N,t.fixedFees,t.raiseTokenPercentFee,t.projectTokenPercentFee,t.penaltyFee,I]),E=(0,i.useMemo)(()=>(0,f.U)(T),[T]);(0,i.useEffect)(()=>{I&&k({fixedFees:[(0,b.d)(I[0][0]),(0,b.d)(I[0][1])],raiseTokenPercentFee:(0,v.b)(I[1],4),projectTokenPercentFee:(0,v.b)(I[2],4),penaltyFee:(0,v.b)(I[3],4)})},[I]);let A=(0,i.useCallback)(async()=>{let n;try{await S({abi:h,address:m.wr[null==e?void 0:e.id],functionName:"updateLegendarySaleFee",args:[[(0,Z.f)(t.fixedFees[0]),(0,Z.f)(t.fixedFees[1])],(0,y.v)(t.raiseTokenPercentFee,4),(0,y.v)(t.projectTokenPercentFee,4),(0,y.v)(t.penaltyFee,4)]}),n||((0,u.yv)("Legendary sale fee changed",{variant:"success"}),await L())}catch(e){console.log(e),(0,u.yv)(e.shortMessage||e.message,{variant:"error"})}return()=>{n=!0}},[null==e?void 0:e.id,L,t.fixedFees,t.penaltyFee,t.projectTokenPercentFee,t.raiseTokenPercentFee,S]),R=(0,i.useCallback)(async()=>{let n;try{await M({abi:h,address:m.wr[null==e?void 0:e.id],functionName:"openLegendarySale",args:[T]}),n||(0,u.yv)("Legendary sale opened for this account",{variant:"success"})}catch(e){console.log(e),(0,u.yv)(e.shortMessage||e.message,{variant:"error"})}return()=>{n=!0}},[T,null==e?void 0:e.id,M]);return(0,r.jsxs)(s.ZP,{container:!0,columnSpacing:2,rowSpacing:.5,p:3,children:[(0,r.jsx)(s.ZP,{item:!0,xs:12,children:(0,r.jsx)(a.Z,{variant:"h5",color:"text.disabled",mb:1,children:"Legendary Sale Fee Setting"})}),N?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(s.ZP,{item:!0,xs:12,sm:6,children:[(0,r.jsx)(l.Z,{direction:"row",alignItems:"center",spacing:.5,sx:{mb:.5},children:(0,r.jsx)(a.Z,{variant:"subtitle2",color:"text.disabled",children:"Fixed Fee (Simple)"})}),(0,r.jsx)(o.Z,{fullWidth:!0,type:"number",inputProps:{inputMode:"numeric",pattern:"[0-9]*"},disabled:!(0,p.Z)(n,m.O0[null==e?void 0:e.id]),value:t.fixedFees[0],onChange:e=>{k(n=>({...n,fixedFees:[e.target.value,n.fixedFees[1]]}))},sx:{width:"100%"}})]}),(0,r.jsxs)(s.ZP,{item:!0,xs:12,sm:6,children:[(0,r.jsx)(l.Z,{direction:"row",alignItems:"center",spacing:.5,sx:{mb:.5},children:(0,r.jsx)(a.Z,{variant:"subtitle2",color:"text.disabled",children:"Fixed Fee (Standard)"})}),(0,r.jsx)(o.Z,{fullWidth:!0,type:"number",inputProps:{inputMode:"numeric",pattern:"[0-9]*"},value:t.fixedFees[1],disabled:!(0,p.Z)(n,m.O0[null==e?void 0:e.id]),onChange:e=>{k(n=>({...n,fixedFees:[n.fixedFees[0],e.target.value]}))},sx:{width:"100%"}})]}),(0,r.jsxs)(s.ZP,{item:!0,xs:12,sm:6,lg:4,children:[(0,r.jsx)(l.Z,{direction:"row",alignItems:"center",spacing:.5,sx:{mb:.5},children:(0,r.jsx)(a.Z,{variant:"subtitle2",color:"text.disabled",children:"Raise Token Percent Fee"})}),(0,r.jsx)(o.Z,{fullWidth:!0,type:"number",inputProps:{inputMode:"numeric",pattern:"[0-9]*",min:"0.0001",step:"0.0001",max:"100"},value:t.raiseTokenPercentFee,disabled:!(0,p.Z)(n,m.O0[null==e?void 0:e.id]),onChange:e=>{k(n=>({...n,raiseTokenPercentFee:e.target.value}))},error:t.raiseTokenPercentFee>100||1e4*t.raiseTokenPercentFee-Math.floor(1e4*t.raiseTokenPercentFee)>0,helperText:t.raiseTokenPercentFee>100?"Percent Fee < 100%":1e4*t.raiseTokenPercentFee-Math.floor(1e4*t.raiseTokenPercentFee)>0?"Fraction is 4":"",sx:{width:"100%"}})]}),(0,r.jsxs)(s.ZP,{item:!0,xs:12,sm:6,lg:4,children:[(0,r.jsx)(l.Z,{direction:"row",alignItems:"center",spacing:.5,sx:{mb:.5},children:(0,r.jsx)(a.Z,{variant:"subtitle2",color:"text.disabled",children:"Project Token Percent Fee"})}),(0,r.jsx)(o.Z,{fullWidth:!0,type:"number",inputProps:{inputMode:"numeric",pattern:"[0-9]*",min:"0.0001",step:"0.0001",max:"100"},value:t.projectTokenPercentFee,disabled:!(0,p.Z)(n,m.O0[null==e?void 0:e.id]),onChange:e=>{k(n=>({...n,projectTokenPercentFee:e.target.value}))},error:t.projectTokenPercentFee>100||1e4*t.projectTokenPercentFee-Math.floor(1e4*t.projectTokenPercentFee)>0,helperText:t.projectTokenPercentFee>100?"Percent Fee < 100%":1e4*t.projectTokenPercentFee-Math.floor(1e4*t.projectTokenPercentFee)>0?"Fraction is 4":"",sx:{width:"100%"}})]}),(0,r.jsxs)(s.ZP,{item:!0,xs:12,sm:6,lg:4,children:[(0,r.jsx)(l.Z,{direction:"row",alignItems:"center",spacing:.5,sx:{mb:.5},children:(0,r.jsx)(a.Z,{variant:"subtitle2",color:"text.disabled",children:"Penalty Percent Fee"})}),(0,r.jsx)(o.Z,{fullWidth:!0,type:"number",inputProps:{inputMode:"numeric",pattern:"[0-9]*",min:"0.0001",step:"0.0001",max:"100"},value:t.penaltyFee,onChange:e=>{k(n=>({...n,penaltyFee:e.target.value}))},disabled:!(0,p.Z)(n,m.O0[null==e?void 0:e.id]),error:t.penaltyFee>100||1e4*t.penaltyFee-Math.floor(1e4*t.penaltyFee)>0,helperText:t.penaltyFee>100?"Percent Fee < 100%":1e4*t.penaltyFee-Math.floor(1e4*t.penaltyFee)>0?"Fraction is 4":"",sx:{width:"100%"}})]}),(0,r.jsx)(s.ZP,{item:!0,xs:12,sm:6}),(0,p.Z)(n,m.O0[null==e?void 0:e.id])&&(0,r.jsx)(s.ZP,{item:!0,xs:12,sm:6,children:(0,r.jsx)(c.Z,{fullWidth:!0,variant:"contained",disabled:W||C,onClick:A,endIcon:C&&(0,r.jsx)(x.Z,{}),sx:{mt:2,color:"text.primary",bgcolor:"primary.main","&:hover":{bgcolor:"primary.main"}},children:"Save"})})]}):O?(0,r.jsx)(s.ZP,{item:!0,xs:12,component:l.Z,justifyContent:"center",py:1,children:(0,r.jsx)(x.Z,{})}):(0,r.jsx)(s.ZP,{item:!0,xs:12,children:(0,r.jsx)(d.Z,{variant:"outlined",severity:"warning",children:"Couldn't fetch data"})}),(0,r.jsx)(s.ZP,{item:!0,xs:12,children:(0,r.jsx)(a.Z,{variant:"h5",color:"text.disabled",mb:1,children:"Open Legend
1ary Sale"})}),(0,r.jsxs)(s.ZP,{item:!0,xs:12,sm:6,children:[(0,r.jsx)(l.Z,{direction:"row",alignItems:"center",spacing:.5,sx:{mb:.5},children:(0,r.jsx)(a.Z,{variant:"subtitle2",color:"text.disabled",children:"Address to open"})}),(0,r.jsx)(o.Z,{fullWidth:!0,value:T,onChange:e=>{w(e.target.value)},sx:{width:"100%"}})]}),(0,r.jsx)(s.ZP,{item:!0,xs:12,sm:6,component:l.Z,alignItems:"flex-end",children:(0,r.jsx)(c.Z,{fullWidth:!0,variant:"contained",disabled:!E||_,onClick:R,endIcon:_&&(0,r.jsx)(x.Z,{}),sx:{mb:1,color:"text.primary",bgcolor:"primary.main","&:hover":{bgcolor:"primary.main"}},children:"Save"})})]})}var T=t(9008),w=t.n(T),S=t(56121),C=t(4723);function M(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(w(),{children:(0,r.jsx)("title",{children:"Legendary Sale Settings"})}),(0,r.jsx)(S.Z,{sx:{p:4,mx:"auto"},children:(0,r.jsx)(k,{})})]})}M.getLayout=e=>(0,r.jsx)(C.Z,{children:e})}},function(e){e.O(0,[1343,5962,4166,4951,1664,8747,5675,5381,1502,6300,4250,3034,6293,4625,5659,3067,5813,1163,8506,2214,3035,4723,2888,9774,179],function(){return e(e.s=19498)}),_N_E=e.O()}]);

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.