@pear-protocol/types 0.0.3 → 0.0.5
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/auth/entities.d.ts +1 -1
- package/dist/auth/entities.js +1 -1
- package/dist/auth/payloads.d.ts +9 -1
- package/dist/auth/payloads.js +10 -4
- package/dist/auth/response.d.ts +15 -18
- package/dist/auth/response.js +8 -5
- package/dist/trade-accounts/entities.d.ts +1 -0
- package/dist/trade-accounts/entities.js +2 -1
- package/dist/trade-accounts/response.d.ts +2 -0
- package/dist/users/entities.d.ts +3 -2
- package/dist/users/entities.js +3 -2
- package/dist/users/response.d.ts +3 -2
- package/package.json +1 -1
package/dist/auth/entities.d.ts
CHANGED
package/dist/auth/entities.js
CHANGED
|
@@ -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().
|
|
6
|
+
address: z.string().nullable().describe("User address")
|
|
7
7
|
}).describe("Current authenticated user info");
|
|
8
8
|
|
|
9
9
|
export { AuthenticatedUser };
|
package/dist/auth/payloads.d.ts
CHANGED
|
@@ -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>;
|
package/dist/auth/payloads.js
CHANGED
|
@@ -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
|
-
|
|
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 };
|
package/dist/auth/response.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export declare const LoginResponse: z.ZodObject<{
|
|
|
6
6
|
basic: "basic";
|
|
7
7
|
pro: "pro";
|
|
8
8
|
}>;
|
|
9
|
-
address: z.
|
|
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.
|
|
19
|
-
export declare const LogoutResponse: z.
|
|
20
|
-
export declare const
|
|
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.
|
|
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.
|
|
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
|
|
58
|
-
export type
|
|
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>;
|
package/dist/auth/response.js
CHANGED
|
@@ -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.
|
|
12
|
-
const LogoutResponse = z.
|
|
13
|
-
const
|
|
14
|
-
const
|
|
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 {
|
|
24
|
+
export { LinkEmailResponse, LinkWalletResponse, LoginResponse, LogoutResponse, MeResponse, RefreshSessionResponse, RefreshTokenResponse, RegisterEmailResponse, RequestNonceResponse, ResendVerificationResponse, VerifyEmailResponse };
|
|
@@ -22,6 +22,7 @@ export declare const TradeAccount: z.ZodObject<{
|
|
|
22
22
|
}, z.core.$strip>]>>;
|
|
23
23
|
createdAt: z.ZodString;
|
|
24
24
|
updatedAt: z.ZodString;
|
|
25
|
+
deletedAt: z.ZodOptional<z.ZodString>;
|
|
25
26
|
}, z.core.$strip>;
|
|
26
27
|
export type TradeAccount = z.infer<typeof TradeAccount>;
|
|
27
28
|
export type HyperliquidMetadata = z.infer<typeof HyperliquidMetadata>;
|
|
@@ -13,7 +13,8 @@ const TradeAccount = z.object({
|
|
|
13
13
|
exchangeIdentifier: z.string().describe("User identifier on the exchange"),
|
|
14
14
|
metadata: ConnectorMetadata.describe("Connector-specific metadata"),
|
|
15
15
|
createdAt: z.string().describe("Creation timestamp (ISO 8601)"),
|
|
16
|
-
updatedAt: z.string().describe("Last update timestamp (ISO 8601)")
|
|
16
|
+
updatedAt: z.string().describe("Last update timestamp (ISO 8601)"),
|
|
17
|
+
deletedAt: z.string().describe("Deletion timestamp (ISO 8601)").optional()
|
|
17
18
|
});
|
|
18
19
|
|
|
19
20
|
export { TradeAccount };
|
|
@@ -16,6 +16,7 @@ export declare const TradeAccountResponse: z.ZodObject<{
|
|
|
16
16
|
}, z.core.$strip>]>>;
|
|
17
17
|
createdAt: z.ZodString;
|
|
18
18
|
updatedAt: z.ZodString;
|
|
19
|
+
deletedAt: z.ZodOptional<z.ZodString>;
|
|
19
20
|
}, z.core.$strip>;
|
|
20
21
|
}, z.core.$strip>;
|
|
21
22
|
export type TradeAccountResponse = z.infer<typeof TradeAccountResponse>;
|
|
@@ -36,6 +37,7 @@ export declare const TradeAccountListResponse: z.ZodObject<{
|
|
|
36
37
|
}, z.core.$strip>]>>;
|
|
37
38
|
createdAt: z.ZodString;
|
|
38
39
|
updatedAt: z.ZodString;
|
|
40
|
+
deletedAt: z.ZodOptional<z.ZodString>;
|
|
39
41
|
}, z.core.$strip>>;
|
|
40
42
|
}, z.core.$strip>;
|
|
41
43
|
export type TradeAccountListResponse = z.infer<typeof TradeAccountListResponse>;
|
package/dist/users/entities.d.ts
CHANGED
|
@@ -9,8 +9,9 @@ export declare const UserProfile: z.ZodObject<{
|
|
|
9
9
|
basic: "basic";
|
|
10
10
|
pro: "pro";
|
|
11
11
|
}>;
|
|
12
|
-
address: z.
|
|
13
|
-
email: z.
|
|
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>;
|
package/dist/users/entities.js
CHANGED
|
@@ -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().
|
|
11
|
-
email: z.string().
|
|
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 };
|
package/dist/users/response.d.ts
CHANGED
|
@@ -7,8 +7,9 @@ export declare const ProfileResponse: z.ZodObject<{
|
|
|
7
7
|
basic: "basic";
|
|
8
8
|
pro: "pro";
|
|
9
9
|
}>;
|
|
10
|
-
address: z.
|
|
11
|
-
email: z.
|
|
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;
|