@pear-protocol/types 0.0.2 → 0.0.4
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 +1 -0
- package/dist/auth/entities.js +2 -1
- package/dist/auth/payloads.d.ts +9 -1
- package/dist/auth/payloads.js +10 -4
- package/dist/auth/response.d.ts +15 -14
- package/dist/auth/response.js +8 -5
- package/dist/connector/index.d.ts +22 -0
- package/dist/trade/payloads.d.ts +8 -0
- package/dist/trade-accounts/entities.d.ts +3 -2
- package/dist/trade-accounts/entities.js +3 -2
- package/dist/trade-accounts/response.d.ts +6 -4
- package/dist/trigger/entities/index.d.ts +45 -0
- package/dist/trigger/entities/index.js +6 -1
- package/dist/trigger/payloads/index.d.ts +12 -0
- package/dist/trigger/payloads/index.js +11 -2
- package/dist/trigger/responses.d.ts +24 -0
- package/dist/users/entities.d.ts +3 -2
- package/dist/users/entities.js +3 -2
- package/dist/users/response.d.ts +3 -2
- package/package.json +1 -1
package/dist/auth/entities.d.ts
CHANGED
package/dist/auth/entities.js
CHANGED
|
@@ -2,7 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
|
|
3
3
|
const AuthenticatedUser = z.object({
|
|
4
4
|
id: z.uuid().describe("User UUID"),
|
|
5
|
-
role: z.enum(["basic", "pro"]).describe("User role")
|
|
5
|
+
role: z.enum(["basic", "pro"]).describe("User role"),
|
|
6
|
+
address: z.string().nullable().describe("User address")
|
|
6
7
|
}).describe("Current authenticated user info");
|
|
7
8
|
|
|
8
9
|
export { AuthenticatedUser };
|
package/dist/auth/payloads.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export declare const EmailRegisterRequest: z.ZodObject<{
|
|
|
8
8
|
}, z.core.$strip>;
|
|
9
9
|
export declare const LinkEmailRequest: z.ZodObject<{
|
|
10
10
|
email: z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>;
|
|
11
|
-
password: z.ZodString;
|
|
12
11
|
}, z.core.$strip>;
|
|
13
12
|
export declare const LinkWalletRequest: z.ZodObject<{
|
|
14
13
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
@@ -24,6 +23,10 @@ export declare const EmailLoginRequest: z.ZodObject<{
|
|
|
24
23
|
email: z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>;
|
|
25
24
|
password: z.ZodString;
|
|
26
25
|
}, z.core.$strip>;
|
|
26
|
+
export declare const VerifyEmailRequest: z.ZodObject<{
|
|
27
|
+
token: z.ZodString;
|
|
28
|
+
password: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strip>;
|
|
27
30
|
export declare const LoginRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
28
31
|
method: z.ZodLiteral<"wallet">;
|
|
29
32
|
address: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
@@ -36,6 +39,9 @@ export declare const LoginRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
36
39
|
export declare const RefreshTokenRequest: z.ZodObject<{
|
|
37
40
|
refreshToken: z.ZodString;
|
|
38
41
|
}, z.core.$strip>;
|
|
42
|
+
export declare const ResendVerificationForRegisterRequest: z.ZodObject<{
|
|
43
|
+
email: z.ZodPipe<z.ZodEmail, z.ZodTransform<string, string>>;
|
|
44
|
+
}, z.core.$strip>;
|
|
39
45
|
export declare const LogoutRequest: z.ZodObject<{
|
|
40
46
|
refreshToken: z.ZodString;
|
|
41
47
|
}, z.core.$strip>;
|
|
@@ -48,3 +54,5 @@ export type EmailLoginRequest = z.infer<typeof EmailLoginRequest>;
|
|
|
48
54
|
export type LoginRequest = z.infer<typeof LoginRequest>;
|
|
49
55
|
export type RefreshTokenRequest = z.infer<typeof RefreshTokenRequest>;
|
|
50
56
|
export type LogoutRequest = z.infer<typeof LogoutRequest>;
|
|
57
|
+
export type VerifyEmailRequest = z.infer<typeof VerifyEmailRequest>;
|
|
58
|
+
export type ResendVerificationForRegisterRequest = z.infer<typeof ResendVerificationForRegisterRequest>;
|
package/dist/auth/payloads.js
CHANGED
|
@@ -11,9 +11,8 @@ const EmailRegisterRequest = z.object({
|
|
|
11
11
|
password: Password
|
|
12
12
|
}).describe("Email registration request");
|
|
13
13
|
const LinkEmailRequest = z.object({
|
|
14
|
-
email: Email
|
|
15
|
-
|
|
16
|
-
}).describe("Link email/password credentials to the authenticated account");
|
|
14
|
+
email: Email
|
|
15
|
+
}).describe("Link email credentials to the authenticated account");
|
|
17
16
|
const LinkWalletRequest = z.object({
|
|
18
17
|
address: EthereumAddress,
|
|
19
18
|
signature: z.string().min(1, "Signature is required").describe("Signature of the nonce message")
|
|
@@ -28,12 +27,19 @@ const EmailLoginRequest = z.object({
|
|
|
28
27
|
email: Email,
|
|
29
28
|
password: Password
|
|
30
29
|
}).describe("Email-based authentication using email and password");
|
|
30
|
+
const VerifyEmailRequest = z.object({
|
|
31
|
+
token: z.string().min(1, "Token is required").describe("Verification token"),
|
|
32
|
+
password: Password.optional().describe("Password for the email claim if using link-flow")
|
|
33
|
+
}).describe("Verify email claim using the token from the verification email");
|
|
31
34
|
const LoginRequest = z.discriminatedUnion("method", [WalletLoginRequest, EmailLoginRequest]);
|
|
32
35
|
const RefreshTokenRequest = z.object({
|
|
33
36
|
refreshToken: z.string().min(1, "Refresh token is required").describe("Refresh token")
|
|
34
37
|
}).describe("Refresh token request");
|
|
38
|
+
const ResendVerificationForRegisterRequest = z.object({
|
|
39
|
+
email: Email
|
|
40
|
+
}).describe("Resend verification email by email address (unauthenticated)");
|
|
35
41
|
const LogoutRequest = z.object({
|
|
36
42
|
refreshToken: z.string().min(1, "Refresh token is required").describe("Refresh token to revoke")
|
|
37
43
|
}).describe("Logout and revoke refresh token");
|
|
38
44
|
|
|
39
|
-
export { EmailLoginRequest, EmailRegisterRequest, LinkEmailRequest, LinkWalletRequest, LoginRequest, LogoutRequest, RefreshTokenRequest, RequestNonceRequest, WalletLoginRequest };
|
|
45
|
+
export { EmailLoginRequest, EmailRegisterRequest, LinkEmailRequest, LinkWalletRequest, LoginRequest, LogoutRequest, RefreshTokenRequest, RequestNonceRequest, ResendVerificationForRegisterRequest, VerifyEmailRequest, WalletLoginRequest };
|
package/dist/auth/response.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare const LoginResponse: z.ZodObject<{
|
|
|
6
6
|
basic: "basic";
|
|
7
7
|
pro: "pro";
|
|
8
8
|
}>;
|
|
9
|
+
address: z.ZodNullable<z.ZodString>;
|
|
9
10
|
}, z.core.$strip>;
|
|
10
11
|
}, z.core.$strip>;
|
|
11
12
|
export declare const RefreshTokenResponse: z.ZodObject<{
|
|
@@ -14,24 +15,20 @@ export declare const RefreshTokenResponse: z.ZodObject<{
|
|
|
14
15
|
tokenType: z.ZodLiteral<"Bearer">;
|
|
15
16
|
expiresIn: z.ZodNumber;
|
|
16
17
|
}, z.core.$strip>;
|
|
17
|
-
export declare const RefreshSessionResponse: z.
|
|
18
|
-
export declare const LogoutResponse: z.
|
|
19
|
-
export declare const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
pro: "pro";
|
|
25
|
-
}>;
|
|
26
|
-
}, z.core.$strip>;
|
|
27
|
-
}, z.core.$strip>;
|
|
28
|
-
export declare const LinkResponse: z.ZodObject<{
|
|
18
|
+
export declare const RefreshSessionResponse: z.ZodVoid;
|
|
19
|
+
export declare const LogoutResponse: z.ZodVoid;
|
|
20
|
+
export declare const RegisterEmailResponse: z.ZodVoid;
|
|
21
|
+
export declare const VerifyEmailResponse: z.ZodVoid;
|
|
22
|
+
export declare const ResendVerificationResponse: z.ZodVoid;
|
|
23
|
+
export declare const LinkEmailResponse: z.ZodVoid;
|
|
24
|
+
export declare const LinkWalletResponse: z.ZodObject<{
|
|
29
25
|
user: z.ZodObject<{
|
|
30
26
|
id: z.ZodUUID;
|
|
31
27
|
role: z.ZodEnum<{
|
|
32
28
|
basic: "basic";
|
|
33
29
|
pro: "pro";
|
|
34
30
|
}>;
|
|
31
|
+
address: z.ZodNullable<z.ZodString>;
|
|
35
32
|
}, z.core.$strip>;
|
|
36
33
|
}, z.core.$strip>;
|
|
37
34
|
export declare const RequestNonceResponse: z.ZodObject<{
|
|
@@ -44,12 +41,16 @@ export declare const MeResponse: z.ZodObject<{
|
|
|
44
41
|
basic: "basic";
|
|
45
42
|
pro: "pro";
|
|
46
43
|
}>;
|
|
44
|
+
address: z.ZodNullable<z.ZodString>;
|
|
47
45
|
}, z.core.$strip>;
|
|
48
46
|
export type RequestNonceResponse = z.infer<typeof RequestNonceResponse>;
|
|
49
47
|
export type LoginResponse = z.infer<typeof LoginResponse>;
|
|
50
48
|
export type RefreshSessionResponse = z.infer<typeof RefreshSessionResponse>;
|
|
51
49
|
export type RefreshTokenResponse = z.infer<typeof RefreshTokenResponse>;
|
|
52
50
|
export type LogoutResponse = z.infer<typeof LogoutResponse>;
|
|
53
|
-
export type
|
|
54
|
-
export type
|
|
51
|
+
export type RegisterEmailResponse = z.infer<typeof RegisterEmailResponse>;
|
|
52
|
+
export type LinkEmailResponse = z.infer<typeof LinkEmailResponse>;
|
|
53
|
+
export type LinkWalletResponse = z.infer<typeof LinkWalletResponse>;
|
|
55
54
|
export type MeResponse = z.infer<typeof MeResponse>;
|
|
55
|
+
export type ResendVerificationResponse = z.infer<typeof ResendVerificationResponse>;
|
|
56
|
+
export type VerifyEmailResponse = z.infer<typeof VerifyEmailResponse>;
|
package/dist/auth/response.js
CHANGED
|
@@ -8,14 +8,17 @@ const RefreshTokenResponse = z.object({
|
|
|
8
8
|
tokenType: z.literal("Bearer").describe('Token type (always "Bearer")'),
|
|
9
9
|
expiresIn: z.number().int().positive().describe("Access token expiry time in seconds")
|
|
10
10
|
}).describe("Successful token refresh response");
|
|
11
|
-
const RefreshSessionResponse = z.
|
|
12
|
-
const LogoutResponse = z.
|
|
13
|
-
const
|
|
14
|
-
const
|
|
11
|
+
const RefreshSessionResponse = z.void().describe("Successful session refresh response");
|
|
12
|
+
const LogoutResponse = z.void().describe("Successful logout response");
|
|
13
|
+
const RegisterEmailResponse = z.void().describe("Successful email registration response");
|
|
14
|
+
const VerifyEmailResponse = z.void().describe("Successful email verification response");
|
|
15
|
+
const ResendVerificationResponse = z.void().describe("Successful resend verification email response");
|
|
16
|
+
const LinkEmailResponse = z.void().describe("Successful email verification response");
|
|
17
|
+
const LinkWalletResponse = z.object({ user: AuthenticatedUser }).describe("Successful link response");
|
|
15
18
|
const RequestNonceResponse = z.object({
|
|
16
19
|
nonce: z.string().describe("Nonce to sign with wallet"),
|
|
17
20
|
expiresAt: z.number().int().positive().describe("Unix timestamp when nonce expires")
|
|
18
21
|
}).describe("Nonce response for wallet authentication");
|
|
19
22
|
const MeResponse = AuthenticatedUser.describe("Current authenticated user info");
|
|
20
23
|
|
|
21
|
-
export {
|
|
24
|
+
export { LinkEmailResponse, LinkWalletResponse, LoginResponse, LogoutResponse, MeResponse, RefreshSessionResponse, RefreshTokenResponse, RegisterEmailResponse, RequestNonceResponse, ResendVerificationResponse, VerifyEmailResponse };
|
|
@@ -6,3 +6,25 @@ export declare const Connector: z.ZodEnum<{
|
|
|
6
6
|
okx: "okx";
|
|
7
7
|
}>;
|
|
8
8
|
export type Connector = z.infer<typeof Connector>;
|
|
9
|
+
export type HyperliquidCredentialsDTO = {
|
|
10
|
+
signer_key: `0x${string}`;
|
|
11
|
+
};
|
|
12
|
+
export type BinanceUSDMCredentialsDTO = {
|
|
13
|
+
api_key: string;
|
|
14
|
+
api_secret: string;
|
|
15
|
+
};
|
|
16
|
+
export type BybitCredentialsDTO = {
|
|
17
|
+
api_key: string;
|
|
18
|
+
api_secret: string;
|
|
19
|
+
};
|
|
20
|
+
export type OkxCredentialsDTO = {
|
|
21
|
+
api_key: string;
|
|
22
|
+
api_secret: string;
|
|
23
|
+
api_pass: string;
|
|
24
|
+
};
|
|
25
|
+
export type ConnectorCredentialsDTO = {
|
|
26
|
+
hyperliquid: HyperliquidCredentialsDTO;
|
|
27
|
+
binanceusdm: BinanceUSDMCredentialsDTO;
|
|
28
|
+
bybit: BybitCredentialsDTO;
|
|
29
|
+
okx: OkxCredentialsDTO;
|
|
30
|
+
};
|
package/dist/trade/payloads.d.ts
CHANGED
|
@@ -67,6 +67,10 @@ export declare const CreateMarketOpen: z.ZodObject<{
|
|
|
67
67
|
threshold_bps: z.ZodNumber;
|
|
68
68
|
}, z.core.$strip>;
|
|
69
69
|
}, z.core.$strip>], "type">;
|
|
70
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
71
|
+
STOP_LOSS: "STOP_LOSS";
|
|
72
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
73
|
+
}>>;
|
|
70
74
|
}, z.core.$strip>>;
|
|
71
75
|
}, z.core.$strip>;
|
|
72
76
|
export declare const CreateMarketAdjust: z.ZodObject<{
|
|
@@ -171,6 +175,10 @@ export declare const CreateTradeOpen: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
171
175
|
threshold_bps: z.ZodNumber;
|
|
172
176
|
}, z.core.$strip>;
|
|
173
177
|
}, z.core.$strip>], "type">;
|
|
178
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
179
|
+
STOP_LOSS: "STOP_LOSS";
|
|
180
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
181
|
+
}>>;
|
|
174
182
|
}, z.core.$strip>>;
|
|
175
183
|
}, z.core.$strip>], "type">;
|
|
176
184
|
export declare const CreateTradeAdjust: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -20,8 +20,9 @@ export declare const TradeAccount: z.ZodObject<{
|
|
|
20
20
|
agentWalletAddress: z.ZodString;
|
|
21
21
|
isSubaccount: z.ZodBoolean;
|
|
22
22
|
}, z.core.$strip>]>>;
|
|
23
|
-
createdAt: z.
|
|
24
|
-
updatedAt: z.
|
|
23
|
+
createdAt: z.ZodISODate;
|
|
24
|
+
updatedAt: z.ZodISODate;
|
|
25
|
+
deletedAt: z.ZodOptional<z.ZodISODate>;
|
|
25
26
|
}, z.core.$strip>;
|
|
26
27
|
export type TradeAccount = z.infer<typeof TradeAccount>;
|
|
27
28
|
export type HyperliquidMetadata = z.infer<typeof HyperliquidMetadata>;
|
|
@@ -12,8 +12,9 @@ const TradeAccount = z.object({
|
|
|
12
12
|
connector: Connector.describe("Exchange connector type"),
|
|
13
13
|
exchangeIdentifier: z.string().describe("User identifier on the exchange"),
|
|
14
14
|
metadata: ConnectorMetadata.describe("Connector-specific metadata"),
|
|
15
|
-
createdAt: z.
|
|
16
|
-
updatedAt: z.
|
|
15
|
+
createdAt: z.iso.date().describe("Creation timestamp (ISO 8601)"),
|
|
16
|
+
updatedAt: z.iso.date().describe("Last update timestamp (ISO 8601)"),
|
|
17
|
+
deletedAt: z.iso.date().describe("Deletion timestamp (ISO 8601)").optional()
|
|
17
18
|
});
|
|
18
19
|
|
|
19
20
|
export { TradeAccount };
|
|
@@ -14,8 +14,9 @@ export declare const TradeAccountResponse: z.ZodObject<{
|
|
|
14
14
|
agentWalletAddress: z.ZodString;
|
|
15
15
|
isSubaccount: z.ZodBoolean;
|
|
16
16
|
}, z.core.$strip>]>>;
|
|
17
|
-
createdAt: z.
|
|
18
|
-
updatedAt: z.
|
|
17
|
+
createdAt: z.ZodISODate;
|
|
18
|
+
updatedAt: z.ZodISODate;
|
|
19
|
+
deletedAt: z.ZodOptional<z.ZodISODate>;
|
|
19
20
|
}, z.core.$strip>;
|
|
20
21
|
}, z.core.$strip>;
|
|
21
22
|
export type TradeAccountResponse = z.infer<typeof TradeAccountResponse>;
|
|
@@ -34,8 +35,9 @@ export declare const TradeAccountListResponse: z.ZodObject<{
|
|
|
34
35
|
agentWalletAddress: z.ZodString;
|
|
35
36
|
isSubaccount: z.ZodBoolean;
|
|
36
37
|
}, z.core.$strip>]>>;
|
|
37
|
-
createdAt: z.
|
|
38
|
-
updatedAt: z.
|
|
38
|
+
createdAt: z.ZodISODate;
|
|
39
|
+
updatedAt: z.ZodISODate;
|
|
40
|
+
deletedAt: z.ZodOptional<z.ZodISODate>;
|
|
39
41
|
}, z.core.$strip>>;
|
|
40
42
|
}, z.core.$strip>;
|
|
41
43
|
export type TradeAccountListResponse = z.infer<typeof TradeAccountListResponse>;
|
|
@@ -16,6 +16,11 @@ export declare const TriggerCancelledReason: z.ZodEnum<{
|
|
|
16
16
|
SYSTEM: "SYSTEM";
|
|
17
17
|
}>;
|
|
18
18
|
export type TriggerCancelledReason = z.infer<typeof TriggerCancelledReason>;
|
|
19
|
+
export declare const BracketType: z.ZodEnum<{
|
|
20
|
+
STOP_LOSS: "STOP_LOSS";
|
|
21
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
22
|
+
}>;
|
|
23
|
+
export type BracketType = z.infer<typeof BracketType>;
|
|
19
24
|
declare const BaseTrigger: z.ZodObject<{
|
|
20
25
|
id: z.ZodUUID;
|
|
21
26
|
tradeAccountId: z.ZodUUID;
|
|
@@ -60,6 +65,10 @@ declare const BaseTrigger: z.ZodObject<{
|
|
|
60
65
|
fee: z.ZodOptional<z.ZodString>;
|
|
61
66
|
timestamp: z.ZodString;
|
|
62
67
|
}, z.core.$strip>>>;
|
|
68
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
69
|
+
STOP_LOSS: "STOP_LOSS";
|
|
70
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
71
|
+
}>>;
|
|
63
72
|
createdAt: z.ZodString;
|
|
64
73
|
updatedAt: z.ZodString;
|
|
65
74
|
}, z.core.$strip>;
|
|
@@ -107,6 +116,10 @@ export declare const TriggerMarketOpen: z.ZodObject<{
|
|
|
107
116
|
fee: z.ZodOptional<z.ZodString>;
|
|
108
117
|
timestamp: z.ZodString;
|
|
109
118
|
}, z.core.$strip>>>;
|
|
119
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
120
|
+
STOP_LOSS: "STOP_LOSS";
|
|
121
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
122
|
+
}>>;
|
|
110
123
|
createdAt: z.ZodString;
|
|
111
124
|
updatedAt: z.ZodString;
|
|
112
125
|
intent: z.ZodLiteral<"OPEN">;
|
|
@@ -250,6 +263,10 @@ export declare const TriggerMarketAdjust: z.ZodObject<{
|
|
|
250
263
|
fee: z.ZodOptional<z.ZodString>;
|
|
251
264
|
timestamp: z.ZodString;
|
|
252
265
|
}, z.core.$strip>>>;
|
|
266
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
267
|
+
STOP_LOSS: "STOP_LOSS";
|
|
268
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
269
|
+
}>>;
|
|
253
270
|
createdAt: z.ZodString;
|
|
254
271
|
updatedAt: z.ZodString;
|
|
255
272
|
intent: z.ZodLiteral<"ADJUST">;
|
|
@@ -438,6 +455,10 @@ export declare const TriggerMarketClose: z.ZodObject<{
|
|
|
438
455
|
fee: z.ZodOptional<z.ZodString>;
|
|
439
456
|
timestamp: z.ZodString;
|
|
440
457
|
}, z.core.$strip>>>;
|
|
458
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
459
|
+
STOP_LOSS: "STOP_LOSS";
|
|
460
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
461
|
+
}>>;
|
|
441
462
|
createdAt: z.ZodString;
|
|
442
463
|
updatedAt: z.ZodString;
|
|
443
464
|
intent: z.ZodLiteral<"CLOSE">;
|
|
@@ -601,6 +622,10 @@ export declare const TriggerMarket: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
601
622
|
fee: z.ZodOptional<z.ZodString>;
|
|
602
623
|
timestamp: z.ZodString;
|
|
603
624
|
}, z.core.$strip>>>;
|
|
625
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
626
|
+
STOP_LOSS: "STOP_LOSS";
|
|
627
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
628
|
+
}>>;
|
|
604
629
|
createdAt: z.ZodString;
|
|
605
630
|
updatedAt: z.ZodString;
|
|
606
631
|
intent: z.ZodLiteral<"OPEN">;
|
|
@@ -743,6 +768,10 @@ export declare const TriggerMarket: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
743
768
|
fee: z.ZodOptional<z.ZodString>;
|
|
744
769
|
timestamp: z.ZodString;
|
|
745
770
|
}, z.core.$strip>>>;
|
|
771
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
772
|
+
STOP_LOSS: "STOP_LOSS";
|
|
773
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
774
|
+
}>>;
|
|
746
775
|
createdAt: z.ZodString;
|
|
747
776
|
updatedAt: z.ZodString;
|
|
748
777
|
intent: z.ZodLiteral<"ADJUST">;
|
|
@@ -930,6 +959,10 @@ export declare const TriggerMarket: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
930
959
|
fee: z.ZodOptional<z.ZodString>;
|
|
931
960
|
timestamp: z.ZodString;
|
|
932
961
|
}, z.core.$strip>>>;
|
|
962
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
963
|
+
STOP_LOSS: "STOP_LOSS";
|
|
964
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
965
|
+
}>>;
|
|
933
966
|
createdAt: z.ZodString;
|
|
934
967
|
updatedAt: z.ZodString;
|
|
935
968
|
intent: z.ZodLiteral<"CLOSE">;
|
|
@@ -1093,6 +1126,10 @@ export declare const Trigger: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[
|
|
|
1093
1126
|
fee: z.ZodOptional<z.ZodString>;
|
|
1094
1127
|
timestamp: z.ZodString;
|
|
1095
1128
|
}, z.core.$strip>>>;
|
|
1129
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
1130
|
+
STOP_LOSS: "STOP_LOSS";
|
|
1131
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
1132
|
+
}>>;
|
|
1096
1133
|
createdAt: z.ZodString;
|
|
1097
1134
|
updatedAt: z.ZodString;
|
|
1098
1135
|
intent: z.ZodLiteral<"OPEN">;
|
|
@@ -1235,6 +1272,10 @@ export declare const Trigger: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[
|
|
|
1235
1272
|
fee: z.ZodOptional<z.ZodString>;
|
|
1236
1273
|
timestamp: z.ZodString;
|
|
1237
1274
|
}, z.core.$strip>>>;
|
|
1275
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
1276
|
+
STOP_LOSS: "STOP_LOSS";
|
|
1277
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
1278
|
+
}>>;
|
|
1238
1279
|
createdAt: z.ZodString;
|
|
1239
1280
|
updatedAt: z.ZodString;
|
|
1240
1281
|
intent: z.ZodLiteral<"ADJUST">;
|
|
@@ -1422,6 +1463,10 @@ export declare const Trigger: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[
|
|
|
1422
1463
|
fee: z.ZodOptional<z.ZodString>;
|
|
1423
1464
|
timestamp: z.ZodString;
|
|
1424
1465
|
}, z.core.$strip>>>;
|
|
1466
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
1467
|
+
STOP_LOSS: "STOP_LOSS";
|
|
1468
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
1469
|
+
}>>;
|
|
1425
1470
|
createdAt: z.ZodString;
|
|
1426
1471
|
updatedAt: z.ZodString;
|
|
1427
1472
|
intent: z.ZodLiteral<"CLOSE">;
|
|
@@ -7,6 +7,7 @@ import { TriggerConditionOpen, TriggerConditionAdjust, TriggerConditionClose } f
|
|
|
7
7
|
const TriggerIntent = z.enum(["OPEN", "CLOSE"]);
|
|
8
8
|
const TriggerStatus = z.enum(["ACTIVE", "TRIGGERED", "CANCELLED"]);
|
|
9
9
|
const TriggerCancelledReason = z.enum(["POSITION_CLOSED", "USER", "SYSTEM"]);
|
|
10
|
+
const BracketType = z.enum(["STOP_LOSS", "TAKE_PROFIT"]);
|
|
10
11
|
const BaseTrigger = z.object({
|
|
11
12
|
/**
|
|
12
13
|
* Trigger UUID
|
|
@@ -40,6 +41,10 @@ const BaseTrigger = z.object({
|
|
|
40
41
|
* Fills for the trigger
|
|
41
42
|
*/
|
|
42
43
|
fills: z.array(Fill).optional(),
|
|
44
|
+
/**
|
|
45
|
+
* Optional: bracket type for CLOSE triggers (stop loss / take profit)
|
|
46
|
+
*/
|
|
47
|
+
bracketType: BracketType.optional(),
|
|
43
48
|
/**
|
|
44
49
|
* Created at timestamp
|
|
45
50
|
*/
|
|
@@ -120,4 +125,4 @@ const TriggerMarket = z.discriminatedUnion("intent", [
|
|
|
120
125
|
]);
|
|
121
126
|
const Trigger = z.discriminatedUnion("type", [TriggerMarket]);
|
|
122
127
|
|
|
123
|
-
export { Trigger, TriggerCancelledReason, TriggerIntent, TriggerMarket, TriggerMarketAdjust, TriggerMarketClose, TriggerMarketOpen, TriggerStatus };
|
|
128
|
+
export { BracketType, Trigger, TriggerCancelledReason, TriggerIntent, TriggerMarket, TriggerMarketAdjust, TriggerMarketClose, TriggerMarketOpen, TriggerStatus };
|
|
@@ -208,6 +208,10 @@ export declare const CreateTriggerMarketClose: z.ZodObject<{
|
|
|
208
208
|
}, z.core.$strip>;
|
|
209
209
|
}, z.core.$strip>], "type">;
|
|
210
210
|
positionId: z.ZodUUID;
|
|
211
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
212
|
+
STOP_LOSS: "STOP_LOSS";
|
|
213
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
214
|
+
}>>;
|
|
211
215
|
}, z.core.$strip>;
|
|
212
216
|
export declare const AttachTriggerMarketClose: z.ZodObject<{
|
|
213
217
|
intent: z.ZodLiteral<"CLOSE">;
|
|
@@ -252,6 +256,10 @@ export declare const AttachTriggerMarketClose: z.ZodObject<{
|
|
|
252
256
|
threshold_bps: z.ZodNumber;
|
|
253
257
|
}, z.core.$strip>;
|
|
254
258
|
}, z.core.$strip>], "type">;
|
|
259
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
260
|
+
STOP_LOSS: "STOP_LOSS";
|
|
261
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
262
|
+
}>>;
|
|
255
263
|
}, z.core.$strip>;
|
|
256
264
|
export declare const CreateTriggerOpen: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
257
265
|
intent: z.ZodLiteral<"OPEN">;
|
|
@@ -462,6 +470,10 @@ export declare const CreateTriggerClose: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
462
470
|
}, z.core.$strip>;
|
|
463
471
|
}, z.core.$strip>], "type">;
|
|
464
472
|
positionId: z.ZodUUID;
|
|
473
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
474
|
+
STOP_LOSS: "STOP_LOSS";
|
|
475
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
476
|
+
}>>;
|
|
465
477
|
}, z.core.$strip>], "type">;
|
|
466
478
|
export type CreateTriggerMarketOpen = z.output<typeof CreateTriggerMarketOpen>;
|
|
467
479
|
export type CreateTriggerMarketClose = z.output<typeof CreateTriggerMarketClose>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { RefineMinimumOneSymbol, RefineUniqueSymbols } from '../../common/refinement';
|
|
3
3
|
import { TradeLegPostOnly } from '../../common/trade-legs';
|
|
4
|
+
import { BracketType } from '../entities';
|
|
4
5
|
import { CreateTriggerConditionOpen, CreateTriggerConditionClose, CreateTriggerConditionAttach } from './conditions';
|
|
5
6
|
|
|
6
7
|
const CreateTriggerMarketOpen = z.object({
|
|
@@ -31,7 +32,11 @@ const CreateTriggerMarketClose = z.object({
|
|
|
31
32
|
/**
|
|
32
33
|
* Position UUID
|
|
33
34
|
*/
|
|
34
|
-
positionId: z.uuid()
|
|
35
|
+
positionId: z.uuid(),
|
|
36
|
+
/**
|
|
37
|
+
* Optional: bracket type (stop loss / take profit)
|
|
38
|
+
*/
|
|
39
|
+
bracketType: BracketType.optional()
|
|
35
40
|
});
|
|
36
41
|
const AttachTriggerMarketClose = z.object({
|
|
37
42
|
intent: z.literal("CLOSE"),
|
|
@@ -39,7 +44,11 @@ const AttachTriggerMarketClose = z.object({
|
|
|
39
44
|
/**
|
|
40
45
|
* Condition to fire the trigger
|
|
41
46
|
*/
|
|
42
|
-
condition: CreateTriggerConditionAttach
|
|
47
|
+
condition: CreateTriggerConditionAttach,
|
|
48
|
+
/**
|
|
49
|
+
* Optional: bracket type (stop loss / take profit)
|
|
50
|
+
*/
|
|
51
|
+
bracketType: BracketType.optional()
|
|
43
52
|
});
|
|
44
53
|
const CreateTriggerOpen = z.discriminatedUnion("type", [CreateTriggerMarketOpen]);
|
|
45
54
|
const CreateTriggerClose = z.discriminatedUnion("type", [CreateTriggerMarketClose]);
|
|
@@ -46,6 +46,10 @@ export declare const TriggerListResponse: z.ZodObject<{
|
|
|
46
46
|
fee: z.ZodOptional<z.ZodString>;
|
|
47
47
|
timestamp: z.ZodString;
|
|
48
48
|
}, z.core.$strip>>>;
|
|
49
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
50
|
+
STOP_LOSS: "STOP_LOSS";
|
|
51
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
52
|
+
}>>;
|
|
49
53
|
createdAt: z.ZodString;
|
|
50
54
|
updatedAt: z.ZodString;
|
|
51
55
|
intent: z.ZodLiteral<"OPEN">;
|
|
@@ -188,6 +192,10 @@ export declare const TriggerListResponse: z.ZodObject<{
|
|
|
188
192
|
fee: z.ZodOptional<z.ZodString>;
|
|
189
193
|
timestamp: z.ZodString;
|
|
190
194
|
}, z.core.$strip>>>;
|
|
195
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
196
|
+
STOP_LOSS: "STOP_LOSS";
|
|
197
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
198
|
+
}>>;
|
|
191
199
|
createdAt: z.ZodString;
|
|
192
200
|
updatedAt: z.ZodString;
|
|
193
201
|
intent: z.ZodLiteral<"ADJUST">;
|
|
@@ -375,6 +383,10 @@ export declare const TriggerListResponse: z.ZodObject<{
|
|
|
375
383
|
fee: z.ZodOptional<z.ZodString>;
|
|
376
384
|
timestamp: z.ZodString;
|
|
377
385
|
}, z.core.$strip>>>;
|
|
386
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
387
|
+
STOP_LOSS: "STOP_LOSS";
|
|
388
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
389
|
+
}>>;
|
|
378
390
|
createdAt: z.ZodString;
|
|
379
391
|
updatedAt: z.ZodString;
|
|
380
392
|
intent: z.ZodLiteral<"CLOSE">;
|
|
@@ -541,6 +553,10 @@ export declare const CreateTriggerResponse: z.ZodObject<{
|
|
|
541
553
|
fee: z.ZodOptional<z.ZodString>;
|
|
542
554
|
timestamp: z.ZodString;
|
|
543
555
|
}, z.core.$strip>>>;
|
|
556
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
557
|
+
STOP_LOSS: "STOP_LOSS";
|
|
558
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
559
|
+
}>>;
|
|
544
560
|
createdAt: z.ZodString;
|
|
545
561
|
updatedAt: z.ZodString;
|
|
546
562
|
intent: z.ZodLiteral<"OPEN">;
|
|
@@ -683,6 +699,10 @@ export declare const CreateTriggerResponse: z.ZodObject<{
|
|
|
683
699
|
fee: z.ZodOptional<z.ZodString>;
|
|
684
700
|
timestamp: z.ZodString;
|
|
685
701
|
}, z.core.$strip>>>;
|
|
702
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
703
|
+
STOP_LOSS: "STOP_LOSS";
|
|
704
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
705
|
+
}>>;
|
|
686
706
|
createdAt: z.ZodString;
|
|
687
707
|
updatedAt: z.ZodString;
|
|
688
708
|
intent: z.ZodLiteral<"ADJUST">;
|
|
@@ -870,6 +890,10 @@ export declare const CreateTriggerResponse: z.ZodObject<{
|
|
|
870
890
|
fee: z.ZodOptional<z.ZodString>;
|
|
871
891
|
timestamp: z.ZodString;
|
|
872
892
|
}, z.core.$strip>>>;
|
|
893
|
+
bracketType: z.ZodOptional<z.ZodEnum<{
|
|
894
|
+
STOP_LOSS: "STOP_LOSS";
|
|
895
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
896
|
+
}>>;
|
|
873
897
|
createdAt: z.ZodString;
|
|
874
898
|
updatedAt: z.ZodString;
|
|
875
899
|
intent: z.ZodLiteral<"CLOSE">;
|
package/dist/users/entities.d.ts
CHANGED
|
@@ -9,8 +9,9 @@ export declare const UserProfile: z.ZodObject<{
|
|
|
9
9
|
basic: "basic";
|
|
10
10
|
pro: "pro";
|
|
11
11
|
}>;
|
|
12
|
-
address: z.
|
|
13
|
-
email: z.
|
|
12
|
+
address: z.ZodNullable<z.ZodString>;
|
|
13
|
+
email: z.ZodNullable<z.ZodString>;
|
|
14
|
+
emailVerified: z.ZodBoolean;
|
|
14
15
|
}, z.core.$strip>;
|
|
15
16
|
export type UserPreferences = z.infer<typeof UserPreferences>;
|
|
16
17
|
export type UserProfile = z.infer<typeof UserProfile>;
|
package/dist/users/entities.js
CHANGED
|
@@ -7,8 +7,9 @@ const UserProfile = z.object({
|
|
|
7
7
|
id: z.uuid().describe("User UUID"),
|
|
8
8
|
displayName: z.string().describe("Public display name"),
|
|
9
9
|
role: z.enum(["basic", "pro"]).describe("User role"),
|
|
10
|
-
address: z.string().
|
|
11
|
-
email: z.string().
|
|
10
|
+
address: z.string().nullable().describe("Linked wallet address (for evm_wallet provider)"),
|
|
11
|
+
email: z.string().nullable().describe("Linked email address (for email provider)"),
|
|
12
|
+
emailVerified: z.boolean().describe("Whether the email is verified")
|
|
12
13
|
}).describe("User profile of the authenticated user");
|
|
13
14
|
|
|
14
15
|
export { UserPreferences, UserProfile };
|
package/dist/users/response.d.ts
CHANGED
|
@@ -7,8 +7,9 @@ export declare const ProfileResponse: z.ZodObject<{
|
|
|
7
7
|
basic: "basic";
|
|
8
8
|
pro: "pro";
|
|
9
9
|
}>;
|
|
10
|
-
address: z.
|
|
11
|
-
email: z.
|
|
10
|
+
address: z.ZodNullable<z.ZodString>;
|
|
11
|
+
email: z.ZodNullable<z.ZodString>;
|
|
12
|
+
emailVerified: z.ZodBoolean;
|
|
12
13
|
}, z.core.$strip>;
|
|
13
14
|
preferences: z.ZodObject<{
|
|
14
15
|
slippageToleranceBps: z.ZodInt;
|