@pear-protocol/types 0.0.15 → 0.0.17
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 +10 -1
- package/dist/auth/entities.js +4 -2
- package/dist/auth/response.d.ts +13 -12
- package/dist/auth/response.js +6 -2
- package/dist/bundle.d.ts +1 -0
- package/dist/bundle.js +1 -0
- package/dist/common/address.d.ts +3 -0
- package/dist/common/address.js +5 -0
- package/dist/common/hex-string.d.ts +3 -0
- package/dist/common/hex-string.js +5 -0
- package/dist/common/refinement.d.ts +1 -0
- package/dist/common/refinement.js +9 -1
- package/dist/common/request.js +1 -1
- package/dist/common/schema.d.ts +1 -1
- package/dist/common/schema.js +1 -1
- package/dist/connector/index.d.ts +4 -1
- package/dist/execution/entities.d.ts +6 -6
- package/dist/execution/responses.d.ts +2 -2
- package/dist/fill/entities.d.ts +20 -2
- package/dist/fill/entities.js +30 -5
- package/dist/fill/queries.d.ts +1 -0
- package/dist/fill/queries.js +3 -3
- package/dist/fill/responses.d.ts +44 -4
- package/dist/fill/responses.js +10 -1
- package/dist/instrument/responses.d.ts +4 -0
- package/dist/instrument/responses.js +5 -2
- package/dist/misc/index.d.ts +3 -1
- package/dist/misc/index.js +2 -1
- package/dist/misc/payloads.d.ts +33 -0
- package/dist/misc/payloads.js +31 -0
- package/dist/misc/responses.d.ts +26 -0
- package/dist/misc/responses.js +24 -0
- package/dist/position/entities.d.ts +5 -5
- package/dist/position/responses.d.ts +32 -2
- package/dist/position/responses.js +13 -1
- package/dist/schedule/entities.d.ts +82 -16
- package/dist/schedule/entities.js +5 -5
- package/dist/schedule/payloads.d.ts +4 -4
- package/dist/schedule/payloads.js +7 -7
- package/dist/schedule/responses.d.ts +66 -14
- package/dist/statistics/entities.d.ts +10 -3
- package/dist/statistics/entities.js +9 -3
- package/dist/statistics/queries.d.ts +26 -3
- package/dist/statistics/queries.js +11 -2
- package/dist/statistics/responses.d.ts +12 -3
- package/dist/statistics/responses.js +7 -4
- package/dist/sync/index.d.ts +2 -0
- package/dist/sync/index.js +2 -0
- package/dist/sync/payloads.d.ts +279 -0
- package/dist/sync/payloads.js +78 -0
- package/dist/sync/responses.d.ts +10 -0
- package/dist/sync/responses.js +11 -0
- package/dist/trade/payloads.d.ts +14 -4
- package/dist/trade/responses.d.ts +8 -8
- package/dist/trade-accounts/entities.d.ts +6 -0
- package/dist/trade-accounts/entities.js +4 -1
- package/dist/trade-accounts/payloads.d.ts +46 -10
- package/dist/trade-accounts/payloads.js +30 -6
- package/dist/trade-accounts/response.d.ts +10 -0
- package/dist/trade-accounts/response.js +9 -1
- package/dist/trigger/entities/index.d.ts +216 -46
- package/dist/trigger/entities/index.js +35 -9
- package/dist/trigger/payloads/index.d.ts +21 -6
- package/dist/trigger/payloads/index.js +24 -7
- package/dist/trigger/responses.d.ts +128 -28
- package/package.json +2 -2
package/dist/auth/entities.d.ts
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const LoginMethod: z.ZodEnum<{
|
|
3
|
+
email: "email";
|
|
4
|
+
evm_wallet: "evm_wallet";
|
|
5
|
+
}>;
|
|
2
6
|
export declare const AuthenticatedUser: z.ZodObject<{
|
|
3
7
|
id: z.ZodUUID;
|
|
4
8
|
role: z.ZodEnum<{
|
|
5
9
|
basic: "basic";
|
|
6
10
|
pro: "pro";
|
|
7
11
|
}>;
|
|
8
|
-
|
|
12
|
+
providerId: z.ZodNullable<z.ZodString>;
|
|
13
|
+
loginMethod: z.ZodEnum<{
|
|
14
|
+
email: "email";
|
|
15
|
+
evm_wallet: "evm_wallet";
|
|
16
|
+
}>;
|
|
9
17
|
}, z.core.$strip>;
|
|
18
|
+
export type LoginMethod = z.infer<typeof LoginMethod>;
|
|
10
19
|
export type AuthenticatedUser = z.infer<typeof AuthenticatedUser>;
|
package/dist/auth/entities.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
+
const LoginMethod = z.enum(["email", "evm_wallet"]).describe("Authentication provider used for the current session");
|
|
3
4
|
const AuthenticatedUser = z.object({
|
|
4
5
|
id: z.uuid().describe("User UUID"),
|
|
5
6
|
role: z.enum(["basic", "pro"]).describe("User role"),
|
|
6
|
-
|
|
7
|
+
providerId: z.string().nullable().describe("Provider identifier (wallet address or email)"),
|
|
8
|
+
loginMethod: LoginMethod.describe("Authentication provider used for the current session")
|
|
7
9
|
}).describe("Current authenticated user info");
|
|
8
10
|
|
|
9
|
-
export { AuthenticatedUser };
|
|
11
|
+
export { AuthenticatedUser, LoginMethod };
|
package/dist/auth/response.d.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const LoginResponse: z.ZodObject<{
|
|
3
|
+
accessToken: z.ZodString;
|
|
4
|
+
refreshToken: z.ZodString;
|
|
3
5
|
user: z.ZodObject<{
|
|
4
6
|
id: z.ZodUUID;
|
|
5
7
|
role: z.ZodEnum<{
|
|
6
8
|
basic: "basic";
|
|
7
9
|
pro: "pro";
|
|
8
10
|
}>;
|
|
9
|
-
|
|
11
|
+
providerId: z.ZodNullable<z.ZodString>;
|
|
12
|
+
loginMethod: z.ZodEnum<{
|
|
13
|
+
email: "email";
|
|
14
|
+
evm_wallet: "evm_wallet";
|
|
15
|
+
}>;
|
|
10
16
|
}, z.core.$strip>;
|
|
11
17
|
}, z.core.$strip>;
|
|
12
18
|
export declare const RefreshTokenResponse: z.ZodObject<{
|
|
@@ -24,16 +30,7 @@ export declare const ChangePasswordResponse: z.ZodVoid;
|
|
|
24
30
|
export declare const ForgotPasswordResponse: z.ZodVoid;
|
|
25
31
|
export declare const ResetPasswordResponse: z.ZodVoid;
|
|
26
32
|
export declare const LinkEmailResponse: z.ZodVoid;
|
|
27
|
-
export declare const LinkWalletResponse: z.
|
|
28
|
-
user: z.ZodObject<{
|
|
29
|
-
id: z.ZodUUID;
|
|
30
|
-
role: z.ZodEnum<{
|
|
31
|
-
basic: "basic";
|
|
32
|
-
pro: "pro";
|
|
33
|
-
}>;
|
|
34
|
-
address: z.ZodNullable<z.ZodString>;
|
|
35
|
-
}, z.core.$strip>;
|
|
36
|
-
}, z.core.$strip>;
|
|
33
|
+
export declare const LinkWalletResponse: z.ZodVoid;
|
|
37
34
|
export declare const RequestNonceResponse: z.ZodObject<{
|
|
38
35
|
nonce: z.ZodString;
|
|
39
36
|
message: z.ZodString;
|
|
@@ -45,7 +42,11 @@ export declare const MeResponse: z.ZodObject<{
|
|
|
45
42
|
basic: "basic";
|
|
46
43
|
pro: "pro";
|
|
47
44
|
}>;
|
|
48
|
-
|
|
45
|
+
providerId: z.ZodNullable<z.ZodString>;
|
|
46
|
+
loginMethod: z.ZodEnum<{
|
|
47
|
+
email: "email";
|
|
48
|
+
evm_wallet: "evm_wallet";
|
|
49
|
+
}>;
|
|
49
50
|
}, z.core.$strip>;
|
|
50
51
|
export type RequestNonceResponse = z.infer<typeof RequestNonceResponse>;
|
|
51
52
|
export type LoginResponse = z.infer<typeof LoginResponse>;
|
package/dist/auth/response.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { AuthenticatedUser } from './entities';
|
|
3
3
|
|
|
4
|
-
const LoginResponse = z.object({
|
|
4
|
+
const LoginResponse = z.object({
|
|
5
|
+
accessToken: z.string().describe("New JWT access token"),
|
|
6
|
+
refreshToken: z.string().describe("New JWT refresh token"),
|
|
7
|
+
user: AuthenticatedUser
|
|
8
|
+
}).describe("Successful login response");
|
|
5
9
|
const RefreshTokenResponse = z.object({
|
|
6
10
|
accessToken: z.string().describe("New JWT access token"),
|
|
7
11
|
refreshToken: z.string().describe("New JWT refresh token"),
|
|
@@ -17,7 +21,7 @@ const ChangePasswordResponse = z.void().describe("Successful password change res
|
|
|
17
21
|
const ForgotPasswordResponse = z.void().describe("Successful password reset request response");
|
|
18
22
|
const ResetPasswordResponse = z.void().describe("Successful password reset response");
|
|
19
23
|
const LinkEmailResponse = z.void().describe("Successful email verification response");
|
|
20
|
-
const LinkWalletResponse = z.
|
|
24
|
+
const LinkWalletResponse = z.void().describe("Successful wallet link response");
|
|
21
25
|
const RequestNonceResponse = z.object({
|
|
22
26
|
nonce: z.string().describe("Nonce to sign with wallet"),
|
|
23
27
|
message: z.string().describe("Domain-bound wallet sign-in message"),
|
package/dist/bundle.d.ts
CHANGED
package/dist/bundle.js
CHANGED
|
@@ -18,3 +18,4 @@ export declare const RefineWeightingSum: <T extends {
|
|
|
18
18
|
export declare const RefineMinimumOneBuyOneSell: <T extends {
|
|
19
19
|
side: "BUY" | "SELL";
|
|
20
20
|
}[]>(basket: T, ctx: z.RefinementCtx) => void;
|
|
21
|
+
export declare const RefineMinimumOneKeyValuePair: <T extends Record<string, unknown>>(data: T, ctx: z.RefinementCtx) => void;
|
|
@@ -56,5 +56,13 @@ const RefineMinimumOneBuyOneSell = (basket, ctx) => {
|
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
+
const RefineMinimumOneKeyValuePair = (data, ctx) => {
|
|
60
|
+
if (Object.keys(data).length < 1) {
|
|
61
|
+
ctx.addIssue({
|
|
62
|
+
code: "custom",
|
|
63
|
+
message: "Empty object is not allowed."
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
};
|
|
59
67
|
|
|
60
|
-
export { RefineMinimumOneBuyOneSell, RefineMinimumOneSymbol, RefineMinimumTwoSymbols, RefineTwoUniqueSymbols, RefineUniqueSymbols, RefineWeightingSum };
|
|
68
|
+
export { RefineMinimumOneBuyOneSell, RefineMinimumOneKeyValuePair, RefineMinimumOneSymbol, RefineMinimumTwoSymbols, RefineTwoUniqueSymbols, RefineUniqueSymbols, RefineWeightingSum };
|
package/dist/common/request.js
CHANGED
|
@@ -4,7 +4,7 @@ const CursorFindParams = z.object({
|
|
|
4
4
|
/**
|
|
5
5
|
* The maximum number of items to retrieve.
|
|
6
6
|
*/
|
|
7
|
-
limit: z.coerce.number().int().positive().max(
|
|
7
|
+
limit: z.coerce.number().int().positive().max(2e3).optional().default(20),
|
|
8
8
|
/**
|
|
9
9
|
* Opaque pagination cursor returned by the API.
|
|
10
10
|
*/
|
package/dist/common/schema.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
export declare const UnsignedDecimalString: z.ZodString;
|
|
3
|
-
export declare const SignedDecimalString: z.ZodString
|
|
3
|
+
export declare const SignedDecimalString: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
|
|
4
4
|
export declare const Leverage: z.ZodInt;
|
|
5
5
|
export declare const Side: z.ZodEnum<{
|
|
6
6
|
BUY: "BUY";
|
package/dist/common/schema.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
|
|
3
3
|
const UnsignedDecimalString = z.string().regex(/^\d+(\.\d+)?$/, "Must be a valid decimal string");
|
|
4
|
-
const SignedDecimalString = z.string().regex(
|
|
4
|
+
const SignedDecimalString = z.string().regex(/^[+-]\d+(\.\d+)?$/, "Must be a valid signed decimal string").transform((val) => val);
|
|
5
5
|
const Leverage = z.int({ message: "Leverage must be an integer" }).positive({ message: "Leverage must be greater than 0" }).max(100, { message: "Leverage must be less than 100" });
|
|
6
6
|
const Side = z.enum(["BUY", "SELL"], {
|
|
7
7
|
message: "Side must be either BUY or SELL"
|
|
@@ -27,7 +27,10 @@ export type OkxCredentialsDTO = {
|
|
|
27
27
|
api_secret: string;
|
|
28
28
|
api_pass: string;
|
|
29
29
|
};
|
|
30
|
-
export type LighterCredentialsDTO =
|
|
30
|
+
export type LighterCredentialsDTO = {
|
|
31
|
+
api_private_key: string;
|
|
32
|
+
api_key_index: number;
|
|
33
|
+
};
|
|
31
34
|
export type ConnectorCredentialsDTO = {
|
|
32
35
|
hyperliquid: HyperliquidCredentialsDTO;
|
|
33
36
|
binance: BinanceCredentialsDTO;
|
|
@@ -229,7 +229,7 @@ export declare const MarketAdjustExecution: z.ZodObject<{
|
|
|
229
229
|
orderType: z.ZodLiteral<"MARKET">;
|
|
230
230
|
position: z.ZodObject<{
|
|
231
231
|
id: z.ZodUUID;
|
|
232
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodString
|
|
232
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
233
233
|
}, z.core.$strip>;
|
|
234
234
|
legs: z.ZodTuple<[z.ZodObject<{
|
|
235
235
|
symbol: z.ZodString;
|
|
@@ -312,7 +312,7 @@ export declare const MarketCloseExecution: z.ZodObject<{
|
|
|
312
312
|
orderType: z.ZodLiteral<"MARKET">;
|
|
313
313
|
position: z.ZodObject<{
|
|
314
314
|
id: z.ZodUUID;
|
|
315
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodString
|
|
315
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
316
316
|
}, z.core.$strip>;
|
|
317
317
|
}, z.core.$strip>;
|
|
318
318
|
export declare const MarketExecution: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -448,7 +448,7 @@ export declare const MarketExecution: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
448
448
|
orderType: z.ZodLiteral<"MARKET">;
|
|
449
449
|
position: z.ZodObject<{
|
|
450
450
|
id: z.ZodUUID;
|
|
451
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodString
|
|
451
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
452
452
|
}, z.core.$strip>;
|
|
453
453
|
legs: z.ZodTuple<[z.ZodObject<{
|
|
454
454
|
symbol: z.ZodString;
|
|
@@ -530,7 +530,7 @@ export declare const MarketExecution: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
530
530
|
orderType: z.ZodLiteral<"MARKET">;
|
|
531
531
|
position: z.ZodObject<{
|
|
532
532
|
id: z.ZodUUID;
|
|
533
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodString
|
|
533
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
534
534
|
}, z.core.$strip>;
|
|
535
535
|
}, z.core.$strip>], "intent">;
|
|
536
536
|
export declare const Execution: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -666,7 +666,7 @@ export declare const Execution: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion
|
|
|
666
666
|
orderType: z.ZodLiteral<"MARKET">;
|
|
667
667
|
position: z.ZodObject<{
|
|
668
668
|
id: z.ZodUUID;
|
|
669
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodString
|
|
669
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
670
670
|
}, z.core.$strip>;
|
|
671
671
|
legs: z.ZodTuple<[z.ZodObject<{
|
|
672
672
|
symbol: z.ZodString;
|
|
@@ -748,7 +748,7 @@ export declare const Execution: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion
|
|
|
748
748
|
orderType: z.ZodLiteral<"MARKET">;
|
|
749
749
|
position: z.ZodObject<{
|
|
750
750
|
id: z.ZodUUID;
|
|
751
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodString
|
|
751
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
752
752
|
}, z.core.$strip>;
|
|
753
753
|
}, z.core.$strip>], "intent">], "orderType">;
|
|
754
754
|
export type ExecutionLeg = z.infer<typeof ExecutionLeg>;
|
|
@@ -135,7 +135,7 @@ export declare const ExecutionListResponse: z.ZodObject<{
|
|
|
135
135
|
orderType: z.ZodLiteral<"MARKET">;
|
|
136
136
|
position: z.ZodObject<{
|
|
137
137
|
id: z.ZodUUID;
|
|
138
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodString
|
|
138
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
139
139
|
}, z.core.$strip>;
|
|
140
140
|
legs: z.ZodTuple<[z.ZodObject<{
|
|
141
141
|
symbol: z.ZodString;
|
|
@@ -217,7 +217,7 @@ export declare const ExecutionListResponse: z.ZodObject<{
|
|
|
217
217
|
orderType: z.ZodLiteral<"MARKET">;
|
|
218
218
|
position: z.ZodObject<{
|
|
219
219
|
id: z.ZodUUID;
|
|
220
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodString
|
|
220
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
221
221
|
}, z.core.$strip>;
|
|
222
222
|
}, z.core.$strip>], "intent">], "orderType">>;
|
|
223
223
|
}, z.core.$strip>;
|
package/dist/fill/entities.d.ts
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const FillStatus: z.ZodEnum<{
|
|
3
|
+
PROVISIONAL: "PROVISIONAL";
|
|
4
|
+
CONFIRMED: "CONFIRMED";
|
|
5
|
+
RECONCILED: "RECONCILED";
|
|
6
|
+
}>;
|
|
7
|
+
export type FillStatus = z.output<typeof FillStatus>;
|
|
2
8
|
export declare const Fill: z.ZodObject<{
|
|
3
9
|
id: z.ZodUUID;
|
|
4
|
-
cloid: z.ZodOptional<z.
|
|
10
|
+
cloid: z.ZodOptional<z.ZodString>;
|
|
11
|
+
exchangeFillId: z.ZodOptional<z.ZodString>;
|
|
12
|
+
status: z.ZodEnum<{
|
|
13
|
+
PROVISIONAL: "PROVISIONAL";
|
|
14
|
+
CONFIRMED: "CONFIRMED";
|
|
15
|
+
RECONCILED: "RECONCILED";
|
|
16
|
+
}>;
|
|
5
17
|
tradeAccountId: z.ZodUUID;
|
|
6
18
|
symbol: z.ZodString;
|
|
7
19
|
positionId: z.ZodUUID;
|
|
@@ -17,10 +29,16 @@ export declare const Fill: z.ZodObject<{
|
|
|
17
29
|
SELL: "SELL";
|
|
18
30
|
}>;
|
|
19
31
|
reduceOnly: z.ZodBoolean;
|
|
32
|
+
isExternal: z.ZodBoolean;
|
|
20
33
|
quantity: z.ZodString;
|
|
21
34
|
price: z.ZodString;
|
|
22
35
|
usd: z.ZodString;
|
|
23
|
-
|
|
36
|
+
tradeFee: z.ZodOptional<z.ZodString>;
|
|
37
|
+
pearFee: z.ZodOptional<z.ZodString>;
|
|
24
38
|
timestamp: z.ZodString;
|
|
39
|
+
original: z.ZodOptional<z.ZodObject<{
|
|
40
|
+
exchangeFillId: z.ZodString;
|
|
41
|
+
quantity: z.ZodString;
|
|
42
|
+
}, z.core.$strip>>;
|
|
25
43
|
}, z.core.$strip>;
|
|
26
44
|
export type Fill = z.output<typeof Fill>;
|
package/dist/fill/entities.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Side } from '../common/schema';
|
|
|
3
3
|
import { Connector } from '../connector';
|
|
4
4
|
import { InstrumentId } from '../instrument';
|
|
5
5
|
|
|
6
|
+
const FillStatus = z.enum(["PROVISIONAL", "CONFIRMED", "RECONCILED"]);
|
|
6
7
|
const Fill = z.object({
|
|
7
8
|
/**
|
|
8
9
|
* Fill UUID
|
|
@@ -11,7 +12,15 @@ const Fill = z.object({
|
|
|
11
12
|
/**
|
|
12
13
|
* Client order ID
|
|
13
14
|
*/
|
|
14
|
-
cloid: z.
|
|
15
|
+
cloid: z.string().optional(),
|
|
16
|
+
/**
|
|
17
|
+
* Exchange-native fill ID (tradeId / tid / etc)
|
|
18
|
+
*/
|
|
19
|
+
exchangeFillId: z.string().optional(),
|
|
20
|
+
/**
|
|
21
|
+
* Fill lifecycle status
|
|
22
|
+
*/
|
|
23
|
+
status: FillStatus,
|
|
15
24
|
/**
|
|
16
25
|
* Trade account UUID
|
|
17
26
|
*/
|
|
@@ -36,6 +45,10 @@ const Fill = z.object({
|
|
|
36
45
|
* Reduce only flag
|
|
37
46
|
*/
|
|
38
47
|
reduceOnly: z.boolean(),
|
|
48
|
+
/**
|
|
49
|
+
* True when the fill was created from external sync.
|
|
50
|
+
*/
|
|
51
|
+
isExternal: z.boolean(),
|
|
39
52
|
/**
|
|
40
53
|
* Filled quantity
|
|
41
54
|
*/
|
|
@@ -49,13 +62,25 @@ const Fill = z.object({
|
|
|
49
62
|
*/
|
|
50
63
|
usd: z.string(),
|
|
51
64
|
/**
|
|
52
|
-
*
|
|
65
|
+
* Trade fee paid
|
|
66
|
+
*/
|
|
67
|
+
tradeFee: z.string().optional(),
|
|
68
|
+
/**
|
|
69
|
+
* Pear fee paid
|
|
53
70
|
*/
|
|
54
|
-
|
|
71
|
+
pearFee: z.string().optional(),
|
|
55
72
|
/**
|
|
56
73
|
* Timestamp
|
|
57
74
|
*/
|
|
58
|
-
timestamp: z.string()
|
|
75
|
+
timestamp: z.string(),
|
|
76
|
+
/**
|
|
77
|
+
* A fill spanning multiple positions gets a synthetic exchange fill id.
|
|
78
|
+
* This `original` field contains the root exchange fill id and quantity.
|
|
79
|
+
*/
|
|
80
|
+
original: z.object({
|
|
81
|
+
exchangeFillId: z.string(),
|
|
82
|
+
quantity: z.string()
|
|
83
|
+
}).optional()
|
|
59
84
|
});
|
|
60
85
|
|
|
61
|
-
export { Fill };
|
|
86
|
+
export { Fill, FillStatus };
|
package/dist/fill/queries.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const FillOrderBy: z.ZodUnion<readonly [z.ZodLiteral<"timestamp">, z.ZodLiteral<"-timestamp">]>;
|
|
2
3
|
export declare const FillListParams: z.ZodObject<{
|
|
3
4
|
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<number>>>;
|
|
4
5
|
cursor: z.ZodOptional<z.ZodString>;
|
package/dist/fill/queries.js
CHANGED
|
@@ -2,10 +2,10 @@ import { z } from 'zod';
|
|
|
2
2
|
import { CursorFindParams } from '../common';
|
|
3
3
|
import { Connector } from '../connector';
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const FillOrderBy = z.union([z.literal("timestamp"), z.literal("-timestamp")]);
|
|
6
6
|
const FillListParams = CursorFindParams.extend({
|
|
7
7
|
connector: Connector.optional(),
|
|
8
|
-
orderBy:
|
|
8
|
+
orderBy: FillOrderBy.default("-timestamp")
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
export { FillListParams };
|
|
11
|
+
export { FillListParams, FillOrderBy };
|
package/dist/fill/responses.d.ts
CHANGED
|
@@ -4,7 +4,13 @@ export declare const FillListResponse: z.ZodObject<{
|
|
|
4
4
|
nextCursor: z.ZodUnion<[z.ZodString, z.ZodUndefined]>;
|
|
5
5
|
fills: z.ZodArray<z.ZodObject<{
|
|
6
6
|
id: z.ZodUUID;
|
|
7
|
-
cloid: z.ZodOptional<z.
|
|
7
|
+
cloid: z.ZodOptional<z.ZodString>;
|
|
8
|
+
exchangeFillId: z.ZodOptional<z.ZodString>;
|
|
9
|
+
status: z.ZodEnum<{
|
|
10
|
+
PROVISIONAL: "PROVISIONAL";
|
|
11
|
+
CONFIRMED: "CONFIRMED";
|
|
12
|
+
RECONCILED: "RECONCILED";
|
|
13
|
+
}>;
|
|
8
14
|
tradeAccountId: z.ZodUUID;
|
|
9
15
|
symbol: z.ZodString;
|
|
10
16
|
positionId: z.ZodUUID;
|
|
@@ -20,18 +26,30 @@ export declare const FillListResponse: z.ZodObject<{
|
|
|
20
26
|
SELL: "SELL";
|
|
21
27
|
}>;
|
|
22
28
|
reduceOnly: z.ZodBoolean;
|
|
29
|
+
isExternal: z.ZodBoolean;
|
|
23
30
|
quantity: z.ZodString;
|
|
24
31
|
price: z.ZodString;
|
|
25
32
|
usd: z.ZodString;
|
|
26
|
-
|
|
33
|
+
tradeFee: z.ZodOptional<z.ZodString>;
|
|
34
|
+
pearFee: z.ZodOptional<z.ZodString>;
|
|
27
35
|
timestamp: z.ZodString;
|
|
36
|
+
original: z.ZodOptional<z.ZodObject<{
|
|
37
|
+
exchangeFillId: z.ZodString;
|
|
38
|
+
quantity: z.ZodString;
|
|
39
|
+
}, z.core.$strip>>;
|
|
28
40
|
}, z.core.$strip>>;
|
|
29
41
|
}, z.core.$strip>;
|
|
30
42
|
export type FillListResponse = z.output<typeof FillListResponse>;
|
|
31
43
|
export declare const PositionFillListResponse: z.ZodObject<{
|
|
32
44
|
fills: z.ZodArray<z.ZodObject<{
|
|
33
45
|
id: z.ZodUUID;
|
|
34
|
-
cloid: z.ZodOptional<z.
|
|
46
|
+
cloid: z.ZodOptional<z.ZodString>;
|
|
47
|
+
exchangeFillId: z.ZodOptional<z.ZodString>;
|
|
48
|
+
status: z.ZodEnum<{
|
|
49
|
+
PROVISIONAL: "PROVISIONAL";
|
|
50
|
+
CONFIRMED: "CONFIRMED";
|
|
51
|
+
RECONCILED: "RECONCILED";
|
|
52
|
+
}>;
|
|
35
53
|
tradeAccountId: z.ZodUUID;
|
|
36
54
|
symbol: z.ZodString;
|
|
37
55
|
positionId: z.ZodUUID;
|
|
@@ -47,11 +65,33 @@ export declare const PositionFillListResponse: z.ZodObject<{
|
|
|
47
65
|
SELL: "SELL";
|
|
48
66
|
}>;
|
|
49
67
|
reduceOnly: z.ZodBoolean;
|
|
68
|
+
isExternal: z.ZodBoolean;
|
|
50
69
|
quantity: z.ZodString;
|
|
51
70
|
price: z.ZodString;
|
|
52
71
|
usd: z.ZodString;
|
|
53
|
-
|
|
72
|
+
tradeFee: z.ZodOptional<z.ZodString>;
|
|
73
|
+
pearFee: z.ZodOptional<z.ZodString>;
|
|
54
74
|
timestamp: z.ZodString;
|
|
75
|
+
original: z.ZodOptional<z.ZodObject<{
|
|
76
|
+
exchangeFillId: z.ZodString;
|
|
77
|
+
quantity: z.ZodString;
|
|
78
|
+
}, z.core.$strip>>;
|
|
55
79
|
}, z.core.$strip>>;
|
|
56
80
|
}, z.core.$strip>;
|
|
57
81
|
export type PositionFillListResponse = z.output<typeof PositionFillListResponse>;
|
|
82
|
+
export declare const ProvisionalFill: z.ZodObject<{
|
|
83
|
+
id: z.ZodUUID;
|
|
84
|
+
positionId: z.ZodUUID;
|
|
85
|
+
cloid: z.ZodOptional<z.ZodString>;
|
|
86
|
+
status: z.ZodLiteral<"PROVISIONAL">;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
export declare const ProvisionalFillListResponse: z.ZodObject<{
|
|
89
|
+
fills: z.ZodArray<z.ZodObject<{
|
|
90
|
+
id: z.ZodUUID;
|
|
91
|
+
positionId: z.ZodUUID;
|
|
92
|
+
cloid: z.ZodOptional<z.ZodString>;
|
|
93
|
+
status: z.ZodLiteral<"PROVISIONAL">;
|
|
94
|
+
}, z.core.$strip>>;
|
|
95
|
+
}, z.core.$strip>;
|
|
96
|
+
export type ProvisionalFill = z.output<typeof ProvisionalFill>;
|
|
97
|
+
export type ProvisionalFillListResponse = z.output<typeof ProvisionalFillListResponse>;
|
package/dist/fill/responses.js
CHANGED
|
@@ -8,5 +8,14 @@ const FillListResponse = CursorResponse.extend({
|
|
|
8
8
|
const PositionFillListResponse = z.object({
|
|
9
9
|
fills: z.array(Fill)
|
|
10
10
|
});
|
|
11
|
+
const ProvisionalFill = z.object({
|
|
12
|
+
id: z.uuid(),
|
|
13
|
+
positionId: z.uuid(),
|
|
14
|
+
cloid: z.string().optional(),
|
|
15
|
+
status: z.literal("PROVISIONAL")
|
|
16
|
+
});
|
|
17
|
+
const ProvisionalFillListResponse = z.object({
|
|
18
|
+
fills: z.array(ProvisionalFill)
|
|
19
|
+
});
|
|
11
20
|
|
|
12
|
-
export { FillListResponse, PositionFillListResponse };
|
|
21
|
+
export { FillListResponse, PositionFillListResponse, ProvisionalFill, ProvisionalFillListResponse };
|
|
@@ -36,3 +36,7 @@ export declare const InstrumentListResponse: z.ZodObject<{
|
|
|
36
36
|
}, z.core.$strip>>;
|
|
37
37
|
}, z.core.$strip>;
|
|
38
38
|
export type InstrumentListResponse = z.output<typeof InstrumentListResponse>;
|
|
39
|
+
export declare const InstrumentSymbolToIdMapResponse: z.ZodObject<{
|
|
40
|
+
data: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export type InstrumentSymbolToIdMapResponse = z.output<typeof InstrumentSymbolToIdMapResponse>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { Instrument } from './entities';
|
|
2
|
+
import { Instrument, InstrumentId } from './entities';
|
|
3
3
|
|
|
4
4
|
const InstrumentListResponse = z.object({
|
|
5
5
|
/**
|
|
@@ -7,5 +7,8 @@ const InstrumentListResponse = z.object({
|
|
|
7
7
|
*/
|
|
8
8
|
instruments: z.array(Instrument)
|
|
9
9
|
});
|
|
10
|
+
const InstrumentSymbolToIdMapResponse = z.object({
|
|
11
|
+
data: z.record(z.string(), InstrumentId)
|
|
12
|
+
});
|
|
10
13
|
|
|
11
|
-
export { InstrumentListResponse };
|
|
14
|
+
export { InstrumentListResponse, InstrumentSymbolToIdMapResponse };
|
package/dist/misc/index.d.ts
CHANGED
package/dist/misc/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export * from './payloads';
|
|
2
|
+
export * from './responses';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const CreateLighterApiKeyParams: z.ZodObject<{
|
|
3
|
+
accountIndex: z.ZodNumber;
|
|
4
|
+
apiKeyIndex: z.ZodNumber;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type CreateLighterApiKeyParams = z.output<typeof CreateLighterApiKeyParams>;
|
|
7
|
+
export declare const SubmitChangePubKeyParams: z.ZodObject<{
|
|
8
|
+
l1Signature: z.ZodString;
|
|
9
|
+
txInfo: z.ZodString;
|
|
10
|
+
accountIndex: z.ZodNumber;
|
|
11
|
+
apiKeyIndex: z.ZodNumber;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type SubmitChangePubKeyParams = z.output<typeof SubmitChangePubKeyParams>;
|
|
14
|
+
export declare const PrepareApproveIntegratorParams: z.ZodObject<{
|
|
15
|
+
accountIndex: z.ZodNumber;
|
|
16
|
+
apiKeyIndex: z.ZodNumber;
|
|
17
|
+
apiPrivateKey: z.ZodString;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type PrepareApproveIntegratorParams = z.output<typeof PrepareApproveIntegratorParams>;
|
|
20
|
+
export declare const SubmitApproveIntegratorParams: z.ZodObject<{
|
|
21
|
+
l1Signature: z.ZodString;
|
|
22
|
+
txInfo: z.ZodString;
|
|
23
|
+
accountIndex: z.ZodNumber;
|
|
24
|
+
apiKeyIndex: z.ZodNumber;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type SubmitApproveIntegratorParams = z.output<typeof SubmitApproveIntegratorParams>;
|
|
27
|
+
export declare const CreateAuthTokenParams: z.ZodObject<{
|
|
28
|
+
accountIndex: z.ZodNumber;
|
|
29
|
+
apiKeyIndex: z.ZodNumber;
|
|
30
|
+
apiPrivateKey: z.ZodString;
|
|
31
|
+
ttlSeconds: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export type CreateAuthTokenParams = z.output<typeof CreateAuthTokenParams>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const CreateLighterApiKeyParams = z.object({
|
|
4
|
+
accountIndex: z.number(),
|
|
5
|
+
apiKeyIndex: z.number()
|
|
6
|
+
});
|
|
7
|
+
const SubmitChangePubKeyParams = z.object({
|
|
8
|
+
l1Signature: z.string(),
|
|
9
|
+
txInfo: z.string(),
|
|
10
|
+
accountIndex: z.number(),
|
|
11
|
+
apiKeyIndex: z.number()
|
|
12
|
+
});
|
|
13
|
+
const PrepareApproveIntegratorParams = z.object({
|
|
14
|
+
accountIndex: z.number(),
|
|
15
|
+
apiKeyIndex: z.number(),
|
|
16
|
+
apiPrivateKey: z.string()
|
|
17
|
+
});
|
|
18
|
+
const SubmitApproveIntegratorParams = z.object({
|
|
19
|
+
l1Signature: z.string(),
|
|
20
|
+
txInfo: z.string(),
|
|
21
|
+
accountIndex: z.number(),
|
|
22
|
+
apiKeyIndex: z.number()
|
|
23
|
+
});
|
|
24
|
+
const CreateAuthTokenParams = z.object({
|
|
25
|
+
accountIndex: z.number(),
|
|
26
|
+
apiKeyIndex: z.number(),
|
|
27
|
+
apiPrivateKey: z.string(),
|
|
28
|
+
ttlSeconds: z.number().optional()
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export { CreateAuthTokenParams, CreateLighterApiKeyParams, PrepareApproveIntegratorParams, SubmitApproveIntegratorParams, SubmitChangePubKeyParams };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const CreateApiKeyWithMessageResult: z.ZodObject<{
|
|
3
|
+
privateKey: z.ZodString;
|
|
4
|
+
publicKey: z.ZodString;
|
|
5
|
+
apiKeyIndex: z.ZodNumber;
|
|
6
|
+
messageToSign: z.ZodString;
|
|
7
|
+
txInfo: z.ZodString;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type CreateApiKeyWithMessageResult = z.output<typeof CreateApiKeyWithMessageResult>;
|
|
10
|
+
export declare const SubmitChangePubKeyResult: z.ZodObject<{
|
|
11
|
+
txHash: z.ZodString;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type SubmitChangePubKeyResult = z.output<typeof SubmitChangePubKeyResult>;
|
|
14
|
+
export declare const PrepareApproveIntegratorResult: z.ZodObject<{
|
|
15
|
+
messageToSign: z.ZodString;
|
|
16
|
+
txInfo: z.ZodString;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type PrepareApproveIntegratorResult = z.output<typeof PrepareApproveIntegratorResult>;
|
|
19
|
+
export declare const SubmitApproveIntegratorResult: z.ZodObject<{
|
|
20
|
+
txHash: z.ZodString;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type SubmitApproveIntegratorResult = z.output<typeof SubmitApproveIntegratorResult>;
|
|
23
|
+
export declare const CreateAuthTokenResult: z.ZodObject<{
|
|
24
|
+
token: z.ZodString;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type CreateAuthTokenResult = z.output<typeof CreateAuthTokenResult>;
|