@pear-protocol/types 1.14.1 → 1.15.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 (66) hide show
  1. package/dist/auth/api-keys.d.ts +0 -1
  2. package/dist/auth/api-keys.js +1 -1
  3. package/dist/auth/entities.d.ts +0 -1
  4. package/dist/auth/entities.js +1 -1
  5. package/dist/auth/response.d.ts +0 -2
  6. package/dist/bundle.d.ts +1 -1
  7. package/dist/bundle.js +1 -1
  8. package/dist/common/refinement.js +1 -1
  9. package/dist/common/schema.d.ts +0 -1
  10. package/dist/common/schema.js +1 -2
  11. package/dist/execution/entities.d.ts +0 -13
  12. package/dist/execution/responses.d.ts +0 -8
  13. package/dist/fee/entities.d.ts +41 -0
  14. package/dist/fee/entities.js +19 -0
  15. package/dist/{admin/client-ids → fee}/index.d.ts +0 -1
  16. package/dist/{admin/client-ids → fee}/index.js +0 -1
  17. package/dist/fee/queries.d.ts +17 -0
  18. package/dist/fee/queries.js +12 -0
  19. package/dist/fee/responses.d.ts +35 -0
  20. package/dist/fee/responses.js +29 -0
  21. package/dist/instrument/entities.d.ts +10 -0
  22. package/dist/instrument/entities.js +22 -1
  23. package/dist/instrument/queries.d.ts +2 -2
  24. package/dist/instrument/responses.d.ts +12 -0
  25. package/dist/instrument/responses.js +8 -2
  26. package/dist/ladder/entities.d.ts +3 -0
  27. package/dist/ladder/payloads.js +1 -2
  28. package/dist/ladder/responses.d.ts +9 -0
  29. package/dist/market/queries.d.ts +2 -2
  30. package/dist/notification/queries.d.ts +1 -1
  31. package/dist/order/entities.d.ts +0 -2
  32. package/dist/order/entities.js +1 -5
  33. package/dist/portfolio/entities.d.ts +4 -0
  34. package/dist/portfolio/entities.js +10 -1
  35. package/dist/portfolio/responses.d.ts +4 -0
  36. package/dist/schedule/entities.d.ts +27 -37
  37. package/dist/schedule/entities.js +24 -28
  38. package/dist/schedule/index.d.ts +1 -0
  39. package/dist/schedule/index.js +1 -0
  40. package/dist/schedule/payloads.d.ts +28 -28
  41. package/dist/schedule/payloads.js +23 -33
  42. package/dist/schedule/randomization.d.ts +10 -0
  43. package/dist/schedule/randomization.js +15 -0
  44. package/dist/schedule/responses.d.ts +24 -20
  45. package/dist/statistics/entities.d.ts +20 -0
  46. package/dist/statistics/entities.js +23 -1
  47. package/dist/statistics/queries.d.ts +28 -0
  48. package/dist/statistics/queries.js +26 -1
  49. package/dist/statistics/responses.d.ts +22 -0
  50. package/dist/statistics/responses.js +5 -2
  51. package/dist/trade/responses.d.ts +0 -20
  52. package/dist/trigger/entities/index.d.ts +10 -0
  53. package/dist/trigger/entities/index.js +4 -0
  54. package/dist/trigger/responses.d.ts +6 -0
  55. package/dist/users/entities.d.ts +0 -1
  56. package/dist/users/entities.js +1 -1
  57. package/dist/users/response.d.ts +0 -1
  58. package/package.json +1 -1
  59. package/dist/admin/client-ids/entities.d.ts +0 -11
  60. package/dist/admin/client-ids/entities.js +0 -13
  61. package/dist/admin/client-ids/payloads.d.ts +0 -14
  62. package/dist/admin/client-ids/payloads.js +0 -13
  63. package/dist/admin/client-ids/queries.d.ts +0 -10
  64. package/dist/admin/client-ids/queries.js +0 -7
  65. package/dist/admin/client-ids/responses.d.ts +0 -11
  66. package/dist/admin/client-ids/responses.js +0 -6
@@ -74,17 +74,18 @@ export declare const ScheduleListResponse: z.ZodObject<{
74
74
  strategy: z.ZodLiteral<"TWAP">;
75
75
  intent: z.ZodLiteral<"OPEN">;
76
76
  sliceIntervalSec: z.ZodNumber;
77
- sliceLegs: z.ZodArray<z.ZodObject<{
77
+ sliceCount: z.ZodNumber;
78
+ randomization: z.ZodObject<{
79
+ timingJitterBps: z.ZodInt;
80
+ sizeJitterBps: z.ZodInt;
81
+ }, z.core.$strip>;
82
+ legs: z.ZodArray<z.ZodObject<{
78
83
  symbol: z.ZodString;
79
84
  side: z.ZodEnum<{
80
85
  BUY: "BUY";
81
86
  SELL: "SELL";
82
87
  }>;
83
- mode: z.ZodEnum<{
84
- QUANTITY: "QUANTITY";
85
- USD: "USD";
86
- }>;
87
- stepAmount: z.ZodString;
88
+ weight: z.ZodNumber;
88
89
  }, z.core.$strip>>;
89
90
  targetNotional: z.ZodString;
90
91
  remainingNotional: z.ZodString;
@@ -160,11 +161,12 @@ export declare const ScheduleListResponse: z.ZodObject<{
160
161
  strategy: z.ZodLiteral<"TWAP">;
161
162
  intent: z.ZodLiteral<"CLOSE">;
162
163
  sliceIntervalSec: z.ZodNumber;
164
+ sliceCount: z.ZodNumber;
165
+ randomization: z.ZodObject<{
166
+ timingJitterBps: z.ZodInt;
167
+ sizeJitterBps: z.ZodInt;
168
+ }, z.core.$strip>;
163
169
  positionId: z.ZodUUID;
164
- sliceLegs: z.ZodArray<z.ZodObject<{
165
- symbol: z.ZodString;
166
- stepAmount: z.ZodString;
167
- }, z.core.$strip>>;
168
170
  initialExposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
169
171
  }, z.core.$strip>], "intent">>;
170
172
  }, z.core.$strip>;
