@pear-protocol/types 0.1.0 → 1.1.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 (49) hide show
  1. package/dist/auth/api-keys.d.ts +67 -0
  2. package/dist/auth/api-keys.js +35 -0
  3. package/dist/auth/index.d.ts +1 -0
  4. package/dist/auth/index.js +1 -0
  5. package/dist/auth/payloads.d.ts +0 -4
  6. package/dist/auth/payloads.js +2 -5
  7. package/dist/bundle.d.ts +2 -0
  8. package/dist/bundle.js +2 -0
  9. package/dist/common/client-id.d.ts +2 -0
  10. package/dist/common/client-id.js +5 -0
  11. package/dist/common/index.d.ts +1 -0
  12. package/dist/common/index.js +1 -0
  13. package/dist/notification/entities.d.ts +108 -0
  14. package/dist/notification/entities.js +61 -0
  15. package/dist/notification/index.d.ts +4 -0
  16. package/dist/notification/index.js +4 -0
  17. package/dist/notification/payloads.d.ts +20 -0
  18. package/dist/notification/payloads.js +9 -0
  19. package/dist/notification/queries.d.ts +13 -0
  20. package/dist/notification/queries.js +25 -0
  21. package/dist/notification/responses.d.ts +67 -0
  22. package/dist/notification/responses.js +20 -0
  23. package/dist/rebalance/payloads.d.ts +1 -0
  24. package/dist/rebalance/payloads.js +6 -1
  25. package/dist/schedule/payloads.d.ts +4 -0
  26. package/dist/schedule/payloads.js +11 -2
  27. package/dist/trade/payloads.d.ts +8 -0
  28. package/dist/trade/payloads.js +21 -4
  29. package/dist/trigger/entities/conditions.d.ts +170 -0
  30. package/dist/trigger/entities/conditions.js +43 -3
  31. package/dist/trigger/entities/index.d.ts +369 -0
  32. package/dist/trigger/index.d.ts +1 -0
  33. package/dist/trigger/index.js +1 -0
  34. package/dist/trigger/oracle.d.ts +31 -0
  35. package/dist/trigger/oracle.js +15 -0
  36. package/dist/trigger/payloads/conditions.d.ts +50 -0
  37. package/dist/trigger/payloads/conditions.js +35 -1
  38. package/dist/trigger/payloads/index.d.ts +90 -0
  39. package/dist/trigger/payloads/index.js +16 -3
  40. package/dist/trigger/responses.d.ts +246 -0
  41. package/dist/triggers/entities.d.ts +34 -0
  42. package/dist/triggers/entities.js +21 -0
  43. package/dist/triggers/index.d.ts +3 -0
  44. package/dist/triggers/index.js +3 -0
  45. package/dist/triggers/queries.d.ts +8 -0
  46. package/dist/triggers/queries.js +10 -0
  47. package/dist/triggers/responses.d.ts +26 -0
  48. package/dist/triggers/responses.js +9 -0
  49. package/package.json +1 -1
