@pear-protocol/types 0.0.16 → 0.0.18

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 (56) hide show
  1. package/dist/auth/entities.d.ts +10 -1
  2. package/dist/auth/entities.js +4 -2
  3. package/dist/auth/response.d.ts +13 -12
  4. package/dist/auth/response.js +6 -2
  5. package/dist/bundle.d.ts +1 -0
  6. package/dist/bundle.js +1 -0
  7. package/dist/common/address.d.ts +3 -0
  8. package/dist/common/address.js +5 -0
  9. package/dist/common/hex-string.d.ts +3 -0
  10. package/dist/common/hex-string.js +5 -0
  11. package/dist/common/refinement.d.ts +1 -0
  12. package/dist/common/refinement.js +9 -1
  13. package/dist/common/request.js +1 -1
  14. package/dist/common/schema.d.ts +1 -1
  15. package/dist/common/schema.js +1 -1
  16. package/dist/execution/entities.d.ts +6 -6
  17. package/dist/execution/responses.d.ts +2 -2
  18. package/dist/fill/entities.d.ts +20 -2
  19. package/dist/fill/entities.js +30 -5
  20. package/dist/fill/queries.d.ts +1 -0
  21. package/dist/fill/queries.js +3 -3
  22. package/dist/fill/responses.d.ts +46 -4
  23. package/dist/fill/responses.js +12 -1
  24. package/dist/instrument/responses.d.ts +4 -0
  25. package/dist/instrument/responses.js +5 -2
  26. package/dist/misc/index.d.ts +1 -1
  27. package/dist/position/entities.d.ts +5 -5
  28. package/dist/position/responses.d.ts +32 -2
  29. package/dist/position/responses.js +13 -1
  30. package/dist/schedule/entities.d.ts +82 -16
  31. package/dist/schedule/entities.js +5 -5
  32. package/dist/schedule/payloads.d.ts +4 -4
  33. package/dist/schedule/payloads.js +7 -7
  34. package/dist/schedule/responses.d.ts +66 -14
  35. package/dist/statistics/entities.d.ts +10 -3
  36. package/dist/statistics/entities.js +9 -3
  37. package/dist/statistics/queries.d.ts +26 -3
  38. package/dist/statistics/queries.js +11 -2
  39. package/dist/statistics/responses.d.ts +12 -3
  40. package/dist/statistics/responses.js +7 -4
  41. package/dist/sync/index.d.ts +2 -0
  42. package/dist/sync/index.js +2 -0
  43. package/dist/sync/payloads.d.ts +279 -0
  44. package/dist/sync/payloads.js +78 -0
  45. package/dist/sync/responses.d.ts +10 -0
  46. package/dist/sync/responses.js +11 -0
  47. package/dist/trade/payloads.d.ts +14 -4
  48. package/dist/trade/responses.d.ts +8 -8
  49. package/dist/trade-accounts/payloads.d.ts +13 -13
  50. package/dist/trade-accounts/payloads.js +7 -5
  51. package/dist/trigger/entities/index.d.ts +216 -46
  52. package/dist/trigger/entities/index.js +35 -9
  53. package/dist/trigger/payloads/index.d.ts +21 -6
  54. package/dist/trigger/payloads/index.js +24 -7
  55. package/dist/trigger/responses.d.ts +128 -28
  56. package/package.json +2 -2
@@ -1,8 +1,11 @@
1
1
  import { z } from 'zod';
2
- import { DailyStatistics } from './entities';
2
+ import { VolumeStatistics, OiStatistics } from './entities';
3
3
 
