@pear-protocol/types 0.0.20 → 0.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 (50) hide show
  1. package/dist/admin/client-ids/entities.d.ts +11 -0
  2. package/dist/admin/client-ids/entities.js +13 -0
  3. package/dist/admin/client-ids/index.d.ts +4 -0
  4. package/dist/admin/client-ids/index.js +4 -0
  5. package/dist/admin/client-ids/payloads.d.ts +14 -0
  6. package/dist/admin/client-ids/payloads.js +13 -0
  7. package/dist/admin/client-ids/queries.d.ts +10 -0
  8. package/dist/admin/client-ids/queries.js +7 -0
  9. package/dist/admin/client-ids/responses.d.ts +11 -0
  10. package/dist/admin/client-ids/responses.js +6 -0
  11. package/dist/auth/entities.d.ts +1 -0
  12. package/dist/auth/entities.js +1 -1
  13. package/dist/auth/payloads.d.ts +4 -0
  14. package/dist/auth/payloads.js +5 -2
  15. package/dist/auth/response.d.ts +2 -0
  16. package/dist/bundle.d.ts +4 -0
  17. package/dist/bundle.js +4 -0
  18. package/dist/instrument/entities.d.ts +25 -0
  19. package/dist/instrument/entities.js +12 -2
  20. package/dist/instrument/queries.d.ts +14 -0
  21. package/dist/instrument/queries.js +4 -2
  22. package/dist/instrument/responses.d.ts +8 -0
  23. package/dist/market/entities.d.ts +66 -0
  24. package/dist/market/entities.js +42 -0
  25. package/dist/market/index.d.ts +3 -0
  26. package/dist/market/index.js +3 -0
  27. package/dist/market/queries.d.ts +38 -0
  28. package/dist/market/queries.js +19 -0
  29. package/dist/market/responses.d.ts +72 -0
  30. package/dist/market/responses.js +15 -0
  31. package/dist/portfolio/entities.d.ts +199 -0
  32. package/dist/portfolio/entities.js +100 -0
  33. package/dist/portfolio/index.d.ts +3 -0
  34. package/dist/portfolio/index.js +3 -0
  35. package/dist/portfolio/queries.d.ts +46 -0
  36. package/dist/portfolio/queries.js +20 -0
  37. package/dist/portfolio/responses.d.ts +172 -0
  38. package/dist/portfolio/responses.js +16 -0
  39. package/dist/tca/entities.d.ts +8 -0
  40. package/dist/tca/entities.js +6 -0
  41. package/dist/tca/index.d.ts +3 -0
  42. package/dist/tca/index.js +3 -0
  43. package/dist/tca/queries.d.ts +15 -0
  44. package/dist/tca/queries.js +14 -0
  45. package/dist/tca/responses.d.ts +353 -0
  46. package/dist/tca/responses.js +105 -0
  47. package/dist/users/entities.d.ts +1 -0
  48. package/dist/users/entities.js +1 -1
  49. package/dist/users/response.d.ts +1 -0
  50. package/package.json +1 -1
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ export declare const ClientIdEntity: z.ZodObject<{
3
+ id: z.ZodUUID;
4
+ code: z.ZodString;
5
+ label: z.ZodString;
6
+ description: z.ZodOptional<z.ZodString>;
7
+ isActive: z.ZodBoolean;
8
+ createdAt: z.ZodString;
9
+ updatedAt: z.ZodString;
10
+ }, z.core.$strip>;
11
+ export type ClientIdEntity = z.output<typeof ClientIdEntity>;
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+
3
+ const ClientIdEntity = z.object({
4
+ id: z.uuid(),
5
+ code: z.string(),
6
+ label: z.string(),
7
+ description: z.string().optional(),
8
+ isActive: z.boolean(),
9
+ createdAt: z.string(),
10
+ updatedAt: z.string()
11
+ }).describe("Client ID registry entry");
12
+
13
+ export { ClientIdEntity };
@@ -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,14 @@
1
+ import { z } from 'zod';
2
+ export declare const CreateClientIdPayload: z.ZodObject<{
3
+ code: z.ZodString;
4
+ label: z.ZodString;
5
+ description: z.ZodOptional<z.ZodString>;
6
+ }, z.core.$strip>;
7
+ export type CreateClientIdPayloadInput = z.input<typeof CreateClientIdPayload>;
8
+ export type CreateClientIdPayload = z.output<typeof CreateClientIdPayload>;
9
+ export declare const UpdateClientIdPayload: z.ZodObject<{
10
+ label: z.ZodOptional<z.ZodString>;
11
+ description: z.ZodOptional<z.ZodString>;
12
+ }, z.core.$strip>;
13
+ export type UpdateClientIdPayloadInput = z.input<typeof UpdateClientIdPayload>;
14
+ export type UpdateClientIdPayload = z.output<typeof UpdateClientIdPayload>;
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+
3
+ const CreateClientIdPayload = z.object({
4
+ code: z.string().min(1).max(64).describe("Stable, immutable attribution key"),
5
+ label: z.string().min(1).max(128),
6
+ description: z.string().max(256).optional()
7
+ }).describe("Payload to create a client ID");
8
+ const UpdateClientIdPayload = z.object({
9
+ label: z.string().min(1).max(128).optional(),
10
+ description: z.string().max(256).optional()
11
+ }).describe("Payload to update a client ID label/description");
12
+
13
+ export { CreateClientIdPayload, UpdateClientIdPayload };
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ export declare const ListClientIdsParams: z.ZodObject<{
3
+ scope: z.ZodDefault<z.ZodEnum<{
4
+ active: "active";
5
+ inactive: "inactive";
6
+ all: "all";
7
+ }>>;
8
+ }, z.core.$strip>;
9
+ export type ListClientIdsParamsInput = z.input<typeof ListClientIdsParams>;
10
+ export type ListClientIdsParams = z.output<typeof ListClientIdsParams>;
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+
3
+ const ListClientIdsParams = z.object({
4
+ scope: z.enum(["active", "inactive", "all"]).default("all")
5
+ });
6
+
7
+ export { ListClientIdsParams };
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ export declare const ListClientIdsResponse: z.ZodArray<z.ZodObject<{
3
+ id: z.ZodUUID;
4
+ code: z.ZodString;
5
+ label: z.ZodString;
6
+ description: z.ZodOptional<z.ZodString>;
7
+ isActive: z.ZodBoolean;
8
+ createdAt: z.ZodString;
9
+ updatedAt: z.ZodString;
10
+ }, z.core.$strip>>;
11
+ export type ListClientIdsResponse = z.output<typeof ListClientIdsResponse>;
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ import { ClientIdEntity } from './entities';
3
+
4
+ const ListClientIdsResponse = z.array(ClientIdEntity);
5
+
6
+ export { ListClientIdsResponse };
@@ -8,6 +8,7 @@ export declare const AuthenticatedUser: z.ZodObject<{
8
8
  role: z.ZodEnum<{
9
9
  basic: "basic";
10
10
  pro: "pro";
11
+ admin: "admin";
11
12
  }>;
12
13
  providerId: z.ZodNullable<z.ZodString>;
13
14
  loginMethod: z.ZodEnum<{
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  const LoginMethod = z.enum(["email", "evm_wallet"]).describe("Authentication provider used for the current session");
4
4
  const AuthenticatedUser = z.object({
5
5
  id: z.uuid().describe("User UUID"),
6
- role: z.enum(["basic", "pro"]).describe("User role"),
6
+ role: z.enum(["basic", "pro", "admin"]).describe("User role"),
7
7
  providerId: z.string().nullable().describe("Provider identifier (wallet address or email)"),
8
8
  loginMethod: LoginMethod.describe("Authentication provider used for the current session")
9
9
  }).describe("Current authenticated user info");
@@ -19,11 +19,13 @@ 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;
22
23
  }, z.core.$strip>;
23
24
  export declare const EmailLoginRequest: z.ZodObject<{
24
25
  method: z.ZodLiteral<"email">;
25
26
  email: z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>;
26
27
  password: z.ZodString;
28
+ clientId: z.ZodString;
27
29
  }, z.core.$strip>;
28
30
  export declare const VerifyEmailRequest: z.ZodObject<{
29
31
  token: z.ZodString;
@@ -45,10 +47,12 @@ export declare const LoginRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
45
47
  address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
46
48
  signature: z.ZodString;
47
49
  accessCode: z.ZodOptional<z.ZodString>;
50
+ clientId: z.ZodString;
48
51
  }, z.core.$strip>, z.ZodObject<{
49
52
  method: z.ZodLiteral<"email">;
50
53
  email: z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>;
51
54
  password: z.ZodString;
55
+ clientId: z.ZodString;
52
56
  }, z.core.$strip>], "method">;