@@ -0,0 +1,67 @@
1
+ import { z } from 'zod';
2
+ export declare const ApiKeyScope: z.ZodEnum<{
3
+ read: "read";
4
+ read_write: "read_write";
5
+ }>;
6
+ export declare const CreateApiKeyInput: z.ZodObject<{
7
+ label: z.ZodString;
8
+ scope: z.ZodDefault<z.ZodEnum<{
9
+ read: "read";
10
+ read_write: "read_write";
11
+ }>>;
12
+ expiresAt: z.ZodOptional<z.ZodISODateTime>;
13
+ }, z.core.$strip>;
14
+ export declare const CreateApiKeyOutput: z.ZodObject<{
15
+ id: z.ZodUUID;
16
+ label: z.ZodString;
17
+ scope: z.ZodEnum<{
18
+ read: "read";
19
+ read_write: "read_write";
20
+ }>;
21
+ key: z.ZodString;
22
+ }, z.core.$strip>;
23
+ export declare const ApiKeySummary: z.ZodObject<{
24
+ id: z.ZodUUID;
25
+ label: z.ZodString;
26
+ scope: z.ZodEnum<{
27
+ read: "read";
28
+ read_write: "read_write";
29
+ }>;
30
+ keyPrefix: z.ZodString;
31
+ lastUsedAt: z.ZodNullable<z.ZodString>;
32
+ expiresAt: z.ZodNullable<z.ZodString>;
33
+ revokedAt: z.ZodNullable<z.ZodString>;
34
+ createdAt: z.ZodString;
35
+ }, z.core.$strip>;
36
+ export declare const ListApiKeysOutput: z.ZodArray<z.ZodObject<{
37
+ id: z.ZodUUID;
38
+ label: z.ZodString;
39
+ scope: z.ZodEnum<{
40
+ read: "read";
41
+ read_write: "read_write";
42
+ }>;
43
+ keyPrefix: z.ZodString;
44
+ lastUsedAt: z.ZodNullable<z.ZodString>;
45
+ expiresAt: z.ZodNullable<z.ZodString>;
46
+ revokedAt: z.ZodNullable<z.ZodString>;
47
+ createdAt: z.ZodString;
48
+ }, z.core.$strip>>;
49
+ export declare const ApiKeyMeResponse: z.ZodObject<{
50
+ id: z.ZodUUID;
51
+ role: z.ZodEnum<{
52
+ basic: "basic";
53
+ pro: "pro";
54
+ admin: "admin";
55
+ }>;
56
+ scope: z.ZodEnum<{
57
+ read: "read";
58
+ read_write: "read_write";
59
+ }>;
60
+ authMethod: z.ZodLiteral<"api_key">;
61
+ }, z.core.$strip>;
62
+ export type ApiKeyScope = z.infer<typeof ApiKeyScope>;
63
+ export type CreateApiKeyInput = z.infer<typeof CreateApiKeyInput>;
64
+ export type CreateApiKeyOutput = z.infer<typeof CreateApiKeyOutput>;
65
+ export type ApiKeySummary = z.infer<typeof ApiKeySummary>;
66
+ export type ListApiKeysOutput = z.infer<typeof ListApiKeysOutput>;
67
+ export type ApiKeyMeResponse = z.infer<typeof ApiKeyMeResponse>;
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod';
2
+
3
+ const ApiKeyScope = z.enum(["read", "read_write"]).describe("API key access scope");
4
+ const CreateApiKeyInput = z.object({
5
+ label: z.string().trim().min(1, "Label is required").max(100).describe("Human label for the key"),
6
+ scope: ApiKeyScope.default("read"),
7
+ /** ISO-8601 datetime; omit for a key that never expires. */
8
+ expiresAt: z.iso.datetime({ offset: true }).optional().describe("Optional expiry (ISO-8601)")
9
+ }).describe("Create a new API key");
10
+ const CreateApiKeyOutput = z.object({
11
+ id: z.uuid(),
12
+ label: z.string(),
13
+ scope: ApiKeyScope,
14
+ /** Raw secret — returned only once, at creation. */
15
+ key: z.string()
16
+ }).describe("Newly created API key (raw secret shown once)");
17
+ const ApiKeySummary = z.object({
18
+ id: z.uuid(),
19
+ label: z.string(),
20
+ scope: ApiKeyScope,
21
+ keyPrefix: z.string(),
22
+ lastUsedAt: z.string().nullable(),
23
+ expiresAt: z.string().nullable(),
24
+ revokedAt: z.string().nullable(),
25
+ createdAt: z.string()
26
+ });
27
+ const ListApiKeysOutput = z.array(ApiKeySummary).describe("All API keys for the user");
28
+ const ApiKeyMeResponse = z.object({
29
+ id: z.uuid().describe("User UUID that owns the API key"),
30
+ role: z.enum(["basic", "pro", "admin"]).describe("User role"),
31
+ scope: ApiKeyScope,
32
+ authMethod: z.literal("api_key")
33
+ }).describe("Identity of the caller authenticated via an API key");
34
+
35
+ export { ApiKeyMeResponse, ApiKeyScope, ApiKeySummary, CreateApiKeyInput, CreateApiKeyOutput, ListApiKeysOutput };
@@ -1,3 +1,4 @@
1
+ export * from './api-keys';
1
2
  export * from './entities';