4
- const DailyStatisticsResponse = z.object({
5
- data: z.array(DailyStatistics)
4
+ const VolumeStatisticsResponse = z.object({
5
+ data: z.array(VolumeStatistics)
6
+ });
7
+ const OiStatisticsResponse = z.object({
8
+ data: z.array(OiStatistics)
6
9
  });
7
10
 
8
- export { DailyStatisticsResponse };
11
+ export { OiStatisticsResponse, VolumeStatisticsResponse };
@@ -0,0 +1,2 @@
1
+ export * from './payloads';
2
+ export * from './responses';
@@ -0,0 +1,2 @@
1
+ export * from './payloads';
2
+ export * from './responses';
@@ -0,0 +1,279 @@
1
+ import { z } from 'zod';
2
+ export declare const UnknownExternalFill: z.ZodObject<{
3
+ exchangeFillId: z.ZodString;
4
+ cloid: z.ZodNullable<z.ZodString>;
5
+ connector: z.ZodEnum<{
6
+ hyperliquid: "hyperliquid";
7
+ binance: "binance";
8
+ bybit: "bybit";
9
+ okx: "okx";
10
+ lighter: "lighter";
11
+ }>;
12
+ symbol: z.ZodString;
13
+ price: z.ZodString;
14
+ quantity: z.ZodString;
15
+ side: z.ZodEnum<{
16
+ BUY: "BUY";
17
+ SELL: "SELL";
18
+ }>;
19
+ reduceOnly: z.ZodBoolean;
20
+ timestamp: z.ZodNumber;
21
+ tradeFee: z.ZodString;
22
+ builderFee: z.ZodString;
23
+ liquidation: z.ZodNullable<z.ZodObject<{
24
+ mark: z.ZodString;
25
+ }, z.core.$strip>>;
26
+ }, z.core.$strip>;
27
+ export declare const ConfirmableExternalFill: z.ZodObject<{
28
+ type: z.ZodLiteral<"confirm">;
29
+ exchangeFillId: z.ZodString;
30
+ cloid: z.ZodString;
31
+ positionId: z.ZodUUID;
32
+ connector: z.ZodEnum<{
33
+ hyperliquid: "hyperliquid";
34
+ binance: "binance";
35
+ bybit: "bybit";
36
+ okx: "okx";
37
+ lighter: "lighter";
38
+ }>;
39
+ symbol: z.ZodString;
40
+ quantity: z.ZodString;
41
+ timestamp: z.ZodNumber;
42
+ tradeFee: z.ZodString;
43
+ builderFee: z.ZodString;
44
+ }, z.core.$strip>;
45
+ export declare const ReconcileReplacementExternalFill: z.ZodObject<{
46
+ exchangeFillId: z.ZodString;
47
+ cloid: z.ZodString;
48
+ connector: z.ZodEnum<{
49
+ hyperliquid: "hyperliquid";
50
+ binance: "binance";
51
+ bybit: "bybit";
52
+ okx: "okx";
53
+ lighter: "lighter";
54
+ }>;
55
+ symbol: z.ZodString;
56
+ price: z.ZodString;
57
+ quantity: z.ZodString;
58
+ side: z.ZodEnum<{
59
+ BUY: "BUY";
60
+ SELL: "SELL";
61
+ }>;
62
+ reduceOnly: z.ZodBoolean;
63
+ timestamp: z.ZodNumber;
64
+ tradeFee: z.ZodString;
65
+ builderFee: z.ZodString;
66
+ liquidation: z.ZodNullable<z.ZodObject<{
67
+ mark: z.ZodString;
68
+ }, z.core.$strip>>;
69
+ }, z.core.$strip>;
70
+ export declare const CreatableExternalFill: z.ZodObject<{
71
+ type: z.ZodLiteral<"create">;
72
+ exchangeFillId: z.ZodString;
73
+ cloid: z.ZodNullable<z.ZodString>;
74
+ positionId: z.ZodUUID;
75
+ connector: z.ZodEnum<{
76
+ hyperliquid: "hyperliquid";
77
+ binance: "binance";
78
+ bybit: "bybit";
79
+ okx: "okx";
80
+ lighter: "lighter";
81
+ }>;
82
+ symbol: z.ZodString;
83
+ price: z.ZodString;
84
+ quantity: z.ZodString;
85
+ side: z.ZodEnum<{
86
+ BUY: "BUY";
87
+ SELL: "SELL";
88
+ }>;
89
+ reduceOnly: z.ZodBoolean;
90
+ timestamp: z.ZodNumber;
91
+ tradeFee: z.ZodString;
92
+ liquidation: z.ZodNullable<z.ZodObject<{
93
+ mark: z.ZodString;
94
+ }, z.core.$strip>>;
95
+ original: z.ZodOptional<z.ZodObject<{
96
+ exchangeFillId: z.ZodString;
97
+ quantity: z.ZodString;
98
+ }, z.core.$strip>>;
99
+ }, z.core.$strip>;
100
+ export declare const ConfirmFillsRequest: z.ZodRecord<z.ZodUUID, z.ZodTuple<[z.ZodObject<{
101
+ type: z.ZodLiteral<"confirm">;
102
+ exchangeFillId: z.ZodString;
103
+ cloid: z.ZodString;
104
+ positionId: z.ZodUUID;
105
+ connector: z.ZodEnum<{
106
+ hyperliquid: "hyperliquid";
107
+ binance: "binance";
108
+ bybit: "bybit";
109
+ okx: "okx";
110
+ lighter: "lighter";
111
+ }>;
112
+ symbol: z.ZodString;
113
+ quantity: z.ZodString;
114
+ timestamp: z.ZodNumber;
115
+ tradeFee: z.ZodString;
116
+ builderFee: z.ZodString;
117
+ }, z.core.$strip>], z.ZodObject<{
118
+ type: z.ZodLiteral<"confirm">;
119
+ exchangeFillId: z.ZodString;
120
+ cloid: z.ZodString;
121
+ positionId: z.ZodUUID;
122
+ connector: z.ZodEnum<{
123
+ hyperliquid: "hyperliquid";
124
+ binance: "binance";
125
+ bybit: "bybit";
126
+ okx: "okx";
127
+ lighter: "lighter";
128
+ }>;
129
+ symbol: z.ZodString;
130
+ quantity: z.ZodString;
131
+ timestamp: z.ZodNumber;
132
+ tradeFee: z.ZodString;
133
+ builderFee: z.ZodString;
134
+ }, z.core.$strip>>>;
135
+ export declare const ReconcileFillsRequest: z.ZodRecord<z.ZodString, z.ZodTuple<[z.ZodObject<{
136
+ exchangeFillId: z.ZodString;
137
+ cloid: z.ZodString;
138
+ connector: z.ZodEnum<{
139
+ hyperliquid: "hyperliquid";
140
+ binance: "binance";
141
+ bybit: "bybit";
142
+ okx: "okx";
143
+ lighter: "lighter";
144
+ }>;
145
+ symbol: z.ZodString;
146
+ price: z.ZodString;
147
+ quantity: z.ZodString;
148
+ side: z.ZodEnum<{
149
+ BUY: "BUY";
150
+ SELL: "SELL";
151
+ }>;
152
+ reduceOnly: z.ZodBoolean;
153
+ timestamp: z.ZodNumber;
154
+ tradeFee: z.ZodString;
155
+ builderFee: z.ZodString;
156
+ liquidation: z.ZodNullable<z.ZodObject<{
157
+ mark: z.ZodString;
158
+ }, z.core.$strip>>;
159
+ }, z.core.$strip>, z.ZodObject<{
160
+ exchangeFillId: z.ZodString;
161
+ cloid: z.ZodString;
162
+ connector: z.ZodEnum<{
163
+ hyperliquid: "hyperliquid";
164
+ binance: "binance";
165
+ bybit: "bybit";
166
+ okx: "okx";
167
+ lighter: "lighter";
168
+ }>;
169
+ symbol: z.ZodString;
170
+ price: z.ZodString;
171
+ quantity: z.ZodString;
172
+ side: z.ZodEnum<{
173
+ BUY: "BUY";
174
+ SELL: "SELL";
175
+ }>;
176
+ reduceOnly: z.ZodBoolean;
177
+ timestamp: z.ZodNumber;
178
+ tradeFee: z.ZodString;
179
+ builderFee: z.ZodString;
180
+ liquidation: z.ZodNullable<z.ZodObject<{
181
+ mark: z.ZodString;
182
+ }, z.core.$strip>>;
183
+ }, z.core.$strip>], z.ZodObject<{
184
+ exchangeFillId: z.ZodString;
185
+ cloid: z.ZodString;
186
+ connector: z.ZodEnum<{
187
+ hyperliquid: "hyperliquid";
188
+ binance: "binance";
189
+ bybit: "bybit";
190
+ okx: "okx";
191
+ lighter: "lighter";
192
+ }>;
193
+ symbol: z.ZodString;
194
+ price: z.ZodString;
195
+ quantity: z.ZodString;
196
+ side: z.ZodEnum<{
197
+ BUY: "BUY";
198
+ SELL: "SELL";
199
+ }>;
200
+ reduceOnly: z.ZodBoolean;
201
+ timestamp: z.ZodNumber;
202
+ tradeFee: z.ZodString;
203
+ builderFee: z.ZodString;
204
+ liquidation: z.ZodNullable<z.ZodObject<{
205
+ mark: z.ZodString;
206
+ }, z.core.$strip>>;
207
+ }, z.core.$strip>>>;
208
+ export declare const CreateFillsRequest: z.ZodRecord<z.ZodUUID, z.ZodTuple<[z.ZodObject<{
209
+ type: z.ZodLiteral<"create">;
210
+ exchangeFillId: z.ZodString;
211
+ cloid: z.ZodNullable<z.ZodString>;
212
+ positionId: z.ZodUUID;
213
+ connector: z.ZodEnum<{
214
+ hyperliquid: "hyperliquid";
215
+ binance: "binance";
216
+ bybit: "bybit";
217
+ okx: "okx";
218
+ lighter: "lighter";
219
+ }>;
220
+ symbol: z.ZodString;
221
+ price: z.ZodString;
222
+ quantity: z.ZodString;
223
+ side: z.ZodEnum<{
224
+ BUY: "BUY";
225
+ SELL: "SELL";
226
+ }>;
227
+ reduceOnly: z.ZodBoolean;
228
+ timestamp: z.ZodNumber;
229
+ tradeFee: z.ZodString;
230
+ liquidation: z.ZodNullable<z.ZodObject<{
231
+ mark: z.ZodString;
232
+ }, z.core.$strip>>;
233
+ original: z.ZodOptional<z.ZodObject<{
234
+ exchangeFillId: z.ZodString;
235
+ quantity: z.ZodString;
236
+ }, z.core.$strip>>;
237
+ }, z.core.$strip>], z.ZodObject<{
238
+ type: z.ZodLiteral<"create">;
239
+ exchangeFillId: z.ZodString;
240
+ cloid: z.ZodNullable<z.ZodString>;
241
+ positionId: z.ZodUUID;
242
+ connector: z.ZodEnum<{
243
+ hyperliquid: "hyperliquid";
244
+ binance: "binance";
245
+ bybit: "bybit";
246
+ okx: "okx";
247
+ lighter: "lighter";
248
+ }>;
249
+ symbol: z.ZodString;
250
+ price: z.ZodString;
251
+ quantity: z.ZodString;
252
+ side: z.ZodEnum<{
253
+ BUY: "BUY";
254
+ SELL: "SELL";
255
+ }>;
256
+ reduceOnly: z.ZodBoolean;
257
+ timestamp: z.ZodNumber;
258
+ tradeFee: z.ZodString;
259
+ liquidation: z.ZodNullable<z.ZodObject<{
260
+ mark: z.ZodString;
261
+ }, z.core.$strip>>;
262
+ original: z.ZodOptional<z.ZodObject<{
263
+ exchangeFillId: z.ZodString;
264
+ quantity: z.ZodString;
265
+ }, z.core.$strip>>;
266
+ }, z.core.$strip>>>;
267
+ export declare const SyncSinceRequest: z.ZodObject<{
268
+ overlapMs: z.ZodNumber;
269
+ nowMs: z.ZodOptional<z.ZodNumber>;
270
+ bootstrapLookbackMs: z.ZodOptional<z.ZodNumber>;
271
+ }, z.core.$strip>;
272
+ export type ConfirmFillsRequest = z.output<typeof ConfirmFillsRequest>;
273
+ export type ReconcileFillsRequest = z.output<typeof ReconcileFillsRequest>;
274
+ export type CreateFillsRequest = z.output<typeof CreateFillsRequest>;
275
+ export type SyncSinceRequest = z.output<typeof SyncSinceRequest>;
276
+ export type UnknownExternalFill = z.output<typeof UnknownExternalFill>;
277
+ export type ReconcileReplacementExternalFill = z.output<typeof ReconcileReplacementExternalFill>;
278
+ export type ConfirmableExternalFill = z.output<typeof ConfirmableExternalFill>;
279
+ export type CreatableExternalFill = z.output<typeof CreatableExternalFill>;
@@ -0,0 +1,78 @@
1
+ import { z } from 'zod';
2
+ import { RefineMinimumOneKeyValuePair } from '../common/refinement';
3
+ import { UnsignedDecimalString, Side } from '../common/schema';
4
+ import { Connector } from '../connector';
5
+ import { InstrumentId } from '../instrument';
6
+
7
+ const UnknownExternalFill = z.object({
8
+ exchangeFillId: z.string().trim().min(1, "Exchange fill ID must be non-empty"),
9
+ cloid: z.string().nullable(),
10
+ connector: Connector,
11
+ symbol: InstrumentId,
12
+ price: UnsignedDecimalString,
13
+ quantity: UnsignedDecimalString,
14
+ side: Side,
15
+ reduceOnly: z.boolean(),
16
+ timestamp: z.number().int().positive().describe("Unix timestamp in milliseconds"),
17
+ tradeFee: UnsignedDecimalString,
18
+ builderFee: UnsignedDecimalString,
19
+ liquidation: z.object({ mark: UnsignedDecimalString }).nullable()
20
+ });
21
+ const ConfirmableExternalFill = z.object({
22
+ type: z.literal("confirm"),
23
+ exchangeFillId: z.string().trim().min(1, "Exchange fill ID must be non-empty"),
24
+ cloid: z.string(),
25
+ positionId: z.uuid().describe("Position ID"),
26
+ connector: Connector,
27
+ symbol: InstrumentId,
28
+ quantity: UnsignedDecimalString,
29
+ timestamp: z.number().int().positive().describe("Unix timestamp in milliseconds"),
30
+ tradeFee: UnsignedDecimalString,
31
+ builderFee: UnsignedDecimalString
32
+ });
33
+ const ReconcileReplacementExternalFill = z.object({
34
+ exchangeFillId: z.string().trim().min(1, "Exchange fill ID must be non-empty"),
35
+ cloid: z.string(),
36
+ connector: Connector,
37
+ symbol: InstrumentId,
38
+ price: UnsignedDecimalString,
39
+ quantity: UnsignedDecimalString,
40
+ side: Side,
41
+ reduceOnly: z.boolean(),
42
+ timestamp: z.number().int().positive().describe("Unix timestamp in milliseconds"),
43
+ tradeFee: UnsignedDecimalString,
44
+ builderFee: UnsignedDecimalString,
45
+ liquidation: z.object({ mark: UnsignedDecimalString }).nullable()
46
+ });
47
+ const CreatableExternalFill = z.object({
48
+ type: z.literal("create"),
49
+ exchangeFillId: z.string().trim().min(1, "Exchange fill ID must be non-empty"),
50
+ cloid: z.string().nullable(),
51
+ positionId: z.uuid().describe("Position ID"),
52
+ connector: Connector,
53
+ symbol: InstrumentId,
54
+ price: UnsignedDecimalString,
55
+ quantity: UnsignedDecimalString,
56
+ side: Side,
57
+ reduceOnly: z.boolean(),
58
+ timestamp: z.number().int().positive().describe("Unix timestamp in milliseconds"),
59
+ tradeFee: UnsignedDecimalString,
60
+ liquidation: z.object({ mark: UnsignedDecimalString }).nullable(),
61
+ original: z.object({
62
+ exchangeFillId: z.string().trim().min(1, "Exchange fill ID must be non-empty"),
63
+ quantity: UnsignedDecimalString
64
+ }).optional()
65
+ });
66
+ const ConfirmFillsRequest = z.record(z.uuid().describe("Position ID"), z.tuple([ConfirmableExternalFill]).rest(ConfirmableExternalFill)).superRefine(RefineMinimumOneKeyValuePair);
67
+ const ReconcileFillsRequest = z.record(
68
+ z.string().trim().min(1, "CLOID must be non-empty"),
69
+ z.tuple([ReconcileReplacementExternalFill, ReconcileReplacementExternalFill]).rest(ReconcileReplacementExternalFill)
70
+ ).superRefine(RefineMinimumOneKeyValuePair);
71
+ const CreateFillsRequest = z.record(z.uuid().describe("Position ID"), z.tuple([CreatableExternalFill]).rest(CreatableExternalFill)).superRefine(RefineMinimumOneKeyValuePair);
72
+ const SyncSinceRequest = z.object({
73
+ overlapMs: z.number().int().positive(),
74
+ nowMs: z.number().int().nonnegative().optional(),
75
+ bootstrapLookbackMs: z.number().int().positive().optional()
76
+ });
77
+
78
+ export { ConfirmFillsRequest, ConfirmableExternalFill, CreatableExternalFill, CreateFillsRequest, ReconcileFillsRequest, ReconcileReplacementExternalFill, SyncSinceRequest, UnknownExternalFill };
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ export declare const SyncFillsResponse: z.ZodObject<{}, z.core.$strip>;
3
+ export declare const SyncSinceResponse: z.ZodObject<{
4
+ since: z.ZodISODateTime;
5
+ sinceMs: z.ZodNumber;
6
+ safeTs: z.ZodOptional<z.ZodNumber>;
7
+ confirmedExchangeFillIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
8
+ }, z.core.$strip>;
9
+ export type SyncFillsResponse = z.output<typeof SyncFillsResponse>;
10
+ export type SyncSinceResponse = z.output<typeof SyncSinceResponse>;
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+
3
+ const SyncFillsResponse = z.object({});
4
+ const SyncSinceResponse = z.object({
5
+ since: z.iso.datetime(),
6
+ sinceMs: z.number().int().nonnegative(),
7
+ safeTs: z.number().int().nonnegative().optional(),
8
+ confirmedExchangeFillIds: z.array(z.string()).optional()
9
+ });
10
+
11
+ export { SyncFillsResponse, SyncSinceResponse };
@@ -67,10 +67,15 @@ export declare const CreateMarketOpen: z.ZodObject<{
67
67
  threshold_bps: z.ZodNumber;
68
68
  }, z.core.$strip>;
69
69
  }, z.core.$strip>], "type">;
