@pear-protocol/types 0.1.0 → 1.1.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.
Files changed (49) hide show
  1. package/dist/auth/api-keys.d.ts +67 -0
  2. package/dist/auth/api-keys.js +35 -0
  3. package/dist/auth/index.d.ts +1 -0
  4. package/dist/auth/index.js +1 -0
  5. package/dist/auth/payloads.d.ts +0 -4
  6. package/dist/auth/payloads.js +2 -5
  7. package/dist/bundle.d.ts +2 -0
  8. package/dist/bundle.js +2 -0
  9. package/dist/common/client-id.d.ts +2 -0
  10. package/dist/common/client-id.js +5 -0
  11. package/dist/common/index.d.ts +1 -0
  12. package/dist/common/index.js +1 -0
  13. package/dist/notification/entities.d.ts +108 -0
  14. package/dist/notification/entities.js +61 -0
  15. package/dist/notification/index.d.ts +4 -0
  16. package/dist/notification/index.js +4 -0
  17. package/dist/notification/payloads.d.ts +20 -0
  18. package/dist/notification/payloads.js +9 -0
  19. package/dist/notification/queries.d.ts +13 -0
  20. package/dist/notification/queries.js +25 -0
  21. package/dist/notification/responses.d.ts +67 -0
  22. package/dist/notification/responses.js +20 -0
  23. package/dist/rebalance/payloads.d.ts +1 -0
  24. package/dist/rebalance/payloads.js +6 -1
  25. package/dist/schedule/payloads.d.ts +4 -0
  26. package/dist/schedule/payloads.js +11 -2
  27. package/dist/trade/payloads.d.ts +8 -0
  28. package/dist/trade/payloads.js +21 -4
  29. package/dist/trigger/entities/conditions.d.ts +170 -0
  30. package/dist/trigger/entities/conditions.js +43 -3
  31. package/dist/trigger/entities/index.d.ts +369 -0
  32. package/dist/trigger/index.d.ts +1 -0
  33. package/dist/trigger/index.js +1 -0
  34. package/dist/trigger/oracle.d.ts +31 -0
  35. package/dist/trigger/oracle.js +15 -0
  36. package/dist/trigger/payloads/conditions.d.ts +50 -0
  37. package/dist/trigger/payloads/conditions.js +35 -1
  38. package/dist/trigger/payloads/index.d.ts +90 -0
  39. package/dist/trigger/payloads/index.js +16 -3
  40. package/dist/trigger/responses.d.ts +246 -0
  41. package/dist/triggers/entities.d.ts +34 -0
  42. package/dist/triggers/entities.js +21 -0
  43. package/dist/triggers/index.d.ts +3 -0
  44. package/dist/triggers/index.js +3 -0
  45. package/dist/triggers/queries.d.ts +8 -0
  46. package/dist/triggers/queries.js +10 -0
  47. package/dist/triggers/responses.d.ts +26 -0
  48. package/dist/triggers/responses.js +9 -0
  49. package/package.json +1 -1
@@ -60,6 +60,47 @@ export declare const CreateTriggerMarketOpen: z.ZodObject<{
60
60
  }>;
61
61
  threshold: z.ZodNumber;
62
62
  }, z.core.$strip>;
