@pear-protocol/types 2.7.0 → 2.10.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 (37) hide show
  1. package/dist/bundle.d.ts +1 -0
  2. package/dist/bundle.js +1 -0
  3. package/dist/common/address.d.ts +8 -2
  4. package/dist/common/trade-legs.d.ts +33 -0
  5. package/dist/common/trade-legs.js +12 -1
  6. package/dist/execution/entities.d.ts +107 -0
  7. package/dist/execution/entities.js +25 -2
  8. package/dist/execution/responses.d.ts +62 -0
  9. package/dist/ladder/entities.d.ts +10 -10
  10. package/dist/ladder/responses.d.ts +30 -30
  11. package/dist/position/responses.d.ts +3 -2
  12. package/dist/sync/payloads.d.ts +11 -0
  13. package/dist/sync/payloads.js +6 -2
  14. package/dist/sync/responses.d.ts +1 -0
  15. package/dist/sync/responses.js +8 -1
  16. package/dist/trade/payloads.d.ts +28 -74
  17. package/dist/trade/payloads.js +17 -21
  18. package/dist/trade/responses.d.ts +155 -9
  19. package/dist/trade/responses.js +1 -9
  20. package/dist/trade-accounts/payloads.d.ts +14 -13
  21. package/dist/trigger/common/index.d.ts +1 -1
  22. package/dist/trigger/entities/index.d.ts +32 -32
  23. package/dist/trigger/payloads/index.d.ts +6 -6
  24. package/dist/trigger/responses.d.ts +20 -20
  25. package/dist/users/entities.d.ts +5 -4
  26. package/dist/users/response.d.ts +2 -2
  27. package/dist/vaults/entities.d.ts +111 -0
  28. package/dist/vaults/entities.js +96 -0
  29. package/dist/vaults/index.d.ts +4 -0
  30. package/dist/vaults/index.js +4 -0
  31. package/dist/vaults/payloads.d.ts +140 -0
  32. package/dist/vaults/payloads.js +65 -0
  33. package/dist/vaults/queries.d.ts +96 -0
  34. package/dist/vaults/queries.js +66 -0
  35. package/dist/vaults/responses.d.ts +574 -0
  36. package/dist/vaults/responses.js +359 -0
  37. package/package.json +1 -1
@@ -1,22 +1,22 @@
1
1
  import { z } from 'zod';
2
2
  import { ClientIdCode } from '../common/client-id';
3
3
  import { RefineMinimumOneSymbol, RefineUniqueSymbols } from '../common/refinement';
4
- import { UnsignedDecimalString } from '../common/schema';
5
- import { TradeLegPostOnly, TradeLeg } from '../common/trade-legs';
4
+ import { TradeLegPostOnlyWithMaxImpactPrice, TradeLegWithMaxImpactPrice } from '../common/trade-legs';
6
5
  import { AttachTriggerMarketClose } from '../trigger';
7
6
 
8
- const BOUNDED_MARKET_MAX_TTL_MS = 1e4;
9
- const BoundedTradeLeg = TradeLegPostOnly.safeExtend({
10
- limitPrice: UnsignedDecimalString.refine((value) => Number.isFinite(Number(value)) && Number(value) > 0)
11
- });
12
7
  const CreateMarketOpen = z.object({
13
8
  type: z.literal("MARKET"),
14
9
  /**
15
10
  * Requested legs
16
11
  */
17
12
  legs: z.tuple([
18
- TradeLegPostOnly
19
- ]).rest(TradeLegPostOnly).superRefine(RefineMinimumOneSymbol).superRefine(RefineUniqueSymbols).describe("Array of legs to make up the exposure"),
13
+ TradeLegPostOnlyWithMaxImpactPrice
14
+ ]).rest(TradeLegPostOnlyWithMaxImpactPrice).superRefine(RefineMinimumOneSymbol).superRefine(RefineUniqueSymbols).describe("Array of legs to make up the exposure"),
15
+ /**
16
+ * Optional absolute deadline (epoch ms); the engine refuses to plan the open after this time.
17
+ * The floor rejects an epoch-seconds timestamp sent by mistake, which would always be expired.
18
+ */
19
+ expiresAt: z.number().int().min(1e12).optional(),
20
20
  /**
21
21
  * Close trigger to attach to the execution
22
22
  */
@@ -26,22 +26,19 @@ const CreateMarketOpen = z.object({
26
26
  */
27
27
  clientId: ClientIdCode
28
28
  });
