forked from bombastictranz/bitcoincom-solidity-swap
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
[id]-b6b59dcca424f179.js.download
1 lines (1 loc) · 15 KB
/
[id]-b6b59dcca424f179.js.download
1
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[113],{1749:function(e,n,t){"use strict";var i=t(5987),r=t(7462),o=t(7294),a=(t(5697),t(6010)),l=t(1591),s=[0,1,2,3,4,5,6,7,8,9,10],c=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12];function d(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,t=parseFloat(e);return"".concat(t/n).concat(String(e).replace(String(t),"")||"px")}var u=o.forwardRef((function(e,n){var t=e.alignContent,l=void 0===t?"stretch":t,s=e.alignItems,c=void 0===s?"stretch":s,d=e.classes,u=e.className,v=e.component,m=void 0===v?"div":v,f=e.container,x=void 0!==f&&f,h=e.direction,y=void 0===h?"row":h,p=e.item,g=void 0!==p&&p,b=e.justify,j=void 0===b?"flex-start":b,k=e.lg,w=void 0!==k&&k,D=e.md,S=void 0!==D&&D,Z=e.sm,C=void 0!==Z&&Z,T=e.spacing,E=void 0===T?0:T,U=e.wrap,W=void 0===U?"wrap":U,A=e.xl,N=void 0!==A&&A,I=e.xs,_=void 0!==I&&I,H=e.zeroMinWidth,V=void 0!==H&&H,q=(0,i.Z)(e,["alignContent","alignItems","classes","className","component","container","direction","item","justify","lg","md","sm","spacing","wrap","xl","xs","zeroMinWidth"]),O=(0,a.Z)(d.root,u,x&&[d.container,0!==E&&d["spacing-xs-".concat(String(E))]],g&&d.item,V&&d.zeroMinWidth,"row"!==y&&d["direction-xs-".concat(String(y))],"wrap"!==W&&d["wrap-xs-".concat(String(W))],"stretch"!==c&&d["align-items-xs-".concat(String(c))],"stretch"!==l&&d["align-content-xs-".concat(String(l))],"flex-start"!==j&&d["justify-xs-".concat(String(j))],!1!==_&&d["grid-xs-".concat(String(_))],!1!==C&&d["grid-sm-".concat(String(C))],!1!==S&&d["grid-md-".concat(String(S))],!1!==w&&d["grid-lg-".concat(String(w))],!1!==N&&d["grid-xl-".concat(String(N))]);return o.createElement(m,(0,r.Z)({className:O,ref:n},q))})),v=(0,l.Z)((function(e){return(0,r.Z)({root:{},container:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",width:"100%"},item:{boxSizing:"border-box",margin:"0"},zeroMinWidth:{minWidth:0},"direction-xs-column":{flexDirection:"column"},"direction-xs-column-reverse":{flexDirection:"column-reverse"},"direction-xs-row-reverse":{flexDirection:"row-reverse"},"wrap-xs-nowrap":{flexWrap:"nowrap"},"wrap-xs-wrap-reverse":{flexWrap:"wrap-reverse"},"align-items-xs-center":{alignItems:"center"},"align-items-xs-flex-start":{alignItems:"flex-start"},"align-items-xs-flex-end":{alignItems:"flex-end"},"align-items-xs-baseline":{alignItems:"baseline"},"align-content-xs-center":{alignContent:"center"},"align-content-xs-flex-start":{alignContent:"flex-start"},"align-content-xs-flex-end":{alignContent:"flex-end"},"align-content-xs-space-between":{alignContent:"space-between"},"align-content-xs-space-around":{alignContent:"space-around"},"justify-xs-center":{justifyContent:"center"},"justify-xs-flex-end":{justifyContent:"flex-end"},"justify-xs-space-between":{justifyContent:"space-between"},"justify-xs-space-around":{justifyContent:"space-around"},"justify-xs-space-evenly":{justifyContent:"space-evenly"}},function(e,n){var t={};return s.forEach((function(i){var r=e.spacing(i);0!==r&&(t["spacing-".concat(n,"-").concat(i)]={margin:"-".concat(d(r,2)),width:"calc(100% + ".concat(d(r),")"),"& > $item":{padding:d(r,2)}})})),t}(e,"xs"),e.breakpoints.keys.reduce((function(n,t){return function(e,n,t){var i={};c.forEach((function(e){var n="grid-".concat(t,"-").concat(e);if(!0!==e)if("auto"!==e){var r="".concat(Math.round(e/12*1e8)/1e6,"%");i[n]={flexBasis:r,flexGrow:0,maxWidth:r}}else i[n]={flexBasis:"auto",flexGrow:0,maxWidth:"none"};else i[n]={flexBasis:0,flexGrow:1,maxWidth:"100%"}})),"xs"===t?(0,r.Z)(e,i):e[n.breakpoints.up(t)]=i}(n,e,t),n}),{}))}),{name:"MuiGrid"})(u);n.Z=v},5784:function(e,n,t){"use strict";t.d(n,{Z:function(){return d}});var i=t(5697),r=t.n(i),o=t(3279),a=t.n(o),l=t(7294),s=t(1033);function c(){return c=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},c.apply(this,arguments)}function d(e){var n=e.className,t=e.children,i=e.debounceTime,r=void 0===i?300:i,o=e.ignoreDimensions,d=void 0===o?[]:o,u=e.parentSizeStyles,v=void 0===u?{width:"100%",height:"100%"}:u,m=e.enableDebounceLeadingCall,f=void 0===m||m,x=function(e,n){if(null==e)return{};var t,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)t=o[i],n.indexOf(t)>=0||(r[t]=e[t]);return r}(e,["className","children","debounceTime","ignoreDimensions","parentSizeStyles","enableDebounceLeadingCall"]),h=(0,l.useRef)(null),y=(0,l.useRef)(0),p=(0,l.useState)({width:0,height:0,top:0,left:0}),g=p[0],b=p[1],j=(0,l.useMemo)((function(){var e=Array.isArray(d)?d:[d];return a()((function(n){b((function(t){return Object.keys(t).filter((function(e){return t[e]!==n[e]})).every((function(n){return e.includes(n)}))?t:n}))}),r,{leading:f})}),[r,f,d]);return(0,l.useEffect)((function(){var e=new s.Z((function(e){void 0===e&&(e=[]),e.forEach((function(e){var n=e.contentRect,t=n.left,i=n.top,r=n.width,o=n.height;y.current=window.requestAnimationFrame((function(){j({width:r,height:o,top:i,left:t})}))}))}));return h.current&&e.observe(h.current),function(){window.cancelAnimationFrame(y.current),e.disconnect(),j.cancel()}}),[j]),l.createElement("div",c({style:v,ref:h,className:n},x),t(c({},g,{ref:h.current,resize:j})))}d.propTypes={className:r().string,debounceTime:r().number,enableDebounceLeadingCall:r().bool,ignoreDimensions:r().oneOfType([r().any,r().arrayOf(r().any)]),children:r().func.isRequired}},8604:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pairs/[id]",function(){return t(1483)}])},1483:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSG:function(){return D}});var i=t(4051),r=t.n(i),o=t(5893),a=t(6980),l=t(4903),s=t(2318),c=t(1749),d=t(9895),u=t(5522),v=t(9008),m=t(5784),f=t(7294),x=t(1120),h=t(8269),y=t(6829),p=t(1163);function g(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=new Array(n);t<n;t++)i[t]=e[t];return i}function b(e,n,t,i,r,o,a){try{var l=e[o](a),s=l.value}catch(c){return void t(c)}l.done?n(s):Promise.resolve(s).then(i,r)}function j(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function k(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var i,r,o=[],a=!0,l=!1;try{for(t=t.call(e);!(a=(i=t.next()).done)&&(o.push(i.value),!n||o.length!==n);a=!0);}catch(s){l=!0,r=s}finally{try{a||null==t.return||t.return()}finally{if(l)throw r}}return o}}(e,n)||function(e,n){if(!e)return;if("string"===typeof e)return g(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return g(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var w=(0,x.Z)((function(e){return{root:{flex:1},avatar:{width:e.spacing(3),height:e.spacing(3),marginRight:e.spacing(1)},avatars:{marginRight:e.spacing(2)},paper:{padding:e.spacing(2)},reserve:{marginRight:e.spacing(1)},firstLink:{marginRight:e.spacing(2)},pageHeader:j({display:"block"},e.breakpoints.up("sm"),{display:"flex"}),links:j({margin:e.spacing(2,0)},e.breakpoints.up("sm"),{margin:0})}}));var D=!0;n.default=function(e){var n,t,i,x,g,j,D,S,Z,C,T,E,U,W,A=(0,p.useRouter)();if(A.isFallback)return(0,o.jsx)(a.Vw,{});var N,I=w(),_=A.query.id.toLowerCase(),H=(0,y.useQuery)(u.B8,{pollInterval:6e4}).data.bundles,V=(0,y.useQuery)(u.lA,{query:u.lA,variables:{id:_}}).data.pair;(0,u.Yz)((N=r().mark((function e(){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,u._z)(_);case 2:case"end":return e.stop()}}),e)})),function(){var e=this,n=arguments;return new Promise((function(t,i){var r=N.apply(e,n);function o(e){b(r,t,i,o,a,"next",e)}function a(e){b(r,t,i,o,a,"throw",e)}o(void 0)}))}),6e4);var q=(0,y.useQuery)(u.ky,{variables:{pairAddresses:[_]},pollInterval:6e4}).data,O=(0,y.useQuery)(u.A3,{variables:{pairs:[_]},pollInterval:6e4}).data.pairDayDatas,z=k("0"===(null===V||void 0===V?void 0:V.volumeUSD)?[null===V||void 0===V?void 0:V.untrackedVolumeUSD,null===V||void 0===V||null===(n=V.oneDay)||void 0===n?void 0:n.untrackedVolumeUSD,null===V||void 0===V||null===(t=V.sevenDay)||void 0===t?void 0:t.untrackedVolumeUSD]:[null===V||void 0===V?void 0:V.volumeUSD,null===V||void 0===V||null===(i=V.oneDay)||void 0===i?void 0:i.volumeUSD,null===V||void 0===V||null===(x=V.sevenDay)||void 0===x?void 0:x.volumeUSD],3),P=z[0],G=z[1],M=(z[2],P-G),R=G-("0"===(null===V||void 0===V||null===(g=V.twoDay)||void 0===g?void 0:g.volumeUSD)?null===V||void 0===V||null===(j=V.twoDay)||void 0===j?void 0:j.untrackedVolumeUSD:null===V||void 0===V||null===(D=V.twoDay)||void 0===D?void 0:D.volumeUSD),L=(M-R)/R*100,F=.003*M,B=.003*R,Q=M/((null===V||void 0===V?void 0:V.txCount)-(null===V||void 0===V||null===(S=V.oneDay)||void 0===S?void 0:S.txCount)),X=R/((null===V||void 0===V||null===(Z=V.oneDay)||void 0===Z?void 0:Z.txCount)-(null===V||void 0===V||null===(C=V.twoDay)||void 0===C?void 0:C.txCount)),$=(Q-X)/X*100,Y=M/V.reserveUSD*100,J=R/V.oneDay.reserveUSD*100,K=(Y-J)/J*100,ee=V.txCount-V.oneDay.txCount,ne=V.oneDay.txCount-V.twoDay.txCount,te=(ee-ne)/ne*100,ie=O.reduce((function(e,n){var t=(null===n||void 0===n?void 0:n.token0.derivedETH)*(null===n||void 0===n?void 0:n.volumeToken0)+(null===n||void 0===n?void 0:n.token1.derivedETH)*(null===n||void 0===n?void 0:n.volumeToken1)*H[0].ethPrice,i="0"===(null===n||void 0===n?void 0:n.volumeUSD)?t:null===n||void 0===n?void 0:n.volumeUSD;return e.liquidity.unshift({date:n.date,value:parseFloat(n.reserveUSD)}),e.volume.unshift({date:n.date,value:parseFloat(i)}),e}),{liquidity:[],volume:[]}),re=(0,f.useMemo)((function(){var e="WETH"===V.token0.symbol?"ETH":V.token0.symbol,n="WETH"===V.token1.symbol?"ETH":V.token1.symbol;return"https://verse.bitcoin.com/swap/?from=".concat(e,"&to=").concat(n,"&fromchain=ETH&tochain=ETH")}),[V]),oe=(0,f.useMemo)((function(){var e="WETH"===V.token0.symbol?"ETH":V.token0.symbol,n="WETH"===V.token1.symbol?"ETH":V.token1.symbol;return"https://verse.bitcoin.com/pools/eth/".concat(e,"-").concat(n,"/")}),[V]);return(0,o.jsxs)(a.Vw,{children:[(0,o.jsx)(v.default,{children:(0,o.jsxs)("title",{children:[V.token0.symbol,"-",V.token1.symbol," | Verse Analytics"]})}),(0,o.jsx)(a.mr,{children:(0,o.jsxs)(l.Z,{display:"flex",alignItems:"center",className:I.pageHeader,children:[(0,o.jsxs)(l.Z,{display:"flex",alignItems:"center",flex:1,flexWrap:"nowrap",children:[(0,o.jsx)(a.fU,{base:V.token0.id,quote:V.token1.id}),(0,o.jsxs)(s.Z,{variant:"h5",component:"h1",noWrap:!0,children:[V.token0.symbol,"-",V.token1.symbol]})]}),(0,o.jsxs)(l.Z,{display:"flex",alignItems:"center",className:I.links,children:[(0,o.jsx)(a.rU,{href:re,target:"_blank",variant:"body1",children:"Trade"}),(0,o.jsx)("span",{style:{margin:"0px 6px"},children:"|"}),(0,o.jsx)(a.rU,{href:oe,target:"_blank",variant:"body1",children:"Add Liquidity"})]})]})}),(0,o.jsxs)(c.Z,{container:!0,spacing:3,children:[(0,o.jsx)(c.Z,{item:!0,xs:12,sm:6,children:(0,o.jsxs)(d.Z,{variant:"outlined",className:I.paper,children:[(0,o.jsxs)(l.Z,{display:"flex",alignItems:"center",children:[(0,o.jsx)(a.T1,{className:I.avatar,id:V.token0.id}),(0,o.jsx)(s.Z,{variant:"h6",color:"textPrimary",noWrap:!0,className:I.reserve,children:(0,u.VG)(V.reserve0)}),(0,o.jsx)(s.Z,{variant:"subtitle2",color:"textSecondary",noWrap:!0,children:V.token0.symbol})]}),(0,o.jsx)(s.Z,{variant:"body2",children:"1 ".concat(V.token0.symbol," = ").concat((0,u.VG)(V.reserve1/V.reserve0)," ").concat(V.token1.symbol," (").concat((0,u.xG)((null===(T=V.token0)||void 0===T?void 0:T.derivedETH)*H[0].ethPrice),")")})]})}),(0,o.jsx)(c.Z,{item:!0,xs:12,sm:6,children:(0,o.jsxs)(d.Z,{variant:"outlined",className:I.paper,children:[(0,o.jsxs)(l.Z,{display:"flex",alignItems:"center",children:[(0,o.jsx)(a.T1,{className:I.avatar,id:V.token1.id}),(0,o.jsx)(s.Z,{variant:"h6",color:"textPrimary",noWrap:!0,className:I.reserve,children:(0,u.VG)(V.reserve1)}),(0,o.jsxs)(s.Z,{variant:"subtitle2",color:"textSecondary",noWrap:!0,children:[V.token1.symbol," "]})]}),(0,o.jsx)(s.Z,{variant:"body2",children:"1 ".concat(V.token1.symbol," = ").concat((0,u.VG)(V.reserve0/V.reserve1)," ").concat(V.token0.symbol," (").concat((0,u.xG)((null===(E=V.token1)||void 0===E?void 0:E.derivedETH)*H[0].ethPrice),")")})]})}),ie.liquidity.length>1?(0,o.jsx)(c.Z,{item:!0,xs:12,md:6,children:(0,o.jsx)(d.Z,{variant:"outlined",style:{height:300,position:"relative"},children:(0,o.jsx)(m.Z,{children:function(e){var n=e.width,t=e.height;return(0,o.jsx)(a.TH,{title:"Liquidity",data:ie.liquidity,margin:{top:125,right:0,bottom:0,left:0},width:n,height:t,tooltipDisabled:!0,overlayEnabled:!0})}})})}):null,ie.liquidity.length>1?(0,o.jsx)(c.Z,{item:!0,xs:12,md:6,children:(0,o.jsx)(d.Z,{variant:"outlined",style:{height:300,position:"relative"},children:(0,o.jsx)(m.Z,{children:function(e){var n=e.width,t=e.height;return(0,o.jsx)(a.vz,{title:"Volume",data:ie.volume,width:n,height:t,margin:{top:125,right:0,bottom:0,left:0},tooltipDisabled:!0,overlayEnabled:!0})}})})}):null,(0,o.jsx)(c.Z,{item:!0,xs:12,sm:6,md:4,children:(0,o.jsx)(a.D8,{title:"Liquidity (24h)",value:null===V||void 0===V?void 0:V.reserveUSD,difference:((null===V||void 0===V?void 0:V.reserveUSD)-(null===V||void 0===V||null===(U=V.oneDay)||void 0===U?void 0:U.reserveUSD))/(null===V||void 0===V||null===(W=V.oneDay)||void 0===W?void 0:W.reserveUSD)*100,format:"currency"})}),(0,o.jsx)(c.Z,{item:!0,xs:12,sm:6,md:4,children:(0,o.jsx)(a.D8,{title:"Volume (24h)",value:M,difference:L,format:"currency"})}),(0,o.jsx)(c.Z,{item:!0,xs:12,sm:6,md:4,children:(0,o.jsx)(a.D8,{title:"Fees (24h)",value:F,difference:(F-B)/B*100,format:"currency"})}),(0,o.jsx)(c.Z,{item:!0,xs:12,sm:6,md:4,children:(0,o.jsx)(a.D8,{title:"Tx (24h)",value:ee,difference:te,format:"integer"})}),(0,o.jsx)(c.Z,{item:!0,xs:12,sm:6,md:4,children:(0,o.jsx)(a.D8,{title:"Avg. Trade (24h)",value:Q,difference:$,format:"currency"})}),(0,o.jsx)(c.Z,{item:!0,xs:12,sm:6,md:4,children:(0,o.jsx)(a.D8,{title:"Utilisation (24h)",value:Y,difference:K,format:"percent"})})]}),(0,o.jsx)(l.Z,{my:4,children:(0,o.jsx)(a.Mb,{title:"Information",headCells:[{key:"id",label:"".concat(V.token0.symbol,"-").concat(V.token1.symbol," Address"),maxWidth:"250px"},{key:"token0",label:"".concat(V.token0.symbol," Address"),maxWidth:"250px"},{key:"token1",label:"".concat(V.token1.symbol," Address"),maxWidth:"250px"},{key:"etherscan",label:"Etherscan",align:"right"}],bodyCells:[(0,o.jsx)(s.Z,{variant:"body2",noWrap:!0,children:(0,h.toChecksumAddress)(V.id)}),(0,o.jsx)(s.Z,{variant:"body2",noWrap:!0,children:(0,o.jsx)(a.rU,{href:"/tokens/".concat(V.token0.id),children:(0,h.toChecksumAddress)(V.token0.id)})}),(0,o.jsx)(s.Z,{variant:"body2",noWrap:!0,children:(0,o.jsx)(a.rU,{href:"/tokens/".concat(V.token1.id),children:(0,h.toChecksumAddress)(V.token1.id)})}),(0,o.jsx)(a.rU,{href:"https://etherscan.io/address/".concat(V.id),children:"View"})]})}),(0,o.jsx)(l.Z,{my:4,children:(0,o.jsx)(a.PU,{transactions:q,txCount:V.txCount})})]})}}},function(e){e.O(0,[159,237,774,888,179],(function(){return n=8604,e(e.s=n);var n}));var n=e.O();_N_E=n}]);