@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.
- package/dist/auth/api-keys.d.ts +1 -0
- package/dist/auth/api-keys.js +2 -1
- package/dist/auth/entities.d.ts +1 -0
- package/dist/auth/entities.js +2 -1
- package/dist/auth/response.d.ts +2 -0
- package/dist/bundle.d.ts +1 -0
- package/dist/bundle.js +1 -0
- package/dist/fee/entities.d.ts +1 -0
- package/dist/fee/entities.js +2 -1
- package/dist/margin/index.d.ts +2 -0
- package/dist/margin/index.js +2 -0
- package/dist/margin/payloads.d.ts +7 -0
- package/dist/margin/payloads.js +20 -0
- package/dist/margin/response.d.ts +5 -0
- package/dist/margin/response.js +11 -0
- package/dist/portfolio/entities.d.ts +107 -150
- package/dist/portfolio/entities.js +51 -83
- package/dist/portfolio/queries.d.ts +0 -1
- package/dist/portfolio/queries.js +4 -5
- package/dist/portfolio/responses.d.ts +158 -149
- package/dist/portfolio/responses.js +20 -7
- package/dist/position/entities.d.ts +148 -13
- package/dist/position/entities.js +161 -12
- package/dist/position/queries.d.ts +17 -1
- package/dist/position/queries.js +42 -2
- package/dist/position/responses.d.ts +107 -3
- package/dist/position/responses.js +6 -3
- package/dist/statistics/queries.d.ts +8 -8
- package/dist/statistics/queries.js +3 -3
- package/dist/trade/entities.d.ts +284 -0
- package/dist/trade/entities.js +101 -0
- package/dist/trade/index.d.ts +2 -0
- package/dist/trade/index.js +2 -0
- package/dist/trade/queries.d.ts +8 -0
- package/dist/trade/queries.js +9 -0
- package/dist/trade/responses.d.ts +116 -0
- package/dist/trade/responses.js +6 -1
- package/dist/trade-accounts/entities.d.ts +4 -0
- package/dist/trade-accounts/entities.js +4 -0
- package/dist/trade-accounts/payloads.d.ts +12 -0
- package/dist/trade-accounts/payloads.js +10 -1
- package/dist/trade-accounts/response.d.ts +101 -0
- package/dist/trade-accounts/response.js +14 -1
- package/dist/users/entities.d.ts +1 -0
- package/dist/users/entities.js +2 -1
- package/dist/users/response.d.ts +1 -0
- 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 };
|
package/dist/users/entities.d.ts
CHANGED
package/dist/users/entities.js
CHANGED
|
@@ -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)"),
|
package/dist/users/response.d.ts
CHANGED