@nadohq/trigger-client 0.1.0-alpha.6 → 0.1.0-alpha.8

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.
@@ -3,25 +3,36 @@ import { EngineServerExecuteResult } from '@nadohq/engine-client';
3
3
  import { TriggerServerPlaceOrderParams } from './serverExecuteTypes';
4
4
 
5
5
  export type TriggerServerOrderStatus =
6
- | 'pending'
7
6
  | {
8
- // Result from sending to engine
9
- triggered: EngineServerExecuteResult;
7
+ cancelled: TriggerServerCancelReason;
10
8
  }
11
9
  | {
12
- // Reason string
13
- cancelled: string;
10
+ triggered: EngineServerExecuteResult;
14
11
  }
15
12
  | {
16
- // Error message
17
13
  internal_error: string;
14
+ }
15
+ | 'triggering'
16
+ | 'waiting_price'
17
+ | 'waiting_dependency'
18
+ | {
19
+ twap_executing: {
20
+ current_execution: number;
21
+ total_executions: number;
22
+ };
23
+ }
24
+ | {
25
+ twap_completed: {
26
+ executed: number;
27
+ total: number;
28
+ };
18
29
  };
19
30
 
20
31
  /**
21
32
  * Request types
22
33
  */
23
34
 
24
- export type TriggerServerTriggerTypeFilter = 'price_trigger' | 'twap';
35
+ export type TriggerServerTriggerTypeFilter = 'price_trigger' | 'time_trigger';
25
36
 
26
37
  export interface TriggerServerListTriggerOrdersParams
27
38
  extends SignedTx<EIP712ListTriggerOrdersValues> {
@@ -35,8 +46,13 @@ export interface TriggerServerListTriggerOrdersParams
35
46
  reduce_only?: boolean;
36
47
  }
37
48
 
49
+ export interface TriggerServerListTwapExecutionsParams {
50
+ digest: string;
51
+ }
52
+
38
53
  export interface TriggerServerQueryRequestByType {
39
54
  list_trigger_orders: TriggerServerListTriggerOrdersParams;
55
+ list_twap_executions: TriggerServerListTwapExecutionsParams;
40
56
  }
41
57
 
42
58
  export type TriggerServerQueryRequestType =
@@ -61,8 +77,43 @@ export interface TriggerServerListTriggerOrdersResponse {
61
77
  orders: TriggerServerOrderInfo[];
62
78
  }
63
79
 
80
+ export type TriggerServerCancelReason =
81
+ | 'user_requested'
82
+ | 'linked_signer_changed'
83
+ | 'expired'
84
+ | 'account_health'
85
+ | 'isolated_subaccount_closed'
86
+ | 'dependent_order_cancelled';
87
+
88
+ export type TriggerServerTwapExecutionStatus =
89
+ | 'pending'
90
+ | {
91
+ executed: {
92
+ executed_time: number;
93
+ execute_response: EngineServerExecuteResult;
94
+ };
95
+ }
96
+ | {
97
+ failed: string;
98
+ }
99
+ | {
100
+ cancelled: TriggerServerCancelReason;
101
+ };
102
+
103
+ export interface TriggerServerTwapExecutionInfo {
104
+ execution_id: number;
105
+ scheduled_time: number;
106
+ status: TriggerServerTwapExecutionStatus;
107
+ updated_at: number;
108
+ }
109
+
110
+ export interface TriggerServerTwapExecutionsResponse {
111
+ executions: TriggerServerTwapExecutionInfo[];
112
+ }
113
+
64
114
  export interface TriggerServerQueryResponseByType {
65
115
  list_trigger_orders: TriggerServerListTriggerOrdersResponse;
116
+ list_twap_executions: TriggerServerTwapExecutionsResponse;
66
117
  }
67
118
 
68
119
  export interface TriggerServerQuerySuccessResponse<