29
- const CreateBoundedMarketOpen = z.object({
30
- type: z.literal("BOUNDED_MARKET"),
31
- expiresAt: z.number().int().positive().max(Number.MAX_SAFE_INTEGER),
32
- legs: z.tuple([
33
- BoundedTradeLeg
34
- ]).rest(BoundedTradeLeg).superRefine(RefineMinimumOneSymbol).superRefine(RefineUniqueSymbols),
35
- clientId: ClientIdCode
36
- });
37
29
  const CreateMarketAdjust = z.object({
38
30
  type: z.literal("MARKET"),
39
31
  /**
40
32
  * Requested legs
41
33
  */
42
34
  legs: z.tuple([
43
- TradeLeg
44
- ]).rest(TradeLeg).superRefine(RefineMinimumOneSymbol).superRefine(RefineUniqueSymbols).describe("Array of legs to modify the position"),
35
+ TradeLegWithMaxImpactPrice
36
+ ]).rest(TradeLegWithMaxImpactPrice).superRefine(RefineMinimumOneSymbol).superRefine(RefineUniqueSymbols).describe("Array of legs to modify the position"),
37
+ /**
38
+ * Optional absolute deadline (epoch ms); the engine refuses to plan the adjust after this time.
39
+ * The floor rejects an epoch-seconds timestamp sent by mistake, which would always be expired.
40
+ */
41
+ expiresAt: z.number().int().min(1e12).optional(),
45
42
  /**
46
43
  * Attribution route code (client_ids.code)
47
44
  */
@@ -69,8 +66,7 @@ const CreateMarketCloseAll = z.object({
69
66
  clientId: ClientIdCode
70
67
  });
71
68
  const CreateTradeOpen = z.discriminatedUnion("type", [
72
- CreateMarketOpen,
73
- CreateBoundedMarketOpen
69
+ CreateMarketOpen
74
70
  ]);
75
71
  const CreateTradeAdjust = z.discriminatedUnion("type", [
76
72
  CreateMarketAdjust
@@ -85,4 +81,4 @@ const CreateTradeCloseAll = z.discriminatedUnion("type", [
85
81
  CreateMarketCloseAll
86
82
  ]);
87
83
 
88
- export { BOUNDED_MARKET_MAX_TTL_MS, CreateBoundedMarketOpen, CreateMarketAdjust, CreateMarketClose, CreateMarketCloseAll, CreateMarketOpen, CreateMarketReverse, CreateTradeAdjust, CreateTradeClose, CreateTradeCloseAll, CreateTradeOpen, CreateTradeReverse };
84
+ export { CreateMarketAdjust, CreateMarketClose, CreateMarketCloseAll, CreateMarketOpen, CreateMarketReverse, CreateTradeAdjust, CreateTradeClose, CreateTradeCloseAll, CreateTradeOpen, CreateTradeReverse };
@@ -1,13 +1,4 @@
1
1
  import { z } from 'zod';
2
- /** An authenticated admission capability; old workers also reject the new persisted discriminant. */
3
- export declare const TradeCapabilities: z.ZodObject<{
4
- boundedMarketOpen: z.ZodObject<{
5
- version: z.ZodLiteral<1>;
6
- maxTtlMs: z.ZodLiteral<10000>;
7
- connectors: z.ZodArray<z.ZodLiteral<"hyperliquid">>;
8
- }, z.core.$strip>;
9
- }, z.core.$strip>;
10
- export type TradeCapabilities = z.output<typeof TradeCapabilities>;
11
2
  export declare const CreateTradeOpenResponse: z.ZodObject<{
12
3
  execution: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
13
4
  id: z.ZodUUID;
@@ -62,8 +53,17 @@ export declare const CreateTradeOpenResponse: z.ZodObject<{
62
53
  filledQuantity: z.ZodString;
63
54
  filledPrice: z.ZodOptional<z.ZodString>;
64
55
  }, z.core.$strip>], "type">>>;
56
+ fulfillment: z.ZodOptional<z.ZodEnum<{
57
+ PENDING: "PENDING";
58
+ PARTIAL: "PARTIAL";
59
+ COMPLETE: "COMPLETE";
60
+ NONE: "NONE";
61
+ }>>;
65
62
  intent: z.ZodLiteral<"OPEN">;
66
63
  orderType: z.ZodLiteral<"MARKET">;
64
+ position: z.ZodOptional<z.ZodObject<{
65
+ id: z.ZodUUID;
66
+ }, z.core.$strip>>;
67
67
  legs: z.ZodTuple<[z.ZodObject<{
68
68
  id: z.ZodOptional<z.ZodString>;
69
69
  symbol: z.ZodString;
@@ -76,6 +76,7 @@ export declare const CreateTradeOpenResponse: z.ZodObject<{
76
76
  USD: "USD";
77
77
  }>;
78
78
  amount: z.ZodString;
79
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
79
80
  reduceOnly: z.ZodBoolean;
80
81
  }, z.core.$strip>], z.ZodObject<{
81
82
  id: z.ZodOptional<z.ZodString>;
@@ -89,6 +90,7 @@ export declare const CreateTradeOpenResponse: z.ZodObject<{
89
90
  USD: "USD";
90
91
  }>;
91
92
  amount: z.ZodString;
93
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
92
94
  reduceOnly: z.ZodBoolean;
93
95
  }, z.core.$strip>>;
94
96
  }, z.core.$strip>, z.ZodObject<{
@@ -144,6 +146,12 @@ export declare const CreateTradeOpenResponse: z.ZodObject<{
144
146
  filledQuantity: z.ZodString;
145
147
  filledPrice: z.ZodOptional<z.ZodString>;
146
148
  }, z.core.$strip>], "type">>>;
149
+ fulfillment: z.ZodOptional<z.ZodEnum<{
150
+ PENDING: "PENDING";
151
+ PARTIAL: "PARTIAL";
152
+ COMPLETE: "COMPLETE";
153
+ NONE: "NONE";
154
+ }>>;
147
155
  intent: z.ZodLiteral<"ADJUST">;
148
156
  orderType: z.ZodLiteral<"MARKET">;
149
157
  position: z.ZodOptional<z.ZodObject<{
@@ -162,6 +170,7 @@ export declare const CreateTradeOpenResponse: z.ZodObject<{
162
170
  USD: "USD";
163
171
  }>;
164
172
  amount: z.ZodString;
173
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
165
174
  reduceOnly: z.ZodBoolean;
166
175
  }, z.core.$strip>], z.ZodObject<{
167
176
  id: z.ZodOptional<z.ZodString>;
@@ -175,6 +184,7 @@ export declare const CreateTradeOpenResponse: z.ZodObject<{
175
184
  USD: "USD";
176
185
  }>;
177
186
  amount: z.ZodString;
187
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
178
188
  reduceOnly: z.ZodBoolean;
179
189
  }, z.core.$strip>>;
