@pear-protocol/types 0.0.3 → 0.0.4

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.
@@ -5,6 +5,6 @@ export declare const AuthenticatedUser: z.ZodObject<{
5
5
  basic: "basic";
6
6
  pro: "pro";
7
7
  }>;
8
- address: z.ZodOptional<z.ZodString>;
8
+ address: z.ZodNullable<z.ZodString>;
9
9
  }, z.core.$strip>;
10
10
  export type AuthenticatedUser = z.infer<typeof AuthenticatedUser>;
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  const AuthenticatedUser = z.object({
4
4
  id: z.uuid().describe("User UUID"),
5
5
  role: z.enum(["basic", "pro"]).describe("User role"),
6
- address: z.string().optional().describe("User address")
6
+ address: z.string().nullable().describe("User address")
7
7
  }).describe("Current authenticated user info");
8
8
 
9
9
  export { AuthenticatedUser };
@@ -8,7 +8,6 @@ export declare const EmailRegisterRequest: z.ZodObject<{
8
8
  }, z.core.$strip>;
9
9
  export declare const LinkEmailRequest: z.ZodObject<{
10
10
  email: z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>;
11
- password: z.ZodString;
12
11
  }, z.core.$strip>;
13
12
  export declare const LinkWalletRequest: z.ZodObject<{
14
13
  address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
@@ -24,6 +23,10 @@ export declare const EmailLoginRequest: z.ZodObject<{
24
23
  email: z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>;
25
24
  password: z.ZodString;
26
25
  }, z.core.$strip>;
26
+ export declare const VerifyEmailRequest: z.ZodObject<{
27
+ token: z.ZodString;
28
+ password: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strip>;
27
30
  export declare const LoginRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
28
31
  method: z.ZodLiteral<"wallet">;
29
32
  address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
@@ -36,6 +39,9 @@ export declare const LoginRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
36
39
  export declare const RefreshTokenRequest: z.ZodObject<{
37
40
  refreshToken: z.ZodString;
38
41
  }, z.core.$strip>;
42
+ export declare const ResendVerificationForRegisterRequest: z.ZodObject<{
43
+ email: z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>;
44
+ }, z.core.$strip>;
39
45
  export declare const LogoutRequest: z.ZodObject<{
40
46
  refreshToken: z.ZodString;
41
47
  }, z.core.$strip>;
@@ -48,3 +54,5 @@ export type EmailLoginRequest = z.infer<typeof EmailLoginRequest>;
48
54
  export type LoginRequest = z.infer<typeof LoginRequest>;
49
55
  export type RefreshTokenRequest = z.infer<typeof RefreshTokenRequest>;
50
56
  export type LogoutRequest = z.infer<typeof LogoutRequest>;
57
+ export type VerifyEmailRequest = z.infer<typeof VerifyEmailRequest>;
58
+ export type ResendVerificationForRegisterRequest = z.infer<typeof ResendVerificationForRegisterRequest>;
@@ -11,9 +11,8 @@ const EmailRegisterRequest = z.object({
11
11
  password: Password
12
12
  }).describe("Email registration request");
13
13
  const LinkEmailRequest = z.object({
14
- email: Email,
15
- password: Password
16
- }).describe("Link email/password credentials to the authenticated account");
14
+ email: Email
15
+ }).describe("Link email credentials to the authenticated account");
17
16
  const LinkWalletRequest = z.object({
18
17
  address: EthereumAddress,
19
18
  signature: z.string().min(1, "Signature is required").describe("Signature of the nonce message")
@@ -28,12 +27,19 @@ const EmailLoginRequest = z.object({
28
27
  email: Email,
29
28
  password: Password
30
29
  }).describe("Email-based authentication using email and password");
30
+ const VerifyEmailRequest = z.object({
31
+ token: z.string().min(1, "Token is required").describe("Verification token"),
32
+ password: Password.optional().describe("Password for the email claim if using link-flow")
33
+ }).describe("Verify email claim using the token from the verification email");
31
34
  const LoginRequest = z.discriminatedUnion("method", [WalletLoginRequest, EmailLoginRequest]);
32
35
  const RefreshTokenRequest = z.object({
33
36
  refreshToken: z.string().min(1, "Refresh token is required").describe("Refresh token")
34
37
  }).describe("Refresh token request");
38
+ const ResendVerificationForRegisterRequest = z.object({
39
+ email: Email
40
+ }).describe("Resend verification email by email address (unauthenticated)");
35
41
  const LogoutRequest = z.object({
36
42
  refreshToken: z.string().min(1, "Refresh token is required").describe("Refresh token to revoke")
37
43
  }).describe("Logout and revoke refresh token");
38
44
 
39
- export { EmailLoginRequest, EmailRegisterRequest, LinkEmailRequest, LinkWalletRequest, LoginRequest, LogoutRequest, RefreshTokenRequest, RequestNonceRequest, WalletLoginRequest };
45
+ export { EmailLoginRequest, EmailRegisterRequest, LinkEmailRequest, LinkWalletRequest, LoginRequest, LogoutRequest, RefreshTokenRequest, RequestNonceRequest, ResendVerificationForRegisterRequest, VerifyEmailRequest, WalletLoginRequest };
@@ -6,7 +6,7 @@ export declare const LoginResponse: z.ZodObject<{
6
6
  basic: "basic";
7
7
  pro: "pro";
8
8
  }>;
9
- address: z.ZodOptional<z.ZodString>;
9
+ address: z.ZodNullable<z.ZodString>;
10
10
  }, z.core.$strip>;
11
11
  }, z.core.$strip>;
