@pear-protocol/types 1.21.0 → 1.23.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/entities.d.ts +20 -0
- package/dist/auth/entities.js +7 -2
- package/dist/auth/response.d.ts +28 -0
- package/dist/auth/response.js +12 -3
- package/dist/statistics/entities.d.ts +4 -0
- package/dist/statistics/entities.js +15 -1
- package/dist/statistics/responses.d.ts +4 -0
- package/dist/trade/responses.d.ts +273 -1
- package/dist/trade/responses.js +1 -1
- package/dist/users/entities.d.ts +3 -0
- package/dist/users/entities.js +6 -1
- package/dist/users/response.d.ts +3 -0
- package/package.json +1 -1
package/dist/auth/entities.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare const LoginMethod: z.ZodEnum<{
|
|
|
3
3
|
email: "email";
|
|
4
4
|
evm_wallet: "evm_wallet";
|
|
5
5
|
oauth: "oauth";
|
|
6
|
+
x: "x";
|
|
6
7
|
}>;
|
|
7
8
|
export declare const AuthenticatedUser: z.ZodObject<{
|
|
8
9
|
id: z.ZodUUID;
|
|
@@ -15,7 +16,26 @@ export declare const AuthenticatedUser: z.ZodObject<{
|
|
|
15
16
|
email: "email";
|
|
16
17
|
evm_wallet: "evm_wallet";
|
|
17
18
|
oauth: "oauth";
|
|
19
|
+
x: "x";
|
|
18
20
|
}>;
|
|
19
21
|
}, z.core.$strip>;
|
|
22
|
+
/**
|
|
23
|
+
* One provider identity connected to the account.
|
|
24
|
+
*
|
|
25
|
+
* Identity only: every entry reports the immutable id the provider knows the account by.
|
|
26
|
+
* Mutable display data - the X handle, name and avatar - is published by the profile
|
|
27
|
+
* endpoints that own it, so it never goes stale in two places at once.
|
|
28
|
+
*/
|
|
29
|
+
export declare const ConnectedIdentity: z.ZodObject<{
|
|
30
|
+
provider: z.ZodEnum<{
|
|
31
|
+
email: "email";
|
|
32
|
+
evm_wallet: "evm_wallet";
|
|
33
|
+
oauth: "oauth";
|
|
34
|
+
x: "x";
|
|
35
|
+
}>;
|
|
36
|
+
externalId: z.ZodString;
|
|
37
|
+
connectedAt: z.ZodString;
|
|
38
|
+
}, z.core.$strip>;
|
|
20
39
|
export type LoginMethod = z.infer<typeof LoginMethod>;
|
|
21
40
|
export type AuthenticatedUser = z.infer<typeof AuthenticatedUser>;
|
|
41
|
+
export type ConnectedIdentity = z.infer<typeof ConnectedIdentity>;
|
package/dist/auth/entities.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
const LoginMethod = z.enum(["email", "evm_wallet", "oauth"]).describe("Authentication provider used for the current session");
|
|
3
|
+
const LoginMethod = z.enum(["email", "evm_wallet", "oauth", "x"]).describe("Authentication provider used for the current session");
|
|
4
4
|
const AuthenticatedUser = z.object({
|
|
5
5
|
id: z.uuid().describe("User UUID"),
|
|
6
6
|
role: z.enum(["basic", "pro"]).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");
|
|
10
|
+
const ConnectedIdentity = z.object({
|
|
11
|
+
provider: LoginMethod.describe("Provider that owns this identity"),
|
|
12
|
+
externalId: z.string().describe("Immutable id the provider knows the account by: wallet address, email, or X numeric id"),
|
|
13
|
+
connectedAt: z.string().describe("ISO-8601 timestamp of when the identity was connected")
|
|
14
|
+
}).describe("One provider identity connected to the account");
|
|
10
15
|
|
|
11
|
-
export { AuthenticatedUser, LoginMethod };
|
|
16
|
+
export { AuthenticatedUser, ConnectedIdentity, LoginMethod };
|
package/dist/auth/response.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare const LoginResponse: z.ZodObject<{
|
|
|
13
13
|
email: "email";
|
|
14
14
|
evm_wallet: "evm_wallet";
|
|
15
15
|
oauth: "oauth";
|
|
16
|
+
x: "x";
|
|
16
17
|
}>;
|
|
17
18
|
}, z.core.$strip>;
|
|
18
19
|
}, z.core.$strip>;
|
|
@@ -50,11 +51,24 @@ export declare const VerifyEmailResponse: z.ZodObject<{
|
|
|
50
51
|
}, z.core.$strip>;
|
|
51
52
|
export declare const LinkEmailResponse: z.ZodVoid;
|
|
52
53
|
export declare const LinkWalletResponse: z.ZodVoid;
|
|
54
|
+
export declare const StartXLinkResponse: z.ZodObject<{
|
|
55
|
+
authorizeUrl: z.ZodString;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
export declare const DisconnectXResponse: z.ZodVoid;
|
|
58
|
+
export declare const StartXLoginResponse: z.ZodObject<{
|
|
59
|
+
authorizeUrl: z.ZodString;
|
|
60
|
+
}, z.core.$strip>;
|
|
53
61
|
export declare const RequestNonceResponse: z.ZodObject<{
|
|
54
62
|
nonce: z.ZodString;
|
|
55
63
|
message: z.ZodString;
|
|
56
64
|
expiresAt: z.ZodNumber;
|
|
57
65
|
}, z.core.$strip>;
|
|
66
|
+
/**
|
|
67
|
+
* The session endpoint answers for the whole account, not just the credential in play:
|
|
68
|
+
* `providerId`/`loginMethod` describe the current session, `identities` lists every login
|
|
69
|
+
* the account can be reached by - which is what a client needs to offer "connect" and
|
|
70
|
+
* "disconnect" for the rest.
|
|
71
|
+
*/
|
|
58
72
|
export declare const MeResponse: z.ZodObject<{
|
|
59
73
|
id: z.ZodUUID;
|
|
60
74
|
role: z.ZodEnum<{
|
|
@@ -66,7 +80,18 @@ export declare const MeResponse: z.ZodObject<{
|
|
|
66
80
|
email: "email";
|
|
67
81
|
evm_wallet: "evm_wallet";
|
|
68
82
|
oauth: "oauth";
|
|
83
|
+
x: "x";
|
|
69
84
|
}>;
|
|
85
|
+
identities: z.ZodArray<z.ZodObject<{
|
|
86
|
+
provider: z.ZodEnum<{
|
|
87
|
+
email: "email";
|
|
88
|
+
evm_wallet: "evm_wallet";
|
|
89
|
+
oauth: "oauth";
|
|
90
|
+
x: "x";
|
|
91
|
+
}>;
|
|
92
|
+
externalId: z.ZodString;
|
|
93
|
+
connectedAt: z.ZodString;
|
|
94
|
+
}, z.core.$strip>>;
|
|
70
95
|
}, z.core.$strip>;
|
|
71
96
|
export declare const OauthGrant: z.ZodObject<{
|
|
72
97
|
id: z.ZodString;
|
|
@@ -111,6 +136,9 @@ export type LogoutResponse = z.infer<typeof LogoutResponse>;
|
|
|
111
136
|
export type RegisterEmailResponse = z.infer<typeof RegisterEmailResponse>;
|
|
112
137
|
export type LinkEmailResponse = z.infer<typeof LinkEmailResponse>;
|
|
113
138
|
export type LinkWalletResponse = z.infer<typeof LinkWalletResponse>;
|
|
139
|
+
export type StartXLinkResponse = z.infer<typeof StartXLinkResponse>;
|
|
140
|
+
export type DisconnectXResponse = z.infer<typeof DisconnectXResponse>;
|
|
141
|
+
export type StartXLoginResponse = z.infer<typeof StartXLoginResponse>;
|
|
114
142
|
export type MeResponse = z.infer<typeof MeResponse>;
|
|
115
143
|
export type OauthGrant = z.infer<typeof OauthGrant>;
|
|
116
144
|
export type OauthGrantsResponse = z.infer<typeof OauthGrantsResponse>;
|
package/dist/auth/response.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { AuthenticatedUser } from './entities';
|
|
2
|
+
import { AuthenticatedUser, ConnectedIdentity } from './entities';
|
|
3
3
|
|
|
4
4
|
const LoginResponse = z.object({
|
|
5
5
|
accessToken: z.string().describe("New JWT access token"),
|
|
@@ -31,12 +31,21 @@ const VerifyEmailResponse = z.object({
|
|
|
31
31
|
}).describe("Successful email verification response");
|
|
32
32
|
const LinkEmailResponse = z.void().describe("Successful email verification response");
|
|
33
33
|
const LinkWalletResponse = z.void().describe("Successful wallet link response");
|
|
34
|
+
const StartXLinkResponse = z.object({
|
|
35
|
+
authorizeUrl: z.string().describe("X authorization URL to send the browser to. Expires with the flow's state.")
|
|
36
|
+
}).describe("Start of the X account link flow");
|
|
37
|
+
const DisconnectXResponse = z.void().describe("Successful X account disconnect response");
|
|
38
|
+
const StartXLoginResponse = z.object({
|
|
39
|
+
authorizeUrl: z.string().describe("X authorization URL to send the browser to. Expires with the flow's state.")
|
|
40
|
+
}).describe("Start of the X sign-in flow");
|
|
34
41
|
const RequestNonceResponse = z.object({
|
|
35
42
|
nonce: z.string().describe("Nonce to sign with wallet"),
|
|
36
43
|
message: z.string().describe("Domain-bound wallet sign-in message"),
|
|
37
44
|
expiresAt: z.number().int().positive().describe("Unix timestamp when nonce expires")
|
|
38
45
|
}).describe("Nonce response for wallet authentication");
|
|
39
|
-
const MeResponse = AuthenticatedUser.
|
|
46
|
+
const MeResponse = AuthenticatedUser.extend({
|
|
47
|
+
identities: z.array(ConnectedIdentity).describe("Every provider identity connected to this account, oldest first")
|
|
48
|
+
}).describe("Current authenticated user info");
|
|
40
49
|
const OauthGrant = z.object({
|
|
41
50
|
id: z.string().describe("OAuth grant id \u2014 used to revoke this grant"),
|
|
42
51
|
name: z.string().describe("Human-readable client name, falling back to the client id when unnamed"),
|
|
@@ -64,4 +73,4 @@ const OauthInteractionRedirectResponse = z.object({
|
|
|
64
73
|
returnTo: z.string().describe("Provider URL to redirect the browser back to")
|
|
65
74
|
}).describe("OAuth interaction redirect target after login/confirm/abort");
|
|
66
75
|
|
|
67
|
-
export { ChangePasswordResponse, ForgotPasswordResponse, LinkEmailResponse, LinkWalletResponse, LoginResponse, LogoutResponse, MeResponse, OauthGrant, OauthGrantsResponse, OauthInteractionClient, OauthInteractionDetailsResponse, OauthInteractionRedirectResponse, RefreshSessionResponse, RefreshTokenResponse, RegisterEmailResponse, RequestNonceResponse, ResendVerificationResponse, ResetPasswordResponse, VerifyEmailResponse };
|
|
76
|
+
export { ChangePasswordResponse, DisconnectXResponse, ForgotPasswordResponse, LinkEmailResponse, LinkWalletResponse, LoginResponse, LogoutResponse, MeResponse, OauthGrant, OauthGrantsResponse, OauthInteractionClient, OauthInteractionDetailsResponse, OauthInteractionRedirectResponse, RefreshSessionResponse, RefreshTokenResponse, RegisterEmailResponse, RequestNonceResponse, ResendVerificationResponse, ResetPasswordResponse, StartXLinkResponse, StartXLoginResponse, VerifyEmailResponse };
|
|
@@ -17,6 +17,10 @@ export declare const LeaderboardRow: z.ZodObject<{
|
|
|
17
17
|
pearFee: z.ZodString;
|
|
18
18
|
tradeFee: z.ZodString;
|
|
19
19
|
totalTrades: z.ZodNumber;
|
|
20
|
+
xHandle: z.ZodOptional<z.ZodString>;
|
|
21
|
+
xName: z.ZodOptional<z.ZodString>;
|
|
22
|
+
xAvatarUrl: z.ZodOptional<z.ZodString>;
|
|
23
|
+
xUserId: z.ZodOptional<z.ZodString>;
|
|
20
24
|
}, z.core.$strip>;
|
|
21
25
|
export type LeaderboardRow = z.output<typeof LeaderboardRow>;
|
|
22
26
|
export declare const VolumeStatistics: z.ZodObject<{
|
|
@@ -20,7 +20,21 @@ const LeaderboardRow = z.object({
|
|
|
20
20
|
// V2 calls this builderFee; V3 names it for the column it comes from.
|
|
21
21
|
pearFee: z.string(),
|
|
22
22
|
tradeFee: z.string(),
|
|
23
|
-
totalTrades: z.number()
|
|
23
|
+
totalTrades: z.number(),
|
|
24
|
+
// The trader's linked X account. Absent for an account whose owner has connected no X
|
|
25
|
+
// account, and absent for an anonymous caller: the board itself is public, but pairing a
|
|
26
|
+
// real name with a wallet address and a PnL for the open internet is a wider promise than
|
|
27
|
+
// the one the user accepted when connecting X. Never null-with-a-key: absence is the
|
|
28
|
+
// signal.
|
|
29
|
+
//
|
|
30
|
+
// Whatever X reported at the owner's last authorization. Nothing re-reads X in between,
|
|
31
|
+
// so a trader who renamed and has not signed in since is named by their old handle.
|
|
32
|
+
xHandle: z.string().optional(),
|
|
33
|
+
xName: z.string().optional(),
|
|
34
|
+
xAvatarUrl: z.string().optional(),
|
|
35
|
+
// Immutable X numeric id. Link by this, never by the handle: X frees a renamed handle
|
|
36
|
+
// for anyone to claim immediately, so a cached handle can point at a stranger.
|
|
37
|
+
xUserId: z.string().optional()
|
|
24
38
|
});
|
|
25
39
|
const VolumeStatistics = z.object({
|
|
26
40
|
timestamp: z.number(),
|
|
@@ -18,6 +18,10 @@ export declare const LeaderboardResponse: z.ZodObject<{
|
|
|
18
18
|
pearFee: z.ZodString;
|
|
19
19
|
tradeFee: z.ZodString;
|
|
20
20
|
totalTrades: z.ZodNumber;
|
|
21
|
+
xHandle: z.ZodOptional<z.ZodString>;
|
|
22
|
+
xName: z.ZodOptional<z.ZodString>;
|
|
23
|
+
xAvatarUrl: z.ZodOptional<z.ZodString>;
|
|
24
|
+
xUserId: z.ZodOptional<z.ZodString>;
|
|
21
25
|
}, z.core.$strip>>;
|
|
22
26
|
}, z.core.$strip>;
|
|
23
27
|
export type LeaderboardResponse = z.output<typeof LeaderboardResponse>;
|
|
@@ -1095,5 +1095,277 @@ export declare const CreateTradeReverseResponse: z.ZodObject<{
|
|
|
1095
1095
|
}, z.core.$strip>], "intent">], "orderType">;
|
|
1096
1096
|
}, z.core.$strip>;
|
|
1097
1097
|
export type CreateTradeReverseResponse = z.output<typeof CreateTradeReverseResponse>;
|
|
1098
|
-
export declare const CreateTradeCloseAllResponse: z.ZodObject<{
|
|
1098
|
+
export declare const CreateTradeCloseAllResponse: z.ZodObject<{
|
|
1099
|
+
executions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1100
|
+
id: z.ZodUUID;
|
|
1101
|
+
connector: z.ZodEnum<{
|
|
1102
|
+
hyperliquid: "hyperliquid";
|
|
1103
|
+
binance: "binance";
|
|
1104
|
+
bybit: "bybit";
|
|
1105
|
+
okx: "okx";
|
|
1106
|
+
lighter: "lighter";
|
|
1107
|
+
}>;
|
|
1108
|
+
status: z.ZodEnum<{
|
|
1109
|
+
CANCELLED: "CANCELLED";
|
|
1110
|
+
IDLE: "IDLE";
|
|
1111
|
+
ACTIVE: "ACTIVE";
|
|
1112
|
+
COMPLETED: "COMPLETED";
|
|
1113
|
+
FAILED: "FAILED";
|
|
1114
|
+
}>;
|
|
1115
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1116
|
+
createdAt: z.ZodString;
|
|
1117
|
+
updatedAt: z.ZodString;
|
|
1118
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1119
|
+
id: z.ZodUUID;
|
|
1120
|
+
connector: z.ZodEnum<{
|
|
1121
|
+
hyperliquid: "hyperliquid";
|
|
1122
|
+
binance: "binance";
|
|
1123
|
+
bybit: "bybit";
|
|
1124
|
+
okx: "okx";
|
|
1125
|
+
lighter: "lighter";
|
|
1126
|
+
}>;
|
|
1127
|
+
status: z.ZodEnum<{
|
|
1128
|
+
PENDING: "PENDING";
|
|
1129
|
+
PARTIAL: "PARTIAL";
|
|
1130
|
+
FILLED: "FILLED";
|
|
1131
|
+
CANCELLED: "CANCELLED";
|
|
1132
|
+
REJECTED: "REJECTED";
|
|
1133
|
+
}>;
|
|
1134
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1135
|
+
createdAt: z.ZodString;
|
|
1136
|
+
updatedAt: z.ZodString;
|
|
1137
|
+
type: z.ZodLiteral<"MARKET">;
|
|
1138
|
+
symbol: z.ZodString;
|
|
1139
|
+
side: z.ZodEnum<{
|
|
1140
|
+
BUY: "BUY";
|
|
1141
|
+
SELL: "SELL";
|
|
1142
|
+
}>;
|
|
1143
|
+
reduceOnly: z.ZodBoolean;
|
|
1144
|
+
quantity: z.ZodString;
|
|
1145
|
+
price: z.ZodString;
|
|
1146
|
+
filledQuantity: z.ZodString;
|
|
1147
|
+
filledPrice: z.ZodOptional<z.ZodString>;
|
|
1148
|
+
}, z.core.$strip>], "type">>>;
|
|
1149
|
+
intent: z.ZodLiteral<"OPEN">;
|
|
1150
|
+
orderType: z.ZodLiteral<"MARKET">;
|
|
1151
|
+
legs: z.ZodTuple<[z.ZodObject<{
|
|
1152
|
+
symbol: z.ZodString;
|
|
1153
|
+
side: z.ZodEnum<{
|
|
1154
|
+
BUY: "BUY";
|
|
1155
|
+
SELL: "SELL";
|
|
1156
|
+
}>;
|
|
1157
|
+
mode: z.ZodEnum<{
|
|
1158
|
+
QUANTITY: "QUANTITY";
|
|
1159
|
+
USD: "USD";
|
|
1160
|
+
}>;
|
|
1161
|
+
amount: z.ZodString;
|
|
1162
|
+
reduceOnly: z.ZodBoolean;
|
|
1163
|
+
}, z.core.$strip>], z.ZodObject<{
|
|
1164
|
+
symbol: z.ZodString;
|
|
1165
|
+
side: z.ZodEnum<{
|
|
1166
|
+
BUY: "BUY";
|
|
1167
|
+
SELL: "SELL";
|
|
1168
|
+
}>;
|
|
1169
|
+
mode: z.ZodEnum<{
|
|
1170
|
+
QUANTITY: "QUANTITY";
|
|
1171
|
+
USD: "USD";
|
|
1172
|
+
}>;
|
|
1173
|
+
amount: z.ZodString;
|
|
1174
|
+
reduceOnly: z.ZodBoolean;
|
|
1175
|
+
}, z.core.$strip>>;
|
|
1176
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1177
|
+
id: z.ZodUUID;
|
|
1178
|
+
connector: z.ZodEnum<{
|
|
1179
|
+
hyperliquid: "hyperliquid";
|
|
1180
|
+
binance: "binance";
|
|
1181
|
+
bybit: "bybit";
|
|
1182
|
+
okx: "okx";
|
|
1183
|
+
lighter: "lighter";
|
|
1184
|
+
}>;
|
|
1185
|
+
status: z.ZodEnum<{
|
|
1186
|
+
CANCELLED: "CANCELLED";
|
|
1187
|
+
IDLE: "IDLE";
|
|
1188
|
+
ACTIVE: "ACTIVE";
|
|
1189
|
+
COMPLETED: "COMPLETED";
|
|
1190
|
+
FAILED: "FAILED";
|
|
1191
|
+
}>;
|
|
1192
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1193
|
+
createdAt: z.ZodString;
|
|
1194
|
+
updatedAt: z.ZodString;
|
|
1195
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1196
|
+
id: z.ZodUUID;
|
|
1197
|
+
connector: z.ZodEnum<{
|
|
1198
|
+
hyperliquid: "hyperliquid";
|
|
1199
|
+
binance: "binance";
|
|
1200
|
+
bybit: "bybit";
|
|
1201
|
+
okx: "okx";
|
|
1202
|
+
lighter: "lighter";
|
|
1203
|
+
}>;
|
|
1204
|
+
status: z.ZodEnum<{
|
|
1205
|
+
PENDING: "PENDING";
|
|
1206
|
+
PARTIAL: "PARTIAL";
|
|
1207
|
+
FILLED: "FILLED";
|
|
1208
|
+
CANCELLED: "CANCELLED";
|
|
1209
|
+
REJECTED: "REJECTED";
|
|
1210
|
+
}>;
|
|
1211
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1212
|
+
createdAt: z.ZodString;
|
|
1213
|
+
updatedAt: z.ZodString;
|
|
1214
|
+
type: z.ZodLiteral<"MARKET">;
|
|
1215
|
+
symbol: z.ZodString;
|
|
1216
|
+
side: z.ZodEnum<{
|
|
1217
|
+
BUY: "BUY";
|
|
1218
|
+
SELL: "SELL";
|
|
1219
|
+
}>;
|
|
1220
|
+
reduceOnly: z.ZodBoolean;
|
|
1221
|
+
quantity: z.ZodString;
|
|
1222
|
+
price: z.ZodString;
|
|
1223
|
+
filledQuantity: z.ZodString;
|
|
1224
|
+
filledPrice: z.ZodOptional<z.ZodString>;
|
|
1225
|
+
}, z.core.$strip>], "type">>>;
|
|
1226
|
+
intent: z.ZodLiteral<"ADJUST">;
|
|
1227
|
+
orderType: z.ZodLiteral<"MARKET">;
|
|
1228
|
+
position: z.ZodObject<{
|
|
1229
|
+
id: z.ZodUUID;
|
|
1230
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
1231
|
+
}, z.core.$strip>;
|
|
1232
|
+
legs: z.ZodTuple<[z.ZodObject<{
|
|
1233
|
+
symbol: z.ZodString;
|
|
1234
|
+
side: z.ZodEnum<{
|
|
1235
|
+
BUY: "BUY";
|
|
1236
|
+
SELL: "SELL";
|
|
1237
|
+
}>;
|
|
1238
|
+
mode: z.ZodEnum<{
|
|
1239
|
+
QUANTITY: "QUANTITY";
|
|
1240
|
+
USD: "USD";
|
|
1241
|
+
}>;
|
|
1242
|
+
amount: z.ZodString;
|
|
1243
|
+
reduceOnly: z.ZodBoolean;
|
|
1244
|
+
}, z.core.$strip>], z.ZodObject<{
|
|
1245
|
+
symbol: z.ZodString;
|
|
1246
|
+
side: z.ZodEnum<{
|
|
1247
|
+
BUY: "BUY";
|
|
1248
|
+
SELL: "SELL";
|
|
1249
|
+
}>;
|
|
1250
|
+
mode: z.ZodEnum<{
|
|
1251
|
+
QUANTITY: "QUANTITY";
|
|
1252
|
+
USD: "USD";
|
|
1253
|
+
}>;
|
|
1254
|
+
amount: z.ZodString;
|
|
1255
|
+
reduceOnly: z.ZodBoolean;
|
|
1256
|
+
}, z.core.$strip>>;
|
|
1257
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1258
|
+
id: z.ZodUUID;
|
|
1259
|
+
connector: z.ZodEnum<{
|
|
1260
|
+
hyperliquid: "hyperliquid";
|
|
1261
|
+
binance: "binance";
|
|
1262
|
+
bybit: "bybit";
|
|
1263
|
+
okx: "okx";
|
|
1264
|
+
lighter: "lighter";
|
|
1265
|
+
}>;
|
|
1266
|
+
status: z.ZodEnum<{
|
|
1267
|
+
CANCELLED: "CANCELLED";
|
|
1268
|
+
IDLE: "IDLE";
|
|
1269
|
+
ACTIVE: "ACTIVE";
|
|
1270
|
+
COMPLETED: "COMPLETED";
|
|
1271
|
+
FAILED: "FAILED";
|
|
1272
|
+
}>;
|
|
1273
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1274
|
+
createdAt: z.ZodString;
|
|
1275
|
+
updatedAt: z.ZodString;
|
|
1276
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1277
|
+
id: z.ZodUUID;
|
|
1278
|
+
connector: z.ZodEnum<{
|
|
1279
|
+
hyperliquid: "hyperliquid";
|
|
1280
|
+
binance: "binance";
|
|
1281
|
+
bybit: "bybit";
|
|
1282
|
+
okx: "okx";
|
|
1283
|
+
lighter: "lighter";
|
|
1284
|
+
}>;
|
|
1285
|
+
status: z.ZodEnum<{
|
|
1286
|
+
PENDING: "PENDING";
|
|
1287
|
+
PARTIAL: "PARTIAL";
|
|
1288
|
+
FILLED: "FILLED";
|
|
1289
|
+
CANCELLED: "CANCELLED";
|
|
1290
|
+
REJECTED: "REJECTED";
|
|
1291
|
+
}>;
|
|
1292
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1293
|
+
createdAt: z.ZodString;
|
|
1294
|
+
updatedAt: z.ZodString;
|
|
1295
|
+
type: z.ZodLiteral<"MARKET">;
|
|
1296
|
+
symbol: z.ZodString;
|
|
1297
|
+
side: z.ZodEnum<{
|
|
1298
|
+
BUY: "BUY";
|
|
1299
|
+
SELL: "SELL";
|
|
1300
|
+
}>;
|
|
1301
|
+
reduceOnly: z.ZodBoolean;
|
|
1302
|
+
quantity: z.ZodString;
|
|
1303
|
+
price: z.ZodString;
|
|
1304
|
+
filledQuantity: z.ZodString;
|
|
1305
|
+
filledPrice: z.ZodOptional<z.ZodString>;
|
|
1306
|
+
}, z.core.$strip>], "type">>>;
|
|
1307
|
+
intent: z.ZodLiteral<"CLOSE">;
|
|
1308
|
+
orderType: z.ZodLiteral<"MARKET">;
|
|
1309
|
+
position: z.ZodObject<{
|
|
1310
|
+
id: z.ZodUUID;
|
|
1311
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
1312
|
+
}, z.core.$strip>;
|
|
1313
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1314
|
+
id: z.ZodUUID;
|
|
1315
|
+
connector: z.ZodEnum<{
|
|
1316
|
+
hyperliquid: "hyperliquid";
|
|
1317
|
+
binance: "binance";
|
|
1318
|
+
bybit: "bybit";
|
|
1319
|
+
okx: "okx";
|
|
1320
|
+
lighter: "lighter";
|
|
1321
|
+
}>;
|
|
1322
|
+
status: z.ZodEnum<{
|
|
1323
|
+
CANCELLED: "CANCELLED";
|
|
1324
|
+
IDLE: "IDLE";
|
|
1325
|
+
ACTIVE: "ACTIVE";
|
|
1326
|
+
COMPLETED: "COMPLETED";
|
|
1327
|
+
FAILED: "FAILED";
|
|
1328
|
+
}>;
|
|
1329
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1330
|
+
createdAt: z.ZodString;
|
|
1331
|
+
updatedAt: z.ZodString;
|
|
1332
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1333
|
+
id: z.ZodUUID;
|
|
1334
|
+
connector: z.ZodEnum<{
|
|
1335
|
+
hyperliquid: "hyperliquid";
|
|
1336
|
+
binance: "binance";
|
|
1337
|
+
bybit: "bybit";
|
|
1338
|
+
okx: "okx";
|
|
1339
|
+
lighter: "lighter";
|
|
1340
|
+
}>;
|
|
1341
|
+
status: z.ZodEnum<{
|
|
1342
|
+
PENDING: "PENDING";
|
|
1343
|
+
PARTIAL: "PARTIAL";
|
|
1344
|
+
FILLED: "FILLED";
|
|
1345
|
+
CANCELLED: "CANCELLED";
|
|
1346
|
+
REJECTED: "REJECTED";
|
|
1347
|
+
}>;
|
|
1348
|
+
error: z.ZodOptional<z.ZodString>;
|
|
1349
|
+
createdAt: z.ZodString;
|
|
1350
|
+
updatedAt: z.ZodString;
|
|
1351
|
+
type: z.ZodLiteral<"MARKET">;
|
|
1352
|
+
symbol: z.ZodString;
|
|
1353
|
+
side: z.ZodEnum<{
|
|
1354
|
+
BUY: "BUY";
|
|
1355
|
+
SELL: "SELL";
|
|
1356
|
+
}>;
|
|
1357
|
+
reduceOnly: z.ZodBoolean;
|
|
1358
|
+
quantity: z.ZodString;
|
|
1359
|
+
price: z.ZodString;
|
|
1360
|
+
filledQuantity: z.ZodString;
|
|
1361
|
+
filledPrice: z.ZodOptional<z.ZodString>;
|
|
1362
|
+
}, z.core.$strip>], "type">>>;
|
|
1363
|
+
intent: z.ZodLiteral<"REVERSE">;
|
|
1364
|
+
orderType: z.ZodLiteral<"MARKET">;
|
|
1365
|
+
position: z.ZodObject<{
|
|
1366
|
+
id: z.ZodUUID;
|
|
1367
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
1368
|
+
}, z.core.$strip>;
|
|
1369
|
+
}, z.core.$strip>], "intent">], "orderType">>;
|
|
1370
|
+
}, z.core.$strip>;
|
|
1099
1371
|
export type CreateTradeCloseAllResponse = z.output<typeof CreateTradeCloseAllResponse>;
|
package/dist/trade/responses.js
CHANGED
|
@@ -5,6 +5,6 @@ const CreateTradeOpenResponse = z.object({ execution: Execution });
|
|
|
5
5
|
const CreateTradeAdjustResponse = z.object({ execution: Execution });
|
|
6
6
|
const CreateTradeCloseResponse = z.object({ execution: Execution });
|
|
7
7
|
const CreateTradeReverseResponse = z.object({ execution: Execution });
|
|
8
|
-
const CreateTradeCloseAllResponse = z.object({});
|
|
8
|
+
const CreateTradeCloseAllResponse = z.object({ executions: z.array(Execution) });
|
|
9
9
|
|
|
10
10
|
export { CreateTradeAdjustResponse, CreateTradeCloseAllResponse, CreateTradeCloseResponse, CreateTradeOpenResponse, CreateTradeReverseResponse };
|
package/dist/users/entities.d.ts
CHANGED
|
@@ -12,6 +12,9 @@ export declare const UserProfile: z.ZodObject<{
|
|
|
12
12
|
address: z.ZodNullable<z.ZodString>;
|
|
13
13
|
email: z.ZodNullable<z.ZodString>;
|
|
14
14
|
emailVerified: z.ZodBoolean;
|
|
15
|
+
xHandle: z.ZodNullable<z.ZodString>;
|
|
16
|
+
xName: z.ZodNullable<z.ZodString>;
|
|
17
|
+
xAvatarUrl: z.ZodNullable<z.ZodString>;
|
|
15
18
|
}, z.core.$strip>;
|
|
16
19
|
export type UserPreferences = z.infer<typeof UserPreferences>;
|
|
17
20
|
export type UserProfile = z.infer<typeof UserProfile>;
|
package/dist/users/entities.js
CHANGED
|
@@ -10,7 +10,12 @@ const UserProfile = z.object({
|
|
|
10
10
|
role: z.enum(["basic", "pro"]).describe("User role"),
|
|
11
11
|
address: z.string().nullable().describe("Linked wallet address (for evm_wallet provider)"),
|
|
12
12
|
email: z.string().nullable().describe("Linked email address (for email provider)"),
|
|
13
|
-
emailVerified: z.boolean().describe("Whether the email is verified")
|
|
13
|
+
emailVerified: z.boolean().describe("Whether the email is verified"),
|
|
14
|
+
// Nullable rather than optional to match `address` and `email` above. Splitting
|
|
15
|
+
// conventions inside one object costs more than following its neighbours.
|
|
16
|
+
xHandle: z.string().nullable().describe('Linked X handle, without the leading "@" (for x provider)'),
|
|
17
|
+
xName: z.string().nullable().describe("Linked X display name"),
|
|
18
|
+
xAvatarUrl: z.string().nullable().describe("Linked X avatar URL")
|
|
14
19
|
}).describe("User profile of the authenticated user");
|
|
15
20
|
const ReferralReferee = z.object({
|
|
16
21
|
address: EthereumAddress.optional().describe("Linked EVM wallet address when the referee has one"),
|
package/dist/users/response.d.ts
CHANGED
|
@@ -10,6 +10,9 @@ export declare const ProfileResponse: z.ZodObject<{
|
|
|
10
10
|
address: z.ZodNullable<z.ZodString>;
|
|
11
11
|
email: z.ZodNullable<z.ZodString>;
|
|
12
12
|
emailVerified: z.ZodBoolean;
|
|
13
|
+
xHandle: z.ZodNullable<z.ZodString>;
|
|
14
|
+
xName: z.ZodNullable<z.ZodString>;
|
|
15
|
+
xAvatarUrl: z.ZodNullable<z.ZodString>;
|
|
13
16
|
}, z.core.$strip>;
|
|
14
17
|
preferences: z.ZodObject<{
|
|
15
18
|
slippageToleranceBps: z.ZodInt;
|