180
190
  }, z.core.$strip>, z.ZodObject<{
@@ -230,6 +240,12 @@ export declare const CreateTradeOpenResponse: z.ZodObject<{
230
240
  filledQuantity: z.ZodString;
231
241
  filledPrice: z.ZodOptional<z.ZodString>;
232
242
  }, z.core.$strip>], "type">>>;
243
+ fulfillment: z.ZodOptional<z.ZodEnum<{
244
+ PENDING: "PENDING";
245
+ PARTIAL: "PARTIAL";
246
+ COMPLETE: "COMPLETE";
247
+ NONE: "NONE";
248
+ }>>;
233
249
  intent: z.ZodLiteral<"CLOSE">;
234
250
  orderType: z.ZodLiteral<"MARKET">;
235
251
  position: z.ZodOptional<z.ZodObject<{
@@ -289,6 +305,12 @@ export declare const CreateTradeOpenResponse: z.ZodObject<{
289
305
  filledQuantity: z.ZodString;
290
306
  filledPrice: z.ZodOptional<z.ZodString>;
291
307
  }, z.core.$strip>], "type">>>;
308
+ fulfillment: z.ZodOptional<z.ZodEnum<{
309
+ PENDING: "PENDING";
310
+ PARTIAL: "PARTIAL";
311
+ COMPLETE: "COMPLETE";
312
+ NONE: "NONE";
313
+ }>>;
292
314
  intent: z.ZodLiteral<"REVERSE">;
293
315
  orderType: z.ZodLiteral<"MARKET">;
294
316
  position: z.ZodOptional<z.ZodObject<{
@@ -352,8 +374,17 @@ export declare const CreateTradeAdjustResponse: z.ZodObject<{
352
374
  filledQuantity: z.ZodString;
353
375
  filledPrice: z.ZodOptional<z.ZodString>;
354
376
  }, z.core.$strip>], "type">>>;
377
+ fulfillment: z.ZodOptional<z.ZodEnum<{
378
+ PENDING: "PENDING";
379
+ PARTIAL: "PARTIAL";
380
+ COMPLETE: "COMPLETE";
381
+ NONE: "NONE";
382
+ }>>;
355
383
  intent: z.ZodLiteral<"OPEN">;
356
384
  orderType: z.ZodLiteral<"MARKET">;
385
+ position: z.ZodOptional<z.ZodObject<{
386
+ id: z.ZodUUID;
387
+ }, z.core.$strip>>;
357
388
  legs: z.ZodTuple<[z.ZodObject<{
358
389
  id: z.ZodOptional<z.ZodString>;
359
390
  symbol: z.ZodString;
@@ -366,6 +397,7 @@ export declare const CreateTradeAdjustResponse: z.ZodObject<{
366
397
  USD: "USD";
367
398
  }>;
368
399
  amount: z.ZodString;
400
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
369
401
  reduceOnly: z.ZodBoolean;
370
402
  }, z.core.$strip>], z.ZodObject<{
371
403
  id: z.ZodOptional<z.ZodString>;
@@ -379,6 +411,7 @@ export declare const CreateTradeAdjustResponse: z.ZodObject<{
379
411
  USD: "USD";
380
412
  }>;
381
413
  amount: z.ZodString;
414
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
382
415
  reduceOnly: z.ZodBoolean;
383
416
  }, z.core.$strip>>;
384
417
  }, z.core.$strip>, z.ZodObject<{
@@ -434,6 +467,12 @@ export declare const CreateTradeAdjustResponse: z.ZodObject<{
434
467
  filledQuantity: z.ZodString;
435
468
  filledPrice: z.ZodOptional<z.ZodString>;
436
469
  }, z.core.$strip>], "type">>>;