2
3
  export * from './payloads';
3
4
  export * from './response';
@@ -1,3 +1,4 @@
1
+ export * from './api-keys';
1
2
  export * from './entities';
2
3
  export * from './payloads';
3
4
  export * from './response';
@@ -19,13 +19,11 @@ export declare const WalletLoginRequest: z.ZodObject<{
19
19
  address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
20
20
  signature: z.ZodString;
21
21
  accessCode: z.ZodOptional<z.ZodString>;
22
- clientId: z.ZodString;
23
22
  }, z.core.$strip>;
24
23
  export declare const EmailLoginRequest: z.ZodObject<{
25
24
  method: z.ZodLiteral<"email">;
26
25
  email: z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>;
27
26
  password: z.ZodString;
28
- clientId: z.ZodString;
29
27
  }, z.core.$strip>;
30
28
  export declare const VerifyEmailRequest: z.ZodObject<{
31
29
  token: z.ZodString;
@@ -47,12 +45,10 @@ export declare const LoginRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
47
45
  address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
48
46
  signature: z.ZodString;
49
47
  accessCode: z.ZodOptional<z.ZodString>;
50
- clientId: z.ZodString;
51
48
  }, z.core.$strip>, z.ZodObject<{
52
49
  method: z.ZodLiteral<"email">;
53
50
  email: z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>;
54
51
  password: z.ZodString;
55
- clientId: z.ZodString;
56
52
  }, z.core.$strip>], "method">;