70
- bracketType: z.ZodOptional<z.ZodEnum<{
70
+ bracketType: z.ZodEnum<{
71
71
  STOP_LOSS: "STOP_LOSS";
72
72
  TAKE_PROFIT: "TAKE_PROFIT";
73
- }>>;
73
+ NONE: "NONE";
74
+ }>;
75
+ trailing: z.ZodOptional<z.ZodObject<{
76
+ deltaValue: z.ZodNumber;
77
+ activationValue: z.ZodNumber;
78
+ }, z.core.$strip>>;
74
79
  }, z.core.$strip>>;
75
80
  }, z.core.$strip>;
76
81
  export declare const CreateMarketAdjust: z.ZodObject<{
@@ -175,10 +180,15 @@ export declare const CreateTradeOpen: z.ZodDiscriminatedUnion<[z.ZodObject<{
175
180
  threshold_bps: z.ZodNumber;
176
181
  }, z.core.$strip>;
177
182
  }, z.core.$strip>], "type">;
178
- bracketType: z.ZodOptional<z.ZodEnum<{
183
+ bracketType: z.ZodEnum<{
179
184
  STOP_LOSS: "STOP_LOSS";
180
185
  TAKE_PROFIT: "TAKE_PROFIT";
181
- }>>;
186
+ NONE: "NONE";
187
+ }>;
188
+ trailing: z.ZodOptional<z.ZodObject<{
189
+ deltaValue: z.ZodNumber;
190
+ activationValue: z.ZodNumber;
191
+ }, z.core.$strip>>;
182
192
  }, z.core.$strip>>;