470
+ fulfillment: z.ZodOptional<z.ZodEnum<{
471
+ PENDING: "PENDING";
472
+ PARTIAL: "PARTIAL";
473
+ COMPLETE: "COMPLETE";
474
+ NONE: "NONE";
475
+ }>>;
437
476
  intent: z.ZodLiteral<"ADJUST">;
438
477
  orderType: z.ZodLiteral<"MARKET">;
439
478
  position: z.ZodOptional<z.ZodObject<{
@@ -452,6 +491,7 @@ export declare const CreateTradeAdjustResponse: z.ZodObject<{
452
491
  USD: "USD";
453
492
  }>;
454
493
  amount: z.ZodString;
494
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
455
495
  reduceOnly: z.ZodBoolean;
456
496
  }, z.core.$strip>], z.ZodObject<{
457
497
  id: z.ZodOptional<z.ZodString>;
@@ -465,6 +505,7 @@ export declare const CreateTradeAdjustResponse: z.ZodObject<{
465
505
  USD: "USD";
466
506
  }>;
467
507
  amount: z.ZodString;
508
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
468
509
  reduceOnly: z.ZodBoolean;
469
510
  }, z.core.$strip>>;
470
511
  }, z.core.$strip>, z.ZodObject<{
@@ -520,6 +561,12 @@ export declare const CreateTradeAdjustResponse: z.ZodObject<{
520
561
  filledQuantity: z.ZodString;
521
562
  filledPrice: z.ZodOptional<z.ZodString>;
522
563
  }, z.core.$strip>], "type">>>;
564
+ fulfillment: z.ZodOptional<z.ZodEnum<{
565
+ PENDING: "PENDING";
566
+ PARTIAL: "PARTIAL";
567
+ COMPLETE: "COMPLETE";
568
+ NONE: "NONE";
569
+ }>>;
523
570
  intent: z.ZodLiteral<"CLOSE">;
524
571
  orderType: z.ZodLiteral<"MARKET">;
525
572
  position: z.ZodOptional<z.ZodObject<{
@@ -579,6 +626,12 @@ export declare const CreateTradeAdjustResponse: z.ZodObject<{
579
626
  filledQuantity: z.ZodString;
580
627
  filledPrice: z.ZodOptional<z.ZodString>;
581
628
  }, z.core.$strip>], "type">>>;
629
+ fulfillment: z.ZodOptional<z.ZodEnum<{
630
+ PENDING: "PENDING";
631
+ PARTIAL: "PARTIAL";
632
+ COMPLETE: "COMPLETE";
633
+ NONE: "NONE";
634
+ }>>;
582
635
  intent: z.ZodLiteral<"REVERSE">;
583
636
  orderType: z.ZodLiteral<"MARKET">;
584
637
  position: z.ZodOptional<z.ZodObject<{
@@ -642,8 +695,17 @@ export declare const CreateTradeCloseResponse: z.ZodObject<{
642
695
  filledQuantity: z.ZodString;
643
696
  filledPrice: z.ZodOptional<z.ZodString>;
644
697
  }, z.core.$strip>], "type">>>;
698
+ fulfillment: z.ZodOptional<z.ZodEnum<{
699
+ PENDING: "PENDING";
700
+ PARTIAL: "PARTIAL";
701
+ COMPLETE: "COMPLETE";
702
+ NONE: "NONE";
703
+ }>>;
645
704
  intent: z.ZodLiteral<"OPEN">;
646
705
  orderType: z.ZodLiteral<"MARKET">;
706
+ position: z.ZodOptional<z.ZodObject<{
707
+ id: z.ZodUUID;
708
+ }, z.core.$strip>>;
647
709
  legs: z.ZodTuple<[z.ZodObject<{
648
710
  id: z.ZodOptional<z.ZodString>;
649
711
  symbol: z.ZodString;
@@ -656,6 +718,7 @@ export declare const CreateTradeCloseResponse: z.ZodObject<{
656
718
  USD: "USD";
657
719
  }>;
658
720
  amount: z.ZodString;
721
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
659
722
  reduceOnly: z.ZodBoolean;
660
723
  }, z.core.$strip>], z.ZodObject<{
661
724
  id: z.ZodOptional<z.ZodString>;
@@ -669,6 +732,7 @@ export declare const CreateTradeCloseResponse: z.ZodObject<{
669
732
  USD: "USD";
670
733
  }>;
671
734
  amount: z.ZodString;
735
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
672
736
  reduceOnly: z.ZodBoolean;
673
737
  }, z.core.$strip>>;
674
738
  }, z.core.$strip>, z.ZodObject<{
@@ -724,6 +788,12 @@ export declare const CreateTradeCloseResponse: z.ZodObject<{
724
788
  filledQuantity: z.ZodString;
725
789
  filledPrice: z.ZodOptional<z.ZodString>;
726
790
  }, z.core.$strip>], "type">>>;
791
+ fulfillment: z.ZodOptional<z.ZodEnum<{
792
+ PENDING: "PENDING";
793
+ PARTIAL: "PARTIAL";
794
+ COMPLETE: "COMPLETE";
795
+ NONE: "NONE";
796
+ }>>;
727
797
  intent: z.ZodLiteral<"ADJUST">;
