PageSourceSearch

https://lxdao.io/_next/static/chunks/pages/governance/airdrop-21c5b5884fafa16a.js

js lxdao.io collected 2026-10-03 22:56:10 UTC 13,063 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3069],{16947:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/governance/airdrop",function(){return n(21077)}])},21077:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return T}});var r=n(52676),a=n(25802),i=n(82814),s=n(75271),o=n(57156),l=n(41879),d=n(4369),c=n(43461),u=n(22650),h=n(10390),p=n(28327),f=n(16220),x=n(10489),g=n(51806),m=n(53517),E=n(18977),w=n(16884),y=n(36993),C=n(98899),R=n(66525),v=n(73818),A=n(56317);function b(e){let[t,n]=(0,s.useState)(),[a,o]=(0,s.useState)([{name:"",address:""}]),[l,d]=(0,s.useState)([]),c=async e=>{try{var t;let n=await R.Z.get("/buidler/options"),r=(null===(t=n.data)||void 0===t?void 0:t.data)||[],a=[];r.forEach(t=>{let{name:n,address:r,badges:i}=t;(null==i?void 0:i[e])||!n||a.push({name:n,address:r})}),d(a)}catch(e){(0,x.Z)({type:"error",title:"Failed to fetch the member list! ",body:e.message})}},u=t=>{if(1===a.length)return;let n=a.filter((e,n)=>n!==t);o(n),e.onChange&&e.onChange(n)},p=(t,n)=>{let r=[...a];r[t].name=(null==n?void 0:n.name)||"",r[t].address=(null==n?void 0:n.address)||"",o(r),e.onChange&&e.onChange(r)};return(0,s.useEffect)(()=>{(async()=>{await c(e.badge)})()},[e.badge]),(0,r.jsxs)(i.Z,{sx:{width:"100%"},children:[a.map((e,o)=>(0,r.jsxs)(i.Z,{sx:{width:"100%",display:"flex"},marginBottom:"12px",children:[(0,r.jsx)(i.Z,{flex:1,children:(0,r.jsx)(A.Z,{open:o===t,onOpen:()=>{n(o)},onClose:()=>{n(null)},isOptionEqualToValue:(e,t)=>e.id===t.id,getOptionLabel:e=>e.name,onChange:(e,t)=>
1{p(o,t)},options:l,renderOption:(e,t)=>(0,s.createElement)("li",{...e,key:t.address,children:[t.name,"#",t.address.slice(-4)]}),renderInput:t=>{let n={...t.inputProps},i={...t};return(null==e?void 0:e.name)&&(n={...t.inputProps,value:null==e?void 0:e.name},i={...t,inputProps:n}),(0,r.jsx)(h.Z,{...i,value:null==a?void 0:a.name,placeholder:"Add a member to mint",InputProps:{...i.InputProps,endAdornment:(0,r.jsx)(r.Fragment,{children:i.InputProps.endAdornment})}})}})}),(0,r.jsx)(i.Z,{height:"56px",width:"56px",display:"flex",alignItems:"center",justifyContent:"center",sx:{cursor:"pointer"},onClick:()=>{u(o)},children:(0,r.jsx)(v.Z,{})})]},o)),(0,r.jsx)(f.Z,{onClick:()=>{let t=[...a];""!==t[a.length-1].name&&(t.push({name:"",address:""}),o(t),e.onChange&&e.onChange(t))},children:"Add a new member"})]})}function _(){let{chainId:e}=(0,m.m)(),[t,n]=(0,s.useState)([]),[a,v]=(0,s.useState)([]),[A,_]=(0,s.useState)(!1),{switchChainAsync:Z}=(0,E.o)(),{data:T,isError:j,error:I,writeContractAsync:S}=(0,w.S)(),{isSuccess:P}=(0,y.A)({hash:T}),[O,N]=(0,s.useState)(""),{handleSubmit:V,control:F}=(0,o.cI)({defaultValues:{members:[],address:[]}}),M=async(t,n,r)=>{try{e!=C.U3.chainId&&await Z({chainId:C.U3.chainId}),await S({...C.U3,args:[t,n,r],functionName:"mintAndAirdrop"})}catch(e){var a;(0,x.Z)({type:"error",title:"Failed to airdrop ".concat(O),body:null===(a=e.cause)||void 0===a?void 0:a.shortMessage})}},k=async e=>{let t=e.members.filter(e=>(0,g.U)(e.address)).map(e=>e.address);n(t);let r=Array((t=t.concat(e.address.filter(e=>(0,g.U)(e)))).length).fill(1);await M(O,t,r)},B=async()=>{let e=a.filter(e=>(0,g.U)(e.address)).map(e=>e.address);if(0===e.length){(0,x.Z)({type:"warning",title:"No members selected",body:"Please select members to refresh their badges"});return}_(!0);try{var t,n;let r=await R.Z.post("/buidler/updateAllBadges",{addresses:e});(null==r?void 0:null===(t=r.data)||void 0===t?void 0:t.status)==="SUCCESS"?(0,x.Z)({type:"success",title:"Badges refreshed successfully!"}):(0,x.Z)({type:"error",title:"Failed to refresh badges",body:null==r?void 0:null===(n=r.data)||void 0===n?void 0:n.message})}catch(e){(0,x.Z)({type:"error",title:"Failed to refresh badges",body:e.message})}finally{_(!1)}};return(0,s.useEffect)(()=>{(async()=>{if(P&&t.length>0){var e,n;let r=await R.Z.post("/buidler/updateAllBadges",{addresses:t});(null==r?void 0:null===(e=r.data)||void 0===e?void 0:e.status)==="SUCCESS"?(0,x.Z)({type:"success",title:"Success!"}):(0,x.Z)({type:"error",title:"Error",body:null==r?void 0:null===(n=r.data)||void 0===n?void 0:n.message})}j&&(0,x.Z)({type:"error",title:"Failed to airdrop membership badge",body:(null==I?void 0:I.message)||(null==I?void 0:I.toString())||"An error occurred"})})()},[P,t,j,I]),(0,r.jsxs)(l.Z,{spacing:3,children:[(0,r.jsxs)(i.Z,{position:"relative",sx:{width:500,border:"solid 1px",borderRadius:5,display:"flex",flexDirection:"column",padding:"24px",gap:"12px"},children:[(0,r.jsx)(d.Z,{sx:{fontSize:40},children:"Airdrop"}),(0,r.jsxs)(i.Z,{display:"flex",width:"100%",children:[(0,r.jsx)(i.Z,{marginRight:"10px",sx:{fontWeight:"bold",color:"#101828",lineHeight:"56px"},children:"*Badges: "}),(0,r.jsx)(c.Z,{width:"100%",value:O,onChange:e=>{N(e.target.value)},style:{width:"100%"},children:["MemberFirstBadge","ValuableGuestOffline","ValuableGuestOnline","REACTIVE_AUTO_BADGE","REACTIVE_BEST_VISION","REACTIVE_CROSS_CHAIN","REACTIVE_DEAD_MAN_SWITCH","REACTIVE_HONEST_BUILDER","REACTIVE_NO_WATCH_CHARTS","REACTIVE_LOVE_LEDGER","REACTIVE_TRUSTWORTHY_CASINO","REACTIVE_WALLET_GOALS","REACTIVE_NO_CODE_AUTO","REACTIVE_MISER_MONEY","REACTIVE_AI_NEVER_SLEEPS","REACTIVE_TREASURY_BREATHER","REACTIVE_WHALE_PAPARAZZI","REACTIVE_WHALE_WATCHING","REACTIVE_WORTH_WAIT","REACTIVE_ZERO_TOLERANCE","INTERN_WEB3_SUMMER_2026"].map((e,t)=>(0,r.jsx)(u.Z,{value:e,children:e},t))})]}),(0,r.jsxs)(i.Z,{display:"flex",width:"100%",children:[(0,r.jsx)(i.Z,{marginRight:"10px",textAlign:"left",sx:{fontWeight:"bold",color:"#101828",lineHeight:"56px"},children:"Members: "}),(0,r.jsx)(i.Z,{flex:1,children:(0,r.jsx)(o.Qr,{name:"members",control:F,rules:{required:!1},render:e=>
1{let{field:{onChange:t,value:n}}=e;return(0,r.jsx)(b,{value:n,badge:O,onChange:t})}})})]}),(0,r.jsxs)(i.Z,{display:"flex",marginBottom:"60px",width:"100%",children:[(0,r.jsx)(i.Z,{marginRight:"10px",textAlign:"left",sx:{fontWeight:"bold",color:"#101828",lineHeight:"56px"},children:"Address: "}),(0,r.jsx)(i.Z,{flex:1,children:(0,r.jsx)(o.Qr,{name:"address",control:F,rules:{required:!1},render:e=>{let{field:{onChange:t,value:n}}=e;return(0,r.jsxs)(l.Z,{gap:2,width:"full",children:[(0,r.jsx)(h.Z,{placeholder:"Press Enter to add address",onKeyDown:e=>{"Enter"===e.key&&(n.push(e.target.value),t(n),e.target.value="")}}),(0,r.jsx)(l.Z,{flexWrap:!0,gap:1,children:n.map((e,a)=>(0,r.jsx)(p.Z,{size:"small",label:e,variant:"outlined",sx:{borderRadius:"2px",fontSize:"14px",border:"none",color:"#36AFF9",background:"rgba(54, 175, 249, 0.1)"},onDelete:()=>{t(n.filter((e,t)=>t!==a))}},a))})]})}})})]}),(0,r.jsx)(i.Z,{display:"flex",alignItems:"center",justifyContent:"end",position:"absolute",bottom:"20px",right:"20px",children:(0,r.jsx)(f.Z,{onClick:V(k),variant:"gradient",size:"large",width:200,children:"Confirm"})})]}),(0,r.jsxs)(i.Z,{position:"relative",sx:{width:500,border:"solid 1px",borderRadius:5,display:"flex",flexDirection:"column",padding:"24px",gap:"12px"},children:[(0,r.jsx)(d.Z,{sx:{fontSize:40},children:"Refresh Badges"}),(0,r.jsxs)(i.Z,{display:"flex",marginBottom:"60px",width:"100%",children:[(0,r.jsx)(i.Z,{marginRight:"10px",textAlign:"left",sx:{fontWeight:"bold",color:"#101828",lineHeight:"56px"},children:"Members: "}),(0,r.jsx)(i.Z,{flex:1,children:(0,r.jsx)(b,{value:a,onChange:v})})]}),(0,r.jsx)(i.Z,{display:"flex",alignItems:"center",justifyContent:"end",position:"absolute",bottom:"20px",right:"20px",children:(0,r.jsx)(f.Z,{onClick:B,variant:"gradient",size:"large",width:200,disabled:A,children:A?"Refreshing...":"Refresh Badges"})})]})]})}function Z(){return(0,r.jsx)(i.Z,{sx:{width:"100%",borderRadius:1,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,r.jsx)(_,{})})}function T(){return(0,r.jsx)(a.Z,{children:(0,r.jsx)(Z,{})})}},36993:function(e,t,n){"use strict";n.d(t,{A:function(){return p}});var r=n(38144),a=n(52128),i=n(2924),s=n(56174),o=n(3904);async function l(e,t){let{chainId:n,timeout:l=0,...d}=t,c=e.getClient({chainId:n}),u=(0,o.s)(c,a.e,"waitForTransactionReceipt"),h=await u({...d,timeout:l});if("reverted"===h.status){let e=(0,o.s)(c,i.f,"getTransaction"),{from:t,...n}=await e({hash:h.transactionHash}),a=(0,o.s)(c,s.R,"call"),l=await a({...n,account:t,data:n.input,gasPrice:"eip1559"!==n.type?n.gasPrice:void 0,maxFeePerGas:"eip1559"===n.type?n.maxFeePerGas:void 0,maxPriorityFeePerGas:"eip1559"===n.type?n.maxPriorityFeePerGas:void 0});throw Error(l?.data?(0,r.rR)(`0x${l.data.substring(138)}`):"unknown reason")}return{...h,chainId:c.chain.id}}var d=n(77669),c=n(806),u=n(82537),h=n(19882);function p(e={}){let{hash:t,query:n={}}=e,r=(0,h.Z)(e),a=(0,u.x)({config:r}),i=function(e,t={}){return{async queryFn({queryKey:n}){let{hash:r,...a}=n[1];if(!r)throw Error("hash is required");return l(e,{...a,onReplaced:t.onReplaced,hash:r})},queryKey:function(e={}){let{onReplaced:t,...n}=e;return["waitForTransactionReceipt",(0,d.OP)(n)]}(t)}}(r,{...e,chainId:e.chainId??a}),s=!!(t&&(n.enabled??!0));return(0,c.aM)({...n,...i,enabled:s})}},16884:function(e,t,n){"use strict";n.d(t,{S:function(){return j}});var r=n(86655),a=n(33316),i=n(42841),s=n(97900),o=n(69984),l=n(58696),d=n(31670),c=n(63335),u=n(35375),h=n(74075),p=n(58044),f=n(55275),x=n(29106),g=n(71921),m=n(94446),E=n(99395),w=n(36890),y=n(55293),C=n(78342);let R=new m.k(128);async function v(e,t){let{account:n=e.account,chain:r=e.chain,accessList:s,authorizationList:o,blobs:m,data:v,gas:A,gasPrice:b,maxFeePerBlobGas:_,maxFeePerGas:Z,maxPriorityFeePerGas:T,nonce:j,type:I,value:S,...P}=t;if(void 0===n)throw new i.o({docsPath:"/docs/actions/wallet/sendTransaction"});let O=n?(0,a.T)(n):null;try{(0,E.F)(t);let n=await (async()=>t.to?t.to:null!==t.to&&o&&o.length>0?await (0,c.z)({authorization:o[0]}).catch(()=>{throw new d.G("`to` is required. Could not infer from `authorizationList`.")}):void 0)();if(O?.type==="json-rpc"||null===O){let t;null!==r&&(t=await (0,l.s)(e,w.L,"getChainId")({}),function({chain:e,currentChainId:t}){if(!e)throw new u.Bk;if(t!==e.id)throw new u.Yl({chain:e,currentChainId:t})}({currentChainId:t,chain:r}));let a=e.chain?.formatters?.transactionRequest?.format,i=(a||g.tG)({...(0,x.K)(P,{format:a}),accessList:s,account:O,authorizationList:o,blobs:m,chainId:t,data:v,gas:A,gasPrice:b,maxFeePerBlobGas:_,maxFeePerGas:Z,maxPriorityFeePerGas:T,nonce:j,to:n,type:I,value:S},"sendTransaction"),d=R.get(e.uid);try{return await e.request({method:d?"wallet_sendTransaction":"eth_sendTransaction",params:[i]},{retryCount:0})}catch(t){if(!1===d)throw t;if("InvalidInputRpcError"===t.name||"InvalidParamsRpcError"===t.name||"MethodNotFoundRpcError"===t.name||"MethodNotSupportedRpcError"===t.name)return await e.request({method:"wallet_sendTransaction",params:[i]},{retryCount:0}).then(t=>(R.set(e.uid,!0),t)).catch(n=>{if("MethodNotFoundRpcError"===n.name||"MethodNotSupportedRpcError"===n.name)throw R.set(e.uid,!1),t;throw n});throw t}}if(O?.type==="local"){let t=await (0,l.s)(e,y.ZE,"prepareTransactionRequest")({account:O,accessList:s,authorizationList:o,blobs:m,chain:r,data:v,gas:A,gasPrice:b,maxFeePerBlobGas:_,maxFeePerGas:Z,maxPriorityFeePerGas:T,nonce:j,nonceManager:O.nonceManager,parameters:[...y.QZ,"sidecars"],type:I,value:S,...P,to:n}),a=r?.serializers?.transaction,i=await O.signTransaction(t,{serializer:a});return await (0,l.s)(e,C.p,"sendRawTransaction")({serializedTransaction:i})}if(O?.type==="smart")throw new i.Y({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"});throw new i.Y({docsPath:"/docs/actions/wallet/sendTransaction",type:O?.type})}catch(e){if(e instanceof i.Y)throw e;throw function(e,{docsPath:t,...n}){let r=(()=>{let t=(0,f.k)(e,n);return t instanceof h.cj?e:t})();return new p.mk(r,{docsPath:t,...n})}(e,{...t,account:O,chain:t.chain||void 0})}}async function A(e,t){return A.internal(e,v,"sendTransaction",t)}!function(e){async function t(e,t,n,r){let{abi:d,account:c=e.account,address:u,args:h,dataSuffix:p,functionName:f,...x}=r;if(void 0===c)throw new i.o({docsPath:"/docs/contract/writeContract"});let g=c?(0,a.T)(c):null,m=(0,s.R)({abi:d,args:h,functionName:f});try{return await (0,l.s)(e,t,n)({data:`${m}${p?p.replace("0x",""):""}`,to:u,account:g,...x})}catch(e){throw(0,o.S)(e,{abi:d,address:u,args:h,docsPath:"/docs/contract/writeContract",functionName:f,sender:g?.address})}}e.internal=t}(A||(A={}));var b=n(3904),_=n(63380);async function Z(e,t){let n;let{account:r,chainId:a,connector:i,...s}=t;n="object"==typeof r&&r?.type==="local"?e.getClient({chainId:a}):await (0,_.e)(e,{account:r??void 0,assertChainId:!1,chainId:a,connector:i});let o=(0,b.s)(n,A,"writeContract");return await o({...s,...r?{account:r}:{},chain:a?{id:a}:null})}var T=n(19882);function j(e={}){var t;let{mutation:n}=e,a=(t=(0,T.Z)(e),{mutationFn:e=>Z(t,e),mutationKey:["writeContract"]}),{mutate:i,mutateAsync:s,...o}=(0,r.D)({...n,...a}
1);return{...o,writeContract:i,writeContractAsync:s}}}},function(e){e.O(0,[4518,9314,3358,390,8327,3584,1879,6317,5802,8899,2888,9774,179],function(){return e(e.s=16947)}),_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.