@orderly.network/trading 3.0.0-beta.1 → 3.0.0-beta.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,6 +1,5 @@
1
- import { AccountState as AccountState$1 } from '@orderly.network/core';
2
1
  import * as React$1 from 'react';
3
- import React__default, { ReactNode, FC, PropsWithChildren, RefObject } from 'react';
2
+ import React__default, { ReactNode, FC, RefObject, PropsWithChildren } from 'react';
4
3
  import * as _orderly_network_types from '@orderly.network/types';
5
4
  import { API, NetworkId, AccountStatusEnum } from '@orderly.network/types';
6
5
  import * as _orderly_network_ui_share from '@orderly.network/ui-share';
@@ -12,35 +11,6 @@ import Split, { SplitProps } from '@uiw/react-split';
12
11
  import { SliderMarks } from '@orderly.network/ui';
13
12
  import * as react_jsx_runtime from 'react/jsx-runtime';
14
13
 
15
- interface Props$1 {
16
- data: number[][];
17
- }
18
-
19
- interface Props {
20
- data: any[];
21
- }
22
-
23
- declare const useAccountScript: () => {
24
- onShowAccountSheet: () => void;
25
- address: string | undefined;
26
- state: AccountState$1;
27
- };
28
- type AccountState = ReturnType<typeof useAccountScript>;
29
-
30
- /**
31
- * Module augmentation: maps interceptor target paths to their component props types.
32
- * Import from @orderly.network/trading to enable typed props in
33
- * createInterceptor('Account.MobileAccountMenu', ...) and createInterceptor('OrderBook.Desktop.Asks', ...).
34
- */
35
-
36
- declare module "@orderly.network/plugin-core" {
37
- interface InterceptorTargetPropsMap {
38
- "Account.MobileAccountMenu": AccountState;
39
- "OrderBook.Desktop.Asks": Props$1;
40
- "OrderBook.Desktop.Bids": Props;
41
- }
42
- }
43
-
44
14
  type layoutInfo = {
45
15
  width?: number;
46
16
  height?: number;
@@ -334,36 +304,6 @@ interface BuySellRatioBarProps {
334
304
  }
335
305
  declare const BuySellRatioBar: FC<BuySellRatioBarProps>;
336
306
 
337
- type QtyMode = "quantity" | "amount";
338
- type TotalMode = "quantity" | "amount";
339
-
340
- interface OrderBookContextValue {
341
- cellHeight: number;
342
- mode: QtyMode;
343
- depth?: string;
344
- onModeChange?: (mode: QtyMode) => void;
345
- onItemClick?: (item: number[]) => void;
346
- showTotal: boolean;
347
- totalMode: TotalMode;
348
- pendingOrders: ReadonlyArray<number> | number[];
349
- onTotalModeChange?: (mode: TotalMode) => void;
350
- symbolInfo: BasicSymbolInfo;
351
- showBuySellRatio: boolean;
352
- onShowBuySellRatioChange?: (show: boolean) => void;
353
- }
354
- declare const useOrderBookContext: () => OrderBookContextValue;
355
- interface OrderBookProviderProps {
356
- cellHeight: number;
357
- depth?: string;
358
- showTotal: boolean;
359
- pendingOrders: ReadonlyArray<number> | number[];
360
- onItemClick?: (item: number[]) => void;
361
- symbolInfo: BasicSymbolInfo;
362
- showBuySellRatio?: boolean;
363
- onShowBuySellRatioChange?: (show: boolean) => void;
364
- }
365
- declare const OrderBookProvider: FC<PropsWithChildren<OrderBookProviderProps>>;
366
-
367
307
  declare const useRiskRateScript: () => {
368
308
  riskRate: string | null;
369
309
  riskRateColor: {
@@ -429,7 +369,7 @@ declare const usePortfolioSheetScript: () => {
429
369
  hasSubAccount: boolean;
430
370
  aggregated: Omit<_orderly_network_types.API.PositionsTPSLExt, "rows">;
431
371
  totalUnrealizedROI: number;
432
- 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", <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">(defaultValue?: Omit<_orderly_network_types.API.PositionInfo, "rows">[Key] | undefined) => Omit<_orderly_network_types.API.PositionInfo, "rows">[Key]> & {
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" | "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]> & {
433
373
  isNil: boolean;
434
374
  };
435
375
  marginRatio: number;
@@ -606,4 +546,4 @@ declare const usePendingOrderCount: (symbol?: string) => {
606
546
  tpSlOrderCount: number;
607
547
  };
608
548
 
609
- export { type AccountState, AssetView, AssetViewWidget, BottomNavBar, BottomNavBarWidget, type BuySellRatio, BuySellRatioBar, DataList, DataListWidget, FundingRate, FundingRateDialogId, FundingRateModal, type FundingRateModalState, FundingRateModalWidget, FundingRateSheetId, FundingRateWidget, LastTrades, LastTradesWidget, OrderBook, OrderBookAndTrades, OrderBookAndTradesWidget, type OrderBookContextValue, type Props$1 as OrderBookDesktopAsksProps, 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { AccountState as AccountState$1 } from '@orderly.network/core';
2
1
  import * as React$1 from 'react';
3
- import React__default, { ReactNode, FC, PropsWithChildren, RefObject } from 'react';
2
+ import React__default, { ReactNode, FC, RefObject, PropsWithChildren } from 'react';
4
3
  import * as _orderly_network_types from '@orderly.network/types';
5
4
  import { API, NetworkId, AccountStatusEnum } from '@orderly.network/types';
6
5
  import * as _orderly_network_ui_share from '@orderly.network/ui-share';
@@ -12,35 +11,6 @@ import Split, { SplitProps } from '@uiw/react-split';
12
11
  import { SliderMarks } from '@orderly.network/ui';
13
12
  import * as react_jsx_runtime from 'react/jsx-runtime';
14
13
 
15
- interface Props$1 {
16
- data: number[][];
17
- }
18
-
19
- interface Props {
20
- data: any[];
21
- }
22
-
23
- declare const useAccountScript: () => {
24
- onShowAccountSheet: () => void;
25
- address: string | undefined;
26
- state: AccountState$1;
27
- };
28
- type AccountState = ReturnType<typeof useAccountScript>;
29
-
30
- /**
31
- * Module augmentation: maps interceptor target paths to their component props types.
32
- * Import from @orderly.network/trading to enable typed props in
33
- * createInterceptor('Account.MobileAccountMenu', ...) and createInterceptor('OrderBook.Desktop.Asks', ...).
34
- */
35
-
36
- declare module "@orderly.network/plugin-core" {
37
- interface InterceptorTargetPropsMap {
38
- "Account.MobileAccountMenu": AccountState;
39
- "OrderBook.Desktop.Asks": Props$1;
40
- "OrderBook.Desktop.Bids": Props;
41
- }
42
- }
43
-
44
14
  type layoutInfo = {
45
15
  width?: number;
46
16
  height?: number;
@@ -334,36 +304,6 @@ interface BuySellRatioBarProps {
334
304
  }
335
305
  declare const BuySellRatioBar: FC<BuySellRatioBarProps>;
336
306
 
337
- type QtyMode = "quantity" | "amount";
338
- type TotalMode = "quantity" | "amount";
339
-
340
- interface OrderBookContextValue {
341
- cellHeight: number;
342
- mode: QtyMode;
343
- depth?: string;
344
- onModeChange?: (mode: QtyMode) => void;
345
- onItemClick?: (item: number[]) => void;
346
- showTotal: boolean;
347
- totalMode: TotalMode;
348
- pendingOrders: ReadonlyArray<number> | number[];
349
- onTotalModeChange?: (mode: TotalMode) => void;
350
- symbolInfo: BasicSymbolInfo;
351
- showBuySellRatio: boolean;
352
- onShowBuySellRatioChange?: (show: boolean) => void;
353
- }
354
- declare const useOrderBookContext: () => OrderBookContextValue;
355
- interface OrderBookProviderProps {
356
- cellHeight: number;
357
- depth?: string;
358
- showTotal: boolean;
359
- pendingOrders: ReadonlyArray<number> | number[];
360
- onItemClick?: (item: number[]) => void;
361
- symbolInfo: BasicSymbolInfo;
362
- showBuySellRatio?: boolean;
363
- onShowBuySellRatioChange?: (show: boolean) => void;
364
- }
365
- declare const OrderBookProvider: FC<PropsWithChildren<OrderBookProviderProps>>;
366
-
367
307
  declare const useRiskRateScript: () => {
368
308
  riskRate: string | null;
369
309
  riskRateColor: {
@@ -429,7 +369,7 @@ declare const usePortfolioSheetScript: () => {
429
369
  hasSubAccount: boolean;
430
370
  aggregated: Omit<_orderly_network_types.API.PositionsTPSLExt, "rows">;
431
371
  totalUnrealizedROI: number;
432
- 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", <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">(defaultValue?: Omit<_orderly_network_types.API.PositionInfo, "rows">[Key] | undefined) => Omit<_orderly_network_types.API.PositionInfo, "rows">[Key]> & {
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" | "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]> & {
433
373
  isNil: boolean;
434
374
  };
435
375
  marginRatio: number;
@@ -606,4 +546,4 @@ declare const usePendingOrderCount: (symbol?: string) => {
606
546
  tpSlOrderCount: number;
607
547
  };
608
548
 
609
- export { type AccountState, AssetView, AssetViewWidget, BottomNavBar, BottomNavBarWidget, type BuySellRatio, BuySellRatioBar, DataList, DataListWidget, FundingRate, FundingRateDialogId, FundingRateModal, type FundingRateModalState, FundingRateModalWidget, FundingRateSheetId, FundingRateWidget, LastTrades, LastTradesWidget, OrderBook, OrderBookAndTrades, OrderBookAndTradesWidget, type OrderBookContextValue, type Props$1 as OrderBookDesktopAsksProps, 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 };
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 };