63
+ }, z.core.$strip>, z.ZodObject<{
64
+ type: z.ZodLiteral<"funding_rate">;
65
+ data: z.ZodObject<{
66
+ connector: z.ZodEnum<{
67
+ hyperliquid: "hyperliquid";
68
+ binance: "binance";
69
+ bybit: "bybit";
70
+ okx: "okx";
71
+ lighter: "lighter";
72
+ }>;
73
+ symbol: z.ZodString;
74
+ track: z.ZodEnum<{
75
+ PEAK: "PEAK";
76
+ TROUGH: "TROUGH";
77
+ }>;
78
+ threshold: z.ZodNumber;
79
+ }, z.core.$strip>;
80
+ }, z.core.$strip>, z.ZodObject<{
81
+ type: z.ZodLiteral<"prediction_market">;
82
+ data: z.ZodObject<{
83
+ source: z.ZodEnum<{
84
+ kalshi: "kalshi";
85
+ polymarket: "polymarket";
86
+ }>;
87
+ marketKey: z.ZodString;
88
+ track: z.ZodEnum<{
89
+ PEAK: "PEAK";
90
+ TROUGH: "TROUGH";
91
+ }>;
92
+ threshold: z.ZodNumber;
93
+ }, z.core.$strip>;
94
+ }, z.core.$strip>, z.ZodObject<{
95
+ type: z.ZodLiteral<"btc_dominance">;
96
+ data: z.ZodObject<{
97
+ source: z.ZodLiteral<"coingecko">;
98
+ track: z.ZodEnum<{
99
+ PEAK: "PEAK";
100
+ TROUGH: "TROUGH";
101
+ }>;
102
+ threshold: z.ZodNumber;
103
+ }, z.core.$strip>;
63
104
  }, z.core.$strip>], "type">;
64
105
  payload: z.ZodObject<{
65
106
  type: z.ZodLiteral<"MARKET">;
@@ -87,6 +128,7 @@ export declare const CreateTriggerMarketOpen: z.ZodObject<{
87
128
  amount: z.ZodString;
88
129
  }, z.core.$strip>>;
89
130
  }, z.core.$strip>;
131
+ clientId: z.ZodOptional<z.ZodString>;
90
132
  }, z.core.$strip>;
91
133
  export declare const CreateTriggerMarketCloseStatic: z.ZodObject<{
92
134
  intent: z.ZodLiteral<"CLOSE">;
@@ -163,6 +205,7 @@ export declare const CreateTriggerMarketCloseStatic: z.ZodObject<{
163
205
  threshold: z.ZodNumber;
164
206
  }, z.core.$strip>;
165
207
  }, z.core.$strip>], "type">;
208
+ clientId: z.ZodOptional<z.ZodString>;
166
209
  }, z.core.$strip>;
167
210
  export declare const CreateTriggerMarketCloseTrailing: z.ZodObject<{
168
211
  intent: z.ZodLiteral<"CLOSE">;
@@ -236,6 +279,7 @@ export declare const CreateTriggerMarketCloseTrailing: z.ZodObject<{
236
279
  deltaValue: z.ZodNumber;
237
280
  activationValue: z.ZodOptional<z.ZodNumber>;
238
281
  }, z.core.$strip>;
282
+ clientId: z.ZodOptional<z.ZodString>;
239
283
  }, z.core.$strip>;
240
284
  export declare const CreateTriggerMarketClose: z.ZodUnion<readonly [z.ZodObject<{
241
285
  intent: z.ZodLiteral<"CLOSE">;
@@ -312,6 +356,7 @@ export declare const CreateTriggerMarketClose: z.ZodUnion<readonly [z.ZodObject<
312
356
  threshold: z.ZodNumber;
313
357
  }, z.core.$strip>;
314
358
  }, z.core.$strip>], "type">;
359
+ clientId: z.ZodOptional<z.ZodString>;
315
360
  }, z.core.$strip>, z.ZodObject<{
316
361
  intent: z.ZodLiteral<"CLOSE">;
317
362
  type: z.ZodLiteral<"MARKET">;
@@ -384,6 +429,7 @@ export declare const CreateTriggerMarketClose: z.ZodUnion<readonly [z.ZodObject<
384
429
  deltaValue: z.ZodNumber;
385
430
  activationValue: z.ZodOptional<z.ZodNumber>;
386
431
  }, z.core.$strip>;
432
+ clientId: z.ZodOptional<z.ZodString>;
387
433
  }, z.core.$strip>]>;