183
193
  }, z.core.$strip>], "type">;
184
194
  export declare const CreateTradeAdjust: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -133,7 +133,7 @@ export declare const CreateTradeOpenResponse: z.ZodObject<{
133
133
  orderType: z.ZodLiteral<"MARKET">;
134
134
  position: z.ZodObject<{
135
135
  id: z.ZodUUID;
136
- exposure: z.ZodRecord<z.ZodString, z.ZodString>;
136
+ exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
137
137
  }, z.core.$strip>;
138
138
  legs: z.ZodTuple<[z.ZodObject<{
139
139
  symbol: z.ZodString;
@@ -215,7 +215,7 @@ export declare const CreateTradeOpenResponse: z.ZodObject<{
215
215
  orderType: z.ZodLiteral<"MARKET">;
216
216
  position: z.ZodObject<{
217
217
  id: z.ZodUUID;
218
- exposure: z.ZodRecord<z.ZodString, z.ZodString>;
218
+ exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
219
219
  }, z.core.$strip>;
220
220
  }, z.core.$strip>], "intent">], "orderType">;
221
221
  }, z.core.$strip>;
@@ -354,7 +354,7 @@ export declare const CreateTradeAdjustResponse: z.ZodObject<{
354
354
  orderType: z.ZodLiteral<"MARKET">;
355
355
  position: z.ZodObject<{
356
356
  id: z.ZodUUID;
357
- exposure: z.ZodRecord<z.ZodString, z.ZodString>;
357
+ exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
358
358
  }, z.core.$strip>;
359
359
  legs: z.ZodTuple<[z.ZodObject<{
360
360
  symbol: z.ZodString;
@@ -436,7 +436,7 @@ export declare const CreateTradeAdjustResponse: z.ZodObject<{
436
436
  orderType: z.ZodLiteral<"MARKET">;
437
437
  position: z.ZodObject<{
438
438
  id: z.ZodUUID;
439
- exposure: z.ZodRecord<z.ZodString, z.ZodString>;
439
+ exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
440
440
  }, z.core.$strip>;
441
441
  }, z.core.$strip>], "intent">], "orderType">;
442
442
  }, z.core.$strip>;
