@orderly.network/trading 3.0.4-alpha.0 → 3.0.4-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,13 +1,15 @@
1
+ import { SymbolInfoBarFullProps } from '@orderly.network/markets';
1
2
  import * as React$1 from 'react';
2
- import React__default, { ReactNode, FC, RefObject, PropsWithChildren } from 'react';
3
+ import React__default, { ReactNode, RefObject, FC, PropsWithChildren } from 'react';
3
4
  import * as _orderly_network_types from '@orderly.network/types';
4
5
  import { API, NetworkId, AccountStatusEnum } from '@orderly.network/types';
5
6
  import * as _orderly_network_ui_share from '@orderly.network/ui-share';
6
7
  import { SharePnLConfig } from '@orderly.network/ui-share';
7
8
  import { TradingviewWidgetPropsInterface } from '@orderly.network/ui-tradingview';
9
+ import { AccountState as AccountState$1 } from '@orderly.network/core';
10
+ import Split, { SplitProps } from '@uiw/react-split';
8
11
  import { PositionsProps } from '@orderly.network/ui-positions';
9
12
  import * as _orderly_network_hooks from '@orderly.network/hooks';
10
- import Split, { SplitProps } from '@uiw/react-split';
11
13
  import { SliderMarks } from '@orderly.network/ui';
12
14
  import * as react_jsx_runtime from 'react/jsx-runtime';
13
15
 
@@ -146,6 +148,127 @@ type TradingPageProps = BaseTradingPageProps & {
146
148
  bottomSheetLeading?: React.ReactNode | string;
147
149
  };
148
150
 
