@pear-protocol/types 1.33.0 → 2.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 (47) hide show
  1. package/dist/auth/api-keys.d.ts +1 -0
  2. package/dist/auth/api-keys.js +2 -1
  3. package/dist/auth/entities.d.ts +1 -0
  4. package/dist/auth/entities.js +2 -1
  5. package/dist/auth/response.d.ts +2 -0
  6. package/dist/bundle.d.ts +1 -0
  7. package/dist/bundle.js +1 -0
  8. package/dist/fee/entities.d.ts +1 -0
  9. package/dist/fee/entities.js +2 -1
  10. package/dist/margin/index.d.ts +2 -0
  11. package/dist/margin/index.js +2 -0
  12. package/dist/margin/payloads.d.ts +7 -0
  13. package/dist/margin/payloads.js +20 -0
  14. package/dist/margin/response.d.ts +5 -0
  15. package/dist/margin/response.js +11 -0
  16. package/dist/portfolio/entities.d.ts +107 -150
  17. package/dist/portfolio/entities.js +51 -83
  18. package/dist/portfolio/queries.d.ts +0 -1
  19. package/dist/portfolio/queries.js +4 -5
  20. package/dist/portfolio/responses.d.ts +158 -149
  21. package/dist/portfolio/responses.js +20 -7
  22. package/dist/position/entities.d.ts +148 -13
  23. package/dist/position/entities.js +161 -12
  24. package/dist/position/queries.d.ts +17 -1
  25. package/dist/position/queries.js +42 -2
  26. package/dist/position/responses.d.ts +107 -3
  27. package/dist/position/responses.js +6 -3
  28. package/dist/statistics/queries.d.ts +8 -8
  29. package/dist/statistics/queries.js +3 -3
  30. package/dist/trade/entities.d.ts +284 -0
  31. package/dist/trade/entities.js +101 -0
  32. package/dist/trade/index.d.ts +2 -0
  33. package/dist/trade/index.js +2 -0
  34. package/dist/trade/queries.d.ts +8 -0
  35. package/dist/trade/queries.js +9 -0
  36. package/dist/trade/responses.d.ts +116 -0
  37. package/dist/trade/responses.js +6 -1
  38. package/dist/trade-accounts/entities.d.ts +4 -0
  39. package/dist/trade-accounts/entities.js +4 -0
  40. package/dist/trade-accounts/payloads.d.ts +12 -0
  41. package/dist/trade-accounts/payloads.js +10 -1
  42. package/dist/trade-accounts/response.d.ts +101 -0
  43. package/dist/trade-accounts/response.js +14 -1
  44. package/dist/users/entities.d.ts +1 -0
  45. package/dist/users/entities.js +2 -1
  46. package/dist/users/response.d.ts +1 -0
  47. package/package.json +1 -1
@@ -10,6 +10,10 @@ export declare const TradeAccountResponse: z.ZodObject<{
10
10
  okx: "okx";
11
11
  lighter: "lighter";
12
12
  }>;
13
+ kind: z.ZodEnum<{
14
+ vault: "vault";
15
+ eoa: "eoa";
16
+ }>;
13
17
  exchangeIdentifier: z.ZodString;
14
18
  metadata: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
15
19
  agentWalletAddress: z.ZodString;
@@ -35,6 +39,10 @@ export declare const TradeAccountListResponse: z.ZodObject<{
35
39
  okx: "okx";
36
40
  lighter: "lighter";
37
41
  }>;
42
+ kind: z.ZodEnum<{
43
+ vault: "vault";
44
+ eoa: "eoa";
45
+ }>;
38
46
  exchangeIdentifier: z.ZodString;
39
47
  metadata: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
40
48
  agentWalletAddress: z.ZodString;
@@ -49,6 +57,79 @@ export declare const TradeAccountListResponse: z.ZodObject<{
49
57
  }, z.core.$strip>>;
50
58
  }, z.core.$strip>;
51
59
  export type TradeAccountListResponse = z.infer<typeof TradeAccountListResponse>;