@@ -575,7 +575,7 @@ export declare const CreateTradeCloseResponse: z.ZodObject<{
575
575
  orderType: z.ZodLiteral<"MARKET">;
576
576
  position: z.ZodObject<{
577
577
  id: z.ZodUUID;
578
- exposure: z.ZodRecord<z.ZodString, z.ZodString>;
578
+ exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
579
579
  }, z.core.$strip>;
580
580
  legs: z.ZodTuple<[z.ZodObject<{
581
581
  symbol: z.ZodString;
@@ -657,7 +657,7 @@ export declare const CreateTradeCloseResponse: z.ZodObject<{
657
657
  orderType: z.ZodLiteral<"MARKET">;
658
658
  position: z.ZodObject<{
659
659
  id: z.ZodUUID;
660
- exposure: z.ZodRecord<z.ZodString, z.ZodString>;
660
+ exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
661
661
  }, z.core.$strip>;
662
662
  }, z.core.$strip>], "intent">], "orderType">;
663
663
  }, z.core.$strip>;
@@ -796,7 +796,7 @@ export declare const CreateTradeCloseAllResponse: z.ZodObject<{
796
796
  orderType: z.ZodLiteral<"MARKET">;
797
797
  position: z.ZodObject<{
798
798
  id: z.ZodUUID;
799
- exposure: z.ZodRecord<z.ZodString, z.ZodString>;
799
+ exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
800
800
  }, z.core.$strip>;
801
801
  legs: z.ZodTuple<[z.ZodObject<{
802
802
  symbol: z.ZodString;
@@ -878,7 +878,7 @@ export declare const CreateTradeCloseAllResponse: z.ZodObject<{
878
878
  orderType: z.ZodLiteral<"MARKET">;
879
879
  position: z.ZodObject<{
880
880
  id: z.ZodUUID;
881
- exposure: z.ZodRecord<z.ZodString, z.ZodString>;
881
+ exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
882
882
  }, z.core.$strip>;
883
883
  }, z.core.$strip>], "intent">], "orderType">>;
884
884
  }, z.core.$strip>;
