@dodoex/widgets 3.14.0 → 3.14.1-react.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -674
- package/README.md +70 -70
- package/dist/{34acf2e58b457195.svg → 28442382d977858a.svg} +9 -9
- package/dist/{219f8611c6c9e6e2.svg → 8de9a184d4ef0a11.svg} +6 -6
- package/dist/assets/bundle-BBymdwHN.css +65 -0
- package/dist/{44df077bd19df476.svg → b3f16b2626f03378.svg} +10 -10
- package/dist/{5c5d298f247819e1.svg → ed726d76d93d4899.svg} +10 -10
- package/dist/{helper-Be3CWTCE.js → helper-5M79rMcu.js} +1 -1
- package/dist/{helper-C8uhoyg4.cjs → helper-BjErvAPT.cjs} +1 -1
- package/dist/index-CfUamTLh.cjs +78 -0
- package/dist/index-CzGOlGFO.cjs +12 -0
- package/dist/index-DDvJb4bR.cjs +14 -0
- package/dist/index-DG3l6Gjm.js +14 -0
- package/dist/index-DXkJy6xu.js +78 -0
- package/dist/index-waICfk4T.js +12 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +162 -162
- package/dist/assets/bundle-DSSoJu9z.css +0 -297
- package/dist/index-BGCyS0SM.cjs +0 -40
- package/dist/index-Cuk9X7Dh.cjs +0 -12
- package/dist/index-DvUw-lQF.js +0 -78
- package/dist/index-FHV08HYK.js +0 -12
- package/dist/index-GeVhabPO.cjs +0 -78
- package/dist/index-asOS-7Ot.js +0 -40
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import e from"bignumber.js";import{merge as t,throttle as i,debounce as o}from"lodash";import{useEffect as r,useMemo as n,useRef as l,useState as a}from"react";import{BiChevronLeft as s,BiMinus as d,BiPlus as p,BiChevronRight as u}from"react-icons/bi";import m from"@emotion/styled";import{css as c}from"@emotion/react";import{Stage as g,Layer as h,Rect as b,Line as M,Text as f,Circle as v,Label as P,Tag as x}from"react-konva";import{c as y,e as L,a as z,b as w,d as k,f as B,u as C,l as S,g as X,h as q,i as A,j as T,k as N}from"./helper-5M79rMcu.js";import{f as W,a as F,b as j}from"./index-DG3l6Gjm.js";import{jsxs as Z,jsx as G}from"react/jsx-runtime";import{solveQuadraticFunctionForTarget as H,PMMModel as E}from"@dodoex/api";import"@lingui/core";import"@dodoex/components";import"@dodoex/dodo-contract-request";import"@babel/runtime/helpers/interopRequireDefault";import"@babel/runtime/helpers/defineProperty";import"@lingui/react";import"identicon.js";import"zustand";import"zustand/middleware";import"@web3-react/core";import"@web3-react/eip1193";import"@web3-react/walletconnect-v2";import"@web3-react/metamask";import"@web3-react/types";import"@tanstack/react-query";import"@ethersproject/bignumber";import"react-dom";import"react-window";import"dayjs";import"dayjs/plugin/utc";import"dayjs/plugin/duration";import"dayjs/plugin/localizedFormat";import"react-transition-group";import"react-is";import"@dodoex/contract-request";import"axios";import"recharts";import"react-dom/client";import"jsbi";import"tiny-invariant";import"@uniswap/sdk-core";import"@uniswap/v2-sdk";import"react-infinite-scroller";import"d3";import"rmc-date-picker";import"rmc-date-picker/assets/index.css";import"react-datetime/css/react-datetime.css";const J=m.input`
|
|
2
|
+
margin: 4px 10px 4px 6px;
|
|
3
|
+
border-radius: 10px;
|
|
4
|
+
border: 1px solid #373739;
|
|
5
|
+
padding: 4px 9px;
|
|
6
|
+
background-color: #1a1a1b;
|
|
7
|
+
color: #ffffff;
|
|
8
|
+
font-size: 14px;
|
|
9
|
+
font-weight: 400;
|
|
10
|
+
line-height: 20px;
|
|
11
|
+
outline: none;
|
|
12
|
+
width: 96px;
|
|
13
|
+
&:focus {
|
|
14
|
+
border-color: #fff;
|
|
15
|
+
|
|
16
|
+
${({error:e})=>e&&c`
|
|
17
|
+
border-color: red;
|
|
18
|
+
`}
|
|
19
|
+
}
|
|
20
|
+
`;const D="rgba(38, 39, 41, 0.3)";function Y({width:o,height:a,midPrice:s,pmmModel:d,params:p,baseTokenSymbol:u,quoteTokenSymbol:m,baseMinAndZoomMultiples:c,colorMap:A,setBaseMinAndZoomMultiples:T}){const N=t({grid:"#2A2A2D",midPriceLine:"#313335",leftBg:[0,D,1,"#31645d"],leftLine:"#55f6db",leftColor:"",rightBg:[0,D,1,"#67303d"],rightLine:"#ff4f73",rightColor:"",tooltipBg:"#121212",tooltipColor:void 0},A),F=o,j=a-18,H=F/7,{buyBaseVert:E,sellBaseVert:J}=z({midPrice:s,q:p.q,q0:p.q0,pmmModel:d}),Y=E.div(j),V=J.div(j),R=l(null),I=l(null),{current:$}=R,O=l(0),Q=l(),{horizontalGridLines:K,verticalGridLines:U}=function({chartHeight:e,chartWidth:t,horizontalLineCount:i,verticalLineCount:o}){return n(()=>{const r=[],n=e/(i+1),l=[],a=t/o;for(let e=0;e<i;e++){const i=n*(e+1);r.push([0,i,t,i])}for(let t=0;t<o;t++){const i=a*t+a/2;l.push([i,0,i,e])}return{horizontalGridLines:r,verticalGridLines:l}},[e,t,i,o])}({chartHeight:j,chartWidth:F,horizontalLineCount:9,verticalLineCount:7}),{horizontalLabelTickPoints:_,horizontalLabelTextPoints:ee}=function({chartHeight:e,chartWidth:t,xAxisPoints:i,oneXPx:o,baseMinAndZoomMultiples:r}){return n(()=>{const n=y(t,r.zoomMultiples),l=[],a=[];for(let t=0;t<i;t++){l.push([t*o+o/2,e,t*o+o/2,e+4]);const i=n.multipliedBy(t).multipliedBy(o).plus(n.multipliedBy(o/2)).toNumber(),s=r.baseMin.multipliedBy(10**i),d=t*o,p=e+2+4,u=W(s);a.push({x:d,y:p,text:u})}return{horizontalLabelTickPoints:l,horizontalLabelTextPoints:a}},[r.baseMin,r.zoomMultiples,e,t,o,i])}({chartHeight:j,chartWidth:F,xAxisPoints:7,oneXPx:H,baseMinAndZoomMultiples:c}),{quoteLinePoints:te,quoteLineAreaPoints:ie,quoteLineAreaLinearGradientEndPointY:oe,baseLinePoints:re,baseLineAreaPoints:ne,baseLineAreaLinearGradientEndPointY:le,midPriceLinePoints:ae}=function({chartHeight:t,chartWidth:i,midPrice:o,xPoints:r,pmmModel:l,baseMinAndZoomMultiples:a,buyYPortion:s,sellYPortion:d}){return n(()=>{const n=[],p=[],u=[],{baseMin:m,zoomMultiples:c}=a,g=y(i,c),h=2*c,b=new e(h).div(r);let M=new e(Math.log(o.div(m).toNumber())/Math.log(10));M=e.minimum(h,M),M=e.maximum(0,M);for(let i=new e(0);i.lte(M);){const e=m.multipliedBy(10**i.toNumber()),o=L({val:e,model:l});if(!o.vert.isNaN()){const e=i.div(g).toNumber(),r=t-o.vert.div(s).toNumber();n.push(e,r)}i=i.plus(b)}for(let e=M;e.lte(h);){const i=m.multipliedBy(10**e.toNumber()),o=L({val:i,model:l});if(!o.vert.isNaN()){const i=e.div(g).toNumber(),r=t-o.vert.div(d).toNumber();p.push(i,r)}e=e.plus(b)}const f=M.div(g).toNumber(),[,v]=n,P=l.k.eq(0);P&&n.push(f,v||t),n.push(f,t),u.push(f,t,f,0);const x=L({val:m.multipliedBy(10**h),model:l});let z=t;const w=new e(h).div(g).toNumber();return x.vert.isNaN()||(z=t-x.vert.div(d).toNumber()),P&&p.length>=2&&(p.unshift(f,z),p.unshift(f,t)),p.push(w,z),M.lte(0)&&p.unshift(0,t),{quoteLinePoints:n,quoteLineAreaPoints:[0,t,0,v,...n],quoteLineAreaLinearGradientEndPointY:v,baseLinePoints:p,baseLineAreaPoints:[...p,w,t],baseLineAreaLinearGradientEndPointY:z,midPriceLinePoints:u}},[a,i,r,o,l,t,s,d])}({chartHeight:j,chartWidth:F,midPrice:s,xPoints:50,pmmModel:d,baseMinAndZoomMultiples:c,buyYPortion:Y,sellYPortion:V}),se=e=>{var t;const i=e.target;if(i&&$){const e=null===(t=i.getStage())||void 0===t?void 0:t.getPointerPosition();if(e){const{x:t}=e;if(t>F)return void $.hide();C({x:t,tooltip:$,buyBaseVert:E,sellBaseVert:J,chartWidth:F,chartHeight:j,midPrice:s,pmmModel:d,baseTokenSymbol:u,quoteTokenSymbol:m,baseMinAndZoomMultiples:c,t:q,isHover:!0,color:N.tooltipColor,leftColor:N.leftLine,rightColor:N.rightLine})}}},de=n(()=>i(e=>{const{target:t}=e,i=t.getStage();if(i){i.container().style.cursor="grabbing";const e=null==i?void 0:i.getPointerPosition();if(e){const t=e.x-O.current;O.current=e.x,Q.current=e.x,T(e=>void 0===e.baseMin?e:{baseMin:w({dragDistance:t,prevBaseMin:e.baseMin,chartWidth:F,zoomMultiples:e.zoomMultiples}),zoomMultiples:e.zoomMultiples,targetMarginPriceX:0})}}},100),[F,T]),pe=n(()=>i(e=>{e.cancelBubble=!0,e.evt.preventDefault();const t=e.evt.deltaY<0;T(e=>{const i=k({zoomIn:t,prevZoomMultiples:e.zoomMultiples});return{baseMin:B({midPrice:s,zoomMultiples:i}),zoomMultiples:i,targetMarginPriceX:e.targetMarginPriceX}})},100),[s,T]);return r(()=>{c.targetMarginPriceX>0&&null!==$?C({x:c.targetMarginPriceX,tooltip:$,buyBaseVert:E,sellBaseVert:J,chartWidth:F,chartHeight:j,midPrice:s,pmmModel:d,baseTokenSymbol:u,quoteTokenSymbol:m,baseMinAndZoomMultiples:c,t:q,color:N.tooltipColor,leftColor:N.leftLine,rightColor:N.rightLine}):void 0!==Q.current&&null!==$&&C({x:Q.current,tooltip:$,buyBaseVert:E,sellBaseVert:J,chartWidth:F,chartHeight:j,midPrice:s,pmmModel:d,baseTokenSymbol:u,quoteTokenSymbol:m,baseMinAndZoomMultiples:c,t:q,isHover:!0,color:N.tooltipColor,leftColor:N.leftLine,rightColor:N.rightLine})},[c,u,E,j,F,N.leftLine,N.rightLine,N.tooltipColor,s,d,m,J,$]),Z(g,{ref:I,width:o,offsetY:-X,height:a+X,draggable:!0,dragBoundFunc:function(){return{x:this.absolutePosition().x,y:this.absolutePosition().y}},onMouseMove:se,onMouseOver:se,onMouseOut:()=>{$&&$.hide()},onDragStart:function(e){const{target:t}=e,i=t.getStage();if(i){const e=i.getPointerPosition();e&&(O.current=e.x)}},onDragMove:de,onDragEnd:e=>{const{target:t}=e,i=t.getStage();i&&(i.container().style.cursor="pointer")},onWheel:pe,children:[Z(h,{children:[G(b,{x:0,y:0,width:o,height:j,stroke:N.grid,strokeWidth:1}),K.map((e,t)=>G(M,{points:e,stroke:N.grid,strokeWidth:1,lineCap:"round",lineJoin:"round",listening:!1},t)),U.map((e,t)=>G(M,{points:e,stroke:N.grid,strokeWidth:1,lineCap:"round",lineJoin:"round",listening:!1},t)),_.map((e,t)=>G(M,{points:e,stroke:"#9d9d9d",strokeWidth:1,lineCap:"round",lineJoin:"round",listening:!1},t)),ee.map((e,t)=>G(f,{x:e.x,y:e.y,text:e.text,fontFamily:"Manrope",fontSize:12,fill:"#9d9d9d",width:H,padding:0,align:"center",verticalAlign:"bottom",listening:!1},t)),G(M,{points:ie,closed:!0,listening:!1,lineCap:"round",lineJoin:"round",fillLinearGradientStartPoint:{x:0,y:j},fillLinearGradientEndPoint:{x:0,y:oe},fillLinearGradientColorStops:N.leftBg}),G(M,{points:te,stroke:N.leftLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1}),G(M,{points:ne,closed:!0,listening:!1,lineCap:"round",lineJoin:"round",fillLinearGradientStartPoint:{x:F,y:j},fillLinearGradientEndPoint:{x:F,y:le},fillLinearGradientColorStops:N.rightBg}),G(M,{points:re,stroke:N.rightLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1}),G(M,{points:ae,stroke:N.midPriceLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1})]}),Z(h,{ref:R,visible:!1,listening:!1,children:[G(M,{points:[],stroke:"#ff4f73",strokeWidth:1,lineCap:"round",lineJoin:"round",dash:[4,6],id:"toolTipVertLine"}),G(M,{points:[],stroke:"ff4f73",strokeWidth:1,lineCap:"round",lineJoin:"round",dash:[4,6],id:"toolTipHoriLine"}),G(v,{x:0,y:0,radius:5,fill:"#FF5072",stroke:"rgba(255, 80, 114, 0.3)",strokeWidth:12,id:"joinCircle"}),Z(P,{x:0,y:0,id:"priceTextLabel",children:[G(x,{fill:N.tooltipBg,id:"priceTextLabel-tag"}),G(f,{text:"",fontSize:12,fontFamily:"Manrope",padding:4,fill:"#FF5072",id:"priceTextLabel-text"})]}),Z(P,{x:0,y:0,id:"slippageTextLabel",children:[G(x,{fill:N.tooltipBg,id:"slippageTextLabel-tag"}),G(f,{text:"",fontSize:12,fontFamily:"Manrope",padding:4,fill:"#FF5072",id:"slippageTextLabel-text"})]}),Z(P,{x:0,y:0,id:"toolTip",children:[G(x,{fill:N.tooltipBg,pointerDirection:"down",pointerWidth:15,pointerHeight:8,cornerRadius:8,lineJoin:"round",id:"toolTip-tag"}),G(f,{text:"-",fontSize:12,lineHeight:17/12,padding:S,fontFamily:"Manrope",fill:"#FFFFFF",id:"toolTip-text"})]})]})]})}const V=m.button`
|
|
21
|
+
margin: 0;
|
|
22
|
+
border: none;
|
|
23
|
+
padding: 0;
|
|
24
|
+
background: none;
|
|
25
|
+
|
|
26
|
+
&:focus {
|
|
27
|
+
outline: none;
|
|
28
|
+
}
|
|
29
|
+
&:active {
|
|
30
|
+
outline: none;
|
|
31
|
+
}
|
|
32
|
+
`,R=m.div`
|
|
33
|
+
height: 100%;
|
|
34
|
+
`,I=m.div`
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
`,$=m.div`
|
|
38
|
+
border: 1px solid ${({borderColor:e})=>e||"#2a2a2d"};
|
|
39
|
+
flex: 1 0 50%;
|
|
40
|
+
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
font-size: 12px;
|
|
45
|
+
font-weight: 400;
|
|
46
|
+
line-height: 17px;
|
|
47
|
+
color: #606066;
|
|
48
|
+
|
|
49
|
+
& + & {
|
|
50
|
+
border-left: none;
|
|
51
|
+
}
|
|
52
|
+
`,O=m.span`
|
|
53
|
+
color: #85858d;
|
|
54
|
+
`,Q=m.div`
|
|
55
|
+
margin-top: 20px;
|
|
56
|
+
display: flex;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
margin-bottom: 9px;
|
|
59
|
+
`,K=m(V)`
|
|
60
|
+
border-radius: 13px;
|
|
61
|
+
background-color: #373739;
|
|
62
|
+
width: 24px;
|
|
63
|
+
height: 24px;
|
|
64
|
+
font-size: 18px;
|
|
65
|
+
color: #85858d;
|
|
66
|
+
line-height: 0;
|
|
67
|
+
& + & {
|
|
68
|
+
margin-left: 10px;
|
|
69
|
+
}
|
|
70
|
+
&:first-child,
|
|
71
|
+
&:last-child {
|
|
72
|
+
font-size: 20px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&:hover {
|
|
76
|
+
color: #fff;
|
|
77
|
+
}
|
|
78
|
+
`;function U({params:t,target:i,isBuy:o=!0}){const r=new e(t.b),n=new e(t.q);let l=new e(t.b0);const a=new e(t.q0),s=new e(t.i),d=new e(t.k),{R:p}=t;1===p&&l.eq(r)&&(l=H(r,n.minus(a),new e(1).div(s),d));const u=o?r.plus(i):r.minus(i);if(u.lt(l)||r.eq(l)){let t=l.multipliedBy(l).div(u).div(u);return t=new e(1).minus(d).plus(d.multipliedBy(t)),s.multipliedBy(t)}const m=new E;m.RStatus=p,m.B=r,m.B0=l,m.Q=n,m.Q0=a,m.i=s,m.k=d,m.mtFeeRate=new e(0),m.lpFeeRate=new e(0);let c=new e(0);c=o?m.querySellBase(i):m.queryBuyBase(i);const g=o?n.minus(c):n.plus(c);let h=a.multipliedBy(a).div(g).div(g);return h=new e(1).minus(d).plus(d.multipliedBy(h)),s.div(h)}const _=({chartId:t,width:i=834,height:l=460,baseTokenSymbol:m,quoteTokenSymbol:c,pmmModel:g,pmmParams:h,midPrice:b=new e(0),colorMap:M,notShowAmountInput:f})=>{(({id:e})=>{r(()=>{function t(e){e.preventDefault()}let i=!1;try{const e={get passive(){return i=!0,!1}};window.addEventListener("test",()=>{},e),window.removeEventListener("test",()=>{})}catch(e){i=!1}const o=document.getElementById(e),r=!!i&&{passive:!1};return null==o||o.addEventListener("wheel",t,r),()=>{null==o||o.removeEventListener("wheel",t)}},[e])})({id:t});const[v,P]=a(""),[x,y]=a(""),[L,z]=a("-"),[C,S]=a("-"),[X,W]=a({baseMin:new e(0),zoomMultiples:A,targetMarginPriceX:0});r(()=>{void 0!==b&&W(e=>({baseMin:B({midPrice:b,zoomMultiples:e.zoomMultiples}),zoomMultiples:e.zoomMultiples,targetMarginPriceX:e.targetMarginPriceX}))},[b]);const H=n(()=>o(({type:t,amount:o})=>{""===o&&b&&(W({baseMin:B({midPrice:b,zoomMultiples:A}),zoomMultiples:A,targetMarginPriceX:0}),"buy"===t?z("-"):S("-"));const r=new e(o);if(!r.lte(0)&&!r.isNaN()&&(null==h?void 0:h.b)&&!r.gte(h.b)&&b)if("buy"===t){const e=U({params:h,target:r});W(o=>{const r=T({currentBaseMinAndZoomMultiples:o,targetPrice:e,midPrice:b,width:i});if(r.isSkip)return{baseMin:o.baseMin,zoomMultiples:o.zoomMultiples,targetMarginPriceX:r.targetX};if(r.targetX>0)return{baseMin:r.baseMin,zoomMultiples:r.zoomMultiples,targetMarginPriceX:r.targetX};const n=N({midPrice:b,width:i,type:t,targetPrice:e}),l=n.zoomMultiples.dp(6).toNumber();return{baseMin:B({midPrice:b,zoomMultiples:l}),zoomMultiples:l,targetMarginPriceX:n.targetX}}),z(`${F({input:e.minus(b).div(b)})}`)}else{const e=function({params:e,target:t}){return U({params:e,target:t,isBuy:!1})}({params:h,target:r});W(o=>{const r=T({currentBaseMinAndZoomMultiples:o,targetPrice:e,midPrice:b,width:i});if(r.isSkip)return{baseMin:o.baseMin,zoomMultiples:o.zoomMultiples,targetMarginPriceX:r.targetX};if(r.targetX>0)return{baseMin:r.baseMin,zoomMultiples:r.zoomMultiples,targetMarginPriceX:r.targetX};const n=N({midPrice:b,width:i,type:t,targetPrice:e}),l=n.zoomMultiples.dp(6).toNumber();return{baseMin:B({midPrice:b,zoomMultiples:l}),zoomMultiples:l,targetMarginPriceX:n.targetX}}),S(`+${F({input:e.minus(b).div(b)})}`)}},300),[h,b,i]);r(()=>{void 0!==v&&H({type:"buy",amount:v})},[H,v]),r(()=>{void 0!==x&&H({type:"sell",amount:x})},[H,x]);const E=e=>{let t=0;t=e?-.1*i:.1*i,W(e=>void 0===e.baseMin?e:{baseMin:w({dragDistance:t,prevBaseMin:e.baseMin,chartWidth:i,zoomMultiples:e.zoomMultiples}),zoomMultiples:e.zoomMultiples,targetMarginPriceX:e.targetMarginPriceX})},D=e=>{W(t=>{const i=k({zoomIn:null!=e&&e,prevZoomMultiples:t.zoomMultiples});return{baseMin:B({midPrice:b,zoomMultiples:i}),zoomMultiples:i,targetMarginPriceX:t.targetMarginPriceX}})},V=n(()=>{if(""===v)return!1;const t=new e(v);return!(!t.lte(0)&&!t.isNaN()&&(null==h?void 0:h.b)&&!t.gte(h.b))},[v,h]),_=n(()=>{if(""===x)return!1;const t=new e(x);return!(!t.lte(0)&&!t.isNaN()&&(null==h?void 0:h.b)&&!t.gte(h.b))},[x,h]);return Z(R,{id:t,children:[f?"":Z(I,{children:[Z($,{borderColor:M&&M.grid,children:[q("pool.chart.buy-amount",{symbol:m}),G(J,{value:v,error:V,onChange:e=>{const t=j(e.target.value,2);null!==t&&P(t)}}),G(O,{children:q("pool.chart.price-impact",{amount:L})})]}),Z($,{borderColor:M&&M.grid,children:[q("pool.chart.sell-amount",{symbol:m}),G(J,{value:x,error:_,onChange:e=>{const t=j(e.target.value,2);null!==t&&y(t)}}),G(O,{children:q("pool.chart.price-impact",{amount:C})})]})]}),void 0!==h&&void 0!==b&&void 0!==g&&void 0!==X.baseMin&&void 0!==b&&G(Y,{width:i,height:l,params:h,midPrice:b,pmmModel:g,baseTokenSymbol:m,quoteTokenSymbol:c,baseMinAndZoomMultiples:X,colorMap:M,setBaseMinAndZoomMultiples:W}),Z(Q,{className:"operate-btn-wrapper",children:[G(K,{onClick:()=>E(!0),children:G(s,{})}),G(K,{onClick:()=>D(!1),children:G(d,{})}),G(K,{onClick:()=>D(!0),children:G(p,{})}),G(K,{onClick:()=>E(!1),children:G(u,{})})]})]})};export{_ as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import t from"@emotion/styled";import{merge as e}from"lodash";import{useMemo as i,useRef as n}from"react";import{l as r,h as o,m as l}from"./helper-5M79rMcu.js";import{Line as a,Text as s,Stage as d,Layer as m,Rect as p,Circle as g,Label as u,Tag as c}from"react-konva";import{f as h}from"./index-DG3l6Gjm.js";import f from"bignumber.js";import{jsxs as x,Fragment as L,jsx as b}from"react/jsx-runtime";import{solveQuadraticFunctionForTarget as w,PMMState as A,PMMHelper as y}from"@dodoex/api";import"@lingui/core";import"@dodoex/components";import"@dodoex/dodo-contract-request";import"@babel/runtime/helpers/interopRequireDefault";import"@babel/runtime/helpers/defineProperty";import"@lingui/react";import"identicon.js";import"zustand";import"zustand/middleware";import"@web3-react/core";import"@web3-react/eip1193";import"@web3-react/walletconnect-v2";import"@web3-react/metamask";import"@web3-react/types";import"@tanstack/react-query";import"@ethersproject/bignumber";import"react-dom";import"react-window";import"dayjs";import"dayjs/plugin/utc";import"dayjs/plugin/duration";import"dayjs/plugin/localizedFormat";import"react-transition-group";import"react-is";import"@dodoex/contract-request";import"axios";import"recharts";import"react-dom/client";import"jsbi";import"tiny-invariant";import"@uniswap/sdk-core";import"@uniswap/v2-sdk";import"react-infinite-scroller";import"d3";import"rmc-date-picker";import"rmc-date-picker/assets/index.css";import"react-datetime/css/react-datetime.css";const P=t.div`
|
|
2
|
+
height: 100%;
|
|
3
|
+
position: relative;
|
|
4
|
+
`,N=t.div`
|
|
5
|
+
text-align: center;
|
|
6
|
+
margin-top: 17.1px;
|
|
7
|
+
margin-bottom: 88.41px;
|
|
8
|
+
color: #606066;
|
|
9
|
+
font-size: 12px;
|
|
10
|
+
line-height: 17px;
|
|
11
|
+
font-weight: 400;
|
|
12
|
+
`;function v({maxHeight:t,gridAreaHeight:e,value:i}){const n=new f(e).minus(36),r=n.div(t);return n.minus(i.multipliedBy(r)).plus(36).toNumber()}function H({targetPrice:t,areaPoints:e,isLeft:i}){for(let n=0;n<e.length;n++){const r=e[n],o=n<e.length-1?e[n+1]:null;if(!o)return{targetAreaStatPoint:r,targetAreaStatPoints:e};if(i){if(t.lte(r.middlePrice)&&t.gte(o.middlePrice))return{targetAreaStatPoint:r,targetAreaStatPoints:e.slice(0,n+1)}}else if(t.gte(r.middlePrice)&&t.lte(o.middlePrice))return{targetAreaStatPoint:r,targetAreaStatPoints:e.slice(0,n+1)}}return{targetAreaStatPoint:null,targetAreaStatPoints:[]}}function S({x:t,width:e,minXLN10:i,maxXLN10:n}){const r=new f(t).div(e).multipliedBy(n.minus(i)).plus(i);return new f(10**r.toNumber())}function k({width:t,targetLN10:e,minXLN10:i,maxXLN10:n}){return e.minus(i).div(n.minus(i)).multipliedBy(t).toNumber()}function X({target:t}){return new f(Math.log10(t.toNumber()))}const B="rgba(38, 39, 41, 0.3)";function C({width:t,height:P,params:N,baseTokenSymbol:C,quoteTokenSymbol:M,colorMap:W}){const{maxLeftHeight:F,maxRightHeight:T,leftStatAreaPoints:j,rightStatAreaPoints:q,minXLN10:J,maxXLN10:R}=function({params:t}){return i(()=>{const e=new f(t.b),i=new f(t.q);let n=new f(t.b0);const r=new f(t.q0),o=new f(t.i),l=new f(t.k),{R:a}=t;1===a&&n.eq(e)&&(n=w(e,i.minus(r),new f(1).div(o),l));const s=new A({i:o,K:l,B:e,Q:i,B0:n,Q0:r,R:a,mtFeeRate:new f(0),lpFeeRate:new f(0)}),d=new y,m=new f(s.B),p=[],g=[];let u=new f(0),c=new f(0);const h=d.GetMidPrice(s),x=i.gt(0)?e.div(i):new f(1);for(let t=0;t<=250;t++){let e=m.multipliedBy(t/100).multipliedBy(h.multipliedBy(x).multipliedBy(4));0===t&&(e=m.multipliedBy(1e-11));const i=null==d?void 0:d.QuerySellBase(e,s);if(!i.isNaN()&&i.gt(0)){const t=i.div(e);p.push({giveAmount:e,getAmount:i,price:t});continue}p.push({giveAmount:e,getAmount:new f(0),price:new f(0)})}for(let t=0;t<=250;t++){let e=m.multipliedBy(t/100).multipliedBy(h.multipliedBy(4));0===t&&(e=m.multipliedBy(1e-11));const i=null==d?void 0:d.QuerySellQuote(e,s);if(!i.isNaN()&&i.gt(0)){const t=e.dividedBy(i);g.push({giveAmount:e,getAmount:i,price:t});continue}g.push({giveAmount:e,getAmount:new f(0),price:new f(0)})}if(p.length<2&&g.length<2)return{leftStatAreaPoints:[],rightStatAreaPoints:[],maxLeftHeight:new f(10).multipliedBy(1.2),maxRightHeight:new f(10).multipliedBy(1.2),middlePriceLN10:new f(0),minXLN10:new f(-1),maxXLN10:new f(1)};const L=[];for(let t=1;t<p.length;t++){const e=p[t],{giveAmount:i,getAmount:n,price:r}=e,o=p[t-1];if(!r.isNaN()&&r.gt(0)&&o){const e=r.minus(o.price).abs(),l=i.minus(o.giveAmount).abs(),a=n.minus(o.getAmount).abs().multipliedBy(l);1===t&&L.push({area:n,price:r,middlePrice:r.plus(e.div(1.1)),rectangleHeight:a.plus(a.multipliedBy(.03))}),L.push({area:n,price:r,middlePrice:r.plus(e.div(2)),rectangleHeight:a}),u=f.max(a,u)}}const b=[];for(let t=1;t<g.length;t++){const e=g[t],{giveAmount:i,getAmount:n,price:r}=e,o=g[t-1],l=o.price,a=o.giveAmount,s=o.getAmount;if(!r.isNaN()&&r.gt(0)&&o){const e=r.minus(l).abs(),o=i.minus(a).abs(),d=n.minus(s).abs().multipliedBy(o);1===t&&b.push({area:n,price:r,middlePrice:r.minus(e.div(1.1)),rectangleHeight:d.plus(d.multipliedBy(.03))}),b.push({area:n,price:r,middlePrice:r.minus(e.div(2)),rectangleHeight:d}),c=f.max(d,c)}}const P=p.length>0?p[p.length-1]:g[0],N=g.length>0?g[0]:p[0],v=g.length>0?g[g.length-1]:p[0],H=P.price,S=v.price,k=N.price,X=new f(Math.log10(k.toNumber()));let B=H.gt(0)?new f(Math.log10(H.toNumber())):new f(-Math.log10(S.toNumber())),C=S.gt(0)?new f(Math.log10(S.toNumber())):new f(-Math.log10(H.toNumber()));const M=f.max(X.minus(B).abs(),C.minus(X).abs());return B=X.minus(M),C=X.plus(M),{leftStatAreaPoints:L,rightStatAreaPoints:b,maxLeftHeight:u.multipliedBy(1.2),maxRightHeight:c.multipliedBy(1.2),minXLN10:B,maxXLN10:C,middlePriceLN10:X}},[t])}({params:N}),O=P-30.13,z=n(null),D=e({grid:"#2A2A2D",midPriceLine:"#313335",leftBg:[0,B,1,"#31645d"],leftLine:"#55f6db",leftColor:"",rightBg:[0,B,1,"#67303d"],rightLine:"#ff4f73",rightColor:"",tooltipBg:"#121212",tooltipColor:void 0,textColor:"#606066"},W),G=e=>{var i;const{current:n}=z,r=e.target;if(r&&n){const e=null===(i=r.getStage())||void 0===i?void 0:i.getPointerPosition();if(e){const{x:i}=e,r=t/2;if(Math.abs(i-r)<=2)return;if(i<=2||t-i<=2)return;const a=S({x:i,width:t,minXLN10:J,maxXLN10:R});let s=null,d=[];const m=i<r;if(m){const t=H({areaPoints:j,targetPrice:a,isLeft:m});s=t.targetAreaStatPoint,d=t.targetAreaStatPoints}else{const t=H({areaPoints:q,targetPrice:a,isLeft:m});s=t.targetAreaStatPoint,d=t.targetAreaStatPoints}if(s){const e=X({target:s.middlePrice}),r=k({minXLN10:J,maxXLN10:R,width:t,targetLN10:e}),a=v({maxHeight:m?F:T,gridAreaHeight:O,value:s.rectangleHeight}),p=n.findOne("#tooltip"),g=n.findOne("#toolTipVertLine"),u=n.findOne("#joinCircle"),c=n.findOne("#tooltip-Text"),f=n.findOne("#tooltip-tag"),x=n.findOne("#priceTextLabel"),L=null==x?void 0:x.findOne("#priceTextLabel-text"),b=n.findOne("#area");null==p||p.position({x:r,y:a-5-6}),null==c||c.fill(D.tooltipColor||(m?"#00FAD9":"#FF5072")),null==c||c.text(m?o("pool.chart.liquidity-chart-buy",{amount:h(s.area),symbol:C,price:h(s.price)}):o("pool.chart.liquidity-chart-sell",{amount:h(s.area),symbol:M,price:h(s.price)})),p&&f&&(p.width()/2>i?(f.pointerDirection("left"),f.pointerHeight(15),f.pointerWidth(8),p.offsetX(-11),p.offsetY(-11)):p.width()/2+i>t?(f.pointerDirection("right"),f.pointerHeight(15),f.pointerWidth(8),p.offsetX(11),p.offsetY(-11)):(f.pointerDirection("down"),f.pointerHeight(8),f.pointerWidth(15),p.offsetX(0),p.offsetY(0))),null==g||g.points([r,O,r,a]),null==g||g.stroke(m?"#55f6db":"#ff4f73");let w=m?"rgb(86, 246, 218)":"#FF5072",A=m?"rgba(86, 246, 218, 0.3)":"rgba(255, 80, 114, 0.3)";D.leftLine&&D.rightLine&&(w=m?D.leftLine:D.rightLine,A=m?`rgba(${l(D.leftLine)}, 0.4)`:`rgba(${l(D.rightLine)}, 0.4)`),u&&(u.x(r),u.y(a),u.fill(w),u.stroke(A)),x&&(x.x(r),x.y(O+8.08+1),x.offsetX(x.width()/2),x.x()-x.width()/2<0?x.x(x.width()/2):x.x()+x.width()/2>t?x.x(t-x.width()/2):x.x(i)),L&&(L.fill(D.tooltipColor||(m?"#00FAD9":"#FF5072")),L.text(h(s.price)));const y=[];for(const e of d){const{middlePrice:i,rectangleHeight:n}=e,r=X({target:i}),o=k({minXLN10:J,maxXLN10:R,width:t,targetLN10:r}),l=v({maxHeight:m?F:T,gridAreaHeight:O,value:n});y.push(o,l+1)}const P=y.slice(),[N,H]=P;m?(P.push(r,a),P.push(r,O),P.push(N,O),P.push(N,H)):(P.unshift(N,O),P.unshift(r,O),P.unshift(r,a)),b&&(b.points(P),b.fill(m?D.leftLine||"#2c5b56":D.rightLine||"#7b3a48")),n.show()}}}},Q=function({gridAreaHeight:t,gridAreaWidth:e,horizontalLineCount:n,verticalLineCount:r,color:o="#2A2A2D"}){return i(()=>{const i=[],l=t/(n+1),s=[],d=e/(r+1);for(let t=0;t<n;t++){const n=l*(t+1);i.push([0,n,e,n])}for(let e=0;e<r;e++){const i=d*(e+1);s.push([i,0,i,t])}return x(L,{children:[i.map((t,e)=>b(a,{points:t,stroke:o,strokeWidth:1,lineCap:"round",lineJoin:"round",tension:1,listening:!1},e)),s.map((t,e)=>b(a,{points:t,stroke:o,strokeWidth:1,lineCap:"round",lineJoin:"round",tension:1,listening:!1},e))]})},[t,e,n,r,o])}({gridAreaHeight:O,gridAreaWidth:t,horizontalLineCount:9,verticalLineCount:7,color:D.grid}),E=function({minXLN10:t,maxXLN10:e,labelCount:n,gridAreaHeight:r,gridAreaWidth:o,color:l="#606066"}){return i(()=>{const i=o/(n+1),d=[],m=[];for(let l=0;l<n;l++){const n=i/2+i*l;d.push({x:n,y:r+10.08+1,text:h(S({x:i*(l+1),width:o,minXLN10:t,maxXLN10:e}))});const a=i*(l+1);m.push([a,r+1,a,r+4+1])}return x(L,{children:[d.map((t,e)=>b(s,{x:t.x,y:t.y,text:t.text,fontSize:14,fontFamily:"Manrope",fill:l,width:i,padding:0,align:"center",verticalAlign:"bottom",listening:!1},e)),m.map((t,e)=>b(a,{points:t,stroke:l,strokeWidth:1,lineCap:"butt",lineJoin:"miter",tension:1,listening:!1},e))]})},[t,e,r,o,n])}({gridAreaHeight:O,gridAreaWidth:t,labelCount:7,minXLN10:J,maxXLN10:R,color:D.textColor}),Y=function({gridAreaHeight:t,gridAreaWidth:e,color:n="#606066"}){return i(()=>{const i=e/2;return b(a,{points:[i,0,i,t-1],stroke:n,strokeWidth:1,lineCap:"round",lineJoin:"round",tension:1,listening:!1})},[t,e,n])}({gridAreaHeight:O,gridAreaWidth:t,color:D.midPriceLine}),{leftLine:V,rightLine:$}=function({leftStatAreaPoints:t,rightStatAreaPoints:e,minXLN10:n,maxXLN10:r,maxLeftHeight:o,maxRightHeight:l,gridAreaWidth:s,gridAreaHeight:d,colorMap:m}){return{leftLine:i(()=>{if(t.length<1)return b(L,{});const e=[];let i=d;for(const l of t){const{middlePrice:t,rectangleHeight:a}=l,m=X({target:t}),p=k({minXLN10:n,maxXLN10:r,width:s,targetLN10:m}),g=v({maxHeight:o,gridAreaHeight:d,value:a});e.push(p,g),g<i&&(i=g)}const l=e.slice(),[p,g]=l,u=l[l.length-1],c=l[l.length-2];return l.push(c,u),l.push(c,d),l.push(p,d),l.push(p,g),x(L,{children:[b(a,{points:l,closed:!0,listening:!1,lineCap:"round",lineJoin:"round",fillLinearGradientStartPoint:{x:0,y:d},fillLinearGradientEndPoint:{x:0,y:i},fillLinearGradientColorStops:m.leftBg}),b(a,{points:e,stroke:m.leftLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1})]})},[t,s,n,r,d,o]),rightLine:i(()=>{if(e.length<1)return b(L,{});const t=[];let i=d;for(const o of e){const{middlePrice:e,rectangleHeight:a}=o,m=X({target:e}),p=k({minXLN10:n,maxXLN10:r,width:s,targetLN10:m}),g=v({maxHeight:l,gridAreaHeight:d,value:a});t.push(p,g),g<i&&(i=g)}const o=t.slice(),[p]=o;return o.unshift(p,d),o.unshift(s,d),x(L,{children:[b(a,{points:o,closed:!0,listening:!1,lineCap:"round",lineJoin:"round",fillLinearGradientStartPoint:{x:0,y:d},fillLinearGradientEndPoint:{x:0,y:i},fillLinearGradientColorStops:m.rightBg}),b(a,{points:t,stroke:m.rightLine,strokeWidth:2,lineCap:"round",lineJoin:"round",listening:!1})]})},[e,s,n,r,d,l])}}({leftStatAreaPoints:j,rightStatAreaPoints:q,minXLN10:J,maxXLN10:R,maxLeftHeight:F,maxRightHeight:T,gridAreaWidth:t,gridAreaHeight:O,colorMap:D});return x(d,{width:t,height:P,onMouseMove:G,onMouseOver:G,onMouseEnter:G,onMouseOut:()=>{const{current:t}=z;t&&t.hide()},children:[x(m,{children:[b(p,{x:0,y:0,width:t,height:O,stroke:D.grid,strokeWidth:1}),Q,E,V,$,Y]}),x(m,{ref:z,visible:!1,children:[b(a,{points:[],closed:!0,listening:!1,lineCap:"round",lineJoin:"round",id:"area"}),b(a,{points:[],strokeWidth:1,stroke:"#ff4f73",lineJoin:"round",lineCap:"round",dash:[4,6],id:"toolTipVertLine"}),b(g,{x:0,y:0,radius:5,fill:"#FF5072",stroke:"rgba(255, 80, 114, 0.3)",strokeWidth:12,id:"joinCircle"}),x(u,{listening:!1,x:0,y:0,id:"priceTextLabel",children:[b(c,{fill:D.tooltipBg,id:"priceTextLabel-tag"}),b(s,{text:"-",fontSize:14,fontFamily:"Manrope",padding:2,fill:"#FF5072",id:"priceTextLabel-text"})]}),x(u,{listening:!1,id:"tooltip",children:[b(c,{fill:D.tooltipBg,pointerDirection:"down",pointerWidth:15,pointerHeight:8,cornerRadius:8,lineJoin:"round",id:"tooltip-tag"}),b(s,{text:"",fontFamily:"Manrope",fontSize:12,lineHeight:17/12,padding:r,fill:"#FF5072",id:"tooltip-Text"})]})]})]})}const M=({width:t=834,height:e=462,baseTokenSymbol:i,quoteTokenSymbol:n,pmmModel:r,pmmParams:l,midPrice:a,notShowTipText:s,colorMap:d})=>x(P,{children:[void 0!==l&&void 0!==a&&void 0!==r&&void 0!==a&&b(C,{width:t,height:e,params:l,midPrice:a,pmmModel:r,baseTokenSymbol:i,quoteTokenSymbol:n,colorMap:d}),s?"":x(N,{children:["* ",o("pool.chart.liquidity-chart-tip",{baseTokenSymbol:i})]})]});export{M as default};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./index-
|
|
1
|
+
"use strict";var e=require("./index-DDvJb4bR.cjs");require("react-dom/client"),require("react/jsx-runtime"),require("bignumber.js"),require("lodash"),require("@dodoex/components"),require("@dodoex/api"),require("@dodoex/dodo-contract-request"),require("react"),require("@babel/runtime/helpers/interopRequireDefault"),require("@babel/runtime/helpers/defineProperty"),require("@lingui/core"),require("@lingui/react"),require("identicon.js"),require("zustand"),require("zustand/middleware"),require("@web3-react/core"),require("@web3-react/eip1193"),require("@web3-react/walletconnect-v2"),require("@web3-react/metamask"),require("@web3-react/types"),require("@tanstack/react-query"),require("@ethersproject/bignumber"),require("react-dom"),require("react-window"),require("dayjs"),require("dayjs/plugin/utc"),require("dayjs/plugin/duration"),require("dayjs/plugin/localizedFormat"),require("react-transition-group"),require("react-is"),require("@dodoex/contract-request"),require("axios"),require("recharts"),require("jsbi"),require("tiny-invariant"),require("@uniswap/sdk-core"),require("@uniswap/v2-sdk"),require("react-infinite-scroller"),require("d3"),require("rmc-date-picker"),require("rmc-date-picker/assets/index.css"),require("react-datetime/css/react-datetime.css"),exports.AMMV2Create=e.AMMV2Create,exports.AMMV3PositionManage=e.AMMV3PositionManage,exports.AMMV3PositionsView=e.AMMV3PositionsView,exports.AddLiquidityV3=e.AddLiquidityV3,exports.EmptyList=e.EmptyList,exports.FailedList=e.FailedList,exports.InitSwapWidget=e.InitSwapWidget,exports.Message=e.Message,Object.defineProperty(exports,"MetadataFlag",{enumerable:!0,get:function(){return e.MetadataFlag}}),exports.MiningCreate=e.MiningCreate,exports.MiningDetail=e.MiningDetail,exports.MiningList=e.MiningList,Object.defineProperty(exports,"PageType",{enumerable:!0,get:function(){return e.PageType}}),exports.Pool=e.Pool,exports.PoolCreate=e.PoolCreate,exports.PoolDetail=e.PoolDetail,exports.PoolList=e.PoolList,exports.PoolModify=e.PoolModify,exports.PoolOperate=e.PoolOperate,exports.PoolOperateDialog=e.PoolOperateDialog,exports.PoolWidget=e.PoolWidget,exports.Swap=e.Swap,exports.SwapOrderHistory=e.SwapOrderHistory,exports.SwapWidget=e.SwapWidget,exports.TokenCard=e.TokenCard,exports.TokenLogo=e.TokenLogo,exports.TokenPairStatusButton=e.TokenPairStatusButton,exports.TokenStatusButton=e.TokenStatusButton,exports.UnstyleWidget=e.UnstyleWidget,exports.WIDGET_CLASS_NAME=e.WIDGET_CLASS_NAME,exports.WIDGET_MODULE_CLASS_NAME=e.WIDGET_MODULE_CLASS_NAME,exports.Widget=e.Widget,exports.chainListMap=e.chainListMap,exports.formatPercentageNumber=e.formatPercentageNumber,exports.formatReadableNumber=e.formatReadableNumber,exports.formatShortNumber=e.formatShortNumber,exports.formatTokenAmountNumber=e.formatTokenAmountNumber,exports.getEtherscanPage=e.getEtherscanPage,exports.rpcServerMap=e.rpcServerMap,exports.scanUrlDomainMap=e.scanUrlDomainMap,exports.useMessageState=e.useMessageState,exports.usePoolBalanceInfo=e.usePoolBalanceInfo,exports.useRouterStore=e.useRouterStore,exports.useTokenStatus=e.useTokenStatus,exports.useTradeSwapOrderList=e.useTradeSwapOrderList;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as AMMV2Create,
|
|
1
|
+
export{A as AMMV2Create,D as AMMV3PositionManage,C as AMMV3PositionsView,B as AddLiquidityV3,K as EmptyList,J as FailedList,I as InitSwapWidget,g as Message,M as MetadataFlag,z as MiningCreate,y as MiningDetail,x as MiningList,c as PageType,m as Pool,o as PoolCreate,q as PoolDetail,n as PoolList,p as PoolModify,v as PoolOperate,t as PoolOperateDialog,P as PoolWidget,j as Swap,k as SwapOrderHistory,S as SwapWidget,G as TokenCard,H as TokenLogo,F as TokenPairStatusButton,T as TokenStatusButton,U as UnstyleWidget,W as WIDGET_CLASS_NAME,h as WIDGET_MODULE_CLASS_NAME,e as Widget,d as chainListMap,a as formatPercentageNumber,N as formatReadableNumber,f as formatShortNumber,O as formatTokenAmountNumber,L as getEtherscanPage,r as rpcServerMap,s as scanUrlDomainMap,i as useMessageState,w as usePoolBalanceInfo,u as useRouterStore,E as useTokenStatus,l as useTradeSwapOrderList}from"./index-DG3l6Gjm.js";import"react-dom/client";import"react/jsx-runtime";import"bignumber.js";import"lodash";import"@dodoex/components";import"@dodoex/api";import"@dodoex/dodo-contract-request";import"react";import"@babel/runtime/helpers/interopRequireDefault";import"@babel/runtime/helpers/defineProperty";import"@lingui/core";import"@lingui/react";import"identicon.js";import"zustand";import"zustand/middleware";import"@web3-react/core";import"@web3-react/eip1193";import"@web3-react/walletconnect-v2";import"@web3-react/metamask";import"@web3-react/types";import"@tanstack/react-query";import"@ethersproject/bignumber";import"react-dom";import"react-window";import"dayjs";import"dayjs/plugin/utc";import"dayjs/plugin/duration";import"dayjs/plugin/localizedFormat";import"react-transition-group";import"react-is";import"@dodoex/contract-request";import"axios";import"recharts";import"jsbi";import"tiny-invariant";import"@uniswap/sdk-core";import"@uniswap/v2-sdk";import"react-infinite-scroller";import"d3";import"rmc-date-picker";import"rmc-date-picker/assets/index.css";import"react-datetime/css/react-datetime.css";
|
package/package.json
CHANGED
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@dodoex/widgets",
|
|
3
|
-
"version": "3.14.
|
|
4
|
-
"description": "DODO Widgets",
|
|
5
|
-
"source": "src/index.tsx",
|
|
6
|
-
"types": "dist/types/index.d.ts",
|
|
7
|
-
"main": "dist/index.cjs",
|
|
8
|
-
"module": "dist/index.js",
|
|
9
|
-
"license": "GPL-3.0-or-later",
|
|
10
|
-
"homepage": "https://github.com/DODOEX/widgets#readme",
|
|
11
|
-
"repository": "https://github.com/DODOEX/widgets",
|
|
12
|
-
"files": [
|
|
13
|
-
"dist"
|
|
14
|
-
],
|
|
15
|
-
"scripts": {
|
|
16
|
-
"prepare": "yarn compile:i18n",
|
|
17
|
-
"extract:i18n": "lingui extract --clean",
|
|
18
|
-
"compile:i18n": "yarn extract:i18n && lingui compile",
|
|
19
|
-
"sync:i18n": "export $(cat .env | xargs) && env lingui extract --overwrite && lingui compile",
|
|
20
|
-
"watch": "yarn run rollup -c --watch",
|
|
21
|
-
"build": "yarn compile:i18n && rollup --config",
|
|
22
|
-
"prerelease": "yarn run build",
|
|
23
|
-
"release": "semantic-release",
|
|
24
|
-
"release:local": "np --any-branch --no-cleanup --no-tests",
|
|
25
|
-
"release.npm-publish": "npm publish --access public",
|
|
26
|
-
"release.npm-publish-beta": "npm publish --tag beta",
|
|
27
|
-
"test": "jest src",
|
|
28
|
-
"test:e2e": "jest e2e"
|
|
29
|
-
},
|
|
30
|
-
"author": "",
|
|
31
|
-
"publishConfig": {
|
|
32
|
-
"access": "public",
|
|
33
|
-
"registry": "https://registry.npmjs.org"
|
|
34
|
-
},
|
|
35
|
-
"exports": {
|
|
36
|
-
".": {
|
|
37
|
-
"types": "./dist/types/index.d.ts",
|
|
38
|
-
"import": "./dist/index.js",
|
|
39
|
-
"require": "./dist/index.cjs"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"keywords": [
|
|
43
|
-
"dodo",
|
|
44
|
-
"widgets",
|
|
45
|
-
"interfaces"
|
|
46
|
-
],
|
|
47
|
-
"browserslist": {
|
|
48
|
-
"production": [
|
|
49
|
-
">0.2%",
|
|
50
|
-
"not dead",
|
|
51
|
-
"not op_mini all"
|
|
52
|
-
],
|
|
53
|
-
"development": [
|
|
54
|
-
"last 1 chrome version",
|
|
55
|
-
"last 1 firefox version",
|
|
56
|
-
"last 1 safari version"
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
"dependencies": {
|
|
60
|
-
"@babel/runtime": "^7.17.0",
|
|
61
|
-
"@dodoex/api": "3.5.
|
|
62
|
-
"@dodoex/components": "^3.2.
|
|
63
|
-
"@dodoex/contract-request": "^1.3.0",
|
|
64
|
-
"@dodoex/dodo-contract-request": "^1.32.0",
|
|
65
|
-
"@dodoex/icons": "^2.1.0",
|
|
66
|
-
"@emotion/react": "^11.10.0",
|
|
67
|
-
"@emotion/styled": "^11.10.0",
|
|
68
|
-
"@ethersproject/bignumber": "^5.6.2",
|
|
69
|
-
"@ethersproject/contracts": "^5.7.0",
|
|
70
|
-
"@lingui/core": "^5.7.0",
|
|
71
|
-
"@lingui/macro": "^5.7.0",
|
|
72
|
-
"@lingui/react": "^5.7.0",
|
|
73
|
-
"@reduxjs/toolkit": "^1.6.1",
|
|
74
|
-
"@semantic-release/changelog": "^6.0.1",
|
|
75
|
-
"@semantic-release/git": "^10.0.1",
|
|
76
|
-
"@tanstack/react-query": "^5.18.1",
|
|
77
|
-
"@uniswap/sdk-core": "^5.9.0",
|
|
78
|
-
"@uniswap/v2-sdk": "^4.6.2",
|
|
79
|
-
"@web3-react/core": "8.2.0",
|
|
80
|
-
"@web3-react/eip1193": "8.2.0",
|
|
81
|
-
"@web3-react/metamask": "8.2.1",
|
|
82
|
-
"@web3-react/types": "8.2.0",
|
|
83
|
-
"@web3-react/walletconnect-v2": "8.3.6",
|
|
84
|
-
"axios": "^0.27.2",
|
|
85
|
-
"bignumber.js": "^9.0.2",
|
|
86
|
-
"d3": "7.6.1",
|
|
87
|
-
"dayjs": "^1.11.11",
|
|
88
|
-
"identicon.js": "^2.3.3",
|
|
89
|
-
"jsbi": "^3.1.4",
|
|
90
|
-
"konva": "^9.3.15",
|
|
91
|
-
"lodash": "^4.17.21",
|
|
92
|
-
"make-plural": "^7.0.0",
|
|
93
|
-
"moment": "^2.29.4",
|
|
94
|
-
"react-datetime": "^3.3.0",
|
|
95
|
-
"react-icons": "^5.0.1",
|
|
96
|
-
"react-infinite-scroller": "^1.2.6",
|
|
97
|
-
"react-konva": "^19.0.0",
|
|
98
|
-
"react-transition-group": "^4.4.5",
|
|
99
|
-
"react-window": "^1.8.11",
|
|
100
|
-
"recharts": "^2.15.0",
|
|
101
|
-
"rmc-date-picker": "^6.0.10",
|
|
102
|
-
"tiny-invariant": "^1.1.0",
|
|
103
|
-
"zustand": "^4.5.5"
|
|
104
|
-
},
|
|
105
|
-
"peerDependencies": {
|
|
106
|
-
"@babel/runtime": ">=7.17.0",
|
|
107
|
-
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
108
|
-
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
109
|
-
},
|
|
110
|
-
"peerDependenciesMeta": {
|
|
111
|
-
"react-infinite-scroller": {
|
|
112
|
-
"optional": true
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
"devDependencies": {
|
|
116
|
-
"@babel/preset-env": "^7.16.11",
|
|
117
|
-
"@babel/preset-react": "^7.18.6",
|
|
118
|
-
"@babel/preset-typescript": "^7.16.7",
|
|
119
|
-
"@lingui/cli": "^5.7.0",
|
|
120
|
-
"@nomicfoundation/hardhat-network-helpers": "^1.0.6",
|
|
121
|
-
"@nomiclabs/hardhat-ethers": "^2.1.1",
|
|
122
|
-
"@rollup/plugin-babel": "^6.0.4",
|
|
123
|
-
"@rollup/plugin-commonjs": "^26.0.1",
|
|
124
|
-
"@rollup/plugin-json": "^6.1.0",
|
|
125
|
-
"@rollup/plugin-multi-entry": "^6.0.1",
|
|
126
|
-
"@rollup/plugin-replace": "^5.0.7",
|
|
127
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
128
|
-
"@rollup/plugin-typescript": "^12.1.1",
|
|
129
|
-
"@rollup/plugin-url": "^8.0.2",
|
|
130
|
-
"@svgr/rollup": "^6.2.1",
|
|
131
|
-
"@testing-library/jest-dom": "^6.5.0",
|
|
132
|
-
"@testing-library/react": "^16.0.1",
|
|
133
|
-
"@testing-library/react-hooks": "^8.0.1",
|
|
134
|
-
"@types/d3": "7.4.3",
|
|
135
|
-
"@types/identicon.js": "^2.3.1",
|
|
136
|
-
"@types/jest": "^29.0.3",
|
|
137
|
-
"@types/lodash": "^4.14.184",
|
|
138
|
-
"@types/react-infinite-scroller": "^1.2.5",
|
|
139
|
-
"@types/react-transition-group": "^4.4.11",
|
|
140
|
-
"@types/react-window": "^1.8.5",
|
|
141
|
-
"babel-plugin-macros": "^3.1.0",
|
|
142
|
-
"babel-runtime": "^6.26.0",
|
|
143
|
-
"dotenv": "^16.0.2",
|
|
144
|
-
"ethers": "^5.7.1",
|
|
145
|
-
"gettext-parser": "^8.0.0",
|
|
146
|
-
"hardhat": "^2.22.13",
|
|
147
|
-
"identity-obj-proxy": "^3.0.0",
|
|
148
|
-
"jest": "^29.0.3",
|
|
149
|
-
"jest-environment-hardhat": "^1.1.9",
|
|
150
|
-
"jest-environment-jsdom": "^29.0.3",
|
|
151
|
-
"np": "^7.6.1",
|
|
152
|
-
"rollup": "^4.18.0",
|
|
153
|
-
"rollup-plugin-clear": "^2.0.7",
|
|
154
|
-
"rollup-plugin-import-css": "^3.5.5",
|
|
155
|
-
"svg-jest": "^1.0.1",
|
|
156
|
-
"ts-jest": "^29.0.1",
|
|
157
|
-
"typescript": "^5.6.3"
|
|
158
|
-
},
|
|
159
|
-
"optionalDependencies": {
|
|
160
|
-
"pino-pretty": "^13.1.3"
|
|
161
|
-
}
|
|
162
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@dodoex/widgets",
|
|
3
|
+
"version": "3.14.1-react.02",
|
|
4
|
+
"description": "DODO Widgets",
|
|
5
|
+
"source": "src/index.tsx",
|
|
6
|
+
"types": "dist/types/index.d.ts",
|
|
7
|
+
"main": "dist/index.cjs",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
|
+
"license": "GPL-3.0-or-later",
|
|
10
|
+
"homepage": "https://github.com/DODOEX/widgets#readme",
|
|
11
|
+
"repository": "https://github.com/DODOEX/widgets",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"prepare": "yarn compile:i18n",
|
|
17
|
+
"extract:i18n": "lingui extract --clean",
|
|
18
|
+
"compile:i18n": "yarn extract:i18n && lingui compile",
|
|
19
|
+
"sync:i18n": "export $(cat .env | xargs) && env lingui extract --overwrite && lingui compile",
|
|
20
|
+
"watch": "yarn run rollup -c --watch",
|
|
21
|
+
"build": "yarn compile:i18n && rollup --config",
|
|
22
|
+
"prerelease": "yarn run build",
|
|
23
|
+
"release": "semantic-release",
|
|
24
|
+
"release:local": "np --any-branch --no-cleanup --no-tests",
|
|
25
|
+
"release.npm-publish": "npm publish --access public",
|
|
26
|
+
"release.npm-publish-beta": "yarn run prerelease && npm publish --tag beta",
|
|
27
|
+
"test": "jest src",
|
|
28
|
+
"test:e2e": "jest e2e"
|
|
29
|
+
},
|
|
30
|
+
"author": "",
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public",
|
|
33
|
+
"registry": "https://registry.npmjs.org"
|
|
34
|
+
},
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"types": "./dist/types/index.d.ts",
|
|
38
|
+
"import": "./dist/index.js",
|
|
39
|
+
"require": "./dist/index.cjs"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"dodo",
|
|
44
|
+
"widgets",
|
|
45
|
+
"interfaces"
|
|
46
|
+
],
|
|
47
|
+
"browserslist": {
|
|
48
|
+
"production": [
|
|
49
|
+
">0.2%",
|
|
50
|
+
"not dead",
|
|
51
|
+
"not op_mini all"
|
|
52
|
+
],
|
|
53
|
+
"development": [
|
|
54
|
+
"last 1 chrome version",
|
|
55
|
+
"last 1 firefox version",
|
|
56
|
+
"last 1 safari version"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@babel/runtime": "^7.17.0",
|
|
61
|
+
"@dodoex/api": "3.5.1-react.01",
|
|
62
|
+
"@dodoex/components": "^3.2.1-react.01",
|
|
63
|
+
"@dodoex/contract-request": "^1.3.0",
|
|
64
|
+
"@dodoex/dodo-contract-request": "^1.32.0",
|
|
65
|
+
"@dodoex/icons": "^2.1.0",
|
|
66
|
+
"@emotion/react": "^11.10.0",
|
|
67
|
+
"@emotion/styled": "^11.10.0",
|
|
68
|
+
"@ethersproject/bignumber": "^5.6.2",
|
|
69
|
+
"@ethersproject/contracts": "^5.7.0",
|
|
70
|
+
"@lingui/core": "^5.7.0",
|
|
71
|
+
"@lingui/macro": "^5.7.0",
|
|
72
|
+
"@lingui/react": "^5.7.0",
|
|
73
|
+
"@reduxjs/toolkit": "^1.6.1",
|
|
74
|
+
"@semantic-release/changelog": "^6.0.1",
|
|
75
|
+
"@semantic-release/git": "^10.0.1",
|
|
76
|
+
"@tanstack/react-query": "^5.18.1",
|
|
77
|
+
"@uniswap/sdk-core": "^5.9.0",
|
|
78
|
+
"@uniswap/v2-sdk": "^4.6.2",
|
|
79
|
+
"@web3-react/core": "8.2.0",
|
|
80
|
+
"@web3-react/eip1193": "8.2.0",
|
|
81
|
+
"@web3-react/metamask": "8.2.1",
|
|
82
|
+
"@web3-react/types": "8.2.0",
|
|
83
|
+
"@web3-react/walletconnect-v2": "8.3.6",
|
|
84
|
+
"axios": "^0.27.2",
|
|
85
|
+
"bignumber.js": "^9.0.2",
|
|
86
|
+
"d3": "7.6.1",
|
|
87
|
+
"dayjs": "^1.11.11",
|
|
88
|
+
"identicon.js": "^2.3.3",
|
|
89
|
+
"jsbi": "^3.1.4",
|
|
90
|
+
"konva": "^9.3.15",
|
|
91
|
+
"lodash": "^4.17.21",
|
|
92
|
+
"make-plural": "^7.0.0",
|
|
93
|
+
"moment": "^2.29.4",
|
|
94
|
+
"react-datetime": "^3.3.0",
|
|
95
|
+
"react-icons": "^5.0.1",
|
|
96
|
+
"react-infinite-scroller": "^1.2.6",
|
|
97
|
+
"react-konva": "^19.0.0",
|
|
98
|
+
"react-transition-group": "^4.4.5",
|
|
99
|
+
"react-window": "^1.8.11",
|
|
100
|
+
"recharts": "^2.15.0",
|
|
101
|
+
"rmc-date-picker": "^6.0.10",
|
|
102
|
+
"tiny-invariant": "^1.1.0",
|
|
103
|
+
"zustand": "^4.5.5"
|
|
104
|
+
},
|
|
105
|
+
"peerDependencies": {
|
|
106
|
+
"@babel/runtime": ">=7.17.0",
|
|
107
|
+
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
108
|
+
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
109
|
+
},
|
|
110
|
+
"peerDependenciesMeta": {
|
|
111
|
+
"react-infinite-scroller": {
|
|
112
|
+
"optional": true
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"devDependencies": {
|
|
116
|
+
"@babel/preset-env": "^7.16.11",
|
|
117
|
+
"@babel/preset-react": "^7.18.6",
|
|
118
|
+
"@babel/preset-typescript": "^7.16.7",
|
|
119
|
+
"@lingui/cli": "^5.7.0",
|
|
120
|
+
"@nomicfoundation/hardhat-network-helpers": "^1.0.6",
|
|
121
|
+
"@nomiclabs/hardhat-ethers": "^2.1.1",
|
|
122
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
123
|
+
"@rollup/plugin-commonjs": "^26.0.1",
|
|
124
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
125
|
+
"@rollup/plugin-multi-entry": "^6.0.1",
|
|
126
|
+
"@rollup/plugin-replace": "^5.0.7",
|
|
127
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
128
|
+
"@rollup/plugin-typescript": "^12.1.1",
|
|
129
|
+
"@rollup/plugin-url": "^8.0.2",
|
|
130
|
+
"@svgr/rollup": "^6.2.1",
|
|
131
|
+
"@testing-library/jest-dom": "^6.5.0",
|
|
132
|
+
"@testing-library/react": "^16.0.1",
|
|
133
|
+
"@testing-library/react-hooks": "^8.0.1",
|
|
134
|
+
"@types/d3": "7.4.3",
|
|
135
|
+
"@types/identicon.js": "^2.3.1",
|
|
136
|
+
"@types/jest": "^29.0.3",
|
|
137
|
+
"@types/lodash": "^4.14.184",
|
|
138
|
+
"@types/react-infinite-scroller": "^1.2.5",
|
|
139
|
+
"@types/react-transition-group": "^4.4.11",
|
|
140
|
+
"@types/react-window": "^1.8.5",
|
|
141
|
+
"babel-plugin-macros": "^3.1.0",
|
|
142
|
+
"babel-runtime": "^6.26.0",
|
|
143
|
+
"dotenv": "^16.0.2",
|
|
144
|
+
"ethers": "^5.7.1",
|
|
145
|
+
"gettext-parser": "^8.0.0",
|
|
146
|
+
"hardhat": "^2.22.13",
|
|
147
|
+
"identity-obj-proxy": "^3.0.0",
|
|
148
|
+
"jest": "^29.0.3",
|
|
149
|
+
"jest-environment-hardhat": "^1.1.9",
|
|
150
|
+
"jest-environment-jsdom": "^29.0.3",
|
|
151
|
+
"np": "^7.6.1",
|
|
152
|
+
"rollup": "^4.18.0",
|
|
153
|
+
"rollup-plugin-clear": "^2.0.7",
|
|
154
|
+
"rollup-plugin-import-css": "^3.5.5",
|
|
155
|
+
"svg-jest": "^1.0.1",
|
|
156
|
+
"ts-jest": "^29.0.1",
|
|
157
|
+
"typescript": "^5.6.3"
|
|
158
|
+
},
|
|
159
|
+
"optionalDependencies": {
|
|
160
|
+
"pino-pretty": "^13.1.3"
|
|
161
|
+
}
|
|
162
|
+
}
|