@nadohq/trigger-client 0.1.0-alpha.3 → 0.1.0-alpha.31
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/TriggerClient.cjs +74 -34
- package/dist/TriggerClient.cjs.map +1 -1
- package/dist/TriggerClient.d.cts +8 -4
- package/dist/TriggerClient.d.ts +8 -4
- package/dist/TriggerClient.js +73 -28
- package/dist/TriggerClient.js.map +1 -1
- package/dist/dataMappers.cjs +170 -67
- package/dist/dataMappers.cjs.map +1 -1
- package/dist/dataMappers.d.cts +22 -8
- package/dist/dataMappers.d.ts +22 -8
- package/dist/dataMappers.js +171 -66
- package/dist/dataMappers.js.map +1 -1
- package/dist/endpoints.cjs +2 -2
- package/dist/endpoints.cjs.map +1 -1
- package/dist/endpoints.d.cts +1 -1
- package/dist/endpoints.d.ts +1 -1
- package/dist/endpoints.js +2 -2
- package/dist/endpoints.js.map +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -8
- package/dist/index.d.ts +9 -8
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/types/TriggerServerFailureError.cjs +1 -1
- package/dist/types/TriggerServerFailureError.cjs.map +1 -1
- package/dist/types/TriggerServerFailureError.d.cts +3 -2
- package/dist/types/TriggerServerFailureError.d.ts +3 -2
- package/dist/types/TriggerServerFailureError.js +1 -1
- package/dist/types/TriggerServerFailureError.js.map +1 -1
- package/dist/types/clientModelTypes.cjs +19 -0
- package/dist/types/clientModelTypes.cjs.map +1 -0
- package/dist/types/clientModelTypes.d.cts +67 -0
- package/dist/types/clientModelTypes.d.ts +67 -0
- package/dist/types/clientModelTypes.js +1 -0
- package/dist/types/clientModelTypes.js.map +1 -0
- package/dist/types/clientTypes.cjs.map +1 -1
- package/dist/types/clientTypes.d.cts +50 -24
- package/dist/types/clientTypes.d.ts +50 -24
- package/dist/types/index.cjs +4 -0
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +6 -5
- package/dist/types/index.d.ts +6 -5
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/serverExecuteTypes.cjs.map +1 -1
- package/dist/types/serverExecuteTypes.d.cts +9 -15
- package/dist/types/serverExecuteTypes.d.ts +9 -15
- package/dist/types/serverModelTypes.cjs +19 -0
- package/dist/types/serverModelTypes.cjs.map +1 -0
- package/dist/types/serverModelTypes.d.cts +42 -0
- package/dist/types/serverModelTypes.d.ts +42 -0
- package/dist/types/serverModelTypes.js +1 -0
- package/dist/types/serverModelTypes.js.map +1 -0
- package/dist/types/serverQueryTypes.cjs.map +1 -1
- package/dist/types/serverQueryTypes.d.cts +48 -7
- package/dist/types/serverQueryTypes.d.ts +48 -7
- package/package.json +4 -5
- package/src/TriggerClient.ts +90 -29
- package/src/dataMappers.ts +225 -71
- package/src/endpoints.ts +2 -2
- package/src/index.ts +2 -2
- package/src/types/TriggerServerFailureError.ts +2 -2
- package/src/types/clientModelTypes.ts +95 -0
- package/src/types/clientTypes.ts +70 -41
- package/src/types/index.ts +2 -0
- package/src/types/serverExecuteTypes.ts +9 -24
- package/src/types/serverModelTypes.ts +55 -0
- package/src/types/serverQueryTypes.ts +75 -9
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { EngineServerExecuteResult } from '@nadohq/engine-client';
|
|
2
|
+
import { BigDecimalish } from '@nadohq/shared';
|
|
3
|
+
|
|
4
|
+
type PriceTriggerRequirementType = 'oracle_price_above' | 'oracle_price_below' | 'last_price_above' | 'last_price_below' | 'mid_price_above' | 'mid_price_below';
|
|
5
|
+
interface PriceTriggerDependency {
|
|
6
|
+
/**
|
|
7
|
+
* Digest of the order that this trigger depends on.
|
|
8
|
+
*/
|
|
9
|
+
digest: string;
|
|
10
|
+
/**
|
|
11
|
+
* Whether to trigger on partial fills.
|
|
12
|
+
*/
|
|
13
|
+
onPartialFill: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface PriceTriggerCriteria {
|
|
16
|
+
type: PriceTriggerRequirementType;
|
|
17
|
+
triggerPrice: BigDecimalish;
|
|
18
|
+
dependency?: PriceTriggerDependency;
|
|
19
|
+
}
|
|
20
|
+
interface TimeTriggerCriteria {
|
|
21
|
+
/**
|
|
22
|
+
* For TWAP: Trigger interval in seconds
|
|
23
|
+
*/
|
|
24
|
+
interval: BigDecimalish;
|
|
25
|
+
/**
|
|
26
|
+
* For TWAP: By default, trigger service will split up orders as per total amount / interval
|
|
27
|
+
* If you want to specify the amounts for each interval, you can provide them here.
|
|
28
|
+
*/
|
|
29
|
+
amounts?: BigDecimalish[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* All possible trigger conditions that can be used to place a trigger order.
|
|
33
|
+
*/
|
|
34
|
+
type TriggerCriteria = {
|
|
35
|
+
type: 'price';
|
|
36
|
+
criteria: PriceTriggerCriteria;
|
|
37
|
+
} | {
|
|
38
|
+
type: 'time';
|
|
39
|
+
criteria: TimeTriggerCriteria;
|
|
40
|
+
};
|
|
41
|
+
type TriggerCriteriaType = TriggerCriteria['type'];
|
|
42
|
+
type TriggerOrderStatus = {
|
|
43
|
+
type: 'cancelled';
|
|
44
|
+
reason: string;
|
|
45
|
+
} | {
|
|
46
|
+
type: 'triggered';
|
|
47
|
+
result: EngineServerExecuteResult;
|
|
48
|
+
} | {
|
|
49
|
+
type: 'internal_error';
|
|
50
|
+
error: string;
|
|
51
|
+
} | {
|
|
52
|
+
type: 'triggering';
|
|
53
|
+
} | {
|
|
54
|
+
type: 'waiting_price';
|
|
55
|
+
} | {
|
|
56
|
+
type: 'waiting_dependency';
|
|
57
|
+
} | {
|
|
58
|
+
type: 'twap_executing';
|
|
59
|
+
currentExecution: number;
|
|
60
|
+
totalExecutions: number;
|
|
61
|
+
} | {
|
|
62
|
+
type: 'twap_completed';
|
|
63
|
+
executed: number;
|
|
64
|
+
total: number;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type { PriceTriggerCriteria, PriceTriggerDependency, PriceTriggerRequirementType, TimeTriggerCriteria, TriggerCriteria, TriggerCriteriaType, TriggerOrderStatus };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=clientModelTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/clientTypes.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"sources":["../../src/types/clientTypes.ts"],"sourcesContent":["import {\n EngineOrderParams,\n EngineServerExecuteResult,\n} from '@nadohq/engine-client';\nimport {\n BigDecimal,\n EIP712CancelOrdersParams,\n EIP712CancelProductOrdersParams,\n OrderAppendix,\n Subaccount,\n} from '@nadohq/shared';\nimport { TriggerCriteria, TriggerOrderStatus } from './clientModelTypes';\nimport {\n TriggerServerOrder,\n TriggerServerStatusTypeFilter,\n TriggerServerTriggerTypeFilter,\n} from './serverQueryTypes';\n\ntype WithOptionalNonce<T> = Omit<T, 'nonce'> & { nonce?: string };\n\ninterface SignatureParams {\n /**\n * Address derived from productId for placement (see getOrderVerifyingAddr)\n * endpoint address for cancellation & listing\n */\n verifyingAddr: string;\n chainId: number;\n}\n\n/**\n * Executes\n */\n\nexport interface TriggerPlaceOrderParams extends SignatureParams {\n id?: number;\n productId: number;\n order: EngineOrderParams;\n triggerCriteria: TriggerCriteria;\n // If not given, engine defaults to true (leverage/borrow enabled)\n spotLeverage?: boolean;\n // For isolated orders, this specifies whether margin can be borrowed (i.e. whether the cross account can have a negative USDT balance)\n borrowMargin?: boolean;\n digest?: string;\n nonce?: string;\n}\n\nexport interface TriggerPlaceOrdersParams {\n orders: TriggerPlaceOrderParams[];\n /**\n * If `true`, aborts the batch after the first failed order; if `false`, remaining orders continue to execute.\n * If not provided, the default value is `false`.\n */\n cancelOnFailure?: boolean;\n}\n\nexport type TriggerCancelOrdersParams = SignatureParams &\n WithOptionalNonce<EIP712CancelOrdersParams>;\n\nexport type TriggerCancelProductOrdersParams = SignatureParams &\n WithOptionalNonce<EIP712CancelProductOrdersParams>;\n\n/**\n * Queries\n */\n\nexport interface TriggerListOrdersParams extends Subaccount, SignatureParams {\n // In millis, defaults to 90s in the future\n recvTime?: BigDecimal;\n // If not given, defaults to all products\n productIds?: number[];\n // In seconds\n maxUpdateTimeInclusive?: number;\n // When provided, the associated trigger orders are returned regardless of other filters\n digests?: string[];\n limit?: number;\n // Filter by status types\n statusTypes?: TriggerServerStatusTypeFilter[];\n // Filter by trigger types\n triggerTypes?: TriggerServerTriggerTypeFilter[];\n // Filter by reduce-only orders\n reduceOnly?: boolean;\n}\n\nexport interface TriggerOrder {\n productId: number;\n triggerCriteria: TriggerCriteria;\n price: BigDecimal;\n amount: BigDecimal;\n expiration: number;\n nonce: string;\n digest: string;\n appendix: OrderAppendix;\n}\n\nexport interface TriggerOrderInfo {\n order: TriggerOrder;\n serverOrder: TriggerServerOrder;\n status: TriggerOrderStatus;\n updatedAt: number;\n placementTime: number;\n}\n\nexport interface TriggerListOrdersResponse {\n orders: TriggerOrderInfo[];\n}\n\nexport interface TriggerListTwapExecutionsParams {\n digest: string;\n}\n\nexport type TwapExecutionStatus =\n | {\n type: 'pending';\n }\n | {\n type: 'executed';\n executedTime: number;\n executeResponse: EngineServerExecuteResult;\n }\n | {\n type: 'failed';\n error: string;\n }\n | {\n type: 'cancelled';\n reason: string;\n };\n\nexport interface TwapExecutionInfo {\n executionId: number;\n scheduledTime: number;\n status: TwapExecutionStatus;\n updatedAt: number;\n}\n\nexport interface TriggerListTwapExecutionsResponse {\n executions: TwapExecutionInfo[];\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -1,30 +1,18 @@
|
|
|
1
|
-
import { EIP712CancelOrdersParams, EIP712CancelProductOrdersParams, Subaccount } from '@nadohq/contracts';
|
|
2
1
|
import { EngineOrderParams, EngineServerExecuteResult } from '@nadohq/engine-client';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { EIP712CancelOrdersParams, EIP712CancelProductOrdersParams, Subaccount, BigDecimal, OrderAppendix } from '@nadohq/shared';
|
|
3
|
+
import { TriggerCriteria, TriggerOrderStatus } from './clientModelTypes.cjs';
|
|
4
|
+
import { TriggerServerStatusTypeFilter, TriggerServerTriggerTypeFilter, TriggerServerOrder } from './serverQueryTypes.cjs';
|
|
5
5
|
import './serverExecuteTypes.cjs';
|
|
6
|
+
import './serverModelTypes.cjs';
|
|
6
7
|
|
|
7
8
|
type WithOptionalNonce<T> = Omit<T, 'nonce'> & {
|
|
8
9
|
nonce?: string;
|
|
9
10
|
};
|
|
10
|
-
type TriggerCriteriaType = 'oracle_price_above' | 'oracle_price_below' | 'last_price_above' | 'last_price_below' | 'mid_price_above' | 'mid_price_below';
|
|
11
|
-
type TriggerCriteria = {
|
|
12
|
-
type: TriggerCriteriaType;
|
|
13
|
-
triggerPrice: BigDecimalish;
|
|
14
|
-
};
|
|
15
|
-
type TriggerOrderStatus = {
|
|
16
|
-
type: 'pending';
|
|
17
|
-
} | {
|
|
18
|
-
type: 'cancelled';
|
|
19
|
-
reason: string;
|
|
20
|
-
} | {
|
|
21
|
-
type: 'triggered';
|
|
22
|
-
result: EngineServerExecuteResult;
|
|
23
|
-
} | {
|
|
24
|
-
type: 'internal_error';
|
|
25
|
-
error: string;
|
|
26
|
-
};
|
|
27
11
|
interface SignatureParams {
|
|
12
|
+
/**
|
|
13
|
+
* Address derived from productId for placement (see getOrderVerifyingAddr)
|
|
14
|
+
* endpoint address for cancellation & listing
|
|
15
|
+
*/
|
|
28
16
|
verifyingAddr: string;
|
|
29
17
|
chainId: number;
|
|
30
18
|
}
|
|
@@ -37,9 +25,18 @@ interface TriggerPlaceOrderParams extends SignatureParams {
|
|
|
37
25
|
order: EngineOrderParams;
|
|
38
26
|
triggerCriteria: TriggerCriteria;
|
|
39
27
|
spotLeverage?: boolean;
|
|
28
|
+
borrowMargin?: boolean;
|
|
40
29
|
digest?: string;
|
|
41
30
|
nonce?: string;
|
|
42
31
|
}
|
|
32
|
+
interface TriggerPlaceOrdersParams {
|
|
33
|
+
orders: TriggerPlaceOrderParams[];
|
|
34
|
+
/**
|
|
35
|
+
* If `true`, aborts the batch after the first failed order; if `false`, remaining orders continue to execute.
|
|
36
|
+
* If not provided, the default value is `false`.
|
|
37
|
+
*/
|
|
38
|
+
cancelOnFailure?: boolean;
|
|
39
|
+
}
|
|
43
40
|
type TriggerCancelOrdersParams = SignatureParams & WithOptionalNonce<EIP712CancelOrdersParams>;
|
|
44
41
|
type TriggerCancelProductOrdersParams = SignatureParams & WithOptionalNonce<EIP712CancelProductOrdersParams>;
|
|
45
42
|
/**
|
|
@@ -47,29 +44,58 @@ type TriggerCancelProductOrdersParams = SignatureParams & WithOptionalNonce<EIP7
|
|
|
47
44
|
*/
|
|
48
45
|
interface TriggerListOrdersParams extends Subaccount, SignatureParams {
|
|
49
46
|
recvTime?: BigDecimal;
|
|
50
|
-
|
|
51
|
-
pending: boolean;
|
|
47
|
+
productIds?: number[];
|
|
52
48
|
maxUpdateTimeInclusive?: number;
|
|
53
49
|
digests?: string[];
|
|
54
50
|
limit?: number;
|
|
51
|
+
statusTypes?: TriggerServerStatusTypeFilter[];
|
|
52
|
+
triggerTypes?: TriggerServerTriggerTypeFilter[];
|
|
53
|
+
reduceOnly?: boolean;
|
|
55
54
|
}
|
|
56
55
|
interface TriggerOrder {
|
|
57
56
|
productId: number;
|
|
58
57
|
triggerCriteria: TriggerCriteria;
|
|
59
58
|
price: BigDecimal;
|
|
60
59
|
amount: BigDecimal;
|
|
61
|
-
expiration:
|
|
60
|
+
expiration: number;
|
|
62
61
|
nonce: string;
|
|
63
62
|
digest: string;
|
|
63
|
+
appendix: OrderAppendix;
|
|
64
64
|
}
|
|
65
65
|
interface TriggerOrderInfo {
|
|
66
66
|
order: TriggerOrder;
|
|
67
67
|
serverOrder: TriggerServerOrder;
|
|
68
68
|
status: TriggerOrderStatus;
|
|
69
69
|
updatedAt: number;
|
|
70
|
+
placementTime: number;
|
|
70
71
|
}
|
|
71
72
|
interface TriggerListOrdersResponse {
|
|
72
73
|
orders: TriggerOrderInfo[];
|
|
73
74
|
}
|
|
75
|
+
interface TriggerListTwapExecutionsParams {
|
|
76
|
+
digest: string;
|
|
77
|
+
}
|
|
78
|
+
type TwapExecutionStatus = {
|
|
79
|
+
type: 'pending';
|
|
80
|
+
} | {
|
|
81
|
+
type: 'executed';
|
|
82
|
+
executedTime: number;
|
|
83
|
+
executeResponse: EngineServerExecuteResult;
|
|
84
|
+
} | {
|
|
85
|
+
type: 'failed';
|
|
86
|
+
error: string;
|
|
87
|
+
} | {
|
|
88
|
+
type: 'cancelled';
|
|
89
|
+
reason: string;
|
|
90
|
+
};
|
|
91
|
+
interface TwapExecutionInfo {
|
|
92
|
+
executionId: number;
|
|
93
|
+
scheduledTime: number;
|
|
94
|
+
status: TwapExecutionStatus;
|
|
95
|
+
updatedAt: number;
|
|
96
|
+
}
|
|
97
|
+
interface TriggerListTwapExecutionsResponse {
|
|
98
|
+
executions: TwapExecutionInfo[];
|
|
99
|
+
}
|
|
74
100
|
|
|
75
|
-
export type { TriggerCancelOrdersParams, TriggerCancelProductOrdersParams,
|
|
101
|
+
export type { TriggerCancelOrdersParams, TriggerCancelProductOrdersParams, TriggerListOrdersParams, TriggerListOrdersResponse, TriggerListTwapExecutionsParams, TriggerListTwapExecutionsResponse, TriggerOrder, TriggerOrderInfo, TriggerPlaceOrderParams, TriggerPlaceOrdersParams, TwapExecutionInfo, TwapExecutionStatus };
|
|
@@ -1,30 +1,18 @@
|
|
|
1
|
-
import { EIP712CancelOrdersParams, EIP712CancelProductOrdersParams, Subaccount } from '@nadohq/contracts';
|
|
2
1
|
import { EngineOrderParams, EngineServerExecuteResult } from '@nadohq/engine-client';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { EIP712CancelOrdersParams, EIP712CancelProductOrdersParams, Subaccount, BigDecimal, OrderAppendix } from '@nadohq/shared';
|
|
3
|
+
import { TriggerCriteria, TriggerOrderStatus } from './clientModelTypes.js';
|
|
4
|
+
import { TriggerServerStatusTypeFilter, TriggerServerTriggerTypeFilter, TriggerServerOrder } from './serverQueryTypes.js';
|
|
5
5
|
import './serverExecuteTypes.js';
|
|
6
|
+
import './serverModelTypes.js';
|
|
6
7
|
|
|
7
8
|
type WithOptionalNonce<T> = Omit<T, 'nonce'> & {
|
|
8
9
|
nonce?: string;
|
|
9
10
|
};
|
|
10
|
-
type TriggerCriteriaType = 'oracle_price_above' | 'oracle_price_below' | 'last_price_above' | 'last_price_below' | 'mid_price_above' | 'mid_price_below';
|
|
11
|
-
type TriggerCriteria = {
|
|
12
|
-
type: TriggerCriteriaType;
|
|
13
|
-
triggerPrice: BigDecimalish;
|
|
14
|
-
};
|
|
15
|
-
type TriggerOrderStatus = {
|
|
16
|
-
type: 'pending';
|
|
17
|
-
} | {
|
|
18
|
-
type: 'cancelled';
|
|
19
|
-
reason: string;
|
|
20
|
-
} | {
|
|
21
|
-
type: 'triggered';
|
|
22
|
-
result: EngineServerExecuteResult;
|
|
23
|
-
} | {
|
|
24
|
-
type: 'internal_error';
|
|
25
|
-
error: string;
|
|
26
|
-
};
|
|
27
11
|
interface SignatureParams {
|
|
12
|
+
/**
|
|
13
|
+
* Address derived from productId for placement (see getOrderVerifyingAddr)
|
|
14
|
+
* endpoint address for cancellation & listing
|
|
15
|
+
*/
|
|
28
16
|
verifyingAddr: string;
|
|
29
17
|
chainId: number;
|
|
30
18
|
}
|
|
@@ -37,9 +25,18 @@ interface TriggerPlaceOrderParams extends SignatureParams {
|
|
|
37
25
|
order: EngineOrderParams;
|
|
38
26
|
triggerCriteria: TriggerCriteria;
|
|
39
27
|
spotLeverage?: boolean;
|
|
28
|
+
borrowMargin?: boolean;
|
|
40
29
|
digest?: string;
|
|
41
30
|
nonce?: string;
|
|
42
31
|
}
|
|
32
|
+
interface TriggerPlaceOrdersParams {
|
|
33
|
+
orders: TriggerPlaceOrderParams[];
|
|
34
|
+
/**
|
|
35
|
+
* If `true`, aborts the batch after the first failed order; if `false`, remaining orders continue to execute.
|
|
36
|
+
* If not provided, the default value is `false`.
|
|
37
|
+
*/
|
|
38
|
+
cancelOnFailure?: boolean;
|
|
39
|
+
}
|
|
43
40
|
type TriggerCancelOrdersParams = SignatureParams & WithOptionalNonce<EIP712CancelOrdersParams>;
|
|
44
41
|
type TriggerCancelProductOrdersParams = SignatureParams & WithOptionalNonce<EIP712CancelProductOrdersParams>;
|
|
45
42
|
/**
|
|
@@ -47,29 +44,58 @@ type TriggerCancelProductOrdersParams = SignatureParams & WithOptionalNonce<EIP7
|
|
|
47
44
|
*/
|
|
48
45
|
interface TriggerListOrdersParams extends Subaccount, SignatureParams {
|
|
49
46
|
recvTime?: BigDecimal;
|
|
50
|
-
|
|
51
|
-
pending: boolean;
|
|
47
|
+
productIds?: number[];
|
|
52
48
|
maxUpdateTimeInclusive?: number;
|
|
53
49
|
digests?: string[];
|
|
54
50
|
limit?: number;
|
|
51
|
+
statusTypes?: TriggerServerStatusTypeFilter[];
|
|
52
|
+
triggerTypes?: TriggerServerTriggerTypeFilter[];
|
|
53
|
+
reduceOnly?: boolean;
|
|
55
54
|
}
|
|
56
55
|
interface TriggerOrder {
|
|
57
56
|
productId: number;
|
|
58
57
|
triggerCriteria: TriggerCriteria;
|
|
59
58
|
price: BigDecimal;
|
|
60
59
|
amount: BigDecimal;
|
|
61
|
-
expiration:
|
|
60
|
+
expiration: number;
|
|
62
61
|
nonce: string;
|
|
63
62
|
digest: string;
|
|
63
|
+
appendix: OrderAppendix;
|
|
64
64
|
}
|
|
65
65
|
interface TriggerOrderInfo {
|
|
66
66
|
order: TriggerOrder;
|
|
67
67
|
serverOrder: TriggerServerOrder;
|
|
68
68
|
status: TriggerOrderStatus;
|
|
69
69
|
updatedAt: number;
|
|
70
|
+
placementTime: number;
|
|
70
71
|
}
|
|
71
72
|
interface TriggerListOrdersResponse {
|
|
72
73
|
orders: TriggerOrderInfo[];
|
|
73
74
|
}
|
|
75
|
+
interface TriggerListTwapExecutionsParams {
|
|
76
|
+
digest: string;
|
|
77
|
+
}
|
|
78
|
+
type TwapExecutionStatus = {
|
|
79
|
+
type: 'pending';
|
|
80
|
+
} | {
|
|
81
|
+
type: 'executed';
|
|
82
|
+
executedTime: number;
|
|
83
|
+
executeResponse: EngineServerExecuteResult;
|
|
84
|
+
} | {
|
|
85
|
+
type: 'failed';
|
|
86
|
+
error: string;
|
|
87
|
+
} | {
|
|
88
|
+
type: 'cancelled';
|
|
89
|
+
reason: string;
|
|
90
|
+
};
|
|
91
|
+
interface TwapExecutionInfo {
|
|
92
|
+
executionId: number;
|
|
93
|
+
scheduledTime: number;
|
|
94
|
+
status: TwapExecutionStatus;
|
|
95
|
+
updatedAt: number;
|
|
96
|
+
}
|
|
97
|
+
interface TriggerListTwapExecutionsResponse {
|
|
98
|
+
executions: TwapExecutionInfo[];
|
|
99
|
+
}
|
|
74
100
|
|
|
75
|
-
export type { TriggerCancelOrdersParams, TriggerCancelProductOrdersParams,
|
|
101
|
+
export type { TriggerCancelOrdersParams, TriggerCancelProductOrdersParams, TriggerListOrdersParams, TriggerListOrdersResponse, TriggerListTwapExecutionsParams, TriggerListTwapExecutionsResponse, TriggerOrder, TriggerOrderInfo, TriggerPlaceOrderParams, TriggerPlaceOrdersParams, TwapExecutionInfo, TwapExecutionStatus };
|
package/dist/types/index.cjs
CHANGED
|
@@ -17,14 +17,18 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
17
17
|
// src/types/index.ts
|
|
18
18
|
var types_exports = {};
|
|
19
19
|
module.exports = __toCommonJS(types_exports);
|
|
20
|
+
__reExport(types_exports, require("./clientModelTypes.cjs"), module.exports);
|
|
20
21
|
__reExport(types_exports, require("./clientTypes.cjs"), module.exports);
|
|
21
22
|
__reExport(types_exports, require("./serverExecuteTypes.cjs"), module.exports);
|
|
23
|
+
__reExport(types_exports, require("./serverModelTypes.cjs"), module.exports);
|
|
22
24
|
__reExport(types_exports, require("./serverQueryTypes.cjs"), module.exports);
|
|
23
25
|
__reExport(types_exports, require("./TriggerServerFailureError.cjs"), module.exports);
|
|
24
26
|
// Annotate the CommonJS export names for ESM import in node:
|
|
25
27
|
0 && (module.exports = {
|
|
28
|
+
...require("./clientModelTypes.cjs"),
|
|
26
29
|
...require("./clientTypes.cjs"),
|
|
27
30
|
...require("./serverExecuteTypes.cjs"),
|
|
31
|
+
...require("./serverModelTypes.cjs"),
|
|
28
32
|
...require("./serverQueryTypes.cjs"),
|
|
29
33
|
...require("./TriggerServerFailureError.cjs")
|
|
30
34
|
});
|
package/dist/types/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export * from './clientTypes';\nexport * from './serverExecuteTypes';\nexport * from './serverQueryTypes';\nexport * from './TriggerServerFailureError';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,
|
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export * from './clientModelTypes';\nexport * from './clientTypes';\nexport * from './serverExecuteTypes';\nexport * from './serverModelTypes';\nexport * from './serverQueryTypes';\nexport * from './TriggerServerFailureError';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,mCAAd;AACA,0BAAc,8BADd;AAEA,0BAAc,qCAFd;AAGA,0BAAc,mCAHd;AAIA,0BAAc,mCAJd;AAKA,0BAAc,4CALd;","names":[]}
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
export { PriceTriggerCriteria, PriceTriggerDependency, PriceTriggerRequirementType, TimeTriggerCriteria, TriggerCriteria, TriggerCriteriaType, TriggerOrderStatus } from './clientModelTypes.cjs';
|
|
2
|
+
export { TriggerCancelOrdersParams, TriggerCancelProductOrdersParams, TriggerListOrdersParams, TriggerListOrdersResponse, TriggerListTwapExecutionsParams, TriggerListTwapExecutionsResponse, TriggerOrder, TriggerOrderInfo, TriggerPlaceOrderParams, TriggerPlaceOrdersParams, TwapExecutionInfo, TwapExecutionStatus } from './clientTypes.cjs';
|
|
3
|
+
export { TriggerServerCancelOrdersParams, TriggerServerCancelProductOrdersParams, TriggerServerExecuteRequestByType, TriggerServerExecuteRequestType, TriggerServerExecuteResult, TriggerServerExecuteSuccessResult, TriggerServerPlaceOrderParams, TriggerServerPlaceOrdersParams } from './serverExecuteTypes.cjs';
|
|
4
|
+
export { TriggerServerDependency, TriggerServerPriceRequirement, TriggerServerPriceTriggerCriteria, TriggerServerTimeTriggerCriteria, TriggerServerTriggerCriteria } from './serverModelTypes.cjs';
|
|
5
|
+
export { TriggerServerCancelReason, TriggerServerListTriggerOrdersParams, TriggerServerListTriggerOrdersResponse, TriggerServerListTwapExecutionsParams, TriggerServerOrder, TriggerServerOrderInfo, TriggerServerOrderStatus, TriggerServerQueryFailureResponse, TriggerServerQueryRequestByType, TriggerServerQueryRequestType, TriggerServerQueryResponse, TriggerServerQueryResponseByType, TriggerServerQuerySuccessResponse, TriggerServerStatusTypeFilter, TriggerServerTriggerTypeFilter, TriggerServerTwapExecutionInfo, TriggerServerTwapExecutionStatus, TriggerServerTwapExecutionsResponse } from './serverQueryTypes.cjs';
|
|
4
6
|
export { TriggerServerFailureError } from './TriggerServerFailureError.cjs';
|
|
5
|
-
import '@nadohq/contracts';
|
|
6
7
|
import '@nadohq/engine-client';
|
|
7
|
-
import '@nadohq/
|
|
8
|
+
import '@nadohq/shared';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
export { PriceTriggerCriteria, PriceTriggerDependency, PriceTriggerRequirementType, TimeTriggerCriteria, TriggerCriteria, TriggerCriteriaType, TriggerOrderStatus } from './clientModelTypes.js';
|
|
2
|
+
export { TriggerCancelOrdersParams, TriggerCancelProductOrdersParams, TriggerListOrdersParams, TriggerListOrdersResponse, TriggerListTwapExecutionsParams, TriggerListTwapExecutionsResponse, TriggerOrder, TriggerOrderInfo, TriggerPlaceOrderParams, TriggerPlaceOrdersParams, TwapExecutionInfo, TwapExecutionStatus } from './clientTypes.js';
|
|
3
|
+
export { TriggerServerCancelOrdersParams, TriggerServerCancelProductOrdersParams, TriggerServerExecuteRequestByType, TriggerServerExecuteRequestType, TriggerServerExecuteResult, TriggerServerExecuteSuccessResult, TriggerServerPlaceOrderParams, TriggerServerPlaceOrdersParams } from './serverExecuteTypes.js';
|
|
4
|
+
export { TriggerServerDependency, TriggerServerPriceRequirement, TriggerServerPriceTriggerCriteria, TriggerServerTimeTriggerCriteria, TriggerServerTriggerCriteria } from './serverModelTypes.js';
|
|
5
|
+
export { TriggerServerCancelReason, TriggerServerListTriggerOrdersParams, TriggerServerListTriggerOrdersResponse, TriggerServerListTwapExecutionsParams, TriggerServerOrder, TriggerServerOrderInfo, TriggerServerOrderStatus, TriggerServerQueryFailureResponse, TriggerServerQueryRequestByType, TriggerServerQueryRequestType, TriggerServerQueryResponse, TriggerServerQueryResponseByType, TriggerServerQuerySuccessResponse, TriggerServerStatusTypeFilter, TriggerServerTriggerTypeFilter, TriggerServerTwapExecutionInfo, TriggerServerTwapExecutionStatus, TriggerServerTwapExecutionsResponse } from './serverQueryTypes.js';
|
|
4
6
|
export { TriggerServerFailureError } from './TriggerServerFailureError.js';
|
|
5
|
-
import '@nadohq/contracts';
|
|
6
7
|
import '@nadohq/engine-client';
|
|
7
|
-
import '@nadohq/
|
|
8
|
+
import '@nadohq/shared';
|
package/dist/types/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// src/types/index.ts
|
|
2
|
+
export * from "./clientModelTypes.js";
|
|
2
3
|
export * from "./clientTypes.js";
|
|
3
4
|
export * from "./serverExecuteTypes.js";
|
|
5
|
+
export * from "./serverModelTypes.js";
|
|
4
6
|
export * from "./serverQueryTypes.js";
|
|
5
7
|
export * from "./TriggerServerFailureError.js";
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export * from './clientTypes';\nexport * from './serverExecuteTypes';\nexport * from './serverQueryTypes';\nexport * from './TriggerServerFailureError';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export * from './clientModelTypes';\nexport * from './clientTypes';\nexport * from './serverExecuteTypes';\nexport * from './serverModelTypes';\nexport * from './serverQueryTypes';\nexport * from './TriggerServerFailureError';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/serverExecuteTypes.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/types/serverExecuteTypes.ts"],"sourcesContent":["import {\n EngineServerExecuteFailureResult,\n EngineServerExecuteRequestByType,\n EngineServerExecuteSuccessResult,\n} from '@nadohq/engine-client';\nimport { EIP712OrderValues } from '@nadohq/shared';\nimport { TriggerServerTriggerCriteria } from './serverModelTypes';\n\nexport interface TriggerServerPlaceOrderParams {\n id: number | null;\n product_id: number;\n order: EIP712OrderValues;\n trigger: TriggerServerTriggerCriteria;\n signature: string;\n digest: string | null;\n // Trigger service defaults this to true\n spot_leverage: boolean | null;\n borrow_margin: boolean | null;\n}\n\nexport type TriggerServerCancelOrdersParams =\n EngineServerExecuteRequestByType['cancel_orders'];\n\nexport type TriggerServerCancelProductOrdersParams =\n EngineServerExecuteRequestByType['cancel_product_orders'];\n\nexport interface TriggerServerPlaceOrdersParams {\n orders: TriggerServerPlaceOrderParams[];\n cancel_on_failure: boolean | null;\n}\n\nexport interface TriggerServerExecuteRequestByType {\n place_order: TriggerServerPlaceOrderParams;\n place_orders: TriggerServerPlaceOrdersParams;\n cancel_orders: TriggerServerCancelOrdersParams;\n cancel_product_orders: TriggerServerCancelProductOrdersParams;\n}\n\nexport type TriggerServerExecuteRequestType =\n keyof TriggerServerExecuteRequestByType;\n\nexport type TriggerServerExecuteSuccessResult<\n T extends TriggerServerExecuteRequestType = TriggerServerExecuteRequestType,\n> = EngineServerExecuteSuccessResult<T>;\n\nexport type TriggerServerExecuteResult<\n T extends TriggerServerExecuteRequestType = TriggerServerExecuteRequestType,\n> = TriggerServerExecuteSuccessResult<T> | EngineServerExecuteFailureResult;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
import { EIP712OrderValues } from '@nadohq/contracts';
|
|
2
1
|
import { EngineServerExecuteRequestByType, EngineServerExecuteSuccessResult, EngineServerExecuteFailureResult } from '@nadohq/engine-client';
|
|
2
|
+
import { EIP712OrderValues } from '@nadohq/shared';
|
|
3
|
+
import { TriggerServerTriggerCriteria } from './serverModelTypes.cjs';
|
|
3
4
|
|
|
4
|
-
type TriggerServerTriggerCriteria = {
|
|
5
|
-
price_above: string;
|
|
6
|
-
} | {
|
|
7
|
-
price_below: string;
|
|
8
|
-
} | {
|
|
9
|
-
last_price_above: string;
|
|
10
|
-
} | {
|
|
11
|
-
last_price_below: string;
|
|
12
|
-
} | {
|
|
13
|
-
mid_price_above: string;
|
|
14
|
-
} | {
|
|
15
|
-
mid_price_below: string;
|
|
16
|
-
};
|
|
17
5
|
interface TriggerServerPlaceOrderParams {
|
|
18
6
|
id: number | null;
|
|
19
7
|
product_id: number;
|
|
@@ -22,11 +10,17 @@ interface TriggerServerPlaceOrderParams {
|
|
|
22
10
|
signature: string;
|
|
23
11
|
digest: string | null;
|
|
24
12
|
spot_leverage: boolean | null;
|
|
13
|
+
borrow_margin: boolean | null;
|
|
25
14
|
}
|
|
26
15
|
type TriggerServerCancelOrdersParams = EngineServerExecuteRequestByType['cancel_orders'];
|
|
27
16
|
type TriggerServerCancelProductOrdersParams = EngineServerExecuteRequestByType['cancel_product_orders'];
|
|
17
|
+
interface TriggerServerPlaceOrdersParams {
|
|
18
|
+
orders: TriggerServerPlaceOrderParams[];
|
|
19
|
+
cancel_on_failure: boolean | null;
|
|
20
|
+
}
|
|
28
21
|
interface TriggerServerExecuteRequestByType {
|
|
29
22
|
place_order: TriggerServerPlaceOrderParams;
|
|
23
|
+
place_orders: TriggerServerPlaceOrdersParams;
|
|
30
24
|
cancel_orders: TriggerServerCancelOrdersParams;
|
|
31
25
|
cancel_product_orders: TriggerServerCancelProductOrdersParams;
|
|
32
26
|
}
|
|
@@ -34,4 +28,4 @@ type TriggerServerExecuteRequestType = keyof TriggerServerExecuteRequestByType;
|
|
|
34
28
|
type TriggerServerExecuteSuccessResult<T extends TriggerServerExecuteRequestType = TriggerServerExecuteRequestType> = EngineServerExecuteSuccessResult<T>;
|
|
35
29
|
type TriggerServerExecuteResult<T extends TriggerServerExecuteRequestType = TriggerServerExecuteRequestType> = TriggerServerExecuteSuccessResult<T> | EngineServerExecuteFailureResult;
|
|
36
30
|
|
|
37
|
-
export type { TriggerServerCancelOrdersParams, TriggerServerCancelProductOrdersParams, TriggerServerExecuteRequestByType, TriggerServerExecuteRequestType, TriggerServerExecuteResult, TriggerServerExecuteSuccessResult, TriggerServerPlaceOrderParams,
|
|
31
|
+
export type { TriggerServerCancelOrdersParams, TriggerServerCancelProductOrdersParams, TriggerServerExecuteRequestByType, TriggerServerExecuteRequestType, TriggerServerExecuteResult, TriggerServerExecuteSuccessResult, TriggerServerPlaceOrderParams, TriggerServerPlaceOrdersParams };
|
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
import { EIP712OrderValues } from '@nadohq/contracts';
|
|
2
1
|
import { EngineServerExecuteRequestByType, EngineServerExecuteSuccessResult, EngineServerExecuteFailureResult } from '@nadohq/engine-client';
|
|
2
|
+
import { EIP712OrderValues } from '@nadohq/shared';
|
|
3
|
+
import { TriggerServerTriggerCriteria } from './serverModelTypes.js';
|
|
3
4
|
|
|
4
|
-
type TriggerServerTriggerCriteria = {
|
|
5
|
-
price_above: string;
|
|
6
|
-
} | {
|
|
7
|
-
price_below: string;
|
|
8
|
-
} | {
|
|
9
|
-
last_price_above: string;
|
|
10
|
-
} | {
|
|
11
|
-
last_price_below: string;
|
|
12
|
-
} | {
|
|
13
|
-
mid_price_above: string;
|
|
14
|
-
} | {
|
|
15
|
-
mid_price_below: string;
|
|
16
|
-
};
|
|
17
5
|
interface TriggerServerPlaceOrderParams {
|
|
18
6
|
id: number | null;
|
|
19
7
|
product_id: number;
|
|
@@ -22,11 +10,17 @@ interface TriggerServerPlaceOrderParams {
|
|
|
22
10
|
signature: string;
|
|
23
11
|
digest: string | null;
|
|
24
12
|
spot_leverage: boolean | null;
|
|
13
|
+
borrow_margin: boolean | null;
|
|
25
14
|
}
|
|
26
15
|
type TriggerServerCancelOrdersParams = EngineServerExecuteRequestByType['cancel_orders'];
|
|
27
16
|
type TriggerServerCancelProductOrdersParams = EngineServerExecuteRequestByType['cancel_product_orders'];
|
|
17
|
+
interface TriggerServerPlaceOrdersParams {
|
|
18
|
+
orders: TriggerServerPlaceOrderParams[];
|
|
19
|
+
cancel_on_failure: boolean | null;
|
|
20
|
+
}
|
|
28
21
|
interface TriggerServerExecuteRequestByType {
|
|
29
22
|
place_order: TriggerServerPlaceOrderParams;
|
|
23
|
+
place_orders: TriggerServerPlaceOrdersParams;
|
|
30
24
|
cancel_orders: TriggerServerCancelOrdersParams;
|
|
31
25
|
cancel_product_orders: TriggerServerCancelProductOrdersParams;
|
|
32
26
|
}
|
|
@@ -34,4 +28,4 @@ type TriggerServerExecuteRequestType = keyof TriggerServerExecuteRequestByType;
|
|
|
34
28
|
type TriggerServerExecuteSuccessResult<T extends TriggerServerExecuteRequestType = TriggerServerExecuteRequestType> = EngineServerExecuteSuccessResult<T>;
|
|
35
29
|
type TriggerServerExecuteResult<T extends TriggerServerExecuteRequestType = TriggerServerExecuteRequestType> = TriggerServerExecuteSuccessResult<T> | EngineServerExecuteFailureResult;
|
|
36
30
|
|
|
37
|
-
export type { TriggerServerCancelOrdersParams, TriggerServerCancelProductOrdersParams, TriggerServerExecuteRequestByType, TriggerServerExecuteRequestType, TriggerServerExecuteResult, TriggerServerExecuteSuccessResult, TriggerServerPlaceOrderParams,
|
|
31
|
+
export type { TriggerServerCancelOrdersParams, TriggerServerCancelProductOrdersParams, TriggerServerExecuteRequestByType, TriggerServerExecuteRequestType, TriggerServerExecuteResult, TriggerServerExecuteSuccessResult, TriggerServerPlaceOrderParams, TriggerServerPlaceOrdersParams };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/types/serverModelTypes.ts
|
|
17
|
+
var serverModelTypes_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(serverModelTypes_exports);
|
|
19
|
+
//# sourceMappingURL=serverModelTypes.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/serverModelTypes.ts"],"sourcesContent":["export interface TriggerServerDependency {\n digest: string;\n /**\n * Whether to trigger on partial fills.\n */\n on_partial_fill: boolean;\n}\n\nexport type TriggerServerPriceRequirement =\n // These trigger on fast oracle price\n | {\n oracle_price_above: string;\n }\n | {\n oracle_price_below: string;\n }\n // These trigger on last trade price\n | {\n last_price_above: string;\n }\n | {\n last_price_below: string;\n }\n // These trigger on mid-book price\n | {\n mid_price_above: string;\n }\n | {\n mid_price_below: string;\n };\n\nexport interface TriggerServerPriceTriggerCriteria {\n price_requirement: TriggerServerPriceRequirement;\n dependency?: TriggerServerDependency;\n}\n\nexport interface TriggerServerTimeTriggerCriteria {\n /**\n * Trigger interval in seconds\n */\n interval: number;\n /**\n * By default, trigger service will split up orders as per total amount / interval\n * If you want to specify the amounts for each interval, you can provide them here.\n */\n amounts?: string[];\n}\n\nexport type TriggerServerTriggerCriteria =\n | {\n price_trigger: TriggerServerPriceTriggerCriteria;\n }\n | {\n time_trigger: TriggerServerTimeTriggerCriteria;\n };\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
interface TriggerServerDependency {
|
|
2
|
+
digest: string;
|
|
3
|
+
/**
|
|
4
|
+
* Whether to trigger on partial fills.
|
|
5
|
+
*/
|
|
6
|
+
on_partial_fill: boolean;
|
|
7
|
+
}
|
|
8
|
+
type TriggerServerPriceRequirement = {
|
|
9
|
+
oracle_price_above: string;
|
|
10
|
+
} | {
|
|
11
|
+
oracle_price_below: string;
|
|
12
|
+
} | {
|
|
13
|
+
last_price_above: string;
|
|
14
|
+
} | {
|
|
15
|
+
last_price_below: string;
|
|
16
|
+
} | {
|
|
17
|
+
mid_price_above: string;
|
|
18
|
+
} | {
|
|
19
|
+
mid_price_below: string;
|
|
20
|
+
};
|
|
21
|
+
interface TriggerServerPriceTriggerCriteria {
|
|
22
|
+
price_requirement: TriggerServerPriceRequirement;
|
|
23
|
+
dependency?: TriggerServerDependency;
|
|
24
|
+
}
|
|
25
|
+
interface TriggerServerTimeTriggerCriteria {
|
|
26
|
+
/**
|
|
27
|
+
* Trigger interval in seconds
|
|
28
|
+
*/
|
|
29
|
+
interval: number;
|
|
30
|
+
/**
|
|
31
|
+
* By default, trigger service will split up orders as per total amount / interval
|
|
32
|
+
* If you want to specify the amounts for each interval, you can provide them here.
|
|
33
|
+
*/
|
|
34
|
+
amounts?: string[];
|
|
35
|
+
}
|
|
36
|
+
type TriggerServerTriggerCriteria = {
|
|
37
|
+
price_trigger: TriggerServerPriceTriggerCriteria;
|
|
38
|
+
} | {
|
|
39
|
+
time_trigger: TriggerServerTimeTriggerCriteria;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type { TriggerServerDependency, TriggerServerPriceRequirement, TriggerServerPriceTriggerCriteria, TriggerServerTimeTriggerCriteria, TriggerServerTriggerCriteria };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
interface TriggerServerDependency {
|
|
2
|
+
digest: string;
|
|
3
|
+
/**
|
|
4
|
+
* Whether to trigger on partial fills.
|
|
5
|
+
*/
|
|
6
|
+
on_partial_fill: boolean;
|
|
7
|
+
}
|
|
8
|
+
type TriggerServerPriceRequirement = {
|
|
9
|
+
oracle_price_above: string;
|
|
10
|
+
} | {
|
|
11
|
+
oracle_price_below: string;
|
|
12
|
+
} | {
|
|
13
|
+
last_price_above: string;
|
|
14
|
+
} | {
|
|
15
|
+
last_price_below: string;
|
|
16
|
+
} | {
|
|
17
|
+
mid_price_above: string;
|
|
18
|
+
} | {
|
|
19
|
+
mid_price_below: string;
|
|
20
|
+
};
|
|
21
|
+
interface TriggerServerPriceTriggerCriteria {
|
|
22
|
+
price_requirement: TriggerServerPriceRequirement;
|
|
23
|
+
dependency?: TriggerServerDependency;
|
|
24
|
+
}
|
|
25
|
+
interface TriggerServerTimeTriggerCriteria {
|
|
26
|
+
/**
|
|
27
|
+
* Trigger interval in seconds
|
|
28
|
+
*/
|
|
29
|
+
interval: number;
|
|
30
|
+
/**
|
|
31
|
+
* By default, trigger service will split up orders as per total amount / interval
|
|
32
|
+
* If you want to specify the amounts for each interval, you can provide them here.
|
|
33
|
+
*/
|
|
34
|
+
amounts?: string[];
|
|
35
|
+
}
|
|
36
|
+
type TriggerServerTriggerCriteria = {
|
|
37
|
+
price_trigger: TriggerServerPriceTriggerCriteria;
|
|
38
|
+
} | {
|
|
39
|
+
time_trigger: TriggerServerTimeTriggerCriteria;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type { TriggerServerDependency, TriggerServerPriceRequirement, TriggerServerPriceTriggerCriteria, TriggerServerTimeTriggerCriteria, TriggerServerTriggerCriteria };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=serverModelTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|