60
+ /**
61
+ * Whether a vault already has a pear-pro trade account (UI: create vs trade). The account is owned by
62
+ * the vault's own synthetic user, so it never shows up in the caller's own list — this is where an
63
+ * authorized owner/trader gets it in order to trade as the vault (via the `pear-vault-address` header).
64
+ */
65
+ export declare const VaultTradeAccountStatus: z.ZodDiscriminatedUnion<[z.ZodObject<{
66
+ exists: z.ZodLiteral<false>;
67
+ }, z.core.$strip>, z.ZodObject<{
68
+ exists: z.ZodLiteral<true>;
69
+ tradeAccountId: z.ZodString;
70
+ account: z.ZodObject<{
71
+ id: z.ZodUUID;
72
+ alias: z.ZodString;
73
+ connector: z.ZodEnum<{
74
+ hyperliquid: "hyperliquid";
75
+ binance: "binance";
76
+ bybit: "bybit";
77
+ okx: "okx";
78
+ lighter: "lighter";
79
+ }>;
80
+ kind: z.ZodEnum<{
81
+ vault: "vault";
82
+ eoa: "eoa";
83
+ }>;
84
+ exchangeIdentifier: z.ZodString;
85
+ metadata: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
86
+ agentWalletAddress: z.ZodString;
87
+ isSubaccount: z.ZodBoolean;
88
+ mainAccountAddress: z.ZodString;
89
+ }, z.core.$strip>, z.ZodObject<{
90
+ l1_address: z.ZodString;
91
+ }, z.core.$strip>]>>;
92
+ createdAt: z.ZodString;
93
+ updatedAt: z.ZodString;
94
+ deletedAt: z.ZodOptional<z.ZodString>;
95
+ }, z.core.$strip>;
96
+ }, z.core.$strip>], "exists">;
97
+ export type VaultTradeAccountStatus = z.infer<typeof VaultTradeAccountStatus>;
98
+ export declare const VaultTradeAccountStatusResponse: z.ZodObject<{
99
+ status: z.ZodDiscriminatedUnion<[z.ZodObject<{
100
+ exists: z.ZodLiteral<false>;
101
+ }, z.core.$strip>, z.ZodObject<{
102
+ exists: z.ZodLiteral<true>;
103
+ tradeAccountId: z.ZodString;
104
+ account: z.ZodObject<{
105
+ id: z.ZodUUID;
106
+ alias: z.ZodString;
107
+ connector: z.ZodEnum<{
108
+ hyperliquid: "hyperliquid";
109
+ binance: "binance";
110
+ bybit: "bybit";
111
+ okx: "okx";
112
+ lighter: "lighter";
113
+ }>;
114
+ kind: z.ZodEnum<{
115
+ vault: "vault";
116
+ eoa: "eoa";
117
+ }>;
118
+ exchangeIdentifier: z.ZodString;
119
+ metadata: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
120
+ agentWalletAddress: z.ZodString;
121
+ isSubaccount: z.ZodBoolean;
122
+ mainAccountAddress: z.ZodString;
123
+ }, z.core.$strip>, z.ZodObject<{
124
+ l1_address: z.ZodString;
125
+ }, z.core.$strip>]>>;
126
+ createdAt: z.ZodString;
127
+ updatedAt: z.ZodString;
128
+ deletedAt: z.ZodOptional<z.ZodString>;
129
+ }, z.core.$strip>;
130
+ }, z.core.$strip>], "exists">;
131
+ }, z.core.$strip>;
132
+ export type VaultTradeAccountStatusResponse = z.infer<typeof VaultTradeAccountStatusResponse>;
52
133
  export declare const ExchangeCredentialsResponse: z.ZodDiscriminatedUnion<[z.ZodObject<{
53
134
  connector: z.ZodLiteral<"hyperliquid">;
54
135
  account: z.ZodObject<{
@@ -61,6 +142,10 @@ export declare const ExchangeCredentialsResponse: z.ZodDiscriminatedUnion<[z.Zod
61
142
  okx: "okx";
62
143
  lighter: "lighter";
63
144
  }>;
145
+ kind: z.ZodEnum<{
146
+ vault: "vault";
147
+ eoa: "eoa";
148
+ }>;
64
149
  exchangeIdentifier: z.ZodString;
65
150
  metadata: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
66
151
  agentWalletAddress: z.ZodString;
@@ -88,6 +173,10 @@ export declare const ExchangeCredentialsResponse: z.ZodDiscriminatedUnion<[z.Zod
88
173
  okx: "okx";
89
174
  lighter: "lighter";
90
175
  }>;
176
+ kind: z.ZodEnum<{
177
+ vault: "vault";
178
+ eoa: "eoa";
179
+ }>;
91
180
  exchangeIdentifier: z.ZodString;
92
181
  metadata: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
93
182
  agentWalletAddress: z.ZodString;
@@ -122,6 +211,10 @@ export declare const ExchangeCredentialsResponse: z.ZodDiscriminatedUnion<[z.Zod
122
211
  okx: "okx";
123
212
  lighter: "lighter";
124
213
  }>;
214
+ kind: z.ZodEnum<{
215
+ vault: "vault";
216
+ eoa: "eoa";
217
+ }>;
125
218
  exchangeIdentifier: z.ZodString;
126
219
  metadata: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
127
220
  agentWalletAddress: z.ZodString;
@@ -150,6 +243,10 @@ export declare const ExchangeCredentialsResponse: z.ZodDiscriminatedUnion<[z.Zod
150
243
  okx: "okx";
151
244
  lighter: "lighter";
152
245
  }>;
246
+ kind: z.ZodEnum<{
247
+ vault: "vault";
248
+ eoa: "eoa";
249
+ }>;
153
250
  exchangeIdentifier: z.ZodString;
154
251
  metadata: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
155
252
  agentWalletAddress: z.ZodString;
@@ -179,6 +276,10 @@ export declare const ExchangeCredentialsResponse: z.ZodDiscriminatedUnion<[z.Zod
179
276
  okx: "okx";
180
277
  lighter: "lighter";
181
278
  }>;
279
+ kind: z.ZodEnum<{
280
+ vault: "vault";
281
+ eoa: "eoa";
282
+ }>;
182
283
  exchangeIdentifier: z.ZodString;
183
284
  metadata: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
184
285
  agentWalletAddress: z.ZodString;
@@ -7,6 +7,19 @@ const TradeAccountResponse = z.object({
7
7
  const TradeAccountListResponse = z.object({
8
8
  accounts: z.array(TradeAccount)
9
9
  });
10
+ const VaultTradeAccountStatus = z.discriminatedUnion("exists", [
11
+ z.object({
12
+ exists: z.literal(false)
13
+ }),
14
+ z.object({
15
+ exists: z.literal(true),
16
+ tradeAccountId: z.string(),
17
+ account: TradeAccount
18
+ })
19
+ ]);
20
+ const VaultTradeAccountStatusResponse = z.object({
21
+ status: VaultTradeAccountStatus
22
+ });
10
23
  const HyperliquidCredentialsResponse = z.object({
11
24
  connector: z.literal("hyperliquid"),
12
25
  account: TradeAccount,
@@ -59,4 +72,4 @@ const ExchangeCredentialsResponse = z.discriminatedUnion("connector", [
59
72
  LighterCredentialsResponse
60
73
  ]);
61
74
 
62
- export { ExchangeCredentialsResponse, TradeAccountListResponse, TradeAccountResponse };
75
+ export { ExchangeCredentialsResponse, TradeAccountListResponse, TradeAccountResponse, VaultTradeAccountStatus, VaultTradeAccountStatusResponse };
@@ -8,6 +8,7 @@ export declare const UserProfile: z.ZodObject<{
8
8
  role: z.ZodEnum<{
9
9
  basic: "basic";
10
10
  pro: "pro";
11
+ vault: "vault";
11
12
  }>;
12
13
  address: z.ZodNullable<z.ZodString>;
13
14
  email: z.ZodNullable<z.ZodString>;
@@ -10,7 +10,8 @@ const UserProfile = z.object({
10
10
  displayName: z.string().describe("Public display name"),
11
11
  role: z.enum([
12
12
  "basic",
13
- "pro"
13
+ "pro",
14
+ "vault"
14
15
  ]).describe("User role"),
15
16
  address: z.string().nullable().describe("Linked wallet address (for evm_wallet provider)"),
16
17
  email: z.string().nullable().describe("Linked email address (for email provider)"),
@@ -6,6 +6,7 @@ export declare const ProfileResponse: z.ZodObject<{
6
6
  role: z.ZodEnum<{
7
7
  basic: "basic";
8
8
  pro: "pro";
9
+ vault: "vault";
9
10
  }>;
10
11
  address: z.ZodNullable<z.ZodString>;
11
12
  email: z.ZodNullable<z.ZodString>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/types",
3
- "version": "1.33.0",
3
+ "version": "2.1.0",
4
4
  "description": "Pear Protocol Types definitions",
5
5
  "private": false,
6
6
  "type": "module",