@orderly.network/trading 2.8.10-alpha.0 → 2.8.11-alpha.0

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/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import { useAccount, useLocalStorage, useConfig, useWalletConnector, useMutation, useChains, useReferralInfo, useCurEpochEstimate, TWType, useEpochInfo, usePositionStream, useOrderStream, useFundingDetails, useFundingRateBySymbol, useFundingRate, useSymbolsInfo, useOrderbookStream, useEventEmitter, useCollateral, useMarginRatio, useLeverage, useDebouncedCallback, useMediaQuery, useAssetsHistory, useGetRwaSymbolInfo, useGetRwaSymbolOpenStatus, useGetRwaSymbolCloseTimeInterval, useMarketTradeStream, useAccountInstance, useComputedLTV, useTickerStream } from '@orderly.network/hooks';
2
- import React11, { forwardRef, useMemo, createContext, useContext, useState, useCallback, useEffect, useRef, createElement } from 'react';
2
+ import React12, { forwardRef, useMemo, createContext, useContext, useState, useCallback, useEffect, useRef, createElement } from 'react';
3
3
  import { useDataTap, useAppContext } from '@orderly.network/react-app';
4
4
  import { AccountStatusEnum, ChainNamespace, AlgoOrderRootType, OrderStatus, OrderSide, AssetHistoryStatusEnum, AssetHistorySideEnum, TradingviewFullscreenKey, OrderEntrySortKeys, EMPTY_LIST } from '@orderly.network/types';
5
5
  import { TabType, DesktopOrderListWidget, MobileOrderListWidget } from '@orderly.network/ui-orders';
6
6
  import { useTranslation, i18n, Trans } from '@orderly.network/i18n';
7
- import { installExtension, ExtensionPositionEnum, cn, Button, formatAddress, registerSimpleDialog, registerSimpleSheet, modal, useModal, Flex, toast as toast$1, Text, ArrowRightShortIcon, Box, ListView, Grid, ArrowDownShortIcon, gradientTextVariants, EyeIcon, EyeCloseIcon, Divider, ChevronDownIcon, useScreen, Tooltip, Tabs, TabPanel, CloseIcon, DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuContent, Statistic, RefreshIcon, ArrowLeftRightIcon, ArrowUpShortIcon, InfoCircleIcon, ExtensionSlot, NewsFillIcon, SimpleSheet, SimpleDialog, ChainIcon, ExclamationFillIcon, Switch, Checkbox, Sheet, SheetTrigger, SheetContent, SettingFillIcon, Spinner, Select, Popover, CaretUpIcon, CaretDownIcon, Picker, TooltipRoot, TooltipTrigger, TooltipContent as TooltipContent$1, TooltipArrow, parseNumber } from '@orderly.network/ui';
7
+ import { installExtension, ExtensionPositionEnum, cn, Button, formatAddress, registerSimpleDialog, registerSimpleSheet, modal, useModal, Flex, toast as toast$1, Text, ArrowRightShortIcon, Box, ListView, Grid, ArrowDownShortIcon, gradientTextVariants, EyeIcon, EyeCloseIcon, Divider, ChevronDownIcon, useScreen, Tooltip, Tabs, TabPanel, CloseIcon, DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuContent, Statistic, RefreshIcon, ArrowLeftRightIcon, ArrowUpShortIcon, InfoCircleIcon, ExtensionSlot, NewsFillIcon, SimpleSheet, SimpleDialog, ChainIcon, ExclamationFillIcon, Switch, Checkbox, Sheet, SheetTrigger, SheetContent, SettingFillIcon, Spinner, PopoverRoot, PopoverTrigger, PopoverContent, Select, Popover, CaretUpIcon, CaretDownIcon, Picker, TooltipRoot, TooltipTrigger, TooltipContent as TooltipContent$1, TooltipArrow, parseNumber } from '@orderly.network/ui';
8
8
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
9
  import { PositionHistoryWidget, LiquidationWidget, PositionsWidget, CloseAllPositionsWidget, MobileLiquidationWidget, MobilePositionsWidget, MobilePositionHistoryWidget, useReversePositionEnabled } from '@orderly.network/ui-positions';
10
10
  import { isTestnet, Decimal, commifyOptional, removeTrailingZeros, formatSymbol, optimizeSymbolDisplay, getPrecisionByNumber } from '@orderly.network/utils';