388
434
  export declare const AttachTriggerMarketCloseStatic: z.ZodObject<{
389
435
  intent: z.ZodLiteral<"CLOSE">;
@@ -585,6 +631,47 @@ export declare const CreateTriggerOpen: z.ZodDiscriminatedUnion<[z.ZodObject<{
585
631
  }>;
586
632
  threshold: z.ZodNumber;
587
633
  }, z.core.$strip>;
634
+ }, z.core.$strip>, z.ZodObject<{
635
+ type: z.ZodLiteral<"funding_rate">;
636
+ data: z.ZodObject<{
637
+ connector: z.ZodEnum<{
638
+ hyperliquid: "hyperliquid";
639
+ binance: "binance";
640
+ bybit: "bybit";
641
+ okx: "okx";
642
+ lighter: "lighter";
643
+ }>;
644
+ symbol: z.ZodString;
645
+ track: z.ZodEnum<{
646
+ PEAK: "PEAK";
647
+ TROUGH: "TROUGH";
648
+ }>;
649
+ threshold: z.ZodNumber;
650
+ }, z.core.$strip>;
651
+ }, z.core.$strip>, z.ZodObject<{
652
+ type: z.ZodLiteral<"prediction_market">;
653
+ data: z.ZodObject<{
654
+ source: z.ZodEnum<{
655
+ kalshi: "kalshi";
656
+ polymarket: "polymarket";
657
+ }>;
658
+ marketKey: z.ZodString;
659
+ track: z.ZodEnum<{
660
+ PEAK: "PEAK";
661
+ TROUGH: "TROUGH";
662
+ }>;
663
+ threshold: z.ZodNumber;
664
+ }, z.core.$strip>;
665
+ }, z.core.$strip>, z.ZodObject<{
666
+ type: z.ZodLiteral<"btc_dominance">;
667
+ data: z.ZodObject<{
668
+ source: z.ZodLiteral<"coingecko">;
669
+ track: z.ZodEnum<{
670
+ PEAK: "PEAK";
671
+ TROUGH: "TROUGH";
672
+ }>;
673
+ threshold: z.ZodNumber;
674
+ }, z.core.$strip>;
588
675
  }, z.core.$strip>], "type">;
589
676
  payload: z.ZodObject<{
590
677
  type: z.ZodLiteral<"MARKET">;
@@ -612,6 +699,7 @@ export declare const CreateTriggerOpen: z.ZodDiscriminatedUnion<[z.ZodObject<{
612
699
  amount: z.ZodString;
613
700
  }, z.core.$strip>>;
614
701
  }, z.core.$strip>;
702
+ clientId: z.ZodOptional<z.ZodString>;
615
703
  }, z.core.$strip>], "type">;
616
704
  export declare const CreateTriggerClose: z.ZodUnion<readonly [z.ZodObject<{
617
705
  intent: z.ZodLiteral<"CLOSE">;
@@ -688,6 +776,7 @@ export declare const CreateTriggerClose: z.ZodUnion<readonly [z.ZodObject<{
688
776
  threshold: z.ZodNumber;
689
777
  }, z.core.$strip>;
690
778
  }, z.core.$strip>], "type">;
779
+ clientId: z.ZodOptional<z.ZodString>;
691
780
  }, z.core.$strip>, z.ZodObject<{
692
781
  intent: z.ZodLiteral<"CLOSE">;
693
782
  type: z.ZodLiteral<"MARKET">;
@@ -760,6 +849,7 @@ export declare const CreateTriggerClose: z.ZodUnion<readonly [z.ZodObject<{
760
849
  deltaValue: z.ZodNumber;
761
850
  activationValue: z.ZodOptional<z.ZodNumber>;
762
851
  }, z.core.$strip>;
852
+ clientId: z.ZodOptional<z.ZodString>;
763
853
  }, z.core.$strip>]>;
764
854
  export type CreateTriggerMarketOpen = z.output<typeof CreateTriggerMarketOpen>;
765
855
  export type CreateTriggerMarketCloseStatic = z.output<typeof CreateTriggerMarketCloseStatic>;
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { ClientIdCode } from '../../common/client-id';
2
3
  import { RefineMinimumOneSymbol, RefineUniqueSymbols } from '../../common/refinement';
3
4
  import { TradeLegPostOnly } from '../../common/trade-legs';