728
798
  orderType: z.ZodLiteral<"MARKET">;
729
799
  position: z.ZodOptional<z.ZodObject<{
@@ -742,6 +812,7 @@ export declare const CreateTradeCloseResponse: z.ZodObject<{
742
812
  USD: "USD";
743
813
  }>;
744
814
  amount: z.ZodString;
815
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
745
816
  reduceOnly: z.ZodBoolean;
746
817
  }, z.core.$strip>], z.ZodObject<{
747
818
  id: z.ZodOptional<z.ZodString>;
@@ -755,6 +826,7 @@ export declare const CreateTradeCloseResponse: z.ZodObject<{
755
826
  USD: "USD";
756
827
  }>;
757
828
  amount: z.ZodString;
829
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
758
830
  reduceOnly: z.ZodBoolean;
759
831
  }, z.core.$strip>>;
760
832
  }, z.core.$strip>, z.ZodObject<{
@@ -810,6 +882,12 @@ export declare const CreateTradeCloseResponse: z.ZodObject<{
810
882
  filledQuantity: z.ZodString;
811
883
  filledPrice: z.ZodOptional<z.ZodString>;
812
884
  }, z.core.$strip>], "type">>>;
885
+ fulfillment: z.ZodOptional<z.ZodEnum<{
886
+ PENDING: "PENDING";
887
+ PARTIAL: "PARTIAL";
888
+ COMPLETE: "COMPLETE";
889
+ NONE: "NONE";
890
+ }>>;
813
891
  intent: z.ZodLiteral<"CLOSE">;
814
892
  orderType: z.ZodLiteral<"MARKET">;
815
893
  position: z.ZodOptional<z.ZodObject<{
@@ -869,6 +947,12 @@ export declare const CreateTradeCloseResponse: z.ZodObject<{
869
947
  filledQuantity: z.ZodString;
870
948
  filledPrice: z.ZodOptional<z.ZodString>;
871
949
  }, z.core.$strip>], "type">>>;
950
+ fulfillment: z.ZodOptional<z.ZodEnum<{
951
+ PENDING: "PENDING";
952
+ PARTIAL: "PARTIAL";
953
+ COMPLETE: "COMPLETE";
954
+ NONE: "NONE";
955
+ }>>;
872
956
  intent: z.ZodLiteral<"REVERSE">;
873
957
  orderType: z.ZodLiteral<"MARKET">;
874
958
  position: z.ZodOptional<z.ZodObject<{
@@ -932,8 +1016,17 @@ export declare const CreateTradeReverseResponse: z.ZodObject<{
932
1016
  filledQuantity: z.ZodString;
933
1017
  filledPrice: z.ZodOptional<z.ZodString>;
934
1018
  }, z.core.$strip>], "type">>>;
1019
+ fulfillment: z.ZodOptional<z.ZodEnum<{
1020
+ PENDING: "PENDING";
1021
+ PARTIAL: "PARTIAL";
1022
+ COMPLETE: "COMPLETE";
1023
+ NONE: "NONE";
1024
+ }>>;
935
1025
  intent: z.ZodLiteral<"OPEN">;
936
1026
  orderType: z.ZodLiteral<"MARKET">;
1027
+ position: z.ZodOptional<z.ZodObject<{
1028
+ id: z.ZodUUID;
1029
+ }, z.core.$strip>>;
937
1030
  legs: z.ZodTuple<[z.ZodObject<{
938
1031
  id: z.ZodOptional<z.ZodString>;
939
1032
  symbol: z.ZodString;
@@ -946,6 +1039,7 @@ export declare const CreateTradeReverseResponse: z.ZodObject<{
946
1039
  USD: "USD";
947
1040
  }>;
948
1041
  amount: z.ZodString;
1042
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
949
1043
  reduceOnly: z.ZodBoolean;
950
1044
  }, z.core.$strip>], z.ZodObject<{
951
1045
  id: z.ZodOptional<z.ZodString>;
@@ -959,6 +1053,7 @@ export declare const CreateTradeReverseResponse: z.ZodObject<{
959
1053
  USD: "USD";
960
1054
  }>;
961
1055
  amount: z.ZodString;
1056
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
962
1057
  reduceOnly: z.ZodBoolean;
963
1058
  }, z.core.$strip>>;
964
1059
  }, z.core.$strip>, z.ZodObject<{
@@ -1014,6 +1109,12 @@ export declare const CreateTradeReverseResponse: z.ZodObject<{
1014
1109
  filledQuantity: z.ZodString;
1015
1110
  filledPrice: z.ZodOptional<z.ZodString>;
1016
1111
  }, z.core.$strip>], "type">>>;
1112
+ fulfillment: z.ZodOptional<z.ZodEnum<{
1113
+ PENDING: "PENDING";
1114
+ PARTIAL: "PARTIAL";
1115
+ COMPLETE: "COMPLETE";
1116
+ NONE: "NONE";
1117
+ }>>;
1017
1118
  intent: z.ZodLiteral<"ADJUST">;
1018
1119
  orderType: z.ZodLiteral<"MARKET">;