@@ -3,15 +3,15 @@ import { z } from 'zod';
3
3
  * Hyperliquid connector credentials
4
4
  */
5
5
  declare const CreateHyperliquidCredentials: z.ZodObject<{
6
- signer_key: z.ZodString;
6
+ signer_key: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
7
7
  }, z.core.$strip>;
8
8
  /**
9
9
  * Hyperliquid connector metadata
10
10
  */
11
11
  declare const CreateHyperliquidMetadata: z.ZodObject<{
12
- agentWalletAddress: z.ZodString;
12
+ agentWalletAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
13
13
  isSubaccount: z.ZodBoolean;
14
- mainAccountAddress: z.ZodString;
14
+ mainAccountAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
15
15
  }, z.core.$strip>;
16
16
  declare const CreateBinanceCredentials: z.ZodObject<{
17
17
  read: z.ZodObject<{
@@ -49,7 +49,7 @@ declare const CreateLighterCredentials: z.ZodObject<{
49
49
  * Lighter connector metadata
50
50
  */
51
51
  declare const CreateLighterMetadata: z.ZodObject<{
52
- l1_address: z.ZodString;
52
+ l1_address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
53
53
  }, z.core.$strip>;
54
54
  /**
55
55
  * Payload to create a new trade account
@@ -57,14 +57,14 @@ declare const CreateLighterMetadata: z.ZodObject<{
57
57
  export declare const CreateTradeAccount: z.ZodDiscriminatedUnion<[z.ZodObject<{
58
58
  connector: z.ZodLiteral<"hyperliquid">;
59
59
  alias: z.ZodString;
60
- exchangeIdentifier: z.ZodString;
60
+ exchangeIdentifier: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
61
61
  credentials: z.ZodObject<{
62
- signer_key: z.ZodString;
62
+ signer_key: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
63
63
  }, z.core.$strip>;
64
64
  metadata: z.ZodObject<{
65
- agentWalletAddress: z.ZodString;
65
+ agentWalletAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
66
66
  isSubaccount: z.ZodBoolean;
67
- mainAccountAddress: z.ZodString;
67
+ mainAccountAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
68
68
  }, z.core.$strip>;
69
69
  }, z.core.$strip>, z.ZodObject<{
70
70
  connector: z.ZodLiteral<"binance">;
@@ -106,7 +106,7 @@ export declare const CreateTradeAccount: z.ZodDiscriminatedUnion<[z.ZodObject<{
106
106
  api_key_index: z.ZodNumber;
107
107
  }, z.core.$strip>;
108
108
  metadata: z.ZodObject<{
109
- l1_address: z.ZodString;
109
+ l1_address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
110
110
  }, z.core.$strip>;
111
111
  }, z.core.$strip>], "connector">;
112
112
  /**
@@ -116,12 +116,12 @@ export declare const UpdateTradeAccount: z.ZodDiscriminatedUnion<[z.ZodObject<{
116
116
  connector: z.ZodLiteral<"hyperliquid">;
117
117
  alias: z.ZodOptional<z.ZodString>;
118
118
  credentials: z.ZodOptional<z.ZodObject<{
119
- signer_key: z.ZodString;
119
+ signer_key: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
120
120
  }, z.core.$strip>>;
121
121
  metadata: z.ZodOptional<z.ZodObject<{
122
- agentWalletAddress: z.ZodString;
122
+ agentWalletAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
123
123
  isSubaccount: z.ZodBoolean;
124
- mainAccountAddress: z.ZodString;
124
+ mainAccountAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
125
125
  }, z.core.$strip>>;
126
126
  }, z.core.$strip>, z.ZodObject<{
127
127
  connector: z.ZodLiteral<"binance">;
@@ -162,7 +162,7 @@ export declare const UpdateTradeAccount: z.ZodDiscriminatedUnion<[z.ZodObject<{
162
162
  api_key_index: z.ZodNumber;
163
163
  }, z.core.$strip>>;
164
164
  metadata: z.ZodOptional<z.ZodObject<{
165
- l1_address: z.ZodString;
165
+ l1_address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
166
166
  }, z.core.$strip>>;
167
167
  }, z.core.$strip>], "connector">;
168
168
  export type CreateHyperliquidCredentials = z.infer<typeof CreateHyperliquidCredentials>;
@@ -1,12 +1,14 @@
1
1
  import { z } from 'zod';
2
+ import { EthereumAddress } from '../common/address';
3
+ import { HexString } from '../common/hex-string';
2
4
 
3
5
  const CreateHyperliquidCredentials = z.object({
4
- signer_key: z.string().min(1, "Signer key is required")
6
+ signer_key: HexString
5
7
  });
6
8
  const CreateHyperliquidMetadata = z.object({
7
- agentWalletAddress: z.string().regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereum address"),
9
+ agentWalletAddress: EthereumAddress,
8
10
  isSubaccount: z.boolean(),
9
- mainAccountAddress: z.string().regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereum address")
11
+ mainAccountAddress: EthereumAddress
10
12
  });
11
13
  const BinanceApiKeyPair = z.object({
12
14
  api_key: z.string().min(1, "API key is required"),
@@ -30,13 +32,13 @@ const CreateLighterCredentials = z.object({
30
32
  api_key_index: z.number().int().min(4, "API key slots 0-3 are reserved; use 4-254").max(254, "API key index must be <= 254")
31
33
  });
32
34
  const CreateLighterMetadata = z.object({
33
- l1_address: z.string().regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereum address")
35
+ l1_address: EthereumAddress
34
36
  });
35
37
  const AccountAlias = z.string().min(1, "Alias is required").max(100, "Alias must be 100 characters or less");
36
38
  const CreateHyperliquidAccount = z.object({
37
39
  connector: z.literal("hyperliquid"),
38
40
  alias: AccountAlias,
39
- exchangeIdentifier: z.string().regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereum address"),
41
+ exchangeIdentifier: EthereumAddress,
40
42
  credentials: CreateHyperliquidCredentials,
41
43
  metadata: CreateHyperliquidMetadata
42
44
  });