@@ -242,17 +244,18 @@ export declare const CreateScheduleResponse: z.ZodObject<{
242
244
  strategy: z.ZodLiteral<"TWAP">;
243
245
  intent: z.ZodLiteral<"OPEN">;
244
246
  sliceIntervalSec: z.ZodNumber;
245
- sliceLegs: z.ZodArray<z.ZodObject<{
247
+ sliceCount: z.ZodNumber;
248
+ randomization: z.ZodObject<{
249
+ timingJitterBps: z.ZodInt;
250
+ sizeJitterBps: z.ZodInt;
251
+ }, z.core.$strip>;
252
+ legs: z.ZodArray<z.ZodObject<{
246
253
  symbol: z.ZodString;
247
254
  side: z.ZodEnum<{
248
255
  BUY: "BUY";
249
256
  SELL: "SELL";
250
257
  }>;
251
- mode: z.ZodEnum<{
252
- QUANTITY: "QUANTITY";
253
- USD: "USD";
254
- }>;
255
- stepAmount: z.ZodString;
258
+ weight: z.ZodNumber;
256
259
  }, z.core.$strip>>;
257
260
  targetNotional: z.ZodString;
258
261
  remainingNotional: z.ZodString;
@@ -328,11 +331,12 @@ export declare const CreateScheduleResponse: z.ZodObject<{
328
331
  strategy: z.ZodLiteral<"TWAP">;
329
332
  intent: z.ZodLiteral<"CLOSE">;
330
333
  sliceIntervalSec: z.ZodNumber;
334
+ sliceCount: z.ZodNumber;
335
+ randomization: z.ZodObject<{
336
+ timingJitterBps: z.ZodInt;
337
+ sizeJitterBps: z.ZodInt;
338
+ }, z.core.$strip>;
331
339
  positionId: z.ZodUUID;
332
- sliceLegs: z.ZodArray<z.ZodObject<{
333
- symbol: z.ZodString;
334
- stepAmount: z.ZodString;
335
- }, z.core.$strip>>;
336
340
  initialExposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
337
341
  }, z.core.$strip>], "intent">;
338
342
  }, z.core.$strip>;
@@ -1,4 +1,24 @@
1
1
  import { z } from 'zod';