1019
1120
  position: z.ZodOptional<z.ZodObject<{
@@ -1032,6 +1133,7 @@ export declare const CreateTradeReverseResponse: z.ZodObject<{
1032
1133
  USD: "USD";
1033
1134
  }>;
1034
1135
  amount: z.ZodString;
1136
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
1035
1137
  reduceOnly: z.ZodBoolean;
1036
1138
  }, z.core.$strip>], z.ZodObject<{
1037
1139
  id: z.ZodOptional<z.ZodString>;
@@ -1045,6 +1147,7 @@ export declare const CreateTradeReverseResponse: z.ZodObject<{
1045
1147
  USD: "USD";
1046
1148
  }>;
1047
1149
  amount: z.ZodString;
1150
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
1048
1151
  reduceOnly: z.ZodBoolean;
1049
1152
  }, z.core.$strip>>;
1050
1153
  }, z.core.$strip>, z.ZodObject<{
@@ -1100,6 +1203,12 @@ export declare const CreateTradeReverseResponse: z.ZodObject<{
1100
1203
  filledQuantity: z.ZodString;
1101
1204
  filledPrice: z.ZodOptional<z.ZodString>;
1102
1205
  }, z.core.$strip>], "type">>>;
1206
+ fulfillment: z.ZodOptional<z.ZodEnum<{
1207
+ PENDING: "PENDING";
1208
+ PARTIAL: "PARTIAL";
1209
+ COMPLETE: "COMPLETE";
1210
+ NONE: "NONE";
1211
+ }>>;
1103
1212
  intent: z.ZodLiteral<"CLOSE">;
1104
1213
  orderType: z.ZodLiteral<"MARKET">;
1105
1214
  position: z.ZodOptional<z.ZodObject<{
@@ -1159,6 +1268,12 @@ export declare const CreateTradeReverseResponse: z.ZodObject<{
1159
1268
  filledQuantity: z.ZodString;
1160
1269
  filledPrice: z.ZodOptional<z.ZodString>;
1161
1270
  }, z.core.$strip>], "type">>>;
1271
+ fulfillment: z.ZodOptional<z.ZodEnum<{
1272
+ PENDING: "PENDING";
1273
+ PARTIAL: "PARTIAL";
1274
+ COMPLETE: "COMPLETE";
1275
+ NONE: "NONE";
1276
+ }>>;
1162
1277
  intent: z.ZodLiteral<"REVERSE">;
1163
1278
  orderType: z.ZodLiteral<"MARKET">;
1164
1279
  position: z.ZodOptional<z.ZodObject<{
@@ -1222,8 +1337,17 @@ export declare const CreateTradeCloseAllResponse: z.ZodObject<{
1222
1337
  filledQuantity: z.ZodString;
1223
1338
  filledPrice: z.ZodOptional<z.ZodString>;
1224
1339
  }, z.core.$strip>], "type">>>;
1340
+ fulfillment: z.ZodOptional<z.ZodEnum<{
1341
+ PENDING: "PENDING";
1342
+ PARTIAL: "PARTIAL";
1343
+ COMPLETE: "COMPLETE";
1344
+ NONE: "NONE";
1345
+ }>>;
1225
1346
  intent: z.ZodLiteral<"OPEN">;
1226
1347
  orderType: z.ZodLiteral<"MARKET">;
1348
+ position: z.ZodOptional<z.ZodObject<{
1349
+ id: z.ZodUUID;
1350
+ }, z.core.$strip>>;
1227
1351
  legs: z.ZodTuple<[z.ZodObject<{
1228
1352
  id: z.ZodOptional<z.ZodString>;
1229
1353
  symbol: z.ZodString;
@@ -1236,6 +1360,7 @@ export declare const CreateTradeCloseAllResponse: z.ZodObject<{
1236
1360
  USD: "USD";
1237
1361
  }>;
1238
1362
  amount: z.ZodString;
1363
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
1239
1364
  reduceOnly: z.ZodBoolean;
1240
1365
  }, z.core.$strip>], z.ZodObject<{
1241
1366
  id: z.ZodOptional<z.ZodString>;
@@ -1249,6 +1374,7 @@ export declare const CreateTradeCloseAllResponse: z.ZodObject<{
1249
1374
  USD: "USD";
1250
1375
  }>;
1251
1376
  amount: z.ZodString;
1377
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
1252
1378
  reduceOnly: z.ZodBoolean;
1253
1379
  }, z.core.$strip>>;
1254
1380
  }, z.core.$strip>, z.ZodObject<{
@@ -1304,6 +1430,12 @@ export declare const CreateTradeCloseAllResponse: z.ZodObject<{
1304
1430
  filledQuantity: z.ZodString;
1305
1431
  filledPrice: z.ZodOptional<z.ZodString>;
1306
1432
  }, z.core.$strip>], "type">>>;
1433
+ fulfillment: z.ZodOptional<z.ZodEnum<{
1434
+ PENDING: "PENDING";
1435
+ PARTIAL: "PARTIAL";
1436
+ COMPLETE: "COMPLETE";
1437
+ NONE: "NONE";
1438
+ }>>;
1307
1439
  intent: z.ZodLiteral<"ADJUST">;