57
53
  export declare const RefreshTokenRequest: z.ZodObject<{
58
54
  refreshToken: z.ZodString;
@@ -3,7 +3,6 @@ import { z } from 'zod';
3
3
  const EthereumAddress = z.string().regex(/^0x[a-fA-F0-9]{40}$/, "Invalid Ethereum address").transform((val) => val.toLowerCase()).describe("Ethereum wallet address (0x-prefixed, 40 hex chars, lowercase)");
4
4
  const Email = z.email("Invalid email address").transform((val) => val.toLowerCase()).describe("Email address (lowercase)");
5
5
  const Password = z.string().min(8, "Password must be at least 8 characters").max(128, "Password must be at most 128 characters").describe("Password for authentication");
6
- const ClientIdCode = z.string().min(1, "clientId is required").max(64, "clientId is too long").describe("Attribution route code (client_ids.code)");
7
6
  const AccessCode = z.string().trim().max(64).optional().describe("Optional beta access code");
8
7
  const RequestNonceRequest = z.object({
9
8
  address: EthereumAddress
@@ -24,14 +23,12 @@ const WalletLoginRequest = z.object({
24
23
  method: z.literal("wallet").describe('Must be "wallet" for wallet authentication'),
25
24
  address: EthereumAddress,
26
25
  signature: z.string().min(1, "Signature is required").describe("Signature of the nonce message"),
27
- accessCode: AccessCode,
28
- clientId: ClientIdCode
26
+ accessCode: AccessCode
29
27
  }).describe("Wallet-based authentication using nonce signature");
30
28
  const EmailLoginRequest = z.object({
31
29
  method: z.literal("email").describe('Must be "email" for email authentication'),
32
30
  email: Email,
33
- password: Password,
34
- clientId: ClientIdCode
31
+ password: Password
35
32
  }).describe("Email-based authentication using email and password");
36
33
  const VerifyEmailRequest = z.object({
37
34
  token: z.string().min(1, "Token is required").describe("Verification token"),
package/dist/bundle.d.ts CHANGED
@@ -10,6 +10,7 @@ export * from './instrument-precision';
10
10
  export * from './leverage';
11
11
  export * from './market';
12
12
  export * from './misc';
13
+ export * from './notification';
13
14
  export * from './order';
14
15
  export * from './portfolio';
15
16
  export * from './position';
@@ -22,4 +23,5 @@ export * from './tca';
22
23
  export * from './trade';
23
24
  export * from './trade-accounts';
24
25
  export * from './trigger';
26
+ export * from './triggers';
25
27
  export * from './users';
package/dist/bundle.js CHANGED
@@ -10,6 +10,7 @@ export * from './instrument-precision';
10
10
  export * from './leverage';
11
11
  export * from './market';
12
12
  export * from './misc';
13
+ export * from './notification';
13
14
  export * from './order';
14
15
  export * from './portfolio';
15
16
  export * from './position';
@@ -22,4 +23,5 @@ export * from './tca';
22
23
  export * from './trade';
23
24
  export * from './trade-accounts';
24
25
  export * from './trigger';
26
+ export * from './triggers';
25
27
  export * from './users';
@@ -0,0 +1,2 @@
1
+ import { z } from 'zod';
2
+ export declare const ClientIdCode: z.ZodOptional<z.ZodString>;
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+
3
+ const ClientIdCode = z.string().min(1).max(64).optional().describe("Attribution route code (client_ids.code)");
4
+
5
+ export { ClientIdCode };
@@ -1,3 +1,4 @@
1
1
  export * from './array';
2
+ export * from './client-id';
2
3
  export * from './request';
3
4
  export * from './response';
@@ -1,3 +1,4 @@
1
1
  export * from './array';
2
+ export * from './client-id';
2
3
  export * from './request';
3
4
  export * from './response';
@@ -0,0 +1,108 @@
1
+ import { z } from 'zod';
2
+ export declare const NotificationCategory: z.ZodEnum<{
3
+ TAKE_PROFIT_HIT: "TAKE_PROFIT_HIT";
4
+ STOP_LOSS_HIT: "STOP_LOSS_HIT";
5
+ TRIGGER_ORDER_HIT: "TRIGGER_ORDER_HIT";
6
+ }>;
7
+ export type NotificationCategory = z.infer<typeof NotificationCategory>;
8
+ export declare const NotificationParameters: z.ZodDiscriminatedUnion<[z.ZodObject<{
9
+ type: z.ZodLiteral<"take_profit">;
10
+ triggerId: z.ZodUUID;
11
+ positionId: z.ZodUUID;
12
+ connector: z.ZodEnum<{
13
+ hyperliquid: "hyperliquid";
14
+ binance: "binance";
15
+ bybit: "bybit";
16
+ okx: "okx";
17
+ lighter: "lighter";
18
+ }>;
19
+ }, z.core.$strip>, z.ZodObject<{
20
+ type: z.ZodLiteral<"stop_loss">;
21
+ triggerId: z.ZodUUID;
22
+ positionId: z.ZodUUID;
23
+ connector: z.ZodEnum<{
24
+ hyperliquid: "hyperliquid";
25
+ binance: "binance";
26
+ bybit: "bybit";
27
+ okx: "okx";
28
+ lighter: "lighter";
29
+ }>;
30
+ }, z.core.$strip>, z.ZodObject<{
31
+ type: z.ZodLiteral<"trigger_order">;
32
+ triggerId: z.ZodUUID;
33
+ positionId: z.ZodUUID;
34
+ connector: z.ZodEnum<{
35
+ hyperliquid: "hyperliquid";
36
+ binance: "binance";
37
+ bybit: "bybit";
38
+ okx: "okx";
39
+ lighter: "lighter";
40
+ }>;
41
+ }, z.core.$strip>, z.ZodObject<{
42
+ type: z.ZodLiteral<"default_trigger">;
43
+ triggerId: z.ZodUUID;
44
+ connector: z.ZodEnum<{
45
+ hyperliquid: "hyperliquid";
46
+ binance: "binance";
47
+ bybit: "bybit";
48
+ okx: "okx";
49
+ lighter: "lighter";
50
+ }>;
51
+ }, z.core.$strip>], "type">;
52
+ export type NotificationParameters = z.output<typeof NotificationParameters>;
53
+ export declare const Notification: z.ZodObject<{
54
+ id: z.ZodUUID;
55
+ category: z.ZodEnum<{
56
+ TAKE_PROFIT_HIT: "TAKE_PROFIT_HIT";
57
+ STOP_LOSS_HIT: "STOP_LOSS_HIT";
58
+ TRIGGER_ORDER_HIT: "TRIGGER_ORDER_HIT";
59
+ }>;
60
+ parameters: z.ZodDiscriminatedUnion<[z.ZodObject<{
61
+ type: z.ZodLiteral<"take_profit">;
62
+ triggerId: z.ZodUUID;
63
+ positionId: z.ZodUUID;
64
+ connector: z.ZodEnum<{
65
+ hyperliquid: "hyperliquid";
66
+ binance: "binance";
67
+ bybit: "bybit";
68
+ okx: "okx";
69
+ lighter: "lighter";
70
+ }>;
71
+ }, z.core.$strip>, z.ZodObject<{
72
+ type: z.ZodLiteral<"stop_loss">;
73
+ triggerId: z.ZodUUID;
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
+ }, z.core.$strip>, z.ZodObject<{
83
+ type: z.ZodLiteral<"trigger_order">;
84
+ triggerId: z.ZodUUID;
85
+ positionId: z.ZodUUID;
86
+ connector: z.ZodEnum<{
87
+ hyperliquid: "hyperliquid";
88
+ binance: "binance";
89
+ bybit: "bybit";
90
+ okx: "okx";
91
+ lighter: "lighter";
92
+ }>;
93
+ }, z.core.$strip>, z.ZodObject<{
94
+ type: z.ZodLiteral<"default_trigger">;
95
+ triggerId: z.ZodUUID;
96
+ connector: z.ZodEnum<{
97
+ hyperliquid: "hyperliquid";
98
+ binance: "binance";
99
+ bybit: "bybit";
100
+ okx: "okx";
101
+ lighter: "lighter";
102
+ }>;
103
+ }, z.core.$strip>], "type">;
104
+ isRead: z.ZodBoolean;
105
+ createdAt: z.ZodString;
106
+ updatedAt: z.ZodString;
107
+ }, z.core.$strip>;
108
+ export type Notification = z.output<typeof Notification>;
@@ -0,0 +1,61 @@
1
+ import { z } from 'zod';
2
+ import { Connector } from '../connector';
3
+
4
+ const NotificationCategory = z.enum(["TAKE_PROFIT_HIT", "STOP_LOSS_HIT", "TRIGGER_ORDER_HIT"]);
5
+ const TakeProfitNotificationParameters = z.object({
6
+ type: z.literal("take_profit"),
7
+ triggerId: z.uuid(),
8
+ positionId: z.uuid(),
9
+ connector: Connector
10
+ });
11
+ const StopLossNotificationParameters = z.object({
12
+ type: z.literal("stop_loss"),
13
+ triggerId: z.uuid(),
14
+ positionId: z.uuid(),
15
+ connector: Connector
16
+ });
17
+ const TriggerOrderNotificationParameters = z.object({
18
+ type: z.literal("trigger_order"),
19
+ triggerId: z.uuid(),
20
+ positionId: z.uuid(),
21
+ connector: Connector
22
+ });
23
+ const DefaultTriggerNotificationParameters = z.object({
24
+ type: z.literal("default_trigger"),
25
+ triggerId: z.uuid(),
26
+ connector: Connector
27
+ });
28
+ const NotificationParameters = z.discriminatedUnion("type", [
29
+ TakeProfitNotificationParameters,
30
+ StopLossNotificationParameters,
31
+ TriggerOrderNotificationParameters,
32
+ DefaultTriggerNotificationParameters
33
+ ]);
34
+ const Notification = z.object({
35
+ /**
36
+ * Notification UUID
37
+ */
38
+ id: z.uuid(),
39
+ /**
40
+ * What kind of notification this is
41
+ */
42
+ category: NotificationCategory,
43
+ /**
44
+ * Category-specific display payload
45
+ */
46
+ parameters: NotificationParameters,
47
+ /**
48
+ * Whether the user has read it
49
+ */
50
+ isRead: z.boolean(),
51
+ /**
52
+ * Created at timestamp
53
+ */
54
+ createdAt: z.string(),
55
+ /**
56
+ * Updated at timestamp
57
+ */
58
+ updatedAt: z.string()
59
+ });
60
+
61
+ export { Notification, NotificationCategory, NotificationParameters };
@@ -0,0 +1,4 @@
1
+ export * from './entities';
2
+ export * from './payloads';
3
+ export * from './queries';
4
+ export * from './responses';
@@ -0,0 +1,4 @@
1
+ export * from './entities';
2
+ export * from './payloads';
3
+ export * from './queries';
4
+ export * from './responses';
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Mark notifications as read. Provide exactly one selector: a single `id`, or a
4
+ * `timestamp` (epoch ms) to mark every notification created at or before it.
5
+ */
6
+ export declare const MarkNotificationsReadPayload: z.ZodUnion<readonly [z.ZodObject<{
7
+ id: z.ZodUUID;
8
+ }, z.core.$strict>, z.ZodObject<{
9
+ timestamp: z.ZodCoercedNumber<number>;
10
+ }, z.core.$strict>]>;
11
+ export type MarkNotificationsReadPayloadInput = z.input<typeof MarkNotificationsReadPayload>;
12
+ export type MarkNotificationsReadPayload = z.output<typeof MarkNotificationsReadPayload>;
13
+ /**
14
+ * Mark a single notification unread again.
15
+ */
16
+ export declare const MarkNotificationUnreadPayload: z.ZodObject<{
17
+ id: z.ZodUUID;
18
+ }, z.core.$strict>;
19
+ export type MarkNotificationUnreadPayloadInput = z.input<typeof MarkNotificationUnreadPayload>;
20
+ export type MarkNotificationUnreadPayload = z.output<typeof MarkNotificationUnreadPayload>;
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+
3
+ const MarkNotificationsReadPayload = z.union([
4
+ z.strictObject({ id: z.uuid() }),
5
+ z.strictObject({ timestamp: z.coerce.number().int().positive() })
6
+ ]);
7
+ const MarkNotificationUnreadPayload = z.strictObject({ id: z.uuid() });
8
+
9
+ export { MarkNotificationUnreadPayload, MarkNotificationsReadPayload };
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export declare const NotificationListParams: z.ZodObject<{
3
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<number>>>;
4
+ startDate: z.ZodOptional<z.ZodCoercedDate<Date>>;
5
+ endDate: z.ZodOptional<z.ZodCoercedDate<Date>>;
6
+ scope: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
7
+ all: "all";
8
+ read: "read";
9
+ unread: "unread";
10
+ }>>>;
11
+ }, z.core.$strip>;
12
+ export type NotificationListParamsInput = z.input<typeof NotificationListParams>;
13
+ export type NotificationListParams = z.output<typeof NotificationListParams>;
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+
3
+ const NotificationListParams = z.object({
4
+ /**
5
+ * The maximum number of notifications to retrieve (newest first).
6
+ * Matches the V2 engine: max and default are both 100.
7
+ */
8
+ limit: z.coerce.number().int().positive().max(100).optional().default(100),
9
+ /**
10
+ * Only return notifications created at or after this date.
11
+ */
12
+ startDate: z.coerce.date().optional(),
13
+ /**
14
+ * Only return notifications created at or before this date.
15
+ */
16
+ endDate: z.coerce.date().optional(),
17
+ /**
18
+ * Filter by read state: `all` (default), only `read`, or only `unread`.
19
+ */
20
+ scope: z.enum(["all", "read", "unread"]).optional().default("all")
21
+ }).refine((data) => !data.startDate || !data.endDate || data.startDate < data.endDate, {
22
+ message: "startDate must be before endDate"
23
+ });
24
+
25
+ export { NotificationListParams };
@@ -0,0 +1,67 @@
1
+ import { z } from 'zod';
2
+ export declare const NotificationListResponse: z.ZodObject<{
3
+ notifications: z.ZodArray<z.ZodObject<{
4
+ id: z.ZodUUID;
5
+ category: z.ZodEnum<{
6
+ TAKE_PROFIT_HIT: "TAKE_PROFIT_HIT";
7
+ STOP_LOSS_HIT: "STOP_LOSS_HIT";
8
+ TRIGGER_ORDER_HIT: "TRIGGER_ORDER_HIT";
9
+ }>;
10
+ parameters: z.ZodDiscriminatedUnion<[z.ZodObject<{
11
+ type: z.ZodLiteral<"take_profit">;
12
+ triggerId: z.ZodUUID;
13
+ positionId: z.ZodUUID;
14
+ connector: z.ZodEnum<{
15
+ hyperliquid: "hyperliquid";
16
+ binance: "binance";
17
+ bybit: "bybit";
18
+ okx: "okx";
19
+ lighter: "lighter";
20
+ }>;
21
+ }, z.core.$strip>, z.ZodObject<{
22
+ type: z.ZodLiteral<"stop_loss">;
23
+ triggerId: z.ZodUUID;
24
+ positionId: z.ZodUUID;
25
+ connector: z.ZodEnum<{
26
+ hyperliquid: "hyperliquid";
27
+ binance: "binance";
28
+ bybit: "bybit";
29
+ okx: "okx";
30
+ lighter: "lighter";
31
+ }>;
32
+ }, z.core.$strip>, z.ZodObject<{
33
+ type: z.ZodLiteral<"trigger_order">;
34
+ triggerId: z.ZodUUID;
35
+ positionId: z.ZodUUID;
36
+ connector: z.ZodEnum<{
37
+ hyperliquid: "hyperliquid";
38
+ binance: "binance";
39
+ bybit: "bybit";
40
+ okx: "okx";
41
+ lighter: "lighter";
42
+ }>;
43
+ }, z.core.$strip>, z.ZodObject<{
44
+ type: z.ZodLiteral<"default_trigger">;
45
+ triggerId: z.ZodUUID;
46
+ connector: z.ZodEnum<{
47
+ hyperliquid: "hyperliquid";
48
+ binance: "binance";
49
+ bybit: "bybit";
50
+ okx: "okx";
51
+ lighter: "lighter";
52
+ }>;
53
+ }, z.core.$strip>], "type">;
54
+ isRead: z.ZodBoolean;
55
+ createdAt: z.ZodString;
56
+ updatedAt: z.ZodString;
57
+ }, z.core.$strip>>;
58
+ }, z.core.$strip>;
59
+ export type NotificationListResponse = z.output<typeof NotificationListResponse>;
60
+ export declare const MarkNotificationsReadResponse: z.ZodObject<{
61
+ updated: z.ZodNumber;
62
+ }, z.core.$strip>;
63
+ export type MarkNotificationsReadResponse = z.output<typeof MarkNotificationsReadResponse>;
64
+ export declare const MarkNotificationUnreadResponse: z.ZodObject<{
65
+ updated: z.ZodNumber;
66
+ }, z.core.$strip>;
67
+ export type MarkNotificationUnreadResponse = z.output<typeof MarkNotificationUnreadResponse>;
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { Notification } from './entities';
3
+
4
+ const NotificationListResponse = z.object({
5
+ notifications: z.array(Notification)
6
+ });
7
+ const MarkNotificationsReadResponse = z.object({
8
+ /**
9
+ * How many notifications were flipped from unread to read.
10
+ */
11
+ updated: z.number().int()
12
+ });
13
+ const MarkNotificationUnreadResponse = z.object({
14
+ /**
15
+ * How many notifications were flipped from read to unread.
16
+ */
17
+ updated: z.number().int()
18
+ });
19
+
20
+ export { MarkNotificationUnreadResponse, MarkNotificationsReadResponse, NotificationListResponse };
@@ -7,5 +7,6 @@ export declare const RebalanceManually: z.ZodObject<{
7
7
  symbol: z.ZodString;
8
8
  weight: z.ZodNumber;
9
9
  }, z.core.$strip>>;
10
+ clientId: z.ZodOptional<z.ZodString>;
10
11
  }, z.core.$strip>;
11
12
  export type RebalanceManually = z.output<typeof RebalanceManually>;
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { ClientIdCode } from '../common/client-id';
2
3
  import { RefineWeightingSum, RefineUniqueSymbols } from '../common/refinement';
3
4
  import { ExecutionOrderType } from '../execution';
4
5
  import { InstrumentId } from '../instrument';
@@ -10,7 +11,11 @@ const RebalanceManually = z.object({
10
11
  symbol: InstrumentId,
11
12
  weight: z.number().positive({ message: "Weight must be greater than 0" }).max(1, { message: "Weight must be less than 1" })
12
13
  })
13
- ).superRefine(RefineWeightingSum).superRefine(RefineUniqueSymbols).describe("Array of weightings to rebalance the position")
14
+ ).superRefine(RefineWeightingSum).superRefine(RefineUniqueSymbols).describe("Array of weightings to rebalance the position"),
15
+ /**
16
+ * Attribution route code (client_ids.code)
17
+ */
18
+ clientId: ClientIdCode
14
19
  });
