@pear-protocol/types 0.0.21 → 1.0.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.
- package/dist/admin/client-ids/entities.d.ts +11 -0
- package/dist/admin/client-ids/entities.js +13 -0
- package/dist/admin/client-ids/index.d.ts +4 -0
- package/dist/admin/client-ids/index.js +4 -0
- package/dist/admin/client-ids/payloads.d.ts +14 -0
- package/dist/admin/client-ids/payloads.js +13 -0
- package/dist/admin/client-ids/queries.d.ts +10 -0
- package/dist/admin/client-ids/queries.js +7 -0
- package/dist/admin/client-ids/responses.d.ts +11 -0
- package/dist/admin/client-ids/responses.js +6 -0
- package/dist/auth/api-keys.d.ts +67 -0
- package/dist/auth/api-keys.js +35 -0
- package/dist/auth/entities.d.ts +1 -0
- package/dist/auth/entities.js +1 -1
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.js +1 -0
- package/dist/auth/response.d.ts +2 -0
- package/dist/bundle.d.ts +5 -0
- package/dist/bundle.js +5 -0
- package/dist/common/client-id.d.ts +2 -0
- package/dist/common/client-id.js +5 -0
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.js +1 -0
- package/dist/instrument/queries.d.ts +2 -2
- package/dist/market/entities.d.ts +66 -0
- package/dist/market/entities.js +42 -0
- package/dist/market/index.d.ts +3 -0
- package/dist/market/index.js +3 -0
- package/dist/market/queries.d.ts +38 -0
- package/dist/market/queries.js +19 -0
- package/dist/market/responses.d.ts +72 -0
- package/dist/market/responses.js +15 -0
- package/dist/portfolio/entities.d.ts +199 -0
- package/dist/portfolio/entities.js +100 -0
- package/dist/portfolio/index.d.ts +3 -0
- package/dist/portfolio/index.js +3 -0
- package/dist/portfolio/queries.d.ts +46 -0
- package/dist/portfolio/queries.js +20 -0
- package/dist/portfolio/responses.d.ts +172 -0
- package/dist/portfolio/responses.js +16 -0
- package/dist/rebalance/payloads.d.ts +1 -0
- package/dist/rebalance/payloads.js +6 -1
- package/dist/schedule/payloads.d.ts +4 -0
- package/dist/schedule/payloads.js +11 -2
- package/dist/tca/entities.d.ts +8 -0
- package/dist/tca/entities.js +6 -0
- package/dist/tca/index.d.ts +3 -0
- package/dist/tca/index.js +3 -0
- package/dist/tca/queries.d.ts +15 -0
- package/dist/tca/queries.js +14 -0
- package/dist/tca/responses.d.ts +353 -0
- package/dist/tca/responses.js +105 -0
- package/dist/trade/payloads.d.ts +8 -0
- package/dist/trade/payloads.js +21 -4
- package/dist/trigger/entities/conditions.d.ts +170 -0
- package/dist/trigger/entities/conditions.js +43 -3
- package/dist/trigger/entities/index.d.ts +369 -0
- package/dist/trigger/index.d.ts +1 -0
- package/dist/trigger/index.js +1 -0
- package/dist/trigger/oracle.d.ts +31 -0
- package/dist/trigger/oracle.js +15 -0
- package/dist/trigger/payloads/conditions.d.ts +50 -0
- package/dist/trigger/payloads/conditions.js +35 -1
- package/dist/trigger/payloads/index.d.ts +90 -0
- package/dist/trigger/payloads/index.js +16 -3
- package/dist/trigger/responses.d.ts +246 -0
- package/dist/triggers/entities.d.ts +34 -0
- package/dist/triggers/entities.js +21 -0
- package/dist/triggers/index.d.ts +3 -0
- package/dist/triggers/index.js +3 -0
- package/dist/triggers/queries.d.ts +8 -0
- package/dist/triggers/queries.js +10 -0
- package/dist/triggers/responses.d.ts +26 -0
- package/dist/triggers/responses.js +9 -0
- package/dist/users/entities.d.ts +1 -0
- package/dist/users/entities.js +1 -1
- package/dist/users/response.d.ts +1 -0
- package/package.json +1 -1
|
@@ -94,6 +94,50 @@ declare const UpnlBps: z.ZodObject<{
|
|
|
94
94
|
threshold: z.ZodNumber;
|
|
95
95
|
}, z.core.$strip>;
|
|
96
96
|
}, z.core.$strip>;
|
|
97
|
+
declare const FundingRate: z.ZodObject<{
|
|
98
|
+
type: z.ZodLiteral<"funding_rate">;
|
|
99
|
+
data: z.ZodObject<{
|
|
100
|
+
connector: z.ZodEnum<{
|
|
101
|
+
hyperliquid: "hyperliquid";
|
|
102
|
+
binance: "binance";
|
|
103
|
+
bybit: "bybit";
|
|
104
|
+
okx: "okx";
|
|
105
|
+
lighter: "lighter";
|
|
106
|
+
}>;
|
|
107
|
+
symbol: z.ZodString;
|
|
108
|
+
track: z.ZodEnum<{
|
|
109
|
+
PEAK: "PEAK";
|
|
110
|
+
TROUGH: "TROUGH";
|
|
111
|
+
}>;
|
|
112
|
+
threshold: z.ZodNumber;
|
|
113
|
+
}, z.core.$strip>;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
declare const PredictionMarket: z.ZodObject<{
|
|
116
|
+
type: z.ZodLiteral<"prediction_market">;
|
|
117
|
+
data: z.ZodObject<{
|
|
118
|
+
source: z.ZodEnum<{
|
|
119
|
+
kalshi: "kalshi";
|
|
120
|
+
polymarket: "polymarket";
|
|
121
|
+
}>;
|
|
122
|
+
marketKey: z.ZodString;
|
|
123
|
+
track: z.ZodEnum<{
|
|
124
|
+
PEAK: "PEAK";
|
|
125
|
+
TROUGH: "TROUGH";
|
|
126
|
+
}>;
|
|
127
|
+
threshold: z.ZodNumber;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
}, z.core.$strip>;
|
|
130
|
+
declare const BtcDominance: z.ZodObject<{
|
|
131
|
+
type: z.ZodLiteral<"btc_dominance">;
|
|
132
|
+
data: z.ZodObject<{
|
|
133
|
+
source: z.ZodLiteral<"coingecko">;
|
|
134
|
+
track: z.ZodEnum<{
|
|
135
|
+
PEAK: "PEAK";
|
|
136
|
+
TROUGH: "TROUGH";
|
|
137
|
+
}>;
|
|
138
|
+
threshold: z.ZodNumber;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
}, z.core.$strip>;
|
|
97
141
|
declare const RatioTrailing: z.ZodObject<{
|
|
98
142
|
type: z.ZodLiteral<"ratio_trailing">;
|
|
99
143
|
data: z.ZodObject<{
|
|
@@ -209,6 +253,47 @@ export declare const TriggerConditionOpen: z.ZodDiscriminatedUnion<[z.ZodObject<
|
|
|
209
253
|
}>;
|
|
210
254
|
threshold: z.ZodNumber;
|
|
211
255
|
}, z.core.$strip>;
|
|
256
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
257
|
+
type: z.ZodLiteral<"funding_rate">;
|
|
258
|
+
data: z.ZodObject<{
|
|
259
|
+
connector: z.ZodEnum<{
|
|
260
|
+
hyperliquid: "hyperliquid";
|
|
261
|
+
binance: "binance";
|
|
262
|
+
bybit: "bybit";
|
|
263
|
+
okx: "okx";
|
|
264
|
+
lighter: "lighter";
|
|
265
|
+
}>;
|
|
266
|
+
symbol: z.ZodString;
|
|
267
|
+
track: z.ZodEnum<{
|
|
268
|
+
PEAK: "PEAK";
|
|
269
|
+
TROUGH: "TROUGH";
|
|
270
|
+
}>;
|
|
271
|
+
threshold: z.ZodNumber;
|
|
272
|
+
}, z.core.$strip>;
|
|
273
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
274
|
+
type: z.ZodLiteral<"prediction_market">;
|
|
275
|
+
data: z.ZodObject<{
|
|
276
|
+
source: z.ZodEnum<{
|
|
277
|
+
kalshi: "kalshi";
|
|
278
|
+
polymarket: "polymarket";
|
|
279
|
+
}>;
|
|
280
|
+
marketKey: z.ZodString;
|
|
281
|
+
track: z.ZodEnum<{
|
|
282
|
+
PEAK: "PEAK";
|
|
283
|
+
TROUGH: "TROUGH";
|
|
284
|
+
}>;
|
|
285
|
+
threshold: z.ZodNumber;
|
|
286
|
+
}, z.core.$strip>;
|
|
287
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
288
|
+
type: z.ZodLiteral<"btc_dominance">;
|
|
289
|
+
data: z.ZodObject<{
|
|
290
|
+
source: z.ZodLiteral<"coingecko">;
|
|
291
|
+
track: z.ZodEnum<{
|
|
292
|
+
PEAK: "PEAK";
|
|
293
|
+
TROUGH: "TROUGH";
|
|
294
|
+
}>;
|
|
295
|
+
threshold: z.ZodNumber;
|
|
296
|
+
}, z.core.$strip>;
|
|
212
297
|
}, z.core.$strip>], "type">;
|
|
213
298
|
export declare const TriggerConditionAdjust: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
214
299
|
type: z.ZodLiteral<"ratio">;
|
|
@@ -299,6 +384,47 @@ export declare const TriggerConditionAdjust: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
299
384
|
}>;
|
|
300
385
|
threshold: z.ZodNumber;
|
|
301
386
|
}, z.core.$strip>;
|
|
387
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
388
|
+
type: z.ZodLiteral<"funding_rate">;
|
|
389
|
+
data: z.ZodObject<{
|
|
390
|
+
connector: z.ZodEnum<{
|
|
391
|
+
hyperliquid: "hyperliquid";
|
|
392
|
+
binance: "binance";
|
|
393
|
+
bybit: "bybit";
|
|
394
|
+
okx: "okx";
|
|
395
|
+
lighter: "lighter";
|
|
396
|
+
}>;
|
|
397
|
+
symbol: z.ZodString;
|
|
398
|
+
track: z.ZodEnum<{
|
|
399
|
+
PEAK: "PEAK";
|
|
400
|
+
TROUGH: "TROUGH";
|
|
401
|
+
}>;
|
|
402
|
+
threshold: z.ZodNumber;
|
|
403
|
+
}, z.core.$strip>;
|
|
404
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
405
|
+
type: z.ZodLiteral<"prediction_market">;
|
|
406
|
+
data: z.ZodObject<{
|
|
407
|
+
source: z.ZodEnum<{
|
|
408
|
+
kalshi: "kalshi";
|
|
409
|
+
polymarket: "polymarket";
|
|
410
|
+
}>;
|
|
411
|
+
marketKey: z.ZodString;
|
|
412
|
+
track: z.ZodEnum<{
|
|
413
|
+
PEAK: "PEAK";
|
|
414
|
+
TROUGH: "TROUGH";
|
|
415
|
+
}>;
|
|
416
|
+
threshold: z.ZodNumber;
|
|
417
|
+
}, z.core.$strip>;
|
|
418
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
419
|
+
type: z.ZodLiteral<"btc_dominance">;
|
|
420
|
+
data: z.ZodObject<{
|
|
421
|
+
source: z.ZodLiteral<"coingecko">;
|
|
422
|
+
track: z.ZodEnum<{
|
|
423
|
+
PEAK: "PEAK";
|
|
424
|
+
TROUGH: "TROUGH";
|
|
425
|
+
}>;
|
|
426
|
+
threshold: z.ZodNumber;
|
|
427
|
+
}, z.core.$strip>;
|
|
302
428
|
}, z.core.$strip>], "type">;
|
|
303
429
|
export declare const TriggerConditionClose: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
304
430
|
type: z.ZodLiteral<"ratio">;
|
|
@@ -448,6 +574,47 @@ export declare const TriggerConditionClose: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
448
574
|
mark: "mark";
|
|
449
575
|
}>;
|
|
450
576
|
}, z.core.$strip>;
|
|
577
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
578
|
+
type: z.ZodLiteral<"funding_rate">;
|
|
579
|
+
data: z.ZodObject<{
|
|
580
|
+
connector: z.ZodEnum<{
|
|
581
|
+
hyperliquid: "hyperliquid";
|
|
582
|
+
binance: "binance";
|
|
583
|
+
bybit: "bybit";
|
|
584
|
+
okx: "okx";
|
|
585
|
+
lighter: "lighter";
|
|
586
|
+
}>;
|
|
587
|
+
symbol: z.ZodString;
|
|
588
|
+
track: z.ZodEnum<{
|
|
589
|
+
PEAK: "PEAK";
|
|
590
|
+
TROUGH: "TROUGH";
|
|
591
|
+
}>;
|
|
592
|
+
threshold: z.ZodNumber;
|
|
593
|
+
}, z.core.$strip>;
|
|
594
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
595
|
+
type: z.ZodLiteral<"prediction_market">;
|
|
596
|
+
data: z.ZodObject<{
|
|
597
|
+
source: z.ZodEnum<{
|
|
598
|
+
kalshi: "kalshi";
|
|
599
|
+
polymarket: "polymarket";
|
|
600
|
+
}>;
|
|
601
|
+
marketKey: z.ZodString;
|
|
602
|
+
track: z.ZodEnum<{
|
|
603
|
+
PEAK: "PEAK";
|
|
604
|
+
TROUGH: "TROUGH";
|
|
605
|
+
}>;
|
|
606
|
+
threshold: z.ZodNumber;
|
|
607
|
+
}, z.core.$strip>;
|
|
608
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
609
|
+
type: z.ZodLiteral<"btc_dominance">;
|
|
610
|
+
data: z.ZodObject<{
|
|
611
|
+
source: z.ZodLiteral<"coingecko">;
|
|
612
|
+
track: z.ZodEnum<{
|
|
613
|
+
PEAK: "PEAK";
|
|
614
|
+
TROUGH: "TROUGH";
|
|
615
|
+
}>;
|
|
616
|
+
threshold: z.ZodNumber;
|
|
617
|
+
}, z.core.$strip>;
|
|
451
618
|
}, z.core.$strip>], "type">;
|
|
452
619
|
export type TriggerConditionRatio = z.output<typeof Ratio>;
|
|
453
620
|
export type TriggerConditionPrice = z.output<typeof Price>;
|
|
@@ -461,6 +628,9 @@ export type TriggerConditionWeightedRatioTrailing = z.output<typeof WeightedRati
|
|
|
461
628
|
export type TriggerConditionNotionalTrailing = z.output<typeof NotionalTrailing>;
|
|
462
629
|
export type TriggerConditionUpnlTrailing = z.output<typeof UpnlTrailing>;
|
|
463
630
|
export type TriggerConditionUpnlBpsTrailing = z.output<typeof UpnlBpsTrailing>;
|
|
631
|
+
export type TriggerConditionFundingRate = z.output<typeof FundingRate>;
|
|
632
|
+
export type TriggerConditionPredictionMarket = z.output<typeof PredictionMarket>;
|
|
633
|
+
export type TriggerConditionBtcDominance = z.output<typeof BtcDominance>;
|
|
464
634
|
export type TriggerConditionOpen = z.output<typeof TriggerConditionOpen>;
|
|
465
635
|
export type TriggerConditionAdjust = z.output<typeof TriggerConditionAdjust>;
|
|
466
636
|
export type TriggerConditionClose = z.output<typeof TriggerConditionClose>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { Side } from '../../common/schema';
|
|
3
|
+
import { Connector } from '../../connector';
|
|
3
4
|
import { InstrumentId } from '../../instrument';
|
|
4
5
|
import { PriceSource } from '../../price';
|
|
5
6
|
import { MetricTrack } from '../common';
|
|
@@ -62,6 +63,32 @@ const UpnlBps = z.object({
|
|
|
62
63
|
threshold: z.number()
|
|
63
64
|
})
|
|
64
65
|
});
|
|
66
|
+
const FundingRate = z.object({
|
|
67
|
+
type: z.literal("funding_rate"),
|
|
68
|
+
data: z.object({
|
|
69
|
+
connector: Connector,
|
|
70
|
+
symbol: InstrumentId,
|
|
71
|
+
track: MetricTrack,
|
|
72
|
+
threshold: z.number()
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
const PredictionMarket = z.object({
|
|
76
|
+
type: z.literal("prediction_market"),
|
|
77
|
+
data: z.object({
|
|
78
|
+
source: z.enum(["kalshi", "polymarket"]),
|
|
79
|
+
marketKey: z.string().min(1),
|
|
80
|
+
track: MetricTrack,
|
|
81
|
+
threshold: z.number()
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
const BtcDominance = z.object({
|
|
85
|
+
type: z.literal("btc_dominance"),
|
|
86
|
+
data: z.object({
|
|
87
|
+
source: z.literal("coingecko"),
|
|
88
|
+
track: MetricTrack,
|
|
89
|
+
threshold: z.number()
|
|
90
|
+
})
|
|
91
|
+
});
|
|
65
92
|
const RatioTrailing = z.object({
|
|
66
93
|
type: z.literal("ratio_trailing"),
|
|
67
94
|
data: z.object({
|
|
@@ -108,14 +135,24 @@ const UpnlBpsTrailing = z.object({
|
|
|
108
135
|
priceSource: PriceSource
|
|
109
136
|
})
|
|
110
137
|
});
|
|
111
|
-
const TriggerConditionOpen = z.discriminatedUnion("type", [
|
|
138
|
+
const TriggerConditionOpen = z.discriminatedUnion("type", [
|
|
139
|
+
Ratio,
|
|
140
|
+
Price,
|
|
141
|
+
WeightedRatio,
|
|
142
|
+
FundingRate,
|
|
143
|
+
PredictionMarket,
|
|
144
|
+
BtcDominance
|
|
145
|
+
]);
|
|
112
146
|
const TriggerConditionAdjust = z.discriminatedUnion("type", [
|
|
113
147
|
Ratio,
|
|
114
148
|
Price,
|
|
115
149
|
WeightedRatio,
|
|
116
150
|
Notional,
|
|
117
151
|
Upnl,
|
|
118
|
-
UpnlBps
|
|
152
|
+
UpnlBps,
|
|
153
|
+
FundingRate,
|
|
154
|
+
PredictionMarket,
|
|
155
|
+
BtcDominance
|
|
119
156
|
]);
|
|
120
157
|
const TriggerConditionClose = z.discriminatedUnion("type", [
|
|
121
158
|
Ratio,
|
|
@@ -129,7 +166,10 @@ const TriggerConditionClose = z.discriminatedUnion("type", [
|
|
|
129
166
|
WeightedRatioTrailing,
|
|
130
167
|
NotionalTrailing,
|
|
131
168
|
UpnlTrailing,
|
|
132
|
-
UpnlBpsTrailing
|
|
169
|
+
UpnlBpsTrailing,
|
|
170
|
+
FundingRate,
|
|
171
|
+
PredictionMarket,
|
|
172
|
+
BtcDominance
|
|
133
173
|
]);
|
|
134
174
|
|
|
135
175
|
export { TriggerConditionAdjust, TriggerConditionClose, TriggerConditionOpen };
|