@pear-protocol/types 0.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.
Files changed (131) hide show
  1. package/dist/auth/entities.d.ts +9 -0
  2. package/dist/auth/entities.js +8 -0
  3. package/dist/auth/index.d.ts +3 -0
  4. package/dist/auth/index.js +3 -0
  5. package/dist/auth/payloads.d.ts +50 -0
  6. package/dist/auth/payloads.js +39 -0
  7. package/dist/auth/response.d.ts +55 -0
  8. package/dist/auth/response.js +21 -0
  9. package/dist/bundle.d.ts +17 -0
  10. package/dist/bundle.js +17 -0
  11. package/dist/common/array.d.ts +10 -0
  12. package/dist/common/array.js +10 -0
  13. package/dist/common/index.d.ts +3 -0
  14. package/dist/common/index.js +3 -0
  15. package/dist/common/refinement.d.ts +20 -0
  16. package/dist/common/refinement.js +60 -0
  17. package/dist/common/request.d.ts +11 -0
  18. package/dist/common/request.js +24 -0
  19. package/dist/common/response.d.ts +12 -0
  20. package/dist/common/response.js +28 -0
  21. package/dist/common/schema.d.ts +8 -0
  22. package/dist/common/schema.js +10 -0
  23. package/dist/common/trade-legs.d.ts +34 -0
  24. package/dist/common/trade-legs.js +30 -0
  25. package/dist/connector/index.d.ts +8 -0
  26. package/dist/connector/index.js +5 -0
  27. package/dist/execution/entities.d.ts +741 -0
  28. package/dist/execution/entities.js +125 -0
  29. package/dist/execution/index.d.ts +3 -0
  30. package/dist/execution/index.js +3 -0
  31. package/dist/execution/queries.d.ts +20 -0
  32. package/dist/execution/queries.js +14 -0
  33. package/dist/execution/responses.d.ts +218 -0
  34. package/dist/execution/responses.js +9 -0
  35. package/dist/fill/entities.d.ts +25 -0
  36. package/dist/fill/entities.js +61 -0
  37. package/dist/fill/index.d.ts +3 -0
  38. package/dist/fill/index.js +3 -0
  39. package/dist/fill/queries.d.ts +13 -0
  40. package/dist/fill/queries.js +11 -0
  41. package/dist/fill/responses.d.ts +55 -0
  42. package/dist/fill/responses.js +12 -0
  43. package/dist/funding/entities.d.ts +11 -0
  44. package/dist/funding/entities.js +16 -0
  45. package/dist/funding/index.d.ts +3 -0
  46. package/dist/funding/index.js +3 -0
  47. package/dist/funding/queries.d.ts +10 -0
  48. package/dist/funding/queries.js +8 -0
  49. package/dist/funding/responses.d.ts +8 -0
  50. package/dist/funding/responses.js +11 -0
  51. package/dist/index.d.ts +2 -0
  52. package/dist/index.js +3 -0
  53. package/dist/instrument/entities.d.ts +43 -0
  54. package/dist/instrument/entities.js +48 -0
  55. package/dist/instrument/index.d.ts +3 -0
  56. package/dist/instrument/index.js +3 -0
  57. package/dist/instrument/queries.d.ts +10 -0
  58. package/dist/instrument/queries.js +8 -0
  59. package/dist/instrument/responses.d.ts +37 -0
  60. package/dist/instrument/responses.js +11 -0
  61. package/dist/instrument-precision/index.d.ts +18 -0
  62. package/dist/instrument-precision/index.js +51 -0
  63. package/dist/misc/index.d.ts +3 -0
  64. package/dist/misc/index.js +1 -0
  65. package/dist/order/entities.d.ts +73 -0
  66. package/dist/order/entities.js +73 -0
  67. package/dist/order/index.d.ts +1 -0
  68. package/dist/order/index.js +1 -0
  69. package/dist/position/entities.d.ts +53 -0
  70. package/dist/position/entities.js +55 -0
  71. package/dist/position/index.d.ts +3 -0
  72. package/dist/position/index.js +3 -0
  73. package/dist/position/queries.d.ts +16 -0
  74. package/dist/position/queries.js +28 -0
  75. package/dist/position/responses.d.ts +28 -0
  76. package/dist/position/responses.js +8 -0
  77. package/dist/price/entities.d.ts +8 -0
  78. package/dist/price/entities.js +7 -0
  79. package/dist/price/index.d.ts +3 -0
  80. package/dist/price/index.js +3 -0
  81. package/dist/price/queries.d.ts +10 -0
  82. package/dist/price/queries.js +8 -0
  83. package/dist/price/responses.d.ts +6 -0
  84. package/dist/price/responses.js +15 -0
  85. package/dist/schedule/entities.d.ts +380 -0
  86. package/dist/schedule/entities.js +159 -0
  87. package/dist/schedule/index.d.ts +4 -0
  88. package/dist/schedule/index.js +4 -0
  89. package/dist/schedule/payloads.d.ts +72 -0
  90. package/dist/schedule/payloads.js +102 -0
  91. package/dist/schedule/queries.d.ts +18 -0
  92. package/dist/schedule/queries.js +12 -0
  93. package/dist/schedule/responses.d.ts +279 -0
  94. package/dist/schedule/responses.js +10 -0
  95. package/dist/trade/index.d.ts +2 -0
  96. package/dist/trade/index.js +2 -0
  97. package/dist/trade/payloads.d.ts +217 -0
  98. package/dist/trade/payloads.js +35 -0
  99. package/dist/trade/responses.d.ts +861 -0
  100. package/dist/trade/responses.js +9 -0
  101. package/dist/trade-accounts/entities.d.ts +50 -0
  102. package/dist/trade-accounts/entities.js +18 -0
  103. package/dist/trade-accounts/index.d.ts +3 -0
  104. package/dist/trade-accounts/index.js +3 -0
  105. package/dist/trade-accounts/payloads.d.ts +137 -0
  106. package/dist/trade-accounts/payloads.js +84 -0
  107. package/dist/trade-accounts/response.d.ts +65 -0
  108. package/dist/trade-accounts/response.js +41 -0
  109. package/dist/trigger/entities/conditions.d.ts +407 -0
  110. package/dist/trigger/entities/conditions.js +239 -0
  111. package/dist/trigger/entities/index.d.ts +1549 -0
  112. package/dist/trigger/entities/index.js +123 -0
  113. package/dist/trigger/index.d.ts +6 -0
  114. package/dist/trigger/index.js +6 -0
  115. package/dist/trigger/payloads/conditions.d.ts +340 -0
  116. package/dist/trigger/payloads/conditions.js +109 -0
  117. package/dist/trigger/payloads/index.d.ts +470 -0
  118. package/dist/trigger/payloads/index.js +47 -0
  119. package/dist/trigger/queries.d.ts +18 -0
  120. package/dist/trigger/queries.js +12 -0
  121. package/dist/trigger/responses.d.ts +1001 -0
  122. package/dist/trigger/responses.js +10 -0
  123. package/dist/users/entities.d.ts +16 -0
  124. package/dist/users/entities.js +14 -0
  125. package/dist/users/index.d.ts +3 -0
  126. package/dist/users/index.js +3 -0
  127. package/dist/users/payloads.d.ts +5 -0
  128. package/dist/users/payloads.js +7 -0
  129. package/dist/users/response.d.ts +23 -0
  130. package/dist/users/response.js +12 -0
  131. package/package.json +35 -0
