PageSourceSearch

https://www.beradrome.com/_next/static/chunks/332.409e44277a11d9bb.js

js beradrome.com collected 2026-10-09 00:25:34 UTC 13,182 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[332],{362:function(e,a,t){t.d(a,{B:function(){return l}});var s=t(52676);t(75271);let l=e=>{let{error:a}=e;return""===a?null:(0,s.jsx)("p",{className:"rounded-lg border border-red-300 p-2 text-center text-sm font-semibold text-red-400",children:a})}},93524:function(e,a,t){t.r(a),t.d(a,{FarmCard:function(){return D},default:function(){return I}});var s=t(52676),l=t(362),n=t(62506),i=t(23506),r=t(69368),c=t(16984),o=t(75271),d=t(65899),u=t(29218),x=t.n(u),m=t(38302),f=t(56392),p=t(15493),h=t(88155),j=t(77838),b=t(2063),w=t(40784),v=t(92024),g=function(e){let{underlyingAddress:a,value:t,isAlive:l,plugin:n,action:d,symbol:u,protocol:x,cancelAction:f,isActionSelected:g,handleSelectAction:y,onTransaction:N,isInsuficient:S}=e,k=(0,m.f)(t),{chainId:A,address:C,isConnected:T}=(0,b.JE)(),[M,V]=(0,o.useState)(!1),{pendingToast:E,errorToast:D}=(0,h.Z)(),{updateTxStatus:I,updateHash:L}=(0,j.Z)(),P={pending:"".concat(d," ").concat(u," in progress"),success:"".concat(d," ").concat(u," success"),error:"Error on ".concat(d," ").concat(u," ")},W=async(e,a,t,s)=>{if(e){let a=(0,r.De)(e);E(e,a,t),L(e),I("txLoading");try{await a(),I("txSuccess")}catch(e){if(I("txError"),s)throw Error(t.error)}}if(a&&(D("error",t.error),I("txError"),s))throw Error(t.error)},O=async(e,a,t)=>{if(await (0,c.Ye)(e,C,a)<t){y(i.MX.APPROVE),N(!0),I("txPrepared");let{error:s,tx:l}=await (0,v._M)(e,a,t);await W(l,s,{pending:"Approving ".concat(u),success:"Approve ".concat(u," success"),error:"Error on Approve ".concat(u," failed")},!0)}},X=async()=>{try{await (0,c.Ye)(a,C,n)<k&&await O(a,n,k),y(i.MX.DEPOSIT),N(!0),I("txPrepared");let{tx:e,error:t}=await (0,v.r5)(n,k,C);await W(e,t,P);let s=await (0,v.SU)(C,A);(0,w.PV)(s),V(!1)}catch(e){V(!1)}},F=async()=>{try{y(i.MX.WITHDRAW),V(!0),N(!0),I("txPrepared");let{tx:e,error:a}=await (0,v.SQ)(n,k,C);await W(e,a,P);let t=await (0,v.SU)(C,A);(0,w.PV)(t),V(!1)}catch(e){V(!1)}};return(0,s.jsxs)("section",{className:"flex w-full items-end gap-2",children:[(0,s.jsx)(p.z,{notMinW:!0,isSecondary:!0,isFull:!0,onClick:()=>{g?f():(0,r.T8)({protocol:x,symbol:u})},children:g?"Cancel":"Get"}),(0,s.jsx)(p.z,{notMinW:!0,isLoading:M,onClick:()=>{g&&V(!0),g||y(i.MX.DEPOSIT);try{("Deposit"===d||"Approve"===d)&&X(),"Withdraw"===d&&F()}catch(e){return{error:e}}},isFull:!0,isDisabled:!T||S||!l&&"Withdraw"!==d,children:g&&"Claim"!=d?d.toLowerCase():"Deposit"})]})};let y=x()(()=>t.e(828).then(t.bind(t,73828)),{loadableGenerated:{webpack:()=>[73828]},ssr:!1}),N=x()(()=>t.e(414).then(t.bind(t,37414)),{loadableGenerated:{webpack:()=>[37414]},ssr:!1});var S=function(e){let{underlyingAddress:a,isAlive:t,plugin:l,action:n,symbol:i,protocol:r,balance:c,cancelAction:o,handleSelectAction:u,isActionSelected:x,handleInput:p,value:h,onTransaction:j}=e,b=c[n],w=!!b&&(b<(0,m.f)(h)||(0,m.f)(h)<=(0,m.f)("0")),v=b?(0,f.b)(b,18):"0";return(0,s.jsxs)("div",{className:"h-fit",children:[x&&"Claim"!=n&&(0,s.jsxs)("section",{children:[(0,s.jsxs)("p",{className:"text-gray-subtitle",children:[(0,s.jsxs)("span",{className:"capitalize",children:[n.toLowerCase()," "]}),"tokens"]}),(0,s.jsxs)("div",{className:"farm-card-items-custom flex flex-col",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(y,{value:h,isDisabled:!1,onInput:p}),(0,s.jsx)("div",{className:"flex items-center justify-end p-2",children:(0,s.jsxs)("div",{className:"flex items-center gap-1",children:["Balance: ",(0,s.jsx)(d.$,{amount:v,decimals:2,type:"number"})]})})]}),(0,s.jsx)(N,{handleInput:p,balance:b})]})]}),(0,s.jsx)(g,{isAlive:t,isInsuficient:w,underlyingAddress:a,symbol:i,protocol:r,onTransaction:j,plugin:l,value:h,cancelAction:o,action:n,handleSelectAction:u,isActionSelected:x})]})},k=t(94931),A=e=>{let{gaugeAddress:a,onTransaction:t,handleSelectAction:l,disableClaim:n}=e,{chainId:c,address:d,isConnected:u}=(0,b.JE)(),[x,m]=(0,o.useState)(!1),{pendingToast:f,errorToast:g}=(0,h.Z)(),{updateTxStatus:y,updateHash:N}=(0,j.Z)(),S={pending:"Claiming rewards",success:"Claim success",error:"Claim failed"},k=async()=>{l(i.MX.CLAIM),m(!0),t(!0),y("txPrepared");let{tx:e,error:s}=await (0,v.Bc)(a,d);if(e){let a=(0,r.De)(e);f(e,a,S),N(e),y("txLoading"),await a(),y("txSuccess")}s&&(g("error",S.error),y("txError"));let n=await (0,v.SU)(d,c);(0,w.PV)(n),m(!1)};return(0,s.jsx)(p.z,{notMinW:!0,isFull:!0,isLoading:x,isDisabled:!u||n,onClick:k,children:"Claim"})},C=t(89378),T=t(70750),M=function(e){let{actionLabel:a,handleSelectAction:t,dataLabel:l,staked:n,action:r,gaugeAddress:c,onTransaction:o,totalSupply:u,tvl:x,rewardTokens:m,rewardTokenDecimals:f,accountRewardsEarned:h}=e,{isConnected:j}=(0,b.JE)(),w=r===i.MX.CLAIM,v=!n||n<0,g=(0,C.d)(null!=n?n:0n),y=(void 0!==x&&"Staked tokens"===l&&0n!==u?+g/+(0,C.d)(u)*x:0).toString();return(0,s.jsx)("section",{className:"farm-card-items-custom",children:(0,s.jsxs)("div",{className:"flex w-full justify-between",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("div",{className:"flex items-center gap-1",children:(0,s.jsx)("p",{className:"text-gray-subtitle",children:l})}),"Earned"===l&&(0,s.jsx)(T.i,{rewardTokensAddresses:m,rewardTokenDecimals:f,accountRewardsEarned:h}),"Earned"!==l&&(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)(d.$,{weight:"bold",amount:g,decimals:3,type:"number"}),(0,s.jsx)(d.$,{weight:"bold",amount:y,decimals:2,type:"price"})]})]}),(0,s.jsxs)("div",{className:"flex w-1/3 items-center",children:[w&&(0,s.jsx)(A,{disableClaim:v,onTransaction:o,gaugeAddress:c,handleSelectAction:t}),!w&&(0,s.jsx)(p.z,{notMinW:!0,isDisabled:!j||v,onClick:()=>{t(r)},isFull:!0,children:a})]})]})})},V=t(88153),E=function(e){let{stakedTokens:a,tvl:t,votingWeight:l,aprs:n}=e,i=(0,f.b)(a,18),r=(0,f.b)(l,18);return(0,s.jsxs)("section",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"farm-card-items-custom w-full flex-col items-center gap-2",children:[(0,s.jsx)("p",{className:"text-gray-subtitle",children:"APR"}),null==n?void 0:n.map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(d.$,{amount:e.apr.toFixed(2),type:"percentage"})," ",e.symbol,"xKDK"===e.symbol&&(0,s.jsx)(V.o,{text:"Values xKDK at 1$ like Kodiak base farm"})]},e.symbol)),!n&&(0,s.jsx)("div",{className:"flex items-center gap-1",children:(0,s.jsx)(d.$,{amount:"0.00",type:"percentage"})})]}),(0,s.jsxs)("div",{className:"farm-card-items-custom flex-col gap-2",children:[(0,s.jsxs)("div",{className:"flex w-full justify-between rounded-md",children:[(0,s.jsx)("p",{className:"text-gray-subtitle",children:t?"T
1VL":"Staked tokens"}),(0,s.jsx)(d.$,{amount:t?t.toFixed(2):i,type:t?"price":"number"})]}),(0,s.jsxs)("div",{className:"flex w-full justify-between rounded-md",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)("p",{className:"text-gray-subtitle",children:"Voting weight"}),(0,s.jsx)(V.o,{text:"Global emission distribution."})]}),(0,s.jsx)(d.$,{amount:r,type:"percentage"})]})]})]})};let D=e=>{let{plugin:a,protocol:t,gauge:d,token:u,totalSupply:x,isAlive:m,name:f,rewardTokens:p,rewardTokenDecimals:h,aprs:j,tvl:b,votingWeight:w,accountTokenBalance:v,accountStakedBalance:g,accountRewardsEarned:y}=e,N=(0,o.useMemo)(()=>({Withdraw:g,Deposit:v,Approve:v}),[g,v]),[A,C]=(0,o.useState)("0"),[T,V]=(0,o.useState)(!1),[D,I]=(0,o.useState)({action:i.MX.NOACTION,isSelected:!1}),{action:L,isSelected:P}=D,[W,O]=(0,o.useState)(""),X=(0,o.useCallback)(e=>{e?I({action:e,isSelected:!0}):I(e=>({...e,isSelected:!1}))},[]),F=(0,o.useCallback)(()=>{C("0"),I({action:i.MX.NOACTION,isSelected:!1}),O("")},[]),$=(0,o.useCallback)(e=>{V(e)},[]),_=(0,o.useCallback)(e=>{let a=(0,r.so)(e,A);if(a!==A){let e="Withdraw"===L?N.Withdraw:N.Deposit;(0,c.Me)(a,e)?O(i.Sg.balance):O(""),C(a)}},[A,L,N]),Z=(0,o.useMemo)(()=>!P||P&&L===i.MX.CLAIM,[P,L]);return(0,s.jsxs)("section",{className:"farm-card-custom relative",children:[(0,s.jsx)("p",{className:"m-0 p-0 text-gray-subtitle",children:t}),T&&(0,s.jsx)(n.L,{handleSelectAction:X,action:L,rewards:y[0],value:A,actionSelectedFarms:L,onTransaction:$,is
1Farm:!0}),(0,s.jsx)(k.Z,{protocol:t,symbol:f}),(0,s.jsxs)("div",{className:"flex h-full flex-col justify-between gap-2",children:[(0,s.jsx)(E,{stakedTokens:x,votingWeight:w,aprs:j,tvl:b}),Z&&(0,s.jsxs)("div",{className:"flex h-full flex-col justify-between gap-2",children:[(0,s.jsx)(M,{onTransaction:$,action:i.MX.WITHDRAW,handleSelectAction:X,actionLabel:"Withdraw",dataLabel:"Staked tokens",staked:g,gaugeAddress:d,tvl:b,totalSupply:x}),(0,s.jsx)(M,{onTransaction:$,handleSelectAction:X,actionLabel:"Claim",dataLabel:"Earned",rewardTokens:p,rewardTokenDecimals:h,accountRewardsEarned:y,action:i.MX.CLAIM,gaugeAddress:d,staked:g})]}),(0,s.jsx)(l.B,{error:W}),(0,s.jsx)(S,{isAlive:m,accountStakedTokens:g,symbol:f,protocol:t,underlyingAddress:u,handleInput:_,value:A,plugin:a,action:L,balance:N,cancelAction:F,onTransaction:$,handleSelectAction:X,isActionSelected:P})]})]})};var I=D},62506:function(e,a,t){t.d(a,{L:function(){return m}});var s=t(52676),l=t(15493),n=t(77838),i=t(2063),r=t(23506),c=t(600);t(75271);var o=t(65899),d=t(61458),u=t(89378),x=e=>{let{isFarm:a,value:t,actionSelectedFarms:l,rewards:r}=e,{txError:c,txSuccess:x}=(0,n.Z)(),{actionSelected:m,tokens:f,swapQuote:p}=(0,i.IO)(),{getValue:h}=(0,d.Z)(),j=h("inputValue"),b=h("outputValue");return(0,s.jsx)("div",{className:"flex w-full flex-col gap-2 divide-y",children:(()=>{if(a&&t){if("Claim"===l&&r){let e=(0,u.d)(r);return(0,s.jsxs)("div",{className:"flex w-full justify-between",children:[!(x||c)&&(0,s.jsx)("p",{children:"".concat(l," amount:")}),!(x||c)&&(0,s.jsx)(o.$,{amount:e,type:"number",decimals:4})]})}return(0,s.jsxs)("div",{className:"flex w-full justify-between",children:[(0,s.jsx)("p",{children:"".concat(l," amount:")}),(0,s.jsx)(o.$,{amount:t,type:"number",decimals:4})]})}return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex w-full justify-between",children:[(0,s.jsx)("p",{children:"Token from:"}),(0,s.jsx)("p",{children:null==f?void 0:f.inputToken.symbol})]}),(0,s.jsxs)("div",{className:"flex w-full justify-between",children:[(0,s.jsx)("p",{children:"Token To:"}),(0,s.jsx)("p",{children:null==f?void 0:f.outputToken.symbol})]}),(0,s.jsxs)("div",{className:"flex w-full justify-between",children:[(0,s.jsx)("p",{children:"".concat(m," amount sent:")}),(0,s.jsx)(o.$,{amount:p?p.amountIn:j,type:"number",decimals:4})]}),(0,s.jsxs)("div",{className:"flex w-full justify-between",children:[(0,s.jsx)("p",{children:"".concat(m," amount expected to receive:")}),(0,s.jsx)(o.$,{amount:p?p.amountOut:b,type:"number",decimals:4})]})]})})()})};let m=e=>{let{action:a,handleSelectAction:t,value:o,isFarm:d,onTransaction:u,actionSelectedFarms:m,rewards:f}=e,{txError:p,txLoading:h,txPrepared:j,txSuccess:b,hash:w,resetTransaction:v}=(0,n.Z)(),{chainId:g}=i.JE.getState(),{actionSelected:y}=(0,i.IO)();return(0,s.jsx)("div",{className:"absolute right-0 top-0 p-10 ".concat(j?"opacity-1 z-10 h-full w-full bg-modal-neutral":"z-[-15] h-full w-full opacity-0"," rounded-lg transition-all duration-700"),children:(0,s.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center gap-3",children:[(0,s.jsx)("h3",{className:"text-lg font-bold",children:"".concat(d?m:y," Information")}),(0,s.jsx)(x,{rewards:f,actionSelectedFarms:m,isFarm:d,value:o}),p?(0,s.jsx)("div",{children:(0,s.jsx)("p",{className:"text-center",children:"Transaction failed. Please try Again"})}):b&&w?(0,s.jsx)("div",{children:(0,s.jsxs)("p",{className:"text-center",children:["Transaction completed. Check it on the"," ",(0,s.jsx)("span",{className:"font-semibold text-blue-400 hover:text-blue-200",children:(0,s.jsx)("a",{href:"".concat(c.wl[g],"/tx/").concat(w),target:"_blank",children:"explorer"})})]})}):h?(0,s.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-3",children:[(0,s.jsx)("div",{className:"loader border-gray-200 h-20 w-20 rounded-full border-4 border-t-4 ease-linear"}),(0,s.jsx)("p",{className:"text-center",children:"Transaction submitted, awaiting confirmation"})]}):j?(0,s.jsxs)("div",{className:"flex w-full flex-col items-center justify-center gap-3",children:[(0,s.jsx)("div",{className:"loader border-gray-200 h-20 w-20 rounded-full border-4 border-t-4 ease-linear"}),(0,s.jsx)("p",{children:"Transaction prepared. Please confirm in y
1our Wallet"})]}):void 0,(b||p)&&(0,s.jsx)(l.z,{onClick:()=>{v(),d&&u&&(t&&(a===r.MX.APPROVE?t(r.MX.DEPOSIT):a===r.MX.CLAIM&&t(r.MX.NOACTION)),u(!1))},children:"Close"})]})})}},61458:function(e,a,t){var s=t(2063);a.Z=()=>{let{craftValue:e,inputValue:a,outputValue:t,bribeValue:l,activeValue:n}=(0,s._D)(),i=e=>{s._D.setState({inputValue:e,craftValue:e,outputValue:e,activeValue:"inputValue"})},r=e=>{s._D.setState({bribeValue:e})};return{getValue:s=>"inputValue"===s?a:"craftValue"===s?e:"outputValue"===s?t:"bribeValue"===s?l:"",setValue:(e,a)=>{if("Swap"===e)throw Error("Never here, because we do ooga booga swaps");["Options","Earn","Lend","Wrap"].includes(e)&&i(a),"Bribe"===e&&r(a)},activeValue:n,resetInputs:()=>{s._D.setState({inputValue:"0",outputValue:"",activeValue:"inputValue",craftValue:""})}}}}}]);

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.