12
12
  export declare const RefreshTokenResponse: z.ZodObject<{
@@ -15,26 +15,20 @@ export declare const RefreshTokenResponse: z.ZodObject<{
15
15
  tokenType: z.ZodLiteral<"Bearer">;
16
16
  expiresIn: z.ZodNumber;
17
17
  }, z.core.$strip>;
18
- export declare const RefreshSessionResponse: z.ZodObject<{}, z.core.$strip>;
19
- export declare const LogoutResponse: z.ZodObject<{}, z.core.$strip>;
20
- export declare const RegisterResponse: z.ZodObject<{
18
+ export declare const RefreshSessionResponse: z.ZodVoid;
19
+ export declare const LogoutResponse: z.ZodVoid;
20
+ export declare const RegisterEmailResponse: z.ZodVoid;
21
+ export declare const VerifyEmailResponse: z.ZodVoid;
22
+ export declare const ResendVerificationResponse: z.ZodVoid;
23
+ export declare const LinkEmailResponse: z.ZodVoid;
24
+ export declare const LinkWalletResponse: z.ZodObject<{
21
25
  user: z.ZodObject<{
22
26
  id: z.ZodUUID;
23
27
  role: z.ZodEnum<{
24
28
  basic: "basic";
25
29
  pro: "pro";
26
30
  }>;
27
- address: z.ZodOptional<z.ZodString>;
28
- }, z.core.$strip>;
29
- }, z.core.$strip>;
30
- export declare const LinkResponse: z.ZodObject<{
31
- user: z.ZodObject<{
32
- id: z.ZodUUID;
33
- role: z.ZodEnum<{
34
- basic: "basic";
35
- pro: "pro";
36
- }>;
37
- address: z.ZodOptional<z.ZodString>;
31
+ address: z.ZodNullable<z.ZodString>;
38
32
  }, z.core.$strip>;
39
33
  }, z.core.$strip>;
40
34
  export declare const RequestNonceResponse: z.ZodObject<{
@@ -47,13 +41,16 @@ export declare const MeResponse: z.ZodObject<{
47
41
  basic: "basic";
48
42
  pro: "pro";
49
43
  }>;
50
- address: z.ZodOptional<z.ZodString>;
44
+ address: z.ZodNullable<z.ZodString>;
51
45
  }, z.core.$strip>;
52
46
  export type RequestNonceResponse = z.infer<typeof RequestNonceResponse>;
53
47
  export type LoginResponse = z.infer<typeof LoginResponse>;
54
48
  export type RefreshSessionResponse = z.infer<typeof RefreshSessionResponse>;
55
49
  export type RefreshTokenResponse = z.infer<typeof RefreshTokenResponse>;
56
50
  export type LogoutResponse = z.infer<typeof LogoutResponse>;
57
- export type RegisterResponse = z.infer<typeof RegisterResponse>;
58
- export type LinkResponse = z.infer<typeof LinkResponse>;
51
+ export type RegisterEmailResponse = z.infer<typeof RegisterEmailResponse>;
52
+ export type LinkEmailResponse = z.infer<typeof LinkEmailResponse>;
53
+ export type LinkWalletResponse = z.infer<typeof LinkWalletResponse>;
59
54
  export type MeResponse = z.infer<typeof MeResponse>;
55
+ export type ResendVerificationResponse = z.infer<typeof ResendVerificationResponse>;
56
+ export type VerifyEmailResponse = z.infer<typeof VerifyEmailResponse>;
@@ -8,14 +8,17 @@ const RefreshTokenResponse = z.object({
8
8
  tokenType: z.literal("Bearer").describe('Token type (always "Bearer")'),
9
9
  expiresIn: z.number().int().positive().describe("Access token expiry time in seconds")
10
10
  }).describe("Successful token refresh response");
11
- const RefreshSessionResponse = z.object({}).describe("Successful session refresh response");
12
- const LogoutResponse = z.object({}).describe("Successful logout response");
13
- const RegisterResponse = LoginResponse.describe("Successful registration response");
14
- const LinkResponse = LoginResponse.describe("Successful link response");
11
+ const RefreshSessionResponse = z.void().describe("Successful session refresh response");
12
+ const LogoutResponse = z.void().describe("Successful logout response");
13
+ const RegisterEmailResponse = z.void().describe("Successful email registration response");
14
+ const VerifyEmailResponse = z.void().describe("Successful email verification response");
15
+ const ResendVerificationResponse = z.void().describe("Successful resend verification email response");
16
+ const LinkEmailResponse = z.void().describe("Successful email verification response");
17
+ const LinkWalletResponse = z.object({ user: AuthenticatedUser }).describe("Successful link response");
15
18
  const RequestNonceResponse = z.object({
16
19
  nonce: z.string().describe("Nonce to sign with wallet"),
17
20
  expiresAt: z.number().int().positive().describe("Unix timestamp when nonce expires")
18
21
  }).describe("Nonce response for wallet authentication");
19
22
  const MeResponse = AuthenticatedUser.describe("Current authenticated user info");
20
23
 
21
- export { LinkResponse, LoginResponse, LogoutResponse, MeResponse, RefreshSessionResponse, RefreshTokenResponse, RegisterResponse, RequestNonceResponse };
24
+ export { LinkEmailResponse, LinkWalletResponse, LoginResponse, LogoutResponse, MeResponse, RefreshSessionResponse, RefreshTokenResponse, RegisterEmailResponse, RequestNonceResponse, ResendVerificationResponse, VerifyEmailResponse };
@@ -20,8 +20,9 @@ export declare const TradeAccount: z.ZodObject<{
20
20
  agentWalletAddress: z.ZodString;
21
21
  isSubaccount: z.ZodBoolean;
22
22
  }, z.core.$strip>]>>;
23
- createdAt: z.ZodString;
24
- updatedAt: z.ZodString;
23
+ createdAt: z.ZodISODate;
24
+ updatedAt: z.ZodISODate;
25
+ deletedAt: z.ZodOptional<z.ZodISODate>;
25
26
  }, z.core.$strip>;