1308
1440
  orderType: z.ZodLiteral<"MARKET">;
1309
1441
  position: z.ZodOptional<z.ZodObject<{
@@ -1322,6 +1454,7 @@ export declare const CreateTradeCloseAllResponse: z.ZodObject<{
1322
1454
  USD: "USD";
1323
1455
  }>;
1324
1456
  amount: z.ZodString;
1457
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
1325
1458
  reduceOnly: z.ZodBoolean;
1326
1459
  }, z.core.$strip>], z.ZodObject<{
1327
1460
  id: z.ZodOptional<z.ZodString>;
@@ -1335,6 +1468,7 @@ export declare const CreateTradeCloseAllResponse: z.ZodObject<{
1335
1468
  USD: "USD";
1336
1469
  }>;
1337
1470
  amount: z.ZodString;
1471
+ maxImpactPrice: z.ZodOptional<z.ZodString>;
1338
1472
  reduceOnly: z.ZodBoolean;
1339
1473
  }, z.core.$strip>>;
1340
1474
  }, z.core.$strip>, z.ZodObject<{
@@ -1390,6 +1524,12 @@ export declare const CreateTradeCloseAllResponse: z.ZodObject<{
1390
1524
  filledQuantity: z.ZodString;
1391
1525
  filledPrice: z.ZodOptional<z.ZodString>;
1392
1526
  }, z.core.$strip>], "type">>>;
1527
+ fulfillment: z.ZodOptional<z.ZodEnum<{
1528
+ PENDING: "PENDING";
1529
+ PARTIAL: "PARTIAL";
1530
+ COMPLETE: "COMPLETE";
1531
+ NONE: "NONE";
1532
+ }>>;
1393
1533
  intent: z.ZodLiteral<"CLOSE">;
1394
1534
  orderType: z.ZodLiteral<"MARKET">;
1395
1535
  position: z.ZodOptional<z.ZodObject<{
@@ -1449,6 +1589,12 @@ export declare const CreateTradeCloseAllResponse: z.ZodObject<{
1449
1589
  filledQuantity: z.ZodString;
1450
1590
  filledPrice: z.ZodOptional<z.ZodString>;
1451
1591
  }, z.core.$strip>], "type">>>;
1592
+ fulfillment: z.ZodOptional<z.ZodEnum<{
1593
+ PENDING: "PENDING";
1594
+ PARTIAL: "PARTIAL";
1595
+ COMPLETE: "COMPLETE";
1596
+ NONE: "NONE";
1597
+ }>>;
1452
1598
  intent: z.ZodLiteral<"REVERSE">;
1453
1599
  orderType: z.ZodLiteral<"MARKET">;