@@ -688,19 +688,19 @@ var LazySettingWidget, LazyPositionHeaderWidget, PositionsView, LiquidationTab,
688
688
  var init_dataList_ui = __esm({
689
689
  "src/components/desktop/dataList/dataList.ui.tsx"() {
690
690
  init_dataList_script();
691
- LazySettingWidget = React11.lazy(
691
+ LazySettingWidget = React12.lazy(
692
692
  () => Promise.resolve().then(() => (init_setting(), setting_exports)).then((mod) => {
693
693
  return { default: mod.SettingWidget };
694
694
  })
695
695
  );
696
- LazyPositionHeaderWidget = React11.lazy(
696
+ LazyPositionHeaderWidget = React12.lazy(
697
697
  () => Promise.resolve().then(() => (init_positionHeader(), positionHeader_exports)).then((mod) => {
698
698
  return { default: mod.PositionHeaderWidget };
699
699
  })
700
700
  );
701
701
  PositionsView = (props) => {
702
702
  return /* @__PURE__ */ jsxs(Flex, { direction: "column", width: "100%", height: "100%", children: [
703
- /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
703
+ /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
704
704
  LazyPositionHeaderWidget,
705
705
  {
706
706
  setPnlNotionalDecimalPrecision: props.setPnlNotionalDecimalPrecision,
@@ -883,7 +883,7 @@ var init_dataList_ui = __esm({
883
883
  {
884
884
  defaultValue: current || "Positions" /* positions */,
885
885
  variant: "contained",
886
- trailing: /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
886
+ trailing: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
887
887
  LazySettingWidget,
888
888
  {
889
889
  pnlNotionalDecimalPrecision,
@@ -1381,6 +1381,8 @@ var init_assetView_ui = __esm({
1381
1381
  freeCollateral,
1382
1382
  marginRatioVal,
1383
1383
  renderMMR,
1384
+ maintenanceMargin,
1385
+ currentLeverage,
1384
1386
  isConnected,
1385
1387
  currentLtv
1386
1388
  } = props;
@@ -1428,7 +1430,7 @@ var init_assetView_ui = __esm({
1428
1430
  "oui-select-none oui-space-y-1.5 oui-overflow-hidden",
1429
1431
  "oui-transition-[max-height] oui-duration-150",
1430
1432
  "group-hover:oui-will-change-[max-height]",
1431
- open ? showLTV ? "oui-max-h-[94px]" : "oui-max-h-[69px]" : "oui-max-h-0"
1433
+ open ? showLTV ? "oui-max-h-[144px]" : "oui-max-h-[119px]" : "oui-max-h-0"
1432
1434
  ),
1433
1435
  children: [
1434
1436
  /* @__PURE__ */ jsx(
@@ -1469,6 +1471,28 @@ var init_assetView_ui = __esm({
1469
1471
  placeholder: "--%"
1470
1472
  }
1471
1473
  ),
1474
+ /* @__PURE__ */ jsx(
1475
+ AssetDetail,
1476
+ {
1477
+ label: t("trading.asset.maintenanceMargin"),
1478
+ description: t("trading.asset.maintenanceMargin.tooltip"),
1479
+ formula: t("trading.asset.maintenanceMargin.formula"),
1480
+ visible,
1481
+ value: maintenanceMargin,
1482
+ unit: "USDC"
1483
+ }
1484
+ ),
1485
+ /* @__PURE__ */ jsx(
1486
+ AssetDetail,
1487
+ {
1488
+ label: t("trading.asset.currentLeverage"),
1489
+ description: t("trading.asset.currentLeverage.tooltip"),
1490
+ formula: t("trading.asset.currentLeverage.formula"),
1491
+ visible,
1492
+ value: currentLeverage,
1493
+ unit: "x"
1494
+ }
1495
+ ),
1472
1496
  showLTV && /* @__PURE__ */ jsx(LTVDetail, { visible, value: currentLtv })
1473
1497
  ]
1474
1498
  }
@@ -1487,6 +1511,8 @@ var init_assetView_ui = __esm({
1487
1511
  freeCollateral,
1488
1512
  marginRatioVal,
1489
1513
  renderMMR,
1514
+ maintenanceMargin,
1515
+ currentLeverage,
1490
1516
  isConnected,
1491
1517
  isMainAccount,
1492
1518
  hasSubAccount,
@@ -1608,6 +1634,8 @@ var init_assetView_ui = __esm({
1608
1634
  freeCollateral,
1609
1635
  marginRatioVal,
1610
1636
  renderMMR,
1637
+ maintenanceMargin,
1638
+ currentLeverage,
1611
1639
  isConnected,
1612
1640
  currentLtv
1613
1641
  }
@@ -1659,7 +1687,7 @@ var init_assetView_script = __esm({
1659
1687
  const { freeCollateral } = useCollateral({
1660
1688
  dp: 2
1661
1689
  });
1662
- const { marginRatio, mmr } = useMarginRatio();
1690
+ const { marginRatio, mmr, maintenanceMargin, currentLeverage } = useMarginRatio();
1663
1691
  const isConnected = state.status >= AccountStatusEnum.Connected;
1664
1692
  const [{ aggregated }, positionsInfo] = usePositionStream();
1665
1693
  const marginRatioVal = useMemo(() => {
@@ -1717,6 +1745,8 @@ var init_assetView_script = __esm({
1717
1745
  const _freeCollateral = useDataTap(freeCollateral) ?? void 0;
1718
1746
  const _marginRatioVal = useDataTap(marginRatioVal) ?? void 0;
1719
1747
  const _mmr = useDataTap(mmr) ?? void 0;
1748
+ const _maintenanceMargin = useDataTap(maintenanceMargin) ?? void 0;
1749
+ const _currentLeverage = useDataTap(currentLeverage) ?? void 0;
1720
1750
  const _totalValue = useDataTap(totalValue) ?? void 0;
1721
1751
  return {
1722
1752
  onDeposit,
@@ -1731,6 +1761,8 @@ var init_assetView_script = __esm({
1731
1761
  freeCollateral: _freeCollateral,
1732
1762
  marginRatioVal: _marginRatioVal,
1733
1763
  renderMMR: _mmr,
1764
+ maintenanceMargin: _maintenanceMargin,
1765
+ currentLeverage: _currentLeverage,
1734
1766
  isConnected,
1735
1767
  isMainAccount,
1736
1768
  hasSubAccount: !!state.subAccounts?.length,
@@ -1775,7 +1807,7 @@ var init_orderContext = __esm({
1775
1807
  OrderBookProvider = (props) => {
1776
1808
  const [mode, setMode] = useState("quantity");
1777
1809
  const [totalMode, setTotalMode] = useState("quantity");
1778
- const memoizedValue = React11.useMemo(() => {
1810
+ const memoizedValue = React12.useMemo(() => {
1779
1811
  return {
1780
1812
  cellHeight: props.cellHeight,
1781
1813
  onItemClick: props.onItemClick,
@@ -1786,7 +1818,9 @@ var init_orderContext = __esm({
1786
1818
  onTotalModeChange: setTotalMode,
1787
1819
  showTotal: props.showTotal || false,
1788
1820
  pendingOrders: props.pendingOrders,
1789
- symbolInfo: props.symbolInfo
1821
+ symbolInfo: props.symbolInfo,
1822
+ showBuySellRatio: props.showBuySellRatio ?? true,
1823
+ onShowBuySellRatioChange: props.onShowBuySellRatioChange
1790
1824
  };
1791
1825
  }, [
1792
1826
  mode,
@@ -1796,6 +1830,8 @@ var init_orderContext = __esm({
1796
1830
  props.pendingOrders,
1797
1831
  props.showTotal,
1798
1832
  props.symbolInfo,
1833
+ props.showBuySellRatio,
1834
+ props.onShowBuySellRatioChange,
1799
1835
  totalMode
1800
1836
  ]);
1801
1837
  return /* @__PURE__ */ jsx(OrderBookContext.Provider, { value: memoizedValue, children: props.children });
@@ -2202,6 +2238,65 @@ var init_bids_desktop = __esm({
2202
2238
  };
2203
2239
  }
2204
2240
  });
2241
+ var BuySellRatioSettings, MoreIcon;
2242
+ var init_buySellRatio = __esm({
2243
+ "src/components/desktop/orderBook/buySellRatio.tsx"() {
2244
+ BuySellRatioSettings = ({
2245
+ showBuySellRatio,
2246
+ setShowBuySellRatio
2247
+ }) => {
2248
+ const { t } = useTranslation();
2249
+ const [settingsOpen, setSettingsOpen] = useState(false);
2250
+ return /* @__PURE__ */ jsxs(PopoverRoot, { open: settingsOpen, onOpenChange: setSettingsOpen, children: [
2251
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
2252
+ "button",
2253
+ {
2254
+ className: "oui-cursor-pointer oui-text-base-contrast-54 hover:oui-text-base-contrast oui-transition-colors",
2255
+ "aria-label": t("trading.orderBook.settings"),
2256
+ children: /* @__PURE__ */ jsx(MoreIcon, {})
2257
+ }
2258
+ ) }),
2259
+ /* @__PURE__ */ jsx(PopoverContent, { align: "end", sideOffset: 8, className: "oui-w-[200px] ", children: /* @__PURE__ */ jsxs(Flex, { itemAlign: "center", gap: 2, children: [
2260
+ /* @__PURE__ */ jsx(
2261
+ Checkbox,
2262
+ {
2263
+ id: "show-buy-sell-ratio",
2264
+ checked: showBuySellRatio,
2265
+ onCheckedChange: (checked) => {
2266
+ setShowBuySellRatio?.(checked === true);
2267
+ setSettingsOpen(false);
2268
+ }
2269
+ }
2270
+ ),
2271
+ /* @__PURE__ */ jsx(
2272
+ "label",
2273
+ {
2274
+ htmlFor: "show-buy-sell-ratio",
2275
+ className: "oui-cursor-pointer oui-text-xs oui-text-base-contrast-54",
2276
+ children: t("trading.orderBook.showBuySellRatio")
2277
+ }
2278
+ )
2279
+ ] }) })
2280
+ ] });
2281
+ };
2282
+ MoreIcon = (props) => /* @__PURE__ */ jsxs(
2283
+ "svg",
2284
+ {
2285
+ xmlns: "http://www.w3.org/2000/svg",
2286
+ width: "16",
2287
+ height: "16",
2288
+ viewBox: "0 0 16 16",
2289
+ fill: "currentColor",
2290
+ ...props,
2291
+ children: [
2292
+ /* @__PURE__ */ jsx("path", { d: "M8.00521 6.66797C8.74161 6.66797 9.33854 7.26464 9.33854 8.0013C9.33854 8.73797 8.74161 9.33464 8.00521 9.33464C7.26881 9.33464 6.67188 8.73797 6.67188 8.0013C6.67188 7.26464 7.26881 6.66797 8.00521 6.66797Z" }),
2293
+ /* @__PURE__ */ jsx("path", { d: "M3.33333 6.66797C4.06973 6.66797 4.66667 7.26464 4.66667 8.0013C4.66667 8.73797 4.06973 9.33464 3.33333 9.33464C2.59693 9.33464 2 8.73797 2 8.0013C2 7.26464 2.59693 6.66797 3.33333 6.66797Z" }),
2294
+ /* @__PURE__ */ jsx("path", { d: "M12.6666 6.66797C13.403 6.66797 14 7.26464 14 8.0013C14 8.73797 13.403 9.33464 12.6666 9.33464C11.9302 9.33464 11.3333 8.73797 11.3333 8.0013C11.3333 7.26464 11.9302 6.66797 12.6666 6.66797Z" })
2295
+ ]
2296
+ }
2297
+ );
2298
+ }
2299
+ });
2205
2300
  var DesktopDepthSelect;
2206
2301
  var init_depthSelect_desktop = __esm({
2207
2302
  "src/components/desktop/orderBook/depthSelect.desktop.tsx"() {
@@ -2282,7 +2377,7 @@ var init_header_desktop = __esm({
2282
2377
  const { base, quote = "USDC" } = props;
2283
2378
  const { showTotal } = useOrderBookContext();
2284
2379
  const { t } = useTranslation();
2285
- const [popoverOpen, setOpen] = React11.useState(false);
2380
+ const [popoverOpen, setOpen] = React12.useState(false);
2286
2381
  const [coinType] = useLocalStorage(ORDERBOOK_COIN_TYPE_KEY, base);
2287
2382
  const TriggerIcon = popoverOpen ? CaretUpIcon : CaretDownIcon;
2288
2383
  const optimizedBase = useMemo(() => {
@@ -2614,14 +2709,27 @@ var init_markPrice_desktop = __esm({
2614
2709
  var DesktopOrderBook;
2615
2710
  var init_index_desktop = __esm({
2616
2711
  "src/components/desktop/orderBook/index.desktop.tsx"() {
2712
+ init_orderBook2();
2617
2713
  init_orderContext();
2618
2714
  init_asks_desktop();
2619
2715
  init_bids_desktop();
2716
+ init_buySellRatio();
2620
2717
  init_depthSelect_desktop();
2621
2718
  init_header_desktop();
2622
2719
  init_markPrice_desktop();
2623
2720
  DesktopOrderBook = (props) => {
2624
- const { lastPrice, markPrice, quote, base, isLoading, onDepthChange } = props;
2721
+ const {
2722
+ lastPrice,
2723
+ markPrice,
2724
+ quote,
2725
+ base,
2726
+ isLoading,
2727
+ onDepthChange,
2728
+ showBuySellRatio = true,
2729
+ setShowBuySellRatio,
2730
+ buySellRatio
2731
+ } = props;
2732
+ const { t } = useTranslation();
2625
2733
  const divRef = useRef(null);
2626
2734
  const [showTotal, setShowTotal] = useState(false);
2627
2735
  const [coinType, setCoinType] = useLocalStorage(
@@ -2659,23 +2767,37 @@ var init_index_desktop = __esm({
2659
2767
  showTotal,
2660
2768
  pendingOrders: props.pendingOrders || EMPTY_LIST,
2661
2769
  symbolInfo: props.symbolInfo,
2770
+ showBuySellRatio,
2771
+ onShowBuySellRatioChange: setShowBuySellRatio,
2662
2772
  children: /* @__PURE__ */ jsxs(
2663
2773
  Grid,
2664
2774
  {
2665
2775
  cols: 1,
2666
- rows: 5,
2776
+ rows: showBuySellRatio ? 6 : 5,
2667
2777
  id: "oui-orderbook-desktop",
2668
2778
  ref: divRef,
2669
- className: "oui-relative oui-size-full oui-grid-rows-[auto,auto,1fr,auto,1fr]",
2779
+ className: cn(
2780
+ "oui-relative oui-size-full",
2781
+ showBuySellRatio ? "oui-grid-rows-[auto,auto,1fr,auto,1fr,auto]" : "oui-grid-rows-[auto,auto,1fr,auto,1fr]"
2782
+ ),
2670
2783
  children: [
2671
- /* @__PURE__ */ jsx(
2672
- DesktopDepthSelect,
2673
- {
2674
- depths: props.depths,
2675
- value: props.activeDepth,
2676
- onChange: onDepthChange
2677
- }
2678
- ),
2784
+ /* @__PURE__ */ jsxs(Flex, { justify: "between", itemAlign: "center", className: "oui-pr-3", children: [
2785
+ /* @__PURE__ */ jsx(
2786
+ DesktopDepthSelect,
2787
+ {
2788
+ depths: props.depths,
2789
+ value: props.activeDepth,
2790
+ onChange: onDepthChange
2791
+ }
2792
+ ),
2793
+ /* @__PURE__ */ jsx(
2794
+ BuySellRatioSettings,
2795
+ {
2796
+ showBuySellRatio,
2797
+ setShowBuySellRatio
2798
+ }
2799
+ )
2800
+ ] }),
2679
2801
  /* @__PURE__ */ jsx(DesktopHeader, { quote, base }),
2680
2802
  /* @__PURE__ */ jsx(DesktopAsks, { data: [...props.asks] }),
2681
2803
  /* @__PURE__ */ jsx(
@@ -2689,6 +2811,13 @@ var init_index_desktop = __esm({
2689
2811
  }
2690
2812
  ),
2691
2813
  /* @__PURE__ */ jsx(DesktopBids, { data: [...props.bids] }),
2814
+ showBuySellRatio && /* @__PURE__ */ jsx(
2815
+ BuySellRatioBar,
2816
+ {
2817
+ ratio: buySellRatio || null,
2818
+ className: "oui-text-2xs oui-px-3 oui-h-[38px]"
2819
+ }
2820
+ ),
2692
2821
  isLoading && /* @__PURE__ */ jsx("div", { className: "oui-bg-bg-8/70 oui-absolute oui-inset-0 oui-z-10 oui-flex oui-items-center oui-justify-center", children: /* @__PURE__ */ jsx(Spinner, {}) })
2693
2822
  ]
2694
2823
  }
@@ -2771,8 +2900,7 @@ var init_fundingRateModal_script = __esm({
2771
2900
  return `${new Decimal(est_funding_rate).mul(notional).todp(4).toNumber()}`;
2772
2901
  }, [est_funding_rate, notional, rows]);
2773
2902
  const calculateAnnualizedRate = (rate, intervalHours) => {
2774
- if (!rate || !intervalHours)
2775
- return void 0;
2903
+ if (!rate || !intervalHours) return void 0;
2776
2904
  const annualizedRate = new Decimal(rate).mul(24).div(intervalHours).mul(365);
2777
2905
  return annualizedRate.todp(2, Decimal.ROUND_DOWN).toNumber();
2778
2906
  };
@@ -3210,7 +3338,9 @@ var init_markPrice2 = __esm({
3210
3338
  var OrderBook;
3211
3339
  var init_orderBook = __esm({
3212
3340
  "src/components/mobile/orderBook/index.tsx"() {
3341
+ init_orderBook2();
3213
3342
  init_orderContext();
3343
+ init_buySellRatio();
3214
3344
  init_fundingRate();
3215
3345
  init_asks();
3216
3346
  init_bids();
@@ -3218,7 +3348,19 @@ var init_orderBook = __esm({
3218
3348
  init_header();
3219
3349
  init_markPrice2();
3220
3350
  OrderBook = (props) => {
3221
- const { lastPrice, markPrice, quote, base, isLoading, onDepthChange } = props;
3351
+ const {
3352
+ lastPrice,
3353
+ markPrice,
3354
+ quote,
3355
+ base,
3356
+ isLoading,
3357
+ onDepthChange,
3358
+ showBuySellRatio = true,
3359
+ setShowBuySellRatio,
3360
+ buySellRatio
3361
+ } = props;
3362
+ const { t } = useTranslation();
3363
+ const [settingsOpen, setSettingsOpen] = useState(false);
3222
3364
  const symbol = `PERP_${props.symbolInfo.base}_${props.symbolInfo.quote}`;
3223
3365
  const [coinUnit, setCoinUnit] = useLocalStorage(
3224
3366
  ORDERBOOK_MOBILE_COIN_TYPE_KEY,
@@ -3233,6 +3375,8 @@ var init_orderBook = __esm({
3233
3375
  pendingOrders: EMPTY_LIST,
3234
3376
  showTotal: false,
3235
3377
  symbolInfo: props.symbolInfo,
3378
+ showBuySellRatio,
3379
+ onShowBuySellRatioChange: setShowBuySellRatio,
3236
3380
  children: /* @__PURE__ */ jsxs(
3237
3381
  Flex,
3238
3382
  {
@@ -3243,7 +3387,16 @@ var init_orderBook = __esm({
3243
3387
  justify: "start",
3244
3388
  itemAlign: "start",
3245
3389
  children: [
3246
- /* @__PURE__ */ jsx(FundingRateWidget, { symbol }),
3390
+ /* @__PURE__ */ jsxs(Flex, { justify: "between", itemAlign: "center", className: "oui-w-full", children: [
3391
+ /* @__PURE__ */ jsx(FundingRateWidget, { symbol }),
3392
+ /* @__PURE__ */ jsx(
3393
+ BuySellRatioSettings,
3394
+ {
3395
+ showBuySellRatio,
3396
+ setShowBuySellRatio
3397
+ }
3398
+ )
3399
+ ] }),
3247
3400
  /* @__PURE__ */ jsx(Header2, { quote, base }),
3248
3401
  /* @__PURE__ */ jsx(Asks, { data: props.asks }),
3249
3402
  /* @__PURE__ */ jsx(MarkPrice, { lastPrice, markPrice }),
@@ -3256,6 +3409,13 @@ var init_orderBook = __esm({
3256
3409
  onChange: onDepthChange
3257
3410
  }
3258
3411
  ),
3412
+ showBuySellRatio && /* @__PURE__ */ jsx(
3413
+ BuySellRatioBar,
3414
+ {
3415
+ ratio: buySellRatio || null,
3416
+ className: "oui-px-0 oui-text-[8px] oui-h-6 oui-mt-2"
3417
+ }
3418
+ ),
3259
3419
  isLoading && /* @__PURE__ */ jsx("div", { className: "oui-bg-base-800/70 oui-absolute oui-inset-0 oui-z-10 oui-flex oui-h-full oui-min-h-[420px] oui-items-center oui-justify-center", children: /* @__PURE__ */ jsx(Spinner, {}) })
3260
3420
  ]
3261
3421
  }
@@ -3288,7 +3448,10 @@ var init_orderBook_ui = __esm({
3288
3448
  cellHeight: props.cellHeight,
3289
3449
  onDepthChange: props.onDepthChange,
3290
3450
  className: props.className,
3291
- symbolInfo: props.symbolInfo
3451
+ symbolInfo: props.symbolInfo,
3452
+ showBuySellRatio: props.showBuySellRatio,
3453
+ setShowBuySellRatio: props.setShowBuySellRatio,
3454
+ buySellRatio: props.buySellRatio
3292
3455
  }
3293
3456
  ) : /* @__PURE__ */ jsx(
3294
3457
  DesktopOrderBook,
@@ -3308,7 +3471,10 @@ var init_orderBook_ui = __esm({
3308
3471
  onDepthChange: props.onDepthChange,
3309
3472
  className: props.className,
3310
3473
  pendingOrders: props.pendingOrders,
3311
- symbolInfo: props.symbolInfo
3474
+ symbolInfo: props.symbolInfo,
3475
+ showBuySellRatio: props.showBuySellRatio,
3476
+ setShowBuySellRatio: props.setShowBuySellRatio,
3477
+ buySellRatio: props.buySellRatio
3312
3478
  }
3313
3479
  ) });
3314
3480
  };
@@ -3330,12 +3496,15 @@ var init_utils = __esm({
3330
3496
  };
3331
3497
  }
3332
3498
  });
3333
- var DEFAULT_CELL_HEIGHT, SPACE, useOrderBookScript, usePendingOrderStream;
3499
+ var DEFAULT_CELL_HEIGHT, SPACE, BUY_SELL_RATIO_BAR_HEIGHT_MOBILE, BUY_SELL_RATIO_BAR_HEIGHT_DESKTOP, ORDERBOOK_SHOW_BUY_SELL_RATIO_KEY, useOrderBookScript, usePendingOrderStream;
3334
3500
  var init_orderBook_script = __esm({
3335
3501
  "src/components/base/orderBook/orderBook.script.tsx"() {
3336
3502
  init_utils();
3337
3503
  DEFAULT_CELL_HEIGHT = 20;
3338
3504
  SPACE = 104;
3505
+ BUY_SELL_RATIO_BAR_HEIGHT_MOBILE = 28;
3506
+ BUY_SELL_RATIO_BAR_HEIGHT_DESKTOP = 38;
3507
+ ORDERBOOK_SHOW_BUY_SELL_RATIO_KEY = "orderbook_show_buy_sell_ratio";
3339
3508
  useOrderBookScript = (props) => {
3340
3509
  const { symbol, height } = props;
3341
3510
  const symbolInfo = useSymbolsInfo()[symbol];
@@ -3344,13 +3513,19 @@ var init_orderBook_script = __esm({
3344
3513
  const { base, quote, quote_dp } = getBasicSymbolInfo(symbolInfo);
3345
3514
  const [data, { onDepthChange, isLoading, onItemClick, depth, allDepths }] = useOrderbookStream(symbol, void 0, { level });
3346
3515
  const pendingOrders = usePendingOrderStream(symbol);
3516
+ const { isMobile } = useScreen();
3517
+ const [showBuySellRatio, setShowBuySellRatio] = useLocalStorage(
3518
+ ORDERBOOK_SHOW_BUY_SELL_RATIO_KEY,
3519
+ true
3520
+ );
3347
3521
  useEffect(() => {
3348
3522
  if (height) {
3523
+ const availableSpace = SPACE + (showBuySellRatio ? isMobile ? BUY_SELL_RATIO_BAR_HEIGHT_MOBILE : BUY_SELL_RATIO_BAR_HEIGHT_DESKTOP : 0);
3349
3524
  const level2 = Math.floor(
3350
- (height - SPACE) / ((DEFAULT_CELL_HEIGHT + 1) * 2)
3525
+ (height - availableSpace) / ((DEFAULT_CELL_HEIGHT + 1) * 2)
3351
3526
  );
3352
3527
  const cellsHeight = (DEFAULT_CELL_HEIGHT + 1) * 2 * level2;
3353
- const restSpace = height - SPACE - cellsHeight;
3528
+ const restSpace = height - availableSpace - cellsHeight;
3354
3529
  if (restSpace > 10) {
3355
3530
  setCellHeight(DEFAULT_CELL_HEIGHT + restSpace / level2 / 2);
3356
3531
  } else {
@@ -3358,7 +3533,7 @@ var init_orderBook_script = __esm({
3358
3533
  }
3359
3534
  setLevel(level2);
3360
3535
  }
3361
- }, [height]);
3536
+ }, [height, showBuySellRatio]);
3362
3537
  const selDepth = useMemo(() => {
3363
3538
  if (typeof depth === "undefined" || typeof quote_dp === "undefined") {
3364
3539
  return void 0;
@@ -3368,7 +3543,38 @@ var init_orderBook_script = __esm({
3368
3543
  const depths = useMemo(() => {
3369
3544
  return allDepths?.map((e) => removeTrailingZeros(e)) || [];
3370
3545
  }, [allDepths, quote_dp]);
3371
- const { isMobile } = useScreen();
3546
+ const buySellRatio = useMemo(() => {
3547
+ if (!data?.asks || !data?.bids || level === void 0) {
3548
+ return null;
3549
+ }
3550
+ const isValidNumber = (value) => {
3551
+ return typeof value === "number" && !Number.isNaN(value) && Number.isFinite(value) && value >= 0;
3552
+ };
3553
+ const visibleAsks = data.asks.slice(0, level);
3554
+ const visibleBids = data.bids.slice(-level);
3555
+ if (visibleAsks.length > 0 && visibleBids.length > 0) {
3556
+ const firstAsk = visibleAsks.find(
3557
+ (ask) => Array.isArray(ask) && ask.length === 4 && ask[3] !== void 0 && ask[3] !== null && isValidNumber(ask[3])
3558
+ );
3559
+ const lastBid = [...visibleBids].reverse().find(
3560
+ (bid) => Array.isArray(bid) && bid.length === 4 && bid[3] !== void 0 && bid[3] !== null && isValidNumber(bid[3])
3561
+ );
3562
+ if (firstAsk && lastBid) {
3563
+ const askAmount = new Decimal(firstAsk[3]);
3564
+ const bidAmount = new Decimal(lastBid[3]);
3565
+ const totalAmount = askAmount.add(bidAmount);
3566
+ const buyPercentage = bidAmount.div(totalAmount).mul(100).toNumber();
3567
+ const sellPercentage = 100 - buyPercentage;
3568
+ return {
3569
+ buyPercentage,
3570
+ sellPercentage,
3571
+ buyAmount: askAmount.toNumber(),
3572
+ sellAmount: bidAmount.toNumber()
3573
+ };
3574
+ }
3575
+ }
3576
+ return null;
3577
+ }, [data?.asks, data?.bids, level]);
3372
3578
  return {
3373
3579
  level,
3374
3580
  asks: data?.asks,
@@ -3385,7 +3591,10 @@ var init_orderBook_script = __esm({
3385
3591
  onDepthChange,
3386
3592
  pendingOrders,
3387
3593
  symbolInfo: getBasicSymbolInfo(symbolInfo),
3388
- isMobile
3594
+ isMobile,
3595
+ showBuySellRatio,
3596
+ setShowBuySellRatio,
3597
+ buySellRatio
3389
3598
  };
3390
3599
  };
3391
3600
  usePendingOrderStream = (symbol) => {
@@ -3416,10 +3625,91 @@ var init_orderBook_widget = __esm({
3416
3625
  };
3417
3626
  }
3418
3627
  });
3628
+ var BuySellRatioBar;
3629
+ var init_buySellRatioBar = __esm({
3630
+ "src/components/base/orderBook/buySellRatioBar.tsx"() {
3631
+ BuySellRatioBar = (props) => {
3632
+ const { ratio, className } = props;
3633
+ const { buyPercentage, sellPercentage } = useMemo(() => {
3634
+ if (!ratio) {
3635
+ return { buyPercentage: 50, sellPercentage: 50 };
3636
+ }
3637
+ const isValidNumber = (value) => {
3638
+ return typeof value === "number" && !Number.isNaN(value) && Number.isFinite(value) && value >= 0 && value <= 100;
3639
+ };
3640
+ const buyPct = isValidNumber(ratio.buyPercentage) ? ratio.buyPercentage : 50;
3641
+ const buyPctRounded = new Decimal(buyPct).toDecimalPlaces(1, Decimal.ROUND_HALF_UP).toNumber();
3642
+ const sellPctRounded = new Decimal(100).sub(buyPctRounded).toDecimalPlaces(1, Decimal.ROUND_HALF_UP).toNumber();
3643
+ return {
3644
+ buyPercentage: buyPctRounded,
3645
+ sellPercentage: sellPctRounded
3646
+ };
3647
+ }, [ratio]);
3648
+ return /* @__PURE__ */ jsxs(Flex, { className: cn("oui-w-full", className), gap: 1, children: [
3649
+ /* @__PURE__ */ jsxs(Flex, { itemAlign: "center", gap: 1, children: [
3650
+ /* @__PURE__ */ jsx(Text, { intensity: 80, children: "B" }),
3651
+ /* @__PURE__ */ jsxs(Text, { color: "success", children: [
3652
+ buyPercentage.toFixed(1),
3653
+ "%"
3654
+ ] })
3655
+ ] }),
3656
+ /* @__PURE__ */ jsxs(
3657
+ "div",
3658
+ {
3659
+ style: {
3660
+ flex: 1,
3661
+ height: "4px",
3662
+ position: "relative",
3663
+ borderRadius: "2px",
3664
+ overflow: "hidden",
3665
+ backgroundColor: "rgb(var(--oui-line-4))"
3666
+ },
3667
+ children: [
3668
+ /* @__PURE__ */ jsx(
3669
+ "div",
3670
+ {
3671
+ className: "oui-bg-trade-profit oui-mr-[2px] oui-rounded-sm",
3672
+ style: {
3673
+ position: "absolute",
3674
+ left: 0,
3675
+ top: 0,
3676
+ width: `${buyPercentage}%`,
3677
+ height: "100%"
3678
+ }
3679
+ }
3680
+ ),
3681
+ /* @__PURE__ */ jsx(
3682
+ "div",
3683
+ {
3684
+ className: "oui-bg-trade-loss oui-ml-[2px] oui-rounded-sm",
3685
+ style: {
3686
+ position: "absolute",
3687
+ left: `${buyPercentage}%`,
3688
+ top: 0,
3689
+ width: `${sellPercentage}%`,
3690
+ height: "100%"
3691
+ }
3692
+ }
3693
+ )
3694
+ ]
3695
+ }
3696
+ ),
3697
+ /* @__PURE__ */ jsxs(Flex, { itemAlign: "center", gap: 1, children: [
3698
+ /* @__PURE__ */ jsxs(Text, { color: "danger", children: [
3699
+ sellPercentage.toFixed(1),
3700
+ "%"
3701
+ ] }),
3702
+ /* @__PURE__ */ jsx(Text, { intensity: 80, children: "S" })
3703
+ ] })
3704
+ ] });
3705
+ };
3706
+ }
3707
+ });
3419
3708
 
3420
3709
  // src/components/base/orderBook/index.ts
3421
3710
  var orderBook_exports = {};
3422
3711
  __export(orderBook_exports, {
3712
+ BuySellRatioBar: () => BuySellRatioBar,
3423
3713
  OrderBook: () => OrderBook2,
3424
3714
  OrderBookWidget: () => OrderBookWidget,
3425
3715
  useOrderBookScript: () => useOrderBookScript
@@ -3429,6 +3719,7 @@ var init_orderBook2 = __esm({
3429
3719
  init_orderBook_ui();
3430
3720
  init_orderBook_widget();
3431
3721
  init_orderBook_script();
3722
+ init_buySellRatioBar();
3432
3723
  }
3433
3724
  });
3434
3725
  var RiskRate;
@@ -3571,14 +3862,14 @@ var init_riskRate = __esm({
3571
3862
  var LazyLastTradesWidget, LazyOrderBookWidget, TwoColLayout, TabLayout, Title2, OrderBookAndTrades;
3572
3863
  var init_orderBookAndTrades_ui = __esm({
3573
3864
  "src/components/desktop/orderBookAndTrades/orderBookAndTrades.ui.tsx"() {
3574
- LazyLastTradesWidget = React11.lazy(
3865
+ LazyLastTradesWidget = React12.lazy(
3575
3866
  () => Promise.resolve().then(() => (init_lastTrades(), lastTrades_exports)).then((mod) => {
3576
3867
  return {
3577
3868
  default: mod.LastTradesWidget
3578
3869
  };
3579
3870
  })
3580
3871
  );
3581
- LazyOrderBookWidget = React11.lazy(
3872
+ LazyOrderBookWidget = React12.lazy(
3582
3873
  () => Promise.resolve().then(() => (init_orderBook2(), orderBook_exports)).then((mod) => {
3583
3874
  return {
3584
3875
  default: mod.OrderBookWidget
@@ -3615,7 +3906,7 @@ var init_orderBookAndTrades_ui = __esm({
3615
3906
  className: "oui-pl-3 oui-text-sm"
3616
3907
  }
3617
3908
  ),
3618
- /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3909
+ /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3619
3910
  LazyOrderBookWidget,
3620
3911
  {
3621
3912
  symbol: props.symbol,
@@ -3641,7 +3932,7 @@ var init_orderBookAndTrades_ui = __esm({
3641
3932
  className: "oui-text-sm oui-px-3"
3642
3933
  }
3643
3934
  ),
3644
- /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3935
+ /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3645
3936
  LazyLastTradesWidget,
3646
3937
  {
3647
3938
  symbol: props.symbol,
@@ -3683,14 +3974,14 @@ var init_orderBookAndTrades_ui = __esm({
3683
3974
  },
3684
3975
  size: "lg",
3685
3976
  children: [
3686
- /* @__PURE__ */ jsx(TabPanel, { value: "orderBook", title: t("trading.orderBook"), children: /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3977
+ /* @__PURE__ */ jsx(TabPanel, { value: "orderBook", title: t("trading.orderBook"), children: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3687
3978
  LazyOrderBookWidget,
3688
3979
  {
3689
3980
  symbol: props.symbol,
3690
3981
  height: props.containerSize ? props.containerSize.height - 29 - 18 : void 0
3691
3982
  }
3692
3983
  ) }) }),
3693
- /* @__PURE__ */ jsx(TabPanel, { value: "lastTrades", title: t("trading.lastTrades"), children: /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3984
+ /* @__PURE__ */ jsx(TabPanel, { value: "lastTrades", title: t("trading.lastTrades"), children: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
3694
3985
  LazyLastTradesWidget,
3695
3986
  {
3696
3987
  symbol: props.symbol,
@@ -4053,10 +4344,8 @@ var init_switchLayout = __esm({
4053
4344
  );
4054
4345
  MarketLeftIcon = ({ isSelected, isHovered, ...props }) => {
4055
4346
  const getStrokeColor = () => {
4056
- if (isSelected)
4057
- return "rgb(var(--oui-color-primary-light))";
4058
- if (isHovered)
4059
- return "rgb(var(--oui-color-primary-light))";
4347
+ if (isSelected) return "rgb(var(--oui-color-primary-light))";
4348
+ if (isHovered) return "rgb(var(--oui-color-primary-light))";
4060
4349
  return "rgb(var(--oui-color-base-5))";
4061
4350
  };
4062
4351
  return /* @__PURE__ */ jsxs(
@@ -4094,10 +4383,8 @@ var init_switchLayout = __esm({
4094
4383
  };
4095
4384
  MarketTopIcon = ({ isSelected, isHovered, ...props }) => {
4096
4385
  const getStrokeColor = () => {
4097
- if (isSelected)
4098
- return "rgb(var(--oui-color-primary-light))";
4099
- if (isHovered)
4100
- return "rgb(var(--oui-color-primary-light))";
4386
+ if (isSelected) return "rgb(var(--oui-color-primary-light))";
4387
+ if (isHovered) return "rgb(var(--oui-color-primary-light))";
4101
4388
  return "rgb(var(--oui-color-base-5))";
4102
4389
  };
4103
4390
  return /* @__PURE__ */ jsxs(
@@ -4149,10 +4436,8 @@ var init_switchLayout = __esm({
4149
4436
  };
4150
4437
  MarketBottomIcon = ({ isSelected, isHovered, ...props }) => {
4151
4438
  const getStrokeColor = () => {
4152
- if (isSelected)
4153
- return "rgb(var(--oui-color-primary-light))";
4154
- if (isHovered)
4155
- return "rgb(var(--oui-color-primary-light))";
4439
+ if (isSelected) return "rgb(var(--oui-color-primary-light))";
4440
+ if (isHovered) return "rgb(var(--oui-color-primary-light))";
4156
4441
  return "rgb(var(--oui-color-base-5))";
4157
4442
  };
4158
4443
  return /* @__PURE__ */ jsxs(
@@ -4204,10 +4489,8 @@ var init_switchLayout = __esm({
4204
4489
  };
4205
4490
  MarketHideIcon = ({ isSelected, isHovered, ...props }) => {
4206
4491
  const getStrokeColor = () => {
4207
- if (isSelected)
4208
- return "rgb(var(--oui-color-primary-light))";
4209
- if (isHovered)
4210
- return "rgb(var(--oui-color-primary-light))";
4492
+ if (isSelected) return "rgb(var(--oui-color-primary-light))";
4493
+ if (isHovered) return "rgb(var(--oui-color-primary-light))";
4211
4494
  return "rgb(var(--oui-color-base-5))";
4212
4495
  };
4213
4496
  return /* @__PURE__ */ jsxs(
@@ -4842,17 +5125,17 @@ var init_topTab_ui = __esm({
4842
5125
  "src/components/mobile/topTab/topTab.ui.tsx"() {
4843
5126
  init_tradingPageContext();
4844
5127
  init_topTab_script();
4845
- LazyTradingviewWidget = React11.lazy(
5128
+ LazyTradingviewWidget = React12.lazy(
4846
5129
  () => Promise.resolve().then(() => (init_tradingview_widget(), tradingview_widget_exports)).then((mod) => {
4847
5130
  return { default: mod.TradingviewWidget };
4848
5131
  })
4849
5132
  );
4850
- LazyMWebLastTrades = React11.lazy(
5133
+ LazyMWebLastTrades = React12.lazy(
4851
5134
  () => Promise.resolve().then(() => (init_lastTrades_widget2(), lastTrades_widget_exports)).then((mod) => {
4852
5135
  return { default: mod.MWebLastTrades };
4853
5136
  })
4854
5137
  );
4855
- LazyTradeDataWidget = React11.lazy(
5138
+ LazyTradeDataWidget = React12.lazy(
4856
5139
  () => Promise.resolve().then(() => (init_tradeData(), tradeData_exports)).then((mod) => {
4857
5140
  return { default: mod.TradeDataWidget };
4858
5141
  })
@@ -4885,15 +5168,15 @@ var init_topTab_ui = __esm({
4885
5168
  }
4886
5169
  ) }),
4887
5170
  children: [
4888
- /* @__PURE__ */ jsx(TabPanel, { title: t("trading.tabs.chart"), value: "chart" /* chart */, children: /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
5171
+ /* @__PURE__ */ jsx(TabPanel, { title: t("trading.tabs.chart"), value: "chart" /* chart */, children: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
4889
5172
  LazyTradingviewWidget,
4890
5173
  {
4891
5174
  symbol: props.symbol,
4892
5175
  tradingViewConfig
4893
5176
  }
4894
5177
  ) }) }),
4895
- /* @__PURE__ */ jsx(TabPanel, { title: t("trading.tabs.trades"), value: "trades" /* trades */, children: /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyMWebLastTrades, { symbol: props.symbol }) }) }),
4896
- /* @__PURE__ */ jsx(TabPanel, { title: t("trading.tabs.data"), value: "data" /* data */, children: /* @__PURE__ */ jsx(Box, { px: 3, children: /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyTradeDataWidget, { symbol: props.symbol }) }) }) })
5178
+ /* @__PURE__ */ jsx(TabPanel, { title: t("trading.tabs.trades"), value: "trades" /* trades */, children: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyMWebLastTrades, { symbol: props.symbol }) }) }),
5179
+ /* @__PURE__ */ jsx(TabPanel, { title: t("trading.tabs.data"), value: "data" /* data */, children: /* @__PURE__ */ jsx(Box, { px: 3, children: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyTradeDataWidget, { symbol: props.symbol }) }) }) })
4897
5180
  ]
4898
5181
  }
4899
5182
  );
@@ -4954,7 +5237,7 @@ var init_topTab = __esm({
4954
5237
  var LazyOrderBookWidget2, OrderBookAndEntry;
4955
5238
  var init_orderBookAndEntry_ui = __esm({
4956
5239
  "src/components/mobile/orderBookAndEntry/orderBookAndEntry.ui.tsx"() {
4957
- LazyOrderBookWidget2 = React11.lazy(
5240
+ LazyOrderBookWidget2 = React12.lazy(
4958
5241
  () => Promise.resolve().then(() => (init_orderBook2(), orderBook_exports)).then((mod) => {
4959
5242
  return { default: mod.OrderBookWidget };
4960
5243
  })
@@ -4990,7 +5273,7 @@ var init_orderBookAndEntry_ui = __esm({
4990
5273
  {
4991
5274
  className: "oui-rounded-xl oui-bg-base-9",
4992
5275
  style: { height: `${height + 16}px` },
4993
- children: /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
5276
+ children: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
4994
5277
  LazyOrderBookWidget2,
4995
5278
  {
4996
5279
  symbol: props.symbol,
@@ -5158,7 +5441,7 @@ var LazyPositionHeaderWidget2, SymbolControlHeader, OrdersView, PositionsView2,
5158
5441
  var init_dataList_ui2 = __esm({
5159
5442
  "src/components/mobile/dataList/dataList.ui.tsx"() {
5160
5443
  init_dataList_script2();
5161
- LazyPositionHeaderWidget2 = React11.lazy(
5444
+ LazyPositionHeaderWidget2 = React12.lazy(
5162
5445
  () => Promise.resolve().then(() => (init_positionHeader(), positionHeader_exports)).then((mod) => {
5163
5446
  return { default: mod.PositionHeaderWidget };
5164
5447
  })
@@ -5249,7 +5532,7 @@ var init_dataList_ui2 = __esm({
5249
5532
  };
5250
5533
  PositionsView2 = (props) => {
5251
5534
  return /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
5252
- /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
5535
+ /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
5253
5536
  LazyPositionHeaderWidget2,
5254
5537
  {
5255
5538
  pnlNotionalDecimalPrecision: props.pnlNotionalDecimalPrecision,
@@ -5259,7 +5542,7 @@ var init_dataList_ui2 = __esm({
5259
5542
  setUnPnlPriceBasic: props.setUnPnlPriceBasic
5260
5543
  }
5261
5544
  ) }),
5262
- /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
5545
+ /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
5263
5546
  MobilePositionsWidget,
5264
5547
  {
5265
5548
  symbol: props.showAllSymbol ? void 0 : props.symbol,
@@ -6892,7 +7175,7 @@ init_fundingRateModal_widget();
6892
7175
  var SortablePanel = (props) => {
6893
7176
  const { showIndicator, dragOverlay } = props;
6894
7177
  const nodeRef = useRef(null);
6895
- const [dimensions, setDimensions] = React11.useState(null);
7178
+ const [dimensions, setDimensions] = React12.useState(null);
6896
7179
  const sortableResult = useSortable({
6897
7180
  id: props.id
6898
7181
  });
@@ -7442,35 +7725,35 @@ function useExtraHeight(options) {
7442
7725
  dataListHeight
7443
7726
  };
7444
7727
  }
7445
- var LazyRiskRateWidget = React11.lazy(
7728
+ var LazyRiskRateWidget = React12.lazy(
7446
7729
  () => Promise.resolve().then(() => (init_riskRate(), riskRate_exports)).then((mod) => {
7447
7730
  return {
7448
7731
  default: mod.RiskRateWidget
7449
7732
  };
7450
7733
  })
7451
7734
  );
7452
- var LazyAssetViewWidget = React11.lazy(
7735
+ var LazyAssetViewWidget = React12.lazy(
7453
7736
  () => Promise.resolve().then(() => (init_assetView(), assetView_exports)).then((mod) => {
7454
7737
  return {
7455
7738
  default: mod.AssetViewWidget
7456
7739
  };
7457
7740
  })
7458
7741
  );
7459
- var LazyDataListWidget = React11.lazy(
7742
+ var LazyDataListWidget = React12.lazy(
7460
7743
  () => Promise.resolve().then(() => (init_dataList(), dataList_exports)).then((mod) => {
7461
7744
  return {
7462
7745
  default: mod.DataListWidget
7463
7746
  };
7464
7747
  })
7465
7748
  );
7466
- var LazySwitchLayout = React11.lazy(
7749
+ var LazySwitchLayout = React12.lazy(
7467
7750
  () => Promise.resolve().then(() => (init_switchLayout(), switchLayout_exports)).then((mod) => {
7468
7751
  return {
7469
7752
  default: mod.SwitchLayout
7470
7753
  };
7471
7754
  })
7472
7755
  );
7473
- var LazyOrderBookAndTradesWidget = React11.lazy(
7756
+ var LazyOrderBookAndTradesWidget = React12.lazy(
7474
7757
  () => Promise.resolve().then(() => (init_orderBookAndTrades(), orderBookAndTrades_exports)).then((mod) => {
7475
7758
  return {
7476
7759
  default: mod.OrderBookAndTradesWidget
@@ -7660,7 +7943,7 @@ var DesktopLayout3 = (props) => {
7660
7943
  onSymbolChange: props.onSymbolChange,
7661
7944
  closeCountdown,
7662
7945
  showCountdown,
7663
- trailing: /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
7946
+ trailing: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
7664
7947
  LazySwitchLayout,
7665
7948
  {
7666
7949
  layout,
@@ -7702,7 +7985,7 @@ var DesktopLayout3 = (props) => {
7702
7985
  children: tradingviewWidget
7703
7986
  }
7704
7987
  );
7705
- const orderbookWidget = /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyOrderBookAndTradesWidget, { symbol: props.symbol }) });
7988
+ const orderbookWidget = /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyOrderBookAndTradesWidget, { symbol: props.symbol }) });
7706
7989
  const orderbookView = /* @__PURE__ */ jsx(
7707
7990
  Box,
7708
7991
  {
@@ -7717,7 +8000,7 @@ var DesktopLayout3 = (props) => {
7717
8000
  children: orderbookWidget
7718
8001
  }
7719
8002
  );
7720
- const dataListWidget = /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
8003
+ const dataListWidget = /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
7721
8004
  LazyDataListWidget,
7722
8005
  {
7723
8006
  current: void 0,
@@ -7745,12 +8028,12 @@ var DesktopLayout3 = (props) => {
7745
8028
  return {
7746
8029
  margin: {
7747
8030
  className: "",
7748
- element: /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyRiskRateWidget, {}) })
8031
+ element: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyRiskRateWidget, {}) })
7749
8032
  },
7750
8033
  assets: {
7751
8034
  className: "oui-border oui-border-line-12",
7752
8035
  element: /* @__PURE__ */ jsxs(Fragment, { children: [
7753
- /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
8036
+ /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
7754
8037
  LazyAssetViewWidget,
7755
8038
  {
7756
8039
  isFirstTimeDeposit: props.isFirstTimeDeposit
@@ -8272,17 +8555,17 @@ function breakDownSeconds(total) {
8272
8555
  const secs = remAfterHours % SEC_PER_MIN;
8273
8556
  return [days, hours, mins, secs];
8274
8557
  }
8275
- var LazyTopTabWidget = React11.lazy(
8558
+ var LazyTopTabWidget = React12.lazy(
8276
8559
  () => Promise.resolve().then(() => (init_topTab(), topTab_exports)).then((mod) => {
8277
8560
  return { default: mod.TopTabWidget };
8278
8561
  })
8279
8562
  );
8280
- var LazyOrderBookAndEntryWidget = React11.lazy(
8563
+ var LazyOrderBookAndEntryWidget = React12.lazy(
8281
8564
  () => Promise.resolve().then(() => (init_orderBookAndEntry(), orderBookAndEntry_exports)).then((mod) => {
8282
8565
  return { default: mod.OrderBookAndEntryWidget };
8283
8566
  })
8284
8567
  );
8285
- var LazyDataListWidget2 = React11.lazy(
8568
+ var LazyDataListWidget2 = React12.lazy(
8286
8569
  () => Promise.resolve().then(() => (init_dataList2(), dataList_exports2)).then((mod) => {
8287
8570
  return { default: mod.DataListWidget };
8288
8571
  })
@@ -8431,9 +8714,9 @@ var MobileLayout3 = (props) => {
8431
8714
  ] });
8432
8715
  return /* @__PURE__ */ jsx("div", { className: "oui-relative oui-grid oui-gap-1 oui-bg-base-10", children: /* @__PURE__ */ jsxs("main", { className: "oui-hide-scrollbar oui-space-y-1 oui-overflow-y-auto", children: [
8433
8716
  topBar,
8434
- /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyTopTabWidget, { className: "oui-mx-1 oui-rounded-xl oui-bg-base-9" }) }),
8435
- /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyOrderBookAndEntryWidget, {}) }),
8436
- /* @__PURE__ */ jsx(React11.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
8717
+ /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyTopTabWidget, { className: "oui-mx-1 oui-rounded-xl oui-bg-base-9" }) }),
8718
+ /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyOrderBookAndEntryWidget, {}) }),
8719
+ /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
8437
8720
  LazyDataListWidget2,
8438
8721
  {
8439
8722
  symbol: props.symbol,
@@ -8501,6 +8784,6 @@ var TradingPage = (props) => {
8501
8784
  init_tradingPageContext();
8502
8785
  init_hooks();
8503
8786
 
8504
- export { AssetView, AssetViewWidget, BottomNavBar, BottomNavBarWidget, DataList, DataListWidget, FundingRate, FundingRateDialogId, FundingRateModal, FundingRateModalWidget, FundingRateSheetId, FundingRateWidget, LastTrades, LastTradesWidget, OrderBook2 as OrderBook, OrderBookAndTrades, OrderBookAndTradesWidget, OrderBookWidget, PortfolioSheet, PortfolioSheetWidget, RiskRate, RiskRateWidget, SplitLayout, Trading, TradingPage, TradingPageContext, TradingPageProvider, TradingWidget, useBottomNavBarScript, useFundingRateModalScript, useFundingRateScript, useOrderBookAndTradesScript, useOrderBookScript, usePendingOrderCount, usePortfolioSheetScript, usePositionsCount, useTradingLocalStorage, useTradingPageContext, useTradingScript };
8505
- //# sourceMappingURL=out.js.map
8787
+ export { AssetView, AssetViewWidget, BottomNavBar, BottomNavBarWidget, BuySellRatioBar, DataList, DataListWidget, FundingRate, FundingRateDialogId, FundingRateModal, FundingRateModalWidget, FundingRateSheetId, FundingRateWidget, LastTrades, LastTradesWidget, OrderBook2 as OrderBook, OrderBookAndTrades, OrderBookAndTradesWidget, OrderBookWidget, PortfolioSheet, PortfolioSheetWidget, RiskRate, RiskRateWidget, SplitLayout, Trading, TradingPage, TradingPageContext, TradingPageProvider, TradingWidget, useBottomNavBarScript, useFundingRateModalScript, useFundingRateScript, useOrderBookAndTradesScript, useOrderBookScript, usePendingOrderCount, usePortfolioSheetScript, usePositionsCount, useTradingLocalStorage, useTradingPageContext, useTradingScript };
8788
+ //# sourceMappingURL=index.mjs.map
8506
8789
  //# sourceMappingURL=index.mjs.map