53
57
  export declare const RefreshTokenRequest: z.ZodObject<{
54
58
  refreshToken: z.ZodString;
@@ -3,6 +3,7 @@ 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)");
6
7
  const AccessCode = z.string().trim().max(64).optional().describe("Optional beta access code");
7
8
  const RequestNonceRequest = z.object({
8
9
  address: EthereumAddress
@@ -23,12 +24,14 @@ const WalletLoginRequest = z.object({
23
24
  method: z.literal("wallet").describe('Must be "wallet" for wallet authentication'),
24
25
  address: EthereumAddress,
25
26
  signature: z.string().min(1, "Signature is required").describe("Signature of the nonce message"),
26
- accessCode: AccessCode
27
+ accessCode: AccessCode,
28
+ clientId: ClientIdCode
27
29
  }).describe("Wallet-based authentication using nonce signature");
28
30
  const EmailLoginRequest = z.object({
29
31
  method: z.literal("email").describe('Must be "email" for email authentication'),
30
32
  email: Email,
31
- password: Password
33
+ password: Password,
34
+ clientId: ClientIdCode
32
35
  }).describe("Email-based authentication using email and password");
33
36
  const VerifyEmailRequest = z.object({
34
37
  token: z.string().min(1, "Token is required").describe("Verification token"),
@@ -7,6 +7,7 @@ export declare const LoginResponse: z.ZodObject<{
7
7
  role: z.ZodEnum<{
8
8
  basic: "basic";
9
9
  pro: "pro";
10
+ admin: "admin";
10
11
  }>;
11
12
  providerId: z.ZodNullable<z.ZodString>;
12
13
  loginMethod: z.ZodEnum<{
@@ -41,6 +42,7 @@ export declare const MeResponse: z.ZodObject<{
41
42
  role: z.ZodEnum<{
42
43
  basic: "basic";
43
44
  pro: "pro";
45
+ admin: "admin";
44
46
  }>;
45
47
  providerId: z.ZodNullable<z.ZodString>;
46
48
  loginMethod: z.ZodEnum<{
package/dist/bundle.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './admin/client-ids';
1
2
  export * from './auth';
2
3
  export * from './common/trade-legs';
3
4
  export * from './connector';
@@ -7,14 +8,17 @@ export * from './funding';
7
8
  export * from './instrument';
8
9
  export * from './instrument-precision';
9
10
  export * from './leverage';
11
+ export * from './market';
10
12
  export * from './misc';
11
13
  export * from './order';
14
+ export * from './portfolio';
12
15
  export * from './position';
13
16
  export * from './price';
14
17
  export * from './rebalance';
15
18
  export * from './schedule';
16
19
  export * from './statistics';
17
20
  export * from './sync';
21
+ export * from './tca';
18
22
  export * from './trade';
19
23
  export * from './trade-accounts';
20
24
  export * from './trigger';
package/dist/bundle.js CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './admin/client-ids';
1
2
  export * from './auth';
2
3
  export * from './common/trade-legs';
3
4
  export * from './connector';
@@ -7,14 +8,17 @@ export * from './funding';
7
8
  export * from './instrument';
8
9
  export * from './instrument-precision';
9
10
  export * from './leverage';
11
+ export * from './market';
10
12
  export * from './misc';
11
13
  export * from './order';
14
+ export * from './portfolio';
12
15
  export * from './position';
13
16
  export * from './price';
14
17
  export * from './rebalance';
15
18
  export * from './schedule';
16
19
  export * from './statistics';
17
20
  export * from './sync';
21
+ export * from './tca';
18
22
  export * from './trade';
19
23
  export * from './trade-accounts';
20
24
  export * from './trigger';
@@ -7,6 +7,23 @@ export declare const InstrumentType: z.ZodEnum<{
7
7
  hip3: "hip3";
8
8
  }>;
9
9
  export type InstrumentType = z.infer<typeof InstrumentType>;
10
+ export declare const InstrumentTradeabilityStatus: z.ZodEnum<{
11
+ tradable: "tradable";
12
+ reduce_only: "reduce_only";
13
+ not_tradable: "not_tradable";
14
+ }>;
15
+ export type InstrumentTradeabilityStatus = z.infer<typeof InstrumentTradeabilityStatus>;
16
+ export declare const InstrumentTradeabilityReason: z.ZodNullable<z.ZodString>;
17
+ export type InstrumentTradeabilityReason = z.infer<typeof InstrumentTradeabilityReason>;
18
+ export declare const InstrumentTradeability: z.ZodObject<{
19
+ status: z.ZodEnum<{
20
+ tradable: "tradable";
21
+ reduce_only: "reduce_only";
22
+ not_tradable: "not_tradable";
23
+ }>;
24
+ reason: z.ZodNullable<z.ZodString>;
25
+ }, z.core.$strip>;
26
+ export type InstrumentTradeability = z.output<typeof InstrumentTradeability>;
10
27
  export declare const Instrument: z.ZodObject<{
11
28
  id: z.ZodString;
12
29
  base: z.ZodString;
@@ -40,5 +57,13 @@ export declare const Instrument: z.ZodObject<{
40
57
  max: z.ZodNullable<z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<number | undefined, number>>>>;
41
58
  }, z.core.$strip>>;
42
59
  }, z.core.$strip>;
60
+ tradeability: z.ZodObject<{
61
+ status: z.ZodEnum<{
62
+ tradable: "tradable";
63
+ reduce_only: "reduce_only";
64
+ not_tradable: "not_tradable";
65
+ }>;
66
+ reason: z.ZodNullable<z.ZodString>;
67
+ }, z.core.$strip>;
43
68
  }, z.core.$strip>;
44
69
  export type Instrument = z.output<typeof Instrument>;
@@ -4,6 +4,12 @@ import { InstrumentPrecision } from '../instrument-precision';
4
4
 
5
5
  const InstrumentId = z.string().trim().min(1, "Instrument ID is required").max(64, "Instrument ID must be at most 64 characters").regex(/^[^\s][^\s]*$/, "Instrument ID contains invalid characters");
6
6
  const InstrumentType = z.enum(["spot", "perp", "hip3"]);
7
+ const InstrumentTradeabilityStatus = z.enum(["tradable", "reduce_only", "not_tradable"]);
8
+ const InstrumentTradeabilityReason = z.string().nullable();
9
+ const InstrumentTradeability = z.object({
10
+ status: InstrumentTradeabilityStatus,
11
+ reason: InstrumentTradeabilityReason
12
+ });
7
13
  const Instrument = z.object({
8
14
  /**
9
15
  * Exchange specific instrument identifier
@@ -42,7 +48,11 @@ const Instrument = z.object({
42
48
  /**
43
49
  * The precision of the instrument.
44
50
  */
45
- precision: InstrumentPrecision
51
+ precision: InstrumentPrecision,
52
+ /**
53
+ * Whether this instrument can be traded normally.
54
+ */
55
+ tradeability: InstrumentTradeability
46
56
  });
47
57
 
48
- export { Instrument, InstrumentId, InstrumentType };
58
+ export { Instrument, InstrumentId, InstrumentTradeability, InstrumentTradeabilityReason, InstrumentTradeabilityStatus, InstrumentType };
@@ -1,4 +1,11 @@
1
1
  import { z } from 'zod';
2
+ export declare const InstrumentScope: z.ZodEnum<{
3
+ all: "all";
4
+ tradable: "tradable";
5
+ reduce_only: "reduce_only";
6
+ not_tradable: "not_tradable";
7
+ }>;
8
+ export type InstrumentScope = z.infer<typeof InstrumentScope>;
2
9
  export declare const InstrumentListParams: z.ZodObject<{
3
10
  connector: z.ZodEnum<{
4
11
  hyperliquid: "hyperliquid";
@@ -7,5 +14,12 @@ export declare const InstrumentListParams: z.ZodObject<{
7
14
  okx: "okx";
8
15
  lighter: "lighter";
9
16
  }>;
17
+ scope: z.ZodDefault<z.ZodEnum<{
18
+ all: "all";
19
+ tradable: "tradable";
20
+ reduce_only: "reduce_only";
21
+ not_tradable: "not_tradable";
22
+ }>>;
10
23
  }, z.core.$strip>;
24
+ export type InstrumentListParamsInput = z.input<typeof InstrumentListParams>;
11
25
  export type InstrumentListParams = z.output<typeof InstrumentListParams>;
@@ -1,8 +1,10 @@
1
1
  import { z } from 'zod';
2
2
  import { Connector } from '../connector';
3
3
 
4
+ const InstrumentScope = z.enum(["tradable", "reduce_only", "not_tradable", "all"]);
4
5
  const InstrumentListParams = z.object({
5
- connector: Connector
6
+ connector: Connector,
7
+ scope: InstrumentScope.default("all")
6
8
  });
7
9
 
8
- export { InstrumentListParams };
10
+ export { InstrumentListParams, InstrumentScope };
@@ -33,6 +33,14 @@ export declare const InstrumentListResponse: z.ZodObject<{
33
33
  max: z.ZodNullable<z.ZodOptional<z.ZodPipe<z.ZodNumber, z.ZodTransform<number | undefined, number>>>>;
34
34
  }, z.core.$strip>>;
35
35
  }, z.core.$strip>;
36
+ tradeability: z.ZodObject<{
37
+ status: z.ZodEnum<{
38
+ tradable: "tradable";
39
+ reduce_only: "reduce_only";
40
+ not_tradable: "not_tradable";
41
+ }>;
42
+ reason: z.ZodNullable<z.ZodString>;
43
+ }, z.core.$strip>;
36
44
  }, z.core.$strip>>;
37
45
  }, z.core.$strip>;
38
46
  export type InstrumentListResponse = z.output<typeof InstrumentListResponse>;
@@ -0,0 +1,66 @@
1
+ import { z } from 'zod';
2
+ export declare const Market: z.ZodObject<{
3
+ connector: z.ZodEnum<{
4
+ hyperliquid: "hyperliquid";
5
+ binance: "binance";
6
+ bybit: "bybit";
7
+ okx: "okx";
8
+ lighter: "lighter";
9
+ }>;
10
+ instrumentId: z.ZodString;
11
+ displaySymbol: z.ZodString;
12
+ base: z.ZodString;
13
+ quote: z.ZodString;
14
+ price: z.ZodString;
15
+ volume24h: z.ZodString;
16
+ change24h: z.ZodString;
17
+ openInterest: z.ZodString;
18
+ fundingRate: z.ZodString;
19
+ tradeability: z.ZodObject<{
20
+ status: z.ZodEnum<{
21
+ tradable: "tradable";
22
+ reduce_only: "reduce_only";
23
+ not_tradable: "not_tradable";
24
+ }>;
25
+ reason: z.ZodNullable<z.ZodString>;
26
+ }, z.core.$strip>;
27
+ updatedAt: z.ZodNumber;
28
+ }, z.core.$strip>;
29
+ export type Market = z.output<typeof Market>;
30
+ export declare const BasketMarket: z.ZodObject<{
31
+ connector: z.ZodEnum<{
32
+ hyperliquid: "hyperliquid";
33
+ binance: "binance";
34
+ bybit: "bybit";
35
+ okx: "okx";
36
+ lighter: "lighter";
37
+ }>;
38
+ basketKey: z.ZodString;
39
+ displaySymbol: z.ZodString;
40
+ longInstrumentIds: z.ZodArray<z.ZodString>;
41
+ shortInstrumentIds: z.ZodArray<z.ZodString>;
42
+ price: z.ZodString;
43
+ priceChange24h: z.ZodString;
44
+ weightRatio: z.ZodString;
45
+ weightRatioChange24h: z.ZodString;
46
+ netFunding: z.ZodString;
47
+ volume24h: z.ZodString;
48
+ openInterest: z.ZodString;
49
+ tradeability: z.ZodObject<{
50
+ status: z.ZodEnum<{
51
+ tradable: "tradable";
52
+ reduce_only: "reduce_only";
53
+ not_tradable: "not_tradable";
54
+ }>;
55
+ reason: z.ZodNullable<z.ZodString>;
56
+ }, z.core.$strip>;
57
+ updatedAt: z.ZodNumber;
58
+ hasMaterializedStats: z.ZodBoolean;
59
+ }, z.core.$strip>;
60
+ export type BasketMarket = z.output<typeof BasketMarket>;
61
+ export declare const MarketTotals: z.ZodObject<{
62
+ markets: z.ZodNumber;
63
+ volume24h: z.ZodString;
64
+ openInterest: z.ZodString;
65
+ }, z.core.$strip>;
66
+ export type MarketTotals = z.output<typeof MarketTotals>;
@@ -0,0 +1,42 @@
1
+ import { z } from 'zod';
2
+ import { Connector } from '../connector';
3
+ import { InstrumentTradeability, InstrumentId } from '../instrument';
4
+
5
+ const Market = z.object({
6
+ connector: Connector,
7
+ instrumentId: InstrumentId,
8
+ displaySymbol: z.string(),
9
+ base: z.string(),
10
+ quote: z.string(),
11
+ price: z.string(),
12
+ volume24h: z.string(),
13
+ change24h: z.string(),
14
+ openInterest: z.string(),
15
+ fundingRate: z.string(),
16
+ tradeability: InstrumentTradeability,
17
+ updatedAt: z.number()
18
+ });
19
+ const BasketMarket = z.object({
20
+ connector: Connector,
21
+ basketKey: z.string(),
22
+ displaySymbol: z.string(),
23
+ longInstrumentIds: z.array(InstrumentId),
24
+ shortInstrumentIds: z.array(InstrumentId),
25
+ price: z.string(),
26
+ priceChange24h: z.string(),
27
+ weightRatio: z.string(),
28
+ weightRatioChange24h: z.string(),
29
+ netFunding: z.string(),
30
+ volume24h: z.string(),
31
+ openInterest: z.string(),
32
+ tradeability: InstrumentTradeability,
33
+ updatedAt: z.number(),
34
+ hasMaterializedStats: z.boolean()
35
+ });
36
+ const MarketTotals = z.object({
37
+ markets: z.number(),
38
+ volume24h: z.string(),
39
+ openInterest: z.string()
40
+ });
41
+
42
+ export { BasketMarket, Market, MarketTotals };
@@ -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,38 @@
1
+ import { z } from 'zod';
2
+ export declare const MarketsQueryParams: z.ZodObject<{
3
+ connector: z.ZodEnum<{
4
+ hyperliquid: "hyperliquid";
5
+ binance: "binance";
6
+ bybit: "bybit";
7
+ okx: "okx";
8
+ lighter: "lighter";
9
+ }>;
10
+ scope: z.ZodDefault<z.ZodEnum<{
11
+ all: "all";
12
+ tradable: "tradable";
13
+ reduce_only: "reduce_only";
14
+ not_tradable: "not_tradable";
15
+ }>>;
16
+ }, z.core.$strip>;
17
+ export type MarketsQueryParamsInput = z.input<typeof MarketsQueryParams>;
18
+ export type MarketsQueryParams = z.output<typeof MarketsQueryParams>;
19
+ export declare const MarketBasketsQueryParams: z.ZodObject<{
20
+ connector: z.ZodEnum<{
21
+ hyperliquid: "hyperliquid";
22
+ binance: "binance";
23
+ bybit: "bybit";
24
+ okx: "okx";
25
+ lighter: "lighter";
26
+ }>;
27
+ scope: z.ZodDefault<z.ZodEnum<{
28
+ all: "all";
29
+ tradable: "tradable";
30
+ reduce_only: "reduce_only";
31
+ not_tradable: "not_tradable";
32
+ }>>;
33
+ search: z.ZodOptional<z.ZodString>;
34
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
35
+ offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
36
+ }, z.core.$strip>;
37
+ export type MarketBasketsQueryParamsInput = z.input<typeof MarketBasketsQueryParams>;
38
+ export type MarketBasketsQueryParams = z.output<typeof MarketBasketsQueryParams>;
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { Connector } from '../connector';
3
+ import { InstrumentScope } from '../instrument';
4
+
5
+ const MarketsQueryParams = z.object({
6
+ connector: Connector,
7
+ // Markets are connector-scoped so the API can return one exchange's live view
8
+ // without mixing instruments that have different ids, liquidity, or stats feeds.
9
+ scope: InstrumentScope.default("tradable")
10
+ });
11
+ const MarketBasketsQueryParams = z.object({
12
+ connector: Connector,
13
+ scope: InstrumentScope.default("tradable"),
14
+ search: z.string().trim().max(128).optional(),
15
+ limit: z.coerce.number().int().min(1).max(1e3).default(500),
16
+ offset: z.coerce.number().int().min(0).default(0)
17
+ });
18
+
19
+ export { MarketBasketsQueryParams, MarketsQueryParams };
@@ -0,0 +1,72 @@
1
+ import { z } from 'zod';
2
+ export declare const MarketsResponse: z.ZodObject<{
3
+ markets: z.ZodArray<z.ZodObject<{
4
+ connector: z.ZodEnum<{
5
+ hyperliquid: "hyperliquid";
6
+ binance: "binance";
7
+ bybit: "bybit";
8
+ okx: "okx";
9
+ lighter: "lighter";
10
+ }>;
11
+ instrumentId: z.ZodString;
12
+ displaySymbol: z.ZodString;
13
+ base: z.ZodString;
14
+ quote: z.ZodString;
15
+ price: z.ZodString;
16
+ volume24h: z.ZodString;
17
+ change24h: z.ZodString;
18
+ openInterest: z.ZodString;
19
+ fundingRate: z.ZodString;
20
+ tradeability: z.ZodObject<{
21
+ status: z.ZodEnum<{
22
+ tradable: "tradable";
23
+ reduce_only: "reduce_only";
24
+ not_tradable: "not_tradable";
25
+ }>;
26
+ reason: z.ZodNullable<z.ZodString>;
27
+ }, z.core.$strip>;
28
+ updatedAt: z.ZodNumber;
29
+ }, z.core.$strip>>;
30
+ totals: z.ZodObject<{
31
+ markets: z.ZodNumber;
32
+ volume24h: z.ZodString;
33
+ openInterest: z.ZodString;
34
+ }, z.core.$strip>;
35
+ }, z.core.$strip>;
36
+ export type MarketsResponse = z.output<typeof MarketsResponse>;
37
+ export declare const MarketBasketsResponse: z.ZodObject<{
38
+ limit: z.ZodNumber;
39
+ offset: z.ZodNumber;
40
+ count: z.ZodNumber;
41
+ markets: z.ZodArray<z.ZodObject<{
42
+ connector: z.ZodEnum<{
43
+ hyperliquid: "hyperliquid";
44
+ binance: "binance";
45
+ bybit: "bybit";
46
+ okx: "okx";
47
+ lighter: "lighter";
48
+ }>;
49
+ basketKey: z.ZodString;
50
+ displaySymbol: z.ZodString;
51
+ longInstrumentIds: z.ZodArray<z.ZodString>;
52
+ shortInstrumentIds: z.ZodArray<z.ZodString>;
53
+ price: z.ZodString;
54
+ priceChange24h: z.ZodString;
55
+ weightRatio: z.ZodString;
56
+ weightRatioChange24h: z.ZodString;
57
+ netFunding: z.ZodString;
58
+ volume24h: z.ZodString;
59
+ openInterest: z.ZodString;
60
+ tradeability: z.ZodObject<{
61
+ status: z.ZodEnum<{
62
+ tradable: "tradable";
63
+ reduce_only: "reduce_only";
64
+ not_tradable: "not_tradable";
65
+ }>;
66
+ reason: z.ZodNullable<z.ZodString>;
67
+ }, z.core.$strip>;
68
+ updatedAt: z.ZodNumber;
69
+ hasMaterializedStats: z.ZodBoolean;
70
+ }, z.core.$strip>>;
71
+ }, z.core.$strip>;
72
+ export type MarketBasketsResponse = z.output<typeof MarketBasketsResponse>;
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ import { MarketTotals, Market, BasketMarket } from './entities';
3
+
4
+ const MarketsResponse = z.object({
5
+ markets: z.array(Market),
6
+ totals: MarketTotals
7
+ });
8
+ const MarketBasketsResponse = z.object({
9
+ limit: z.number(),
10
+ offset: z.number(),
11
+ count: z.number(),
12
+ markets: z.array(BasketMarket)
13
+ });
14
+
15
+ export { MarketBasketsResponse, MarketsResponse };