@orderly.network/ui-orders 2.0.3 → 2.0.4

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,10 +1,10 @@
1
1
  import * as react from 'react';
2
2
  import { ForwardedRef, FC } from 'react';
3
- import { SharePnLConfig, SharePnLParams } from '@orderly.network/ui-share';
3
+ import { SharePnLConfig } from '@orderly.network/ui-share';
4
4
  import * as _orderly_network_ui from '@orderly.network/ui';
5
5
  import { Table } from '@orderly.network/ui';
6
6
  import * as _orderly_network_types from '@orderly.network/types';
7
- import { API, OrderStatus, OrderSide } from '@orderly.network/types';
7
+ import { OrderStatus, API, OrderSide } from '@orderly.network/types';
8
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
9
9
 
10
10
  type OrderListInstance = {
@@ -16,7 +16,7 @@ type useOrderListScriptOptions = {
16
16
  symbol?: string;
17
17
  enableLoadMore?: boolean;
18
18
  onSymbolChange?: (symbol: API.Symbol) => void;
19
- sharePnLConfig?: SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>;
19
+ sharePnLConfig?: SharePnLConfig;
20
20
  filterConfig?: {
21
21
  side?: OrderSide | "all";
22
22
  range?: {
@@ -32,9 +32,9 @@ declare const useOrderListScript: (props: useOrderListScriptOptions) => {
32
32
  dataSource: any[] | undefined;
33
33
  isLoading: boolean;
34
34
  loadMore: () => void;
35
- cancelOrder: (orderId: number, symbol?: string | undefined) => Promise<any>;
35
+ cancelOrder: (orderId: number, symbol?: string) => Promise<any>;
36
36
  updateOrder: (orderId: string, order: _orderly_network_types.OrderEntity) => Promise<any>;
37
- cancelAlgoOrder: (orderId: number, symbol?: string | undefined) => Promise<any>;
37
+ cancelAlgoOrder: (orderId: number, symbol?: string) => Promise<any>;
38
38
  updateAlgoOrder: (orderId: string, order: _orderly_network_types.OrderEntity) => Promise<any>;
39
39
  pagination: _orderly_network_ui.PaginationMeta | {
40
40
  page: number;
@@ -51,7 +51,7 @@ declare const useOrderListScript: (props: useOrderListScriptOptions) => {
51
51
  filterItems: any[];
52
52
  onCancelAll: () => void;
53
53
  onSymbolChange: ((symbol: API.Symbol) => void) | undefined;
54
- sharePnLConfig: (SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>) | undefined;
54
+ sharePnLConfig: SharePnLConfig | undefined;
55
55
  tableInstance: react.MutableRefObject<Table<any> | undefined>;
56
56
  symbolsInfo: {
57
57
  [x: string]: (key?: keyof API.SymbolExt | undefined, defaultValue?: (string | number) | undefined) => any;
@@ -73,7 +73,7 @@ declare enum TabType {
73
73
  type OrdersWidgetProps = {
74
74
  current?: TabType;
75
75
  pnlNotionalDecimalPrecision?: number;
76
- sharePnLConfig?: SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>;
76
+ sharePnLConfig?: SharePnLConfig;
77
77
  };
78
78
  declare const OrdersWidget: react.ForwardRefExoticComponent<OrdersWidgetProps & react.RefAttributes<OrderListInstance>>;
79
79
 
@@ -81,13 +81,13 @@ type UseOrdersScriptOptions = {
81
81
  current?: TabType;
82
82
  pnlNotionalDecimalPrecision?: number;
83
83
  ref: ForwardedRef<OrderListInstance>;
84
- sharePnLConfig?: SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>;
84
+ sharePnLConfig?: SharePnLConfig;
85
85
  };
86
86
  declare const useOrdersScript: (props: UseOrdersScriptOptions) => {
87
87
  current: TabType | undefined;
88
88
  pnlNotionalDecimalPrecision: number | undefined;
89
89
  orderListRef: react.RefObject<OrderListInstance>;
90
- sharePnLConfig: (SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>) | undefined;
90
+ sharePnLConfig: SharePnLConfig | undefined;
91
91
  };
92
92
  type OrdersBuilderState = ReturnType<typeof useOrdersScript>;
93
93
 
@@ -112,7 +112,7 @@ type DesktopOrderListWidgetProps = {
112
112
  symbol?: string;
113
113
  onSymbolChange?: (symbol: API.Symbol) => void;
114
114
  pnlNotionalDecimalPrecision?: number;
115
- sharePnLConfig?: SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>;
115
+ sharePnLConfig?: SharePnLConfig;
116
116
  testIds?: {
117
117
  tableBody?: string;
118
118
  };
@@ -120,24 +120,24 @@ type DesktopOrderListWidgetProps = {
120
120
  declare const DesktopOrderListWidget: react.ForwardRefExoticComponent<DesktopOrderListWidgetProps & react.RefAttributes<OrderListInstance>>;
121
121
  declare const MobileOrderListWidget: (props: {
122
122
  type: TabType;
123
- ordersStatus?: OrderStatus | undefined;
123
+ ordersStatus?: OrderStatus;
124
124
  /** if has value, will be fetch current symbol orders*/
125
- symbol?: string | undefined;
126
- onSymbolChange?: ((symbol: API.Symbol) => void) | undefined;
127
- sharePnLConfig?: (SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>) | undefined;
125
+ symbol?: string;
126
+ onSymbolChange?: (symbol: API.Symbol) => void;
127
+ sharePnLConfig?: SharePnLConfig;
128
128
  classNames?: {
129
- root?: string | undefined;
130
- cell?: string | undefined;
131
- content?: string | undefined;
132
- } | undefined;
133
- showFilter?: boolean | undefined;
129
+ root?: string;
130
+ cell?: string;
131
+ content?: string;
132
+ };
133
+ showFilter?: boolean;
134
134
  filterConfig?: {
135
- side?: OrderSide | "all" | undefined;
135
+ side?: OrderSide | "all";
136
136
  range?: {
137
- from?: Date | undefined;
138
- to?: Date | undefined;
139
- } | undefined;
140
- } | undefined;
137
+ from?: Date;
138
+ to?: Date;
139
+ };
140
+ };
141
141
  }) => react_jsx_runtime.JSX.Element;
142
142
 
143
143
  export { DesktopOrderList, DesktopOrderListWidget, MobileOrderList, MobileOrderListWidget, type OrderListInstance, type OrdersBuilderState, OrdersWidget, TabType, useOrderListScript, useOrdersScript };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as react from 'react';
2
2
  import { ForwardedRef, FC } from 'react';
3
- import { SharePnLConfig, SharePnLParams } from '@orderly.network/ui-share';
3
+ import { SharePnLConfig } from '@orderly.network/ui-share';
4
4
  import * as _orderly_network_ui from '@orderly.network/ui';
5
5
  import { Table } from '@orderly.network/ui';
6
6
  import * as _orderly_network_types from '@orderly.network/types';
7
- import { API, OrderStatus, OrderSide } from '@orderly.network/types';
7
+ import { OrderStatus, API, OrderSide } from '@orderly.network/types';
8
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
9
9
 
10
10
  type OrderListInstance = {
@@ -16,7 +16,7 @@ type useOrderListScriptOptions = {
16
16
  symbol?: string;
17
17
  enableLoadMore?: boolean;
18
18
  onSymbolChange?: (symbol: API.Symbol) => void;
19
- sharePnLConfig?: SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>;
19
+ sharePnLConfig?: SharePnLConfig;
20
20
  filterConfig?: {
21
21
  side?: OrderSide | "all";
22
22
  range?: {
@@ -32,9 +32,9 @@ declare const useOrderListScript: (props: useOrderListScriptOptions) => {
32
32
  dataSource: any[] | undefined;
33
33
  isLoading: boolean;
34
34
  loadMore: () => void;
35
- cancelOrder: (orderId: number, symbol?: string | undefined) => Promise<any>;
35
+ cancelOrder: (orderId: number, symbol?: string) => Promise<any>;
36
36
  updateOrder: (orderId: string, order: _orderly_network_types.OrderEntity) => Promise<any>;
37
- cancelAlgoOrder: (orderId: number, symbol?: string | undefined) => Promise<any>;
37
+ cancelAlgoOrder: (orderId: number, symbol?: string) => Promise<any>;
38
38
  updateAlgoOrder: (orderId: string, order: _orderly_network_types.OrderEntity) => Promise<any>;
39
39
  pagination: _orderly_network_ui.PaginationMeta | {
40
40
  page: number;
@@ -51,7 +51,7 @@ declare const useOrderListScript: (props: useOrderListScriptOptions) => {
51
51
  filterItems: any[];
52
52
  onCancelAll: () => void;
53
53
  onSymbolChange: ((symbol: API.Symbol) => void) | undefined;
54
- sharePnLConfig: (SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>) | undefined;
54
+ sharePnLConfig: SharePnLConfig | undefined;
55
55
  tableInstance: react.MutableRefObject<Table<any> | undefined>;
56
56
  symbolsInfo: {
57
57
  [x: string]: (key?: keyof API.SymbolExt | undefined, defaultValue?: (string | number) | undefined) => any;
@@ -73,7 +73,7 @@ declare enum TabType {
73
73
  type OrdersWidgetProps = {
74
74
  current?: TabType;
75
75
  pnlNotionalDecimalPrecision?: number;
76
- sharePnLConfig?: SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>;
76
+ sharePnLConfig?: SharePnLConfig;
77
77
  };
78
78
  declare const OrdersWidget: react.ForwardRefExoticComponent<OrdersWidgetProps & react.RefAttributes<OrderListInstance>>;
79
79
 
@@ -81,13 +81,13 @@ type UseOrdersScriptOptions = {
81
81
  current?: TabType;
82
82
  pnlNotionalDecimalPrecision?: number;
83
83
  ref: ForwardedRef<OrderListInstance>;
84
- sharePnLConfig?: SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>;
84
+ sharePnLConfig?: SharePnLConfig;
85
85
  };
86
86
  declare const useOrdersScript: (props: UseOrdersScriptOptions) => {
87
87
  current: TabType | undefined;
88
88
  pnlNotionalDecimalPrecision: number | undefined;
89
89
  orderListRef: react.RefObject<OrderListInstance>;
90
- sharePnLConfig: (SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>) | undefined;
90
+ sharePnLConfig: SharePnLConfig | undefined;
91
91
  };
92
92
  type OrdersBuilderState = ReturnType<typeof useOrdersScript>;
93
93
 
@@ -112,7 +112,7 @@ type DesktopOrderListWidgetProps = {
112
112
  symbol?: string;
113
113
  onSymbolChange?: (symbol: API.Symbol) => void;
114
114
  pnlNotionalDecimalPrecision?: number;
115
- sharePnLConfig?: SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>;
115
+ sharePnLConfig?: SharePnLConfig;
116
116
  testIds?: {
117
117
  tableBody?: string;
118
118
  };
@@ -120,24 +120,24 @@ type DesktopOrderListWidgetProps = {
120
120
  declare const DesktopOrderListWidget: react.ForwardRefExoticComponent<DesktopOrderListWidgetProps & react.RefAttributes<OrderListInstance>>;
121
121
  declare const MobileOrderListWidget: (props: {
122
122
  type: TabType;
123
- ordersStatus?: OrderStatus | undefined;
123
+ ordersStatus?: OrderStatus;
124
124
  /** if has value, will be fetch current symbol orders*/
125
- symbol?: string | undefined;
126
- onSymbolChange?: ((symbol: API.Symbol) => void) | undefined;
127
- sharePnLConfig?: (SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>) | undefined;
125
+ symbol?: string;
126
+ onSymbolChange?: (symbol: API.Symbol) => void;
127
+ sharePnLConfig?: SharePnLConfig;
128
128
  classNames?: {
129
- root?: string | undefined;
130
- cell?: string | undefined;
131
- content?: string | undefined;
132
- } | undefined;
133
- showFilter?: boolean | undefined;
129
+ root?: string;
130
+ cell?: string;
131
+ content?: string;
132
+ };
133
+ showFilter?: boolean;
134
134
  filterConfig?: {
135
- side?: OrderSide | "all" | undefined;
135
+ side?: OrderSide | "all";
136
136
  range?: {
137
- from?: Date | undefined;
138
- to?: Date | undefined;
139
- } | undefined;
140
- } | undefined;
137
+ from?: Date;
138
+ to?: Date;
139
+ };
140
+ };
141
141
  }) => react_jsx_runtime.JSX.Element;
142
142
 
143
143
  export { DesktopOrderList, DesktopOrderListWidget, MobileOrderList, MobileOrderListWidget, type OrderListInstance, type OrdersBuilderState, OrdersWidget, TabType, useOrderListScript, useOrdersScript };