4
5
  import { TrailingMode, BracketType } from '../common';
@@ -18,21 +19,33 @@ const CreateTriggerMarketOpen = z.object({
18
19
  payload: z.object({
19
20
  type: z.literal("MARKET"),
20
21
  legs: z.tuple([TradeLegPostOnly]).rest(TradeLegPostOnly).superRefine(RefineMinimumOneSymbol).superRefine(RefineUniqueSymbols).describe("Array of legs to make up the exposure")
21
- })
22
+ }),
23
+ /**
24
+ * Attribution route code (client_ids.code)
25
+ */
26
+ clientId: ClientIdCode
22
27
  });
23
28
  const CreateTriggerMarketCloseStatic = z.object({
24
29
  intent: z.literal("CLOSE"),
25
30
  type: z.literal("MARKET"),
26
31
  positionId: z.uuid(),
27
32
  bracketType: BracketType,
28
- condition: CreateTriggerConditionCloseStatic
33
+ condition: CreateTriggerConditionCloseStatic,
34
+ /**
35
+ * Attribution route code (client_ids.code)
36
+ */
37
+ clientId: ClientIdCode
29
38
  }).superRefine(RefineStaticLogicalRules);
30
39
  const CreateTriggerMarketCloseTrailing = z.object({
31
40
  intent: z.literal("CLOSE"),
32
41
  type: z.literal("MARKET"),
33
42
  positionId: z.uuid(),
34
43
  condition: CreateTriggerConditionCloseTrailing,
35
- trailing: TrailingConfig
44
+ trailing: TrailingConfig,
45
+ /**
46
+ * Attribution route code (client_ids.code)
47
+ */
48
+ clientId: ClientIdCode
36
49
  }).superRefine(RefineTrailingLogicalRules);
37
50
  const CreateTriggerMarketClose = z.union([CreateTriggerMarketCloseStatic, CreateTriggerMarketCloseTrailing]);
38
51
  const AttachTriggerMarketCloseStatic = z.object({
@@ -120,6 +120,47 @@ export declare const TriggerListResponse: z.ZodObject<{
120
120
  }>;
121
121
  threshold: z.ZodNumber;
122
122
  }, z.core.$strip>;
123
+ }, z.core.$strip>, z.ZodObject<{
124
+ type: z.ZodLiteral<"funding_rate">;
125
+ data: z.ZodObject<{
126
+ connector: z.ZodEnum<{
127
+ hyperliquid: "hyperliquid";
128
+ binance: "binance";
129
+ bybit: "bybit";
130
+ okx: "okx";
131
+ lighter: "lighter";
132
+ }>;
133
+ symbol: z.ZodString;
134
+ track: z.ZodEnum<{
135
+ PEAK: "PEAK";
136
+ TROUGH: "TROUGH";
137
+ }>;
138
+ threshold: z.ZodNumber;
139
+ }, z.core.$strip>;
140
+ }, z.core.$strip>, z.ZodObject<{
141
+ type: z.ZodLiteral<"prediction_market">;
142
+ data: z.ZodObject<{
143
+ source: z.ZodEnum<{
144
+ kalshi: "kalshi";
145
+ polymarket: "polymarket";
146
+ }>;
147
+ marketKey: z.ZodString;
148
+ track: z.ZodEnum<{
149
+ PEAK: "PEAK";
150
+ TROUGH: "TROUGH";
151
+ }>;
152
+ threshold: z.ZodNumber;
153
+ }, z.core.$strip>;
154
+ }, z.core.$strip>, z.ZodObject<{
155
+ type: z.ZodLiteral<"btc_dominance">;
156
+ data: z.ZodObject<{
157
+ source: z.ZodLiteral<"coingecko">;
158
+ track: z.ZodEnum<{
159
+ PEAK: "PEAK";
160
+ TROUGH: "TROUGH";
161
+ }>;
162
+ threshold: z.ZodNumber;
163
+ }, z.core.$strip>;
123
164
  }, z.core.$strip>], "type">;
