@pear-protocol/types 0.0.11 → 0.0.13

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,7 @@ export declare const RequestNonceRequest: z.ZodObject<{
5
5
  export declare const EmailRegisterRequest: z.ZodObject<{
6
6
  email: z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>;
7
7
  password: z.ZodString;
8
+ accessCode: z.ZodOptional<z.ZodString>;
8
9
  }, z.core.$strip>;
9
10
  export declare const LinkEmailRequest: z.ZodObject<{
10
11
  email: z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>;
@@ -17,6 +18,7 @@ export declare const WalletLoginRequest: z.ZodObject<{
17
18
  method: z.ZodLiteral<"wallet">;
18
19
  address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
19
20
  signature: z.ZodString;
21
+ accessCode: z.ZodOptional<z.ZodString>;
20
22
  }, z.core.$strip>;
21
23
  export declare const EmailLoginRequest: z.ZodObject<{
22
24
  method: z.ZodLiteral<"email">;
@@ -42,6 +44,7 @@ export declare const LoginRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
42
44
  method: z.ZodLiteral<"wallet">;
43
45
  address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
44
46
  signature: z.ZodString;
47
+ accessCode: z.ZodOptional<z.ZodString>;
45
48
  }, z.core.$strip>, z.ZodObject<{
46
49
  method: z.ZodLiteral<"email">;
47
50
  email: z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>;
@@ -3,12 +3,14 @@ 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 AccessCode = z.string().trim().max(64).optional().describe("Optional beta access code");
6
7
  const RequestNonceRequest = z.object({
7
8
  address: EthereumAddress
8
9
  }).describe("Request a nonce for wallet authentication");
9
10
  const EmailRegisterRequest = z.object({
10
11
  email: Email,
11
- password: Password
12
+ password: Password,
13
+ accessCode: AccessCode
12
14
  }).describe("Email registration request");
13
15
  const LinkEmailRequest = z.object({
14
16
  email: Email
@@ -20,7 +22,8 @@ const LinkWalletRequest = z.object({
20
22
  const WalletLoginRequest = z.object({
21
23
  method: z.literal("wallet").describe('Must be "wallet" for wallet authentication'),
22
24
  address: EthereumAddress,
23
- signature: z.string().min(1, "Signature is required").describe("Signature of the nonce message")
25
+ signature: z.string().min(1, "Signature is required").describe("Signature of the nonce message"),
26
+ accessCode: AccessCode
24
27
  }).describe("Wallet-based authentication using nonce signature");
25
28
  const EmailLoginRequest = z.object({
26
29
  method: z.literal("email").describe('Must be "email" for email authentication'),
package/dist/bundle.d.ts CHANGED
@@ -12,6 +12,7 @@ export * from './order';
12
12
  export * from './position';
13
13
  export * from './price';
14
14
  export * from './schedule';
15
+ export * from './statistics';
15
16
  export * from './trade';
16
17
  export * from './trade-accounts';
17
18
  export * from './trigger';
package/dist/bundle.js CHANGED
@@ -12,6 +12,7 @@ export * from './order';
12
12
  export * from './position';
13
13
  export * from './price';
14
14
  export * from './schedule';
15
+ export * from './statistics';
15
16
  export * from './trade';
16
17
  export * from './trade-accounts';
17
18
  export * from './trigger';
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ export declare const DailyStatistics: z.ZodObject<{
3
+ date: z.ZodString;
4
+ volume: z.ZodNumber;
5
+ fees: z.ZodNumber;
6
+ users: z.ZodNumber;
7
+ newUsers: z.ZodNumber;
8
+ }, z.core.$strip>;
9
+ export type DailyStatistics = z.output<typeof DailyStatistics>;
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+
3
+ const DailyStatistics = z.object({
4
+ date: z.string(),
5
+ volume: z.number(),
6
+ fees: z.number(),
7
+ users: z.number(),
8
+ newUsers: z.number()
9
+ });
10
+
11
+ export { DailyStatistics };
@@ -0,0 +1,3 @@
1
+ export * from './entities';
2
+ export * from './queries';
3
+ export * from './responses';
@@ -0,0 +1,3 @@
1
+ export * from './entities';
2
+ export * from './queries';
3
+ export * from './responses';
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export declare const DailyStatisticsQueryParams: z.ZodObject<{
3
+ connector: z.ZodEnum<{
4
+ hyperliquid: "hyperliquid";
5
+ binance: "binance";
6
+ bybit: "bybit";
7
+ okx: "okx";
8
+ }>;
9
+ startDate: z.ZodOptional<z.ZodCoercedDate<Date>>;
10
+ endDate: z.ZodDefault<z.ZodCoercedDate<Date>>;
11
+ }, z.core.$strip>;
12
+ export type DailyStatisticsQueryParamsInput = z.input<typeof DailyStatisticsQueryParams>;
13
+ export type DailyStatisticsQueryParams = z.output<typeof DailyStatisticsQueryParams>;
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ import { Connector } from '../connector';
3
+
4
+ const DailyStatisticsQueryParams = z.object({
5
+ connector: Connector,
6
+ startDate: z.coerce.date().optional(),
7
+ endDate: z.coerce.date().default(() => /* @__PURE__ */ new Date())
8
+ }).refine((data) => !data.startDate || data.startDate < data.endDate, {
9
+ message: "startDate must be before endDate"
10
+ });
11
+
12
+ export { DailyStatisticsQueryParams };
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ export declare const DailyStatisticsResponse: z.ZodObject<{
3
+ data: z.ZodArray<z.ZodObject<{
4
+ date: z.ZodString;
5
+ volume: z.ZodNumber;
6
+ fees: z.ZodNumber;
7
+ users: z.ZodNumber;
8
+ newUsers: z.ZodNumber;
9
+ }, z.core.$strip>>;
10
+ }, z.core.$strip>;
11
+ export type DailyStatisticsResponse = z.output<typeof DailyStatisticsResponse>;
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ import { DailyStatistics } from './entities';
3
+
4
+ const DailyStatisticsResponse = z.object({
5
+ data: z.array(DailyStatistics)
6
+ });
7
+
8
+ export { DailyStatisticsResponse };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/types",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "Pear Protocol Types definitions",
5
5
  "private": false,
6
6
  "type": "module",