@dodoex/widgets 3.0.2-zetachain.12 → 3.0.2-zetachain.13

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.
@@ -1,1212 +0,0 @@
1
- 'use strict';
2
-
3
- var BigNumber = require('bignumber.js');
4
- var lodash = require('lodash');
5
- var React = require('react');
6
- var styled = require('@emotion/styled');
7
- var react = require('@emotion/react');
8
- var reactKonva = require('react-konva');
9
- var helper = require('./helper-BnoyRpeK.cjs');
10
- var index = require('./index-De8Sa6Av.cjs');
11
- var api = require('@dodoex/api');
12
- require('@lingui/core');
13
- require('@lingui/react');
14
- require('@dodoex/components');
15
- require('@web3-react/core');
16
- require('axios');
17
- require('@ethersproject/bignumber');
18
- require('zustand');
19
- require('@dodoex/dodo-contract-request');
20
- require('@tanstack/react-query');
21
- require('pino');
22
- require('events');
23
- require('node-fetch');
24
- require('@web3-react/eip1193');
25
- require('@web3-react/walletconnect-v2');
26
- require('@web3-react/metamask');
27
- require('@web3-react/types');
28
- require('@ethersproject/contracts');
29
- require('identicon.js');
30
- require('react-dom');
31
- require('dayjs');
32
- require('react-transition-group');
33
- require('@dodoex/contract-request');
34
- require('recharts');
35
- require('react-window');
36
- require('jsbi');
37
- require('tiny-invariant');
38
- require('@ethersproject/units');
39
- require('@uniswap/sdk-core');
40
- require('@uniswap/v2-sdk');
41
- require('react-infinite-scroller');
42
- require('d3');
43
- require('rmc-date-picker');
44
-
45
- var DefaultContext = {
46
- color: undefined,
47
- size: undefined,
48
- className: undefined,
49
- style: undefined,
50
- attr: undefined
51
- };
52
- var IconContext = React.createContext && /*#__PURE__*/React.createContext(DefaultContext);
53
-
54
- var _excluded = ["attr", "size", "title"];
55
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
56
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
57
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
58
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
59
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
60
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
61
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
62
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
63
- function Tree2Element(tree) {
64
- return tree && tree.map((node, i) => /*#__PURE__*/React.createElement(node.tag, _objectSpread({
65
- key: i
66
- }, node.attr), Tree2Element(node.child)));
67
- }
68
- function GenIcon(data) {
69
- // eslint-disable-next-line react/display-name
70
- return props => /*#__PURE__*/React.createElement(IconBase, _extends({
71
- attr: _objectSpread({}, data.attr)
72
- }, props), Tree2Element(data.child));
73
- }
74
- function IconBase(props) {
75
- var elem = conf => {
76
- var {
77
- attr,
78
- size,
79
- title
80
- } = props,
81
- svgProps = _objectWithoutProperties(props, _excluded);
82
- var computedSize = size || conf.size || "1em";
83
- var className;
84
- if (conf.className) className = conf.className;
85
- if (props.className) className = (className ? className + " " : "") + props.className;
86
- return /*#__PURE__*/React.createElement("svg", _extends({
87
- stroke: "currentColor",
88
- fill: "currentColor",
89
- strokeWidth: "0"
90
- }, conf.attr, attr, svgProps, {
91
- className: className,
92
- style: _objectSpread(_objectSpread({
93
- color: props.color || conf.color
94
- }, conf.style), props.style),
95
- height: computedSize,
96
- width: computedSize,
97
- xmlns: "http://www.w3.org/2000/svg"
98
- }), title && /*#__PURE__*/React.createElement("title", null, title), props.children);
99
- };
100
- return IconContext !== undefined ? /*#__PURE__*/React.createElement(IconContext.Consumer, null, conf => elem(conf)) : elem(DefaultContext);
101
- }
102
-
103
- // THIS FILE IS AUTO GENERATED
104
- function BiChevronLeft (props) {
105
- return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24"},"child":[{"tag":"path","attr":{"d":"M13.293 6.293 7.586 12l5.707 5.707 1.414-1.414L10.414 12l4.293-4.293z"},"child":[]}]})(props);
106
- }function BiChevronRight (props) {
107
- return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24"},"child":[{"tag":"path","attr":{"d":"M10.707 17.707 16.414 12l-5.707-5.707-1.414 1.414L13.586 12l-4.293 4.293z"},"child":[]}]})(props);
108
- }function BiMinus (props) {
109
- return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24"},"child":[{"tag":"path","attr":{"d":"M5 11h14v2H5z"},"child":[]}]})(props);
110
- }function BiPlus (props) {
111
- return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24"},"child":[{"tag":"path","attr":{"d":"M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z"},"child":[]}]})(props);
112
- }
113
-
114
- const Input = styled.input`
115
- margin: 4px 10px 4px 6px;
116
- border-radius: 10px;
117
- border: 1px solid #373739;
118
- padding: 4px 9px;
119
- background-color: #1a1a1b;
120
- color: #ffffff;
121
- font-size: 14px;
122
- font-weight: 400;
123
- line-height: 20px;
124
- outline: none;
125
- width: 96px;
126
- &:focus {
127
- border-color: #fff;
128
-
129
- ${({
130
- error
131
- }) => error && react.css`
132
- border-color: red;
133
- `}
134
- }
135
- `;
136
-
137
- /**
138
- * 防止鼠标在图上滚动滚轮时页面上下滑动
139
- * @param param0
140
- */
141
- const usePreventWheel = ({
142
- id
143
- }) => {
144
- React.useEffect(() => {
145
- function handleWheelEvt(event) {
146
- event.preventDefault();
147
- }
148
- // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
149
- let passiveSupported = false;
150
- try {
151
- const options = {
152
- get passive() {
153
- // This function will be called when the browser
154
- // attempts to access the passive property.
155
- passiveSupported = true;
156
- return false;
157
- }
158
- };
159
- // eslint-disable-next-line @typescript-eslint/no-empty-function
160
- window.addEventListener('test', () => {}, options);
161
- // eslint-disable-next-line @typescript-eslint/no-empty-function
162
- window.removeEventListener('test', () => {});
163
- } catch (err) {
164
- passiveSupported = false;
165
- }
166
- const container = document.getElementById(id);
167
- // https://github.com/inuyaksa/jquery.nicescroll/issues/799
168
- const options = passiveSupported ? {
169
- passive: false
170
- } : false;
171
- container === null || container === void 0 ? void 0 : container.addEventListener('wheel', handleWheelEvt, options);
172
- return () => {
173
- container === null || container === void 0 ? void 0 : container.removeEventListener('wheel', handleWheelEvt);
174
- };
175
- }, [id]);
176
- };
177
-
178
- function useDepthLinePoints({
179
- chartHeight,
180
- chartWidth,
181
- midPrice,
182
- xPoints,
183
- pmmModel,
184
- baseMinAndZoomMultiples,
185
- buyYPortion,
186
- sellYPortion
187
- }) {
188
- return React.useMemo(() => {
189
- const quoteLinePoints = [];
190
- const baseLinePoints = [];
191
- const midPriceLinePoints = [];
192
- const {
193
- baseMin,
194
- zoomMultiples
195
- } = baseMinAndZoomMultiples;
196
- const xPortion = helper.computeXPortion(chartWidth, zoomMultiples);
197
- // 1 -> 10 -> 100 index increases from 0 to 2
198
- // If the minimum value on the left is not midPrice/10, the existing calculation method is to calculate the maximum value based on the minimum value and multiply by 10^2
199
- const multiplesNum = zoomMultiples * 2;
200
- const step = new BigNumber(multiplesNum).div(xPoints);
201
- // The position of the middle price
202
- let midPriceN = new BigNumber(Math.log(midPrice.div(baseMin).toNumber()) / Math.log(10));
203
- midPriceN = BigNumber.minimum(multiplesNum, midPriceN);
204
- midPriceN = BigNumber.maximum(0, midPriceN);
205
- for (let i = new BigNumber(0); i.lte(midPriceN);) {
206
- const price = baseMin.multipliedBy(10 ** i.toNumber());
207
- const result = helper.evalPoint({
208
- val: price,
209
- model: pmmModel,
210
- midPrice
211
- });
212
- if (!result.vert.isNaN()) {
213
- const x = i.div(xPortion).toNumber();
214
- const y = chartHeight - result.vert.div(buyYPortion).toNumber();
215
- quoteLinePoints.push(x, y);
216
- }
217
- i = i.plus(step);
218
- }
219
- for (let i = midPriceN; i.lte(multiplesNum);) {
220
- const price = baseMin.multipliedBy(10 ** i.toNumber());
221
- const result = helper.evalPoint({
222
- val: price,
223
- model: pmmModel,
224
- midPrice
225
- });
226
- if (!result.vert.isNaN()) {
227
- const x = i.div(xPortion).toNumber();
228
- const y = chartHeight - result.vert.div(sellYPortion).toNumber();
229
- baseLinePoints.push(x, y);
230
- }
231
- i = i.plus(step);
232
- }
233
- const midPriceX = midPriceN.div(xPortion).toNumber();
234
- const [, firstY] = quoteLinePoints;
235
- // k === 0 means selling coins at a constant price. The curve is two horizontal lines and requires special processing.
236
- const isZeroK = pmmModel.k.eq(0);
237
- if (isZeroK) {
238
- quoteLinePoints.push(midPriceX, firstY || chartHeight);
239
- }
240
- quoteLinePoints.push(midPriceX, chartHeight);
241
- midPriceLinePoints.push(midPriceX, chartHeight, midPriceX, 0);
242
- const maxResult = helper.evalPoint({
243
- val: baseMin.multipliedBy(10 ** multiplesNum),
244
- model: pmmModel,
245
- midPrice
246
- });
247
- let maxHeightY = chartHeight;
248
- const maxHeightX = new BigNumber(multiplesNum).div(xPortion).toNumber();
249
- if (!maxResult.vert.isNaN()) {
250
- maxHeightY = chartHeight - maxResult.vert.div(sellYPortion).toNumber();
251
- }
252
- if (isZeroK && baseLinePoints.length >= 2) {
253
- baseLinePoints.unshift(midPriceX, maxHeightY);
254
- baseLinePoints.unshift(midPriceX, chartHeight);
255
- }
256
- baseLinePoints.push(maxHeightX, maxHeightY);
257
- // The left side has been dragged to the left side of baseMin
258
- if (midPriceN.lte(0)) {
259
- baseLinePoints.unshift(0, chartHeight);
260
- }
261
- return {
262
- quoteLinePoints,
263
- quoteLineAreaPoints: [0, chartHeight, 0, firstY, ...quoteLinePoints],
264
- quoteLineAreaLinearGradientEndPointY: firstY,
265
- baseLinePoints,
266
- baseLineAreaPoints: [...baseLinePoints, maxHeightX, chartHeight],
267
- baseLineAreaLinearGradientEndPointY: maxHeightY,
268
- midPriceLinePoints
269
- };
270
- }, [baseMinAndZoomMultiples, chartWidth, xPoints, midPrice, pmmModel, chartHeight, buyYPortion, sellYPortion]);
271
- }
272
-
273
- function useGridLinePoints({
274
- chartHeight,
275
- chartWidth,
276
- horizontalLineCount,
277
- verticalLineCount
278
- }) {
279
- return React.useMemo(() => {
280
- const horizontalGridLines = [];
281
- const horizontalGridPerBlockHeight = chartHeight / (horizontalLineCount + 1);
282
- const verticalGridLines = [];
283
- const verticalGridPerBlockWidth = chartWidth / verticalLineCount;
284
- for (let index = 0; index < horizontalLineCount; index++) {
285
- const y = horizontalGridPerBlockHeight * (index + 1);
286
- horizontalGridLines.push([0, y, chartWidth, y]);
287
- }
288
- for (let index = 0; index < verticalLineCount; index++) {
289
- const x = verticalGridPerBlockWidth * index + verticalGridPerBlockWidth / 2;
290
- verticalGridLines.push([x, 0, x, chartHeight]);
291
- }
292
- return {
293
- horizontalGridLines,
294
- verticalGridLines
295
- };
296
- }, [chartHeight, chartWidth, horizontalLineCount, verticalLineCount]);
297
- }
298
-
299
- function useHorizontalLabelPoints({
300
- chartHeight,
301
- chartWidth,
302
- xAxisPoints,
303
- oneXPx,
304
- baseMinAndZoomMultiples
305
- }) {
306
- return React.useMemo(() => {
307
- const xPortion = helper.computeXPortion(chartWidth, baseMinAndZoomMultiples.zoomMultiples);
308
- const horizontalLabelTickPoints = [];
309
- const horizontalLabelTextPoints = [];
310
- for (let i = 0; i < xAxisPoints; i++) {
311
- horizontalLabelTickPoints.push([i * oneXPx + oneXPx / 2, chartHeight, i * oneXPx + oneXPx / 2, chartHeight + 4]);
312
- const power = xPortion.multipliedBy(i).multipliedBy(oneXPx).plus(xPortion.multipliedBy(oneXPx / 2)).toNumber();
313
- const axisNum = baseMinAndZoomMultiples.baseMin.multipliedBy(10 ** power);
314
- const x = i * oneXPx;
315
- const y = chartHeight + 2 + 4;
316
- const text = index.formatShortNumber(axisNum);
317
- horizontalLabelTextPoints.push({
318
- x,
319
- y,
320
- text
321
- });
322
- }
323
- return {
324
- horizontalLabelTickPoints,
325
- horizontalLabelTextPoints
326
- };
327
- }, [baseMinAndZoomMultiples.baseMin, baseMinAndZoomMultiples.zoomMultiples, chartHeight, chartWidth, oneXPx, xAxisPoints]);
328
- }
329
-
330
- const bgColor = 'rgba(38, 39, 41, 0.3)';
331
- // toolTip the height of the arrow
332
- const toolTipPointerHeight = 8;
333
- const toolTipPointerWidth = 15;
334
- const xAxisHight = 18;
335
- const xPoints = 50;
336
- /** The number of horizontal axis scales or the number of vertical grid lines */
337
- const xAxisPoints = 7;
338
- // Number of horizontal grid lines
339
- const horizontalLineCount = 9;
340
- function DepthChartKonva({
341
- width,
342
- height,
343
- midPrice,
344
- pmmModel,
345
- params,
346
- baseTokenSymbol,
347
- quoteTokenSymbol,
348
- baseMinAndZoomMultiples,
349
- colorMap,
350
- setBaseMinAndZoomMultiples
351
- }) {
352
- const colorMapRes = lodash.merge({
353
- grid: '#2A2A2D',
354
- midPriceLine: '#313335',
355
- leftBg: [0, bgColor, 1, '#31645d'],
356
- leftLine: '#55f6db',
357
- leftColor: '',
358
- rightBg: [0, bgColor, 1, '#67303d'],
359
- rightLine: '#ff4f73',
360
- rightColor: '',
361
- tooltipBg: '#121212',
362
- tooltipColor: undefined
363
- }, colorMap);
364
- const chartWidth = width;
365
- const chartHeight = height - xAxisHight;
366
- const oneXPx = chartWidth / xAxisPoints;
367
- const {
368
- buyBaseVert,
369
- sellBaseVert
370
- } = helper.computeBaseVert({
371
- midPrice,
372
- q: params.q,
373
- q0: params.q0,
374
- pmmModel
375
- });
376
- const buyYPortion = buyBaseVert.div(chartHeight);
377
- const sellYPortion = sellBaseVert.div(chartHeight);
378
- const tooltipRef = React.useRef(null);
379
- const stageRef = React.useRef(null);
380
- const {
381
- current: tooltip
382
- } = tooltipRef;
383
- const dragStartXRef = React.useRef(0);
384
- const pointerXRef = React.useRef();
385
- const {
386
- horizontalGridLines,
387
- verticalGridLines
388
- } = useGridLinePoints({
389
- chartHeight,
390
- chartWidth,
391
- horizontalLineCount,
392
- verticalLineCount: xAxisPoints
393
- });
394
- const {
395
- horizontalLabelTickPoints,
396
- horizontalLabelTextPoints
397
- } = useHorizontalLabelPoints({
398
- chartHeight,
399
- chartWidth,
400
- xAxisPoints,
401
- oneXPx,
402
- baseMinAndZoomMultiples
403
- });
404
- const {
405
- quoteLinePoints,
406
- quoteLineAreaPoints,
407
- quoteLineAreaLinearGradientEndPointY,
408
- baseLinePoints,
409
- baseLineAreaPoints,
410
- baseLineAreaLinearGradientEndPointY,
411
- midPriceLinePoints
412
- } = useDepthLinePoints({
413
- chartHeight,
414
- chartWidth,
415
- midPrice,
416
- xPoints,
417
- pmmModel,
418
- baseMinAndZoomMultiples,
419
- buyYPortion,
420
- sellYPortion
421
- });
422
- const handleMouseover = evt => {
423
- var _a;
424
- const node = evt.target;
425
- if (node && tooltip) {
426
- // update tooltip
427
- const mousePos = (_a = node.getStage()) === null || _a === void 0 ? void 0 : _a.getPointerPosition();
428
- if (mousePos) {
429
- const {
430
- x
431
- } = mousePos;
432
- if (x > chartWidth) {
433
- tooltip.hide();
434
- return;
435
- }
436
- helper.updateTooltip({
437
- x,
438
- tooltip,
439
- buyBaseVert,
440
- sellBaseVert,
441
- chartWidth,
442
- chartHeight,
443
- midPrice,
444
- pmmModel,
445
- baseTokenSymbol,
446
- quoteTokenSymbol,
447
- baseMinAndZoomMultiples,
448
- t: helper.chartT,
449
- isHover: true,
450
- color: colorMapRes.tooltipColor,
451
- leftColor: colorMapRes.leftLine,
452
- rightColor: colorMapRes.rightLine
453
- });
454
- }
455
- }
456
- };
457
- const handleMouseOut = () => {
458
- if (tooltip) {
459
- tooltip.hide();
460
- }
461
- };
462
- const updateWhenDrag = React.useMemo(() => lodash.throttle(evt => {
463
- const {
464
- target
465
- } = evt;
466
- const stage = target.getStage();
467
- if (stage) {
468
- stage.container().style.cursor = 'grabbing';
469
- const mousePos = stage === null || stage === void 0 ? void 0 : stage.getPointerPosition();
470
- if (mousePos) {
471
- const dragDistance = mousePos.x - dragStartXRef.current;
472
- dragStartXRef.current = mousePos.x;
473
- pointerXRef.current = mousePos.x;
474
- setBaseMinAndZoomMultiples(prev => {
475
- if (prev.baseMin === undefined) {
476
- return prev;
477
- }
478
- return {
479
- baseMin: helper.computeBaseMinByDistance({
480
- dragDistance,
481
- prevBaseMin: prev.baseMin,
482
- chartWidth,
483
- zoomMultiples: prev.zoomMultiples
484
- }),
485
- zoomMultiples: prev.zoomMultiples,
486
- targetMarginPriceX: 0
487
- };
488
- });
489
- }
490
- }
491
- }, 100), [chartWidth, setBaseMinAndZoomMultiples]);
492
- const updateWhenWheel = React.useMemo(() => lodash.throttle(event => {
493
- // eslint-disable-next-line no-param-reassign
494
- event.cancelBubble = true;
495
- event.evt.preventDefault();
496
- // scroll up
497
- const isScrollUp = event.evt.deltaY < 0;
498
- setBaseMinAndZoomMultiples(prev => {
499
- const newZoomMultiples = helper.computeZoomMultiplesWhenZoom({
500
- zoomIn: isScrollUp,
501
- prevZoomMultiples: prev.zoomMultiples
502
- });
503
- return {
504
- baseMin: helper.computeBaseAfterZoom({
505
- midPrice,
506
- zoomMultiples: newZoomMultiples
507
- }),
508
- zoomMultiples: newZoomMultiples,
509
- targetMarginPriceX: prev.targetMarginPriceX
510
- };
511
- });
512
- }, 100), [midPrice, setBaseMinAndZoomMultiples]);
513
- React.useEffect(() => {
514
- if (baseMinAndZoomMultiples.targetMarginPriceX > 0 && tooltip !== null) {
515
- helper.updateTooltip({
516
- x: baseMinAndZoomMultiples.targetMarginPriceX,
517
- tooltip,
518
- buyBaseVert,
519
- sellBaseVert,
520
- chartWidth,
521
- chartHeight,
522
- midPrice,
523
- pmmModel,
524
- baseTokenSymbol,
525
- quoteTokenSymbol,
526
- baseMinAndZoomMultiples,
527
- t: helper.chartT,
528
- color: colorMapRes.tooltipColor,
529
- leftColor: colorMapRes.leftLine,
530
- rightColor: colorMapRes.rightLine
531
- });
532
- return;
533
- }
534
- if (pointerXRef.current !== undefined && tooltip !== null) {
535
- helper.updateTooltip({
536
- x: pointerXRef.current,
537
- tooltip,
538
- buyBaseVert,
539
- sellBaseVert,
540
- chartWidth,
541
- chartHeight,
542
- midPrice,
543
- pmmModel,
544
- baseTokenSymbol,
545
- quoteTokenSymbol,
546
- baseMinAndZoomMultiples,
547
- t: helper.chartT,
548
- isHover: true,
549
- color: colorMapRes.tooltipColor,
550
- leftColor: colorMapRes.leftLine,
551
- rightColor: colorMapRes.rightLine
552
- });
553
- }
554
- }, [baseMinAndZoomMultiples, baseTokenSymbol, buyBaseVert, chartHeight, chartWidth, colorMapRes.leftLine, colorMapRes.rightLine, colorMapRes.tooltipColor, midPrice, pmmModel, quoteTokenSymbol, sellBaseVert, tooltip]);
555
- return /*#__PURE__*/index.jsxRuntimeExports.jsxs(reactKonva.Stage, {
556
- ref: stageRef,
557
- width: width,
558
- offsetY: -helper.chartOffsetYBCToolTip,
559
- height: height + helper.chartOffsetYBCToolTip,
560
- draggable: true,
561
- dragBoundFunc: function () {
562
- return {
563
- x: this.absolutePosition().x,
564
- y: this.absolutePosition().y
565
- };
566
- },
567
- onMouseMove: handleMouseover,
568
- onMouseOver: handleMouseover,
569
- onMouseOut: handleMouseOut,
570
- onDragStart: function (evt) {
571
- const {
572
- target
573
- } = evt;
574
- const stage = target.getStage();
575
- if (stage) {
576
- const mousePos = stage.getPointerPosition();
577
- if (mousePos) {
578
- dragStartXRef.current = mousePos.x;
579
- }
580
- }
581
- },
582
- onDragMove: updateWhenDrag,
583
- onDragEnd: evt => {
584
- const {
585
- target
586
- } = evt;
587
- const stage = target.getStage();
588
- if (stage) {
589
- stage.container().style.cursor = 'pointer';
590
- }
591
- },
592
- onWheel: updateWhenWheel,
593
- children: [/*#__PURE__*/index.jsxRuntimeExports.jsxs(reactKonva.Layer, {
594
- children: [/*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Rect, {
595
- x: 0,
596
- y: 0,
597
- width: width,
598
- height: chartHeight,
599
- stroke: colorMapRes.grid,
600
- strokeWidth: 1
601
- }), horizontalGridLines.map((points, index$1) => /*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Line, {
602
- points: points,
603
- stroke: colorMapRes.grid,
604
- strokeWidth: 1,
605
- lineCap: "round",
606
- lineJoin: "round",
607
- listening: false
608
- }, index$1)), verticalGridLines.map((points, index$1) => /*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Line, {
609
- points: points,
610
- stroke: colorMapRes.grid,
611
- strokeWidth: 1,
612
- lineCap: "round",
613
- lineJoin: "round",
614
- listening: false
615
- }, index$1)), horizontalLabelTickPoints.map((tickPoints, index$1) => /*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Line, {
616
- points: tickPoints,
617
- stroke: "#9d9d9d",
618
- strokeWidth: 1,
619
- lineCap: "round",
620
- lineJoin: "round",
621
- listening: false
622
- }, index$1)), horizontalLabelTextPoints.map((textPoint, index$1) => /*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Text, {
623
- x: textPoint.x,
624
- y: textPoint.y,
625
- text: textPoint.text,
626
- fontFamily: "Manrope",
627
- fontSize: 12,
628
- fill: "#9d9d9d",
629
- width: oneXPx,
630
- padding: 0,
631
- align: "center",
632
- verticalAlign: "bottom",
633
- listening: false
634
- }, index$1)), /*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Line, {
635
- points: quoteLineAreaPoints,
636
- closed: true,
637
- listening: false,
638
- lineCap: "round",
639
- lineJoin: "round",
640
- fillLinearGradientStartPoint: {
641
- x: 0,
642
- y: chartHeight
643
- },
644
- fillLinearGradientEndPoint: {
645
- x: 0,
646
- y: quoteLineAreaLinearGradientEndPointY
647
- },
648
- fillLinearGradientColorStops: colorMapRes.leftBg
649
- }), /*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Line, {
650
- points: quoteLinePoints,
651
- stroke: colorMapRes.leftLine,
652
- strokeWidth: 2,
653
- lineCap: "round",
654
- lineJoin: "round",
655
- listening: false
656
- }), /*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Line, {
657
- points: baseLineAreaPoints,
658
- closed: true,
659
- listening: false,
660
- lineCap: "round",
661
- lineJoin: "round",
662
- fillLinearGradientStartPoint: {
663
- x: chartWidth,
664
- y: chartHeight
665
- },
666
- fillLinearGradientEndPoint: {
667
- x: chartWidth,
668
- y: baseLineAreaLinearGradientEndPointY
669
- },
670
- fillLinearGradientColorStops: colorMapRes.rightBg
671
- }), /*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Line, {
672
- points: baseLinePoints,
673
- stroke: colorMapRes.rightLine,
674
- strokeWidth: 2,
675
- lineCap: "round",
676
- lineJoin: "round",
677
- listening: false
678
- }), /*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Line, {
679
- points: midPriceLinePoints,
680
- stroke: colorMapRes.midPriceLine,
681
- strokeWidth: 2,
682
- lineCap: "round",
683
- lineJoin: "round",
684
- listening: false
685
- })]
686
- }), /*#__PURE__*/index.jsxRuntimeExports.jsxs(reactKonva.Layer, {
687
- ref: tooltipRef,
688
- visible: false,
689
- listening: false,
690
- children: [/*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Line, {
691
- points: [],
692
- stroke: "#ff4f73",
693
- strokeWidth: 1,
694
- lineCap: "round",
695
- lineJoin: "round",
696
- dash: [4, 6],
697
- id: "toolTipVertLine"
698
- }), /*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Line, {
699
- points: [],
700
- stroke: "ff4f73",
701
- strokeWidth: 1,
702
- lineCap: "round",
703
- lineJoin: "round",
704
- dash: [4, 6],
705
- id: "toolTipHoriLine"
706
- }), /*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Circle, {
707
- x: 0,
708
- y: 0,
709
- radius: 5,
710
- fill: "#FF5072",
711
- stroke: "rgba(255, 80, 114, 0.3)",
712
- strokeWidth: 12,
713
- id: "joinCircle"
714
- }), /*#__PURE__*/index.jsxRuntimeExports.jsxs(reactKonva.Label, {
715
- x: 0,
716
- y: 0,
717
- id: "priceTextLabel",
718
- children: [/*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Tag, {
719
- fill: colorMapRes.tooltipBg,
720
- id: "priceTextLabel-tag"
721
- }), /*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Text, {
722
- text: "",
723
- fontSize: 12,
724
- fontFamily: "Manrope",
725
- padding: 4,
726
- fill: "#FF5072",
727
- id: "priceTextLabel-text"
728
- })]
729
- }), /*#__PURE__*/index.jsxRuntimeExports.jsxs(reactKonva.Label, {
730
- x: 0,
731
- y: 0,
732
- id: "slippageTextLabel",
733
- children: [/*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Tag, {
734
- fill: colorMapRes.tooltipBg,
735
- id: "slippageTextLabel-tag"
736
- }), /*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Text, {
737
- text: "",
738
- fontSize: 12,
739
- fontFamily: "Manrope",
740
- padding: 4,
741
- fill: "#FF5072",
742
- id: "slippageTextLabel-text"
743
- })]
744
- }), /*#__PURE__*/index.jsxRuntimeExports.jsxs(reactKonva.Label, {
745
- x: 0,
746
- y: 0,
747
- id: "toolTip",
748
- children: [/*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Tag, {
749
- fill: colorMapRes.tooltipBg,
750
- pointerDirection: "down",
751
- pointerWidth: toolTipPointerWidth,
752
- pointerHeight: toolTipPointerHeight,
753
- cornerRadius: toolTipPointerHeight,
754
- lineJoin: "round",
755
- id: "toolTip-tag"
756
- }), /*#__PURE__*/index.jsxRuntimeExports.jsx(reactKonva.Text, {
757
- text: "-",
758
- fontSize: 12,
759
- lineHeight: 17 / 12,
760
- padding: helper.labelPadding,
761
- fontFamily: "Manrope",
762
- fill: "#FFFFFF",
763
- id: "toolTip-text"
764
- })]
765
- })]
766
- })]
767
- });
768
- }
769
-
770
- const BaseButton = styled.button`
771
- margin: 0;
772
- border: none;
773
- padding: 0;
774
- background: none;
775
-
776
- &:focus {
777
- outline: none;
778
- }
779
- &:active {
780
- outline: none;
781
- }
782
- `;
783
-
784
- const Container = styled.div`
785
- height: 100%;
786
- `;
787
- const AmountInputContainer = styled.div`
788
- display: flex;
789
- align-items: center;
790
- `;
791
- const InputSectionWrapper = styled.div`
792
- border: 1px solid ${({
793
- borderColor
794
- }) => borderColor || '#2a2a2d'};
795
- flex: 1 0 50%;
796
-
797
- display: flex;
798
- align-items: center;
799
- justify-content: center;
800
- font-size: 12px;
801
- font-weight: 400;
802
- line-height: 17px;
803
- color: #606066;
804
-
805
- & + & {
806
- border-left: none;
807
- }
808
- `;
809
- const PriceImpactWrapper = styled.span`
810
- color: #85858d;
811
- `;
812
- const OptButtonGroup = styled.div`
813
- margin-top: 20px;
814
- display: flex;
815
- justify-content: center;
816
- margin-bottom: 9px;
817
- `;
818
- const OptButton = styled(BaseButton)`
819
- border-radius: 13px;
820
- background-color: #373739;
821
- width: 24px;
822
- height: 24px;
823
- font-size: 18px;
824
- color: #85858d;
825
- line-height: 0;
826
- & + & {
827
- margin-left: 10px;
828
- }
829
- &:first-child,
830
- &:last-child {
831
- font-size: 20px;
832
- }
833
-
834
- &:hover {
835
- color: #fff;
836
- }
837
- `;
838
-
839
- /**
840
- * Calculate marginPrice for buying or selling target baseToken
841
- * @param param0
842
- * @returns
843
- */
844
- function computeMarginPrice({
845
- params,
846
- target,
847
- isBuy = true
848
- }) {
849
- const b = new BigNumber(params.b);
850
- const q = new BigNumber(params.q);
851
- let b0 = new BigNumber(params.b0);
852
- const q0 = new BigNumber(params.q0);
853
- const i = new BigNumber(params.i);
854
- const k = new BigNumber(params.k);
855
- const {
856
- R
857
- } = params;
858
- // When created, b0 is equal to b, and a b0 needs to be calculated.
859
- if (R === 1 && b0.eq(b)) {
860
- b0 = api.solveQuadraticFunctionForTarget(b, q.minus(q0), new BigNumber(1).div(i), k);
861
- }
862
- const newB = isBuy ? b.plus(target) : b.minus(target);
863
- if (newB.lt(b0) || b.eq(b0)) {
864
- // b < b0: The shortage of baseToken corresponds to the user buying baseToken. At this time, the quoteToken in the pool is higher than the regression target; the price curve is directly used to calculate the marginal price.
865
- let r = b0.multipliedBy(b0).div(newB).div(newB);
866
- r = new BigNumber(1).minus(k).plus(k.multipliedBy(r));
867
- return i.multipliedBy(r);
868
- }
869
- // There is a shortage of quoteToken, which corresponds to the user selling baseToken, causing the number of quoteTokens in the pool to be lower than the return target at this time; the parameter target is the number of baseTokens sold by the user, and it is necessary to calculate the number of quoteTokens obtained after selling based on this value, that is, the user How many quoteTokens are obtained; then put this value into the price curve equation to calculate the marginal price.
870
- const pmm = new api.PMMModel();
871
- pmm.RStatus = R;
872
- pmm.B = b;
873
- pmm.B0 = b0;
874
- pmm.Q = q;
875
- pmm.Q0 = q0;
876
- pmm.i = i;
877
- pmm.k = k;
878
- pmm.mtFeeRate = new BigNumber(0);
879
- pmm.lpFeeRate = new BigNumber(0);
880
- let getAmount = new BigNumber(0);
881
- if (isBuy) {
882
- getAmount = pmm.querySellBase(target);
883
- } else {
884
- getAmount = pmm.queryBuyBase(target);
885
- }
886
- const deltaQ = isBuy ? q.minus(getAmount) : q.plus(getAmount);
887
- let r = q0.multipliedBy(q0).div(deltaQ).div(deltaQ);
888
- r = new BigNumber(1).minus(k).plus(k.multipliedBy(r));
889
- return i.div(r);
890
- }
891
- /**
892
- * Calculate the margin price for selling target baseTokens
893
- */
894
- function computeSellMarginPrice({
895
- params,
896
- target
897
- }) {
898
- return computeMarginPrice({
899
- params,
900
- target,
901
- isBuy: false
902
- });
903
- }
904
-
905
- const DepthChart = ({
906
- chartId,
907
- width = 834,
908
- height = 460,
909
- baseTokenSymbol,
910
- quoteTokenSymbol,
911
- pmmModel,
912
- pmmParams,
913
- midPrice = new BigNumber(0),
914
- colorMap,
915
- notShowAmountInput
916
- }) => {
917
- usePreventWheel({
918
- id: chartId
919
- });
920
- const [buyAmount, setBuyAmount] = React.useState('');
921
- const [sellAmount, setSellAmount] = React.useState('');
922
- const [buyImpact, setBuyImpact] = React.useState('-');
923
- const [sellImpact, setSellImpact] = React.useState('-');
924
- // 横轴起点和缩放比例同时变化,变化也会引起价格冲击点变化
925
- const [baseMinAndZoomMultiples, setBaseMinAndZoomMultiples] = React.useState({
926
- baseMin: new BigNumber(0),
927
- zoomMultiples: helper.baseZoomMultiples,
928
- targetMarginPriceX: 0
929
- });
930
- React.useEffect(() => {
931
- if (midPrice !== undefined) {
932
- setBaseMinAndZoomMultiples(prev => {
933
- return {
934
- baseMin: helper.computeBaseAfterZoom({
935
- midPrice,
936
- zoomMultiples: prev.zoomMultiples
937
- }),
938
- zoomMultiples: prev.zoomMultiples,
939
- targetMarginPriceX: prev.targetMarginPriceX
940
- };
941
- });
942
- }
943
- }, [midPrice]);
944
- const amountOnChange = React.useMemo(() => lodash.debounce(({
945
- type,
946
- amount
947
- }) => {
948
- if (amount === '' && midPrice) {
949
- setBaseMinAndZoomMultiples({
950
- baseMin: helper.computeBaseAfterZoom({
951
- midPrice,
952
- zoomMultiples: helper.baseZoomMultiples
953
- }),
954
- zoomMultiples: helper.baseZoomMultiples,
955
- targetMarginPriceX: 0
956
- });
957
- if (type === 'buy') {
958
- setBuyImpact('-');
959
- } else {
960
- setSellImpact('-');
961
- }
962
- }
963
- const amountB = new BigNumber(amount);
964
- if (amountB.lte(0) || amountB.isNaN() || !(pmmParams === null || pmmParams === void 0 ? void 0 : pmmParams.b) || amountB.gte(pmmParams.b) || !midPrice) {
965
- return;
966
- }
967
- if (type === 'buy') {
968
- const marginPrice = computeMarginPrice({
969
- params: pmmParams,
970
- target: amountB
971
- });
972
- setBaseMinAndZoomMultiples(prev => {
973
- const impactResult = helper.beforePriceImpactEffect({
974
- currentBaseMinAndZoomMultiples: prev,
975
- targetPrice: marginPrice,
976
- midPrice,
977
- width
978
- });
979
- if (impactResult.isSkip) {
980
- return {
981
- baseMin: prev.baseMin,
982
- zoomMultiples: prev.zoomMultiples,
983
- targetMarginPriceX: impactResult.targetX
984
- };
985
- }
986
- if (impactResult.targetX > 0) {
987
- return {
988
- baseMin: impactResult.baseMin,
989
- zoomMultiples: impactResult.zoomMultiples,
990
- targetMarginPriceX: impactResult.targetX
991
- };
992
- }
993
- const result = helper.computeTargetXByTargetPrice({
994
- midPrice,
995
- width,
996
- type,
997
- targetPrice: marginPrice
998
- });
999
- const newZoomMultiples = result.zoomMultiples.dp(6).toNumber();
1000
- return {
1001
- baseMin: helper.computeBaseAfterZoom({
1002
- midPrice,
1003
- zoomMultiples: newZoomMultiples
1004
- }),
1005
- zoomMultiples: newZoomMultiples,
1006
- targetMarginPriceX: result.targetX
1007
- };
1008
- });
1009
- // console.log(
1010
- // 'v2 marginPrice',
1011
- // amountB.toFixed(6),
1012
- // marginPrice.toFixed(6),
1013
- // result.targetX,
1014
- // result.zoomMultiples.toFixed(6),
1015
- // );
1016
- setBuyImpact(`${index.formatPercentageNumber({
1017
- input: marginPrice.minus(midPrice).div(midPrice)
1018
- })}`);
1019
- } else {
1020
- const marginPrice = computeSellMarginPrice({
1021
- params: pmmParams,
1022
- target: amountB
1023
- });
1024
- setBaseMinAndZoomMultiples(prev => {
1025
- const impactResult = helper.beforePriceImpactEffect({
1026
- currentBaseMinAndZoomMultiples: prev,
1027
- targetPrice: marginPrice,
1028
- midPrice,
1029
- width
1030
- });
1031
- if (impactResult.isSkip) {
1032
- return {
1033
- baseMin: prev.baseMin,
1034
- zoomMultiples: prev.zoomMultiples,
1035
- targetMarginPriceX: impactResult.targetX
1036
- };
1037
- }
1038
- if (impactResult.targetX > 0) {
1039
- return {
1040
- baseMin: impactResult.baseMin,
1041
- zoomMultiples: impactResult.zoomMultiples,
1042
- targetMarginPriceX: impactResult.targetX
1043
- };
1044
- }
1045
- const result = helper.computeTargetXByTargetPrice({
1046
- midPrice,
1047
- width,
1048
- type,
1049
- targetPrice: marginPrice
1050
- });
1051
- const newZoomMultiples = result.zoomMultiples.dp(6).toNumber();
1052
- return {
1053
- baseMin: helper.computeBaseAfterZoom({
1054
- midPrice,
1055
- zoomMultiples: newZoomMultiples
1056
- }),
1057
- zoomMultiples: newZoomMultiples,
1058
- targetMarginPriceX: result.targetX
1059
- };
1060
- });
1061
- setSellImpact(`+${index.formatPercentageNumber({
1062
- input: marginPrice.minus(midPrice).div(midPrice)
1063
- })}`);
1064
- }
1065
- }, 300), [pmmParams, midPrice, width]);
1066
- React.useEffect(() => {
1067
- if (buyAmount !== undefined) {
1068
- amountOnChange({
1069
- type: 'buy',
1070
- amount: buyAmount
1071
- });
1072
- }
1073
- }, [amountOnChange, buyAmount]);
1074
- React.useEffect(() => {
1075
- if (sellAmount !== undefined) {
1076
- amountOnChange({
1077
- type: 'sell',
1078
- amount: sellAmount
1079
- });
1080
- }
1081
- }, [amountOnChange, sellAmount]);
1082
- const handleDragButtonMouseDown = moveLeft => {
1083
- let dragDistance = 0;
1084
- if (moveLeft) {
1085
- dragDistance = -(width * 0.1);
1086
- } else {
1087
- dragDistance = width * 0.1;
1088
- }
1089
- setBaseMinAndZoomMultiples(prev => {
1090
- if (prev.baseMin === undefined) {
1091
- return prev;
1092
- }
1093
- return {
1094
- baseMin: helper.computeBaseMinByDistance({
1095
- dragDistance,
1096
- prevBaseMin: prev.baseMin,
1097
- chartWidth: width,
1098
- zoomMultiples: prev.zoomMultiples
1099
- }),
1100
- zoomMultiples: prev.zoomMultiples,
1101
- targetMarginPriceX: prev.targetMarginPriceX
1102
- };
1103
- });
1104
- };
1105
- const handleZoomButtonMouseDown = zoomIn => {
1106
- setBaseMinAndZoomMultiples(prev => {
1107
- const newZoomMultiples = helper.computeZoomMultiplesWhenZoom({
1108
- zoomIn: zoomIn !== null && zoomIn !== void 0 ? zoomIn : false,
1109
- prevZoomMultiples: prev.zoomMultiples
1110
- });
1111
- return {
1112
- baseMin: helper.computeBaseAfterZoom({
1113
- midPrice,
1114
- zoomMultiples: newZoomMultiples
1115
- }),
1116
- zoomMultiples: newZoomMultiples,
1117
- targetMarginPriceX: prev.targetMarginPriceX
1118
- };
1119
- });
1120
- };
1121
- const buyInputError = React.useMemo(() => {
1122
- if (buyAmount === '') {
1123
- return false;
1124
- }
1125
- const amountB = new BigNumber(buyAmount);
1126
- if (amountB.lte(0) || amountB.isNaN() || !(pmmParams === null || pmmParams === void 0 ? void 0 : pmmParams.b) || amountB.gte(pmmParams.b)) {
1127
- return true;
1128
- }
1129
- return false;
1130
- }, [buyAmount, pmmParams]);
1131
- const sellInputError = React.useMemo(() => {
1132
- if (sellAmount === '') {
1133
- return false;
1134
- }
1135
- const amountB = new BigNumber(sellAmount);
1136
- if (amountB.lte(0) || amountB.isNaN() || !(pmmParams === null || pmmParams === void 0 ? void 0 : pmmParams.b) || amountB.gte(pmmParams.b)) {
1137
- return true;
1138
- }
1139
- return false;
1140
- }, [sellAmount, pmmParams]);
1141
- return /*#__PURE__*/index.jsxRuntimeExports.jsxs(Container, {
1142
- id: chartId,
1143
- children: [!notShowAmountInput ? /*#__PURE__*/index.jsxRuntimeExports.jsxs(AmountInputContainer, {
1144
- children: [/*#__PURE__*/index.jsxRuntimeExports.jsxs(InputSectionWrapper, {
1145
- borderColor: colorMap && colorMap.grid,
1146
- children: [helper.chartT('pool.chart.buy-amount', {
1147
- symbol: baseTokenSymbol
1148
- }), /*#__PURE__*/index.jsxRuntimeExports.jsx(Input, {
1149
- value: buyAmount,
1150
- error: buyInputError,
1151
- onChange: evt => {
1152
- const amount = index.fixedInputStringToFormattedNumber(evt.target.value, 2);
1153
- if (amount !== null) {
1154
- setBuyAmount(amount);
1155
- }
1156
- }
1157
- }), /*#__PURE__*/index.jsxRuntimeExports.jsx(PriceImpactWrapper, {
1158
- children: helper.chartT('pool.chart.price-impact', {
1159
- amount: buyImpact
1160
- })
1161
- })]
1162
- }), /*#__PURE__*/index.jsxRuntimeExports.jsxs(InputSectionWrapper, {
1163
- borderColor: colorMap && colorMap.grid,
1164
- children: [helper.chartT('pool.chart.sell-amount', {
1165
- symbol: baseTokenSymbol
1166
- }), /*#__PURE__*/index.jsxRuntimeExports.jsx(Input, {
1167
- value: sellAmount,
1168
- error: sellInputError,
1169
- onChange: evt => {
1170
- const amount = index.fixedInputStringToFormattedNumber(evt.target.value, 2);
1171
- if (amount !== null) {
1172
- setSellAmount(amount);
1173
- }
1174
- }
1175
- }), /*#__PURE__*/index.jsxRuntimeExports.jsx(PriceImpactWrapper, {
1176
- children: helper.chartT('pool.chart.price-impact', {
1177
- amount: sellImpact
1178
- })
1179
- })]
1180
- })]
1181
- }) : '', pmmParams !== undefined && midPrice !== undefined && pmmModel !== undefined && baseMinAndZoomMultiples.baseMin !== undefined && midPrice !== undefined && /*#__PURE__*/index.jsxRuntimeExports.jsx(DepthChartKonva, {
1182
- width: width,
1183
- height: height,
1184
- params: pmmParams,
1185
- midPrice: midPrice,
1186
- pmmModel: pmmModel,
1187
- baseTokenSymbol: baseTokenSymbol,
1188
- quoteTokenSymbol: quoteTokenSymbol,
1189
- baseMinAndZoomMultiples: baseMinAndZoomMultiples,
1190
- colorMap: colorMap,
1191
- setBaseMinAndZoomMultiples: setBaseMinAndZoomMultiples
1192
- }), /*#__PURE__*/index.jsxRuntimeExports.jsxs(OptButtonGroup, {
1193
- className: "operate-btn-wrapper",
1194
- children: [/*#__PURE__*/index.jsxRuntimeExports.jsx(OptButton, {
1195
- onClick: () => handleDragButtonMouseDown(true),
1196
- children: /*#__PURE__*/index.jsxRuntimeExports.jsx(BiChevronLeft, {})
1197
- }), /*#__PURE__*/index.jsxRuntimeExports.jsx(OptButton, {
1198
- onClick: () => handleZoomButtonMouseDown(false),
1199
- children: /*#__PURE__*/index.jsxRuntimeExports.jsx(BiMinus, {})
1200
- }), /*#__PURE__*/index.jsxRuntimeExports.jsx(OptButton, {
1201
- onClick: () => handleZoomButtonMouseDown(true),
1202
- children: /*#__PURE__*/index.jsxRuntimeExports.jsx(BiPlus, {})
1203
- }), /*#__PURE__*/index.jsxRuntimeExports.jsx(OptButton, {
1204
- onClick: () => handleDragButtonMouseDown(false),
1205
- children: /*#__PURE__*/index.jsxRuntimeExports.jsx(BiChevronRight, {})
1206
- })]
1207
- })]
1208
- });
1209
- };
1210
-
1211
- exports.default = DepthChart;
1212
- //# sourceMappingURL=index-B-5Qs8z3.cjs.map