@pear-protocol/types 1.18.0 → 1.19.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.
@@ -15,3 +15,9 @@ export declare const UserProfile: z.ZodObject<{
15
15
  }, z.core.$strip>;
16
16
  export type UserPreferences = z.infer<typeof UserPreferences>;
17
17
  export type UserProfile = z.infer<typeof UserProfile>;
18
+ export declare const ReferralReferee: z.ZodObject<{
19
+ address: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
20
+ referredAt: z.ZodOptional<z.ZodNumber>;
21
+ tradeCount: z.ZodNumber;
22
+ }, z.core.$strip>;
23
+ export type ReferralReferee = z.infer<typeof ReferralReferee>;
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { EthereumAddress } from '../common/address';
2
3
 
3
4
  const UserPreferences = z.object({
4
5
  slippageToleranceBps: z.int().describe("User slippage preference in basis points")
@@ -11,5 +12,10 @@ const UserProfile = z.object({
11
12
  email: z.string().nullable().describe("Linked email address (for email provider)"),
12
13
  emailVerified: z.boolean().describe("Whether the email is verified")
13
14
  }).describe("User profile of the authenticated user");
15
+ const ReferralReferee = z.object({
16
+ address: EthereumAddress.optional().describe("Linked EVM wallet address when the referee has one"),
17
+ referredAt: z.number().int().nonnegative().optional().describe("V3 attribution time in epoch milliseconds; not the original legacy on-chain referral time"),
18
+ tradeCount: z.number().int().nonnegative().describe("Distinct Pear executions with at least one real confirmed fill")
19
+ });
14
20
 
15
- export { UserPreferences, UserProfile };
21
+ export { ReferralReferee, UserPreferences, UserProfile };
@@ -1,3 +1,4 @@
1
1
  export * from './entities';
2
2
  export * from './payloads';
3
+ export * from './queries';
3
4
  export * from './response';
@@ -1,3 +1,4 @@
1
1
  export * from './entities';
2
2
  export * from './payloads';
3
+ export * from './queries';
3
4
  export * from './response';
@@ -0,0 +1,8 @@
1
+ /** Query contracts for authenticated referral history. */
2
+ import { z } from 'zod';
3
+ export declare const ReferralRefereeListParams: z.ZodObject<{
4
+ cursor: z.ZodOptional<z.ZodString>;
5
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<number>>>;
6
+ }, z.core.$strip>;
7
+ export type ReferralRefereeListParamsInput = z.input<typeof ReferralRefereeListParams>;
8
+ export type ReferralRefereeListParams = z.output<typeof ReferralRefereeListParams>;
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ import { CursorFindParams } from '../common/request';
3
+
4
+ const ReferralRefereeListParams = CursorFindParams.extend({
5
+ limit: z.coerce.number().int().positive().max(100).optional().default(20)
6
+ });
7
+
8
+ export { ReferralRefereeListParams };
@@ -28,6 +28,17 @@ export declare const UpdateUserDisplayNameResponse: z.ZodObject<{
28
28
  export type UpdateUserDisplayNameResponse = z.infer<typeof UpdateUserDisplayNameResponse>;
29
29
  export declare const ReferralStatusResponse: z.ZodObject<{
30
30
  ownedCodes: z.ZodArray<z.ZodString>;
31
- referrerUserId: z.ZodOptional<z.ZodUUID>;
31
+ referrerCode: z.ZodOptional<z.ZodString>;
32
32
  }, z.core.$strip>;
33
33
  export type ReferralStatusResponse = z.infer<typeof ReferralStatusResponse>;
34
+ export declare const ReferralRefereeListResponse: z.ZodObject<{
35
+ limit: z.ZodNumber;
36
+ nextCursor: z.ZodOptional<z.ZodString>;
37
+ count: z.ZodNumber;
38
+ referees: z.ZodArray<z.ZodObject<{
39
+ address: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
40
+ referredAt: z.ZodOptional<z.ZodNumber>;
41
+ tradeCount: z.ZodNumber;
42
+ }, z.core.$strip>>;
43
+ }, z.core.$strip>;
44
+ export type ReferralRefereeListResponse = z.infer<typeof ReferralRefereeListResponse>;
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { UserPreferences, UserProfile } from './entities';
2
+ import { CursorResponse } from '../common/response';
3
+ import { UserPreferences, UserProfile, ReferralReferee } from './entities';
3
4
 
4
5
  const ProfileResponse = z.object({
5
6
  profile: UserProfile,
@@ -13,7 +14,11 @@ const UpdateUserDisplayNameResponse = z.object({
13
14
  });
14
15
  const ReferralStatusResponse = z.object({
15
16
  ownedCodes: z.array(z.string()).describe("Exact case-sensitive referral codes owned by the authenticated user"),
16
- referrerUserId: z.uuid().optional().describe("User that permanently referred the authenticated user")
17
+ referrerCode: z.string().optional().describe("Exact case-sensitive code owned by the permanent referrer")
18
+ });
19
+ const ReferralRefereeListResponse = CursorResponse.extend({
20
+ count: z.number().int().nonnegative().describe("Total V3 users permanently bound to the authenticated referrer"),
21
+ referees: z.array(ReferralReferee)
17
22
  });
18
23
 
19
- export { ProfileResponse, ReferralStatusResponse, UpdateUserDisplayNameResponse, UpdateUserPreferencesResponse };
24
+ export { ProfileResponse, ReferralRefereeListResponse, ReferralStatusResponse, UpdateUserDisplayNameResponse, UpdateUserPreferencesResponse };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/types",
3
- "version": "1.18.0",
3
+ "version": "1.19.0",
4
4
  "description": "Pear Protocol Types definitions",
5
5
  "private": false,
6
6
  "type": "module",