PageSourceSearch

https://agdex.io/_next/static/chunks/pages/onchain-position/positionFeeWidget-05a53537b716ab32.js

js agdex.io collected 2026-10-08 07:27:37 UTC 2,356 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5755],{3221:function(e,i,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/onchain-position/positionFeeWidget",function(){return n(5923)}])},5923:function(e,i,n){"use strict";n.r(i),n.d(i,{default:function(){return PositionFeeWidget}});var l=n(5893),t=n(7294),d=n(9522),o=n(377);function PositionFeeWidget(e){let{vault:i,symbol:n,position:s,priceDatas:a}=e,[c,r]=(0,t.useState)(0),[u,v]=(0,t.useState)(0),[f,x]=(0,t.useState)(0);(0,t.useEffect)(()=>{var e;let n=null===(e=a.find(e=>e.tokenName===(null==i?void 0:i.symbol)))||void 0===e?void 0:e.price;x(n)},[a]);let fetchReservingFee=async e=>{try{var l,t;let o=await (0,d.sK)(e,null==s?void 0:null===(l=s.decoded_key)||void 0===l?void 0:l.id,i,n,(null==s?void 0:s.side)===d.FB?d.dY:d.eV);if(o&&o.length>0){let e=null==o?void 0:null===(t=o[0])||void 0===t?void 0:t.value,n=(0,d.PC)(Number(e),18+i.decimal);r(n)}}catch(e){(0,o.yv)(String(e),{variant:"error"})}},fetchFundingFee=async e=>{try{var l,t,a,c;let o=await (0,d.yQ)(e,null==s?void 0:null===(l=s.decoded_key)||void 0===l?void 0:l.id,i,n,(null==s?void 0:s.side)===d.FB?d.dY:d.eV);if(o&&o.length>0){let e=null==o?void 0:null===(a=o[0])||void 0===a?void 0:null===(t=a.value)||void 0===t?void 0:t.value,i=null==o?void 0:null===(c=o[0])||void 0===c?void 0:c.isPositive,n=(0,d.PC)(Number(e),18);v(i?n:-n)}}catch(e){(0,o.yv)(String(e),{variant:"error"})}};return(0,t.useEffect)(()=>{if(s){var e,i;fetchFundingFee(null==s?void 0:null===(e=s.decoded_key)||void 0===e?void 0:e.owner),fetchReservingFee(null==s?void 0:null===(i=s.decoded_key)||void 0===i?void 0:i.owner)}},[s]),(0,l.jsxs)("div",{className:"flex flex-col items-start justify-center gap-1",children:[(0,l.jsxs)("div",{className:"flex flex-row gap-2",children:[(0,l.jsx)("span",{className:"text-gray-500",children:"Amt: "}),(0,l.jsx)("span",{children:"".concat(c.toFixed(3)," ").concat(null==i?void 0:i.symbol)}),(0,l.jsxs)("span",{className:"text-0xgreen",children:["$".concat((c*f).toFixed(3))," "]})]}),(0,l.jsxs)("div",{className:"flex flex-row gap-2",children:[(0,l.jsxs)("span",{className:"text-gray-500",children:["Funding Fee: "," "]}),(0,l.jsx)("span",{className:"".concat(u>0?"text-0xgreen":"text-0xred"),children:"$".concat(u.toFixed(6))})]})]})}}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=3221)}),_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.