151
+ /**
152
+ * Desktop asks list props. `symbolInfo` and `depth` are threaded through
153
+ * {@link InjectableDesktopAsks} so Orderly plugins replacing `OrderBook.Desktop.Asks`
154
+ * can render without relying only on context. The default `DesktopAsks` uses `data`
155
+ * and reads symbol/depth from `OrderBookProvider` / `OrderBookContext`.
156
+ */
157
+ interface Props$1 {
158
+ data: number[][];
159
+ /** For plugin replacements; unused by the default asks row list (context carries symbol). */
160
+ symbolInfo: BasicSymbolInfo;
161
+ /** For plugin replacements; active depth key; unused by the default list (context carries depth). */
162
+ depth: string | undefined;
163
+ }
164
+
165
+ /**
166
+ * Desktop bids list props. `symbolInfo` and `depth` are threaded through
167
+ * {@link InjectableDesktopBids} so Orderly plugins replacing `OrderBook.Desktop.Bids`
168
+ * can render without relying only on context. The default `DesktopBids` uses `data`
169
+ * and reads symbol/depth from `OrderBookProvider` / `OrderBookContext`.
170
+ */
171
+ interface Props {
172
+ data: number[][];
173
+ /** For plugin replacements; unused by the default bids row list (context carries symbol). */
174
+ symbolInfo: BasicSymbolInfo;
175
+ /** For plugin replacements; active depth key; unused by the default list (context carries depth). */
176
+ depth: string | undefined;
177
+ }
178
+
179
+ declare const useAccountScript: () => {
180
+ onShowAccountSheet: () => void;
181
+ address: string | undefined;
182
+ state: AccountState$1;
183
+ };
184
+ type AccountState = ReturnType<typeof useAccountScript>;
185
+
186
+ type LayoutPosition = "left" | "right";
187
+
188
+ type TradingState = ReturnType<typeof useTradingScript>;
189
+ type MarketLayoutPosition = "left" | "top" | "bottom" | "hide";
190
+ declare const useTradingScript: () => TradingPageState & {
191
+ marketsWidth: number;
192
+ tradindviewMaxHeight: number;
193
+ dataListMinHeight: number;
194
+ total: number | null;
195
+ hideAssets: any;
196
+ setHideAssets: (value: boolean) => void;
197
+ onShowPortfolioSheet: () => void;
198
+ navigateToPortfolio: (() => void) | undefined;
199
+ isFirstTimeDeposit: boolean;
200
+ symbolInfoBarHeight: number;
201
+ max2XLSplitRef: RefObject<Split>;
202
+ tradingviewAndOrderbookSplitRef: RefObject<Split>;
203
+ onTradingviewAndOrderbookDragging: (preSize: number, nextSize: number) => void;
204
+ onDataListSplitHeightDragging: (preSize: number, nextSize: number) => void;
205
+ extraHeight: any;
206
+ dataListHeight: any;
207
+ restrictedInfo: {
208
+ ip: string;
209
+ invalidRegions: string[];
210
+ restrictedOpen: boolean;
211
+ content: React$1.ReactNode | ((data: {
212
+ ip: string;
213
+ brokerName: string;
214
+ }) => React$1.ReactNode);
215
+ canUnblock: boolean;
216
+ accessRestricted: any;
217
+ setAccessRestricted: (value: boolean | undefined) => void;
218
+ };
219
+ orderEntryViewRef: RefObject<HTMLDivElement>;
220
+ orderEntryHeight: number;
221
+ orderBookSplitSize: string | undefined;
222
+ setOrderbookSplitSize: (size: string) => void;
223
+ dataListSplitSize: string | undefined;
224
+ setDataListSplitSize: (size: string) => void;
225
+ mainSplitSize: string | undefined;
226
+ setMainSplitSize: (size: string) => void;
227
+ dataListSplitHeightSM: string | undefined;
228
+ setDataListSplitHeightSM: (size: string) => void;
229
+ orderBookSplitHeightSM: string | undefined;
230
+ setOrderbookSplitHeightSM: (size: string) => void;
231
+ positions: number[];
232
+ showPositionIcon: boolean;
233
+ updatePositions: (currentIdx: number, targetIdx: number) => void;
234
+ resizeable: boolean;
235
+ panelSize: "small" | "middle" | "large";
236
+ onPanelSizeChange: (collapsed: "small" | "middle" | "large") => void;
237
+ animating: boolean;
238
+ setAnimating: React$1.Dispatch<React$1.SetStateAction<boolean>>;
239
+ layout: any;
240
+ onLayout: (value: LayoutPosition) => void;
241
+ marketLayout: any;
242
+ onMarketLayout: (value: MarketLayoutPosition) => void;
243
+ max2XL: boolean;
244
+ min3XL: boolean;
245
+ max4XL: boolean;
246
+ canTrade: boolean;
247
+ openMarketsSheet: boolean;
248
+ onOpenMarketsSheetChange: React$1.Dispatch<React$1.SetStateAction<boolean>>;
249
+ horizontalDraggable: boolean;
250
+ };
251
+
252
+ type DesktopLayoutProps = TradingState & {
253
+ className?: string;
254
+ };
255
+
256
+ /**
257
+ * Module augmentation: maps interceptor target paths to their component props types.
258
+ * Import from @orderly.network/trading to enable typed props in
259
+ * createInterceptor('Trading.Layout.Desktop', ...), createInterceptor('Account.MobileAccountMenu', ...), etc.
260
+ */
261
+
262
+ declare module "@orderly.network/plugin-core" {
263
+ interface InterceptorTargetPropsMap {
264
+ "Account.MobileAccountMenu": AccountState;
265
+ "OrderBook.Desktop.Asks": Props$1;
266
+ "OrderBook.Desktop.Bids": Props;
267
+ "Trading.Layout.Desktop": DesktopLayoutProps;
268
+ "Trading.SymbolInfoBar.Desktop": SymbolInfoBarFullProps;
269
+ }
270
+ }
271
+
149
272
  declare enum DataListTabType {
150
273
  positions = "Positions",
151
274
  pending = "Pending",
@@ -306,6 +429,36 @@ interface BuySellRatioBarProps {
306
429
  }
307
430
  declare const BuySellRatioBar: FC<BuySellRatioBarProps>;
308
431
 
432
+ type QtyMode = "quantity" | "amount";
433
+ type TotalMode = "quantity" | "amount";
434
+
435
+ interface OrderBookContextValue {
436
+ cellHeight: number;
437
+ mode: QtyMode;
438
+ depth?: string;
439
+ onModeChange?: (mode: QtyMode) => void;
440
+ onItemClick?: (item: number[]) => void;
441
+ showTotal: boolean;
442
+ totalMode: TotalMode;
443
+ pendingOrders: ReadonlyArray<number> | number[];
444
+ onTotalModeChange?: (mode: TotalMode) => void;
445
+ symbolInfo: BasicSymbolInfo;
446
+ showBuySellRatio: boolean;
447
+ onShowBuySellRatioChange?: (show: boolean) => void;
448
+ }
449
+ declare const useOrderBookContext: () => OrderBookContextValue;
450
+ interface OrderBookProviderProps {
451
+ cellHeight: number;
452
+ depth?: string;
453
+ showTotal: boolean;
454
+ pendingOrders: ReadonlyArray<number> | number[];
455
+ onItemClick?: (item: number[]) => void;
456
+ symbolInfo: BasicSymbolInfo;
457
+ showBuySellRatio?: boolean;
458
+ onShowBuySellRatioChange?: (show: boolean) => void;
459
+ }
460
+ declare const OrderBookProvider: FC<PropsWithChildren<OrderBookProviderProps>>;
461
+
309
462
  declare const useRiskRateScript: () => {
310
463
  riskRate: string | null;
311
464
  riskRateColor: {
@@ -371,7 +524,7 @@ declare const usePortfolioSheetScript: () => {
371
524
  hasSubAccount: boolean;
372
525
  aggregated: Omit<_orderly_network_types.API.PositionsTPSLExt, "rows">;
373
526
  totalUnrealizedROI: number;
374
- positionsInfo: Record<"unsettledPnL" | "margin_ratio" | "initial_margin_ratio" | "maintenance_margin_ratio" | "open_margin_ratio" | "current_margin_ratio_with_orders" | "initial_margin_ratio_with_orders" | "maintenance_margin_ratio_with_orders" | "total_collateral_value" | "free_collateral" | "total_pnl_24_h" | "unrealPnL" | "total_unreal_pnl" | "total_unreal_pnl_index" | "total_unsettled_pnl" | "notional" | "unrealPnlROI" | "unrealPnlROI_index" | "total_unsettled_cross_pnl" | "total_unsettled_isolated_pnl", <Key extends "unsettledPnL" | "margin_ratio" | "initial_margin_ratio" | "maintenance_margin_ratio" | "open_margin_ratio" | "current_margin_ratio_with_orders" | "initial_margin_ratio_with_orders" | "maintenance_margin_ratio_with_orders" | "total_collateral_value" | "free_collateral" | "total_pnl_24_h" | "unrealPnL" | "total_unreal_pnl" | "total_unreal_pnl_index" | "total_unsettled_pnl" | "notional" | "unrealPnlROI" | "unrealPnlROI_index" | "total_unsettled_cross_pnl" | "total_unsettled_isolated_pnl">(defaultValue?: Omit<_orderly_network_types.API.PositionInfo, "rows">[Key] | undefined) => Omit<_orderly_network_types.API.PositionInfo, "rows">[Key]> & {
527
+ positionsInfo: Record<"notional" | "unsettledPnL" | "margin_ratio" | "initial_margin_ratio" | "maintenance_margin_ratio" | "open_margin_ratio" | "current_margin_ratio_with_orders" | "initial_margin_ratio_with_orders" | "maintenance_margin_ratio_with_orders" | "total_collateral_value" | "free_collateral" | "total_pnl_24_h" | "unrealPnL" | "total_unreal_pnl" | "total_unreal_pnl_index" | "total_unsettled_pnl" | "unrealPnlROI" | "unrealPnlROI_index" | "total_unsettled_cross_pnl" | "total_unsettled_isolated_pnl", <Key extends "unsettledPnL" | "margin_ratio" | "initial_margin_ratio" | "maintenance_margin_ratio" | "open_margin_ratio" | "current_margin_ratio_with_orders" | "initial_margin_ratio_with_orders" | "maintenance_margin_ratio_with_orders" | "total_collateral_value" | "free_collateral" | "total_pnl_24_h" | "unrealPnL" | "total_unreal_pnl" | "total_unreal_pnl_index" | "total_unsettled_pnl" | "notional" | "unrealPnlROI" | "unrealPnlROI_index" | "total_unsettled_cross_pnl" | "total_unsettled_isolated_pnl">(defaultValue?: Omit<_orderly_network_types.API.PositionInfo, "rows">[Key] | undefined) => Omit<_orderly_network_types.API.PositionInfo, "rows">[Key]> & {
375
528
  isNil: boolean;
376
529
  };
377
530
  marginRatio: number;
@@ -449,72 +602,6 @@ declare const FundingRateModalWidget: React__default.FC<{
449
602
  declare const FundingRateDialogId = "FundingRateDialogId";
450
603
  declare const FundingRateSheetId = "FundingRateSheetId";
451
604
 
452
- type LayoutPosition = "left" | "right";
453
-
454
- type TradingState = ReturnType<typeof useTradingScript>;
455
- type MarketLayoutPosition = "left" | "top" | "bottom" | "hide";
456
- declare const useTradingScript: () => TradingPageState & {
457
- marketsWidth: number;
458
- tradindviewMaxHeight: number;
459
- dataListMinHeight: number;
460
- total: number | null;
461
- hideAssets: any;
462
- setHideAssets: (value: boolean) => void;
463
- onShowPortfolioSheet: () => void;
464
- navigateToPortfolio: (() => void) | undefined;
465
- isFirstTimeDeposit: boolean;
466
- symbolInfoBarHeight: number;
467
- max2XLSplitRef: RefObject<Split>;
468
- tradingviewAndOrderbookSplitRef: RefObject<Split>;
469
- onTradingviewAndOrderbookDragging: (preSize: number, nextSize: number) => void;
470
- onDataListSplitHeightDragging: (preSize: number, nextSize: number) => void;
471
- extraHeight: any;
472
- dataListHeight: any;
473
- restrictedInfo: {
474
- ip: string;
475
- invalidRegions: string[];
476
- restrictedOpen: boolean;
477
- content: React$1.ReactNode | ((data: {
478
- ip: string;
479
- brokerName: string;
480
- }) => React$1.ReactNode);
481
- canUnblock: boolean;
482
- accessRestricted: any;
483
- setAccessRestricted: (value: boolean | undefined) => void;
484
- };
485
- orderEntryViewRef: RefObject<HTMLDivElement>;
486
- orderEntryHeight: number;
487
- orderBookSplitSize: string | undefined;
488
- setOrderbookSplitSize: (size: string) => void;
489
- dataListSplitSize: string | undefined;
490
- setDataListSplitSize: (size: string) => void;
491
- mainSplitSize: string | undefined;
492
- setMainSplitSize: (size: string) => void;
493
- dataListSplitHeightSM: string | undefined;
494
- setDataListSplitHeightSM: (size: string) => void;
495
- orderBookSplitHeightSM: string | undefined;
496
- setOrderbookSplitHeightSM: (size: string) => void;
497
- positions: number[];
498
- showPositionIcon: boolean;
499
- updatePositions: (currentIdx: number, targetIdx: number) => void;
500
- resizeable: boolean;
501
- panelSize: "middle" | "small" | "large";
502
- onPanelSizeChange: (collapsed: "small" | "middle" | "large") => void;
503
- animating: boolean;
504
- setAnimating: React$1.Dispatch<React$1.SetStateAction<boolean>>;
505
- layout: any;
506
- onLayout: (value: LayoutPosition) => void;
507
- marketLayout: any;
508
- onMarketLayout: (value: MarketLayoutPosition) => void;
509
- max2XL: boolean;
510
- min3XL: boolean;
511
- max4XL: boolean;
512
- canTrade: boolean;
513
- openMarketsSheet: boolean;
514
- onOpenMarketsSheetChange: React$1.Dispatch<React$1.SetStateAction<boolean>>;
515
- horizontalDraggable: boolean;
516
- };
517
-
518
605
  declare const Trading: FC<TradingState>;
519
606
 
520
607
  declare const TradingWidget: React__default.FC;
@@ -548,4 +635,4 @@ declare const usePendingOrderCount: (symbol?: string) => {
548
635
  tpSlOrderCount: number;
549
636
  };
550
637
 
551
- export { AssetView, AssetViewWidget, BottomNavBar, BottomNavBarWidget, type BuySellRatio, BuySellRatioBar, DataList, DataListWidget, FundingRate, FundingRateDialogId, FundingRateModal, type FundingRateModalState, FundingRateModalWidget, FundingRateSheetId, FundingRateWidget, LastTrades, LastTradesWidget, OrderBook, OrderBookAndTrades, OrderBookAndTradesWidget, OrderBookWidget, PortfolioSheet, PortfolioSheetWidget, type ReferralProps, RiskRate, RiskRateWidget, type ShareOptions, SplitLayout, Trading, TradingPage, TradingPageContext, type TradingPageProps, TradingPageProvider, type TradingRewardsProps, TradingWidget, useBottomNavBarScript, useFundingRateModalScript, useFundingRateScript, useOrderBookAndTradesScript, useOrderBookScript, usePendingOrderCount, usePortfolioSheetScript, usePositionsCount, useTradingLocalStorage, useTradingPageContext, useTradingScript };
638
+ export { type AccountState, AssetView, AssetViewWidget, BottomNavBar, BottomNavBarWidget, type BuySellRatio, BuySellRatioBar, DataList, DataListWidget, type DesktopLayoutProps, FundingRate, FundingRateDialogId, FundingRateModal, type FundingRateModalState, FundingRateModalWidget, FundingRateSheetId, FundingRateWidget, LastTrades, LastTradesWidget, OrderBook, OrderBookAndTrades, OrderBookAndTradesWidget, type Props$1 as OrderBookDesktopAsksProps, type Props as OrderBookDesktopBidsProps, OrderBookProvider, OrderBookWidget, PortfolioSheet, PortfolioSheetWidget, type ReferralProps, RiskRate, RiskRateWidget, type ShareOptions, SplitLayout, Trading, TradingPage, TradingPageContext, type TradingPageProps, TradingPageProvider, type TradingRewardsProps, TradingWidget, useBottomNavBarScript, useFundingRateModalScript, useFundingRateScript, useOrderBookAndTradesScript, useOrderBookContext, useOrderBookScript, usePendingOrderCount, usePortfolioSheetScript, usePositionsCount, useTradingLocalStorage, useTradingPageContext, useTradingScript };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,15 @@
1
+ import { SymbolInfoBarFullProps } from '@orderly.network/markets';
1
2
  import * as React$1 from 'react';
2
- import React__default, { ReactNode, FC, RefObject, PropsWithChildren } from 'react';
3
+ import React__default, { ReactNode, RefObject, FC, PropsWithChildren } from 'react';
3
4
  import * as _orderly_network_types from '@orderly.network/types';
4
5
  import { API, NetworkId, AccountStatusEnum } from '@orderly.network/types';
5
6
  import * as _orderly_network_ui_share from '@orderly.network/ui-share';
6
7
  import { SharePnLConfig } from '@orderly.network/ui-share';
7
8
  import { TradingviewWidgetPropsInterface } from '@orderly.network/ui-tradingview';
9
+ import { AccountState as AccountState$1 } from '@orderly.network/core';
10
+ import Split, { SplitProps } from '@uiw/react-split';
8
11
  import { PositionsProps } from '@orderly.network/ui-positions';
9
12
  import * as _orderly_network_hooks from '@orderly.network/hooks';
10
- import Split, { SplitProps } from '@uiw/react-split';
11
13
  import { SliderMarks } from '@orderly.network/ui';
12
14
  import * as react_jsx_runtime from 'react/jsx-runtime';
13
15
 
@@ -146,6 +148,127 @@ type TradingPageProps = BaseTradingPageProps & {
146
148
  bottomSheetLeading?: React.ReactNode | string;
147
149
  };
148
150
 
151
+ /**
152
+ * Desktop asks list props. `symbolInfo` and `depth` are threaded through
153
+ * {@link InjectableDesktopAsks} so Orderly plugins replacing `OrderBook.Desktop.Asks`
154
+ * can render without relying only on context. The default `DesktopAsks` uses `data`
155
+ * and reads symbol/depth from `OrderBookProvider` / `OrderBookContext`.
156
+ */
157
+ interface Props$1 {
158
+ data: number[][];
159
+ /** For plugin replacements; unused by the default asks row list (context carries symbol). */
160
+ symbolInfo: BasicSymbolInfo;
161
+ /** For plugin replacements; active depth key; unused by the default list (context carries depth). */
162
+ depth: string | undefined;
163
+ }
164
+
165
+ /**
166
+ * Desktop bids list props. `symbolInfo` and `depth` are threaded through
167
+ * {@link InjectableDesktopBids} so Orderly plugins replacing `OrderBook.Desktop.Bids`
168
+ * can render without relying only on context. The default `DesktopBids` uses `data`
169
+ * and reads symbol/depth from `OrderBookProvider` / `OrderBookContext`.
170
+ */
171
+ interface Props {
172
+ data: number[][];
173
+ /** For plugin replacements; unused by the default bids row list (context carries symbol). */
174
+ symbolInfo: BasicSymbolInfo;
175
+ /** For plugin replacements; active depth key; unused by the default list (context carries depth). */
176
+ depth: string | undefined;
177
+ }
178
+
179
+ declare const useAccountScript: () => {
180
+ onShowAccountSheet: () => void;
181
+ address: string | undefined;
182
+ state: AccountState$1;
183
+ };
184
+ type AccountState = ReturnType<typeof useAccountScript>;
185
+
186
+ type LayoutPosition = "left" | "right";
187
+
188
+ type TradingState = ReturnType<typeof useTradingScript>;
189
+ type MarketLayoutPosition = "left" | "top" | "bottom" | "hide";
190
+ declare const useTradingScript: () => TradingPageState & {
191
+ marketsWidth: number;
192
+ tradindviewMaxHeight: number;
193
+ dataListMinHeight: number;
194
+ total: number | null;
195
+ hideAssets: any;
196
+ setHideAssets: (value: boolean) => void;
197
+ onShowPortfolioSheet: () => void;
198
+ navigateToPortfolio: (() => void) | undefined;
199
+ isFirstTimeDeposit: boolean;
200
+ symbolInfoBarHeight: number;
201
+ max2XLSplitRef: RefObject<Split>;
202
+ tradingviewAndOrderbookSplitRef: RefObject<Split>;
203
+ onTradingviewAndOrderbookDragging: (preSize: number, nextSize: number) => void;
204
+ onDataListSplitHeightDragging: (preSize: number, nextSize: number) => void;
205
+ extraHeight: any;
206
+ dataListHeight: any;
207
+ restrictedInfo: {
208
+ ip: string;
209
+ invalidRegions: string[];
210
+ restrictedOpen: boolean;
211
+ content: React$1.ReactNode | ((data: {
212
+ ip: string;
213
+ brokerName: string;
214
+ }) => React$1.ReactNode);
215
+ canUnblock: boolean;
216
+ accessRestricted: any;
217
+ setAccessRestricted: (value: boolean | undefined) => void;
218
+ };
219
+ orderEntryViewRef: RefObject<HTMLDivElement>;
220
+ orderEntryHeight: number;
221
+ orderBookSplitSize: string | undefined;
222
+ setOrderbookSplitSize: (size: string) => void;
223
+ dataListSplitSize: string | undefined;
224
+ setDataListSplitSize: (size: string) => void;
225
+ mainSplitSize: string | undefined;
226
+ setMainSplitSize: (size: string) => void;
227
+ dataListSplitHeightSM: string | undefined;
228
+ setDataListSplitHeightSM: (size: string) => void;
229
+ orderBookSplitHeightSM: string | undefined;
230
+ setOrderbookSplitHeightSM: (size: string) => void;
231
+ positions: number[];
232
+ showPositionIcon: boolean;
233
+ updatePositions: (currentIdx: number, targetIdx: number) => void;
234
+ resizeable: boolean;
235
+ panelSize: "small" | "middle" | "large";
236
+ onPanelSizeChange: (collapsed: "small" | "middle" | "large") => void;
237
+ animating: boolean;
238
+ setAnimating: React$1.Dispatch<React$1.SetStateAction<boolean>>;
239
+ layout: any;
240
+ onLayout: (value: LayoutPosition) => void;
241
+ marketLayout: any;
242
+ onMarketLayout: (value: MarketLayoutPosition) => void;
243
+ max2XL: boolean;
244
+ min3XL: boolean;
245
+ max4XL: boolean;
246
+ canTrade: boolean;
247
+ openMarketsSheet: boolean;
248
+ onOpenMarketsSheetChange: React$1.Dispatch<React$1.SetStateAction<boolean>>;
249
+ horizontalDraggable: boolean;
250
+ };
251
+
252
+ type DesktopLayoutProps = TradingState & {
253
+ className?: string;
254
+ };
255
+
256
+ /**
257
+ * Module augmentation: maps interceptor target paths to their component props types.
258
+ * Import from @orderly.network/trading to enable typed props in
259
+ * createInterceptor('Trading.Layout.Desktop', ...), createInterceptor('Account.MobileAccountMenu', ...), etc.
260
+ */
261
+
262
+ declare module "@orderly.network/plugin-core" {
263
+ interface InterceptorTargetPropsMap {
264
+ "Account.MobileAccountMenu": AccountState;
265
+ "OrderBook.Desktop.Asks": Props$1;
266
+ "OrderBook.Desktop.Bids": Props;
267
+ "Trading.Layout.Desktop": DesktopLayoutProps;
268
+ "Trading.SymbolInfoBar.Desktop": SymbolInfoBarFullProps;
269
+ }
270
+ }
271
+
149
272
  declare enum DataListTabType {
150
273
  positions = "Positions",
151
274
  pending = "Pending",
@@ -306,6 +429,36 @@ interface BuySellRatioBarProps {
306
429
  }
307
430
  declare const BuySellRatioBar: FC<BuySellRatioBarProps>;
308
431
 
432
+ type QtyMode = "quantity" | "amount";
433
+ type TotalMode = "quantity" | "amount";
434
+
435
+ interface OrderBookContextValue {
436
+ cellHeight: number;
437
+ mode: QtyMode;
438
+ depth?: string;
439
+ onModeChange?: (mode: QtyMode) => void;
440
+ onItemClick?: (item: number[]) => void;
441
+ showTotal: boolean;
442
+ totalMode: TotalMode;
443
+ pendingOrders: ReadonlyArray<number> | number[];
444
+ onTotalModeChange?: (mode: TotalMode) => void;
445
+ symbolInfo: BasicSymbolInfo;
446
+ showBuySellRatio: boolean;
447
+ onShowBuySellRatioChange?: (show: boolean) => void;
448
+ }
449
+ declare const useOrderBookContext: () => OrderBookContextValue;
450
+ interface OrderBookProviderProps {
451
+ cellHeight: number;
452
+ depth?: string;
453
+ showTotal: boolean;
454
+ pendingOrders: ReadonlyArray<number> | number[];
455
+ onItemClick?: (item: number[]) => void;
456
+ symbolInfo: BasicSymbolInfo;
457
+ showBuySellRatio?: boolean;
458
+ onShowBuySellRatioChange?: (show: boolean) => void;
459
+ }
460
+ declare const OrderBookProvider: FC<PropsWithChildren<OrderBookProviderProps>>;
461
+
309
462
  declare const useRiskRateScript: () => {
310
463
  riskRate: string | null;
311
464
  riskRateColor: {
@@ -371,7 +524,7 @@ declare const usePortfolioSheetScript: () => {
371
524
  hasSubAccount: boolean;
372
525
  aggregated: Omit<_orderly_network_types.API.PositionsTPSLExt, "rows">;
373
526
  totalUnrealizedROI: number;
374
- positionsInfo: Record<"unsettledPnL" | "margin_ratio" | "initial_margin_ratio" | "maintenance_margin_ratio" | "open_margin_ratio" | "current_margin_ratio_with_orders" | "initial_margin_ratio_with_orders" | "maintenance_margin_ratio_with_orders" | "total_collateral_value" | "free_collateral" | "total_pnl_24_h" | "unrealPnL" | "total_unreal_pnl" | "total_unreal_pnl_index" | "total_unsettled_pnl" | "notional" | "unrealPnlROI" | "unrealPnlROI_index" | "total_unsettled_cross_pnl" | "total_unsettled_isolated_pnl", <Key extends "unsettledPnL" | "margin_ratio" | "initial_margin_ratio" | "maintenance_margin_ratio" | "open_margin_ratio" | "current_margin_ratio_with_orders" | "initial_margin_ratio_with_orders" | "maintenance_margin_ratio_with_orders" | "total_collateral_value" | "free_collateral" | "total_pnl_24_h" | "unrealPnL" | "total_unreal_pnl" | "total_unreal_pnl_index" | "total_unsettled_pnl" | "notional" | "unrealPnlROI" | "unrealPnlROI_index" | "total_unsettled_cross_pnl" | "total_unsettled_isolated_pnl">(defaultValue?: Omit<_orderly_network_types.API.PositionInfo, "rows">[Key] | undefined) => Omit<_orderly_network_types.API.PositionInfo, "rows">[Key]> & {
527
+ positionsInfo: Record<"notional" | "unsettledPnL" | "margin_ratio" | "initial_margin_ratio" | "maintenance_margin_ratio" | "open_margin_ratio" | "current_margin_ratio_with_orders" | "initial_margin_ratio_with_orders" | "maintenance_margin_ratio_with_orders" | "total_collateral_value" | "free_collateral" | "total_pnl_24_h" | "unrealPnL" | "total_unreal_pnl" | "total_unreal_pnl_index" | "total_unsettled_pnl" | "unrealPnlROI" | "unrealPnlROI_index" | "total_unsettled_cross_pnl" | "total_unsettled_isolated_pnl", <Key extends "unsettledPnL" | "margin_ratio" | "initial_margin_ratio" | "maintenance_margin_ratio" | "open_margin_ratio" | "current_margin_ratio_with_orders" | "initial_margin_ratio_with_orders" | "maintenance_margin_ratio_with_orders" | "total_collateral_value" | "free_collateral" | "total_pnl_24_h" | "unrealPnL" | "total_unreal_pnl" | "total_unreal_pnl_index" | "total_unsettled_pnl" | "notional" | "unrealPnlROI" | "unrealPnlROI_index" | "total_unsettled_cross_pnl" | "total_unsettled_isolated_pnl">(defaultValue?: Omit<_orderly_network_types.API.PositionInfo, "rows">[Key] | undefined) => Omit<_orderly_network_types.API.PositionInfo, "rows">[Key]> & {
375
528
  isNil: boolean;
376
529
  };
377
530
  marginRatio: number;
@@ -449,72 +602,6 @@ declare const FundingRateModalWidget: React__default.FC<{
449
602
  declare const FundingRateDialogId = "FundingRateDialogId";
450
603
  declare const FundingRateSheetId = "FundingRateSheetId";
451
604
 
452
- type LayoutPosition = "left" | "right";
453
-
454
- type TradingState = ReturnType<typeof useTradingScript>;
455
- type MarketLayoutPosition = "left" | "top" | "bottom" | "hide";
456
- declare const useTradingScript: () => TradingPageState & {
457
- marketsWidth: number;
458
- tradindviewMaxHeight: number;
459
- dataListMinHeight: number;
460
- total: number | null;
461
- hideAssets: any;
462
- setHideAssets: (value: boolean) => void;
463
- onShowPortfolioSheet: () => void;
464
- navigateToPortfolio: (() => void) | undefined;
465
- isFirstTimeDeposit: boolean;
466
- symbolInfoBarHeight: number;
467
- max2XLSplitRef: RefObject<Split>;
468
- tradingviewAndOrderbookSplitRef: RefObject<Split>;
469
- onTradingviewAndOrderbookDragging: (preSize: number, nextSize: number) => void;
470
- onDataListSplitHeightDragging: (preSize: number, nextSize: number) => void;
471
- extraHeight: any;
472
- dataListHeight: any;
473
- restrictedInfo: {
474
- ip: string;
475
- invalidRegions: string[];
476
- restrictedOpen: boolean;
477
- content: React$1.ReactNode | ((data: {
478
- ip: string;
479
- brokerName: string;
480
- }) => React$1.ReactNode);
481
- canUnblock: boolean;
482
- accessRestricted: any;
483
- setAccessRestricted: (value: boolean | undefined) => void;
484
- };
485
- orderEntryViewRef: RefObject<HTMLDivElement>;
486
- orderEntryHeight: number;
487
- orderBookSplitSize: string | undefined;
488
- setOrderbookSplitSize: (size: string) => void;
489
- dataListSplitSize: string | undefined;
490
- setDataListSplitSize: (size: string) => void;
491
- mainSplitSize: string | undefined;
492
- setMainSplitSize: (size: string) => void;
493
- dataListSplitHeightSM: string | undefined;
494
- setDataListSplitHeightSM: (size: string) => void;
495
- orderBookSplitHeightSM: string | undefined;
496
- setOrderbookSplitHeightSM: (size: string) => void;
497
- positions: number[];
498
- showPositionIcon: boolean;
499
- updatePositions: (currentIdx: number, targetIdx: number) => void;
500
- resizeable: boolean;
501
- panelSize: "middle" | "small" | "large";
502
- onPanelSizeChange: (collapsed: "small" | "middle" | "large") => void;
503
- animating: boolean;
504
- setAnimating: React$1.Dispatch<React$1.SetStateAction<boolean>>;
505
- layout: any;
506
- onLayout: (value: LayoutPosition) => void;
507
- marketLayout: any;
508
- onMarketLayout: (value: MarketLayoutPosition) => void;
509
- max2XL: boolean;
510
- min3XL: boolean;
511
- max4XL: boolean;
512
- canTrade: boolean;
513
- openMarketsSheet: boolean;
514
- onOpenMarketsSheetChange: React$1.Dispatch<React$1.SetStateAction<boolean>>;
515
- horizontalDraggable: boolean;
516
- };
517
-
518
605
  declare const Trading: FC<TradingState>;
519
606
 
520
607
  declare const TradingWidget: React__default.FC;
@@ -548,4 +635,4 @@ declare const usePendingOrderCount: (symbol?: string) => {
548
635
  tpSlOrderCount: number;
549
636
  };
550
637
 
551
- export { AssetView, AssetViewWidget, BottomNavBar, BottomNavBarWidget, type BuySellRatio, BuySellRatioBar, DataList, DataListWidget, FundingRate, FundingRateDialogId, FundingRateModal, type FundingRateModalState, FundingRateModalWidget, FundingRateSheetId, FundingRateWidget, LastTrades, LastTradesWidget, OrderBook, OrderBookAndTrades, OrderBookAndTradesWidget, OrderBookWidget, PortfolioSheet, PortfolioSheetWidget, type ReferralProps, RiskRate, RiskRateWidget, type ShareOptions, SplitLayout, Trading, TradingPage, TradingPageContext, type TradingPageProps, TradingPageProvider, type TradingRewardsProps, TradingWidget, useBottomNavBarScript, useFundingRateModalScript, useFundingRateScript, useOrderBookAndTradesScript, useOrderBookScript, usePendingOrderCount, usePortfolioSheetScript, usePositionsCount, useTradingLocalStorage, useTradingPageContext, useTradingScript };
638
+ export { type AccountState, AssetView, AssetViewWidget, BottomNavBar, BottomNavBarWidget, type BuySellRatio, BuySellRatioBar, DataList, DataListWidget, type DesktopLayoutProps, FundingRate, FundingRateDialogId, FundingRateModal, type FundingRateModalState, FundingRateModalWidget, FundingRateSheetId, FundingRateWidget, LastTrades, LastTradesWidget, OrderBook, OrderBookAndTrades, OrderBookAndTradesWidget, type Props$1 as OrderBookDesktopAsksProps, type Props as OrderBookDesktopBidsProps, OrderBookProvider, OrderBookWidget, PortfolioSheet, PortfolioSheetWidget, type ReferralProps, RiskRate, RiskRateWidget, type ShareOptions, SplitLayout, Trading, TradingPage, TradingPageContext, type TradingPageProps, TradingPageProvider, type TradingRewardsProps, TradingWidget, useBottomNavBarScript, useFundingRateModalScript, useFundingRateScript, useOrderBookAndTradesScript, useOrderBookContext, useOrderBookScript, usePendingOrderCount, usePortfolioSheetScript, usePositionsCount, useTradingLocalStorage, useTradingPageContext, useTradingScript };