2
+ export declare const LeaderboardRow: z.ZodObject<{
3
+ tradeAccountId: z.ZodString;
4
+ exchangeIdentifier: z.ZodString;
5
+ connector: z.ZodEnum<{
6
+ hyperliquid: "hyperliquid";
7
+ binance: "binance";
8
+ bybit: "bybit";
9
+ okx: "okx";
10
+ lighter: "lighter";
11
+ }>;
12
+ volume: z.ZodString;
13
+ grossRealizedPnl: z.ZodString;
14
+ grossUpnl: z.ZodString;
15
+ fundingPayment: z.ZodString;
16
+ totalNetPnl: z.ZodString;
17
+ pearFee: z.ZodString;
18
+ tradeFee: z.ZodString;
19
+ totalTrades: z.ZodNumber;
20
+ }, z.core.$strip>;
21
+ export type LeaderboardRow = z.output<typeof LeaderboardRow>;
2
22
  export declare const VolumeStatistics: z.ZodObject<{
3
23
  timestamp: z.ZodNumber;
4
24
  volume: z.ZodNumber;
@@ -1,5 +1,27 @@
1
1
  import { z } from 'zod';
2
+ import { Connector } from '../connector';
2
3
 
4
+ const LeaderboardRow = z.object({
5
+ // The row's identity. Two accounts may register the same exchange identifier, so this
6
+ // is the only field that separates their rows — and the only safe key to render by.
7
+ tradeAccountId: z.string(),
8
+ // Address for Hyperliquid/Lighter, exchange account UID for CEXes.
9
+ exchangeIdentifier: z.string(),
10
+ connector: Connector,
11
+ volume: z.string(),
12
+ grossRealizedPnl: z.string(),
13
+ // Zero on a ranged board — unrealized PnL is only meaningful as of now.
14
+ grossUpnl: z.string(),
15
+ // Net funding carry over the range, signed: negative when the trader paid to hold.
16
+ // Account-level, so a client-scoped board reports the account's whole carry —
17
+ // funding_payments carries no position id to attribute it any finer.
18
+ fundingPayment: z.string(),
19
+ totalNetPnl: z.string(),
20
+ // V2 calls this builderFee; V3 names it for the column it comes from.
21
+ pearFee: z.string(),
22
+ tradeFee: z.string(),
23
+ totalTrades: z.number()
24
+ });
3
25
  const VolumeStatistics = z.object({
4
26
  timestamp: z.number(),
5
27
  volume: z.number(),
@@ -20,4 +42,4 @@ const StatisticsTotals = z.object({
20
42
  totalUsers: z.number()
21
43
  });
22
44
 
23
- export { OiStatistics, StatisticsTotals, VolumeStatistics };
45
+ export { LeaderboardRow, OiStatistics, StatisticsTotals, VolumeStatistics };
@@ -46,3 +46,31 @@ export declare const StatisticsTotalsQueryParams: z.ZodObject<{
46
46
  }, z.core.$strip>;
47
47
  export type StatisticsTotalsQueryParamsInput = z.input<typeof StatisticsTotalsQueryParams>;
48
48
  export type StatisticsTotalsQueryParams = z.output<typeof StatisticsTotalsQueryParams>;
49
+ export declare const LeaderboardSortBy: z.ZodEnum<{
50
+ volume: "volume";
51
+ trades: "trades";
52
+ totalNetPnl: "totalNetPnl";
53
+ }>;
54
+ export type LeaderboardSortBy = z.infer<typeof LeaderboardSortBy>;
55
+ export declare const LEADERBOARD_MAX_LIMIT = 200;
56
+ export declare const LeaderboardQueryParams: z.ZodObject<{
57
+ clientId: z.ZodOptional<z.ZodString>;
58
+ connector: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[] | (("hyperliquid" | "binance" | "bybit" | "okx" | "lighter")[] & any[]) | undefined, ("hyperliquid" | "binance" | "bybit" | "okx" | "lighter")[]>, z.ZodArray<z.ZodEnum<{
59
+ hyperliquid: "hyperliquid";
60
+ binance: "binance";
61
+ bybit: "bybit";
62
+ okx: "okx";
63
+ lighter: "lighter";
64
+ }>>>>;
65
+ asset: z.ZodOptional<z.ZodPipe<z.ZodTransform<string[] | (string[] & any[]) | undefined, string[]>, z.ZodArray<z.ZodString>>>;
66
+ sortBy: z.ZodDefault<z.ZodEnum<{
67
+ volume: "volume";
68
+ trades: "trades";
69
+ totalNetPnl: "totalNetPnl";
70
+ }>>;
71
+ startDate: z.ZodOptional<z.ZodPipe<z.ZodCoercedNumber<number>, z.ZodTransform<Date, number>>>;
72
+ endDate: z.ZodOptional<z.ZodPipe<z.ZodCoercedNumber<number>, z.ZodTransform<Date, number>>>;
73
+ limit: z.ZodDefault<z.ZodCoercedNumber<number>>;
74
+ }, z.core.$strip>;
75
+ export type LeaderboardQueryParamsInput = z.input<typeof LeaderboardQueryParams>;
76
+ export type LeaderboardQueryParams = z.output<typeof LeaderboardQueryParams>;
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { normalizeArray } from '../common/array';
2
3
  import { Connector } from '../connector';
3
4
 
4
5
  const VolumeStatisticsQueryParams = z.object({
@@ -20,5 +21,29 @@ const OiStatisticsQueryParams = z.object({
20
21
  const StatisticsTotalsQueryParams = z.object({
21
22
  connector: Connector
22
23
  });
24
+ const LeaderboardSortBy = z.enum(["trades", "totalNetPnl", "volume"]);
25
+ const LEADERBOARD_MAX_LIMIT = 200;
26
+ const UnixSeconds = z.coerce.number().int().min(0).transform((seconds) => new Date(seconds * 1e3));
27
+ const ConnectorArray = z.preprocess((arg) => normalizeArray(arg), z.array(Connector));
28
+ const AssetArray = z.preprocess((arg) => normalizeArray(arg), z.array(z.string().trim().min(1)));
29
+ const LeaderboardQueryParams = z.object({
30
+ // Attribution filter, not a scope boundary — any caller may pass any client.
31
+ clientId: z.string().optional(),
32
+ // Absent means every connector. The filter applies before the top-N cut, so
33
+ // two connectors return the top N across both combined, not N of each.
34
+ connector: ConnectorArray.optional(),
35
+ // Absent means every asset. Filtering is per-leg: a long-BTC / short-ETH basket
36
+ // contributes only its BTC leg to an asset=BTC board. Each asset's realized-PnL
37
+ // walk is independent, so selecting a subset leaves every remaining walk complete.
38
+ asset: AssetArray.optional(),
39
+ sortBy: LeaderboardSortBy.default("totalNetPnl"),
40
+ startDate: UnixSeconds.optional(),
41
+ // Absent endDate means the live board: unrealized PnL is included. Any
42
+ // endDate at all yields a settled, reproducible board with no unrealized.
43
+ endDate: UnixSeconds.optional(),
44
+ limit: z.coerce.number().int().positive().max(LEADERBOARD_MAX_LIMIT).default(LEADERBOARD_MAX_LIMIT)
45
+ }).refine((data) => !data.startDate || !data.endDate || data.startDate < data.endDate, {
46
+ message: "startDate must be before endDate"
47
+ });
23
48
 
24
- export { OiStatisticsQueryParams, StatisticsTotalsQueryParams, VolumeStatisticsQueryParams };
49
+ export { LEADERBOARD_MAX_LIMIT, LeaderboardQueryParams, LeaderboardSortBy, OiStatisticsQueryParams, StatisticsTotalsQueryParams, VolumeStatisticsQueryParams };
@@ -1,4 +1,26 @@
1
1
  import { z } from 'zod';
2
+ export declare const LeaderboardResponse: z.ZodObject<{
3
+ data: z.ZodArray<z.ZodObject<{
4
+ tradeAccountId: z.ZodString;
5
+ exchangeIdentifier: z.ZodString;
6
+ connector: z.ZodEnum<{
7
+ hyperliquid: "hyperliquid";
8
+ binance: "binance";
9
+ bybit: "bybit";
10
+ okx: "okx";
11
+ lighter: "lighter";
12
+ }>;
13
+ volume: z.ZodString;
14
+ grossRealizedPnl: z.ZodString;
15
+ grossUpnl: z.ZodString;
16
+ fundingPayment: z.ZodString;
17
+ totalNetPnl: z.ZodString;
18
+ pearFee: z.ZodString;
19
+ tradeFee: z.ZodString;
20
+ totalTrades: z.ZodNumber;
21
+ }, z.core.$strip>>;
22
+ }, z.core.$strip>;
23
+ export type LeaderboardResponse = z.output<typeof LeaderboardResponse>;
2
24
  export declare const VolumeStatisticsResponse: z.ZodObject<{
3
25
  data: z.ZodArray<z.ZodObject<{
4
26
  timestamp: z.ZodNumber;
@@ -1,6 +1,9 @@
1
1
  import { z } from 'zod';
2
- import { VolumeStatistics, OiStatistics, StatisticsTotals } from './entities';
2
+ import { LeaderboardRow, VolumeStatistics, OiStatistics, StatisticsTotals } from './entities';
3
3
 
4
+ const LeaderboardResponse = z.object({
5
+ data: z.array(LeaderboardRow)
6
+ });
4
7
  const VolumeStatisticsResponse = z.object({
5
8
  data: z.array(VolumeStatistics)
6
9
  });
@@ -11,4 +14,4 @@ const StatisticsTotalsResponse = z.object({
11
14
  data: StatisticsTotals
12
15
  });
13
16
 
14
- export { OiStatisticsResponse, StatisticsTotalsResponse, VolumeStatisticsResponse };
17
+ export { LeaderboardResponse, OiStatisticsResponse, StatisticsTotalsResponse, VolumeStatisticsResponse };
@@ -45,7 +45,6 @@ export declare const CreateTradeOpenResponse: z.ZodObject<{
45
45
  SELL: "SELL";
46
46
  }>;
47
47
  reduceOnly: z.ZodBoolean;
48
- leverage: z.ZodInt;
49
48
  quantity: z.ZodString;
50
49
  price: z.ZodString;
51
50
  filledQuantity: z.ZodString;
@@ -123,7 +122,6 @@ export declare const CreateTradeOpenResponse: z.ZodObject<{
123
122
  SELL: "SELL";
124
123
  }>;
125
124
  reduceOnly: z.ZodBoolean;
126
- leverage: z.ZodInt;
127
125
  quantity: z.ZodString;
128
126
  price: z.ZodString;
129
127
  filledQuantity: z.ZodString;
@@ -205,7 +203,6 @@ export declare const CreateTradeOpenResponse: z.ZodObject<{
205
203
  SELL: "SELL";
206
204
  }>;
207
205
  reduceOnly: z.ZodBoolean;
208
- leverage: z.ZodInt;
209
206
  quantity: z.ZodString;
210
207
  price: z.ZodString;
211
208
  filledQuantity: z.ZodString;
@@ -262,7 +259,6 @@ export declare const CreateTradeOpenResponse: z.ZodObject<{
262
259
  SELL: "SELL";
263
260
  }>;
264
261
  reduceOnly: z.ZodBoolean;
265
- leverage: z.ZodInt;
266
262
  quantity: z.ZodString;
267
263
  price: z.ZodString;
268
264
  filledQuantity: z.ZodString;
@@ -323,7 +319,6 @@ export declare const CreateTradeAdjustResponse: z.ZodObject<{
323
319
  SELL: "SELL";
324
320
  }>;
325
321
  reduceOnly: z.ZodBoolean;
326
- leverage: z.ZodInt;
327
322
  quantity: z.ZodString;
328
323
  price: z.ZodString;
329
324
  filledQuantity: z.ZodString;
@@ -401,7 +396,6 @@ export declare const CreateTradeAdjustResponse: z.ZodObject<{
401
396
  SELL: "SELL";
402
397
  }>;
403
398
  reduceOnly: z.ZodBoolean;
404
- leverage: z.ZodInt;
405
399
  quantity: z.ZodString;
406
400
  price: z.ZodString;
407
401
  filledQuantity: z.ZodString;
@@ -483,7 +477,6 @@ export declare const CreateTradeAdjustResponse: z.ZodObject<{
483
477
  SELL: "SELL";
484
478
  }>;
485
479
  reduceOnly: z.ZodBoolean;
486
- leverage: z.ZodInt;
487
480
  quantity: z.ZodString;
488
481
  price: z.ZodString;
489
482
  filledQuantity: z.ZodString;
@@ -540,7 +533,6 @@ export declare const CreateTradeAdjustResponse: z.ZodObject<{
540
533
  SELL: "SELL";
541
534
  }>;
542
535
  reduceOnly: z.ZodBoolean;
543
- leverage: z.ZodInt;
544
536
  quantity: z.ZodString;
545
537
  price: z.ZodString;
546
538
  filledQuantity: z.ZodString;
@@ -601,7 +593,6 @@ export declare const CreateTradeCloseResponse: z.ZodObject<{
601
593
  SELL: "SELL";
602
594
  }>;
603
595
  reduceOnly: z.ZodBoolean;
604
- leverage: z.ZodInt;
605
596
  quantity: z.ZodString;
606
597
  price: z.ZodString;
607
598
  filledQuantity: z.ZodString;
@@ -679,7 +670,6 @@ export declare const CreateTradeCloseResponse: z.ZodObject<{
679
670
  SELL: "SELL";
680
671
  }>;
681
672
  reduceOnly: z.ZodBoolean;
682
- leverage: z.ZodInt;
683
673
  quantity: z.ZodString;
684
674
  price: z.ZodString;
685
675
  filledQuantity: z.ZodString;
@@ -761,7 +751,6 @@ export declare const CreateTradeCloseResponse: z.ZodObject<{
761
751
  SELL: "SELL";
762
752
  }>;
763
753
  reduceOnly: z.ZodBoolean;
764
- leverage: z.ZodInt;
765
754
  quantity: z.ZodString;
766
755
  price: z.ZodString;
767
756
  filledQuantity: z.ZodString;
@@ -818,7 +807,6 @@ export declare const CreateTradeCloseResponse: z.ZodObject<{
818
807
  SELL: "SELL";
819
808
  }>;
820
809
  reduceOnly: z.ZodBoolean;
821
- leverage: z.ZodInt;
822
810
  quantity: z.ZodString;
823
811
  price: z.ZodString;
824
812
  filledQuantity: z.ZodString;
@@ -879,7 +867,6 @@ export declare const CreateTradeReverseResponse: z.ZodObject<{
879
867
  SELL: "SELL";
880
868
  }>;
881
869
  reduceOnly: z.ZodBoolean;
882
- leverage: z.ZodInt;
883
870
  quantity: z.ZodString;
884
871
  price: z.ZodString;
885
872
  filledQuantity: z.ZodString;
@@ -957,7 +944,6 @@ export declare const CreateTradeReverseResponse: z.ZodObject<{
957
944
  SELL: "SELL";
958
945
  }>;
959
946
  reduceOnly: z.ZodBoolean;
960
- leverage: z.ZodInt;
961
947
  quantity: z.ZodString;
962
948
  price: z.ZodString;
963
949
  filledQuantity: z.ZodString;
@@ -1039,7 +1025,6 @@ export declare const CreateTradeReverseResponse: z.ZodObject<{
1039
1025
  SELL: "SELL";
1040
1026
  }>;
1041
1027
  reduceOnly: z.ZodBoolean;
1042
- leverage: z.ZodInt;
1043
1028
  quantity: z.ZodString;
1044
1029
  price: z.ZodString;
1045
1030
  filledQuantity: z.ZodString;
@@ -1096,7 +1081,6 @@ export declare const CreateTradeReverseResponse: z.ZodObject<{
1096
1081
  SELL: "SELL";
1097
1082
  }>;
1098
1083
  reduceOnly: z.ZodBoolean;
1099
- leverage: z.ZodInt;
1100
1084
  quantity: z.ZodString;
1101
1085
  price: z.ZodString;
1102
1086
  filledQuantity: z.ZodString;
@@ -1157,7 +1141,6 @@ export declare const CreateTradeCloseAllResponse: z.ZodObject<{
1157
1141
  SELL: "SELL";
1158
1142
  }>;
1159
1143
  reduceOnly: z.ZodBoolean;
1160
- leverage: z.ZodInt;
1161
1144
  quantity: z.ZodString;
1162
1145
  price: z.ZodString;
1163
1146
  filledQuantity: z.ZodString;
@@ -1235,7 +1218,6 @@ export declare const CreateTradeCloseAllResponse: z.ZodObject<{
1235
1218
  SELL: "SELL";
1236
1219
  }>;
1237
1220
  reduceOnly: z.ZodBoolean;
1238
- leverage: z.ZodInt;
1239
1221
  quantity: z.ZodString;
1240
1222
  price: z.ZodString;
1241
1223
  filledQuantity: z.ZodString;
@@ -1317,7 +1299,6 @@ export declare const CreateTradeCloseAllResponse: z.ZodObject<{
1317
1299
  SELL: "SELL";
1318
1300
  }>;
1319
1301
  reduceOnly: z.ZodBoolean;
1320
- leverage: z.ZodInt;
1321
1302
  quantity: z.ZodString;
1322
1303
  price: z.ZodString;
1323
1304
  filledQuantity: z.ZodString;
@@ -1374,7 +1355,6 @@ export declare const CreateTradeCloseAllResponse: z.ZodObject<{
1374
1355
  SELL: "SELL";
1375
1356
  }>;
1376
1357
  reduceOnly: z.ZodBoolean;
1377
- leverage: z.ZodInt;
1378
1358
  quantity: z.ZodString;
1379
1359
  price: z.ZodString;
1380
1360
  filledQuantity: z.ZodString;
@@ -27,6 +27,7 @@ declare const BaseTrigger: z.ZodObject<{
27
27
  }>;
28
28
  ladderId: z.ZodOptional<z.ZodUUID>;
29
29
  ladderIndex: z.ZodOptional<z.ZodNumber>;
30
+ parentTriggerId: z.ZodOptional<z.ZodUUID>;
30
31
  triggeredAt: z.ZodOptional<z.ZodString>;
31
32
  cancelledAt: z.ZodOptional<z.ZodString>;
32
33
  cancelledReason: z.ZodOptional<z.ZodEnum<{
@@ -108,6 +109,7 @@ export declare const TriggerMarketOpen: z.ZodObject<{
108
109
  }>;
109
110
  ladderId: z.ZodOptional<z.ZodUUID>;
110
111
  ladderIndex: z.ZodOptional<z.ZodNumber>;
112
+ parentTriggerId: z.ZodOptional<z.ZodUUID>;
111
113
  triggeredAt: z.ZodOptional<z.ZodString>;
112
114
  cancelledAt: z.ZodOptional<z.ZodString>;
113
115
  cancelledReason: z.ZodOptional<z.ZodEnum<{
@@ -309,6 +311,7 @@ export declare const TriggerMarketAdjust: z.ZodObject<{
309
311
  }>;
310
312
  ladderId: z.ZodOptional<z.ZodUUID>;
311
313
  ladderIndex: z.ZodOptional<z.ZodNumber>;
314
+ parentTriggerId: z.ZodOptional<z.ZodUUID>;
312
315
  triggeredAt: z.ZodOptional<z.ZodString>;
313
316
  cancelledAt: z.ZodOptional<z.ZodString>;
314
317
  cancelledReason: z.ZodOptional<z.ZodEnum<{
@@ -556,6 +559,7 @@ export declare const TriggerMarketClose: z.ZodObject<{
556
559
  }>;
557
560
  ladderId: z.ZodOptional<z.ZodUUID>;
558
561
  ladderIndex: z.ZodOptional<z.ZodNumber>;
562
+ parentTriggerId: z.ZodOptional<z.ZodUUID>;
559
563
  triggeredAt: z.ZodOptional<z.ZodString>;
560
564
  cancelledAt: z.ZodOptional<z.ZodString>;
561
565
  cancelledReason: z.ZodOptional<z.ZodEnum<{
@@ -837,6 +841,7 @@ export declare const TriggerMarket: z.ZodDiscriminatedUnion<[z.ZodObject<{
837
841
  }>;
838
842
  ladderId: z.ZodOptional<z.ZodUUID>;
839
843
  ladderIndex: z.ZodOptional<z.ZodNumber>;
844
+ parentTriggerId: z.ZodOptional<z.ZodUUID>;
840
845
  triggeredAt: z.ZodOptional<z.ZodString>;
841
846
  cancelledAt: z.ZodOptional<z.ZodString>;
842
847
  cancelledReason: z.ZodOptional<z.ZodEnum<{
@@ -1037,6 +1042,7 @@ export declare const TriggerMarket: z.ZodDiscriminatedUnion<[z.ZodObject<{
1037
1042
  }>;
1038
1043
  ladderId: z.ZodOptional<z.ZodUUID>;
1039
1044
  ladderIndex: z.ZodOptional<z.ZodNumber>;
1045
+ parentTriggerId: z.ZodOptional<z.ZodUUID>;
1040
1046
  triggeredAt: z.ZodOptional<z.ZodString>;
1041
1047
  cancelledAt: z.ZodOptional<z.ZodString>;
1042
1048
  cancelledReason: z.ZodOptional<z.ZodEnum<{
@@ -1283,6 +1289,7 @@ export declare const TriggerMarket: z.ZodDiscriminatedUnion<[z.ZodObject<{
1283
1289
  }>;
1284
1290
  ladderId: z.ZodOptional<z.ZodUUID>;
1285
1291
  ladderIndex: z.ZodOptional<z.ZodNumber>;
1292
+ parentTriggerId: z.ZodOptional<z.ZodUUID>;
1286
1293
  triggeredAt: z.ZodOptional<z.ZodString>;
1287
1294
  cancelledAt: z.ZodOptional<z.ZodString>;
1288
1295
  cancelledReason: z.ZodOptional<z.ZodEnum<{
@@ -1564,6 +1571,7 @@ export declare const Trigger: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[
1564
1571
  }>;
1565
1572
  ladderId: z.ZodOptional<z.ZodUUID>;
1566
1573
  ladderIndex: z.ZodOptional<z.ZodNumber>;
1574
+ parentTriggerId: z.ZodOptional<z.ZodUUID>;
1567
1575
  triggeredAt: z.ZodOptional<z.ZodString>;
1568
1576
  cancelledAt: z.ZodOptional<z.ZodString>;
1569
1577
  cancelledReason: z.ZodOptional<z.ZodEnum<{
@@ -1764,6 +1772,7 @@ export declare const Trigger: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[
1764
1772
  }>;
1765
1773
  ladderId: z.ZodOptional<z.ZodUUID>;
1766
1774
  ladderIndex: z.ZodOptional<z.ZodNumber>;
1775
+ parentTriggerId: z.ZodOptional<z.ZodUUID>;
1767
1776
  triggeredAt: z.ZodOptional<z.ZodString>;
1768
1777
  cancelledAt: z.ZodOptional<z.ZodString>;
1769
1778
  cancelledReason: z.ZodOptional<z.ZodEnum<{
@@ -2010,6 +2019,7 @@ export declare const Trigger: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[
2010
2019
  }>;
2011
2020
  ladderId: z.ZodOptional<z.ZodUUID>;
2012
2021
  ladderIndex: z.ZodOptional<z.ZodNumber>;
2022
+ parentTriggerId: z.ZodOptional<z.ZodUUID>;
2013
2023
  triggeredAt: z.ZodOptional<z.ZodString>;
2014
2024
  cancelledAt: z.ZodOptional<z.ZodString>;
2015
2025
  cancelledReason: z.ZodOptional<z.ZodEnum<{
@@ -59,6 +59,10 @@ const BaseTrigger = z.object({
59
59
  * Zero-based rung index within the parent ladder
60
60
  */
61
61
  ladderIndex: z.number().int().optional(),
62
+ /**
63
+ * Source open trigger that spawned this attached close trigger, when it originated from a conditional open
64
+ */
65
+ parentTriggerId: z.uuid().optional(),
62
66
  /**
63
67
  * When the trigger was triggered
64
68
  */
@@ -19,6 +19,7 @@ export declare const TriggerListResponse: z.ZodObject<{
19
19
  }>;
20
20
  ladderId: z.ZodOptional<z.ZodUUID>;
21
21
  ladderIndex: z.ZodOptional<z.ZodNumber>;
22
+ parentTriggerId: z.ZodOptional<z.ZodUUID>;
22
23
  triggeredAt: z.ZodOptional<z.ZodString>;
23
24
  cancelledAt: z.ZodOptional<z.ZodString>;
24
25
  cancelledReason: z.ZodOptional<z.ZodEnum<{
@@ -219,6 +220,7 @@ export declare const TriggerListResponse: z.ZodObject<{
219
220
  }>;
220
221
  ladderId: z.ZodOptional<z.ZodUUID>;
221
222
  ladderIndex: z.ZodOptional<z.ZodNumber>;
223
+ parentTriggerId: z.ZodOptional<z.ZodUUID>;
222
224
  triggeredAt: z.ZodOptional<z.ZodString>;
223
225
  cancelledAt: z.ZodOptional<z.ZodString>;
224
226
  cancelledReason: z.ZodOptional<z.ZodEnum<{
@@ -465,6 +467,7 @@ export declare const TriggerListResponse: z.ZodObject<{
465
467
  }>;
466
468
  ladderId: z.ZodOptional<z.ZodUUID>;
467
469
  ladderIndex: z.ZodOptional<z.ZodNumber>;
470
+ parentTriggerId: z.ZodOptional<z.ZodUUID>;
468
471
  triggeredAt: z.ZodOptional<z.ZodString>;
469
472
  cancelledAt: z.ZodOptional<z.ZodString>;
470
473
  cancelledReason: z.ZodOptional<z.ZodEnum<{
@@ -749,6 +752,7 @@ export declare const CreateTriggerResponse: z.ZodObject<{
749
752
  }>;
750
753
  ladderId: z.ZodOptional<z.ZodUUID>;
751
754
  ladderIndex: z.ZodOptional<z.ZodNumber>;
755
+ parentTriggerId: z.ZodOptional<z.ZodUUID>;
752
756
  triggeredAt: z.ZodOptional<z.ZodString>;
753
757
  cancelledAt: z.ZodOptional<z.ZodString>;
754
758
  cancelledReason: z.ZodOptional<z.ZodEnum<{
@@ -949,6 +953,7 @@ export declare const CreateTriggerResponse: z.ZodObject<{
949
953
  }>;
950
954
  ladderId: z.ZodOptional<z.ZodUUID>;
951
955
  ladderIndex: z.ZodOptional<z.ZodNumber>;
956
+ parentTriggerId: z.ZodOptional<z.ZodUUID>;
952
957
  triggeredAt: z.ZodOptional<z.ZodString>;
953
958
  cancelledAt: z.ZodOptional<z.ZodString>;
954
959
  cancelledReason: z.ZodOptional<z.ZodEnum<{
@@ -1195,6 +1200,7 @@ export declare const CreateTriggerResponse: z.ZodObject<{
1195
1200
  }>;
1196
1201
  ladderId: z.ZodOptional<z.ZodUUID>;
1197
1202
  ladderIndex: z.ZodOptional<z.ZodNumber>;
1203
+ parentTriggerId: z.ZodOptional<z.ZodUUID>;
1198
1204
  triggeredAt: z.ZodOptional<z.ZodString>;
1199
1205
  cancelledAt: z.ZodOptional<z.ZodString>;
1200
1206
  cancelledReason: z.ZodOptional<z.ZodEnum<{
@@ -8,7 +8,6 @@ export declare const UserProfile: z.ZodObject<{
8
8
  role: z.ZodEnum<{
9
9
  basic: "basic";
10
10
  pro: "pro";
11
- admin: "admin";
12
11
  }>;
13
12
  address: z.ZodNullable<z.ZodString>;
14
13
  email: z.ZodNullable<z.ZodString>;
@@ -6,7 +6,7 @@ const UserPreferences = z.object({
6
6
  const UserProfile = z.object({
7
7
  id: z.uuid().describe("User UUID"),
8
8
  displayName: z.string().describe("Public display name"),
9
- role: z.enum(["basic", "pro", "admin"]).describe("User role"),
9
+ role: z.enum(["basic", "pro"]).describe("User role"),
10
10
  address: z.string().nullable().describe("Linked wallet address (for evm_wallet provider)"),
11
11
  email: z.string().nullable().describe("Linked email address (for email provider)"),
12
12
  emailVerified: z.boolean().describe("Whether the email is verified")
@@ -6,7 +6,6 @@ export declare const ProfileResponse: z.ZodObject<{
6
6
  role: z.ZodEnum<{
7
7
  basic: "basic";
8
8
  pro: "pro";
9
- admin: "admin";
10
9
  }>;
11
10
  address: z.ZodNullable<z.ZodString>;
12
11
  email: z.ZodNullable<z.ZodString>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/types",
3
- "version": "1.14.1",
3
+ "version": "1.15.0",
4
4
  "description": "Pear Protocol Types definitions",
5
5
  "private": false,
6
6
  "type": "module",
@@ -1,11 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const ClientIdEntity: z.ZodObject<{
3
- id: z.ZodUUID;
4
- code: z.ZodString;
5
- label: z.ZodString;
6
- description: z.ZodOptional<z.ZodString>;
7
- isActive: z.ZodBoolean;
8
- createdAt: z.ZodString;
9
- updatedAt: z.ZodString;
10
- }, z.core.$strip>;
11
- export type ClientIdEntity = z.output<typeof ClientIdEntity>;
@@ -1,13 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- const ClientIdEntity = z.object({
4
- id: z.uuid(),
5
- code: z.string(),
6
- label: z.string(),
7
- description: z.string().optional(),
8
- isActive: z.boolean(),
9
- createdAt: z.string(),
10
- updatedAt: z.string()
11
- }).describe("Client ID registry entry");
12
-
13
- export { ClientIdEntity };
@@ -1,14 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const CreateClientIdPayload: z.ZodObject<{
3
- code: z.ZodString;
4
- label: z.ZodString;
5
- description: z.ZodOptional<z.ZodString>;
6
- }, z.core.$strip>;
7
- export type CreateClientIdPayloadInput = z.input<typeof CreateClientIdPayload>;
8
- export type CreateClientIdPayload = z.output<typeof CreateClientIdPayload>;
9
- export declare const UpdateClientIdPayload: z.ZodObject<{
10
- label: z.ZodOptional<z.ZodString>;
11
- description: z.ZodOptional<z.ZodString>;
12
- }, z.core.$strip>;
13
- export type UpdateClientIdPayloadInput = z.input<typeof UpdateClientIdPayload>;
14
- export type UpdateClientIdPayload = z.output<typeof UpdateClientIdPayload>;
@@ -1,13 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- const CreateClientIdPayload = z.object({
4
- code: z.string().min(1).max(64).describe("Stable, immutable attribution key"),
5
- label: z.string().min(1).max(128),
6
- description: z.string().max(256).optional()
7
- }).describe("Payload to create a client ID");
8
- const UpdateClientIdPayload = z.object({
9
- label: z.string().min(1).max(128).optional(),
10
- description: z.string().max(256).optional()
11
- }).describe("Payload to update a client ID label/description");
12
-
13
- export { CreateClientIdPayload, UpdateClientIdPayload };
@@ -1,10 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const ListClientIdsParams: z.ZodObject<{
3
- scope: z.ZodDefault<z.ZodEnum<{
4
- active: "active";
5
- inactive: "inactive";
6
- all: "all";
7
- }>>;
8
- }, z.core.$strip>;
9
- export type ListClientIdsParamsInput = z.input<typeof ListClientIdsParams>;
10
- export type ListClientIdsParams = z.output<typeof ListClientIdsParams>;
@@ -1,7 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- const ListClientIdsParams = z.object({
4
- scope: z.enum(["active", "inactive", "all"]).default("all")
5
- });
6
-
7
- export { ListClientIdsParams };