15
20
 
16
21
  export { RebalanceManually };
@@ -19,6 +19,7 @@ declare const CreateTWAPOpen: z.ZodObject<{
19
19
  }, z.core.$strip>>;
20
20
  targetNotional: z.ZodString;
21
21
  sliceIntervalSec: z.ZodInt;
22
+ clientId: z.ZodOptional<z.ZodString>;
22
23
  }, z.core.$strip>;
23
24
  declare const CreateTWAPClose: z.ZodObject<{
24
25
  startAt: z.ZodPipe<z.ZodOptional<z.ZodCoercedDate<unknown>>, z.ZodTransform<Date, Date | undefined>>;
@@ -32,6 +33,7 @@ declare const CreateTWAPClose: z.ZodObject<{
32
33
  }, z.core.$strip>>;
33
34
  positionId: z.ZodUUID;
34
35
  sliceIntervalSec: z.ZodInt;
36
+ clientId: z.ZodOptional<z.ZodString>;
35
37
  }, z.core.$strip>;
36
38
  export declare const CreateSchedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
37
39
  startAt: z.ZodPipe<z.ZodOptional<z.ZodCoercedDate<unknown>>, z.ZodTransform<Date, Date | undefined>>;
@@ -53,6 +55,7 @@ export declare const CreateSchedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
53
55
  }, z.core.$strip>>;
