@pear-protocol/types 2.18.0 → 2.19.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.
@@ -0,0 +1,923 @@
1
+ import { z } from 'zod';
2
+ import { EthereumAddress } from '../common/address';
3
+ /** Sent on every (re)connect: nothing is replayed, so the client must resubscribe. */
4
+ export declare const WebsocketWelcomeFrame: z.ZodObject<{
5
+ type: z.ZodLiteral<"welcome">;
6
+ connectionId: z.ZodString;
7
+ heartbeatIntervalMs: z.ZodNumber;
8
+ resubscribeRequired: z.ZodLiteral<true>;
9
+ }, z.core.$strip>;
10
+ export type WebsocketWelcomeFrame = z.output<typeof WebsocketWelcomeFrame>;
11
+ /** Confirms an auth, subscribe or unsubscribe; subscription acks name the channel they settled. */
12
+ export declare const WebsocketAckFrame: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
+ id: z.ZodOptional<z.ZodString>;
14
+ type: z.ZodLiteral<"ack">;
15
+ method: z.ZodLiteral<"auth">;
16
+ ok: z.ZodLiteral<true>;
17
+ }, z.core.$strip>, z.ZodObject<{
18
+ id: z.ZodOptional<z.ZodString>;
19
+ type: z.ZodLiteral<"ack">;
20
+ method: z.ZodEnum<{
21
+ subscribe: "subscribe";
22
+ unsubscribe: "unsubscribe";
23
+ }>;
24
+ channel: z.ZodEnum<{
25
+ funding: "funding";
26
+ prices: "prices";
27
+ trades: "trades";
28
+ trigger_events: "trigger_events";
29
+ user_events: "user_events";
30
+ vault_events: "vault_events";
31
+ vault_management: "vault_management";
32
+ }>;
33
+ ok: z.ZodLiteral<true>;
34
+ }, z.core.$strip>], "method">;
35
+ export type WebsocketAckFrame = z.output<typeof WebsocketAckFrame>;
36
+ /** Error codes about a vault_management grant; their frames name the vaults concerned. */
37
+ export declare const WebsocketVaultErrorCode: z.ZodEnum<{
38
+ FORBIDDEN: "FORBIDDEN";
39
+ SUBSCRIPTION_REVOKED: "SUBSCRIPTION_REVOKED";
40
+ }>;
41
+ export type WebsocketVaultErrorCode = z.infer<typeof WebsocketVaultErrorCode>;
42
+ /** Error codes about the connection or a single request. */
43
+ export declare const WebsocketRequestErrorCode: z.ZodEnum<{
44
+ AUTH_EXPIRED: "AUTH_EXPIRED";
45
+ CAPACITY_UNAVAILABLE: "CAPACITY_UNAVAILABLE";
46
+ INTERNAL_ERROR: "INTERNAL_ERROR";
47
+ INVALID_FRAME: "INVALID_FRAME";
48
+ INVALID_JSON: "INVALID_JSON";
49
+ INVALID_MESSAGE: "INVALID_MESSAGE";
50
+ INVALID_SUBSCRIPTION: "INVALID_SUBSCRIPTION";
51
+ RATE_LIMITED: "RATE_LIMITED";
52
+ TOO_MANY_SUBSCRIPTIONS: "TOO_MANY_SUBSCRIPTIONS";
53
+ UNAUTHENTICATED: "UNAUTHENTICATED";
54
+ }>;
55
+ export type WebsocketRequestErrorCode = z.infer<typeof WebsocketRequestErrorCode>;
56
+ export declare const WebsocketErrorCode: z.ZodEnum<{
57
+ FORBIDDEN: "FORBIDDEN";
58
+ SUBSCRIPTION_REVOKED: "SUBSCRIPTION_REVOKED";
59
+ AUTH_EXPIRED: "AUTH_EXPIRED";
60
+ CAPACITY_UNAVAILABLE: "CAPACITY_UNAVAILABLE";
61
+ INTERNAL_ERROR: "INTERNAL_ERROR";
62
+ INVALID_FRAME: "INVALID_FRAME";
63
+ INVALID_JSON: "INVALID_JSON";
64
+ INVALID_MESSAGE: "INVALID_MESSAGE";
65
+ INVALID_SUBSCRIPTION: "INVALID_SUBSCRIPTION";
66
+ RATE_LIMITED: "RATE_LIMITED";
67
+ TOO_MANY_SUBSCRIPTIONS: "TOO_MANY_SUBSCRIPTIONS";
68
+ UNAUTHENTICATED: "UNAUTHENTICATED";
69
+ }>;
70
+ export type WebsocketErrorCode = z.infer<typeof WebsocketErrorCode>;
71
+ /** Refuses a request or explains a server-side close; vault grant errors name their vaults. */
72
+ export declare const WebsocketErrorFrame: z.ZodDiscriminatedUnion<[z.ZodObject<{
73
+ id: z.ZodOptional<z.ZodString>;
74
+ type: z.ZodLiteral<"error">;
75
+ code: z.ZodEnum<{
76
+ AUTH_EXPIRED: "AUTH_EXPIRED";
77
+ CAPACITY_UNAVAILABLE: "CAPACITY_UNAVAILABLE";
78
+ INTERNAL_ERROR: "INTERNAL_ERROR";
79
+ INVALID_FRAME: "INVALID_FRAME";
80
+ INVALID_JSON: "INVALID_JSON";
81
+ INVALID_MESSAGE: "INVALID_MESSAGE";
82
+ INVALID_SUBSCRIPTION: "INVALID_SUBSCRIPTION";
83
+ RATE_LIMITED: "RATE_LIMITED";
84
+ TOO_MANY_SUBSCRIPTIONS: "TOO_MANY_SUBSCRIPTIONS";
85
+ UNAUTHENTICATED: "UNAUTHENTICATED";
86
+ }>;
87
+ message: z.ZodString;
88
+ }, z.core.$strip>, z.ZodObject<{
89
+ id: z.ZodOptional<z.ZodString>;
90
+ type: z.ZodLiteral<"error">;
91
+ code: z.ZodEnum<{
92
+ FORBIDDEN: "FORBIDDEN";
93
+ SUBSCRIPTION_REVOKED: "SUBSCRIPTION_REVOKED";
94
+ }>;
95
+ message: z.ZodString;
96
+ vaults: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>>;
97
+ }, z.core.$strip>], "code">;
98
+ export type WebsocketErrorFrame = z.output<typeof WebsocketErrorFrame>;
99
+ /** One pushed event; `topic` decides the shape of `data`. */
100
+ export declare const WebsocketEventFrame: z.ZodDiscriminatedUnion<[z.ZodObject<{
101
+ type: z.ZodLiteral<"event">;
102
+ channel: z.ZodLiteral<"prices">;
103
+ topic: z.ZodLiteral<"price.updated">;
104
+ data: z.ZodObject<{
105
+ connector: z.ZodEnum<{
106
+ hyperliquid: "hyperliquid";
107
+ binance: "binance";
108
+ bybit: "bybit";
109
+ okx: "okx";
110
+ lighter: "lighter";
111
+ lighter_rhc: "lighter_rhc";
112
+ }>;
113
+ source: z.ZodEnum<{
114
+ mid: "mid";
115
+ mark: "mark";
116
+ }>;
117
+ prices: z.ZodRecord<z.ZodString, z.ZodObject<{
118
+ id: z.ZodString;
119
+ p: z.ZodString;
120
+ bid: z.ZodNullable<z.ZodString>;
121
+ ask: z.ZodNullable<z.ZodString>;
122
+ t: z.ZodNumber;
123
+ }, z.core.$strip>>;
124
+ }, z.core.$strip>;
125
+ }, z.core.$strip>, z.ZodObject<{
126
+ type: z.ZodLiteral<"event">;
127
+ channel: z.ZodLiteral<"funding">;
128
+ topic: z.ZodLiteral<"funding.updated">;
129
+ data: z.ZodObject<{
130
+ connector: z.ZodEnum<{
131
+ hyperliquid: "hyperliquid";
132
+ binance: "binance";
133
+ bybit: "bybit";
134
+ okx: "okx";
135
+ lighter: "lighter";
136
+ lighter_rhc: "lighter_rhc";
137
+ }>;
138
+ funding: z.ZodRecord<z.ZodString, z.ZodObject<{
139
+ id: z.ZodString;
140
+ r: z.ZodString;
141
+ t: z.ZodNumber;
142
+ nft: z.ZodNumber;
143
+ }, z.core.$strip>>;
144
+ }, z.core.$strip>;
145
+ }, z.core.$strip>, z.ZodObject<{
146
+ type: z.ZodLiteral<"event">;
147
+ channel: z.ZodLiteral<"trades">;
148
+ topic: z.ZodLiteral<"trade.executed">;
149
+ data: z.ZodObject<{
150
+ connector: z.ZodEnum<{
151
+ hyperliquid: "hyperliquid";
152
+ binance: "binance";
153
+ bybit: "bybit";
154
+ okx: "okx";
155
+ lighter: "lighter";
156
+ lighter_rhc: "lighter_rhc";
157
+ }>;
158
+ source: z.ZodEnum<{
159
+ DIRECT: "DIRECT";
160
+ TRIGGER: "TRIGGER";
161
+ TWAP: "TWAP";
162
+ }>;
163
+ intent: z.ZodEnum<{
164
+ OPEN: "OPEN";
165
+ ADJUST: "ADJUST";
166
+ CLOSE: "CLOSE";
167
+ REVERSE: "REVERSE";
168
+ }>;
169
+ orderType: z.ZodEnum<{
170
+ MARKET: "MARKET";
171
+ }>;
172
+ timestamp: z.ZodISODateTime;
173
+ clientId: z.ZodOptional<z.ZodString>;
174
+ legs: z.ZodArray<z.ZodObject<{
175
+ id: z.ZodOptional<z.ZodString>;
176
+ symbol: z.ZodString;
177
+ side: z.ZodEnum<{
178
+ BUY: "BUY";
179
+ SELL: "SELL";
180
+ }>;
181
+ reduceOnly: z.ZodBoolean;
182
+ quantity: z.ZodString;
183
+ price: z.ZodString;
184
+ }, z.core.$strip>>;
185
+ }, z.core.$strip>;
186
+ }, z.core.$strip>, z.ZodObject<{
187
+ type: z.ZodLiteral<"event">;
188
+ channel: z.ZodLiteral<"trigger_events">;
189
+ topic: z.ZodLiteral<"trigger.triggered.public">;
190
+ data: z.ZodObject<{
191
+ connector: z.ZodEnum<{
192
+ hyperliquid: "hyperliquid";
193
+ binance: "binance";
194
+ bybit: "bybit";
195
+ okx: "okx";
196
+ lighter: "lighter";
197
+ lighter_rhc: "lighter_rhc";
198
+ }>;
199
+ accountId: z.ZodString;
200
+ triggerId: z.ZodString;
201
+ bracketType: z.ZodEnum<{
202
+ STOP_LOSS: "STOP_LOSS";
203
+ TAKE_PROFIT: "TAKE_PROFIT";
204
+ }>;
205
+ semanticBracketType: z.ZodEnum<{
206
+ STOP_LOSS: "STOP_LOSS";
207
+ TAKE_PROFIT: "TAKE_PROFIT";
208
+ }>;
209
+ intent: z.ZodEnum<{
210
+ OPEN: "OPEN";
211
+ ADJUST: "ADJUST";
212
+ CLOSE: "CLOSE";
213
+ }>;
214
+ condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
215
+ type: z.ZodLiteral<"ratio">;
216
+ data: z.ZodObject<{
217
+ priceSource: z.ZodEnum<{
218
+ mid: "mid";
219
+ mark: "mark";
220
+ }>;
221
+ symbol_a: z.ZodString;
222
+ symbol_b: z.ZodString;
223
+ track: z.ZodEnum<{
224
+ PEAK: "PEAK";
225
+ TROUGH: "TROUGH";
226
+ }>;
227
+ threshold: z.ZodNumber;
228
+ }, z.core.$strip>;
229
+ }, z.core.$strip>, z.ZodObject<{
230
+ type: z.ZodLiteral<"price">;
231
+ data: z.ZodObject<{
232
+ priceSource: z.ZodEnum<{
233
+ mid: "mid";
234
+ mark: "mark";
235
+ }>;
236
+ symbol: z.ZodString;
237
+ track: z.ZodEnum<{
238
+ PEAK: "PEAK";
239
+ TROUGH: "TROUGH";
240
+ }>;
241
+ threshold: z.ZodNumber;
242
+ }, z.core.$strip>;
243
+ }, z.core.$strip>, z.ZodObject<{
244
+ type: z.ZodLiteral<"weighted_ratio">;
245
+ data: z.ZodObject<{
246
+ priceSource: z.ZodEnum<{
247
+ mid: "mid";
248
+ mark: "mark";
249
+ }>;
250
+ basket: z.ZodArray<z.ZodObject<{
251
+ symbol: z.ZodString;
252
+ side: z.ZodEnum<{
253
+ BUY: "BUY";
254
+ SELL: "SELL";
255
+ }>;
256
+ weight: z.ZodNumber;
257
+ }, z.core.$strip>>;
258
+ track: z.ZodEnum<{
259
+ PEAK: "PEAK";
260
+ TROUGH: "TROUGH";
261
+ }>;
262
+ threshold: z.ZodNumber;
263
+ }, z.core.$strip>;
264
+ }, z.core.$strip>, z.ZodObject<{
265
+ type: z.ZodLiteral<"notional">;
266
+ data: z.ZodObject<{
267
+ priceSource: z.ZodEnum<{
268
+ mid: "mid";
269
+ mark: "mark";
270
+ }>;
271
+ track: z.ZodEnum<{
272
+ PEAK: "PEAK";
273
+ TROUGH: "TROUGH";
274
+ }>;
275
+ threshold: z.ZodNumber;
276
+ }, z.core.$strip>;
277
+ }, z.core.$strip>, z.ZodObject<{
278
+ type: z.ZodLiteral<"upnl">;
279
+ data: z.ZodObject<{
280
+ priceSource: z.ZodEnum<{
281
+ mid: "mid";
282
+ mark: "mark";
283
+ }>;
284
+ track: z.ZodEnum<{
285
+ PEAK: "PEAK";
286
+ TROUGH: "TROUGH";
287
+ }>;
288
+ threshold: z.ZodNumber;
289
+ }, z.core.$strip>;
290
+ }, z.core.$strip>, z.ZodObject<{
291
+ type: z.ZodLiteral<"upnl_bps">;
292
+ data: z.ZodObject<{
293
+ priceSource: z.ZodEnum<{
294
+ mid: "mid";
295
+ mark: "mark";
296
+ }>;
297
+ track: z.ZodEnum<{
298
+ PEAK: "PEAK";
299
+ TROUGH: "TROUGH";
300
+ }>;
301
+ threshold: z.ZodNumber;
302
+ }, z.core.$strip>;
303
+ }, z.core.$strip>, z.ZodObject<{
304
+ type: z.ZodLiteral<"ratio_trailing">;
305
+ data: z.ZodObject<{
306
+ priceSource: z.ZodEnum<{
307
+ mid: "mid";
308
+ mark: "mark";
309
+ }>;
310
+ symbol_a: z.ZodString;
311
+ symbol_b: z.ZodString;
312
+ }, z.core.$strip>;
313
+ }, z.core.$strip>, z.ZodObject<{
314
+ type: z.ZodLiteral<"price_trailing">;
315
+ data: z.ZodObject<{
316
+ priceSource: z.ZodEnum<{
317
+ mid: "mid";
318
+ mark: "mark";
319
+ }>;
320
+ symbol: z.ZodString;
321
+ }, z.core.$strip>;
322
+ }, z.core.$strip>, z.ZodObject<{
323
+ type: z.ZodLiteral<"weighted_ratio_trailing">;
324
+ data: z.ZodObject<{
325
+ priceSource: z.ZodEnum<{
326
+ mid: "mid";
327
+ mark: "mark";
328
+ }>;
329
+ basket: z.ZodArray<z.ZodObject<{
330
+ symbol: z.ZodString;
331
+ side: z.ZodEnum<{
332
+ BUY: "BUY";
333
+ SELL: "SELL";
334
+ }>;
335
+ weight: z.ZodNumber;
336
+ }, z.core.$strip>>;
337
+ }, z.core.$strip>;
338
+ }, z.core.$strip>, z.ZodObject<{
339
+ type: z.ZodLiteral<"notional_trailing">;
340
+ data: z.ZodObject<{
341
+ priceSource: z.ZodEnum<{
342
+ mid: "mid";
343
+ mark: "mark";
344
+ }>;
345
+ }, z.core.$strip>;
346
+ }, z.core.$strip>, z.ZodObject<{
347
+ type: z.ZodLiteral<"upnl_trailing">;
348
+ data: z.ZodObject<{
349
+ priceSource: z.ZodEnum<{
350
+ mid: "mid";
351
+ mark: "mark";
352
+ }>;
353
+ }, z.core.$strip>;
354
+ }, z.core.$strip>, z.ZodObject<{
355
+ type: z.ZodLiteral<"upnl_bps_trailing">;
356
+ data: z.ZodObject<{
357
+ priceSource: z.ZodEnum<{
358
+ mid: "mid";
359
+ mark: "mark";
360
+ }>;
361
+ }, z.core.$strip>;
362
+ }, z.core.$strip>, z.ZodObject<{
363
+ type: z.ZodLiteral<"funding_rate">;
364
+ data: z.ZodObject<{
365
+ connector: z.ZodEnum<{
366
+ hyperliquid: "hyperliquid";
367
+ binance: "binance";
368
+ bybit: "bybit";
369
+ okx: "okx";
370
+ lighter: "lighter";
371
+ lighter_rhc: "lighter_rhc";
372
+ }>;
373
+ symbol: z.ZodString;
374
+ track: z.ZodEnum<{
375
+ PEAK: "PEAK";
376
+ TROUGH: "TROUGH";
377
+ }>;
378
+ threshold: z.ZodNumber;
379
+ }, z.core.$strip>;
380
+ }, z.core.$strip>, z.ZodObject<{
381
+ type: z.ZodLiteral<"prediction_market">;
382
+ data: z.ZodObject<{
383
+ source: z.ZodEnum<{
384
+ kalshi: "kalshi";
385
+ polymarket: "polymarket";
386
+ }>;
387
+ marketKey: z.ZodString;
388
+ track: z.ZodEnum<{
389
+ PEAK: "PEAK";
390
+ TROUGH: "TROUGH";
391
+ }>;
392
+ threshold: z.ZodNumber;
393
+ }, z.core.$strip>;
394
+ }, z.core.$strip>, z.ZodObject<{
395
+ type: z.ZodLiteral<"btc_dominance">;
396
+ data: z.ZodObject<{
397
+ source: z.ZodLiteral<"coingecko">;
398
+ track: z.ZodEnum<{
399
+ PEAK: "PEAK";
400
+ TROUGH: "TROUGH";
401
+ }>;
402
+ threshold: z.ZodNumber;
403
+ }, z.core.$strip>;
404
+ }, z.core.$strip>], "type">;
405
+ triggerLevel: z.ZodNullable<z.ZodNumber>;
406
+ timestamp: z.ZodISODateTime;
407
+ legs: z.ZodArray<z.ZodObject<{
408
+ id: z.ZodOptional<z.ZodString>;
409
+ symbol: z.ZodString;
410
+ side: z.ZodEnum<{
411
+ BUY: "BUY";
412
+ SELL: "SELL";
413
+ }>;
414
+ reduceOnly: z.ZodBoolean;
415
+ quantity: z.ZodString;
416
+ price: z.ZodString;
417
+ }, z.core.$strip>>;
418
+ }, z.core.$strip>;
419
+ }, z.core.$strip>, z.ZodObject<{
420
+ type: z.ZodLiteral<"event">;
421
+ channel: z.ZodLiteral<"user_events">;
422
+ topic: z.ZodEnum<{
423
+ "execution.failed": "execution.failed";
424
+ "execution.completed": "execution.completed";
425
+ "position.created": "position.created";
426
+ "position.updated": "position.updated";
427
+ "position.closed": "position.closed";
428
+ "schedule.created": "schedule.created";
429
+ "schedule.completed": "schedule.completed";
430
+ "schedule.failed": "schedule.failed";
431
+ "schedule.cancelled": "schedule.cancelled";
432
+ "ladder.created": "ladder.created";
433
+ "ladder.updated": "ladder.updated";
434
+ "ladder.cancelled": "ladder.cancelled";
435
+ "trigger.created": "trigger.created";
436
+ "trigger.triggered": "trigger.triggered";
437
+ "trigger.cancelled": "trigger.cancelled";
438
+ "trigger.converted": "trigger.converted";
439
+ "rebalance.created": "rebalance.created";
440
+ "rebalance.updated": "rebalance.updated";
441
+ "rebalance.executed": "rebalance.executed";
442
+ "rebalance.paused": "rebalance.paused";
443
+ "rebalance.cancelled": "rebalance.cancelled";
444
+ "notification.created": "notification.created";
445
+ }>;
446
+ data: z.ZodObject<{
447
+ entityId: z.ZodString;
448
+ }, z.core.$strip>;
449
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
450
+ type: z.ZodLiteral<"event">;
451
+ channel: z.ZodLiteral<"vault_events">;
452
+ topic: z.ZodLiteral<"vault.invalidated">;
453
+ data: z.ZodObject<{
454
+ vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
455
+ eventId: z.ZodUUID;
456
+ emittedAt: z.ZodNumber;
457
+ dataset: z.ZodEnum<{
458
+ positions: "positions";
459
+ detail: "detail";
460
+ nav: "nav";
461
+ ledger: "ledger";
462
+ }>;
463
+ }, z.core.$strip>;
464
+ }, z.core.$strip>, z.ZodObject<{
465
+ type: z.ZodLiteral<"event">;
466
+ channel: z.ZodLiteral<"vault_management">;
467
+ topic: z.ZodLiteral<"vault.invalidated">;
468
+ data: z.ZodObject<{
469
+ vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
470
+ eventId: z.ZodUUID;
471
+ emittedAt: z.ZodNumber;
472
+ dataset: z.ZodEnum<{
473
+ orders: "orders";
474
+ schedules: "schedules";
475
+ private_history: "private_history";
476
+ }>;
477
+ }, z.core.$strip>;
478
+ }, z.core.$strip>], "channel">], "topic">;
479
+ export type WebsocketEventFrame = z.output<typeof WebsocketEventFrame>;
480
+ /** Answers an application-level ping with the server time. */
481
+ export declare const WebsocketPongFrame: z.ZodObject<{
482
+ id: z.ZodOptional<z.ZodString>;
483
+ type: z.ZodLiteral<"pong">;
484
+ timestamp: z.ZodISODateTime;
485
+ }, z.core.$strip>;
486
+ export type WebsocketPongFrame = z.output<typeof WebsocketPongFrame>;
487
+ /** Every frame the realtime websocket sends to a client. */
488
+ export declare const WebsocketFrame: z.ZodDiscriminatedUnion<[z.ZodObject<{
489
+ type: z.ZodLiteral<"welcome">;
490
+ connectionId: z.ZodString;
491
+ heartbeatIntervalMs: z.ZodNumber;
492
+ resubscribeRequired: z.ZodLiteral<true>;
493
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
494
+ id: z.ZodOptional<z.ZodString>;
495
+ type: z.ZodLiteral<"ack">;
496
+ method: z.ZodLiteral<"auth">;
497
+ ok: z.ZodLiteral<true>;
498
+ }, z.core.$strip>, z.ZodObject<{
499
+ id: z.ZodOptional<z.ZodString>;
500
+ type: z.ZodLiteral<"ack">;
501
+ method: z.ZodEnum<{
502
+ subscribe: "subscribe";
503
+ unsubscribe: "unsubscribe";
504
+ }>;
505
+ channel: z.ZodEnum<{
506
+ funding: "funding";
507
+ prices: "prices";
508
+ trades: "trades";
509
+ trigger_events: "trigger_events";
510
+ user_events: "user_events";
511
+ vault_events: "vault_events";
512
+ vault_management: "vault_management";
513
+ }>;
514
+ ok: z.ZodLiteral<true>;
515
+ }, z.core.$strip>], "method">, z.ZodDiscriminatedUnion<[z.ZodObject<{
516
+ id: z.ZodOptional<z.ZodString>;
517
+ type: z.ZodLiteral<"error">;
518
+ code: z.ZodEnum<{
519
+ AUTH_EXPIRED: "AUTH_EXPIRED";
520
+ CAPACITY_UNAVAILABLE: "CAPACITY_UNAVAILABLE";
521
+ INTERNAL_ERROR: "INTERNAL_ERROR";
522
+ INVALID_FRAME: "INVALID_FRAME";
523
+ INVALID_JSON: "INVALID_JSON";
524
+ INVALID_MESSAGE: "INVALID_MESSAGE";
525
+ INVALID_SUBSCRIPTION: "INVALID_SUBSCRIPTION";
526
+ RATE_LIMITED: "RATE_LIMITED";
527
+ TOO_MANY_SUBSCRIPTIONS: "TOO_MANY_SUBSCRIPTIONS";
528
+ UNAUTHENTICATED: "UNAUTHENTICATED";
529
+ }>;
530
+ message: z.ZodString;
531
+ }, z.core.$strip>, z.ZodObject<{
532
+ id: z.ZodOptional<z.ZodString>;
533
+ type: z.ZodLiteral<"error">;
534
+ code: z.ZodEnum<{
535
+ FORBIDDEN: "FORBIDDEN";
536
+ SUBSCRIPTION_REVOKED: "SUBSCRIPTION_REVOKED";
537
+ }>;
538
+ message: z.ZodString;
539
+ vaults: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>>;
540
+ }, z.core.$strip>], "code">, z.ZodDiscriminatedUnion<[z.ZodObject<{
541
+ type: z.ZodLiteral<"event">;
542
+ channel: z.ZodLiteral<"prices">;
543
+ topic: z.ZodLiteral<"price.updated">;
544
+ data: z.ZodObject<{
545
+ connector: z.ZodEnum<{
546
+ hyperliquid: "hyperliquid";
547
+ binance: "binance";
548
+ bybit: "bybit";
549
+ okx: "okx";
550
+ lighter: "lighter";
551
+ lighter_rhc: "lighter_rhc";
552
+ }>;
553
+ source: z.ZodEnum<{
554
+ mid: "mid";
555
+ mark: "mark";
556
+ }>;
557
+ prices: z.ZodRecord<z.ZodString, z.ZodObject<{
558
+ id: z.ZodString;
559
+ p: z.ZodString;
560
+ bid: z.ZodNullable<z.ZodString>;
561
+ ask: z.ZodNullable<z.ZodString>;
562
+ t: z.ZodNumber;
563
+ }, z.core.$strip>>;
564
+ }, z.core.$strip>;
565
+ }, z.core.$strip>, z.ZodObject<{
566
+ type: z.ZodLiteral<"event">;
567
+ channel: z.ZodLiteral<"funding">;
568
+ topic: z.ZodLiteral<"funding.updated">;
569
+ data: z.ZodObject<{
570
+ connector: z.ZodEnum<{
571
+ hyperliquid: "hyperliquid";
572
+ binance: "binance";
573
+ bybit: "bybit";
574
+ okx: "okx";
575
+ lighter: "lighter";
576
+ lighter_rhc: "lighter_rhc";
577
+ }>;
578
+ funding: z.ZodRecord<z.ZodString, z.ZodObject<{
579
+ id: z.ZodString;
580
+ r: z.ZodString;
581
+ t: z.ZodNumber;
582
+ nft: z.ZodNumber;
583
+ }, z.core.$strip>>;
584
+ }, z.core.$strip>;
585
+ }, z.core.$strip>, z.ZodObject<{
586
+ type: z.ZodLiteral<"event">;
587
+ channel: z.ZodLiteral<"trades">;
588
+ topic: z.ZodLiteral<"trade.executed">;
589
+ data: z.ZodObject<{
590
+ connector: z.ZodEnum<{
591
+ hyperliquid: "hyperliquid";
592
+ binance: "binance";
593
+ bybit: "bybit";
594
+ okx: "okx";
595
+ lighter: "lighter";
596
+ lighter_rhc: "lighter_rhc";
597
+ }>;
598
+ source: z.ZodEnum<{
599
+ DIRECT: "DIRECT";
600
+ TRIGGER: "TRIGGER";
601
+ TWAP: "TWAP";
602
+ }>;
603
+ intent: z.ZodEnum<{
604
+ OPEN: "OPEN";
605
+ ADJUST: "ADJUST";
606
+ CLOSE: "CLOSE";
607
+ REVERSE: "REVERSE";
608
+ }>;
609
+ orderType: z.ZodEnum<{
610
+ MARKET: "MARKET";
611
+ }>;
612
+ timestamp: z.ZodISODateTime;
613
+ clientId: z.ZodOptional<z.ZodString>;
614
+ legs: z.ZodArray<z.ZodObject<{
615
+ id: z.ZodOptional<z.ZodString>;
616
+ symbol: z.ZodString;
617
+ side: z.ZodEnum<{
618
+ BUY: "BUY";
619
+ SELL: "SELL";
620
+ }>;
621
+ reduceOnly: z.ZodBoolean;
622
+ quantity: z.ZodString;
623
+ price: z.ZodString;
624
+ }, z.core.$strip>>;
625
+ }, z.core.$strip>;
626
+ }, z.core.$strip>, z.ZodObject<{
627
+ type: z.ZodLiteral<"event">;
628
+ channel: z.ZodLiteral<"trigger_events">;
629
+ topic: z.ZodLiteral<"trigger.triggered.public">;
630
+ data: z.ZodObject<{
631
+ connector: z.ZodEnum<{
632
+ hyperliquid: "hyperliquid";
633
+ binance: "binance";
634
+ bybit: "bybit";
635
+ okx: "okx";
636
+ lighter: "lighter";
637
+ lighter_rhc: "lighter_rhc";
638
+ }>;
639
+ accountId: z.ZodString;
640
+ triggerId: z.ZodString;
641
+ bracketType: z.ZodEnum<{
642
+ STOP_LOSS: "STOP_LOSS";
643
+ TAKE_PROFIT: "TAKE_PROFIT";
644
+ }>;
645
+ semanticBracketType: z.ZodEnum<{
646
+ STOP_LOSS: "STOP_LOSS";
647
+ TAKE_PROFIT: "TAKE_PROFIT";
648
+ }>;
649
+ intent: z.ZodEnum<{
650
+ OPEN: "OPEN";
651
+ ADJUST: "ADJUST";
652
+ CLOSE: "CLOSE";
653
+ }>;
654
+ condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
655
+ type: z.ZodLiteral<"ratio">;
656
+ data: z.ZodObject<{
657
+ priceSource: z.ZodEnum<{
658
+ mid: "mid";
659
+ mark: "mark";
660
+ }>;
661
+ symbol_a: z.ZodString;
662
+ symbol_b: z.ZodString;
663
+ track: z.ZodEnum<{
664
+ PEAK: "PEAK";
665
+ TROUGH: "TROUGH";
666
+ }>;
667
+ threshold: z.ZodNumber;
668
+ }, z.core.$strip>;
669
+ }, z.core.$strip>, z.ZodObject<{
670
+ type: z.ZodLiteral<"price">;
671
+ data: z.ZodObject<{
672
+ priceSource: z.ZodEnum<{
673
+ mid: "mid";
674
+ mark: "mark";
675
+ }>;
676
+ symbol: z.ZodString;
677
+ track: z.ZodEnum<{
678
+ PEAK: "PEAK";
679
+ TROUGH: "TROUGH";
680
+ }>;
681
+ threshold: z.ZodNumber;
682
+ }, z.core.$strip>;
683
+ }, z.core.$strip>, z.ZodObject<{
684
+ type: z.ZodLiteral<"weighted_ratio">;
685
+ data: z.ZodObject<{
686
+ priceSource: z.ZodEnum<{
687
+ mid: "mid";
688
+ mark: "mark";
689
+ }>;
690
+ basket: z.ZodArray<z.ZodObject<{
691
+ symbol: z.ZodString;
692
+ side: z.ZodEnum<{
693
+ BUY: "BUY";
694
+ SELL: "SELL";
695
+ }>;
696
+ weight: z.ZodNumber;
697
+ }, z.core.$strip>>;
698
+ track: z.ZodEnum<{
699
+ PEAK: "PEAK";
700
+ TROUGH: "TROUGH";
701
+ }>;
702
+ threshold: z.ZodNumber;
703
+ }, z.core.$strip>;
704
+ }, z.core.$strip>, z.ZodObject<{
705
+ type: z.ZodLiteral<"notional">;
706
+ data: z.ZodObject<{
707
+ priceSource: z.ZodEnum<{
708
+ mid: "mid";
709
+ mark: "mark";
710
+ }>;
711
+ track: z.ZodEnum<{
712
+ PEAK: "PEAK";
713
+ TROUGH: "TROUGH";
714
+ }>;
715
+ threshold: z.ZodNumber;
716
+ }, z.core.$strip>;
717
+ }, z.core.$strip>, z.ZodObject<{
718
+ type: z.ZodLiteral<"upnl">;
719
+ data: z.ZodObject<{
720
+ priceSource: z.ZodEnum<{
721
+ mid: "mid";
722
+ mark: "mark";
723
+ }>;
724
+ track: z.ZodEnum<{
725
+ PEAK: "PEAK";
726
+ TROUGH: "TROUGH";
727
+ }>;
728
+ threshold: z.ZodNumber;
729
+ }, z.core.$strip>;
730
+ }, z.core.$strip>, z.ZodObject<{
731
+ type: z.ZodLiteral<"upnl_bps">;
732
+ data: z.ZodObject<{
733
+ priceSource: z.ZodEnum<{
734
+ mid: "mid";
735
+ mark: "mark";
736
+ }>;
737
+ track: z.ZodEnum<{
738
+ PEAK: "PEAK";
739
+ TROUGH: "TROUGH";
740
+ }>;
741
+ threshold: z.ZodNumber;
742
+ }, z.core.$strip>;
743
+ }, z.core.$strip>, z.ZodObject<{
744
+ type: z.ZodLiteral<"ratio_trailing">;
745
+ data: z.ZodObject<{
746
+ priceSource: z.ZodEnum<{
747
+ mid: "mid";
748
+ mark: "mark";
749
+ }>;
750
+ symbol_a: z.ZodString;
751
+ symbol_b: z.ZodString;
752
+ }, z.core.$strip>;
753
+ }, z.core.$strip>, z.ZodObject<{
754
+ type: z.ZodLiteral<"price_trailing">;
755
+ data: z.ZodObject<{
756
+ priceSource: z.ZodEnum<{
757
+ mid: "mid";
758
+ mark: "mark";
759
+ }>;
760
+ symbol: z.ZodString;
761
+ }, z.core.$strip>;
762
+ }, z.core.$strip>, z.ZodObject<{
763
+ type: z.ZodLiteral<"weighted_ratio_trailing">;
764
+ data: z.ZodObject<{
765
+ priceSource: z.ZodEnum<{
766
+ mid: "mid";
767
+ mark: "mark";
768
+ }>;
769
+ basket: z.ZodArray<z.ZodObject<{
770
+ symbol: z.ZodString;
771
+ side: z.ZodEnum<{
772
+ BUY: "BUY";
773
+ SELL: "SELL";
774
+ }>;
775
+ weight: z.ZodNumber;
776
+ }, z.core.$strip>>;
777
+ }, z.core.$strip>;
778
+ }, z.core.$strip>, z.ZodObject<{
779
+ type: z.ZodLiteral<"notional_trailing">;
780
+ data: z.ZodObject<{
781
+ priceSource: z.ZodEnum<{
782
+ mid: "mid";
783
+ mark: "mark";
784
+ }>;
785
+ }, z.core.$strip>;
786
+ }, z.core.$strip>, z.ZodObject<{
787
+ type: z.ZodLiteral<"upnl_trailing">;
788
+ data: z.ZodObject<{
789
+ priceSource: z.ZodEnum<{
790
+ mid: "mid";
791
+ mark: "mark";
792
+ }>;
793
+ }, z.core.$strip>;
794
+ }, z.core.$strip>, z.ZodObject<{
795
+ type: z.ZodLiteral<"upnl_bps_trailing">;
796
+ data: z.ZodObject<{
797
+ priceSource: z.ZodEnum<{
798
+ mid: "mid";
799
+ mark: "mark";
800
+ }>;
801
+ }, z.core.$strip>;
802
+ }, z.core.$strip>, z.ZodObject<{
803
+ type: z.ZodLiteral<"funding_rate">;
804
+ data: z.ZodObject<{
805
+ connector: z.ZodEnum<{
806
+ hyperliquid: "hyperliquid";
807
+ binance: "binance";
808
+ bybit: "bybit";
809
+ okx: "okx";
810
+ lighter: "lighter";
811
+ lighter_rhc: "lighter_rhc";
812
+ }>;
813
+ symbol: z.ZodString;
814
+ track: z.ZodEnum<{
815
+ PEAK: "PEAK";
816
+ TROUGH: "TROUGH";
817
+ }>;
818
+ threshold: z.ZodNumber;
819
+ }, z.core.$strip>;
820
+ }, z.core.$strip>, z.ZodObject<{
821
+ type: z.ZodLiteral<"prediction_market">;
822
+ data: z.ZodObject<{
823
+ source: z.ZodEnum<{
824
+ kalshi: "kalshi";
825
+ polymarket: "polymarket";
826
+ }>;
827
+ marketKey: z.ZodString;
828
+ track: z.ZodEnum<{
829
+ PEAK: "PEAK";
830
+ TROUGH: "TROUGH";
831
+ }>;
832
+ threshold: z.ZodNumber;
833
+ }, z.core.$strip>;
834
+ }, z.core.$strip>, z.ZodObject<{
835
+ type: z.ZodLiteral<"btc_dominance">;
836
+ data: z.ZodObject<{
837
+ source: z.ZodLiteral<"coingecko">;
838
+ track: z.ZodEnum<{
839
+ PEAK: "PEAK";
840
+ TROUGH: "TROUGH";
841
+ }>;
842
+ threshold: z.ZodNumber;
843
+ }, z.core.$strip>;
844
+ }, z.core.$strip>], "type">;
845
+ triggerLevel: z.ZodNullable<z.ZodNumber>;
846
+ timestamp: z.ZodISODateTime;
847
+ legs: z.ZodArray<z.ZodObject<{
848
+ id: z.ZodOptional<z.ZodString>;
849
+ symbol: z.ZodString;
850
+ side: z.ZodEnum<{
851
+ BUY: "BUY";
852
+ SELL: "SELL";
853
+ }>;
854
+ reduceOnly: z.ZodBoolean;
855
+ quantity: z.ZodString;
856
+ price: z.ZodString;
857
+ }, z.core.$strip>>;
858
+ }, z.core.$strip>;
859
+ }, z.core.$strip>, z.ZodObject<{
860
+ type: z.ZodLiteral<"event">;
861
+ channel: z.ZodLiteral<"user_events">;
862
+ topic: z.ZodEnum<{
863
+ "execution.failed": "execution.failed";
864
+ "execution.completed": "execution.completed";
865
+ "position.created": "position.created";
866
+ "position.updated": "position.updated";
867
+ "position.closed": "position.closed";
868
+ "schedule.created": "schedule.created";
869
+ "schedule.completed": "schedule.completed";
870
+ "schedule.failed": "schedule.failed";
871
+ "schedule.cancelled": "schedule.cancelled";
872
+ "ladder.created": "ladder.created";
873
+ "ladder.updated": "ladder.updated";
874
+ "ladder.cancelled": "ladder.cancelled";
875
+ "trigger.created": "trigger.created";
876
+ "trigger.triggered": "trigger.triggered";
877
+ "trigger.cancelled": "trigger.cancelled";
878
+ "trigger.converted": "trigger.converted";
879
+ "rebalance.created": "rebalance.created";
880
+ "rebalance.updated": "rebalance.updated";
881
+ "rebalance.executed": "rebalance.executed";
882
+ "rebalance.paused": "rebalance.paused";
883
+ "rebalance.cancelled": "rebalance.cancelled";
884
+ "notification.created": "notification.created";
885
+ }>;
886
+ data: z.ZodObject<{
887
+ entityId: z.ZodString;
888
+ }, z.core.$strip>;
889
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
890
+ type: z.ZodLiteral<"event">;
891
+ channel: z.ZodLiteral<"vault_events">;
892
+ topic: z.ZodLiteral<"vault.invalidated">;
893
+ data: z.ZodObject<{
894
+ vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
895
+ eventId: z.ZodUUID;
896
+ emittedAt: z.ZodNumber;
897
+ dataset: z.ZodEnum<{
898
+ positions: "positions";
899
+ detail: "detail";
900
+ nav: "nav";
901
+ ledger: "ledger";
902
+ }>;
903
+ }, z.core.$strip>;
904
+ }, z.core.$strip>, z.ZodObject<{
905
+ type: z.ZodLiteral<"event">;
906
+ channel: z.ZodLiteral<"vault_management">;
907
+ topic: z.ZodLiteral<"vault.invalidated">;
908
+ data: z.ZodObject<{
909
+ vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
910
+ eventId: z.ZodUUID;
911
+ emittedAt: z.ZodNumber;
912
+ dataset: z.ZodEnum<{
913
+ orders: "orders";
914
+ schedules: "schedules";
915
+ private_history: "private_history";
916
+ }>;
917
+ }, z.core.$strip>;
918
+ }, z.core.$strip>], "channel">], "topic">, z.ZodObject<{
919
+ id: z.ZodOptional<z.ZodString>;
920
+ type: z.ZodLiteral<"pong">;
921
+ timestamp: z.ZodISODateTime;
922
+ }, z.core.$strip>], "type">;
923
+ export type WebsocketFrame = z.output<typeof WebsocketFrame>;