1454
1600
  position: z.ZodOptional<z.ZodObject<{
@@ -2,15 +2,7 @@ import { z } from 'zod';
2
2
  import { CursorResponse } from '../common';
3
3
  import { Execution } from '../execution/entities';
4
4
  import { TradeGroup } from './entities';
5
- import { BOUNDED_MARKET_MAX_TTL_MS } from './payloads';
6
5
 
7
- const TradeCapabilities = z.object({
8
- boundedMarketOpen: z.object({
9
- version: z.literal(1),
10
- maxTtlMs: z.literal(BOUNDED_MARKET_MAX_TTL_MS),
11
- connectors: z.array(z.literal("hyperliquid"))
12
- })
13
- });
14
6
  const CreateTradeOpenResponse = z.object({
15
7
  execution: Execution
16
8
  });
@@ -30,4 +22,4 @@ const TradeListResponse = CursorResponse.extend({
30
22
  groups: z.array(TradeGroup)
31
23
  });
32
24
 
33
- export { CreateTradeAdjustResponse, CreateTradeCloseAllResponse, CreateTradeCloseResponse, CreateTradeOpenResponse, CreateTradeReverseResponse, TradeCapabilities, TradeListResponse };
25
+ export { CreateTradeAdjustResponse, CreateTradeCloseAllResponse, CreateTradeCloseResponse, CreateTradeOpenResponse, CreateTradeReverseResponse, TradeListResponse };
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { EthereumAddress } from '../common/address';
2
3
  /**
3
4
  * Hyperliquid connector credentials
4
5
  */
@@ -9,9 +10,9 @@ declare const CreateHyperliquidCredentials: z.ZodObject<{
9
10
  * Hyperliquid connector metadata
10
11
  */
11
12
  declare const CreateHyperliquidMetadata: z.ZodObject<{
12
- agentWalletAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
13
+ agentWalletAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
13
14
  isSubaccount: z.ZodBoolean;
14
- mainAccountAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
15
+ mainAccountAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
15
16
  }, z.core.$strip>;
16
17
  declare const CreateBinanceCredentials: z.ZodObject<{
17
18
  read: z.ZodObject<{
@@ -49,7 +50,7 @@ declare const CreateLighterCredentials: z.ZodObject<{
49
50
  * Lighter connector metadata
50
51
  */
51
52
  declare const CreateLighterMetadata: z.ZodObject<{
52
- l1_address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
53
+ l1_address: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
53
54
  }, z.core.$strip>;
54
55
  /**
55
56
  * Payload to create a new trade account
@@ -57,14 +58,14 @@ declare const CreateLighterMetadata: z.ZodObject<{
57
58
  export declare const CreateTradeAccount: z.ZodDiscriminatedUnion<[z.ZodObject<{
58
59
  connector: z.ZodLiteral<"hyperliquid">;
59
60
  alias: z.ZodString;
60
- exchangeIdentifier: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
61
+ exchangeIdentifier: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
61
62
  credentials: z.ZodObject<{
62
63
  signer_key: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
63
64
  }, z.core.$strip>;
64
65
  metadata: z.ZodObject<{
65
- agentWalletAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
66
+ agentWalletAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
66
67
  isSubaccount: z.ZodBoolean;
67
- mainAccountAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
68
+ mainAccountAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
68
69
  }, z.core.$strip>;
69
70
  }, z.core.$strip>, z.ZodObject<{
70
71
  connector: z.ZodLiteral<"binance">;
@@ -106,7 +107,7 @@ export declare const CreateTradeAccount: z.ZodDiscriminatedUnion<[z.ZodObject<{
106
107
  api_key_index: z.ZodNumber;
107
108
  }, z.core.$strip>;
108
109
  metadata: z.ZodObject<{
109
- l1_address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
110
+ l1_address: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
110
111
  }, z.core.$strip>;
111
112
  }, z.core.$strip>, z.ZodObject<{
112
113
  alias: z.ZodString;
@@ -116,7 +117,7 @@ export declare const CreateTradeAccount: z.ZodDiscriminatedUnion<[z.ZodObject<{
116
117
  api_key_index: z.ZodNumber;
117
118
  }, z.core.$strip>;
118
119
  metadata: z.ZodObject<{
119
- l1_address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
120
+ l1_address: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
120
121
  }, z.core.$strip>;
121
122
  connector: z.ZodLiteral<"lighter_rhc">;
122
123
  }, z.core.$strip>], "connector">;
@@ -126,7 +127,7 @@ export declare const CreateTradeAccount: z.ZodDiscriminatedUnion<[z.ZodObject<{
126
127
  * the payload carries no credentials.
127
128
  */
128
129
  export declare const CreateVaultTradeAccount: z.ZodObject<{
129
- vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
130
+ vaultAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
130
131
  alias: z.ZodString;
131
132
  idempotencyKey: z.ZodOptional<z.ZodString>;
132
133
  }, z.core.$strip>;
@@ -140,9 +141,9 @@ export declare const UpdateTradeAccount: z.ZodDiscriminatedUnion<[z.ZodObject<{
140
141
  signer_key: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
141
142
  }, z.core.$strip>>;
142
143
  metadata: z.ZodOptional<z.ZodObject<{
143
- agentWalletAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
144
+ agentWalletAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
144
145
  isSubaccount: z.ZodBoolean;
145
- mainAccountAddress: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
146
+ mainAccountAddress: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
146
147
  }, z.core.$strip>>;
147
148
  }, z.core.$strip>, z.ZodObject<{
148
149
  connector: z.ZodLiteral<"binance">;
@@ -183,7 +184,7 @@ export declare const UpdateTradeAccount: z.ZodDiscriminatedUnion<[z.ZodObject<{
183
184
  api_key_index: z.ZodNumber;
184
185
  }, z.core.$strip>>;
185
186
  metadata: z.ZodOptional<z.ZodObject<{
186
- l1_address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
187
+ l1_address: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
187
188
  }, z.core.$strip>>;
188
189
  }, z.core.$strip>, z.ZodObject<{
189
190
  alias: z.ZodOptional<z.ZodString>;
@@ -192,7 +193,7 @@ export declare const UpdateTradeAccount: z.ZodDiscriminatedUnion<[z.ZodObject<{
192
193
  api_key_index: z.ZodNumber;
193
194
  }, z.core.$strip>>;
194
195
  metadata: z.ZodOptional<z.ZodObject<{
195
- l1_address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
196
+ l1_address: z.ZodPipe<z.ZodString, z.ZodTransform<EthereumAddress, string>>;
196
197
  }, z.core.$strip>>;
197
198
  connector: z.ZodLiteral<"lighter_rhc">;
198
199
  }, z.core.$strip>], "connector">;
@@ -20,9 +20,9 @@ export declare const TriggerCancelledReason: z.ZodEnum<{
20
20
  }>;
21
21
  export type TriggerCancelledReason = z.infer<typeof TriggerCancelledReason>;
22
22
  export declare const BracketType: z.ZodEnum<{
23
+ NONE: "NONE";
23
24
  STOP_LOSS: "STOP_LOSS";
24
25
  TAKE_PROFIT: "TAKE_PROFIT";
25
- NONE: "NONE";
26
26
  }>;
27
27
  export type BracketType = z.infer<typeof BracketType>;
28
28
  export declare const MetricTrack: z.ZodEnum<{