124
165
  context: z.ZodObject<{
125
166
  type: z.ZodLiteral<"MARKET">;
@@ -304,6 +345,47 @@ export declare const TriggerListResponse: z.ZodObject<{
304
345
  }>;
305
346
  threshold: z.ZodNumber;
306
347
  }, z.core.$strip>;
348
+ }, z.core.$strip>, z.ZodObject<{
349
+ type: z.ZodLiteral<"funding_rate">;
350
+ data: z.ZodObject<{
351
+ connector: z.ZodEnum<{
352
+ hyperliquid: "hyperliquid";
353
+ binance: "binance";
354
+ bybit: "bybit";
355
+ okx: "okx";
356
+ lighter: "lighter";
357
+ }>;
358
+ symbol: z.ZodString;
359
+ track: z.ZodEnum<{
360
+ PEAK: "PEAK";
361
+ TROUGH: "TROUGH";
362
+ }>;
363
+ threshold: z.ZodNumber;
364
+ }, z.core.$strip>;
365
+ }, z.core.$strip>, z.ZodObject<{
366
+ type: z.ZodLiteral<"prediction_market">;
367
+ data: z.ZodObject<{
368
+ source: z.ZodEnum<{
369
+ kalshi: "kalshi";
370
+ polymarket: "polymarket";
371
+ }>;
372
+ marketKey: z.ZodString;
373
+ track: z.ZodEnum<{
374
+ PEAK: "PEAK";
375
+ TROUGH: "TROUGH";
376
+ }>;
377
+ threshold: z.ZodNumber;
378
+ }, z.core.$strip>;
379
+ }, z.core.$strip>, z.ZodObject<{
380
+ type: z.ZodLiteral<"btc_dominance">;
381
+ data: z.ZodObject<{
382
+ source: z.ZodLiteral<"coingecko">;
383
+ track: z.ZodEnum<{
384
+ PEAK: "PEAK";
385
+ TROUGH: "TROUGH";
386
+ }>;
387
+ threshold: z.ZodNumber;
388
+ }, z.core.$strip>;
307
389
  }, z.core.$strip>], "type">;
308
390
  context: z.ZodObject<{
309
391
  type: z.ZodLiteral<"MARKET">;
@@ -564,6 +646,47 @@ export declare const TriggerListResponse: z.ZodObject<{
564
646
  mark: "mark";
565
647
  }>;
566
648
  }, z.core.$strip>;
649
+ }, z.core.$strip>, z.ZodObject<{
650
+ type: z.ZodLiteral<"funding_rate">;
651
+ data: z.ZodObject<{
652
+ connector: z.ZodEnum<{
653
+ hyperliquid: "hyperliquid";
654
+ binance: "binance";
655
+ bybit: "bybit";
656
+ okx: "okx";
657
+ lighter: "lighter";
658
+ }>;
659
+ symbol: z.ZodString;
660
+ track: z.ZodEnum<{
661
+ PEAK: "PEAK";
662
+ TROUGH: "TROUGH";
663
+ }>;
664
+ threshold: z.ZodNumber;
665
+ }, z.core.$strip>;
666
+ }, z.core.$strip>, z.ZodObject<{
667
+ type: z.ZodLiteral<"prediction_market">;
668
+ data: z.ZodObject<{
669
+ source: z.ZodEnum<{
670
+ kalshi: "kalshi";
671
+ polymarket: "polymarket";
672
+ }>;
673
+ marketKey: z.ZodString;
674
+ track: z.ZodEnum<{
675
+ PEAK: "PEAK";
676
+ TROUGH: "TROUGH";
677
+ }>;
678
+ threshold: z.ZodNumber;
679
+ }, z.core.$strip>;
680
+ }, z.core.$strip>, z.ZodObject<{
681
+ type: z.ZodLiteral<"btc_dominance">;
682
+ data: z.ZodObject<{
683
+ source: z.ZodLiteral<"coingecko">;
684
+ track: z.ZodEnum<{
685
+ PEAK: "PEAK";
686
+ TROUGH: "TROUGH";
687
+ }>;
688
+ threshold: z.ZodNumber;
689
+ }, z.core.$strip>;
567
690
  }, z.core.$strip>], "type">;