@@ -0,0 +1,470 @@
1
+ import { z } from 'zod';
2
+ export declare const CreateTriggerMarketOpen: z.ZodObject<{
3
+ intent: z.ZodLiteral<"OPEN">;
4
+ type: z.ZodLiteral<"MARKET">;
5
+ condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
6
+ type: z.ZodLiteral<"ratio_v1">;
7
+ data: z.ZodObject<{
8
+ priceSource: z.ZodEnum<{
9
+ mid: "mid";
10
+ mark: "mark";
11
+ }>;
12
+ symbol_a: z.ZodString;
13
+ symbol_b: z.ZodString;
14
+ direction: z.ZodEnum<{
15
+ ABOVE: "ABOVE";
16
+ BELOW: "BELOW";
17
+ }>;
18
+ threshold: z.ZodNumber;
19
+ }, z.core.$strip>;
20
+ }, z.core.$strip>, z.ZodObject<{
21
+ type: z.ZodLiteral<"price_v1">;
22
+ data: z.ZodObject<{
23
+ priceSource: z.ZodEnum<{
24
+ mid: "mid";
25
+ mark: "mark";
26
+ }>;
27
+ symbol: z.ZodString;
28
+ direction: z.ZodEnum<{
29
+ ABOVE: "ABOVE";
30
+ BELOW: "BELOW";
31
+ }>;
32
+ threshold: z.ZodNumber;
33
+ }, z.core.$strip>;
34
+ }, z.core.$strip>, z.ZodObject<{
35
+ type: z.ZodLiteral<"index_v1">;
36
+ data: z.ZodObject<{
37
+ priceSource: z.ZodEnum<{
38
+ mid: "mid";
39
+ mark: "mark";
40
+ }>;
41
+ basket: z.ZodArray<z.ZodObject<{
42
+ symbol: z.ZodString;
43
+ weight: z.ZodNumber;
44
+ }, z.core.$strip>>;
45
+ direction: z.ZodEnum<{
46
+ ABOVE: "ABOVE";
47
+ BELOW: "BELOW";
48
+ }>;
49
+ threshold: z.ZodNumber;
50
+ }, z.core.$strip>;
51
+ }, z.core.$strip>, z.ZodObject<{
52
+ type: z.ZodLiteral<"weighted_ratio_v1">;
53
+ data: z.ZodObject<{
54
+ priceSource: z.ZodEnum<{
55
+ mid: "mid";
56
+ mark: "mark";
57
+ }>;
58
+ basket: z.ZodArray<z.ZodObject<{
59
+ symbol: z.ZodString;
60
+ side: z.ZodEnum<{
61
+ BUY: "BUY";
62
+ SELL: "SELL";
63
+ }>;
64
+ weight: z.ZodNumber;
65
+ }, z.core.$strip>>;
66
+ direction: z.ZodEnum<{
67
+ ABOVE: "ABOVE";
68
+ BELOW: "BELOW";
69
+ }>;
70
+ threshold: z.ZodNumber;
71
+ }, z.core.$strip>;
72
+ }, z.core.$strip>], "type">;
73
+ payload: z.ZodObject<{
74
+ type: z.ZodLiteral<"MARKET">;
75
+ legs: z.ZodTuple<[z.ZodObject<{
76
+ symbol: z.ZodString;
77
+ side: z.ZodEnum<{
78
+ BUY: "BUY";
79
+ SELL: "SELL";
80
+ }>;
81
+ mode: z.ZodEnum<{
82
+ QUANTITY: "QUANTITY";
83
+ USD: "USD";
84
+ }>;
85
+ amount: z.ZodString;
86
+ }, z.core.$strip>], z.ZodObject<{
87
+ symbol: z.ZodString;
88
+ side: z.ZodEnum<{
89
+ BUY: "BUY";
90
+ SELL: "SELL";
91
+ }>;
92
+ mode: z.ZodEnum<{
93
+ QUANTITY: "QUANTITY";
94
+ USD: "USD";
95
+ }>;
96
+ amount: z.ZodString;
97
+ }, z.core.$strip>>;
98
+ }, z.core.$strip>;
99
+ }, z.core.$strip>;
100
+ export declare const CreateTriggerMarketClose: z.ZodObject<{
101
+ intent: z.ZodLiteral<"CLOSE">;
102
+ type: z.ZodLiteral<"MARKET">;
103
+ condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
104
+ type: z.ZodLiteral<"ratio_v1">;
105
+ data: z.ZodObject<{
106
+ priceSource: z.ZodEnum<{
107
+ mid: "mid";
108
+ mark: "mark";
109
+ }>;
110
+ symbol_a: z.ZodString;
111
+ symbol_b: z.ZodString;
112
+ direction: z.ZodEnum<{
113
+ ABOVE: "ABOVE";
114
+ BELOW: "BELOW";
115
+ }>;
116
+ threshold: z.ZodNumber;
117
+ }, z.core.$strip>;
118
+ }, z.core.$strip>, z.ZodObject<{
119
+ type: z.ZodLiteral<"price_v1">;
120
+ data: z.ZodObject<{
121
+ priceSource: z.ZodEnum<{
122
+ mid: "mid";
123
+ mark: "mark";
124
+ }>;
125
+ symbol: z.ZodString;
126
+ direction: z.ZodEnum<{
127
+ ABOVE: "ABOVE";
128
+ BELOW: "BELOW";
129
+ }>;
130
+ threshold: z.ZodNumber;
131
+ }, z.core.$strip>;
132
+ }, z.core.$strip>, z.ZodObject<{
133
+ type: z.ZodLiteral<"index_v1">;
134
+ data: z.ZodObject<{
135
+ priceSource: z.ZodEnum<{
136
+ mid: "mid";
137
+ mark: "mark";
138
+ }>;
139
+ basket: z.ZodArray<z.ZodObject<{
140
+ symbol: z.ZodString;
141
+ weight: z.ZodNumber;
142
+ }, z.core.$strip>>;
143
+ direction: z.ZodEnum<{
144
+ ABOVE: "ABOVE";
145
+ BELOW: "BELOW";
146
+ }>;
147
+ threshold: z.ZodNumber;
148
+ }, z.core.$strip>;
149
+ }, z.core.$strip>, z.ZodObject<{
150
+ type: z.ZodLiteral<"weighted_ratio_v1">;
151
+ data: z.ZodObject<{
152
+ priceSource: z.ZodEnum<{
153
+ mid: "mid";
154
+ mark: "mark";
155
+ }>;
156
+ basket: z.ZodArray<z.ZodObject<{
157
+ symbol: z.ZodString;
158
+ side: z.ZodEnum<{
159
+ BUY: "BUY";
160
+ SELL: "SELL";
161
+ }>;
162
+ weight: z.ZodNumber;
163
+ }, z.core.$strip>>;
164
+ direction: z.ZodEnum<{
165
+ ABOVE: "ABOVE";
166
+ BELOW: "BELOW";
167
+ }>;
168
+ threshold: z.ZodNumber;
169
+ }, z.core.$strip>;
170
+ }, z.core.$strip>, z.ZodObject<{
171
+ type: z.ZodLiteral<"position_value_v1">;
172
+ data: z.ZodObject<{
173
+ priceSource: z.ZodEnum<{
174
+ mid: "mid";
175
+ mark: "mark";
176
+ }>;
177
+ direction: z.ZodEnum<{
178
+ ABOVE: "ABOVE";
179
+ BELOW: "BELOW";
180
+ }>;
181
+ threshold: z.ZodNumber;
182
+ }, z.core.$strip>;
183
+ }, z.core.$strip>, z.ZodObject<{
184
+ type: z.ZodLiteral<"position_upnl_value_v1">;
185
+ data: z.ZodObject<{
186
+ priceSource: z.ZodEnum<{
187
+ mid: "mid";
188
+ mark: "mark";
189
+ }>;
190
+ direction: z.ZodEnum<{
191
+ ABOVE: "ABOVE";
192
+ BELOW: "BELOW";
193
+ }>;
194
+ threshold: z.ZodNumber;
195
+ }, z.core.$strip>;
196
+ }, z.core.$strip>, z.ZodObject<{
197
+ type: z.ZodLiteral<"position_upnl_percentage_v1">;
198
+ data: z.ZodObject<{
199
+ priceSource: z.ZodEnum<{
200
+ mid: "mid";
201
+ mark: "mark";
202
+ }>;
203
+ direction: z.ZodEnum<{
204
+ ABOVE: "ABOVE";
205
+ BELOW: "BELOW";
206
+ }>;
207
+ threshold_bps: z.ZodNumber;
208
+ }, z.core.$strip>;
209
+ }, z.core.$strip>], "type">;
210
+ positionId: z.ZodUUID;
211
+ }, z.core.$strip>;
212
+ export declare const AttachTriggerMarketClose: z.ZodObject<{
213
+ intent: z.ZodLiteral<"CLOSE">;
214
+ type: z.ZodLiteral<"MARKET">;
215
+ condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
216
+ type: z.ZodLiteral<"position_value_v1">;
217
+ data: z.ZodObject<{
218
+ priceSource: z.ZodEnum<{
219
+ mid: "mid";
220
+ mark: "mark";
221
+ }>;
222
+ direction: z.ZodEnum<{
223
+ ABOVE: "ABOVE";
224
+ BELOW: "BELOW";
225
+ }>;
226
+ threshold: z.ZodNumber;
227
+ }, z.core.$strip>;
228
+ }, z.core.$strip>, z.ZodObject<{
229
+ type: z.ZodLiteral<"position_upnl_value_v1">;
230
+ data: z.ZodObject<{
231
+ priceSource: z.ZodEnum<{
232
+ mid: "mid";
233
+ mark: "mark";
234
+ }>;
235
+ direction: z.ZodEnum<{
236
+ ABOVE: "ABOVE";
237
+ BELOW: "BELOW";
238
+ }>;
239
+ threshold: z.ZodNumber;
240
+ }, z.core.$strip>;
241
+ }, z.core.$strip>, z.ZodObject<{
242
+ type: z.ZodLiteral<"position_upnl_percentage_v1">;
243
+ data: z.ZodObject<{
244
+ priceSource: z.ZodEnum<{
245
+ mid: "mid";
246
+ mark: "mark";
247
+ }>;
248
+ direction: z.ZodEnum<{
249
+ ABOVE: "ABOVE";
250
+ BELOW: "BELOW";
251
+ }>;
252
+ threshold_bps: z.ZodNumber;
253
+ }, z.core.$strip>;
254
+ }, z.core.$strip>], "type">;
255
+ }, z.core.$strip>;
256
+ export declare const CreateTriggerOpen: z.ZodDiscriminatedUnion<[z.ZodObject<{
257
+ intent: z.ZodLiteral<"OPEN">;
258
+ type: z.ZodLiteral<"MARKET">;
259
+ condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
260
+ type: z.ZodLiteral<"ratio_v1">;
261
+ data: z.ZodObject<{
262
+ priceSource: z.ZodEnum<{
263
+ mid: "mid";
264
+ mark: "mark";
265
+ }>;
266
+ symbol_a: z.ZodString;
267
+ symbol_b: z.ZodString;
268
+ direction: z.ZodEnum<{
269
+ ABOVE: "ABOVE";
270
+ BELOW: "BELOW";
271
+ }>;
272
+ threshold: z.ZodNumber;
273
+ }, z.core.$strip>;
274
+ }, z.core.$strip>, z.ZodObject<{
275
+ type: z.ZodLiteral<"price_v1">;
276
+ data: z.ZodObject<{
277
+ priceSource: z.ZodEnum<{
278
+ mid: "mid";
279
+ mark: "mark";
280
+ }>;
281
+ symbol: z.ZodString;
282
+ direction: z.ZodEnum<{
283
+ ABOVE: "ABOVE";
284
+ BELOW: "BELOW";
285
+ }>;
286
+ threshold: z.ZodNumber;
287
+ }, z.core.$strip>;
288
+ }, z.core.$strip>, z.ZodObject<{
289
+ type: z.ZodLiteral<"index_v1">;
290
+ data: z.ZodObject<{
291
+ priceSource: z.ZodEnum<{
292
+ mid: "mid";
293
+ mark: "mark";
294
+ }>;
295
+ basket: z.ZodArray<z.ZodObject<{
296
+ symbol: z.ZodString;
297
+ weight: z.ZodNumber;
298
+ }, z.core.$strip>>;
299
+ direction: z.ZodEnum<{
300
+ ABOVE: "ABOVE";
301
+ BELOW: "BELOW";
302
+ }>;
303
+ threshold: z.ZodNumber;
304
+ }, z.core.$strip>;
305
+ }, z.core.$strip>, z.ZodObject<{
306
+ type: z.ZodLiteral<"weighted_ratio_v1">;
307
+ data: z.ZodObject<{
308
+ priceSource: z.ZodEnum<{
309
+ mid: "mid";
310
+ mark: "mark";
311
+ }>;
312
+ basket: z.ZodArray<z.ZodObject<{
313
+ symbol: z.ZodString;
314
+ side: z.ZodEnum<{
315
+ BUY: "BUY";
316
+ SELL: "SELL";
317
+ }>;
318
+ weight: z.ZodNumber;
319
+ }, z.core.$strip>>;
320
+ direction: z.ZodEnum<{
321
+ ABOVE: "ABOVE";
322
+ BELOW: "BELOW";
323
+ }>;
324
+ threshold: z.ZodNumber;
325
+ }, z.core.$strip>;
326
+ }, z.core.$strip>], "type">;
327
+ payload: z.ZodObject<{
328
+ type: z.ZodLiteral<"MARKET">;
329
+ legs: z.ZodTuple<[z.ZodObject<{
330
+ symbol: z.ZodString;
331
+ side: z.ZodEnum<{
332
+ BUY: "BUY";
333
+ SELL: "SELL";
334
+ }>;
335
+ mode: z.ZodEnum<{
336
+ QUANTITY: "QUANTITY";
337
+ USD: "USD";
338
+ }>;
339
+ amount: z.ZodString;
340
+ }, z.core.$strip>], z.ZodObject<{
341
+ symbol: z.ZodString;
342
+ side: z.ZodEnum<{
343
+ BUY: "BUY";
344
+ SELL: "SELL";
345
+ }>;
346
+ mode: z.ZodEnum<{
347
+ QUANTITY: "QUANTITY";
348
+ USD: "USD";
349
+ }>;
350
+ amount: z.ZodString;
351
+ }, z.core.$strip>>;
352
+ }, z.core.$strip>;
353
+ }, z.core.$strip>], "type">;
354
+ export declare const CreateTriggerClose: z.ZodDiscriminatedUnion<[z.ZodObject<{
355
+ intent: z.ZodLiteral<"CLOSE">;
356
+ type: z.ZodLiteral<"MARKET">;
357
+ condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
358
+ type: z.ZodLiteral<"ratio_v1">;
359
+ data: z.ZodObject<{
360
+ priceSource: z.ZodEnum<{
361
+ mid: "mid";
362
+ mark: "mark";
363
+ }>;
364
+ symbol_a: z.ZodString;
365
+ symbol_b: z.ZodString;
366
+ direction: z.ZodEnum<{
367
+ ABOVE: "ABOVE";
368
+ BELOW: "BELOW";
369
+ }>;
370
+ threshold: z.ZodNumber;
371
+ }, z.core.$strip>;
372
+ }, z.core.$strip>, z.ZodObject<{
373
+ type: z.ZodLiteral<"price_v1">;
374
+ data: z.ZodObject<{
375
+ priceSource: z.ZodEnum<{
376
+ mid: "mid";
377
+ mark: "mark";
378
+ }>;
379
+ symbol: z.ZodString;
380
+ direction: z.ZodEnum<{
381
+ ABOVE: "ABOVE";
382
+ BELOW: "BELOW";
383
+ }>;
384
+ threshold: z.ZodNumber;
385
+ }, z.core.$strip>;
386
+ }, z.core.$strip>, z.ZodObject<{
387
+ type: z.ZodLiteral<"index_v1">;
388
+ data: z.ZodObject<{
389
+ priceSource: z.ZodEnum<{
390
+ mid: "mid";
391
+ mark: "mark";
392
+ }>;
393
+ basket: z.ZodArray<z.ZodObject<{
394
+ symbol: z.ZodString;
395
+ weight: z.ZodNumber;
396
+ }, z.core.$strip>>;
397
+ direction: z.ZodEnum<{
398
+ ABOVE: "ABOVE";
399
+ BELOW: "BELOW";
400
+ }>;
401
+ threshold: z.ZodNumber;
402
+ }, z.core.$strip>;
403
+ }, z.core.$strip>, z.ZodObject<{
404
+ type: z.ZodLiteral<"weighted_ratio_v1">;
405
+ data: z.ZodObject<{
406
+ priceSource: z.ZodEnum<{
407
+ mid: "mid";
408
+ mark: "mark";
409
+ }>;
410
+ basket: z.ZodArray<z.ZodObject<{
411
+ symbol: z.ZodString;
412
+ side: z.ZodEnum<{
413
+ BUY: "BUY";
414
+ SELL: "SELL";
415
+ }>;
416
+ weight: z.ZodNumber;
417
+ }, z.core.$strip>>;
418
+ direction: z.ZodEnum<{
419
+ ABOVE: "ABOVE";
420
+ BELOW: "BELOW";
421
+ }>;
422
+ threshold: z.ZodNumber;
423
+ }, z.core.$strip>;
424
+ }, z.core.$strip>, z.ZodObject<{
425
+ type: z.ZodLiteral<"position_value_v1">;
426
+ data: z.ZodObject<{
427
+ priceSource: z.ZodEnum<{
428
+ mid: "mid";
429
+ mark: "mark";
430
+ }>;
431
+ direction: z.ZodEnum<{
432
+ ABOVE: "ABOVE";
433
+ BELOW: "BELOW";
434
+ }>;
435
+ threshold: z.ZodNumber;
436
+ }, z.core.$strip>;
437
+ }, z.core.$strip>, z.ZodObject<{
438
+ type: z.ZodLiteral<"position_upnl_value_v1">;
439
+ data: z.ZodObject<{
440
+ priceSource: z.ZodEnum<{
441
+ mid: "mid";
442
+ mark: "mark";
443
+ }>;
444
+ direction: z.ZodEnum<{
445
+ ABOVE: "ABOVE";
446
+ BELOW: "BELOW";
447
+ }>;
448
+ threshold: z.ZodNumber;
449
+ }, z.core.$strip>;
450
+ }, z.core.$strip>, z.ZodObject<{
451
+ type: z.ZodLiteral<"position_upnl_percentage_v1">;
452
+ data: z.ZodObject<{
453
+ priceSource: z.ZodEnum<{
454
+ mid: "mid";
455
+ mark: "mark";
456
+ }>;
457
+ direction: z.ZodEnum<{
458
+ ABOVE: "ABOVE";
459
+ BELOW: "BELOW";
460
+ }>;
461
+ threshold_bps: z.ZodNumber;
462
+ }, z.core.$strip>;
463
+ }, z.core.$strip>], "type">;
464
+ positionId: z.ZodUUID;
465
+ }, z.core.$strip>], "type">;
466
+ export type CreateTriggerMarketOpen = z.output<typeof CreateTriggerMarketOpen>;
467
+ export type CreateTriggerMarketClose = z.output<typeof CreateTriggerMarketClose>;
468
+ export type AttachTriggerMarketClose = z.output<typeof AttachTriggerMarketClose>;
469
+ export type CreateTriggerOpen = z.output<typeof CreateTriggerOpen>;
470
+ export type CreateTriggerClose = z.output<typeof CreateTriggerClose>;
@@ -0,0 +1,47 @@
1
+ import { z } from 'zod';
2
+ import { RefineMinimumOneSymbol, RefineUniqueSymbols } from '../../common/refinement';
3
+ import { TradeLegPostOnly } from '../../common/trade-legs';
4
+ import { CreateTriggerConditionOpen, CreateTriggerConditionClose, CreateTriggerConditionAttach } from './conditions';
5
+
6
+ const CreateTriggerMarketOpen = z.object({
7
+ intent: z.literal("OPEN"),
8
+ type: z.literal("MARKET"),
9
+ /**
10
+ * Condition to fire the trigger
11
+ */
12
+ condition: CreateTriggerConditionOpen,
13
+ /**
14
+ * MARKET Execution details to execute when the trigger is fired
15
+ */
16
+ payload: z.object({
17
+ type: z.literal("MARKET"),
18
+ /**
19
+ * Requested legs
20
+ */
21
+ legs: z.tuple([TradeLegPostOnly]).rest(TradeLegPostOnly).superRefine(RefineMinimumOneSymbol).superRefine(RefineUniqueSymbols).describe("Array of legs to make up the exposure")
22
+ })
23
+ });
24
+ const CreateTriggerMarketClose = z.object({
25
+ intent: z.literal("CLOSE"),
26
+ type: z.literal("MARKET"),
27
+ /**
28
+ * Condition to fire the trigger
29
+ */
30
+ condition: CreateTriggerConditionClose,
31
+ /**
32
+ * Position UUID
33
+ */
34
+ positionId: z.uuid()
35
+ });
36
+ const AttachTriggerMarketClose = z.object({
37
+ intent: z.literal("CLOSE"),
38
+ type: z.literal("MARKET"),
39
+ /**
40
+ * Condition to fire the trigger
41
+ */
42
+ condition: CreateTriggerConditionAttach
43
+ });
44
+ const CreateTriggerOpen = z.discriminatedUnion("type", [CreateTriggerMarketOpen]);
45
+ const CreateTriggerClose = z.discriminatedUnion("type", [CreateTriggerMarketClose]);
46
+
47
+ export { AttachTriggerMarketClose, CreateTriggerClose, CreateTriggerMarketClose, CreateTriggerMarketOpen, CreateTriggerOpen };
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ export declare const TriggerListParams: z.ZodObject<{
3
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<number>>>;
4
+ cursor: z.ZodOptional<z.ZodString>;
5
+ connector: z.ZodOptional<z.ZodEnum<{
6
+ hyperliquid: "hyperliquid";
7
+ binanceusdm: "binanceusdm";
8
+ bybit: "bybit";
9
+ okx: "okx";
10
+ }>>;
11
+ status: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[] | (("CANCELLED" | "ACTIVE" | "COMPLETED")[] & any[]) | undefined, ("CANCELLED" | "ACTIVE" | "COMPLETED")[]>, z.ZodArray<z.ZodEnum<{
12
+ CANCELLED: "CANCELLED";
13
+ ACTIVE: "ACTIVE";
14
+ COMPLETED: "COMPLETED";
15
+ }>>>>;
16
+ }, z.core.$strip>;
17
+ export type TriggerListParamsInput = z.input<typeof TriggerListParams>;
18
+ export type TriggerListParams = z.output<typeof TriggerListParams>;
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ import { normalizeArray, CursorFindParams } from '../common';
3
+ import { Connector } from '../connector';
4
+
5
+ const StatusEnum = z.enum(["ACTIVE", "COMPLETED", "CANCELLED"]);
6
+ const StatusArray = z.preprocess((arg) => normalizeArray(arg), z.array(StatusEnum));
7
+ const TriggerListParams = CursorFindParams.extend({
8
+ connector: Connector.optional(),
9
+ status: StatusArray.optional()
10
+ });
11
+
12
+ export { TriggerListParams };