@kodiak-finance/orderly-trading 2.9.2 → 2.9.3
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 +159 -70
- package/dist/index.d.ts +159 -70
- package/dist/index.js +122 -85
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +120 -83
- package/dist/index.mjs.map +1 -1
- package/package.json +19 -18
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { SymbolInfoBarFullProps } from '@kodiak-finance/orderly-markets';
|
|
1
2
|
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { ReactNode,
|
|
3
|
+
import React__default, { ReactNode, RefObject, FC, PropsWithChildren } from 'react';
|
|
3
4
|
import * as _kodiak_finance_orderly_types from '@kodiak-finance/orderly-types';
|
|
4
5
|
import { API, NetworkId, AccountStatusEnum } from '@kodiak-finance/orderly-types';
|
|
5
6
|
import * as _kodiak_finance_orderly_ui_share from '@kodiak-finance/orderly-ui-share';
|
|
6
7
|
import { SharePnLConfig } from '@kodiak-finance/orderly-ui-share';
|
|
7
8
|
import { TradingviewWidgetPropsInterface } from '@kodiak-finance/orderly-ui-tradingview';
|
|
9
|
+
import { AccountState as AccountState$1 } from '@kodiak-finance/orderly-core';
|
|
10
|
+
import Split, { SplitProps } from '@uiw/react-split';
|
|
8
11
|
import { PositionsProps } from '@kodiak-finance/orderly-ui-positions';
|
|
9
12
|
import * as _kodiak_finance_orderly_hooks from '@kodiak-finance/orderly-hooks';
|
|
10
|
-
import Split, { SplitProps } from '@uiw/react-split';
|
|
11
13
|
import { SliderMarks } from '@kodiak-finance/orderly-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.DesktopLayout', ...), createInterceptor('Account.MobileAccountMenu', ...), etc.
|
|
260
|
+
*/
|
|
261
|
+
|
|
262
|
+
declare module "@kodiak-finance/orderly-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",
|
|
@@ -272,6 +395,8 @@ declare const useOrderBookScript: (props: {
|
|
|
272
395
|
lastPrice: number[] | undefined;
|
|
273
396
|
depths: string[];
|
|
274
397
|
selDepth: string | undefined;
|
|
398
|
+
/** Canonical API / route symbol (do not reconstruct from base+quote). */
|
|
399
|
+
symbol: string;
|
|
275
400
|
base: string;
|
|
276
401
|
quote: string;
|
|
277
402
|
isLoading: boolean | undefined;
|
|
@@ -304,6 +429,36 @@ interface BuySellRatioBarProps {
|
|
|
304
429
|
}
|
|
305
430
|
declare const BuySellRatioBar: FC<BuySellRatioBarProps>;
|
|
306
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
|
+
|
|
307
462
|
declare const useRiskRateScript: () => {
|
|
308
463
|
riskRate: string | null;
|
|
309
464
|
riskRateColor: {
|
|
@@ -369,7 +524,7 @@ declare const usePortfolioSheetScript: () => {
|
|
|
369
524
|
hasSubAccount: boolean;
|
|
370
525
|
aggregated: Omit<_kodiak_finance_orderly_types.API.PositionsTPSLExt, "rows">;
|
|
371
526
|
totalUnrealizedROI: number;
|
|
372
|
-
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<_kodiak_finance_orderly_types.API.PositionInfo, "rows">[Key] | undefined) => Omit<_kodiak_finance_orderly_types.API.PositionInfo, "rows">[Key]> & {
|
|
373
528
|
isNil: boolean;
|
|
374
529
|
};
|
|
375
530
|
marginRatio: number;
|
|
@@ -447,72 +602,6 @@ declare const FundingRateModalWidget: React__default.FC<{
|
|
|
447
602
|
declare const FundingRateDialogId = "FundingRateDialogId";
|
|
448
603
|
declare const FundingRateSheetId = "FundingRateSheetId";
|
|
449
604
|
|
|
450
|
-
type LayoutPosition = "left" | "right";
|
|
451
|
-
|
|
452
|
-
type TradingState = ReturnType<typeof useTradingScript>;
|
|
453
|
-
type MarketLayoutPosition = "left" | "top" | "bottom" | "hide";
|
|
454
|
-
declare const useTradingScript: () => TradingPageState & {
|
|
455
|
-
marketsWidth: number;
|
|
456
|
-
tradindviewMaxHeight: number;
|
|
457
|
-
dataListMinHeight: number;
|
|
458
|
-
total: number | null;
|
|
459
|
-
hideAssets: any;
|
|
460
|
-
setHideAssets: (value: boolean) => void;
|
|
461
|
-
onShowPortfolioSheet: () => void;
|
|
462
|
-
navigateToPortfolio: (() => void) | undefined;
|
|
463
|
-
isFirstTimeDeposit: boolean;
|
|
464
|
-
symbolInfoBarHeight: number;
|
|
465
|
-
max2XLSplitRef: RefObject<Split>;
|
|
466
|
-
tradingviewAndOrderbookSplitRef: RefObject<Split>;
|
|
467
|
-
onTradingviewAndOrderbookDragging: (preSize: number, nextSize: number) => void;
|
|
468
|
-
onDataListSplitHeightDragging: (preSize: number, nextSize: number) => void;
|
|
469
|
-
extraHeight: any;
|
|
470
|
-
dataListHeight: any;
|
|
471
|
-
restrictedInfo: {
|
|
472
|
-
ip: string;
|
|
473
|
-
invalidRegions: string[];
|
|
474
|
-
restrictedOpen: boolean;
|
|
475
|
-
content: React$1.ReactNode | ((data: {
|
|
476
|
-
ip: string;
|
|
477
|
-
brokerName: string;
|
|
478
|
-
}) => React$1.ReactNode);
|
|
479
|
-
canUnblock: boolean;
|
|
480
|
-
accessRestricted: any;
|
|
481
|
-
setAccessRestricted: (value: boolean | undefined) => void;
|
|
482
|
-
};
|
|
483
|
-
orderEntryViewRef: RefObject<HTMLDivElement>;
|
|
484
|
-
orderEntryHeight: number;
|
|
485
|
-
orderBookSplitSize: string | undefined;
|
|
486
|
-
setOrderbookSplitSize: (size: string) => void;
|
|
487
|
-
dataListSplitSize: string | undefined;
|
|
488
|
-
setDataListSplitSize: (size: string) => void;
|
|
489
|
-
mainSplitSize: string | undefined;
|
|
490
|
-
setMainSplitSize: (size: string) => void;
|
|
491
|
-
dataListSplitHeightSM: string | undefined;
|
|
492
|
-
setDataListSplitHeightSM: (size: string) => void;
|
|
493
|
-
orderBookSplitHeightSM: string | undefined;
|
|
494
|
-
setOrderbookSplitHeightSM: (size: string) => void;
|
|
495
|
-
positions: number[];
|
|
496
|
-
showPositionIcon: boolean;
|
|
497
|
-
updatePositions: (currentIdx: number, targetIdx: number) => void;
|
|
498
|
-
resizeable: boolean;
|
|
499
|
-
panelSize: "middle" | "small" | "large";
|
|
500
|
-
onPanelSizeChange: (collapsed: "small" | "middle" | "large") => void;
|
|
501
|
-
animating: boolean;
|
|
502
|
-
setAnimating: React$1.Dispatch<React$1.SetStateAction<boolean>>;
|
|
503
|
-
layout: any;
|
|
504
|
-
onLayout: (value: LayoutPosition) => void;
|
|
505
|
-
marketLayout: any;
|
|
506
|
-
onMarketLayout: (value: MarketLayoutPosition) => void;
|
|
507
|
-
max2XL: boolean;
|
|
508
|
-
min3XL: boolean;
|
|
509
|
-
max4XL: boolean;
|
|
510
|
-
canTrade: boolean;
|
|
511
|
-
openMarketsSheet: boolean;
|
|
512
|
-
onOpenMarketsSheetChange: React$1.Dispatch<React$1.SetStateAction<boolean>>;
|
|
513
|
-
horizontalDraggable: boolean;
|
|
514
|
-
};
|
|
515
|
-
|
|
516
605
|
declare const Trading: FC<TradingState>;
|
|
517
606
|
|
|
518
607
|
declare const TradingWidget: React__default.FC;
|
|
@@ -546,4 +635,4 @@ declare const usePendingOrderCount: (symbol?: string) => {
|
|
|
546
635
|
tpSlOrderCount: number;
|
|
547
636
|
};
|
|
548
637
|
|
|
549
|
-
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 '@kodiak-finance/orderly-markets';
|
|
1
2
|
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { ReactNode,
|
|
3
|
+
import React__default, { ReactNode, RefObject, FC, PropsWithChildren } from 'react';
|
|
3
4
|
import * as _kodiak_finance_orderly_types from '@kodiak-finance/orderly-types';
|
|
4
5
|
import { API, NetworkId, AccountStatusEnum } from '@kodiak-finance/orderly-types';
|
|
5
6
|
import * as _kodiak_finance_orderly_ui_share from '@kodiak-finance/orderly-ui-share';
|
|
6
7
|
import { SharePnLConfig } from '@kodiak-finance/orderly-ui-share';
|
|
7
8
|
import { TradingviewWidgetPropsInterface } from '@kodiak-finance/orderly-ui-tradingview';
|
|
9
|
+
import { AccountState as AccountState$1 } from '@kodiak-finance/orderly-core';
|
|
10
|
+
import Split, { SplitProps } from '@uiw/react-split';
|
|
8
11
|
import { PositionsProps } from '@kodiak-finance/orderly-ui-positions';
|
|
9
12
|
import * as _kodiak_finance_orderly_hooks from '@kodiak-finance/orderly-hooks';
|
|
10
|
-
import Split, { SplitProps } from '@uiw/react-split';
|
|
11
13
|
import { SliderMarks } from '@kodiak-finance/orderly-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.DesktopLayout', ...), createInterceptor('Account.MobileAccountMenu', ...), etc.
|
|
260
|
+
*/
|
|
261
|
+
|
|
262
|
+
declare module "@kodiak-finance/orderly-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",
|
|
@@ -272,6 +395,8 @@ declare const useOrderBookScript: (props: {
|
|
|
272
395
|
lastPrice: number[] | undefined;
|
|
273
396
|
depths: string[];
|
|
274
397
|
selDepth: string | undefined;
|
|
398
|
+
/** Canonical API / route symbol (do not reconstruct from base+quote). */
|
|
399
|
+
symbol: string;
|
|
275
400
|
base: string;
|
|
276
401
|
quote: string;
|
|
277
402
|
isLoading: boolean | undefined;
|
|
@@ -304,6 +429,36 @@ interface BuySellRatioBarProps {
|
|
|
304
429
|
}
|
|
305
430
|
declare const BuySellRatioBar: FC<BuySellRatioBarProps>;
|
|
306
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
|
+
|
|
307
462
|
declare const useRiskRateScript: () => {
|
|
308
463
|
riskRate: string | null;
|
|
309
464
|
riskRateColor: {
|
|
@@ -369,7 +524,7 @@ declare const usePortfolioSheetScript: () => {
|
|
|
369
524
|
hasSubAccount: boolean;
|
|
370
525
|
aggregated: Omit<_kodiak_finance_orderly_types.API.PositionsTPSLExt, "rows">;
|
|
371
526
|
totalUnrealizedROI: number;
|
|
372
|
-
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<_kodiak_finance_orderly_types.API.PositionInfo, "rows">[Key] | undefined) => Omit<_kodiak_finance_orderly_types.API.PositionInfo, "rows">[Key]> & {
|
|
373
528
|
isNil: boolean;
|
|
374
529
|
};
|
|
375
530
|
marginRatio: number;
|
|
@@ -447,72 +602,6 @@ declare const FundingRateModalWidget: React__default.FC<{
|
|
|
447
602
|
declare const FundingRateDialogId = "FundingRateDialogId";
|
|
448
603
|
declare const FundingRateSheetId = "FundingRateSheetId";
|
|
449
604
|
|
|
450
|
-
type LayoutPosition = "left" | "right";
|
|
451
|
-
|
|
452
|
-
type TradingState = ReturnType<typeof useTradingScript>;
|
|
453
|
-
type MarketLayoutPosition = "left" | "top" | "bottom" | "hide";
|
|
454
|
-
declare const useTradingScript: () => TradingPageState & {
|
|
455
|
-
marketsWidth: number;
|
|
456
|
-
tradindviewMaxHeight: number;
|
|
457
|
-
dataListMinHeight: number;
|
|
458
|
-
total: number | null;
|
|
459
|
-
hideAssets: any;
|
|
460
|
-
setHideAssets: (value: boolean) => void;
|
|
461
|
-
onShowPortfolioSheet: () => void;
|
|
462
|
-
navigateToPortfolio: (() => void) | undefined;
|
|
463
|
-
isFirstTimeDeposit: boolean;
|
|
464
|
-
symbolInfoBarHeight: number;
|
|
465
|
-
max2XLSplitRef: RefObject<Split>;
|
|
466
|
-
tradingviewAndOrderbookSplitRef: RefObject<Split>;
|
|
467
|
-
onTradingviewAndOrderbookDragging: (preSize: number, nextSize: number) => void;
|
|
468
|
-
onDataListSplitHeightDragging: (preSize: number, nextSize: number) => void;
|
|
469
|
-
extraHeight: any;
|
|
470
|
-
dataListHeight: any;
|
|
471
|
-
restrictedInfo: {
|
|
472
|
-
ip: string;
|
|
473
|
-
invalidRegions: string[];
|
|
474
|
-
restrictedOpen: boolean;
|
|
475
|
-
content: React$1.ReactNode | ((data: {
|
|
476
|
-
ip: string;
|
|
477
|
-
brokerName: string;
|
|
478
|
-
}) => React$1.ReactNode);
|
|
479
|
-
canUnblock: boolean;
|
|
480
|
-
accessRestricted: any;
|
|
481
|
-
setAccessRestricted: (value: boolean | undefined) => void;
|
|
482
|
-
};
|
|
483
|
-
orderEntryViewRef: RefObject<HTMLDivElement>;
|
|
484
|
-
orderEntryHeight: number;
|
|
485
|
-
orderBookSplitSize: string | undefined;
|
|
486
|
-
setOrderbookSplitSize: (size: string) => void;
|
|
487
|
-
dataListSplitSize: string | undefined;
|
|
488
|
-
setDataListSplitSize: (size: string) => void;
|
|
489
|
-
mainSplitSize: string | undefined;
|
|
490
|
-
setMainSplitSize: (size: string) => void;
|
|
491
|
-
dataListSplitHeightSM: string | undefined;
|
|
492
|
-
setDataListSplitHeightSM: (size: string) => void;
|
|
493
|
-
orderBookSplitHeightSM: string | undefined;
|
|
494
|
-
setOrderbookSplitHeightSM: (size: string) => void;
|
|
495
|
-
positions: number[];
|
|
496
|
-
showPositionIcon: boolean;
|
|
497
|
-
updatePositions: (currentIdx: number, targetIdx: number) => void;
|
|
498
|
-
resizeable: boolean;
|
|
499
|
-
panelSize: "middle" | "small" | "large";
|
|
500
|
-
onPanelSizeChange: (collapsed: "small" | "middle" | "large") => void;
|
|
501
|
-
animating: boolean;
|
|
502
|
-
setAnimating: React$1.Dispatch<React$1.SetStateAction<boolean>>;
|
|
503
|
-
layout: any;
|
|
504
|
-
onLayout: (value: LayoutPosition) => void;
|
|
505
|
-
marketLayout: any;
|
|
506
|
-
onMarketLayout: (value: MarketLayoutPosition) => void;
|
|
507
|
-
max2XL: boolean;
|
|
508
|
-
min3XL: boolean;
|
|
509
|
-
max4XL: boolean;
|
|
510
|
-
canTrade: boolean;
|
|
511
|
-
openMarketsSheet: boolean;
|
|
512
|
-
onOpenMarketsSheetChange: React$1.Dispatch<React$1.SetStateAction<boolean>>;
|
|
513
|
-
horizontalDraggable: boolean;
|
|
514
|
-
};
|
|
515
|
-
|
|
516
605
|
declare const Trading: FC<TradingState>;
|
|
517
606
|
|
|
518
607
|
declare const TradingWidget: React__default.FC;
|
|
@@ -546,4 +635,4 @@ declare const usePendingOrderCount: (symbol?: string) => {
|
|
|
546
635
|
tpSlOrderCount: number;
|
|
547
636
|
};
|
|
548
637
|
|
|
549
|
-
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 };
|