54
56
  targetNotional: z.ZodString;
55
57
  sliceIntervalSec: z.ZodInt;
58
+ clientId: z.ZodOptional<z.ZodString>;
56
59
  }, z.core.$strip>, z.ZodObject<{
57
60
  startAt: z.ZodPipe<z.ZodOptional<z.ZodCoercedDate<unknown>>, z.ZodTransform<Date, Date | undefined>>;
58
61
  endAt: z.ZodPipe<z.ZodOptional<z.ZodCoercedDate<unknown>>, z.ZodTransform<Date, Date | undefined>>;
@@ -65,6 +68,7 @@ export declare const CreateSchedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
65
68
  }, z.core.$strip>>;
66
69
  positionId: z.ZodUUID;
67
70
  sliceIntervalSec: z.ZodInt;
71
+ clientId: z.ZodOptional<z.ZodString>;
68
72
  }, z.core.$strip>], "intent">;
69
73
  export type CreateTWAPOpen = z.output<typeof CreateTWAPOpen>;
70
74
  export type CreateTWAPClose = z.output<typeof CreateTWAPClose>;
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { ClientIdCode } from '../common/client-id';
2
3
  import { UnsignedDecimalString, Side } from '../common/schema';
3
4
  import { InstrumentId } from '../instrument';
4
5
  import { ScheduleSliceMode } from './entities';
@@ -73,7 +74,11 @@ const CreateTWAPOpen = BaseSchedule.safeExtend({
73
74
  /**
74
75
  * Slice interval in seconds
75
76
  */
76
- sliceIntervalSec: SliceIntervalSec
77
+ sliceIntervalSec: SliceIntervalSec,
78
+ /**
79
+ * Attribution route code (client_ids.code)
80
+ */
81
+ clientId: ClientIdCode
77
82
  });
78
83
  const CreateTWAPClose = BaseSchedule.safeExtend({
79
84
  /**
@@ -99,7 +104,11 @@ const CreateTWAPClose = BaseSchedule.safeExtend({
99
104
  /**
100
105
  * Slice interval in seconds
101
106
  */
102
- sliceIntervalSec: SliceIntervalSec
107
+ sliceIntervalSec: SliceIntervalSec,
108
+ /**
109
+ * Attribution route code (client_ids.code)
110
+ */
111
+ clientId: ClientIdCode
103
112
  });
104
113
  const CreateSchedule = z.discriminatedUnion("intent", [CreateTWAPOpen, CreateTWAPClose]);
105
114