568
691
  context: z.ZodObject<{
569
692
  type: z.ZodLiteral<"MARKET">;
@@ -705,6 +828,47 @@ export declare const CreateTriggerResponse: z.ZodObject<{
705
828
  }>;
706
829
  threshold: z.ZodNumber;
707
830
  }, z.core.$strip>;
831
+ }, z.core.$strip>, z.ZodObject<{
832
+ type: z.ZodLiteral<"funding_rate">;
833
+ data: z.ZodObject<{
834
+ connector: z.ZodEnum<{
835
+ hyperliquid: "hyperliquid";
836
+ binance: "binance";
837
+ bybit: "bybit";
838
+ okx: "okx";
839
+ lighter: "lighter";
840
+ }>;
841
+ symbol: z.ZodString;
842
+ track: z.ZodEnum<{
843
+ PEAK: "PEAK";
844
+ TROUGH: "TROUGH";
845
+ }>;
846
+ threshold: z.ZodNumber;
847
+ }, z.core.$strip>;
848
+ }, z.core.$strip>, z.ZodObject<{
849
+ type: z.ZodLiteral<"prediction_market">;
850
+ data: z.ZodObject<{
851
+ source: z.ZodEnum<{
852
+ kalshi: "kalshi";
853
+ polymarket: "polymarket";
854
+ }>;
855
+ marketKey: z.ZodString;
856
+ track: z.ZodEnum<{
857
+ PEAK: "PEAK";
858
+ TROUGH: "TROUGH";
859
+ }>;
860
+ threshold: z.ZodNumber;
861
+ }, z.core.$strip>;
862
+ }, z.core.$strip>, z.ZodObject<{
863
+ type: z.ZodLiteral<"btc_dominance">;
864
+ data: z.ZodObject<{
865
+ source: z.ZodLiteral<"coingecko">;
866
+ track: z.ZodEnum<{
867
+ PEAK: "PEAK";
868
+ TROUGH: "TROUGH";
869
+ }>;
870
+ threshold: z.ZodNumber;
871
+ }, z.core.$strip>;
708
872
  }, z.core.$strip>], "type">;
709
873
  context: z.ZodObject<{
710
874
  type: z.ZodLiteral<"MARKET">;
@@ -889,6 +1053,47 @@ export declare const CreateTriggerResponse: z.ZodObject<{
889
1053
  }>;
890
1054
  threshold: z.ZodNumber;
891
1055
  }, z.core.$strip>;
1056
+ }, z.core.$strip>, z.ZodObject<{
1057
+ type: z.ZodLiteral<"funding_rate">;
1058
+ data: z.ZodObject<{
1059
+ connector: z.ZodEnum<{
1060
+ hyperliquid: "hyperliquid";
1061
+ binance: "binance";
1062
+ bybit: "bybit";
1063
+ okx: "okx";
1064
+ lighter: "lighter";
1065
+ }>;
1066
+ symbol: z.ZodString;
1067
+ track: z.ZodEnum<{
1068
+ PEAK: "PEAK";
1069
+ TROUGH: "TROUGH";
1070
+ }>;
1071
+ threshold: z.ZodNumber;
1072
+ }, z.core.$strip>;
1073
+ }, z.core.$strip>, z.ZodObject<{
1074
+ type: z.ZodLiteral<"prediction_market">;
1075
+ data: z.ZodObject<{
1076
+ source: z.ZodEnum<{
1077
+ kalshi: "kalshi";
1078
+ polymarket: "polymarket";
1079
+ }>;
1080
+ marketKey: z.ZodString;
1081
+ track: z.ZodEnum<{
1082
+ PEAK: "PEAK";
1083
+ TROUGH: "TROUGH";
1084
+ }>;
1085
+ threshold: z.ZodNumber;
1086
+ }, z.core.$strip>;
1087
+ }, z.core.$strip>, z.ZodObject<{
1088
+ type: z.ZodLiteral<"btc_dominance">;
1089
+ data: z.ZodObject<{
1090
+ source: z.ZodLiteral<"coingecko">;
1091
+ track: z.ZodEnum<{
1092
+ PEAK: "PEAK";
1093
+ TROUGH: "TROUGH";
1094
+ }>;
1095
+ threshold: z.ZodNumber;
1096
+ }, z.core.$strip>;
892
1097
  }, z.core.$strip>], "type">;
