@orderly.network/trading 3.0.4-alpha.1 → 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 +127 -70
- package/dist/index.d.ts +127 -70
- package/dist/index.js +40 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -27
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -21
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, PropsWithChildren
|
|
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",
|
|
@@ -401,7 +524,7 @@ declare const usePortfolioSheetScript: () => {
|
|
|
401
524
|
hasSubAccount: boolean;
|
|
402
525
|
aggregated: Omit<_orderly_network_types.API.PositionsTPSLExt, "rows">;
|
|
403
526
|
totalUnrealizedROI: number;
|
|
404
|
-
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" | "
|
|
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]> & {
|
|
405
528
|
isNil: boolean;
|
|
406
529
|
};
|
|
407
530
|
marginRatio: number;
|
|
@@ -479,72 +602,6 @@ declare const FundingRateModalWidget: React__default.FC<{
|
|
|
479
602
|
declare const FundingRateDialogId = "FundingRateDialogId";
|
|
480
603
|
declare const FundingRateSheetId = "FundingRateSheetId";
|
|
481
604
|
|
|
482
|
-
type LayoutPosition = "left" | "right";
|
|
483
|
-
|
|
484
|
-
type TradingState = ReturnType<typeof useTradingScript>;
|
|
485
|
-
type MarketLayoutPosition = "left" | "top" | "bottom" | "hide";
|
|
486
|
-
declare const useTradingScript: () => TradingPageState & {
|
|
487
|
-
marketsWidth: number;
|
|
488
|
-
tradindviewMaxHeight: number;
|
|
489
|
-
dataListMinHeight: number;
|
|
490
|
-
total: number | null;
|
|
491
|
-
hideAssets: any;
|
|
492
|
-
setHideAssets: (value: boolean) => void;
|
|
493
|
-
onShowPortfolioSheet: () => void;
|
|
494
|
-
navigateToPortfolio: (() => void) | undefined;
|
|
495
|
-
isFirstTimeDeposit: boolean;
|
|
496
|
-
symbolInfoBarHeight: number;
|
|
497
|
-
max2XLSplitRef: RefObject<Split>;
|
|
498
|
-
tradingviewAndOrderbookSplitRef: RefObject<Split>;
|
|
499
|
-
onTradingviewAndOrderbookDragging: (preSize: number, nextSize: number) => void;
|
|
500
|
-
onDataListSplitHeightDragging: (preSize: number, nextSize: number) => void;
|
|
501
|
-
extraHeight: any;
|
|
502
|
-
dataListHeight: any;
|
|
503
|
-
restrictedInfo: {
|
|
504
|
-
ip: string;
|
|
505
|
-
invalidRegions: string[];
|
|
506
|
-
restrictedOpen: boolean;
|
|
507
|
-
content: React$1.ReactNode | ((data: {
|
|
508
|
-
ip: string;
|
|
509
|
-
brokerName: string;
|
|
510
|
-
}) => React$1.ReactNode);
|
|
511
|
-
canUnblock: boolean;
|
|
512
|
-
accessRestricted: any;
|
|
513
|
-
setAccessRestricted: (value: boolean | undefined) => void;
|
|
514
|
-
};
|
|
515
|
-
orderEntryViewRef: RefObject<HTMLDivElement>;
|
|
516
|
-
orderEntryHeight: number;
|
|
517
|
-
orderBookSplitSize: string | undefined;
|
|
518
|
-
setOrderbookSplitSize: (size: string) => void;
|
|
519
|
-
dataListSplitSize: string | undefined;
|
|
520
|
-
setDataListSplitSize: (size: string) => void;
|
|
521
|
-
mainSplitSize: string | undefined;
|
|
522
|
-
setMainSplitSize: (size: string) => void;
|
|
523
|
-
dataListSplitHeightSM: string | undefined;
|
|
524
|
-
setDataListSplitHeightSM: (size: string) => void;
|
|
525
|
-
orderBookSplitHeightSM: string | undefined;
|
|
526
|
-
setOrderbookSplitHeightSM: (size: string) => void;
|
|
527
|
-
positions: number[];
|
|
528
|
-
showPositionIcon: boolean;
|
|
529
|
-
updatePositions: (currentIdx: number, targetIdx: number) => void;
|
|
530
|
-
resizeable: boolean;
|
|
531
|
-
panelSize: "middle" | "small" | "large";
|
|
532
|
-
onPanelSizeChange: (collapsed: "small" | "middle" | "large") => void;
|
|
533
|
-
animating: boolean;
|
|
534
|
-
setAnimating: React$1.Dispatch<React$1.SetStateAction<boolean>>;
|
|
535
|
-
layout: any;
|
|
536
|
-
onLayout: (value: LayoutPosition) => void;
|
|
537
|
-
marketLayout: any;
|
|
538
|
-
onMarketLayout: (value: MarketLayoutPosition) => void;
|
|
539
|
-
max2XL: boolean;
|
|
540
|
-
min3XL: boolean;
|
|
541
|
-
max4XL: boolean;
|
|
542
|
-
canTrade: boolean;
|
|
543
|
-
openMarketsSheet: boolean;
|
|
544
|
-
onOpenMarketsSheetChange: React$1.Dispatch<React$1.SetStateAction<boolean>>;
|
|
545
|
-
horizontalDraggable: boolean;
|
|
546
|
-
};
|
|
547
|
-
|
|
548
605
|
declare const Trading: FC<TradingState>;
|
|
549
606
|
|
|
550
607
|
declare const TradingWidget: React__default.FC;
|
|
@@ -578,4 +635,4 @@ declare const usePendingOrderCount: (symbol?: string) => {
|
|
|
578
635
|
tpSlOrderCount: number;
|
|
579
636
|
};
|
|
580
637
|
|
|
581
|
-
export { AssetView, AssetViewWidget, BottomNavBar, BottomNavBarWidget, type BuySellRatio, BuySellRatioBar, DataList, DataListWidget, FundingRate, FundingRateDialogId, FundingRateModal, type FundingRateModalState, FundingRateModalWidget, FundingRateSheetId, FundingRateWidget, LastTrades, LastTradesWidget, OrderBook, OrderBookAndTrades, OrderBookAndTradesWidget, 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 };
|
|
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, PropsWithChildren
|
|
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",
|
|
@@ -401,7 +524,7 @@ declare const usePortfolioSheetScript: () => {
|
|
|
401
524
|
hasSubAccount: boolean;
|
|
402
525
|
aggregated: Omit<_orderly_network_types.API.PositionsTPSLExt, "rows">;
|
|
403
526
|
totalUnrealizedROI: number;
|
|
404
|
-
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" | "
|
|
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]> & {
|
|
405
528
|
isNil: boolean;
|
|
406
529
|
};
|
|
407
530
|
marginRatio: number;
|
|
@@ -479,72 +602,6 @@ declare const FundingRateModalWidget: React__default.FC<{
|
|
|
479
602
|
declare const FundingRateDialogId = "FundingRateDialogId";
|
|
480
603
|
declare const FundingRateSheetId = "FundingRateSheetId";
|
|
481
604
|
|
|
482
|
-
type LayoutPosition = "left" | "right";
|
|
483
|
-
|
|
484
|
-
type TradingState = ReturnType<typeof useTradingScript>;
|
|
485
|
-
type MarketLayoutPosition = "left" | "top" | "bottom" | "hide";
|
|
486
|
-
declare const useTradingScript: () => TradingPageState & {
|
|
487
|
-
marketsWidth: number;
|
|
488
|
-
tradindviewMaxHeight: number;
|
|
489
|
-
dataListMinHeight: number;
|
|
490
|
-
total: number | null;
|
|
491
|
-
hideAssets: any;
|
|
492
|
-
setHideAssets: (value: boolean) => void;
|
|
493
|
-
onShowPortfolioSheet: () => void;
|
|
494
|
-
navigateToPortfolio: (() => void) | undefined;
|
|
495
|
-
isFirstTimeDeposit: boolean;
|
|
496
|
-
symbolInfoBarHeight: number;
|
|
497
|
-
max2XLSplitRef: RefObject<Split>;
|
|
498
|
-
tradingviewAndOrderbookSplitRef: RefObject<Split>;
|
|
499
|
-
onTradingviewAndOrderbookDragging: (preSize: number, nextSize: number) => void;
|
|
500
|
-
onDataListSplitHeightDragging: (preSize: number, nextSize: number) => void;
|
|
501
|
-
extraHeight: any;
|
|
502
|
-
dataListHeight: any;
|
|
503
|
-
restrictedInfo: {
|
|
504
|
-
ip: string;
|
|
505
|
-
invalidRegions: string[];
|
|
506
|
-
restrictedOpen: boolean;
|
|
507
|
-
content: React$1.ReactNode | ((data: {
|
|
508
|
-
ip: string;
|
|
509
|
-
brokerName: string;
|
|
510
|
-
}) => React$1.ReactNode);
|
|
511
|
-
canUnblock: boolean;
|
|
512
|
-
accessRestricted: any;
|
|
513
|
-
setAccessRestricted: (value: boolean | undefined) => void;
|
|
514
|
-
};
|
|
515
|
-
orderEntryViewRef: RefObject<HTMLDivElement>;
|
|
516
|
-
orderEntryHeight: number;
|
|
517
|
-
orderBookSplitSize: string | undefined;
|
|
518
|
-
setOrderbookSplitSize: (size: string) => void;
|
|
519
|
-
dataListSplitSize: string | undefined;
|
|
520
|
-
setDataListSplitSize: (size: string) => void;
|
|
521
|
-
mainSplitSize: string | undefined;
|
|
522
|
-
setMainSplitSize: (size: string) => void;
|
|
523
|
-
dataListSplitHeightSM: string | undefined;
|
|
524
|
-
setDataListSplitHeightSM: (size: string) => void;
|
|
525
|
-
orderBookSplitHeightSM: string | undefined;
|
|
526
|
-
setOrderbookSplitHeightSM: (size: string) => void;
|
|
527
|
-
positions: number[];
|
|
528
|
-
showPositionIcon: boolean;
|
|
529
|
-
updatePositions: (currentIdx: number, targetIdx: number) => void;
|
|
530
|
-
resizeable: boolean;
|
|
531
|
-
panelSize: "middle" | "small" | "large";
|
|
532
|
-
onPanelSizeChange: (collapsed: "small" | "middle" | "large") => void;
|
|
533
|
-
animating: boolean;
|
|
534
|
-
setAnimating: React$1.Dispatch<React$1.SetStateAction<boolean>>;
|
|
535
|
-
layout: any;
|
|
536
|
-
onLayout: (value: LayoutPosition) => void;
|
|
537
|
-
marketLayout: any;
|
|
538
|
-
onMarketLayout: (value: MarketLayoutPosition) => void;
|
|
539
|
-
max2XL: boolean;
|
|
540
|
-
min3XL: boolean;
|
|
541
|
-
max4XL: boolean;
|
|
542
|
-
canTrade: boolean;
|
|
543
|
-
openMarketsSheet: boolean;
|
|
544
|
-
onOpenMarketsSheetChange: React$1.Dispatch<React$1.SetStateAction<boolean>>;
|
|
545
|
-
horizontalDraggable: boolean;
|
|
546
|
-
};
|
|
547
|
-
|
|
548
605
|
declare const Trading: FC<TradingState>;
|
|
549
606
|
|
|
550
607
|
declare const TradingWidget: React__default.FC;
|
|
@@ -578,4 +635,4 @@ declare const usePendingOrderCount: (symbol?: string) => {
|
|
|
578
635
|
tpSlOrderCount: number;
|
|
579
636
|
};
|
|
580
637
|
|
|
581
|
-
export { AssetView, AssetViewWidget, BottomNavBar, BottomNavBarWidget, type BuySellRatio, BuySellRatioBar, DataList, DataListWidget, FundingRate, FundingRateDialogId, FundingRateModal, type FundingRateModalState, FundingRateModalWidget, FundingRateSheetId, FundingRateWidget, LastTrades, LastTradesWidget, OrderBook, OrderBookAndTrades, OrderBookAndTradesWidget, 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 };
|
|
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.js
CHANGED
|
@@ -2211,7 +2211,7 @@ var init_listBox_desktop = __esm({
|
|
|
2211
2211
|
};
|
|
2212
2212
|
}
|
|
2213
2213
|
});
|
|
2214
|
-
var DesktopAsks;
|
|
2214
|
+
var DesktopAsks, InjectableDesktopAsks;
|
|
2215
2215
|
var init_asks_desktop = __esm({
|
|
2216
2216
|
"src/components/desktop/orderBook/asks.desktop.tsx"() {
|
|
2217
2217
|
init_types();
|
|
@@ -2237,9 +2237,13 @@ var init_asks_desktop = __esm({
|
|
|
2237
2237
|
}
|
|
2238
2238
|
);
|
|
2239
2239
|
};
|
|
2240
|
+
InjectableDesktopAsks = ui.injectable(
|
|
2241
|
+
DesktopAsks,
|
|
2242
|
+
"OrderBook.Desktop.Asks"
|
|
2243
|
+
);
|
|
2240
2244
|
}
|
|
2241
2245
|
});
|
|
2242
|
-
var DesktopBids;
|
|
2246
|
+
var DesktopBids, InjectableDesktopBids;
|
|
2243
2247
|
var init_bids_desktop = __esm({
|
|
2244
2248
|
"src/components/desktop/orderBook/bids.desktop.tsx"() {
|
|
2245
2249
|
init_types();
|
|
@@ -2264,6 +2268,10 @@ var init_bids_desktop = __esm({
|
|
|
2264
2268
|
}
|
|
2265
2269
|
);
|
|
2266
2270
|
};
|
|
2271
|
+
InjectableDesktopBids = ui.injectable(
|
|
2272
|
+
DesktopBids,
|
|
2273
|
+
"OrderBook.Desktop.Bids"
|
|
2274
|
+
);
|
|
2267
2275
|
}
|
|
2268
2276
|
});
|
|
2269
2277
|
var BuySellRatioSettings, MoreIcon;
|
|
@@ -2927,7 +2935,14 @@ var init_index_desktop = __esm({
|
|
|
2927
2935
|
)
|
|
2928
2936
|
] }),
|
|
2929
2937
|
/* @__PURE__ */ jsxRuntime.jsx(DesktopHeader, { quote, base }),
|
|
2930
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2938
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2939
|
+
InjectableDesktopAsks,
|
|
2940
|
+
{
|
|
2941
|
+
data: [...props.asks],
|
|
2942
|
+
symbolInfo: props.symbolInfo,
|
|
2943
|
+
depth: props.activeDepth
|
|
2944
|
+
}
|
|
2945
|
+
),
|
|
2931
2946
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2932
2947
|
DesktopMarkPrice,
|
|
2933
2948
|
{
|
|
@@ -2938,7 +2953,14 @@ var init_index_desktop = __esm({
|
|
|
2938
2953
|
symbolInfo: props.symbolInfo
|
|
2939
2954
|
}
|
|
2940
2955
|
),
|
|
2941
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2956
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2957
|
+
InjectableDesktopBids,
|
|
2958
|
+
{
|
|
2959
|
+
data: [...props.bids],
|
|
2960
|
+
symbolInfo: props.symbolInfo,
|
|
2961
|
+
depth: props.activeDepth
|
|
2962
|
+
}
|
|
2963
|
+
),
|
|
2942
2964
|
showBuySellRatio && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2943
2965
|
exports.BuySellRatioBar,
|
|
2944
2966
|
{
|
|
@@ -6918,17 +6940,10 @@ var Account = (props) => {
|
|
|
6918
6940
|
}
|
|
6919
6941
|
);
|
|
6920
6942
|
};
|
|
6921
|
-
ui.
|
|
6922
|
-
name: "mobile-account-menu",
|
|
6923
|
-
scope: ["*"],
|
|
6924
|
-
positions: [ui.ExtensionPositionEnum.MobileAccountMenu],
|
|
6925
|
-
builder: useAccountScript,
|
|
6926
|
-
__isInternal: true
|
|
6927
|
-
})((props) => {
|
|
6928
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Account, { ...props });
|
|
6929
|
-
});
|
|
6943
|
+
var InjectableAccount = ui.injectable(Account, "Account.MobileAccountMenu");
|
|
6930
6944
|
var MobileAccountMenuExtension = () => {
|
|
6931
|
-
|
|
6945
|
+
const state = useAccountScript();
|
|
6946
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InjectableAccount, { ...state });
|
|
6932
6947
|
};
|
|
6933
6948
|
|
|
6934
6949
|
// src/components/mobile/bottomNavBar/balance/balance.ui.tsx
|
|
@@ -8403,7 +8418,10 @@ var DesktopLayout4 = (props) => {
|
|
|
8403
8418
|
}
|
|
8404
8419
|
];
|
|
8405
8420
|
},
|
|
8406
|
-
sideEffects: ({
|
|
8421
|
+
sideEffects: ({
|
|
8422
|
+
active,
|
|
8423
|
+
dragOverlay
|
|
8424
|
+
}) => {
|
|
8407
8425
|
active.node.style.opacity = "0";
|
|
8408
8426
|
const innerElement = dragOverlay.node.querySelector(".inner-content");
|
|
8409
8427
|
if (innerElement) {
|
|
@@ -8476,9 +8494,6 @@ var DesktopLayout4 = (props) => {
|
|
|
8476
8494
|
const marketsWidget = /* @__PURE__ */ jsxRuntime.jsx(
|
|
8477
8495
|
markets.SideMarketsWidget,
|
|
8478
8496
|
{
|
|
8479
|
-
resizeable,
|
|
8480
|
-
panelSize,
|
|
8481
|
-
onPanelSizeChange,
|
|
8482
8497
|
symbol: props.symbol,
|
|
8483
8498
|
onSymbolChange: props.onSymbolChange
|
|
8484
8499
|
}
|
|
@@ -9109,6 +9124,12 @@ var DesktopLayout4 = (props) => {
|
|
|
9109
9124
|
}
|
|
9110
9125
|
);
|
|
9111
9126
|
};
|
|
9127
|
+
|
|
9128
|
+
// src/pages/trading/trading.injectable.tsx
|
|
9129
|
+
var InjectableDesktopLayout = ui.injectable(
|
|
9130
|
+
DesktopLayout4,
|
|
9131
|
+
"Trading.Layout.Desktop"
|
|
9132
|
+
);
|
|
9112
9133
|
var Countdown = ({
|
|
9113
9134
|
timeInterval
|
|
9114
9135
|
}) => {
|
|
@@ -9371,7 +9392,7 @@ var Trading = (props) => {
|
|
|
9371
9392
|
return /* @__PURE__ */ jsxRuntime.jsx(MobileLayout4, { ...props });
|
|
9372
9393
|
}
|
|
9373
9394
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9374
|
-
|
|
9395
|
+
InjectableDesktopLayout,
|
|
9375
9396
|
{
|
|
9376
9397
|
className: "oui-h-[calc(100vh_-_48px_-_29px)] oui-bg-base-10",
|
|
9377
9398
|
...props
|