@kodiak-finance/orderly-ui-order-entry 2.8.18 → 2.8.19-rc.0
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 +19 -14
- package/dist/index.d.ts +19 -14
- package/dist/index.js +17761 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17759 -10
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +12 -12
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { FC } from 'react';
|
|
3
|
-
import * as _kodiak_finance_orderly_hooks from '@kodiak-finance/orderly-hooks';
|
|
4
3
|
import * as _kodiak_finance_orderly_types from '@kodiak-finance/orderly-types';
|
|
5
4
|
import { OrderSide, OrderType, OrderLevel, OrderlyOrder, API } from '@kodiak-finance/orderly-types';
|
|
5
|
+
import * as _kodiak_finance_orderly_hooks from '@kodiak-finance/orderly-hooks';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
declare enum InputType {
|
|
@@ -10,20 +10,22 @@ declare enum InputType {
|
|
|
10
10
|
PRICE = 1,// price input focus
|
|
11
11
|
TRIGGER_PRICE = 2,// trigger price input focus
|
|
12
12
|
QUANTITY = 3,// quantity input focus
|
|
13
|
-
|
|
13
|
+
QUANTITY_SLIDER = 4,// quantity slider input focus
|
|
14
|
+
TOTAL = 5,// total input focus
|
|
15
|
+
MARGIN = 6,// margin input focus
|
|
14
16
|
/**
|
|
15
17
|
* Scaled order
|
|
16
18
|
*/
|
|
17
|
-
START_PRICE =
|
|
18
|
-
END_PRICE =
|
|
19
|
-
TOTAL_ORDERS =
|
|
20
|
-
SKEW =
|
|
19
|
+
START_PRICE = 7,// scaled order start price input focus
|
|
20
|
+
END_PRICE = 8,// scaled order end price input focus
|
|
21
|
+
TOTAL_ORDERS = 9,// scaled order total orders input focus
|
|
22
|
+
SKEW = 10,// scaled order skew input focus
|
|
21
23
|
/**
|
|
22
24
|
* Trailing stop
|
|
23
25
|
*/
|
|
24
|
-
ACTIVATED_PRICE =
|
|
25
|
-
CALLBACK_VALUE =
|
|
26
|
-
CALLBACK_RATE =
|
|
26
|
+
ACTIVATED_PRICE = 11,// trailing stop activated price input focus
|
|
27
|
+
CALLBACK_VALUE = 12,// trailing stop callback value input focus
|
|
28
|
+
CALLBACK_RATE = 13
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
declare enum BBOStatus {
|
|
@@ -37,6 +39,7 @@ type OrderEntryScriptInputs = {
|
|
|
37
39
|
};
|
|
38
40
|
type OrderEntryScriptReturn = ReturnType<typeof useOrderEntryScript>;
|
|
39
41
|
declare const useOrderEntryScript: (inputs: OrderEntryScriptInputs) => {
|
|
42
|
+
slPriceError: _kodiak_finance_orderly_hooks.OrderValidationResult | undefined;
|
|
40
43
|
side: OrderSide;
|
|
41
44
|
type: OrderType;
|
|
42
45
|
level: OrderLevel;
|
|
@@ -48,7 +51,6 @@ declare const useOrderEntryScript: (inputs: OrderEntryScriptInputs) => {
|
|
|
48
51
|
currentLeverage: number | null;
|
|
49
52
|
tpslSwitch: any;
|
|
50
53
|
setTpslSwitch: (state: boolean) => void;
|
|
51
|
-
setMaxQty: () => void;
|
|
52
54
|
symbolInfo: _kodiak_finance_orderly_types.API.SymbolExt;
|
|
53
55
|
onFocus: (this: unknown, type: InputType) => (_: react.FocusEvent) => void;
|
|
54
56
|
onBlur: (this: unknown, type: InputType) => (_: react.FocusEvent) => void;
|
|
@@ -57,6 +59,7 @@ declare const useOrderEntryScript: (inputs: OrderEntryScriptInputs) => {
|
|
|
57
59
|
priceInputContainerWidth: number;
|
|
58
60
|
triggerPriceInputRef: react.MutableRefObject<HTMLInputElement | null>;
|
|
59
61
|
activatedPriceInputRef: react.MutableRefObject<HTMLInputElement | null>;
|
|
62
|
+
lastQuantityInputType: react.MutableRefObject<InputType>;
|
|
60
63
|
canTrade: boolean;
|
|
61
64
|
bboStatus: BBOStatus;
|
|
62
65
|
bboType: any;
|
|
@@ -68,7 +71,6 @@ declare const useOrderEntryScript: (inputs: OrderEntryScriptInputs) => {
|
|
|
68
71
|
soundAlert: any;
|
|
69
72
|
setSoundAlert: (value: boolean) => void;
|
|
70
73
|
currentFocusInput: react.MutableRefObject<InputType>;
|
|
71
|
-
symbolLeverage: number | undefined;
|
|
72
74
|
submit: (options?: {
|
|
73
75
|
resetOnSuccess?: boolean;
|
|
74
76
|
}) => Promise<{
|
|
@@ -85,7 +87,7 @@ declare const useOrderEntryScript: (inputs: OrderEntryScriptInputs) => {
|
|
|
85
87
|
estSlippage: number | null;
|
|
86
88
|
helper: {
|
|
87
89
|
validator: () => Promise<_kodiak_finance_orderly_hooks.OrderValidationResult | null>;
|
|
88
|
-
validate: () => Promise<_kodiak_finance_orderly_hooks.OrderValidationResult | null>;
|
|
90
|
+
validate: (otherErrors?: _kodiak_finance_orderly_hooks.OrderValidationResult) => Promise<_kodiak_finance_orderly_hooks.OrderValidationResult | null>;
|
|
89
91
|
};
|
|
90
92
|
freeCollateral: number;
|
|
91
93
|
metaState: {
|
|
@@ -95,7 +97,8 @@ declare const useOrderEntryScript: (inputs: OrderEntryScriptInputs) => {
|
|
|
95
97
|
errors: _kodiak_finance_orderly_hooks.OrderValidationResult | null;
|
|
96
98
|
};
|
|
97
99
|
isMutating: boolean;
|
|
98
|
-
markPrice
|
|
100
|
+
markPrice?: number;
|
|
101
|
+
symbolLeverage?: number;
|
|
99
102
|
};
|
|
100
103
|
|
|
101
104
|
type OrderEntryProps = OrderEntryScriptReturn & {
|
|
@@ -135,6 +138,8 @@ declare const AdditionalInfo: FC<AdditionalInfoProps>;
|
|
|
135
138
|
|
|
136
139
|
declare const LTVRiskTooltipWidget: react__default.FC;
|
|
137
140
|
|
|
138
|
-
declare const FeesWidget: react__default.FC
|
|
141
|
+
declare const FeesWidget: react__default.FC<{
|
|
142
|
+
symbol: string;
|
|
143
|
+
}>;
|
|
139
144
|
|
|
140
145
|
export { AdditionalInfo, FeesWidget, LTVRiskTooltipWidget, OrderConfirmDialog, OrderEntry, OrderEntryWidget, useOrderEntryScript };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { FC } from 'react';
|
|
3
|
-
import * as _kodiak_finance_orderly_hooks from '@kodiak-finance/orderly-hooks';
|
|
4
3
|
import * as _kodiak_finance_orderly_types from '@kodiak-finance/orderly-types';
|
|
5
4
|
import { OrderSide, OrderType, OrderLevel, OrderlyOrder, API } from '@kodiak-finance/orderly-types';
|
|
5
|
+
import * as _kodiak_finance_orderly_hooks from '@kodiak-finance/orderly-hooks';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
declare enum InputType {
|
|
@@ -10,20 +10,22 @@ declare enum InputType {
|
|
|
10
10
|
PRICE = 1,// price input focus
|
|
11
11
|
TRIGGER_PRICE = 2,// trigger price input focus
|
|
12
12
|
QUANTITY = 3,// quantity input focus
|
|
13
|
-
|
|
13
|
+
QUANTITY_SLIDER = 4,// quantity slider input focus
|
|
14
|
+
TOTAL = 5,// total input focus
|
|
15
|
+
MARGIN = 6,// margin input focus
|
|
14
16
|
/**
|
|
15
17
|
* Scaled order
|
|
16
18
|
*/
|
|
17
|
-
START_PRICE =
|
|
18
|
-
END_PRICE =
|
|
19
|
-
TOTAL_ORDERS =
|
|
20
|
-
SKEW =
|
|
19
|
+
START_PRICE = 7,// scaled order start price input focus
|
|
20
|
+
END_PRICE = 8,// scaled order end price input focus
|
|
21
|
+
TOTAL_ORDERS = 9,// scaled order total orders input focus
|
|
22
|
+
SKEW = 10,// scaled order skew input focus
|
|
21
23
|
/**
|
|
22
24
|
* Trailing stop
|
|
23
25
|
*/
|
|
24
|
-
ACTIVATED_PRICE =
|
|
25
|
-
CALLBACK_VALUE =
|
|
26
|
-
CALLBACK_RATE =
|
|
26
|
+
ACTIVATED_PRICE = 11,// trailing stop activated price input focus
|
|
27
|
+
CALLBACK_VALUE = 12,// trailing stop callback value input focus
|
|
28
|
+
CALLBACK_RATE = 13
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
declare enum BBOStatus {
|
|
@@ -37,6 +39,7 @@ type OrderEntryScriptInputs = {
|
|
|
37
39
|
};
|
|
38
40
|
type OrderEntryScriptReturn = ReturnType<typeof useOrderEntryScript>;
|
|
39
41
|
declare const useOrderEntryScript: (inputs: OrderEntryScriptInputs) => {
|
|
42
|
+
slPriceError: _kodiak_finance_orderly_hooks.OrderValidationResult | undefined;
|
|
40
43
|
side: OrderSide;
|
|
41
44
|
type: OrderType;
|
|
42
45
|
level: OrderLevel;
|
|
@@ -48,7 +51,6 @@ declare const useOrderEntryScript: (inputs: OrderEntryScriptInputs) => {
|
|
|
48
51
|
currentLeverage: number | null;
|
|
49
52
|
tpslSwitch: any;
|
|
50
53
|
setTpslSwitch: (state: boolean) => void;
|
|
51
|
-
setMaxQty: () => void;
|
|
52
54
|
symbolInfo: _kodiak_finance_orderly_types.API.SymbolExt;
|
|
53
55
|
onFocus: (this: unknown, type: InputType) => (_: react.FocusEvent) => void;
|
|
54
56
|
onBlur: (this: unknown, type: InputType) => (_: react.FocusEvent) => void;
|
|
@@ -57,6 +59,7 @@ declare const useOrderEntryScript: (inputs: OrderEntryScriptInputs) => {
|
|
|
57
59
|
priceInputContainerWidth: number;
|
|
58
60
|
triggerPriceInputRef: react.MutableRefObject<HTMLInputElement | null>;
|
|
59
61
|
activatedPriceInputRef: react.MutableRefObject<HTMLInputElement | null>;
|
|
62
|
+
lastQuantityInputType: react.MutableRefObject<InputType>;
|
|
60
63
|
canTrade: boolean;
|
|
61
64
|
bboStatus: BBOStatus;
|
|
62
65
|
bboType: any;
|
|
@@ -68,7 +71,6 @@ declare const useOrderEntryScript: (inputs: OrderEntryScriptInputs) => {
|
|
|
68
71
|
soundAlert: any;
|
|
69
72
|
setSoundAlert: (value: boolean) => void;
|
|
70
73
|
currentFocusInput: react.MutableRefObject<InputType>;
|
|
71
|
-
symbolLeverage: number | undefined;
|
|
72
74
|
submit: (options?: {
|
|
73
75
|
resetOnSuccess?: boolean;
|
|
74
76
|
}) => Promise<{
|
|
@@ -85,7 +87,7 @@ declare const useOrderEntryScript: (inputs: OrderEntryScriptInputs) => {
|
|
|
85
87
|
estSlippage: number | null;
|
|
86
88
|
helper: {
|
|
87
89
|
validator: () => Promise<_kodiak_finance_orderly_hooks.OrderValidationResult | null>;
|
|
88
|
-
validate: () => Promise<_kodiak_finance_orderly_hooks.OrderValidationResult | null>;
|
|
90
|
+
validate: (otherErrors?: _kodiak_finance_orderly_hooks.OrderValidationResult) => Promise<_kodiak_finance_orderly_hooks.OrderValidationResult | null>;
|
|
89
91
|
};
|
|
90
92
|
freeCollateral: number;
|
|
91
93
|
metaState: {
|
|
@@ -95,7 +97,8 @@ declare const useOrderEntryScript: (inputs: OrderEntryScriptInputs) => {
|
|
|
95
97
|
errors: _kodiak_finance_orderly_hooks.OrderValidationResult | null;
|
|
96
98
|
};
|
|
97
99
|
isMutating: boolean;
|
|
98
|
-
markPrice
|
|
100
|
+
markPrice?: number;
|
|
101
|
+
symbolLeverage?: number;
|
|
99
102
|
};
|
|
100
103
|
|
|
101
104
|
type OrderEntryProps = OrderEntryScriptReturn & {
|
|
@@ -135,6 +138,8 @@ declare const AdditionalInfo: FC<AdditionalInfoProps>;
|
|
|
135
138
|
|
|
136
139
|
declare const LTVRiskTooltipWidget: react__default.FC;
|
|
137
140
|
|
|
138
|
-
declare const FeesWidget: react__default.FC
|
|
141
|
+
declare const FeesWidget: react__default.FC<{
|
|
142
|
+
symbol: string;
|
|
143
|
+
}>;
|
|
139
144
|
|
|
140
145
|
export { AdditionalInfo, FeesWidget, LTVRiskTooltipWidget, OrderConfirmDialog, OrderEntry, OrderEntryWidget, useOrderEntryScript };
|