893
1098
  context: z.ZodObject<{
894
1099
  type: z.ZodLiteral<"MARKET">;
@@ -1149,6 +1354,47 @@ export declare const CreateTriggerResponse: z.ZodObject<{
1149
1354
  mark: "mark";
1150
1355
  }>;
1151
1356
  }, z.core.$strip>;
1357
+ }, z.core.$strip>, z.ZodObject<{
1358
+ type: z.ZodLiteral<"funding_rate">;
1359
+ data: z.ZodObject<{
1360
+ connector: z.ZodEnum<{
1361
+ hyperliquid: "hyperliquid";
1362
+ binance: "binance";
1363
+ bybit: "bybit";
1364
+ okx: "okx";
1365
+ lighter: "lighter";
1366
+ }>;
1367
+ symbol: z.ZodString;
1368
+ track: z.ZodEnum<{
1369
+ PEAK: "PEAK";
1370
+ TROUGH: "TROUGH";
1371
+ }>;
1372
+ threshold: z.ZodNumber;
1373
+ }, z.core.$strip>;
1374
+ }, z.core.$strip>, z.ZodObject<{
1375
+ type: z.ZodLiteral<"prediction_market">;
1376
+ data: z.ZodObject<{
1377
+ source: z.ZodEnum<{
1378
+ kalshi: "kalshi";
1379
+ polymarket: "polymarket";
1380
+ }>;
1381
+ marketKey: z.ZodString;
1382
+ track: z.ZodEnum<{
1383
+ PEAK: "PEAK";
1384
+ TROUGH: "TROUGH";
1385
+ }>;
1386
+ threshold: z.ZodNumber;
1387
+ }, z.core.$strip>;
1388
+ }, z.core.$strip>, z.ZodObject<{
1389
+ type: z.ZodLiteral<"btc_dominance">;
1390
+ data: z.ZodObject<{
1391
+ source: z.ZodLiteral<"coingecko">;
1392
+ track: z.ZodEnum<{
1393
+ PEAK: "PEAK";
1394
+ TROUGH: "TROUGH";
1395
+ }>;
1396
+ threshold: z.ZodNumber;
1397
+ }, z.core.$strip>;
1152
1398
  }, z.core.$strip>], "type">;
