@pear-protocol/types 0.0.6 → 0.0.8

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.
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export declare const Connector: z.ZodEnum<{
3
3
  hyperliquid: "hyperliquid";
4
- binanceusdm: "binanceusdm";
4
+ binance: "binance";
5
5
  bybit: "bybit";
6
6
  okx: "okx";
7
7
  }>;
@@ -9,7 +9,7 @@ export type Connector = z.infer<typeof Connector>;
9
9
  export type HyperliquidCredentialsDTO = {
10
10
  signer_key: `0x${string}`;
11
11
  };
12
- export type BinanceUSDMCredentialsDTO = {
12
+ export type BinanceCredentialsDTO = {
13
13
  api_key: string;
14
14
  api_secret: string;
15
15
  };
@@ -24,7 +24,7 @@ export type OkxCredentialsDTO = {
24
24
  };
25
25
  export type ConnectorCredentialsDTO = {
26
26
  hyperliquid: HyperliquidCredentialsDTO;
27
- binanceusdm: BinanceUSDMCredentialsDTO;
27
+ binance: BinanceCredentialsDTO;
28
28
  bybit: BybitCredentialsDTO;
29
29
  okx: OkxCredentialsDTO;
30
30
  };
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
2
 
3
- const Connector = z.enum(["hyperliquid", "binanceusdm", "bybit", "okx"]);
3
+ const Connector = z.enum(["hyperliquid", "binance", "bybit", "okx"]);
4
4
 
5
5
  export { Connector };
@@ -39,7 +39,7 @@ export declare const BaseExecution: z.ZodObject<{
39
39
  id: z.ZodUUID;
40
40
  connector: z.ZodEnum<{
41
41
  hyperliquid: "hyperliquid";
42
- binanceusdm: "binanceusdm";
42
+ binance: "binance";
43
43
  bybit: "bybit";
44
44
  okx: "okx";
45
45
  }>;
@@ -65,7 +65,7 @@ export declare const BaseExecution: z.ZodObject<{
65
65
  id: z.ZodUUID;
66
66
  connector: z.ZodEnum<{
67
67
  hyperliquid: "hyperliquid";
68
- binanceusdm: "binanceusdm";
68
+ binance: "binance";
69
69
  bybit: "bybit";
70
70
  okx: "okx";
71
71
  }>;
@@ -97,7 +97,7 @@ export declare const MarketOpenExecution: z.ZodObject<{
97
97
  id: z.ZodUUID;
98
98
  connector: z.ZodEnum<{
99
99
  hyperliquid: "hyperliquid";
100
- binanceusdm: "binanceusdm";
100
+ binance: "binance";
101
101
  bybit: "bybit";
102
102
  okx: "okx";
103
103
  }>;
@@ -115,7 +115,7 @@ export declare const MarketOpenExecution: z.ZodObject<{
115
115
  id: z.ZodUUID;
116
116
  connector: z.ZodEnum<{
117
117
  hyperliquid: "hyperliquid";
118
- binanceusdm: "binanceusdm";
118
+ binance: "binance";
119
119
  bybit: "bybit";
120
120
  okx: "okx";
121
121
  }>;
@@ -174,7 +174,7 @@ export declare const MarketAdjustExecution: z.ZodObject<{
174
174
  id: z.ZodUUID;
175
175
  connector: z.ZodEnum<{
176
176
  hyperliquid: "hyperliquid";
177
- binanceusdm: "binanceusdm";
177
+ binance: "binance";
178
178
  bybit: "bybit";
179
179
  okx: "okx";
180
180
  }>;
@@ -192,7 +192,7 @@ export declare const MarketAdjustExecution: z.ZodObject<{
192
192
  id: z.ZodUUID;
193
193
  connector: z.ZodEnum<{
194
194
  hyperliquid: "hyperliquid";
195
- binanceusdm: "binanceusdm";
195
+ binance: "binance";
196
196
  bybit: "bybit";
197
197
  okx: "okx";
198
198
  }>;
@@ -255,7 +255,7 @@ export declare const MarketCloseExecution: z.ZodObject<{
255
255
  id: z.ZodUUID;
256
256
  connector: z.ZodEnum<{
257
257
  hyperliquid: "hyperliquid";
258
- binanceusdm: "binanceusdm";
258
+ binance: "binance";
259
259
  bybit: "bybit";
260
260
  okx: "okx";
261
261
  }>;
@@ -273,7 +273,7 @@ export declare const MarketCloseExecution: z.ZodObject<{
273
273
  id: z.ZodUUID;
274
274
  connector: z.ZodEnum<{
275
275
  hyperliquid: "hyperliquid";
276
- binanceusdm: "binanceusdm";
276
+ binance: "binance";
277
277
  bybit: "bybit";
278
278
  okx: "okx";
279
279
  }>;
@@ -311,7 +311,7 @@ export declare const MarketExecution: z.ZodDiscriminatedUnion<[z.ZodObject<{
311
311
  id: z.ZodUUID;
312
312
  connector: z.ZodEnum<{
313
313
  hyperliquid: "hyperliquid";
314
- binanceusdm: "binanceusdm";
314
+ binance: "binance";
315
315
  bybit: "bybit";
316
316
  okx: "okx";
317
317
  }>;
@@ -329,7 +329,7 @@ export declare const MarketExecution: z.ZodDiscriminatedUnion<[z.ZodObject<{
329
329
  id: z.ZodUUID;
330
330
  connector: z.ZodEnum<{
331
331
  hyperliquid: "hyperliquid";
332
- binanceusdm: "binanceusdm";
332
+ binance: "binance";
333
333
  bybit: "bybit";
334
334
  okx: "okx";
335
335
  }>;
@@ -387,7 +387,7 @@ export declare const MarketExecution: z.ZodDiscriminatedUnion<[z.ZodObject<{
387
387
  id: z.ZodUUID;
388
388
  connector: z.ZodEnum<{
389
389
  hyperliquid: "hyperliquid";
390
- binanceusdm: "binanceusdm";
390
+ binance: "binance";
391
391
  bybit: "bybit";
392
392
  okx: "okx";
393
393
  }>;
@@ -405,7 +405,7 @@ export declare const MarketExecution: z.ZodDiscriminatedUnion<[z.ZodObject<{
405
405
  id: z.ZodUUID;
406
406
  connector: z.ZodEnum<{
407
407
  hyperliquid: "hyperliquid";
408
- binanceusdm: "binanceusdm";
408
+ binance: "binance";
409
409
  bybit: "bybit";
410
410
  okx: "okx";
411
411
  }>;
@@ -467,7 +467,7 @@ export declare const MarketExecution: z.ZodDiscriminatedUnion<[z.ZodObject<{
467
467
  id: z.ZodUUID;
468
468
  connector: z.ZodEnum<{
469
469
  hyperliquid: "hyperliquid";
470
- binanceusdm: "binanceusdm";
470
+ binance: "binance";
471
471
  bybit: "bybit";
472
472
  okx: "okx";
473
473
  }>;
@@ -485,7 +485,7 @@ export declare const MarketExecution: z.ZodDiscriminatedUnion<[z.ZodObject<{
485
485
  id: z.ZodUUID;
486
486
  connector: z.ZodEnum<{
487
487
  hyperliquid: "hyperliquid";
488
- binanceusdm: "binanceusdm";
488
+ binance: "binance";
489
489
  bybit: "bybit";
490
490
  okx: "okx";
491
491
  }>;
@@ -523,7 +523,7 @@ export declare const Execution: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion
523
523
  id: z.ZodUUID;
524
524
  connector: z.ZodEnum<{
525
525
  hyperliquid: "hyperliquid";
526
- binanceusdm: "binanceusdm";
526
+ binance: "binance";
527
527
  bybit: "bybit";
528
528
  okx: "okx";
529
529
  }>;
@@ -541,7 +541,7 @@ export declare const Execution: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion
541
541
  id: z.ZodUUID;
542
542
  connector: z.ZodEnum<{
543
543
  hyperliquid: "hyperliquid";
544
- binanceusdm: "binanceusdm";
544
+ binance: "binance";
545
545
  bybit: "bybit";
546
546
  okx: "okx";
547
547
  }>;
@@ -599,7 +599,7 @@ export declare const Execution: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion
599
599
  id: z.ZodUUID;
600
600
  connector: z.ZodEnum<{
601
601
  hyperliquid: "hyperliquid";
602
- binanceusdm: "binanceusdm";
602
+ binance: "binance";
603
603
  bybit: "bybit";
604
604
  okx: "okx";
605
605
  }>;
@@ -617,7 +617,7 @@ export declare const Execution: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion
617
617
  id: z.ZodUUID;
618
618
  connector: z.ZodEnum<{
619
619
  hyperliquid: "hyperliquid";
620
- binanceusdm: "binanceusdm";
620
+ binance: "binance";
621
621
  bybit: "bybit";
622
622
  okx: "okx";
623
623
  }>;
@@ -679,7 +679,7 @@ export declare const Execution: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion
679
679
  id: z.ZodUUID;
680
680
  connector: z.ZodEnum<{
681
681
  hyperliquid: "hyperliquid";
682
- binanceusdm: "binanceusdm";
682
+ binance: "binance";
683
683
  bybit: "bybit";
684
684
  okx: "okx";
685
685
  }>;
@@ -697,7 +697,7 @@ export declare const Execution: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion
697
697
  id: z.ZodUUID;
698
698
  connector: z.ZodEnum<{
699
699
  hyperliquid: "hyperliquid";
700
- binanceusdm: "binanceusdm";
700
+ binance: "binance";
701
701
  bybit: "bybit";
702
702
  okx: "okx";
703
703
  }>;
@@ -4,7 +4,7 @@ export declare const ExecutionListParams: z.ZodObject<{
4
4
  cursor: z.ZodOptional<z.ZodString>;
5
5
  connector: z.ZodOptional<z.ZodEnum<{
6
6
  hyperliquid: "hyperliquid";
7
- binanceusdm: "binanceusdm";
7
+ binance: "binance";
8
8
  bybit: "bybit";
9
9
  okx: "okx";
10
10
  }>>;
@@ -6,7 +6,7 @@ export declare const ExecutionListResponse: z.ZodObject<{
6
6
  id: z.ZodUUID;
7
7
  connector: z.ZodEnum<{
8
8
  hyperliquid: "hyperliquid";
9
- binanceusdm: "binanceusdm";
9
+ binance: "binance";
10
10
  bybit: "bybit";
11
11
  okx: "okx";
12
12
  }>;
@@ -24,7 +24,7 @@ export declare const ExecutionListResponse: z.ZodObject<{
24
24
  id: z.ZodUUID;
25
25
  connector: z.ZodEnum<{
26
26
  hyperliquid: "hyperliquid";
27
- binanceusdm: "binanceusdm";
27
+ binance: "binance";
28
28
  bybit: "bybit";
29
29
  okx: "okx";
30
30
  }>;
@@ -82,7 +82,7 @@ export declare const ExecutionListResponse: z.ZodObject<{
82
82
  id: z.ZodUUID;
83
83
  connector: z.ZodEnum<{
84
84
  hyperliquid: "hyperliquid";
85
- binanceusdm: "binanceusdm";
85
+ binance: "binance";
86
86
  bybit: "bybit";
87
87
  okx: "okx";
88
88
  }>;
@@ -100,7 +100,7 @@ export declare const ExecutionListResponse: z.ZodObject<{
100
100
  id: z.ZodUUID;
101
101
  connector: z.ZodEnum<{
102
102
  hyperliquid: "hyperliquid";
103
- binanceusdm: "binanceusdm";
103
+ binance: "binance";
104
104
  bybit: "bybit";
105
105
  okx: "okx";
106
106
  }>;
@@ -162,7 +162,7 @@ export declare const ExecutionListResponse: z.ZodObject<{
162
162
  id: z.ZodUUID;
163
163
  connector: z.ZodEnum<{
164
164
  hyperliquid: "hyperliquid";
165
- binanceusdm: "binanceusdm";
165
+ binance: "binance";
166
166
  bybit: "bybit";
167
167
  okx: "okx";
168
168
  }>;
@@ -180,7 +180,7 @@ export declare const ExecutionListResponse: z.ZodObject<{
180
180
  id: z.ZodUUID;
181
181
  connector: z.ZodEnum<{
182
182
  hyperliquid: "hyperliquid";
183
- binanceusdm: "binanceusdm";
183
+ binance: "binance";
184
184
  bybit: "bybit";
185
185
  okx: "okx";
186
186
  }>;
@@ -7,7 +7,7 @@ export declare const Fill: z.ZodObject<{
7
7
  positionId: z.ZodUUID;
8
8
  connector: z.ZodEnum<{
9
9
  hyperliquid: "hyperliquid";
10
- binanceusdm: "binanceusdm";
10
+ binance: "binance";
11
11
  bybit: "bybit";
12
12
  okx: "okx";
13
13
  }>;
@@ -4,7 +4,7 @@ export declare const FillListParams: z.ZodObject<{
4
4
  cursor: z.ZodOptional<z.ZodString>;
5
5
  connector: z.ZodOptional<z.ZodEnum<{
6
6
  hyperliquid: "hyperliquid";
7
- binanceusdm: "binanceusdm";
7
+ binance: "binance";
8
8
  bybit: "bybit";
9
9
  okx: "okx";
10
10
  }>>;
@@ -10,7 +10,7 @@ export declare const FillListResponse: z.ZodObject<{
10
10
  positionId: z.ZodUUID;
11
11
  connector: z.ZodEnum<{
12
12
  hyperliquid: "hyperliquid";
13
- binanceusdm: "binanceusdm";
13
+ binance: "binance";
14
14
  bybit: "bybit";
15
15
  okx: "okx";
16
16
  }>;
@@ -36,7 +36,7 @@ export declare const PositionFillListResponse: z.ZodObject<{
36
36
  positionId: z.ZodUUID;
37
37
  connector: z.ZodEnum<{
38
38
  hyperliquid: "hyperliquid";
39
- binanceusdm: "binanceusdm";
39
+ binance: "binance";
40
40
  bybit: "bybit";
41
41
  okx: "okx";
42
42
  }>;
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  export declare const FundingQueryParams: z.ZodObject<{
3
3
  connector: z.ZodEnum<{
4
4
  hyperliquid: "hyperliquid";
5
- binanceusdm: "binanceusdm";
5
+ binance: "binance";
6
6
  bybit: "bybit";
7
7
  okx: "okx";
8
8
  }>;
@@ -13,7 +13,7 @@ export declare const Instrument: z.ZodObject<{
13
13
  quote: z.ZodString;
14
14
  connector: z.ZodEnum<{
15
15
  hyperliquid: "hyperliquid";
16
- binanceusdm: "binanceusdm";
16
+ binance: "binance";
17
17
  bybit: "bybit";
18
18
  okx: "okx";
19
19
  }>;
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { Connector } from '../connector';
3
3
  import { InstrumentPrecision } from '../instrument-precision';
4
4
 
5
- const InstrumentId = z.string();
5
+ const InstrumentId = z.string().trim().min(1, "Instrument ID is required").max(64, "Instrument ID must be at most 64 characters").regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/, "Instrument ID contains invalid characters");
6
6
  const InstrumentType = z.enum(["spot", "perp", "hip3"]);
7
7
  const Instrument = z.object({
8
8
  /**
@@ -24,7 +24,7 @@ const Instrument = z.object({
24
24
  /**
25
25
  * The connector of the instrument.
26
26
  * @example "hyperliquid"
27
- * @example "binanceusdm"
27
+ * @example "binance"
28
28
  */
29
29
  connector: Connector,
30
30
  /**
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  export declare const InstrumentListParams: z.ZodObject<{
3
3
  connector: z.ZodEnum<{
4
4
  hyperliquid: "hyperliquid";
5
- binanceusdm: "binanceusdm";
5
+ binance: "binance";
6
6
  bybit: "bybit";
7
7
  okx: "okx";
8
8
  }>;
@@ -6,7 +6,7 @@ export declare const InstrumentListResponse: z.ZodObject<{
6
6
  quote: z.ZodString;
7
7
  connector: z.ZodEnum<{
8
8
  hyperliquid: "hyperliquid";
9
- binanceusdm: "binanceusdm";
9
+ binance: "binance";
10
10
  bybit: "bybit";
11
11
  okx: "okx";
12
12
  }>;
@@ -11,7 +11,7 @@ export declare const MarketOrder: z.ZodObject<{
11
11
  id: z.ZodUUID;
12
12
  connector: z.ZodEnum<{
13
13
  hyperliquid: "hyperliquid";
14
- binanceusdm: "binanceusdm";
14
+ binance: "binance";
15
15
  bybit: "bybit";
16
16
  okx: "okx";
17
17
  }>;
@@ -42,7 +42,7 @@ export declare const Order: z.ZodDiscriminatedUnion<[z.ZodObject<{
42
42
  id: z.ZodUUID;
43
43
  connector: z.ZodEnum<{
44
44
  hyperliquid: "hyperliquid";
45
- binanceusdm: "binanceusdm";
45
+ binance: "binance";
46
46
  bybit: "bybit";
47
47
  okx: "okx";
48
48
  }>;
@@ -31,7 +31,7 @@ export declare const Position: z.ZodObject<{
31
31
  tradeAccountId: z.ZodUUID;
32
32
  connector: z.ZodEnum<{
33
33
  hyperliquid: "hyperliquid";
34
- binanceusdm: "binanceusdm";
34
+ binance: "binance";
35
35
  bybit: "bybit";
36
36
  okx: "okx";
37
37
  }>;
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  export declare const PositionListParams: z.ZodObject<{
3
3
  connector: z.ZodOptional<z.ZodEnum<{
4
4
  hyperliquid: "hyperliquid";
5
- binanceusdm: "binanceusdm";
5
+ binance: "binance";
6
6
  bybit: "bybit";
7
7
  okx: "okx";
8
8
  }>>;
@@ -5,7 +5,7 @@ export declare const PositionListResponse: z.ZodObject<{
5
5
  tradeAccountId: z.ZodUUID;
6
6
  connector: z.ZodEnum<{
7
7
  hyperliquid: "hyperliquid";
8
- binanceusdm: "binanceusdm";
8
+ binance: "binance";
9
9
  bybit: "bybit";
10
10
  okx: "okx";
11
11
  }>;
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  export declare const PricesQueryParams: z.ZodObject<{
3
3
  connector: z.ZodEnum<{
4
4
  hyperliquid: "hyperliquid";
5
- binanceusdm: "binanceusdm";
5
+ binance: "binance";
6
6
  bybit: "bybit";
7
7
  okx: "okx";
8
8
  }>;
@@ -51,7 +51,7 @@ declare const BaseSchedule: z.ZodObject<{
51
51
  id: z.ZodUUID;
52
52
  connector: z.ZodEnum<{
53
53
  hyperliquid: "hyperliquid";
54
- binanceusdm: "binanceusdm";
54
+ binance: "binance";
55
55
  bybit: "bybit";
56
56
  okx: "okx";
57
57
  }>;
@@ -92,7 +92,7 @@ declare const BaseSchedule: z.ZodObject<{
92
92
  positionId: z.ZodUUID;
93
93
  connector: z.ZodEnum<{
94
94
  hyperliquid: "hyperliquid";
95
- binanceusdm: "binanceusdm";
95
+ binance: "binance";
96
96
  bybit: "bybit";
97
97
  okx: "okx";
98
98
  }>;
@@ -112,7 +112,7 @@ export declare const TWAPOpen: z.ZodObject<{
112
112
  id: z.ZodUUID;
113
113
  connector: z.ZodEnum<{
114
114
  hyperliquid: "hyperliquid";
115
- binanceusdm: "binanceusdm";
115
+ binance: "binance";
116
116
  bybit: "bybit";
117
117
  okx: "okx";
118
118
  }>;
@@ -145,7 +145,7 @@ export declare const TWAPOpen: z.ZodObject<{
145
145
  positionId: z.ZodUUID;
146
146
  connector: z.ZodEnum<{
147
147
  hyperliquid: "hyperliquid";
148
- binanceusdm: "binanceusdm";
148
+ binance: "binance";
149
149
  bybit: "bybit";
150
150
  okx: "okx";
151
151
  }>;
@@ -182,7 +182,7 @@ export declare const TWAPClose: z.ZodObject<{
182
182
  id: z.ZodUUID;
183
183
  connector: z.ZodEnum<{
184
184
  hyperliquid: "hyperliquid";
185
- binanceusdm: "binanceusdm";
185
+ binance: "binance";
186
186
  bybit: "bybit";
187
187
  okx: "okx";
188
188
  }>;
@@ -215,7 +215,7 @@ export declare const TWAPClose: z.ZodObject<{
215
215
  positionId: z.ZodUUID;
216
216
  connector: z.ZodEnum<{
217
217
  hyperliquid: "hyperliquid";
218
- binanceusdm: "binanceusdm";
218
+ binance: "binance";
219
219
  bybit: "bybit";
220
220
  okx: "okx";
221
221
  }>;
@@ -244,7 +244,7 @@ export declare const Schedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
244
244
  id: z.ZodUUID;
245
245
  connector: z.ZodEnum<{
246
246
  hyperliquid: "hyperliquid";
247
- binanceusdm: "binanceusdm";
247
+ binance: "binance";
248
248
  bybit: "bybit";
249
249
  okx: "okx";
250
250
  }>;
@@ -277,7 +277,7 @@ export declare const Schedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
277
277
  positionId: z.ZodUUID;
278
278
  connector: z.ZodEnum<{
279
279
  hyperliquid: "hyperliquid";
280
- binanceusdm: "binanceusdm";
280
+ binance: "binance";
281
281
  bybit: "bybit";
282
282
  okx: "okx";
283
283
  }>;
@@ -313,7 +313,7 @@ export declare const Schedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
313
313
  id: z.ZodUUID;
314
314
  connector: z.ZodEnum<{
315
315
  hyperliquid: "hyperliquid";
316
- binanceusdm: "binanceusdm";
316
+ binance: "binance";
317
317
  bybit: "bybit";
318
318
  okx: "okx";
319
319
  }>;
@@ -346,7 +346,7 @@ export declare const Schedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
346
346
  positionId: z.ZodUUID;
347
347
  connector: z.ZodEnum<{
348
348
  hyperliquid: "hyperliquid";
349
- binanceusdm: "binanceusdm";
349
+ binance: "binance";
350
350
  bybit: "bybit";
351
351
  okx: "okx";
352
352
  }>;
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  declare const CreateTWAPOpen: z.ZodObject<{
3
- startAt: z.ZodDefault<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
4
- endAt: z.ZodDefault<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
3
+ startAt: z.ZodPipe<z.ZodOptional<z.ZodCoercedDate<unknown>>, z.ZodTransform<Date, Date | undefined>>;
4
+ endAt: z.ZodPipe<z.ZodOptional<z.ZodCoercedDate<unknown>>, z.ZodTransform<Date, Date | undefined>>;
5
5
  strategy: z.ZodLiteral<"TWAP">;
6
6
  intent: z.ZodLiteral<"OPEN">;
7
7
  executionType: z.ZodLiteral<"MARKET">;
@@ -21,8 +21,8 @@ declare const CreateTWAPOpen: z.ZodObject<{
21
21
  sliceIntervalMs: z.ZodInt;
22
22
  }, z.core.$strip>;
23
23
  declare const CreateTWAPClose: z.ZodObject<{
24
- startAt: z.ZodDefault<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
25
- endAt: z.ZodDefault<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
24
+ startAt: z.ZodPipe<z.ZodOptional<z.ZodCoercedDate<unknown>>, z.ZodTransform<Date, Date | undefined>>;
25
+ endAt: z.ZodPipe<z.ZodOptional<z.ZodCoercedDate<unknown>>, z.ZodTransform<Date, Date | undefined>>;
26
26
  strategy: z.ZodLiteral<"TWAP">;
27
27
  intent: z.ZodLiteral<"CLOSE">;
28
28
  executionType: z.ZodLiteral<"MARKET">;
@@ -34,8 +34,8 @@ declare const CreateTWAPClose: z.ZodObject<{
34
34
  sliceIntervalMs: z.ZodInt;
35
35
  }, z.core.$strip>;
36
36
  export declare const CreateSchedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
37
- startAt: z.ZodDefault<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
38
- endAt: z.ZodDefault<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
37
+ startAt: z.ZodPipe<z.ZodOptional<z.ZodCoercedDate<unknown>>, z.ZodTransform<Date, Date | undefined>>;
38
+ endAt: z.ZodPipe<z.ZodOptional<z.ZodCoercedDate<unknown>>, z.ZodTransform<Date, Date | undefined>>;
39
39
  strategy: z.ZodLiteral<"TWAP">;
40
40
  intent: z.ZodLiteral<"OPEN">;
41
41
  executionType: z.ZodLiteral<"MARKET">;
@@ -54,8 +54,8 @@ export declare const CreateSchedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
54
54
  targetNotional: z.ZodString;
55
55
  sliceIntervalMs: z.ZodInt;
56
56
  }, z.core.$strip>, z.ZodObject<{
57
- startAt: z.ZodDefault<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
58
- endAt: z.ZodDefault<z.ZodOptional<z.ZodCoercedDate<unknown>>>;
57
+ startAt: z.ZodPipe<z.ZodOptional<z.ZodCoercedDate<unknown>>, z.ZodTransform<Date, Date | undefined>>;
58
+ endAt: z.ZodPipe<z.ZodOptional<z.ZodCoercedDate<unknown>>, z.ZodTransform<Date, Date | undefined>>;
59
59
  strategy: z.ZodLiteral<"TWAP">;
60
60
  intent: z.ZodLiteral<"CLOSE">;
61
61
  executionType: z.ZodLiteral<"MARKET">;
@@ -4,6 +4,9 @@ import { InstrumentId } from '../instrument';
4
4
  import { ScheduleSliceMode } from './entities';
5
5
 
6
6
  const SliceInterval = z.int().min(6e4).max(26784e5);
7
+ const THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1e3;
8
+ const DefaultStartAt = z.coerce.date().optional().transform((value) => value ?? /* @__PURE__ */ new Date());
9
+ const DefaultEndAt = z.coerce.date().optional().transform((value) => value ?? new Date(Date.now() + THIRTY_DAYS_MS));
7
10
  const TWAPSliceOpenLeg = z.object({
8
11
  /**
9
12
  * Instrument ID
@@ -38,14 +41,15 @@ const BaseSchedule = z.object({
38
41
  /**
39
42
  * Start at date
40
43
  */
41
- startAt: z.coerce.date().optional().default(/* @__PURE__ */ new Date()),
44
+ startAt: DefaultStartAt,
42
45
  /**
43
46
  * End at date
44
47
  */
45
- endAt: z.coerce.date().optional().default(new Date(Date.now() + 30 * 24 * 60 * 60 * 1e3))
46
- // 30 days from now
48
+ endAt: DefaultEndAt
49
+ }).refine((data) => data.startAt && data.endAt && data.startAt < data.endAt, {
50
+ message: "Start at date must be before end at date"
47
51
  });
48
- const CreateTWAPOpen = BaseSchedule.extend({
52
+ const CreateTWAPOpen = BaseSchedule.safeExtend({
49
53
  /**
50
54
  * Strategy
51
55
  */
@@ -71,7 +75,7 @@ const CreateTWAPOpen = BaseSchedule.extend({
71
75
  */
72
76
  sliceIntervalMs: SliceInterval
73
77
  });
74
- const CreateTWAPClose = BaseSchedule.extend({
78
+ const CreateTWAPClose = BaseSchedule.safeExtend({
75
79
  /**
76
80
  * Strategy
77
81
  */
@@ -4,7 +4,7 @@ export declare const ScheduleListParams: z.ZodObject<{
4
4
  cursor: z.ZodOptional<z.ZodString>;
5
5
  connector: z.ZodOptional<z.ZodEnum<{
6
6
  hyperliquid: "hyperliquid";
7
- binanceusdm: "binanceusdm";
7
+ binance: "binance";
8
8
  bybit: "bybit";
9
9
  okx: "okx";
10
10
  }>>;