26
27
  export type TradeAccount = z.infer<typeof TradeAccount>;
27
28
  export type HyperliquidMetadata = z.infer<typeof HyperliquidMetadata>;
@@ -12,8 +12,9 @@ const TradeAccount = z.object({
12
12
  connector: Connector.describe("Exchange connector type"),
13
13
  exchangeIdentifier: z.string().describe("User identifier on the exchange"),
14
14
  metadata: ConnectorMetadata.describe("Connector-specific metadata"),
15
- createdAt: z.string().describe("Creation timestamp (ISO 8601)"),
16
- updatedAt: z.string().describe("Last update timestamp (ISO 8601)")
15
+ createdAt: z.iso.date().describe("Creation timestamp (ISO 8601)"),
16
+ updatedAt: z.iso.date().describe("Last update timestamp (ISO 8601)"),
17
+ deletedAt: z.iso.date().describe("Deletion timestamp (ISO 8601)").optional()
17
18
  });
18
19
 
19
20
  export { TradeAccount };
@@ -14,8 +14,9 @@ export declare const TradeAccountResponse: z.ZodObject<{
14
14
  agentWalletAddress: z.ZodString;
15
15
  isSubaccount: z.ZodBoolean;
16
16
  }, z.core.$strip>]>>;
17
- createdAt: z.ZodString;
18
- updatedAt: z.ZodString;
17
+ createdAt: z.ZodISODate;
18
+ updatedAt: z.ZodISODate;
19
+ deletedAt: z.ZodOptional<z.ZodISODate>;
19
20
  }, z.core.$strip>;
