@orderly.network/ui-order-entry 2.6.2 → 2.6.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 +43 -36
- package/dist/index.d.ts +43 -36
- package/dist/index.js +14 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -11
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +14 -12
package/dist/index.d.mts
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import react__default, {
|
|
2
|
+
import react__default, { FC } from 'react';
|
|
3
3
|
import * as _orderly_network_hooks from '@orderly.network/hooks';
|
|
4
4
|
import * as _orderly_network_types from '@orderly.network/types';
|
|
5
|
-
import { OrderSide, OrderType, OrderLevel,
|
|
5
|
+
import { OrderSide, OrderType, OrderLevel, OrderlyOrder, API } from '@orderly.network/types';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
declare enum InputType {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
NONE = 0,
|
|
10
|
+
PRICE = 1,// price input focus
|
|
11
|
+
TRIGGER_PRICE = 2,// trigger price input focus
|
|
12
|
+
QUANTITY = 3,// quantity input focus
|
|
13
|
+
TOTAL = 4,// total input focus
|
|
14
|
+
/**
|
|
15
|
+
* Scaled order
|
|
16
|
+
*/
|
|
17
|
+
START_PRICE = 5,// scaled order start price input focus
|
|
18
|
+
END_PRICE = 6,// scaled order end price input focus
|
|
19
|
+
TOTAL_ORDERS = 7,// scaled order total orders input focus
|
|
20
|
+
SKEW = 8,// scaled order skew input focus
|
|
21
|
+
/**
|
|
22
|
+
* Trailing stop
|
|
23
|
+
*/
|
|
24
|
+
ACTIVATED_PRICE = 9,// trailing stop activated price input focus
|
|
25
|
+
CALLBACK_VALUE = 10,// trailing stop callback value input focus
|
|
26
|
+
CALLBACK_RATE = 11
|
|
18
27
|
}
|
|
19
28
|
|
|
20
29
|
declare enum BBOStatus {
|
|
@@ -28,40 +37,37 @@ type OrderEntryScriptInputs = {
|
|
|
28
37
|
};
|
|
29
38
|
type OrderEntryScriptReturn = ReturnType<typeof useOrderEntryScript>;
|
|
30
39
|
declare const useOrderEntryScript: (inputs: OrderEntryScriptInputs) => {
|
|
31
|
-
currentQtyPercentage: number;
|
|
32
40
|
side: OrderSide;
|
|
33
41
|
type: OrderType;
|
|
34
42
|
level: OrderLevel;
|
|
35
|
-
|
|
43
|
+
formattedOrder: Partial<_orderly_network_types.OrderlyOrder>;
|
|
44
|
+
setOrderValue: (this: unknown, key: any, value: any, options?: {
|
|
36
45
|
shouldUpdateLastChangedField?: boolean;
|
|
37
|
-
}) => void;
|
|
46
|
+
} | undefined) => void;
|
|
38
47
|
setOrderValues: (values: Partial<_orderly_network_types.OrderlyOrder>) => void;
|
|
39
48
|
currentLeverage: number | null;
|
|
40
|
-
formattedOrder: Partial<_orderly_network_types.OrderlyOrder>;
|
|
41
49
|
tpslSwitch: any;
|
|
42
50
|
setTpslSwitch: (state: boolean) => void;
|
|
43
51
|
setMaxQty: () => void;
|
|
44
52
|
symbolInfo: _orderly_network_types.API.SymbolExt;
|
|
45
|
-
onFocus: (type: InputType) => (_: FocusEvent) => void;
|
|
46
|
-
onBlur: (type: InputType) => (_: FocusEvent) => void;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
onFocus: (this: unknown, type: InputType) => (_: react.FocusEvent) => void;
|
|
54
|
+
onBlur: (this: unknown, type: InputType) => (_: react.FocusEvent) => void;
|
|
55
|
+
priceInputRef: react.MutableRefObject<HTMLInputElement | null>;
|
|
56
|
+
priceInputContainerRef: react.MutableRefObject<HTMLDivElement | null>;
|
|
57
|
+
priceInputContainerWidth: number;
|
|
58
|
+
triggerPriceInputRef: react.MutableRefObject<HTMLInputElement | null>;
|
|
59
|
+
activatedPriceInputRef: react.MutableRefObject<HTMLInputElement | null>;
|
|
52
60
|
canTrade: boolean;
|
|
53
61
|
bboStatus: BBOStatus;
|
|
54
62
|
bboType: any;
|
|
55
|
-
onBBOChange: (value: BBOOrderType) => void;
|
|
63
|
+
onBBOChange: (value: _orderly_network_types.BBOOrderType) => void;
|
|
56
64
|
toggleBBO: () => void;
|
|
57
|
-
priceInputContainerWidth: number;
|
|
58
65
|
currentLtv: number;
|
|
59
66
|
fillMiddleValue: () => void;
|
|
60
|
-
quantityUnit: any;
|
|
61
|
-
setQuantityUnit: (value: "base" | "quote") => void;
|
|
62
67
|
symbol: string;
|
|
63
68
|
soundAlert: any;
|
|
64
69
|
setSoundAlert: (value: boolean) => void;
|
|
70
|
+
currentFocusInput: react.MutableRefObject<InputType>;
|
|
65
71
|
submit: (options?: {
|
|
66
72
|
resetOnSuccess?: boolean;
|
|
67
73
|
}) => Promise<{
|
|
@@ -92,15 +98,15 @@ declare const useOrderEntryScript: (inputs: OrderEntryScriptInputs) => {
|
|
|
92
98
|
};
|
|
93
99
|
|
|
94
100
|
type OrderEntryProps = OrderEntryScriptReturn & {
|
|
95
|
-
containerRef
|
|
101
|
+
containerRef?: react__default.RefObject<HTMLDivElement>;
|
|
96
102
|
disableFeatures?: ("slippageSetting" | "feesInfo")[];
|
|
97
103
|
};
|
|
98
104
|
declare const OrderEntry: react__default.FC<OrderEntryProps>;
|
|
99
105
|
|
|
100
|
-
declare const OrderEntryWidget:
|
|
101
|
-
containerRef?:
|
|
106
|
+
declare const OrderEntryWidget: react__default.FC<OrderEntryScriptInputs & {
|
|
107
|
+
containerRef?: react__default.RefObject<HTMLDivElement>;
|
|
102
108
|
disableFeatures?: ("slippageSetting" | "feesInfo")[];
|
|
103
|
-
}
|
|
109
|
+
}>;
|
|
104
110
|
|
|
105
111
|
type OrderConfirmDialogProps = {
|
|
106
112
|
order: OrderlyOrder;
|
|
@@ -118,15 +124,16 @@ type AdditionalInfoProps = {
|
|
|
118
124
|
setPinned: (value: boolean) => void;
|
|
119
125
|
needConfirm: boolean;
|
|
120
126
|
setNeedConfirm: (value: boolean) => void;
|
|
121
|
-
orderTypeExtra?: OrderType;
|
|
122
|
-
onValueChange?: (key: keyof OrderlyOrder, value: any) => void;
|
|
123
|
-
showExtra?: boolean;
|
|
124
127
|
hidden: boolean;
|
|
125
128
|
setHidden: (value: boolean) => void;
|
|
129
|
+
onValueChange?: (key: keyof OrderlyOrder, value: any) => void;
|
|
130
|
+
orderTypeExtra?: OrderType;
|
|
131
|
+
showExtra?: boolean;
|
|
126
132
|
};
|
|
127
|
-
|
|
128
|
-
declare const AdditionalInfoWidget: (props: AdditionalInfoProps) => react_jsx_runtime.JSX.Element;
|
|
133
|
+
declare const AdditionalInfo: FC<AdditionalInfoProps>;
|
|
129
134
|
|
|
130
135
|
declare const LTVRiskTooltipWidget: react__default.FC;
|
|
131
136
|
|
|
132
|
-
|
|
137
|
+
declare const FeesWidget: react__default.FC;
|
|
138
|
+
|
|
139
|
+
export { AdditionalInfo, FeesWidget, LTVRiskTooltipWidget, OrderConfirmDialog, OrderEntry, OrderEntryWidget, useOrderEntryScript };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import react__default, {
|
|
2
|
+
import react__default, { FC } from 'react';
|
|
3
3
|
import * as _orderly_network_hooks from '@orderly.network/hooks';
|
|
4
4
|
import * as _orderly_network_types from '@orderly.network/types';
|
|
5
|
-
import { OrderSide, OrderType, OrderLevel,
|
|
5
|
+
import { OrderSide, OrderType, OrderLevel, OrderlyOrder, API } from '@orderly.network/types';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
declare enum InputType {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
NONE = 0,
|
|
10
|
+
PRICE = 1,// price input focus
|
|
11
|
+
TRIGGER_PRICE = 2,// trigger price input focus
|
|
12
|
+
QUANTITY = 3,// quantity input focus
|
|
13
|
+
TOTAL = 4,// total input focus
|
|
14
|
+
/**
|
|
15
|
+
* Scaled order
|
|
16
|
+
*/
|
|
17
|
+
START_PRICE = 5,// scaled order start price input focus
|
|
18
|
+
END_PRICE = 6,// scaled order end price input focus
|
|
19
|
+
TOTAL_ORDERS = 7,// scaled order total orders input focus
|
|
20
|
+
SKEW = 8,// scaled order skew input focus
|
|
21
|
+
/**
|
|
22
|
+
* Trailing stop
|
|
23
|
+
*/
|
|
24
|
+
ACTIVATED_PRICE = 9,// trailing stop activated price input focus
|
|
25
|
+
CALLBACK_VALUE = 10,// trailing stop callback value input focus
|
|
26
|
+
CALLBACK_RATE = 11
|
|
18
27
|
}
|
|
19
28
|
|
|
20
29
|
declare enum BBOStatus {
|
|
@@ -28,40 +37,37 @@ type OrderEntryScriptInputs = {
|
|
|
28
37
|
};
|
|
29
38
|
type OrderEntryScriptReturn = ReturnType<typeof useOrderEntryScript>;
|
|
30
39
|
declare const useOrderEntryScript: (inputs: OrderEntryScriptInputs) => {
|
|
31
|
-
currentQtyPercentage: number;
|
|
32
40
|
side: OrderSide;
|
|
33
41
|
type: OrderType;
|
|
34
42
|
level: OrderLevel;
|
|
35
|
-
|
|
43
|
+
formattedOrder: Partial<_orderly_network_types.OrderlyOrder>;
|
|
44
|
+
setOrderValue: (this: unknown, key: any, value: any, options?: {
|
|
36
45
|
shouldUpdateLastChangedField?: boolean;
|
|
37
|
-
}) => void;
|
|
46
|
+
} | undefined) => void;
|
|
38
47
|
setOrderValues: (values: Partial<_orderly_network_types.OrderlyOrder>) => void;
|
|
39
48
|
currentLeverage: number | null;
|
|
40
|
-
formattedOrder: Partial<_orderly_network_types.OrderlyOrder>;
|
|
41
49
|
tpslSwitch: any;
|
|
42
50
|
setTpslSwitch: (state: boolean) => void;
|
|
43
51
|
setMaxQty: () => void;
|
|
44
52
|
symbolInfo: _orderly_network_types.API.SymbolExt;
|
|
45
|
-
onFocus: (type: InputType) => (_: FocusEvent) => void;
|
|
46
|
-
onBlur: (type: InputType) => (_: FocusEvent) => void;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
onFocus: (this: unknown, type: InputType) => (_: react.FocusEvent) => void;
|
|
54
|
+
onBlur: (this: unknown, type: InputType) => (_: react.FocusEvent) => void;
|
|
55
|
+
priceInputRef: react.MutableRefObject<HTMLInputElement | null>;
|
|
56
|
+
priceInputContainerRef: react.MutableRefObject<HTMLDivElement | null>;
|
|
57
|
+
priceInputContainerWidth: number;
|
|
58
|
+
triggerPriceInputRef: react.MutableRefObject<HTMLInputElement | null>;
|
|
59
|
+
activatedPriceInputRef: react.MutableRefObject<HTMLInputElement | null>;
|
|
52
60
|
canTrade: boolean;
|
|
53
61
|
bboStatus: BBOStatus;
|
|
54
62
|
bboType: any;
|
|
55
|
-
onBBOChange: (value: BBOOrderType) => void;
|
|
63
|
+
onBBOChange: (value: _orderly_network_types.BBOOrderType) => void;
|
|
56
64
|
toggleBBO: () => void;
|
|
57
|
-
priceInputContainerWidth: number;
|
|
58
65
|
currentLtv: number;
|
|
59
66
|
fillMiddleValue: () => void;
|
|
60
|
-
quantityUnit: any;
|
|
61
|
-
setQuantityUnit: (value: "base" | "quote") => void;
|
|
62
67
|
symbol: string;
|
|
63
68
|
soundAlert: any;
|
|
64
69
|
setSoundAlert: (value: boolean) => void;
|
|
70
|
+
currentFocusInput: react.MutableRefObject<InputType>;
|
|
65
71
|
submit: (options?: {
|
|
66
72
|
resetOnSuccess?: boolean;
|
|
67
73
|
}) => Promise<{
|
|
@@ -92,15 +98,15 @@ declare const useOrderEntryScript: (inputs: OrderEntryScriptInputs) => {
|
|
|
92
98
|
};
|
|
93
99
|
|
|
94
100
|
type OrderEntryProps = OrderEntryScriptReturn & {
|
|
95
|
-
containerRef
|
|
101
|
+
containerRef?: react__default.RefObject<HTMLDivElement>;
|
|
96
102
|
disableFeatures?: ("slippageSetting" | "feesInfo")[];
|
|
97
103
|
};
|
|
98
104
|
declare const OrderEntry: react__default.FC<OrderEntryProps>;
|
|
99
105
|
|
|
100
|
-
declare const OrderEntryWidget:
|
|
101
|
-
containerRef?:
|
|
106
|
+
declare const OrderEntryWidget: react__default.FC<OrderEntryScriptInputs & {
|
|
107
|
+
containerRef?: react__default.RefObject<HTMLDivElement>;
|
|
102
108
|
disableFeatures?: ("slippageSetting" | "feesInfo")[];
|
|
103
|
-
}
|
|
109
|
+
}>;
|
|
104
110
|
|
|
105
111
|
type OrderConfirmDialogProps = {
|
|
106
112
|
order: OrderlyOrder;
|
|
@@ -118,15 +124,16 @@ type AdditionalInfoProps = {
|
|
|
118
124
|
setPinned: (value: boolean) => void;
|
|
119
125
|
needConfirm: boolean;
|
|
120
126
|
setNeedConfirm: (value: boolean) => void;
|
|
121
|
-
orderTypeExtra?: OrderType;
|
|
122
|
-
onValueChange?: (key: keyof OrderlyOrder, value: any) => void;
|
|
123
|
-
showExtra?: boolean;
|
|
124
127
|
hidden: boolean;
|
|
125
128
|
setHidden: (value: boolean) => void;
|
|
129
|
+
onValueChange?: (key: keyof OrderlyOrder, value: any) => void;
|
|
130
|
+
orderTypeExtra?: OrderType;
|
|
131
|
+
showExtra?: boolean;
|
|
126
132
|
};
|
|
127
|
-
|
|
128
|
-
declare const AdditionalInfoWidget: (props: AdditionalInfoProps) => react_jsx_runtime.JSX.Element;
|
|
133
|
+
declare const AdditionalInfo: FC<AdditionalInfoProps>;
|
|
129
134
|
|
|
130
135
|
declare const LTVRiskTooltipWidget: react__default.FC;
|
|
131
136
|
|
|
132
|
-
|
|
137
|
+
declare const FeesWidget: react__default.FC;
|
|
138
|
+
|
|
139
|
+
export { AdditionalInfo, FeesWidget, LTVRiskTooltipWidget, OrderConfirmDialog, OrderEntry, OrderEntryWidget, useOrderEntryScript };
|