@dodoex/widgets 3.10.8-cp.5 → 3.10.8-cp.6
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/dist/assets/bundle-DSSoJu9z.css +297 -0
- package/dist/{helper-BD_TU9_Y.cjs → helper-Cf2ZbMcF.cjs} +1 -1
- package/dist/{helper-7bahf5lY.js → helper-DcVtliN6.js} +1 -1
- package/dist/{index-CyjYpcQg.js → index-Bj8Q8Qp3.js} +1 -1
- package/dist/{index-DfDr5FZl.js → index-BxE1IH7P.js} +5 -5
- package/dist/{index-yHykimG2.cjs → index-CDyvjUiX.cjs} +2 -2
- package/dist/index-CI-ctoTB.js +78 -0
- package/dist/{index-CLIMx87H.cjs → index-DKd3QSAO.cjs} +5 -5
- package/dist/{index-Bcsad8UU.cjs → index-DMFD1yhr.cjs} +5 -5
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/quill.snow-BrbQlPt5.cjs +1 -0
- package/dist/quill.snow-CFLJD2Vw.js +1 -0
- package/dist/types/widgets/CrowdpoolingWidget/CrowdpoolingCreate/components/RichTextEditor/index.d.ts +0 -1
- package/package.json +1 -1
- package/dist/assets/bundle-j598CJmN.css +0 -308
- package/dist/index-DKT6DLYE.js +0 -78
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
.rmc-date-picker {
|
|
2
|
+
display: -ms-flexbox;
|
|
3
|
+
display: flex;
|
|
4
|
+
-ms-flex-align: center;
|
|
5
|
+
align-items: center;
|
|
6
|
+
padding: 10px 0;
|
|
7
|
+
}
|
|
8
|
+
.rmc-date-picker-item {
|
|
9
|
+
-ms-flex: 1;
|
|
10
|
+
flex: 1;
|
|
11
|
+
text-align: center;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.rmc-picker,
|
|
15
|
+
.rmc-multi-picker {
|
|
16
|
+
height: 238px;
|
|
17
|
+
/*34*7*/
|
|
18
|
+
}
|
|
19
|
+
.rmc-multi-picker {
|
|
20
|
+
display: -webkit-box;
|
|
21
|
+
display: flex;
|
|
22
|
+
-webkit-box-align: center;
|
|
23
|
+
align-items: center;
|
|
24
|
+
}
|
|
25
|
+
.rmc-picker-item {
|
|
26
|
+
font-size: 16px;
|
|
27
|
+
height: 34px;
|
|
28
|
+
line-height: 34px;
|
|
29
|
+
padding: 0 10px;
|
|
30
|
+
white-space: nowrap;
|
|
31
|
+
position: relative;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
text-overflow: ellipsis;
|
|
34
|
+
color: #9b9b9b;
|
|
35
|
+
width: 100%;
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
}
|
|
38
|
+
.rmc-picker {
|
|
39
|
+
display: block;
|
|
40
|
+
position: relative;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
width: 100%;
|
|
43
|
+
-webkit-box-flex: 1;
|
|
44
|
+
flex: 1;
|
|
45
|
+
text-align: center;
|
|
46
|
+
}
|
|
47
|
+
.rmc-picker-mask {
|
|
48
|
+
position: absolute;
|
|
49
|
+
left: 0;
|
|
50
|
+
top: 0;
|
|
51
|
+
height: 100%;
|
|
52
|
+
margin: 0 auto;
|
|
53
|
+
width: 100%;
|
|
54
|
+
z-index: 3;
|
|
55
|
+
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0.95)), to(rgba(255, 255, 255, 0.6))), -webkit-gradient(linear, left bottom, left top, from(rgba(255, 255, 255, 0.95)), to(rgba(255, 255, 255, 0.6)));
|
|
56
|
+
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.6)), linear-gradient(to top, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.6));
|
|
57
|
+
background-position: top, bottom;
|
|
58
|
+
background-size: 100% 204px;
|
|
59
|
+
background-repeat: no-repeat;
|
|
60
|
+
}
|
|
61
|
+
.rmc-picker-content {
|
|
62
|
+
position: absolute;
|
|
63
|
+
left: 0;
|
|
64
|
+
top: 0;
|
|
65
|
+
width: 100%;
|
|
66
|
+
z-index: 1;
|
|
67
|
+
}
|
|
68
|
+
.rmc-picker-indicator {
|
|
69
|
+
box-sizing: border-box;
|
|
70
|
+
width: 100%;
|
|
71
|
+
height: 34px;
|
|
72
|
+
position: absolute;
|
|
73
|
+
left: 0;
|
|
74
|
+
top: 102px;
|
|
75
|
+
z-index: 3;
|
|
76
|
+
border-top: 1PX solid #ddd;
|
|
77
|
+
border-bottom: 1PX solid #ddd;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/*!
|
|
81
|
+
* https://github.com/arqex/react-datetime
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
.rdt {
|
|
85
|
+
position: relative;
|
|
86
|
+
}
|
|
87
|
+
.rdtPicker {
|
|
88
|
+
display: none;
|
|
89
|
+
position: absolute;
|
|
90
|
+
min-width: 250px;
|
|
91
|
+
padding: 4px;
|
|
92
|
+
margin-top: 1px;
|
|
93
|
+
z-index: 99999 !important;
|
|
94
|
+
background: #fff;
|
|
95
|
+
box-shadow: 0 1px 3px rgba(0,0,0,.1);
|
|
96
|
+
border: 1px solid #f9f9f9;
|
|
97
|
+
}
|
|
98
|
+
.rdtOpen .rdtPicker {
|
|
99
|
+
display: block;
|
|
100
|
+
}
|
|
101
|
+
.rdtStatic .rdtPicker {
|
|
102
|
+
box-shadow: none;
|
|
103
|
+
position: static;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.rdtPicker .rdtTimeToggle {
|
|
107
|
+
text-align: center;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.rdtPicker table {
|
|
111
|
+
width: 100%;
|
|
112
|
+
margin: 0;
|
|
113
|
+
}
|
|
114
|
+
.rdtPicker td,
|
|
115
|
+
.rdtPicker th {
|
|
116
|
+
text-align: center;
|
|
117
|
+
height: 28px;
|
|
118
|
+
}
|
|
119
|
+
.rdtPicker td {
|
|
120
|
+
cursor: pointer;
|
|
121
|
+
}
|
|
122
|
+
.rdtPicker td.rdtDay:hover,
|
|
123
|
+
.rdtPicker td.rdtHour:hover,
|
|
124
|
+
.rdtPicker td.rdtMinute:hover,
|
|
125
|
+
.rdtPicker td.rdtSecond:hover,
|
|
126
|
+
.rdtPicker .rdtTimeToggle:hover {
|
|
127
|
+
background: #eeeeee;
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
}
|
|
130
|
+
.rdtPicker td.rdtOld,
|
|
131
|
+
.rdtPicker td.rdtNew {
|
|
132
|
+
color: #999999;
|
|
133
|
+
}
|
|
134
|
+
.rdtPicker td.rdtToday {
|
|
135
|
+
position: relative;
|
|
136
|
+
}
|
|
137
|
+
.rdtPicker td.rdtToday:before {
|
|
138
|
+
content: '';
|
|
139
|
+
display: inline-block;
|
|
140
|
+
border-left: 7px solid transparent;
|
|
141
|
+
border-bottom: 7px solid #428bca;
|
|
142
|
+
border-top-color: rgba(0, 0, 0, 0.2);
|
|
143
|
+
position: absolute;
|
|
144
|
+
bottom: 4px;
|
|
145
|
+
right: 4px;
|
|
146
|
+
}
|
|
147
|
+
.rdtPicker td.rdtActive,
|
|
148
|
+
.rdtPicker td.rdtActive:hover {
|
|
149
|
+
background-color: #428bca;
|
|
150
|
+
color: #fff;
|
|
151
|
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
|
152
|
+
}
|
|
153
|
+
.rdtPicker td.rdtActive.rdtToday:before {
|
|
154
|
+
border-bottom-color: #fff;
|
|
155
|
+
}
|
|
156
|
+
.rdtPicker td.rdtDisabled,
|
|
157
|
+
.rdtPicker td.rdtDisabled:hover {
|
|
158
|
+
background: none;
|
|
159
|
+
color: #999999;
|
|
160
|
+
cursor: not-allowed;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.rdtPicker td span.rdtOld {
|
|
164
|
+
color: #999999;
|
|
165
|
+
}
|
|
166
|
+
.rdtPicker td span.rdtDisabled,
|
|
167
|
+
.rdtPicker td span.rdtDisabled:hover {
|
|
168
|
+
background: none;
|
|
169
|
+
color: #999999;
|
|
170
|
+
cursor: not-allowed;
|
|
171
|
+
}
|
|
172
|
+
.rdtPicker th {
|
|
173
|
+
border-bottom: 1px solid #f9f9f9;
|
|
174
|
+
}
|
|
175
|
+
.rdtPicker .dow {
|
|
176
|
+
width: 14.2857%;
|
|
177
|
+
border-bottom: none;
|
|
178
|
+
cursor: default;
|
|
179
|
+
}
|
|
180
|
+
.rdtPicker th.rdtSwitch {
|
|
181
|
+
width: 100px;
|
|
182
|
+
}
|
|
183
|
+
.rdtPicker th.rdtNext,
|
|
184
|
+
.rdtPicker th.rdtPrev {
|
|
185
|
+
font-size: 21px;
|
|
186
|
+
vertical-align: top;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.rdtPrev span,
|
|
190
|
+
.rdtNext span {
|
|
191
|
+
display: block;
|
|
192
|
+
-webkit-touch-callout: none; /* iOS Safari */
|
|
193
|
+
-webkit-user-select: none; /* Chrome/Safari/Opera */
|
|
194
|
+
-khtml-user-select: none; /* Konqueror */
|
|
195
|
+
-moz-user-select: none; /* Firefox */
|
|
196
|
+
-ms-user-select: none; /* Internet Explorer/Edge */
|
|
197
|
+
user-select: none;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.rdtPicker th.rdtDisabled,
|
|
201
|
+
.rdtPicker th.rdtDisabled:hover {
|
|
202
|
+
background: none;
|
|
203
|
+
color: #999999;
|
|
204
|
+
cursor: not-allowed;
|
|
205
|
+
}
|
|
206
|
+
.rdtPicker thead tr:first-of-type th {
|
|
207
|
+
cursor: pointer;
|
|
208
|
+
}
|
|
209
|
+
.rdtPicker thead tr:first-of-type th:hover {
|
|
210
|
+
background: #eeeeee;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.rdtPicker tfoot {
|
|
214
|
+
border-top: 1px solid #f9f9f9;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.rdtPicker button {
|
|
218
|
+
border: none;
|
|
219
|
+
background: none;
|
|
220
|
+
cursor: pointer;
|
|
221
|
+
}
|
|
222
|
+
.rdtPicker button:hover {
|
|
223
|
+
background-color: #eee;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.rdtPicker thead button {
|
|
227
|
+
width: 100%;
|
|
228
|
+
height: 100%;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
td.rdtMonth,
|
|
232
|
+
td.rdtYear {
|
|
233
|
+
height: 50px;
|
|
234
|
+
width: 25%;
|
|
235
|
+
cursor: pointer;
|
|
236
|
+
}
|
|
237
|
+
td.rdtMonth:hover,
|
|
238
|
+
td.rdtYear:hover {
|
|
239
|
+
background: #eee;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.rdtCounters {
|
|
243
|
+
display: inline-block;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.rdtCounters > div {
|
|
247
|
+
float: left;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.rdtCounter {
|
|
251
|
+
height: 100px;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.rdtCounter {
|
|
255
|
+
width: 40px;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.rdtCounterSeparator {
|
|
259
|
+
line-height: 100px;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.rdtCounter .rdtBtn {
|
|
263
|
+
height: 40%;
|
|
264
|
+
line-height: 40px;
|
|
265
|
+
cursor: pointer;
|
|
266
|
+
display: block;
|
|
267
|
+
|
|
268
|
+
-webkit-touch-callout: none; /* iOS Safari */
|
|
269
|
+
-webkit-user-select: none; /* Chrome/Safari/Opera */
|
|
270
|
+
-khtml-user-select: none; /* Konqueror */
|
|
271
|
+
-moz-user-select: none; /* Firefox */
|
|
272
|
+
-ms-user-select: none; /* Internet Explorer/Edge */
|
|
273
|
+
user-select: none;
|
|
274
|
+
}
|
|
275
|
+
.rdtCounter .rdtBtn:hover {
|
|
276
|
+
background: #eee;
|
|
277
|
+
}
|
|
278
|
+
.rdtCounter .rdtCount {
|
|
279
|
+
height: 20%;
|
|
280
|
+
font-size: 1.2em;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.rdtMilli {
|
|
284
|
+
vertical-align: middle;
|
|
285
|
+
padding-left: 8px;
|
|
286
|
+
width: 48px;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.rdtMilli input {
|
|
290
|
+
width: 100%;
|
|
291
|
+
font-size: 1.2em;
|
|
292
|
+
margin-top: 37px;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.rdtTime td {
|
|
296
|
+
cursor: default;
|
|
297
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("@lingui/core"),t=require("bignumber.js"),i=require("./index-
|
|
1
|
+
"use strict";var e=require("@lingui/core"),t=require("bignumber.js"),i=require("./index-DKd3QSAO.cjs");function o(e){let t=e.toLowerCase();if(t&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)){if(4===t.length){let e="#";for(let i=1;i<4;i+=1)e+=t.slice(i,i+1).concat(t.slice(i,i+1));t=e}const e=[];for(let i=1;i<7;i+=2)e.push(parseInt(`0x${t.slice(i,i+2)}`));return e.join(",")}return t}function r({val:e,model:i}){let o=e;if(e.isNaN())return{side:"no-one",vert:new t(0),base:new t(0),quote:new t(0)};i.Q0.eq(0)&&e.lt(i.i)&&(o=i.i),i.B0.eq(0)&&e.gt(i.i)&&(o=i.i);const r=i.getPriceDepth(o),n=r.baseAmount,l=r.quoteAmount,{isBuy:s}=r;return{side:s?"ask":"bid",vert:s?n:l,base:n,quote:l}}function n(e,i=1){return new t(i).div(e/2)}exports.baseZoomMultiples=1,exports.beforePriceImpactEffect=function({currentBaseMinAndZoomMultiples:e,targetPrice:i,midPrice:o,width:r}){const{baseMin:n,zoomMultiples:l}=e,s=new t(Math.log10(n.div(o).toNumber())),u=s.plus(2*l),a=new t(o.multipliedBy(10**u.toNumber()));if(i.gte(n)&&i.lte(a)){return{isSkip:!0,targetX:new t(Math.log10(i.div(o).toNumber())).minus(s).div(2*l).multipliedBy(r).toNumber(),baseMin:new t(0),zoomMultiples:1}}const m=new t(o.multipliedBy(.1)),p=new t(o.multipliedBy(10));if(i.gte(m)&&i.lte(p)){return{isSkip:!1,targetX:new t(Math.log10(i.div(o).toNumber())).minus(-1).div(2).multipliedBy(r).toNumber(),baseMin:m,zoomMultiples:1}}return{isSkip:!1,targetX:-1,baseMin:new t(0),zoomMultiples:1}},exports.chartOffsetYBCToolTip=18,exports.chartT=function(t,i){switch(t){case"depth-chart.tips.buy":return e.i18n._({id:"q+Q952",message:"Users pay {0} {1} and receive {2} {3}\\nPrice {4} ({5}%)",values:{0:i.amountText,1:i.baseTokenSymbol,2:i.oppositeAmountText,3:i.quoteTokenSymbol,4:i.priceText,5:i.slippageText}});case"depth-chart.tips.mid-price":return e.i18n._({id:"cnbRVW",message:"Initial Price {0} {1} = {2} {3}",values:{0:i.amountText,1:i.baseTokenSymbol,2:i.oppositeAmountText,3:i.quoteTokenSymbol}});case"depth-chart.tips.sell":return e.i18n._({id:"q+Q952",message:"Users pay {0} {1} and receive {2} {3}\\nPrice {4} ({5}%)",values:{0:i.oppositeAmountText,1:i.quoteTokenSymbol,2:i.amountText,3:i.baseTokenSymbol,4:i.priceText,5:i.slippageText}});case"pool.chart.buy-amount":return e.i18n._({id:"TaScUS",message:"Users sell {0} amount:",values:{0:i.symbol}});case"pool.chart.price-impact":return e.i18n._({id:"I0LXan",message:"Price Impact: {0}",values:{0:i.amount}});case"pool.chart.sell-amount":return e.i18n._({id:"F2vX4t",message:"Users buy {0} amount:",values:{0:i.symbol}});case"pool.create.disabled-token-amount":return e.i18n._({id:"5QDjef",message:"The token amount is calculated by initial price."});case"pool.create.set-pool.emulator.title":return e.i18n._({id:"FQfStS",message:"Emulator"});case"pool.create.set-pool.emulator.title.question":return e.i18n._({id:"9D2g7k",message:"The liquidity of DODO is continuous, which is different from the discrete liquidity of UniV3. The ticks shown in the illustration are for demonstration purposes only."});case"pool.chart.liquidity-chart-tip":return e.i18n._({id:"YvXHDU",message:"The area of the chart indicates the buy/sell volume of {0} that can be carried by the market when the current price changes to the hover price.",values:{0:i.baseTokenSymbol}});case"pool.chart.liquidity-chart-buy":return e.i18n._({id:"TvH4Ym",message:"Bought {0} {1}, price in the pool decreased to {2}",values:{0:i.amount,1:i.symbol,2:i.price}});case"pool.chart.liquidity-chart-sell":return e.i18n._({id:"0O1wzf",message:"Traders sold {0} {1}, price in the pool increased to {2}",values:{0:i.amount,1:i.symbol,2:i.price}});default:throw new Error(`Unknown key ${t}`)}},exports.colorRgb=o,exports.computeBaseAfterZoom=function({midPrice:e,zoomMultiples:t}){return e.multipliedBy(10**-t)},exports.computeBaseMinByDistance=function({dragDistance:e,prevBaseMin:i,chartWidth:o,zoomMultiples:r}){const l=n(o,r);return e>0?i.multipliedBy(1-l.multipliedBy(e).toNumber()):i.multipliedBy(10**l.multipliedBy(new t(e).abs()).plus(0).toNumber())},exports.computeBaseVert=function({midPrice:e,q:i,q0:o,pmmModel:r}){let n=t.maximum(i,o,r.B.multipliedBy(e));return n.isNaN()&&(n=new t(10)),n.eq(0)&&(n=new t(1)),{buyBaseVert:n.multipliedBy(1.2),sellBaseVert:n.div(e).multipliedBy(1.2)}},exports.computeTargetXByTargetPrice=function({type:e,targetPrice:i,midPrice:o,width:r}){if("sell"===e){return{zoomMultiples:new t(Math.log10(i.div(o).toNumber())).minus(0).div(3/4).abs(),targetX:r/2*(3/4)+r/2}}const n=new t(Math.log10(i.div(o).toNumber()));return{zoomMultiples:new t(0).minus(n).div(3/4).abs(),targetX:r/2*(1/4)}},exports.computeXPortion=n,exports.computeZoomMultiplesWhenZoom=function({prevZoomMultiples:e,zoomIn:t}){return!t&&e<=.1?e:t?e+.1:e-.1},exports.evalPoint=r,exports.labelPadding=12,exports.updateTooltip=function({tooltip:e,x:l,chartWidth:s,chartHeight:u,buyBaseVert:a,sellBaseVert:m,pmmModel:p,midPrice:c,baseTokenSymbol:d,quoteTokenSymbol:h,t:b,baseMinAndZoomMultiples:f,isHover:g,color:y,leftColor:x,rightColor:T}){const{zoomMultiples:v,baseMin:w}=f,B=n(s,v),M=a.div(u),k=m.div(u),q=2*v,S=w.multipliedBy(10**B.multipliedBy(l).toNumber());let N=new t(Math.log(c.div(w).toNumber())/Math.log(10));N=t.minimum(q,N),N=t.maximum(0,N);const P=N.div(B),X=r({val:S,model:p,midPrice:c});if(X.vert.isNaN())return;const A=S.lt(c);let O=u-X.vert.div(M).toNumber();A||(O=u-X.vert.div(k).toNumber());const _=i.formatShortNumber(S),z=i.formatShortNumber(X.vert),D=S.minus(c).abs().div(c).multipliedBy(100).toFixed(2),$=P.toNumber(),H=e.findOne("#toolTipVertLine"),L=e.findOne("#toolTipHoriLine"),U=e.findOne("#joinCircle"),V=e.findOne("#toolTip"),W=e.findOne("#priceTextLabel"),Y=e.findOne("#slippageTextLabel");if(!V)return;V.x(l),V.y(O-5-6);const Z=V.getText(),I=V.getTag();let j="ask"===X.side?i.formatShortNumber(X.quote):i.formatShortNumber(X.base);const C=p.k.lte(0);C&&(j=z);const F=i.formatShortNumber(c),Q={amountText:z,baseTokenSymbol:d,oppositeAmountText:j,quoteTokenSymbol:h,priceText:C?F:_,slippageText:`${A?"-":"+"}${D}`};if(P.minus(4).lte(l)&&P.plus(2).gte(l)&&g)Z.text(b("depth-chart.tips.mid-price",{amountText:1,baseTokenSymbol:d,oppositeAmountText:F,quoteTokenSymbol:h})),V.x($),V.y(u/2),null==H||H.hide(),null==L||L.hide(),null==U||U.hide(),null==W||W.hide(),null==Y||Y.hide();else{Z.text(A?b("depth-chart.tips.buy",{amountText:j,baseTokenSymbol:d,oppositeAmountText:z,quoteTokenSymbol:h,priceText:C?F:_,slippageText:`${A?"-":"+"}${D}`}):b("depth-chart.tips.sell",Q));const e=y||(A?"#55f6db":"#ff4f73"),t=A?x||"#55f6db":T||"#ff4f73";Z.fill(e),V.width()/2>l?(I.pointerDirection("left"),I.pointerHeight(15),I.pointerWidth(8),V.offsetX(-11),V.offsetY(-11)):V.width()/2+l>s?(I.pointerDirection("right"),I.pointerHeight(15),I.pointerWidth(8),V.offsetX(11),V.offsetY(-11)):(I.pointerDirection("down"),I.pointerHeight(8),I.pointerWidth(15),V.offsetX(0),V.offsetY(0)),null==H||H.points([l,u,l,O]),null==H||H.stroke(t),null==L||L.points(A?[l,O,$,O]:[$,O,l,O]),null==L||L.stroke(t),null==U||U.x(l),null==U||U.y(O),null==U||U.fill(A?x||"rgb(86, 246, 218)":T||"#FF5072"),null==U||U.stroke(A?x?`rgba(${o(x)}, 0.4)`:"rgba(86, 246, 218, 0.3)":T?`rgba(${o(T)}, 0.4)`:"rgba(255, 80, 114, 0.3)"),W&&(W.x(l),W.y(u),W.offsetX(W.width()/2),W.x()-W.width()/2<0?W.x(W.width()/2):W.x()+W.width()/2>s?W.x(s-W.width()/2):W.x(l));const i=null==W?void 0:W.findOne("#priceTextLabel-text");i&&(i.fill(e),i.text(_)),Y&&(Y.x(A?l+($-l)/2:l-(l-$)/2),Y.y(O),Y.offsetY(Y.height()/2),Y.offsetX(Y.width()/2));const r=null==Y?void 0:Y.findOne("#slippageTextLabel-text");r&&(r.fill(e),r.text(`${A?"-":"+"}${D}%`)),null==H||H.show(),null==L||L.show(),null==U||U.show(),null==W||W.show(),null==Y||Y.show()}e.show()};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i18n as e}from"@lingui/core";import t from"bignumber.js";import{f as i}from"./index-
|
|
1
|
+
import{i18n as e}from"@lingui/core";import t from"bignumber.js";import{f as i}from"./index-BxE1IH7P.js";function o(t,i){switch(t){case"depth-chart.tips.buy":return e._({id:"q+Q952",message:"Users pay {0} {1} and receive {2} {3}\\nPrice {4} ({5}%)",values:{0:i.amountText,1:i.baseTokenSymbol,2:i.oppositeAmountText,3:i.quoteTokenSymbol,4:i.priceText,5:i.slippageText}});case"depth-chart.tips.mid-price":return e._({id:"cnbRVW",message:"Initial Price {0} {1} = {2} {3}",values:{0:i.amountText,1:i.baseTokenSymbol,2:i.oppositeAmountText,3:i.quoteTokenSymbol}});case"depth-chart.tips.sell":return e._({id:"q+Q952",message:"Users pay {0} {1} and receive {2} {3}\\nPrice {4} ({5}%)",values:{0:i.oppositeAmountText,1:i.quoteTokenSymbol,2:i.amountText,3:i.baseTokenSymbol,4:i.priceText,5:i.slippageText}});case"pool.chart.buy-amount":return e._({id:"TaScUS",message:"Users sell {0} amount:",values:{0:i.symbol}});case"pool.chart.price-impact":return e._({id:"I0LXan",message:"Price Impact: {0}",values:{0:i.amount}});case"pool.chart.sell-amount":return e._({id:"F2vX4t",message:"Users buy {0} amount:",values:{0:i.symbol}});case"pool.create.disabled-token-amount":return e._({id:"5QDjef",message:"The token amount is calculated by initial price."});case"pool.create.set-pool.emulator.title":return e._({id:"FQfStS",message:"Emulator"});case"pool.create.set-pool.emulator.title.question":return e._({id:"9D2g7k",message:"The liquidity of DODO is continuous, which is different from the discrete liquidity of UniV3. The ticks shown in the illustration are for demonstration purposes only."});case"pool.chart.liquidity-chart-tip":return e._({id:"YvXHDU",message:"The area of the chart indicates the buy/sell volume of {0} that can be carried by the market when the current price changes to the hover price.",values:{0:i.baseTokenSymbol}});case"pool.chart.liquidity-chart-buy":return e._({id:"TvH4Ym",message:"Bought {0} {1}, price in the pool decreased to {2}",values:{0:i.amount,1:i.symbol,2:i.price}});case"pool.chart.liquidity-chart-sell":return e._({id:"0O1wzf",message:"Traders sold {0} {1}, price in the pool increased to {2}",values:{0:i.amount,1:i.symbol,2:i.price}});default:throw new Error(`Unknown key ${t}`)}}const l=12,n=18;function s(e){let t=e.toLowerCase();if(t&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)){if(4===t.length){let e="#";for(let i=1;i<4;i+=1)e+=t.slice(i,i+1).concat(t.slice(i,i+1));t=e}const e=[];for(let i=1;i<7;i+=2)e.push(parseInt(`0x${t.slice(i,i+2)}`));return e.join(",")}return t}function r({val:e,model:i}){let o=e;if(e.isNaN())return{side:"no-one",vert:new t(0),base:new t(0),quote:new t(0)};i.Q0.eq(0)&&e.lt(i.i)&&(o=i.i),i.B0.eq(0)&&e.gt(i.i)&&(o=i.i);const l=i.getPriceDepth(o),n=l.baseAmount,s=l.quoteAmount,{isBuy:r}=l;return{side:r?"ask":"bid",vert:r?n:s,base:n,quote:s}}function a({midPrice:e,q:i,q0:o,pmmModel:l}){let n=t.maximum(i,o,l.B.multipliedBy(e));return n.isNaN()&&(n=new t(10)),n.eq(0)&&(n=new t(1)),{buyBaseVert:n.multipliedBy(1.2),sellBaseVert:n.div(e).multipliedBy(1.2)}}function u(e,i=1){return new t(i).div(e/2)}function m({tooltip:e,x:o,chartWidth:l,chartHeight:n,buyBaseVert:a,sellBaseVert:m,pmmModel:p,midPrice:d,baseTokenSymbol:c,quoteTokenSymbol:h,t:b,baseMinAndZoomMultiples:f,isHover:y,color:g,leftColor:T,rightColor:x}){const{zoomMultiples:v,baseMin:w}=f,k=u(l,v),M=a.div(n),B=m.div(n),q=2*v,S=w.multipliedBy(10**k.multipliedBy(o).toNumber());let N=new t(Math.log(d.div(w).toNumber())/Math.log(10));N=t.minimum(q,N),N=t.maximum(0,N);const P=N.div(k),X=r({val:S,model:p,midPrice:d});if(X.vert.isNaN())return;const A=S.lt(d);let _=n-X.vert.div(M).toNumber();A||(_=n-X.vert.div(B).toNumber());const z=i(S),O=i(X.vert),$=S.minus(d).abs().div(d).multipliedBy(100).toFixed(2),D=P.toNumber(),H=e.findOne("#toolTipVertLine"),L=e.findOne("#toolTipHoriLine"),U=e.findOne("#joinCircle"),V=e.findOne("#toolTip"),j=e.findOne("#priceTextLabel"),W=e.findOne("#slippageTextLabel");if(!V)return;V.x(o),V.y(_-5-6);const Y=V.getText(),F=V.getTag();let I="ask"===X.side?i(X.quote):i(X.base);const Q=p.k.lte(0);Q&&(I=O);const C=i(d),Z={amountText:O,baseTokenSymbol:c,oppositeAmountText:I,quoteTokenSymbol:h,priceText:Q?C:z,slippageText:`${A?"-":"+"}${$}`};if(P.minus(4).lte(o)&&P.plus(2).gte(o)&&y)Y.text(b("depth-chart.tips.mid-price",{amountText:1,baseTokenSymbol:c,oppositeAmountText:C,quoteTokenSymbol:h})),V.x(D),V.y(n/2),null==H||H.hide(),null==L||L.hide(),null==U||U.hide(),null==j||j.hide(),null==W||W.hide();else{Y.text(A?b("depth-chart.tips.buy",{amountText:I,baseTokenSymbol:c,oppositeAmountText:O,quoteTokenSymbol:h,priceText:Q?C:z,slippageText:`${A?"-":"+"}${$}`}):b("depth-chart.tips.sell",Z));const e=g||(A?"#55f6db":"#ff4f73"),t=A?T||"#55f6db":x||"#ff4f73";Y.fill(e),V.width()/2>o?(F.pointerDirection("left"),F.pointerHeight(15),F.pointerWidth(8),V.offsetX(-11),V.offsetY(-11)):V.width()/2+o>l?(F.pointerDirection("right"),F.pointerHeight(15),F.pointerWidth(8),V.offsetX(11),V.offsetY(-11)):(F.pointerDirection("down"),F.pointerHeight(8),F.pointerWidth(15),V.offsetX(0),V.offsetY(0)),null==H||H.points([o,n,o,_]),null==H||H.stroke(t),null==L||L.points(A?[o,_,D,_]:[D,_,o,_]),null==L||L.stroke(t),null==U||U.x(o),null==U||U.y(_),null==U||U.fill(A?T||"rgb(86, 246, 218)":x||"#FF5072"),null==U||U.stroke(A?T?`rgba(${s(T)}, 0.4)`:"rgba(86, 246, 218, 0.3)":x?`rgba(${s(x)}, 0.4)`:"rgba(255, 80, 114, 0.3)"),j&&(j.x(o),j.y(n),j.offsetX(j.width()/2),j.x()-j.width()/2<0?j.x(j.width()/2):j.x()+j.width()/2>l?j.x(l-j.width()/2):j.x(o));const i=null==j?void 0:j.findOne("#priceTextLabel-text");i&&(i.fill(e),i.text(z)),W&&(W.x(A?o+(D-o)/2:o-(o-D)/2),W.y(_),W.offsetY(W.height()/2),W.offsetX(W.width()/2));const r=null==W?void 0:W.findOne("#slippageTextLabel-text");r&&(r.fill(e),r.text(`${A?"-":"+"}${$}%`)),null==H||H.show(),null==L||L.show(),null==U||U.show(),null==j||j.show(),null==W||W.show()}e.show()}function p({dragDistance:e,prevBaseMin:i,chartWidth:o,zoomMultiples:l}){const n=u(o,l);return e>0?i.multipliedBy(1-n.multipliedBy(e).toNumber()):i.multipliedBy(10**n.multipliedBy(new t(e).abs()).plus(0).toNumber())}const d=1;function c({prevZoomMultiples:e,zoomIn:t}){return!t&&e<=.1?e:t?e+.1:e-.1}function h({type:e,targetPrice:i,midPrice:o,width:l}){if("sell"===e){return{zoomMultiples:new t(Math.log10(i.div(o).toNumber())).minus(0).div(3/4).abs(),targetX:l/2*(3/4)+l/2}}const n=new t(Math.log10(i.div(o).toNumber()));return{zoomMultiples:new t(0).minus(n).div(3/4).abs(),targetX:l/2*(1/4)}}function b({currentBaseMinAndZoomMultiples:e,targetPrice:i,midPrice:o,width:l}){const{baseMin:n,zoomMultiples:s}=e,r=new t(Math.log10(n.div(o).toNumber())),a=r.plus(2*s),u=new t(o.multipliedBy(10**a.toNumber()));if(i.gte(n)&&i.lte(u)){return{isSkip:!0,targetX:new t(Math.log10(i.div(o).toNumber())).minus(r).div(2*s).multipliedBy(l).toNumber(),baseMin:new t(0),zoomMultiples:1}}const m=new t(o.multipliedBy(.1)),p=new t(o.multipliedBy(10));if(i.gte(m)&&i.lte(p)){return{isSkip:!1,targetX:new t(Math.log10(i.div(o).toNumber())).minus(-1).div(2).multipliedBy(l).toNumber(),baseMin:m,zoomMultiples:1}}return{isSkip:!1,targetX:-1,baseMin:new t(0),zoomMultiples:1}}function f({midPrice:e,zoomMultiples:t}){return e.multipliedBy(10**-t)}export{a,p as b,u as c,c as d,r as e,f,o as g,n as h,d as i,b as j,h as k,l,s as m,m as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
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,g as o,m as l}from"./helper-
|
|
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,g as o,m as l}from"./helper-DcVtliN6.js";import{Line as a,Text as s,Stage as d,Layer as g,Rect as m,Circle as u,Label as p,Tag as c}from"react-konva";import{j as h,f}from"./index-BxE1IH7P.js";import x from"bignumber.js";import{solveQuadraticFunctionForTarget as L,PMMState as w,PMMHelper as b}from"@dodoex/api";import"@lingui/core";import"@lingui/react";import"@dodoex/components";import"@dodoex/dodo-contract-request";import"identicon.js";import"zustand";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"react-transition-group";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";const A=t.div`
|
|
2
2
|
height: 100%;
|
|
3
3
|
position: relative;
|
|
4
4
|
`,y=t.div`
|