20
21
  }, z.core.$strip>;
21
22
  export type TradeAccountResponse = z.infer<typeof TradeAccountResponse>;
@@ -34,8 +35,9 @@ export declare const TradeAccountListResponse: z.ZodObject<{
34
35
  agentWalletAddress: z.ZodString;
35
36
  isSubaccount: z.ZodBoolean;
36
37
  }, z.core.$strip>]>>;
37
- createdAt: z.ZodString;
38
- updatedAt: z.ZodString;
38
+ createdAt: z.ZodISODate;
39
+ updatedAt: z.ZodISODate;
40
+ deletedAt: z.ZodOptional<z.ZodISODate>;
39
41
  }, z.core.$strip>>;
40
42
  }, z.core.$strip>;
41
43
  export type TradeAccountListResponse = z.infer<typeof TradeAccountListResponse>;
@@ -9,8 +9,9 @@ export declare const UserProfile: z.ZodObject<{
9
9
  basic: "basic";
10
10
  pro: "pro";
11
11
  }>;
12
- address: z.ZodOptional<z.ZodString>;
13
- email: z.ZodOptional<z.ZodString>;
12
+ address: z.ZodNullable<z.ZodString>;
13
+ email: z.ZodNullable<z.ZodString>;
14
+ emailVerified: z.ZodBoolean;
14
15
  }, z.core.$strip>;
15
16
  export type UserPreferences = z.infer<typeof UserPreferences>;
16
17
  export type UserProfile = z.infer<typeof UserProfile>;
@@ -7,8 +7,9 @@ const UserProfile = z.object({
7
7
  id: z.uuid().describe("User UUID"),
8
8
  displayName: z.string().describe("Public display name"),
9
9
  role: z.enum(["basic", "pro"]).describe("User role"),
10
- address: z.string().optional().describe("Linked wallet address (for evm_wallet provider)"),
11
- email: z.string().optional().describe("Linked email address (for email provider)")
10
+ address: z.string().nullable().describe("Linked wallet address (for evm_wallet provider)"),
11
+ email: z.string().nullable().describe("Linked email address (for email provider)"),
12
+ emailVerified: z.boolean().describe("Whether the email is verified")
12
13
  }).describe("User profile of the authenticated user");
13
14
 
14
15
  export { UserPreferences, UserProfile };
@@ -7,8 +7,9 @@ export declare const ProfileResponse: z.ZodObject<{
7
7
  basic: "basic";
8
8
  pro: "pro";
9
9
  }>;
10
- address: z.ZodOptional<z.ZodString>;
11
- email: z.ZodOptional<z.ZodString>;
10
+ address: z.ZodNullable<z.ZodString>;
11
+ email: z.ZodNullable<z.ZodString>;
12
+ emailVerified: z.ZodBoolean;
12
13
  }, z.core.$strip>;
13
14
  preferences: z.ZodObject<{
14
15
  slippageToleranceBps: z.ZodInt;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/types",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Pear Protocol Types definitions",
5
5
  "private": false,
6
6
  "type": "module",