@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.
- package/dist/connector/index.d.ts +3 -3
- package/dist/connector/index.js +1 -1
- package/dist/execution/entities.d.ts +20 -20
- package/dist/execution/queries.d.ts +1 -1
- package/dist/execution/responses.d.ts +6 -6
- package/dist/fill/entities.d.ts +1 -1
- package/dist/fill/queries.d.ts +1 -1
- package/dist/fill/responses.d.ts +2 -2
- package/dist/funding/queries.d.ts +1 -1
- package/dist/instrument/entities.d.ts +1 -1
- package/dist/instrument/entities.js +2 -2
- package/dist/instrument/queries.d.ts +1 -1
- package/dist/instrument/responses.d.ts +1 -1
- package/dist/order/entities.d.ts +2 -2
- package/dist/position/entities.d.ts +1 -1
- package/dist/position/queries.d.ts +1 -1
- package/dist/position/responses.d.ts +1 -1
- package/dist/price/queries.d.ts +1 -1
- package/dist/schedule/entities.d.ts +10 -10
- package/dist/schedule/payloads.d.ts +8 -8
- package/dist/schedule/payloads.js +9 -5
- package/dist/schedule/queries.d.ts +1 -1
- package/dist/schedule/responses.d.ts +8 -8
- package/dist/trade/responses.d.ts +24 -24
- package/dist/trade-accounts/entities.d.ts +1 -1
- package/dist/trade-accounts/payloads.d.ts +4 -4
- package/dist/trade-accounts/payloads.js +9 -9
- package/dist/trade-accounts/response.d.ts +3 -3
- package/dist/trade-accounts/response.js +3 -3
- package/dist/trigger/entities/index.d.ts +20 -20
- package/dist/trigger/queries.d.ts +1 -1
- package/dist/trigger/responses.d.ts +12 -12
- package/dist/users/payloads.d.ts +1 -1
- package/dist/users/payloads.js +19 -3
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ export declare const TriggerListResponse: z.ZodObject<{
|
|
|
7
7
|
tradeAccountId: z.ZodUUID;
|
|
8
8
|
connector: z.ZodEnum<{
|
|
9
9
|
hyperliquid: "hyperliquid";
|
|
10
|
-
|
|
10
|
+
binance: "binance";
|
|
11
11
|
bybit: "bybit";
|
|
12
12
|
okx: "okx";
|
|
13
13
|
}>;
|
|
@@ -31,7 +31,7 @@ export declare const TriggerListResponse: z.ZodObject<{
|
|
|
31
31
|
positionId: z.ZodUUID;
|
|
32
32
|
connector: z.ZodEnum<{
|
|
33
33
|
hyperliquid: "hyperliquid";
|
|
34
|
-
|
|
34
|
+
binance: "binance";
|
|
35
35
|
bybit: "bybit";
|
|
36
36
|
okx: "okx";
|
|
37
37
|
}>;
|
|
@@ -153,7 +153,7 @@ export declare const TriggerListResponse: z.ZodObject<{
|
|
|
153
153
|
tradeAccountId: z.ZodUUID;
|
|
154
154
|
connector: z.ZodEnum<{
|
|
155
155
|
hyperliquid: "hyperliquid";
|
|
156
|
-
|
|
156
|
+
binance: "binance";
|
|
157
157
|
bybit: "bybit";
|
|
158
158
|
okx: "okx";
|
|
159
159
|
}>;
|
|
@@ -177,7 +177,7 @@ export declare const TriggerListResponse: z.ZodObject<{
|
|
|
177
177
|
positionId: z.ZodUUID;
|
|
178
178
|
connector: z.ZodEnum<{
|
|
179
179
|
hyperliquid: "hyperliquid";
|
|
180
|
-
|
|
180
|
+
binance: "binance";
|
|
181
181
|
bybit: "bybit";
|
|
182
182
|
okx: "okx";
|
|
183
183
|
}>;
|
|
@@ -344,7 +344,7 @@ export declare const TriggerListResponse: z.ZodObject<{
|
|
|
344
344
|
tradeAccountId: z.ZodUUID;
|
|
345
345
|
connector: z.ZodEnum<{
|
|
346
346
|
hyperliquid: "hyperliquid";
|
|
347
|
-
|
|
347
|
+
binance: "binance";
|
|
348
348
|
bybit: "bybit";
|
|
349
349
|
okx: "okx";
|
|
350
350
|
}>;
|
|
@@ -368,7 +368,7 @@ export declare const TriggerListResponse: z.ZodObject<{
|
|
|
368
368
|
positionId: z.ZodUUID;
|
|
369
369
|
connector: z.ZodEnum<{
|
|
370
370
|
hyperliquid: "hyperliquid";
|
|
371
|
-
|
|
371
|
+
binance: "binance";
|
|
372
372
|
bybit: "bybit";
|
|
373
373
|
okx: "okx";
|
|
374
374
|
}>;
|
|
@@ -514,7 +514,7 @@ export declare const CreateTriggerResponse: z.ZodObject<{
|
|
|
514
514
|
tradeAccountId: z.ZodUUID;
|
|
515
515
|
connector: z.ZodEnum<{
|
|
516
516
|
hyperliquid: "hyperliquid";
|
|
517
|
-
|
|
517
|
+
binance: "binance";
|
|
518
518
|
bybit: "bybit";
|
|
519
519
|
okx: "okx";
|
|
520
520
|
}>;
|
|
@@ -538,7 +538,7 @@ export declare const CreateTriggerResponse: z.ZodObject<{
|
|
|
538
538
|
positionId: z.ZodUUID;
|
|
539
539
|
connector: z.ZodEnum<{
|
|
540
540
|
hyperliquid: "hyperliquid";
|
|
541
|
-
|
|
541
|
+
binance: "binance";
|
|
542
542
|
bybit: "bybit";
|
|
543
543
|
okx: "okx";
|
|
544
544
|
}>;
|
|
@@ -660,7 +660,7 @@ export declare const CreateTriggerResponse: z.ZodObject<{
|
|
|
660
660
|
tradeAccountId: z.ZodUUID;
|
|
661
661
|
connector: z.ZodEnum<{
|
|
662
662
|
hyperliquid: "hyperliquid";
|
|
663
|
-
|
|
663
|
+
binance: "binance";
|
|
664
664
|
bybit: "bybit";
|
|
665
665
|
okx: "okx";
|
|
666
666
|
}>;
|
|
@@ -684,7 +684,7 @@ export declare const CreateTriggerResponse: z.ZodObject<{
|
|
|
684
684
|
positionId: z.ZodUUID;
|
|
685
685
|
connector: z.ZodEnum<{
|
|
686
686
|
hyperliquid: "hyperliquid";
|
|
687
|
-
|
|
687
|
+
binance: "binance";
|
|
688
688
|
bybit: "bybit";
|
|
689
689
|
okx: "okx";
|
|
690
690
|
}>;
|
|
@@ -851,7 +851,7 @@ export declare const CreateTriggerResponse: z.ZodObject<{
|
|
|
851
851
|
tradeAccountId: z.ZodUUID;
|
|
852
852
|
connector: z.ZodEnum<{
|
|
853
853
|
hyperliquid: "hyperliquid";
|
|
854
|
-
|
|
854
|
+
binance: "binance";
|
|
855
855
|
bybit: "bybit";
|
|
856
856
|
okx: "okx";
|
|
857
857
|
}>;
|
|
@@ -875,7 +875,7 @@ export declare const CreateTriggerResponse: z.ZodObject<{
|
|
|
875
875
|
positionId: z.ZodUUID;
|
|
876
876
|
connector: z.ZodEnum<{
|
|
877
877
|
hyperliquid: "hyperliquid";
|
|
878
|
-
|
|
878
|
+
binance: "binance";
|
|
879
879
|
bybit: "bybit";
|
|
880
880
|
okx: "okx";
|
|
881
881
|
}>;
|
package/dist/users/payloads.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ export declare const UpdateUserPreferences: z.ZodObject<{
|
|
|
4
4
|
}, z.core.$strip>;
|
|
5
5
|
export type UpdateUserPreferences = z.infer<typeof UpdateUserPreferences>;
|
|
6
6
|
export declare const UpdateUserDisplayName: z.ZodObject<{
|
|
7
|
-
displayName: z.ZodString
|
|
7
|
+
displayName: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>;
|
|
8
8
|
}, z.core.$strip>;
|
|
9
9
|
export type UpdateUserDisplayName = z.infer<typeof UpdateUserDisplayName>;
|
package/dist/users/payloads.js
CHANGED
|
@@ -3,8 +3,24 @@ import { z } from 'zod';
|
|
|
3
3
|
const UpdateUserPreferences = z.object({
|
|
4
4
|
slippageToleranceBps: z.int().min(1).max(1e4).optional().describe("User slippage preference in basis points")
|
|
5
5
|
}).describe("Payload to update user preferences");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const DISPLAY_NAME_REGEX = /^[\p{L}\p{N} .'-]+$/u;
|
|
7
|
+
const DisplayNameSchema = z.preprocess(
|
|
8
|
+
(value) => {
|
|
9
|
+
if (typeof value !== "string") return value;
|
|
10
|
+
return value.normalize("NFKC").trim().replace(/\s+/g, " ");
|
|
11
|
+
},
|
|
12
|
+
z.string().min(1, "Display name must be at least 1 character").max(40, "Display name must be at most 40 characters").refine((value) => !/[\u200B-\u200D\uFEFF]/.test(value), {
|
|
13
|
+
message: "Display name contains invisible characters"
|
|
14
|
+
}).refine((value) => DISPLAY_NAME_REGEX.test(value), {
|
|
15
|
+
message: "Display name may only contain letters, numbers, spaces, apostrophes, hyphens, and periods"
|
|
16
|
+
}).refine((value) => /[\p{L}\p{N}]/u.test(value), {
|
|
17
|
+
message: "Display name must contain at least one letter or number"
|
|
18
|
+
}).refine((value) => !/^[ .'-]|[ .'-]$/.test(value), {
|
|
19
|
+
message: "Display name cannot start or end with punctuation"
|
|
20
|
+
}).refine((value) => !/[ .'-]{2,}/.test(value), {
|
|
21
|
+
message: "Display name cannot contain repeated separators"
|
|
22
|
+
})
|
|
23
|
+
);
|
|
24
|
+
const UpdateUserDisplayName = z.object({ displayName: DisplayNameSchema }).describe("Payload to update user display name");
|
|
9
25
|
|
|
10
26
|
export { UpdateUserDisplayName, UpdateUserPreferences };
|