1153
1399
  context: z.ZodObject<{
1154
1400
  type: z.ZodLiteral<"MARKET">;
@@ -0,0 +1,34 @@
1
+ import { z } from 'zod';
2
+ export declare const ExternalTriggerSource: z.ZodEnum<{
3
+ kalshi: "kalshi";
4
+ polymarket: "polymarket";
5
+ }>;
6
+ export type ExternalTriggerSource = z.output<typeof ExternalTriggerSource>;
7
+ export declare const TriggerOutcome: z.ZodObject<{
8
+ id: z.ZodString;
9
+ label: z.ZodString;
10
+ oracle: z.ZodNullable<z.ZodNumber>;
11
+ }, z.core.$strip>;
12
+ export type TriggerOutcome = z.output<typeof TriggerOutcome>;
13
+ export declare const ExternalTrigger: z.ZodObject<{
14
+ id: z.ZodString;
15
+ category: z.ZodLiteral<"prediction_market">;
16
+ source: z.ZodEnum<{
17
+ kalshi: "kalshi";
18
+ polymarket: "polymarket";
19
+ }>;
20
+ selectable: z.ZodBoolean;
21
+ oracle: z.ZodNullable<z.ZodNumber>;
22
+ options: z.ZodArray<z.ZodObject<{
23
+ id: z.ZodString;
24
+ label: z.ZodString;
25
+ oracle: z.ZodNullable<z.ZodNumber>;
26
+ }, z.core.$strip>>;
27
+ type: z.ZodEnum<{
28
+ binary: "binary";
29
+ multi: "multi";
30
+ }>;
31
+ title: z.ZodString;
32
+ imageUrl: z.ZodNullable<z.ZodString>;
33
+ }, z.core.$strip>;
34
+ export type ExternalTrigger = z.output<typeof ExternalTrigger>;
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+
3
+ const ExternalTriggerSource = z.enum(["kalshi", "polymarket"]);
4
+ const TriggerOutcome = z.object({
5
+ id: z.string(),
6
+ label: z.string(),
7
+ oracle: z.number().nullable()
8
+ });
9
+ const ExternalTrigger = z.object({
10
+ id: z.string(),
11
+ category: z.literal("prediction_market"),
12
+ source: ExternalTriggerSource,
13
+ selectable: z.boolean(),
14
+ oracle: z.number().nullable(),
15
+ options: z.array(TriggerOutcome),
16
+ type: z.enum(["binary", "multi"]),
17
+ title: z.string(),
18
+ imageUrl: z.string().nullable()
19
+ });
20
+
21
+ export { ExternalTrigger, ExternalTriggerSource, TriggerOutcome };
@@ -0,0 +1,3 @@
1
+ export * from './entities';
2
+ export * from './queries';
3
+ export * from './responses';
@@ -0,0 +1,3 @@
1
+ export * from './entities';
2
+ export * from './queries';
3
+ export * from './responses';
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ export declare const SearchTriggersParams: z.ZodObject<{
3
+ category: z.ZodOptional<z.ZodString>;
4
+ search: z.ZodOptional<z.ZodString>;
5
+ cursor: z.ZodOptional<z.ZodString>;
6
+ pageSize: z.ZodOptional<z.ZodNumber>;
7
+ }, z.core.$strip>;
8
+ export type SearchTriggersParams = z.input<typeof SearchTriggersParams>;
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+
3
+ const SearchTriggersParams = z.object({
4
+ category: z.string().optional(),
5
+ search: z.string().optional(),
6
+ cursor: z.string().optional(),
7
+ pageSize: z.number().optional()
8
+ });
9
+
10
+ export { SearchTriggersParams };
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ export declare const SearchTriggersResponse: z.ZodObject<{
3
+ triggers: z.ZodArray<z.ZodObject<{
4
+ id: z.ZodString;
5
+ category: z.ZodLiteral<"prediction_market">;
6
+ source: z.ZodEnum<{
7
+ kalshi: "kalshi";
8
+ polymarket: "polymarket";
9
+ }>;
10
+ selectable: z.ZodBoolean;
11
+ oracle: z.ZodNullable<z.ZodNumber>;
12
+ options: z.ZodArray<z.ZodObject<{
13
+ id: z.ZodString;
14
+ label: z.ZodString;
15
+ oracle: z.ZodNullable<z.ZodNumber>;
16
+ }, z.core.$strip>>;
17
+ type: z.ZodEnum<{
18
+ binary: "binary";
19
+ multi: "multi";
20
+ }>;
21
+ title: z.ZodString;
22
+ imageUrl: z.ZodNullable<z.ZodString>;
23
+ }, z.core.$strip>>;
24
+ nextCursor: z.ZodNullable<z.ZodString>;
25
+ }, z.core.$strip>;
26
+ export type SearchTriggersResponse = z.output<typeof SearchTriggersResponse>;
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ import { ExternalTrigger } from './entities';
3
+
4
+ const SearchTriggersResponse = z.object({
5
+ triggers: z.array(ExternalTrigger),
6
+ nextCursor: z.string().nullable()
7
+ });
8
+
9
+ export { SearchTriggersResponse };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/types",
3
- "version": "0.1.0",
3
+ "version": "1.1.0",
4
4
  "description": "Pear Protocol Types definitions",
5
5
  "private": false,
6
6
  "type": "module",