@orderly.network/ui-orders 2.0.1-preview.3 → 2.0.1
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 +73 -48
- package/dist/index.d.ts +73 -48
- package/dist/index.js +15 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -8
package/dist/index.d.mts
CHANGED
|
@@ -1,48 +1,33 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { FC } from 'react';
|
|
2
|
+
import { ForwardedRef, FC } from 'react';
|
|
3
|
+
import { SharePnLConfig, SharePnLParams } from '@orderly.network/ui-share';
|
|
3
4
|
import * as _orderly_network_ui from '@orderly.network/ui';
|
|
5
|
+
import { Table } from '@orderly.network/ui';
|
|
4
6
|
import * as _orderly_network_types from '@orderly.network/types';
|
|
5
|
-
import {
|
|
7
|
+
import { API, OrderStatus, OrderSide } from '@orderly.network/types';
|
|
6
8
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
pending = "pending",
|
|
11
|
-
tp_sl = "tp_sl",
|
|
12
|
-
filled = "filled",
|
|
13
|
-
cancelled = "cancelled",
|
|
14
|
-
rejected = "rejected",
|
|
15
|
-
orderHistory = "orderHistory"
|
|
16
|
-
}
|
|
17
|
-
declare const OrdersWidget: FC<{
|
|
18
|
-
current?: TabType;
|
|
19
|
-
pnlNotionalDecimalPrecision?: number;
|
|
20
|
-
}>;
|
|
21
|
-
|
|
22
|
-
declare const useOrdersScript: (props: {
|
|
23
|
-
current?: TabType;
|
|
24
|
-
pnlNotionalDecimalPrecision?: number;
|
|
25
|
-
}) => {
|
|
26
|
-
current: TabType | undefined;
|
|
27
|
-
pnlNotionalDecimalPrecision: number | undefined;
|
|
10
|
+
type OrderListInstance = {
|
|
11
|
+
download?: () => void;
|
|
28
12
|
};
|
|
29
|
-
type
|
|
30
|
-
|
|
31
|
-
declare const useOrderListScript: (props: {
|
|
13
|
+
type useOrderListScriptOptions = {
|
|
32
14
|
type: TabType;
|
|
33
|
-
ordersStatus?: OrderStatus
|
|
34
|
-
symbol?: string
|
|
35
|
-
enableLoadMore?: boolean
|
|
36
|
-
onSymbolChange?: (
|
|
15
|
+
ordersStatus?: OrderStatus;
|
|
16
|
+
symbol?: string;
|
|
17
|
+
enableLoadMore?: boolean;
|
|
18
|
+
onSymbolChange?: (symbol: API.Symbol) => void;
|
|
19
|
+
sharePnLConfig?: SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>;
|
|
37
20
|
filterConfig?: {
|
|
38
|
-
side?: OrderSide | "all"
|
|
21
|
+
side?: OrderSide | "all";
|
|
39
22
|
range?: {
|
|
40
|
-
from?: Date
|
|
41
|
-
to?: Date
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
pnlNotionalDecimalPrecision?: number
|
|
45
|
-
|
|
23
|
+
from?: Date;
|
|
24
|
+
to?: Date;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
pnlNotionalDecimalPrecision?: number;
|
|
28
|
+
ref?: ForwardedRef<OrderListInstance>;
|
|
29
|
+
};
|
|
30
|
+
declare const useOrderListScript: (props: useOrderListScriptOptions) => {
|
|
46
31
|
type: TabType;
|
|
47
32
|
dataSource: any[] | undefined;
|
|
48
33
|
isLoading: boolean;
|
|
@@ -66,15 +51,52 @@ declare const useOrderListScript: (props: {
|
|
|
66
51
|
filterItems: any[];
|
|
67
52
|
onCancelAll: () => void;
|
|
68
53
|
onSymbolChange: ((symbol: API.Symbol) => void) | undefined;
|
|
54
|
+
sharePnLConfig: (SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>) | undefined;
|
|
55
|
+
tableInstance: react.MutableRefObject<Table<any> | undefined>;
|
|
56
|
+
symbolsInfo: {
|
|
57
|
+
[x: string]: (key?: keyof API.SymbolExt | undefined, defaultValue?: (string | number) | undefined) => any;
|
|
58
|
+
} & {
|
|
59
|
+
isNil: boolean;
|
|
60
|
+
};
|
|
69
61
|
};
|
|
70
|
-
type OrdersBuilderState = ReturnType<typeof useOrderListScript>;
|
|
62
|
+
type OrdersBuilderState$1 = ReturnType<typeof useOrderListScript>;
|
|
71
63
|
|
|
72
|
-
declare
|
|
64
|
+
declare enum TabType {
|
|
65
|
+
all = "all",
|
|
66
|
+
pending = "pending",
|
|
67
|
+
tp_sl = "tp_sl",
|
|
68
|
+
filled = "filled",
|
|
69
|
+
cancelled = "cancelled",
|
|
70
|
+
rejected = "rejected",
|
|
71
|
+
orderHistory = "orderHistory"
|
|
72
|
+
}
|
|
73
|
+
type OrdersWidgetProps = {
|
|
74
|
+
current?: TabType;
|
|
75
|
+
pnlNotionalDecimalPrecision?: number;
|
|
76
|
+
sharePnLConfig?: SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>;
|
|
77
|
+
};
|
|
78
|
+
declare const OrdersWidget: react.ForwardRefExoticComponent<OrdersWidgetProps & react.RefAttributes<OrderListInstance>>;
|
|
79
|
+
|
|
80
|
+
type UseOrdersScriptOptions = {
|
|
81
|
+
current?: TabType;
|
|
82
|
+
pnlNotionalDecimalPrecision?: number;
|
|
83
|
+
ref: ForwardedRef<OrderListInstance>;
|
|
84
|
+
sharePnLConfig?: SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>;
|
|
85
|
+
};
|
|
86
|
+
declare const useOrdersScript: (props: UseOrdersScriptOptions) => {
|
|
87
|
+
current: TabType | undefined;
|
|
88
|
+
pnlNotionalDecimalPrecision: number | undefined;
|
|
89
|
+
orderListRef: react.RefObject<OrderListInstance>;
|
|
90
|
+
sharePnLConfig: (SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>) | undefined;
|
|
91
|
+
};
|
|
92
|
+
type OrdersBuilderState = ReturnType<typeof useOrdersScript>;
|
|
93
|
+
|
|
94
|
+
declare const DesktopOrderList: FC<OrdersBuilderState$1 & {
|
|
73
95
|
testIds?: {
|
|
74
96
|
tableBody?: string;
|
|
75
97
|
};
|
|
76
98
|
}>;
|
|
77
|
-
declare const MobileOrderList: FC<OrdersBuilderState & {
|
|
99
|
+
declare const MobileOrderList: FC<OrdersBuilderState$1 & {
|
|
78
100
|
classNames?: {
|
|
79
101
|
root?: string;
|
|
80
102
|
cell?: string;
|
|
@@ -83,23 +105,26 @@ declare const MobileOrderList: FC<OrdersBuilderState & {
|
|
|
83
105
|
showFilter?: boolean;
|
|
84
106
|
}>;
|
|
85
107
|
|
|
86
|
-
|
|
108
|
+
type DesktopOrderListWidgetProps = {
|
|
87
109
|
type: TabType;
|
|
88
|
-
ordersStatus?: OrderStatus
|
|
110
|
+
ordersStatus?: OrderStatus;
|
|
89
111
|
/** if has value, will be fetch current symbol orders*/
|
|
90
|
-
symbol?: string
|
|
91
|
-
onSymbolChange?: (
|
|
92
|
-
pnlNotionalDecimalPrecision?: number
|
|
112
|
+
symbol?: string;
|
|
113
|
+
onSymbolChange?: (symbol: API.Symbol) => void;
|
|
114
|
+
pnlNotionalDecimalPrecision?: number;
|
|
115
|
+
sharePnLConfig?: SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>;
|
|
93
116
|
testIds?: {
|
|
94
|
-
tableBody?: string
|
|
95
|
-
}
|
|
96
|
-
}
|
|
117
|
+
tableBody?: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
declare const DesktopOrderListWidget: react.ForwardRefExoticComponent<DesktopOrderListWidgetProps & react.RefAttributes<OrderListInstance>>;
|
|
97
121
|
declare const MobileOrderListWidget: (props: {
|
|
98
122
|
type: TabType;
|
|
99
123
|
ordersStatus?: OrderStatus | undefined;
|
|
100
124
|
/** if has value, will be fetch current symbol orders*/
|
|
101
125
|
symbol?: string | undefined;
|
|
102
126
|
onSymbolChange?: ((symbol: API.Symbol) => void) | undefined;
|
|
127
|
+
sharePnLConfig?: (SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>) | undefined;
|
|
103
128
|
classNames?: {
|
|
104
129
|
root?: string | undefined;
|
|
105
130
|
cell?: string | undefined;
|
|
@@ -115,4 +140,4 @@ declare const MobileOrderListWidget: (props: {
|
|
|
115
140
|
} | undefined;
|
|
116
141
|
}) => react_jsx_runtime.JSX.Element;
|
|
117
142
|
|
|
118
|
-
export { DesktopOrderList, DesktopOrderListWidget, MobileOrderList, MobileOrderListWidget, type
|
|
143
|
+
export { DesktopOrderList, DesktopOrderListWidget, MobileOrderList, MobileOrderListWidget, type OrderListInstance, type OrdersBuilderState, OrdersWidget, TabType, useOrderListScript, useOrdersScript };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,48 +1,33 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { FC } from 'react';
|
|
2
|
+
import { ForwardedRef, FC } from 'react';
|
|
3
|
+
import { SharePnLConfig, SharePnLParams } from '@orderly.network/ui-share';
|
|
3
4
|
import * as _orderly_network_ui from '@orderly.network/ui';
|
|
5
|
+
import { Table } from '@orderly.network/ui';
|
|
4
6
|
import * as _orderly_network_types from '@orderly.network/types';
|
|
5
|
-
import {
|
|
7
|
+
import { API, OrderStatus, OrderSide } from '@orderly.network/types';
|
|
6
8
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
pending = "pending",
|
|
11
|
-
tp_sl = "tp_sl",
|
|
12
|
-
filled = "filled",
|
|
13
|
-
cancelled = "cancelled",
|
|
14
|
-
rejected = "rejected",
|
|
15
|
-
orderHistory = "orderHistory"
|
|
16
|
-
}
|
|
17
|
-
declare const OrdersWidget: FC<{
|
|
18
|
-
current?: TabType;
|
|
19
|
-
pnlNotionalDecimalPrecision?: number;
|
|
20
|
-
}>;
|
|
21
|
-
|
|
22
|
-
declare const useOrdersScript: (props: {
|
|
23
|
-
current?: TabType;
|
|
24
|
-
pnlNotionalDecimalPrecision?: number;
|
|
25
|
-
}) => {
|
|
26
|
-
current: TabType | undefined;
|
|
27
|
-
pnlNotionalDecimalPrecision: number | undefined;
|
|
10
|
+
type OrderListInstance = {
|
|
11
|
+
download?: () => void;
|
|
28
12
|
};
|
|
29
|
-
type
|
|
30
|
-
|
|
31
|
-
declare const useOrderListScript: (props: {
|
|
13
|
+
type useOrderListScriptOptions = {
|
|
32
14
|
type: TabType;
|
|
33
|
-
ordersStatus?: OrderStatus
|
|
34
|
-
symbol?: string
|
|
35
|
-
enableLoadMore?: boolean
|
|
36
|
-
onSymbolChange?: (
|
|
15
|
+
ordersStatus?: OrderStatus;
|
|
16
|
+
symbol?: string;
|
|
17
|
+
enableLoadMore?: boolean;
|
|
18
|
+
onSymbolChange?: (symbol: API.Symbol) => void;
|
|
19
|
+
sharePnLConfig?: SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>;
|
|
37
20
|
filterConfig?: {
|
|
38
|
-
side?: OrderSide | "all"
|
|
21
|
+
side?: OrderSide | "all";
|
|
39
22
|
range?: {
|
|
40
|
-
from?: Date
|
|
41
|
-
to?: Date
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
pnlNotionalDecimalPrecision?: number
|
|
45
|
-
|
|
23
|
+
from?: Date;
|
|
24
|
+
to?: Date;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
pnlNotionalDecimalPrecision?: number;
|
|
28
|
+
ref?: ForwardedRef<OrderListInstance>;
|
|
29
|
+
};
|
|
30
|
+
declare const useOrderListScript: (props: useOrderListScriptOptions) => {
|
|
46
31
|
type: TabType;
|
|
47
32
|
dataSource: any[] | undefined;
|
|
48
33
|
isLoading: boolean;
|
|
@@ -66,15 +51,52 @@ declare const useOrderListScript: (props: {
|
|
|
66
51
|
filterItems: any[];
|
|
67
52
|
onCancelAll: () => void;
|
|
68
53
|
onSymbolChange: ((symbol: API.Symbol) => void) | undefined;
|
|
54
|
+
sharePnLConfig: (SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>) | undefined;
|
|
55
|
+
tableInstance: react.MutableRefObject<Table<any> | undefined>;
|
|
56
|
+
symbolsInfo: {
|
|
57
|
+
[x: string]: (key?: keyof API.SymbolExt | undefined, defaultValue?: (string | number) | undefined) => any;
|
|
58
|
+
} & {
|
|
59
|
+
isNil: boolean;
|
|
60
|
+
};
|
|
69
61
|
};
|
|
70
|
-
type OrdersBuilderState = ReturnType<typeof useOrderListScript>;
|
|
62
|
+
type OrdersBuilderState$1 = ReturnType<typeof useOrderListScript>;
|
|
71
63
|
|
|
72
|
-
declare
|
|
64
|
+
declare enum TabType {
|
|
65
|
+
all = "all",
|
|
66
|
+
pending = "pending",
|
|
67
|
+
tp_sl = "tp_sl",
|
|
68
|
+
filled = "filled",
|
|
69
|
+
cancelled = "cancelled",
|
|
70
|
+
rejected = "rejected",
|
|
71
|
+
orderHistory = "orderHistory"
|
|
72
|
+
}
|
|
73
|
+
type OrdersWidgetProps = {
|
|
74
|
+
current?: TabType;
|
|
75
|
+
pnlNotionalDecimalPrecision?: number;
|
|
76
|
+
sharePnLConfig?: SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>;
|
|
77
|
+
};
|
|
78
|
+
declare const OrdersWidget: react.ForwardRefExoticComponent<OrdersWidgetProps & react.RefAttributes<OrderListInstance>>;
|
|
79
|
+
|
|
80
|
+
type UseOrdersScriptOptions = {
|
|
81
|
+
current?: TabType;
|
|
82
|
+
pnlNotionalDecimalPrecision?: number;
|
|
83
|
+
ref: ForwardedRef<OrderListInstance>;
|
|
84
|
+
sharePnLConfig?: SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>;
|
|
85
|
+
};
|
|
86
|
+
declare const useOrdersScript: (props: UseOrdersScriptOptions) => {
|
|
87
|
+
current: TabType | undefined;
|
|
88
|
+
pnlNotionalDecimalPrecision: number | undefined;
|
|
89
|
+
orderListRef: react.RefObject<OrderListInstance>;
|
|
90
|
+
sharePnLConfig: (SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>) | undefined;
|
|
91
|
+
};
|
|
92
|
+
type OrdersBuilderState = ReturnType<typeof useOrdersScript>;
|
|
93
|
+
|
|
94
|
+
declare const DesktopOrderList: FC<OrdersBuilderState$1 & {
|
|
73
95
|
testIds?: {
|
|
74
96
|
tableBody?: string;
|
|
75
97
|
};
|
|
76
98
|
}>;
|
|
77
|
-
declare const MobileOrderList: FC<OrdersBuilderState & {
|
|
99
|
+
declare const MobileOrderList: FC<OrdersBuilderState$1 & {
|
|
78
100
|
classNames?: {
|
|
79
101
|
root?: string;
|
|
80
102
|
cell?: string;
|
|
@@ -83,23 +105,26 @@ declare const MobileOrderList: FC<OrdersBuilderState & {
|
|
|
83
105
|
showFilter?: boolean;
|
|
84
106
|
}>;
|
|
85
107
|
|
|
86
|
-
|
|
108
|
+
type DesktopOrderListWidgetProps = {
|
|
87
109
|
type: TabType;
|
|
88
|
-
ordersStatus?: OrderStatus
|
|
110
|
+
ordersStatus?: OrderStatus;
|
|
89
111
|
/** if has value, will be fetch current symbol orders*/
|
|
90
|
-
symbol?: string
|
|
91
|
-
onSymbolChange?: (
|
|
92
|
-
pnlNotionalDecimalPrecision?: number
|
|
112
|
+
symbol?: string;
|
|
113
|
+
onSymbolChange?: (symbol: API.Symbol) => void;
|
|
114
|
+
pnlNotionalDecimalPrecision?: number;
|
|
115
|
+
sharePnLConfig?: SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>;
|
|
93
116
|
testIds?: {
|
|
94
|
-
tableBody?: string
|
|
95
|
-
}
|
|
96
|
-
}
|
|
117
|
+
tableBody?: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
declare const DesktopOrderListWidget: react.ForwardRefExoticComponent<DesktopOrderListWidgetProps & react.RefAttributes<OrderListInstance>>;
|
|
97
121
|
declare const MobileOrderListWidget: (props: {
|
|
98
122
|
type: TabType;
|
|
99
123
|
ordersStatus?: OrderStatus | undefined;
|
|
100
124
|
/** if has value, will be fetch current symbol orders*/
|
|
101
125
|
symbol?: string | undefined;
|
|
102
126
|
onSymbolChange?: ((symbol: API.Symbol) => void) | undefined;
|
|
127
|
+
sharePnLConfig?: (SharePnLConfig & Partial<Omit<SharePnLParams, "position" | "refCode" | "leverage">>) | undefined;
|
|
103
128
|
classNames?: {
|
|
104
129
|
root?: string | undefined;
|
|
105
130
|
cell?: string | undefined;
|
|
@@ -115,4 +140,4 @@ declare const MobileOrderListWidget: (props: {
|
|
|
115
140
|
} | undefined;
|
|
116
141
|
}) => react_jsx_runtime.JSX.Element;
|
|
117
142
|
|
|
118
|
-
export { DesktopOrderList, DesktopOrderListWidget, MobileOrderList, MobileOrderListWidget, type
|
|
143
|
+
export { DesktopOrderList, DesktopOrderListWidget, MobileOrderList, MobileOrderListWidget, type OrderListInstance, type OrdersBuilderState, OrdersWidget, TabType, useOrderListScript, useOrdersScript };
|