@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
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
2
|
+
export declare const VolumeStatistics: z.ZodObject<{
|
|
3
|
+
timestamp: z.ZodNumber;
|
|
4
4
|
volume: z.ZodNumber;
|
|
5
5
|
fees: z.ZodNumber;
|
|
6
|
+
trades: z.ZodNumber;
|
|
6
7
|
users: z.ZodNumber;
|
|
7
8
|
newUsers: z.ZodNumber;
|
|
8
9
|
}, z.core.$strip>;
|
|
9
|
-
export type
|
|
10
|
+
export type VolumeStatistics = z.output<typeof VolumeStatistics>;
|
|
11
|
+
export declare const OiStatistics: z.ZodObject<{
|
|
12
|
+
timestamp: z.ZodNumber;
|
|
13
|
+
openInterest: z.ZodNumber;
|
|
14
|
+
openPositions: z.ZodNumber;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
export type OiStatistics = z.output<typeof OiStatistics>;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
|
|
3
|
+
const VolumeStatistics = z.object({
|
|
4
|
+
timestamp: z.number(),
|
|
5
5
|
volume: z.number(),
|
|
6
6
|
fees: z.number(),
|
|
7
|
+
trades: z.number(),
|
|
7
8
|
users: z.number(),
|
|
8
9
|
newUsers: z.number()
|
|
9
10
|
});
|
|
11
|
+
const OiStatistics = z.object({
|
|
12
|
+
timestamp: z.number(),
|
|
13
|
+
openInterest: z.number(),
|
|
14
|
+
openPositions: z.number()
|
|
15
|
+
});
|
|
10
16
|
|
|
11
|
-
export {
|
|
17
|
+
export { OiStatistics, VolumeStatistics };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const VolumeStatisticsQueryParams: z.ZodObject<{
|
|
3
3
|
connector: z.ZodEnum<{
|
|
4
4
|
hyperliquid: "hyperliquid";
|
|
5
5
|
binance: "binance";
|
|
@@ -7,8 +7,31 @@ export declare const DailyStatisticsQueryParams: z.ZodObject<{
|
|
|
7
7
|
okx: "okx";
|
|
8
8
|
lighter: "lighter";
|
|
9
9
|
}>;
|
|
10
|
+
resolution: z.ZodEnum<{
|
|
11
|
+
"1h": "1h";
|
|
12
|
+
"4h": "4h";
|
|
13
|
+
"24h": "24h";
|
|
14
|
+
}>;
|
|
15
|
+
startDate: z.ZodOptional<z.ZodCoercedDate<Date>>;
|
|
16
|
+
endDate: z.ZodDefault<z.ZodCoercedDate<Date>>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type VolumeStatisticsQueryParamsInput = z.input<typeof VolumeStatisticsQueryParams>;
|
|
19
|
+
export type VolumeStatisticsQueryParams = z.output<typeof VolumeStatisticsQueryParams>;
|
|
20
|
+
export declare const OiStatisticsQueryParams: z.ZodObject<{
|
|
21
|
+
connector: z.ZodEnum<{
|
|
22
|
+
hyperliquid: "hyperliquid";
|
|
23
|
+
binance: "binance";
|
|
24
|
+
bybit: "bybit";
|
|
25
|
+
okx: "okx";
|
|
26
|
+
lighter: "lighter";
|
|
27
|
+
}>;
|
|
28
|
+
resolution: z.ZodEnum<{
|
|
29
|
+
"1h": "1h";
|
|
30
|
+
"4h": "4h";
|
|
31
|
+
"24h": "24h";
|
|
32
|
+
}>;
|
|
10
33
|
startDate: z.ZodOptional<z.ZodCoercedDate<Date>>;
|
|
11
34
|
endDate: z.ZodDefault<z.ZodCoercedDate<Date>>;
|
|
12
35
|
}, z.core.$strip>;
|
|
13
|
-
export type
|
|
14
|
-
export type
|
|
36
|
+
export type OiStatisticsQueryParamsInput = z.input<typeof OiStatisticsQueryParams>;
|
|
37
|
+
export type OiStatisticsQueryParams = z.output<typeof OiStatisticsQueryParams>;
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { Connector } from '../connector';
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const VolumeStatisticsQueryParams = z.object({
|
|
5
5
|
connector: Connector,
|
|
6
|
+
resolution: z.enum(["1h", "4h", "24h"]),
|
|
7
|
+
startDate: z.coerce.date().optional(),
|
|
8
|
+
endDate: z.coerce.date().default(() => /* @__PURE__ */ new Date())
|
|
9
|
+
}).refine((data) => !data.startDate || data.startDate < data.endDate, {
|
|
10
|
+
message: "startDate must be before endDate"
|
|
11
|
+
});
|
|
12
|
+
const OiStatisticsQueryParams = z.object({
|
|
13
|
+
connector: Connector,
|
|
14
|
+
resolution: z.enum(["1h", "4h", "24h"]),
|
|
6
15
|
startDate: z.coerce.date().optional(),
|
|
7
16
|
endDate: z.coerce.date().default(() => /* @__PURE__ */ new Date())
|
|
8
17
|
}).refine((data) => !data.startDate || data.startDate < data.endDate, {
|
|
9
18
|
message: "startDate must be before endDate"
|
|
10
19
|
});
|
|
11
20
|
|
|
12
|
-
export {
|
|
21
|
+
export { OiStatisticsQueryParams, VolumeStatisticsQueryParams };
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const VolumeStatisticsResponse: z.ZodObject<{
|
|
3
3
|
data: z.ZodArray<z.ZodObject<{
|
|
4
|
-
|
|
4
|
+
timestamp: z.ZodNumber;
|
|
5
5
|
volume: z.ZodNumber;
|
|
6
6
|
fees: z.ZodNumber;
|
|
7
|
+
trades: z.ZodNumber;
|
|
7
8
|
users: z.ZodNumber;
|
|
8
9
|
newUsers: z.ZodNumber;
|
|
9
10
|
}, z.core.$strip>>;
|
|
10
11
|
}, z.core.$strip>;
|
|
11
|
-
export type
|
|
12
|
+
export type VolumeStatisticsResponse = z.output<typeof VolumeStatisticsResponse>;
|
|
13
|
+
export declare const OiStatisticsResponse: z.ZodObject<{
|
|
14
|
+
data: z.ZodArray<z.ZodObject<{
|
|
15
|
+
timestamp: z.ZodNumber;
|
|
16
|
+
openInterest: z.ZodNumber;
|
|
17
|
+
openPositions: z.ZodNumber;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type OiStatisticsResponse = z.output<typeof OiStatisticsResponse>;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { VolumeStatistics, OiStatistics } from './entities';
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
data: z.array(
|
|
4
|
+
const VolumeStatisticsResponse = z.object({
|
|
5
|
+
data: z.array(VolumeStatistics)
|
|
6
|
+
});
|
|
7
|
+
const OiStatisticsResponse = z.object({
|
|
8
|
+
data: z.array(OiStatistics)
|
|
6
9
|
});
|
|
7
10
|
|
|
8
|
-
export {
|
|
11
|
+
export { OiStatisticsResponse, VolumeStatisticsResponse };
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const UnknownExternalFill: z.ZodObject<{
|
|
3
|
+
exchangeFillId: z.ZodString;
|
|
4
|
+
cloid: z.ZodNullable<z.ZodString>;
|
|
5
|
+
connector: z.ZodEnum<{
|
|
6
|
+
hyperliquid: "hyperliquid";
|
|
7
|
+
binance: "binance";
|
|
8
|
+
bybit: "bybit";
|
|
9
|
+
okx: "okx";
|
|
10
|
+
lighter: "lighter";
|
|
11
|
+
}>;
|
|
12
|
+
symbol: z.ZodString;
|
|
13
|
+
price: z.ZodString;
|
|
14
|
+
quantity: z.ZodString;
|
|
15
|
+
side: z.ZodEnum<{
|
|
16
|
+
BUY: "BUY";
|
|
17
|
+
SELL: "SELL";
|
|
18
|
+
}>;
|
|
19
|
+
reduceOnly: z.ZodBoolean;
|
|
20
|
+
timestamp: z.ZodNumber;
|
|
21
|
+
tradeFee: z.ZodString;
|
|
22
|
+
builderFee: z.ZodString;
|
|
23
|
+
liquidation: z.ZodNullable<z.ZodObject<{
|
|
24
|
+
mark: z.ZodString;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export declare const ConfirmableExternalFill: z.ZodObject<{
|
|
28
|
+
type: z.ZodLiteral<"confirm">;
|
|
29
|
+
exchangeFillId: z.ZodString;
|
|
30
|
+
cloid: z.ZodString;
|
|
31
|
+
positionId: z.ZodUUID;
|
|
32
|
+
connector: z.ZodEnum<{
|
|
33
|
+
hyperliquid: "hyperliquid";
|
|
34
|
+
binance: "binance";
|
|
35
|
+
bybit: "bybit";
|
|
36
|
+
okx: "okx";
|
|
37
|
+
lighter: "lighter";
|
|
38
|
+
}>;
|
|
39
|
+
symbol: z.ZodString;
|
|
40
|
+
quantity: z.ZodString;
|
|
41
|
+
timestamp: z.ZodNumber;
|
|
42
|
+
tradeFee: z.ZodString;
|
|
43
|
+
builderFee: z.ZodString;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export declare const ReconcileReplacementExternalFill: z.ZodObject<{
|
|
46
|
+
exchangeFillId: z.ZodString;
|
|
47
|
+
cloid: z.ZodString;
|
|
48
|
+
connector: z.ZodEnum<{
|
|
49
|
+
hyperliquid: "hyperliquid";
|
|
50
|
+
binance: "binance";
|
|
51
|
+
bybit: "bybit";
|
|
52
|
+
okx: "okx";
|
|
53
|
+
lighter: "lighter";
|
|
54
|
+
}>;
|
|
55
|
+
symbol: z.ZodString;
|
|
56
|
+
price: z.ZodString;
|
|
57
|
+
quantity: z.ZodString;
|
|
58
|
+
side: z.ZodEnum<{
|
|
59
|
+
BUY: "BUY";
|
|
60
|
+
SELL: "SELL";
|
|
61
|
+
}>;
|
|
62
|
+
reduceOnly: z.ZodBoolean;
|
|
63
|
+
timestamp: z.ZodNumber;
|
|
64
|
+
tradeFee: z.ZodString;
|
|
65
|
+
builderFee: z.ZodString;
|
|
66
|
+
liquidation: z.ZodNullable<z.ZodObject<{
|
|
67
|
+
mark: z.ZodString;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
export declare const CreatableExternalFill: z.ZodObject<{
|
|
71
|
+
type: z.ZodLiteral<"create">;
|
|
72
|
+
exchangeFillId: z.ZodString;
|
|
73
|
+
cloid: z.ZodNullable<z.ZodString>;
|
|
74
|
+
positionId: z.ZodUUID;
|
|
75
|
+
connector: z.ZodEnum<{
|
|
76
|
+
hyperliquid: "hyperliquid";
|
|
77
|
+
binance: "binance";
|
|
78
|
+
bybit: "bybit";
|
|
79
|
+
okx: "okx";
|
|
80
|
+
lighter: "lighter";
|
|
81
|
+
}>;
|
|
82
|
+
symbol: z.ZodString;
|
|
83
|
+
price: z.ZodString;
|
|
84
|
+
quantity: z.ZodString;
|
|
85
|
+
side: z.ZodEnum<{
|
|
86
|
+
BUY: "BUY";
|
|
87
|
+
SELL: "SELL";
|
|
88
|
+
}>;
|
|
89
|
+
reduceOnly: z.ZodBoolean;
|
|
90
|
+
timestamp: z.ZodNumber;
|
|
91
|
+
tradeFee: z.ZodString;
|
|
92
|
+
liquidation: z.ZodNullable<z.ZodObject<{
|
|
93
|
+
mark: z.ZodString;
|
|
94
|
+
}, z.core.$strip>>;
|
|
95
|
+
original: z.ZodOptional<z.ZodObject<{
|
|
96
|
+
exchangeFillId: z.ZodString;
|
|
97
|
+
quantity: z.ZodString;
|
|
98
|
+
}, z.core.$strip>>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
export declare const ConfirmFillsRequest: z.ZodRecord<z.ZodUUID, z.ZodTuple<[z.ZodObject<{
|
|
101
|
+
type: z.ZodLiteral<"confirm">;
|
|
102
|
+
exchangeFillId: z.ZodString;
|
|
103
|
+
cloid: z.ZodString;
|
|
104
|
+
positionId: z.ZodUUID;
|
|
105
|
+
connector: z.ZodEnum<{
|
|
106
|
+
hyperliquid: "hyperliquid";
|
|
107
|
+
binance: "binance";
|
|
108
|
+
bybit: "bybit";
|
|
109
|
+
okx: "okx";
|
|
110
|
+
lighter: "lighter";
|
|
111
|
+
}>;
|
|
112
|
+
symbol: z.ZodString;
|
|
113
|
+
quantity: z.ZodString;
|
|
114
|
+
timestamp: z.ZodNumber;
|
|
115
|
+
tradeFee: z.ZodString;
|
|
116
|
+
builderFee: z.ZodString;
|
|
117
|
+
}, z.core.$strip>], z.ZodObject<{
|
|
118
|
+
type: z.ZodLiteral<"confirm">;
|
|
119
|
+
exchangeFillId: z.ZodString;
|
|
120
|
+
cloid: z.ZodString;
|
|
121
|
+
positionId: z.ZodUUID;
|
|
122
|
+
connector: z.ZodEnum<{
|
|
123
|
+
hyperliquid: "hyperliquid";
|
|
124
|
+
binance: "binance";
|
|
125
|
+
bybit: "bybit";
|
|
126
|
+
okx: "okx";
|
|
127
|
+
lighter: "lighter";
|
|
128
|
+
}>;
|
|
129
|
+
symbol: z.ZodString;
|
|
130
|
+
quantity: z.ZodString;
|
|
131
|
+
timestamp: z.ZodNumber;
|
|
132
|
+
tradeFee: z.ZodString;
|
|
133
|
+
builderFee: z.ZodString;
|
|
134
|
+
}, z.core.$strip>>>;
|
|
135
|
+
export declare const ReconcileFillsRequest: z.ZodRecord<z.ZodString, z.ZodTuple<[z.ZodObject<{
|
|
136
|
+
exchangeFillId: z.ZodString;
|
|
137
|
+
cloid: z.ZodString;
|
|
138
|
+
connector: z.ZodEnum<{
|
|
139
|
+
hyperliquid: "hyperliquid";
|
|
140
|
+
binance: "binance";
|
|
141
|
+
bybit: "bybit";
|
|
142
|
+
okx: "okx";
|
|
143
|
+
lighter: "lighter";
|
|
144
|
+
}>;
|
|
145
|
+
symbol: z.ZodString;
|
|
146
|
+
price: z.ZodString;
|
|
147
|
+
quantity: z.ZodString;
|
|
148
|
+
side: z.ZodEnum<{
|
|
149
|
+
BUY: "BUY";
|
|
150
|
+
SELL: "SELL";
|
|
151
|
+
}>;
|
|
152
|
+
reduceOnly: z.ZodBoolean;
|
|
153
|
+
timestamp: z.ZodNumber;
|
|
154
|
+
tradeFee: z.ZodString;
|
|
155
|
+
builderFee: z.ZodString;
|
|
156
|
+
liquidation: z.ZodNullable<z.ZodObject<{
|
|
157
|
+
mark: z.ZodString;
|
|
158
|
+
}, z.core.$strip>>;
|
|
159
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
160
|
+
exchangeFillId: z.ZodString;
|
|
161
|
+
cloid: z.ZodString;
|
|
162
|
+
connector: z.ZodEnum<{
|
|
163
|
+
hyperliquid: "hyperliquid";
|
|
164
|
+
binance: "binance";
|
|
165
|
+
bybit: "bybit";
|
|
166
|
+
okx: "okx";
|
|
167
|
+
lighter: "lighter";
|
|
168
|
+
}>;
|
|
169
|
+
symbol: z.ZodString;
|
|
170
|
+
price: z.ZodString;
|
|
171
|
+
quantity: z.ZodString;
|
|
172
|
+
side: z.ZodEnum<{
|
|
173
|
+
BUY: "BUY";
|
|
174
|
+
SELL: "SELL";
|
|
175
|
+
}>;
|
|
176
|
+
reduceOnly: z.ZodBoolean;
|
|
177
|
+
timestamp: z.ZodNumber;
|
|
178
|
+
tradeFee: z.ZodString;
|
|
179
|
+
builderFee: z.ZodString;
|
|
180
|
+
liquidation: z.ZodNullable<z.ZodObject<{
|
|
181
|
+
mark: z.ZodString;
|
|
182
|
+
}, z.core.$strip>>;
|
|
183
|
+
}, z.core.$strip>], z.ZodObject<{
|
|
184
|
+
exchangeFillId: z.ZodString;
|
|
185
|
+
cloid: z.ZodString;
|
|
186
|
+
connector: z.ZodEnum<{
|
|
187
|
+
hyperliquid: "hyperliquid";
|
|
188
|
+
binance: "binance";
|
|
189
|
+
bybit: "bybit";
|
|
190
|
+
okx: "okx";
|
|
191
|
+
lighter: "lighter";
|
|
192
|
+
}>;
|
|
193
|
+
symbol: z.ZodString;
|
|
194
|
+
price: z.ZodString;
|
|
195
|
+
quantity: z.ZodString;
|
|
196
|
+
side: z.ZodEnum<{
|
|
197
|
+
BUY: "BUY";
|
|
198
|
+
SELL: "SELL";
|
|
199
|
+
}>;
|
|
200
|
+
reduceOnly: z.ZodBoolean;
|
|
201
|
+
timestamp: z.ZodNumber;
|
|
202
|
+
tradeFee: z.ZodString;
|
|
203
|
+
builderFee: z.ZodString;
|
|
204
|
+
liquidation: z.ZodNullable<z.ZodObject<{
|
|
205
|
+
mark: z.ZodString;
|
|
206
|
+
}, z.core.$strip>>;
|
|
207
|
+
}, z.core.$strip>>>;
|
|
208
|
+
export declare const CreateFillsRequest: z.ZodRecord<z.ZodUUID, z.ZodTuple<[z.ZodObject<{
|
|
209
|
+
type: z.ZodLiteral<"create">;
|
|
210
|
+
exchangeFillId: z.ZodString;
|
|
211
|
+
cloid: z.ZodNullable<z.ZodString>;
|
|
212
|
+
positionId: z.ZodUUID;
|
|
213
|
+
connector: z.ZodEnum<{
|
|
214
|
+
hyperliquid: "hyperliquid";
|
|
215
|
+
binance: "binance";
|
|
216
|
+
bybit: "bybit";
|
|
217
|
+
okx: "okx";
|
|
218
|
+
lighter: "lighter";
|
|
219
|
+
}>;
|
|
220
|
+
symbol: z.ZodString;
|
|
221
|
+
price: z.ZodString;
|
|
222
|
+
quantity: z.ZodString;
|
|
223
|
+
side: z.ZodEnum<{
|
|
224
|
+
BUY: "BUY";
|
|
225
|
+
SELL: "SELL";
|
|
226
|
+
}>;
|
|
227
|
+
reduceOnly: z.ZodBoolean;
|
|
228
|
+
timestamp: z.ZodNumber;
|
|
229
|
+
tradeFee: z.ZodString;
|
|
230
|
+
liquidation: z.ZodNullable<z.ZodObject<{
|
|
231
|
+
mark: z.ZodString;
|
|
232
|
+
}, z.core.$strip>>;
|
|
233
|
+
original: z.ZodOptional<z.ZodObject<{
|
|
234
|
+
exchangeFillId: z.ZodString;
|
|
235
|
+
quantity: z.ZodString;
|
|
236
|
+
}, z.core.$strip>>;
|
|
237
|
+
}, z.core.$strip>], z.ZodObject<{
|
|
238
|
+
type: z.ZodLiteral<"create">;
|
|
239
|
+
exchangeFillId: z.ZodString;
|
|
240
|
+
cloid: z.ZodNullable<z.ZodString>;
|
|
241
|
+
positionId: z.ZodUUID;
|
|
242
|
+
connector: z.ZodEnum<{
|
|
243
|
+
hyperliquid: "hyperliquid";
|
|
244
|
+
binance: "binance";
|
|
245
|
+
bybit: "bybit";
|
|
246
|
+
okx: "okx";
|
|
247
|
+
lighter: "lighter";
|
|
248
|
+
}>;
|
|
249
|
+
symbol: z.ZodString;
|
|
250
|
+
price: z.ZodString;
|
|
251
|
+
quantity: z.ZodString;
|
|
252
|
+
side: z.ZodEnum<{
|
|
253
|
+
BUY: "BUY";
|
|
254
|
+
SELL: "SELL";
|
|
255
|
+
}>;
|
|
256
|
+
reduceOnly: z.ZodBoolean;
|
|
257
|
+
timestamp: z.ZodNumber;
|
|
258
|
+
tradeFee: z.ZodString;
|
|
259
|
+
liquidation: z.ZodNullable<z.ZodObject<{
|
|
260
|
+
mark: z.ZodString;
|
|
261
|
+
}, z.core.$strip>>;
|
|
262
|
+
original: z.ZodOptional<z.ZodObject<{
|
|
263
|
+
exchangeFillId: z.ZodString;
|
|
264
|
+
quantity: z.ZodString;
|
|
265
|
+
}, z.core.$strip>>;
|
|
266
|
+
}, z.core.$strip>>>;
|
|
267
|
+
export declare const SyncSinceRequest: z.ZodObject<{
|
|
268
|
+
overlapMs: z.ZodNumber;
|
|
269
|
+
nowMs: z.ZodOptional<z.ZodNumber>;
|
|
270
|
+
bootstrapLookbackMs: z.ZodOptional<z.ZodNumber>;
|
|
271
|
+
}, z.core.$strip>;
|
|
272
|
+
export type ConfirmFillsRequest = z.output<typeof ConfirmFillsRequest>;
|
|
273
|
+
export type ReconcileFillsRequest = z.output<typeof ReconcileFillsRequest>;
|
|
274
|
+
export type CreateFillsRequest = z.output<typeof CreateFillsRequest>;
|
|
275
|
+
export type SyncSinceRequest = z.output<typeof SyncSinceRequest>;
|
|
276
|
+
export type UnknownExternalFill = z.output<typeof UnknownExternalFill>;
|
|
277
|
+
export type ReconcileReplacementExternalFill = z.output<typeof ReconcileReplacementExternalFill>;
|
|
278
|
+
export type ConfirmableExternalFill = z.output<typeof ConfirmableExternalFill>;
|
|
279
|
+
export type CreatableExternalFill = z.output<typeof CreatableExternalFill>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { RefineMinimumOneKeyValuePair } from '../common/refinement';
|
|
3
|
+
import { UnsignedDecimalString, Side } from '../common/schema';
|
|
4
|
+
import { Connector } from '../connector';
|
|
5
|
+
import { InstrumentId } from '../instrument';
|
|
6
|
+
|
|
7
|
+
const UnknownExternalFill = z.object({
|
|
8
|
+
exchangeFillId: z.string().trim().min(1, "Exchange fill ID must be non-empty"),
|
|
9
|
+
cloid: z.string().nullable(),
|
|
10
|
+
connector: Connector,
|
|
11
|
+
symbol: InstrumentId,
|
|
12
|
+
price: UnsignedDecimalString,
|
|
13
|
+
quantity: UnsignedDecimalString,
|
|
14
|
+
side: Side,
|
|
15
|
+
reduceOnly: z.boolean(),
|
|
16
|
+
timestamp: z.number().int().positive().describe("Unix timestamp in milliseconds"),
|
|
17
|
+
tradeFee: UnsignedDecimalString,
|
|
18
|
+
builderFee: UnsignedDecimalString,
|
|
19
|
+
liquidation: z.object({ mark: UnsignedDecimalString }).nullable()
|
|
20
|
+
});
|
|
21
|
+
const ConfirmableExternalFill = z.object({
|
|
22
|
+
type: z.literal("confirm"),
|
|
23
|
+
exchangeFillId: z.string().trim().min(1, "Exchange fill ID must be non-empty"),
|
|
24
|
+
cloid: z.string(),
|
|
25
|
+
positionId: z.uuid().describe("Position ID"),
|
|
26
|
+
connector: Connector,
|
|
27
|
+
symbol: InstrumentId,
|
|
28
|
+
quantity: UnsignedDecimalString,
|
|
29
|
+
timestamp: z.number().int().positive().describe("Unix timestamp in milliseconds"),
|
|
30
|
+
tradeFee: UnsignedDecimalString,
|
|
31
|
+
builderFee: UnsignedDecimalString
|
|
32
|
+
});
|
|
33
|
+
const ReconcileReplacementExternalFill = z.object({
|
|
34
|
+
exchangeFillId: z.string().trim().min(1, "Exchange fill ID must be non-empty"),
|
|
35
|
+
cloid: z.string(),
|
|
36
|
+
connector: Connector,
|
|
37
|
+
symbol: InstrumentId,
|
|
38
|
+
price: UnsignedDecimalString,
|
|
39
|
+
quantity: UnsignedDecimalString,
|
|
40
|
+
side: Side,
|
|
41
|
+
reduceOnly: z.boolean(),
|
|
42
|
+
timestamp: z.number().int().positive().describe("Unix timestamp in milliseconds"),
|
|
43
|
+
tradeFee: UnsignedDecimalString,
|
|
44
|
+
builderFee: UnsignedDecimalString,
|
|
45
|
+
liquidation: z.object({ mark: UnsignedDecimalString }).nullable()
|
|
46
|
+
});
|
|
47
|
+
const CreatableExternalFill = z.object({
|
|
48
|
+
type: z.literal("create"),
|
|
49
|
+
exchangeFillId: z.string().trim().min(1, "Exchange fill ID must be non-empty"),
|
|
50
|
+
cloid: z.string().nullable(),
|
|
51
|
+
positionId: z.uuid().describe("Position ID"),
|
|
52
|
+
connector: Connector,
|
|
53
|
+
symbol: InstrumentId,
|
|
54
|
+
price: UnsignedDecimalString,
|
|
55
|
+
quantity: UnsignedDecimalString,
|
|
56
|
+
side: Side,
|
|
57
|
+
reduceOnly: z.boolean(),
|
|
58
|
+
timestamp: z.number().int().positive().describe("Unix timestamp in milliseconds"),
|
|
59
|
+
tradeFee: UnsignedDecimalString,
|
|
60
|
+
liquidation: z.object({ mark: UnsignedDecimalString }).nullable(),
|
|
61
|
+
original: z.object({
|
|
62
|
+
exchangeFillId: z.string().trim().min(1, "Exchange fill ID must be non-empty"),
|
|
63
|
+
quantity: UnsignedDecimalString
|
|
64
|
+
}).optional()
|
|
65
|
+
});
|
|
66
|
+
const ConfirmFillsRequest = z.record(z.uuid().describe("Position ID"), z.tuple([ConfirmableExternalFill]).rest(ConfirmableExternalFill)).superRefine(RefineMinimumOneKeyValuePair);
|
|
67
|
+
const ReconcileFillsRequest = z.record(
|
|
68
|
+
z.string().trim().min(1, "CLOID must be non-empty"),
|
|
69
|
+
z.tuple([ReconcileReplacementExternalFill, ReconcileReplacementExternalFill]).rest(ReconcileReplacementExternalFill)
|
|
70
|
+
).superRefine(RefineMinimumOneKeyValuePair);
|
|
71
|
+
const CreateFillsRequest = z.record(z.uuid().describe("Position ID"), z.tuple([CreatableExternalFill]).rest(CreatableExternalFill)).superRefine(RefineMinimumOneKeyValuePair);
|
|
72
|
+
const SyncSinceRequest = z.object({
|
|
73
|
+
overlapMs: z.number().int().positive(),
|
|
74
|
+
nowMs: z.number().int().nonnegative().optional(),
|
|
75
|
+
bootstrapLookbackMs: z.number().int().positive().optional()
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
export { ConfirmFillsRequest, ConfirmableExternalFill, CreatableExternalFill, CreateFillsRequest, ReconcileFillsRequest, ReconcileReplacementExternalFill, SyncSinceRequest, UnknownExternalFill };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SyncFillsResponse: z.ZodObject<{}, z.core.$strip>;
|
|
3
|
+
export declare const SyncSinceResponse: z.ZodObject<{
|
|
4
|
+
since: z.ZodISODateTime;
|
|
5
|
+
sinceMs: z.ZodNumber;
|
|
6
|
+
safeTs: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
confirmedExchangeFillIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type SyncFillsResponse = z.output<typeof SyncFillsResponse>;
|
|
10
|
+
export type SyncSinceResponse = z.output<typeof SyncSinceResponse>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const SyncFillsResponse = z.object({});
|
|
4
|
+
const SyncSinceResponse = z.object({
|
|
5
|
+
since: z.iso.datetime(),
|
|
6
|
+
sinceMs: z.number().int().nonnegative(),
|
|
7
|
+
safeTs: z.number().int().nonnegative().optional(),
|
|
8
|
+
confirmedExchangeFillIds: z.array(z.string()).optional()
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { SyncFillsResponse, SyncSinceResponse };
|
package/dist/trade/payloads.d.ts
CHANGED
|
@@ -67,10 +67,15 @@ 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.
|
|
70
|
+
bracketType: z.ZodEnum<{
|
|
71
71
|
STOP_LOSS: "STOP_LOSS";
|
|
72
72
|
TAKE_PROFIT: "TAKE_PROFIT";
|
|
73
|
-
|
|
73
|
+
NONE: "NONE";
|
|
74
|
+
}>;
|
|
75
|
+
trailing: z.ZodOptional<z.ZodObject<{
|
|
76
|
+
deltaValue: z.ZodNumber;
|
|
77
|
+
activationValue: z.ZodNumber;
|
|
78
|
+
}, z.core.$strip>>;
|
|
74
79
|
}, z.core.$strip>>;
|
|
75
80
|
}, z.core.$strip>;
|
|
76
81
|
export declare const CreateMarketAdjust: z.ZodObject<{
|
|
@@ -175,10 +180,15 @@ export declare const CreateTradeOpen: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
175
180
|
threshold_bps: z.ZodNumber;
|
|
176
181
|
}, z.core.$strip>;
|
|
177
182
|
}, z.core.$strip>], "type">;
|
|
178
|
-
bracketType: z.
|
|
183
|
+
bracketType: z.ZodEnum<{
|
|
179
184
|
STOP_LOSS: "STOP_LOSS";
|
|
180
185
|
TAKE_PROFIT: "TAKE_PROFIT";
|
|
181
|
-
|
|
186
|
+
NONE: "NONE";
|
|
187
|
+
}>;
|
|
188
|
+
trailing: z.ZodOptional<z.ZodObject<{
|
|
189
|
+
deltaValue: z.ZodNumber;
|
|
190
|
+
activationValue: z.ZodNumber;
|
|
191
|
+
}, z.core.$strip>>;
|
|
182
192
|
}, z.core.$strip>>;
|
|
183
193
|
}, z.core.$strip>], "type">;
|
|
184
194
|
export declare const CreateTradeAdjust: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -133,7 +133,7 @@ export declare const CreateTradeOpenResponse: z.ZodObject<{
|
|
|
133
133
|
orderType: z.ZodLiteral<"MARKET">;
|
|
134
134
|
position: z.ZodObject<{
|
|
135
135
|
id: z.ZodUUID;
|
|
136
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodString
|
|
136
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
137
137
|
}, z.core.$strip>;
|
|
138
138
|
legs: z.ZodTuple<[z.ZodObject<{
|
|
139
139
|
symbol: z.ZodString;
|
|
@@ -215,7 +215,7 @@ export declare const CreateTradeOpenResponse: z.ZodObject<{
|
|
|
215
215
|
orderType: z.ZodLiteral<"MARKET">;
|
|
216
216
|
position: z.ZodObject<{
|
|
217
217
|
id: z.ZodUUID;
|
|
218
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodString
|
|
218
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
219
219
|
}, z.core.$strip>;
|
|
220
220
|
}, z.core.$strip>], "intent">], "orderType">;
|
|
221
221
|
}, z.core.$strip>;
|
|
@@ -354,7 +354,7 @@ export declare const CreateTradeAdjustResponse: z.ZodObject<{
|
|
|
354
354
|
orderType: z.ZodLiteral<"MARKET">;
|
|
355
355
|
position: z.ZodObject<{
|
|
356
356
|
id: z.ZodUUID;
|
|
357
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodString
|
|
357
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
358
358
|
}, z.core.$strip>;
|
|
359
359
|
legs: z.ZodTuple<[z.ZodObject<{
|
|
360
360
|
symbol: z.ZodString;
|
|
@@ -436,7 +436,7 @@ export declare const CreateTradeAdjustResponse: z.ZodObject<{
|
|
|
436
436
|
orderType: z.ZodLiteral<"MARKET">;
|
|
437
437
|
position: z.ZodObject<{
|
|
438
438
|
id: z.ZodUUID;
|
|
439
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodString
|
|
439
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
440
440
|
}, z.core.$strip>;
|
|
441
441
|
}, z.core.$strip>], "intent">], "orderType">;
|
|
442
442
|
}, z.core.$strip>;
|
|
@@ -575,7 +575,7 @@ export declare const CreateTradeCloseResponse: z.ZodObject<{
|
|
|
575
575
|
orderType: z.ZodLiteral<"MARKET">;
|
|
576
576
|
position: z.ZodObject<{
|
|
577
577
|
id: z.ZodUUID;
|
|
578
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodString
|
|
578
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
579
579
|
}, z.core.$strip>;
|
|
580
580
|
legs: z.ZodTuple<[z.ZodObject<{
|
|
581
581
|
symbol: z.ZodString;
|
|
@@ -657,7 +657,7 @@ export declare const CreateTradeCloseResponse: z.ZodObject<{
|
|
|
657
657
|
orderType: z.ZodLiteral<"MARKET">;
|
|
658
658
|
position: z.ZodObject<{
|
|
659
659
|
id: z.ZodUUID;
|
|
660
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodString
|
|
660
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
661
661
|
}, z.core.$strip>;
|
|
662
662
|
}, z.core.$strip>], "intent">], "orderType">;
|
|
663
663
|
}, z.core.$strip>;
|
|
@@ -796,7 +796,7 @@ export declare const CreateTradeCloseAllResponse: z.ZodObject<{
|
|
|
796
796
|
orderType: z.ZodLiteral<"MARKET">;
|
|
797
797
|
position: z.ZodObject<{
|
|
798
798
|
id: z.ZodUUID;
|
|
799
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodString
|
|
799
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
800
800
|
}, z.core.$strip>;
|
|
801
801
|
legs: z.ZodTuple<[z.ZodObject<{
|
|
802
802
|
symbol: z.ZodString;
|
|
@@ -878,7 +878,7 @@ export declare const CreateTradeCloseAllResponse: z.ZodObject<{
|
|
|
878
878
|
orderType: z.ZodLiteral<"MARKET">;
|
|
879
879
|
position: z.ZodObject<{
|
|
880
880
|
id: z.ZodUUID;
|
|
881
|
-
exposure: z.ZodRecord<z.ZodString, z.ZodString
|
|
881
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
882
882
|
}, z.core.$strip>;
|
|
883
883
|
}, z.core.$strip>], "intent">], "orderType">>;
|
|
884
884
|
}, z.core.$strip>;
|
|
@@ -7,6 +7,9 @@ declare const HyperliquidMetadata: z.ZodObject<{
|
|
|
7
7
|
isSubaccount: z.ZodBoolean;
|
|
8
8
|
mainAccountAddress: z.ZodString;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
|
+
declare const LighterMetadata: z.ZodObject<{
|
|
11
|
+
l1_address: z.ZodString;
|
|
12
|
+
}, z.core.$strip>;
|
|
10
13
|
export declare const TradeAccount: z.ZodObject<{
|
|
11
14
|
id: z.ZodUUID;
|
|
12
15
|
alias: z.ZodString;
|
|
@@ -22,6 +25,8 @@ export declare const TradeAccount: z.ZodObject<{
|
|
|
22
25
|
agentWalletAddress: z.ZodString;
|
|
23
26
|
isSubaccount: z.ZodBoolean;
|
|
24
27
|
mainAccountAddress: z.ZodString;
|
|
28
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
29
|
+
l1_address: z.ZodString;
|
|
25
30
|
}, z.core.$strip>]>>;
|
|
26
31
|
createdAt: z.ZodString;
|
|
27
32
|
updatedAt: z.ZodString;
|
|
@@ -29,4 +34,5 @@ export declare const TradeAccount: z.ZodObject<{
|
|
|
29
34
|
}, z.core.$strip>;
|
|
30
35
|
export type TradeAccount = z.infer<typeof TradeAccount>;
|
|
31
36
|
export type HyperliquidMetadata = z.infer<typeof HyperliquidMetadata>;
|
|
37
|
+
export type LighterMetadata = z.infer<typeof LighterMetadata>;
|
|
32
38
|
export {};
|