@pear-protocol/types 2.11.0 → 2.12.1

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.
Files changed (66) hide show
  1. package/dist/auth/payloads.d.ts +3 -3
  2. package/dist/auth/payloads.js +1 -1
  3. package/dist/baskets/saved/entities.js +1 -1
  4. package/dist/bundle.d.ts +2 -0
  5. package/dist/bundle.js +2 -0
  6. package/dist/common/refinement.d.ts +3 -3
  7. package/dist/common/trade-legs.js +1 -1
  8. package/dist/copy/entities.d.ts +186 -0
  9. package/dist/copy/entities.js +113 -0
  10. package/dist/copy/index.d.ts +4 -0
  11. package/dist/copy/index.js +4 -0
  12. package/dist/copy/payloads.d.ts +14 -0
  13. package/dist/copy/payloads.js +8 -0
  14. package/dist/copy/queries.d.ts +13 -0
  15. package/dist/copy/queries.js +16 -0
  16. package/dist/copy/responses.d.ts +332 -0
  17. package/dist/copy/responses.js +91 -0
  18. package/dist/execution/entities.d.ts +71 -71
  19. package/dist/execution/entities.js +1 -1
  20. package/dist/execution/queries.d.ts +2 -2
  21. package/dist/execution/responses.d.ts +40 -40
  22. package/dist/ladder/entities.d.ts +22 -17
  23. package/dist/ladder/queries.d.ts +5 -0
  24. package/dist/ladder/queries.js +6 -2
  25. package/dist/ladder/responses.d.ts +63 -48
  26. package/dist/misc/payloads.d.ts +26 -0
  27. package/dist/misc/payloads.js +27 -1
  28. package/dist/misc/responses.d.ts +8 -0
  29. package/dist/misc/responses.js +7 -1
  30. package/dist/notification/entities.d.ts +120 -0
  31. package/dist/notification/entities.js +59 -3
  32. package/dist/notification/responses.d.ts +60 -0
  33. package/dist/order/entities.d.ts +3 -3
  34. package/dist/position/entities.d.ts +1 -1
  35. package/dist/position/responses.d.ts +3 -1
  36. package/dist/position/responses.js +2 -0
  37. package/dist/schedule/entities.d.ts +18 -12
  38. package/dist/schedule/entities.js +2 -1
  39. package/dist/schedule/queries.d.ts +2 -2
  40. package/dist/schedule/responses.d.ts +12 -8
  41. package/dist/schedule/twap-config.js +1 -1
  42. package/dist/statistics/entities.d.ts +10 -0
  43. package/dist/statistics/entities.js +4 -0
  44. package/dist/statistics/responses.d.ts +10 -0
  45. package/dist/sync/payloads.d.ts +12 -0
  46. package/dist/sync/payloads.js +31 -3
  47. package/dist/tca/responses.d.ts +12 -12
  48. package/dist/trade/responses.d.ts +100 -100
  49. package/dist/trade-accounts/entities.d.ts +136 -12
  50. package/dist/trade-accounts/entities.js +41 -9
  51. package/dist/trade-accounts/payloads.d.ts +12 -0
  52. package/dist/trade-accounts/payloads.js +7 -1
  53. package/dist/trade-accounts/response.d.ts +963 -223
  54. package/dist/traders/index.d.ts +1 -0
  55. package/dist/traders/index.js +1 -0
  56. package/dist/traders/public.d.ts +5053 -0
  57. package/dist/traders/public.js +161 -0
  58. package/dist/trigger/common/index.d.ts +3 -2
  59. package/dist/trigger/common/index.js +1 -0
  60. package/dist/trigger/entities/index.d.ts +64 -48
  61. package/dist/trigger/entities/index.js +3 -3
  62. package/dist/trigger/queries.d.ts +2 -2
  63. package/dist/trigger/responses.d.ts +40 -30
  64. package/dist/vaults/entities.d.ts +1 -1
  65. package/dist/vaults/responses.d.ts +2 -2
  66. package/package.json +2 -2
@@ -0,0 +1,332 @@
1
+ import { z } from 'zod';
2
+ /** Current relationship only; NONE does not imply that the account has no positions. */
3
+ export declare const CopyStateResponse: z.ZodDiscriminatedUnion<[z.ZodObject<{
4
+ state: z.ZodLiteral<"NONE">;
5
+ }, z.core.$strip>, z.ZodObject<{
6
+ state: z.ZodLiteral<"ACTIVE">;
7
+ subscription: z.ZodObject<{
8
+ id: z.ZodUUID;
9
+ leaderTradeAccountId: z.ZodUUID;
10
+ followerTradeAccountId: z.ZodUUID;
11
+ connector: z.ZodEnum<{
12
+ hyperliquid: "hyperliquid";
13
+ binance: "binance";
14
+ bybit: "bybit";
15
+ okx: "okx";
16
+ lighter: "lighter";
17
+ lighter_rhc: "lighter_rhc";
18
+ }>;
19
+ sizing: z.ZodDiscriminatedUnion<[z.ZodObject<{
20
+ mode: z.ZodLiteral<"LEADER_EQUITY_FRACTION">;
21
+ }, z.core.$strip>], "mode">;
22
+ createdAt: z.ZodString;
23
+ endedAt: z.ZodOptional<z.ZodString>;
24
+ status: z.ZodLiteral<"ACTIVE">;
25
+ }, z.core.$strip>;
26
+ }, z.core.$strip>], "state">;
27
+ export type CopyStateResponse = z.output<typeof CopyStateResponse>;
28
+ /** All current follower accounts, including accounts without X. */
29
+ export declare const CopyFollowersResponse: z.ZodObject<{
30
+ followers: z.ZodArray<z.ZodObject<{
31
+ tradeAccountId: z.ZodUUID;
32
+ status: z.ZodLiteral<"ACTIVE">;
33
+ followedAt: z.ZodString;
34
+ xUserId: z.ZodOptional<z.ZodString>;
35
+ xHandle: z.ZodOptional<z.ZodString>;
36
+ xName: z.ZodOptional<z.ZodString>;
37
+ xAvatarUrl: z.ZodOptional<z.ZodString>;
38
+ }, z.core.$strip>>;
39
+ followerCount: z.ZodNumber;
40
+ }, z.core.$strip>;
41
+ export type CopyFollowersResponse = z.output<typeof CopyFollowersResponse>;
42
+ export declare const CopySubscriptionResponse: z.ZodObject<{
43
+ subscription: z.ZodObject<{
44
+ id: z.ZodUUID;
45
+ leaderTradeAccountId: z.ZodUUID;
46
+ followerTradeAccountId: z.ZodUUID;
47
+ connector: z.ZodEnum<{
48
+ hyperliquid: "hyperliquid";
49
+ binance: "binance";
50
+ bybit: "bybit";
51
+ okx: "okx";
52
+ lighter: "lighter";
53
+ lighter_rhc: "lighter_rhc";
54
+ }>;
55
+ status: z.ZodEnum<{
56
+ ACTIVE: "ACTIVE";
57
+ ENDED: "ENDED";
58
+ }>;
59
+ sizing: z.ZodDiscriminatedUnion<[z.ZodObject<{
60
+ mode: z.ZodLiteral<"LEADER_EQUITY_FRACTION">;
61
+ }, z.core.$strip>], "mode">;
62
+ createdAt: z.ZodString;
63
+ endedAt: z.ZodOptional<z.ZodString>;
64
+ }, z.core.$strip>;
65
+ }, z.core.$strip>;
66
+ export type CopySubscriptionResponse = z.output<typeof CopySubscriptionResponse>;
67
+ /** Stopping returns the committed subscription. */
68
+ export declare const EndCopySubscriptionResponse: z.ZodObject<{
69
+ subscription: z.ZodObject<{
70
+ id: z.ZodUUID;
71
+ leaderTradeAccountId: z.ZodUUID;
72
+ followerTradeAccountId: z.ZodUUID;
73
+ connector: z.ZodEnum<{
74
+ hyperliquid: "hyperliquid";
75
+ binance: "binance";
76
+ bybit: "bybit";
77
+ okx: "okx";
78
+ lighter: "lighter";
79
+ lighter_rhc: "lighter_rhc";
80
+ }>;
81
+ status: z.ZodEnum<{
82
+ ACTIVE: "ACTIVE";
83
+ ENDED: "ENDED";
84
+ }>;
85
+ sizing: z.ZodDiscriminatedUnion<[z.ZodObject<{
86
+ mode: z.ZodLiteral<"LEADER_EQUITY_FRACTION">;
87
+ }, z.core.$strip>], "mode">;
88
+ createdAt: z.ZodString;
89
+ endedAt: z.ZodOptional<z.ZodString>;
90
+ }, z.core.$strip>;
91
+ }, z.core.$strip>;
92
+ export type EndCopySubscriptionResponse = z.output<typeof EndCopySubscriptionResponse>;
93
+ /** The result of each existing position entry attempted at subscription start. */
94
+ export declare const CopyJoinResult: z.ZodDiscriminatedUnion<[z.ZodObject<{
95
+ leaderPositionId: z.ZodUUID;
96
+ outcome: z.ZodLiteral<"COPIED">;
97
+ positionId: z.ZodUUID;
98
+ }, z.core.$strip>, z.ZodObject<{
99
+ leaderPositionId: z.ZodUUID;
100
+ outcome: z.ZodLiteral<"PARTIAL">;
101
+ positionId: z.ZodUUID;
102
+ reason: z.ZodString;
103
+ }, z.core.$strip>, z.ZodObject<{
104
+ leaderPositionId: z.ZodUUID;
105
+ outcome: z.ZodLiteral<"SKIPPED">;
106
+ reason: z.ZodEnum<{
107
+ SUBSCRIPTION_NOT_ACTIVE: "SUBSCRIPTION_NOT_ACTIVE";
108
+ POSITION_EXCLUDED: "POSITION_EXCLUDED";
109
+ INCLUDED_IN_JOIN: "INCLUDED_IN_JOIN";
110
+ VENUE_MISMATCH: "VENUE_MISMATCH";
111
+ BELOW_VENUE_MINIMUM: "BELOW_VENUE_MINIMUM";
112
+ PAIR_ALREADY_ENTERED: "PAIR_ALREADY_ENTERED";
113
+ ENTRY_EXPIRED: "ENTRY_EXPIRED";
114
+ FOLLOWER_LEG_ABSENT: "FOLLOWER_LEG_ABSENT";
115
+ LEADER_LEG_REOPENED: "LEADER_LEG_REOPENED";
116
+ NO_FOLLOWER_DELTA: "NO_FOLLOWER_DELTA";
117
+ LEADER_EQUITY_UNREADABLE: "LEADER_EQUITY_UNREADABLE";
118
+ FOLLOWER_EQUITY_UNREADABLE: "FOLLOWER_EQUITY_UNREADABLE";
119
+ PRICE_UNAVAILABLE: "PRICE_UNAVAILABLE";
120
+ LEVERAGE_NOT_APPLIED: "LEVERAGE_NOT_APPLIED";
121
+ }>;
122
+ }, z.core.$strip>, z.ZodObject<{
123
+ leaderPositionId: z.ZodUUID;
124
+ outcome: z.ZodLiteral<"FAILED">;
125
+ reason: z.ZodString;
126
+ }, z.core.$strip>, z.ZodObject<{
127
+ leaderPositionId: z.ZodUUID;
128
+ outcome: z.ZodLiteral<"UNCONFIRMED">;
129
+ }, z.core.$strip>], "outcome">;
130
+ export type CopyJoinResult = z.output<typeof CopyJoinResult>;
131
+ export declare const CreateCopySubscriptionResponse: z.ZodObject<{
132
+ subscription: z.ZodObject<{
133
+ id: z.ZodUUID;
134
+ leaderTradeAccountId: z.ZodUUID;
135
+ followerTradeAccountId: z.ZodUUID;
136
+ connector: z.ZodEnum<{
137
+ hyperliquid: "hyperliquid";
138
+ binance: "binance";
139
+ bybit: "bybit";
140
+ okx: "okx";
141
+ lighter: "lighter";
142
+ lighter_rhc: "lighter_rhc";
143
+ }>;
144
+ status: z.ZodEnum<{
145
+ ACTIVE: "ACTIVE";
146
+ ENDED: "ENDED";
147
+ }>;
148
+ sizing: z.ZodDiscriminatedUnion<[z.ZodObject<{
149
+ mode: z.ZodLiteral<"LEADER_EQUITY_FRACTION">;
150
+ }, z.core.$strip>], "mode">;
151
+ createdAt: z.ZodString;
152
+ endedAt: z.ZodOptional<z.ZodString>;
153
+ }, z.core.$strip>;
154
+ joinResults: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
155
+ leaderPositionId: z.ZodUUID;
156
+ outcome: z.ZodLiteral<"COPIED">;
157
+ positionId: z.ZodUUID;
158
+ }, z.core.$strip>, z.ZodObject<{
159
+ leaderPositionId: z.ZodUUID;
160
+ outcome: z.ZodLiteral<"PARTIAL">;
161
+ positionId: z.ZodUUID;
162
+ reason: z.ZodString;
163
+ }, z.core.$strip>, z.ZodObject<{
164
+ leaderPositionId: z.ZodUUID;
165
+ outcome: z.ZodLiteral<"SKIPPED">;
166
+ reason: z.ZodEnum<{
167
+ SUBSCRIPTION_NOT_ACTIVE: "SUBSCRIPTION_NOT_ACTIVE";
168
+ POSITION_EXCLUDED: "POSITION_EXCLUDED";
169
+ INCLUDED_IN_JOIN: "INCLUDED_IN_JOIN";
170
+ VENUE_MISMATCH: "VENUE_MISMATCH";
171
+ BELOW_VENUE_MINIMUM: "BELOW_VENUE_MINIMUM";
172
+ PAIR_ALREADY_ENTERED: "PAIR_ALREADY_ENTERED";
173
+ ENTRY_EXPIRED: "ENTRY_EXPIRED";
174
+ FOLLOWER_LEG_ABSENT: "FOLLOWER_LEG_ABSENT";
175
+ LEADER_LEG_REOPENED: "LEADER_LEG_REOPENED";
176
+ NO_FOLLOWER_DELTA: "NO_FOLLOWER_DELTA";
177
+ LEADER_EQUITY_UNREADABLE: "LEADER_EQUITY_UNREADABLE";
178
+ FOLLOWER_EQUITY_UNREADABLE: "FOLLOWER_EQUITY_UNREADABLE";
179
+ PRICE_UNAVAILABLE: "PRICE_UNAVAILABLE";
180
+ LEVERAGE_NOT_APPLIED: "LEVERAGE_NOT_APPLIED";
181
+ }>;
182
+ }, z.core.$strip>, z.ZodObject<{
183
+ leaderPositionId: z.ZodUUID;
184
+ outcome: z.ZodLiteral<"FAILED">;
185
+ reason: z.ZodString;
186
+ }, z.core.$strip>, z.ZodObject<{
187
+ leaderPositionId: z.ZodUUID;
188
+ outcome: z.ZodLiteral<"UNCONFIRMED">;
189
+ }, z.core.$strip>], "outcome">>;
190
+ }, z.core.$strip>;
191
+ export type CreateCopySubscriptionResponse = z.output<typeof CreateCopySubscriptionResponse>;
192
+ export declare const CopySubscriptionListResponse: z.ZodObject<{
193
+ subscriptions: z.ZodArray<z.ZodObject<{
194
+ id: z.ZodUUID;
195
+ leaderTradeAccountId: z.ZodUUID;
196
+ followerTradeAccountId: z.ZodUUID;
197
+ connector: z.ZodEnum<{
198
+ hyperliquid: "hyperliquid";
199
+ binance: "binance";
200
+ bybit: "bybit";
201
+ okx: "okx";
202
+ lighter: "lighter";
203
+ lighter_rhc: "lighter_rhc";
204
+ }>;
205
+ status: z.ZodEnum<{
206
+ ACTIVE: "ACTIVE";
207
+ ENDED: "ENDED";
208
+ }>;
209
+ sizing: z.ZodDiscriminatedUnion<[z.ZodObject<{
210
+ mode: z.ZodLiteral<"LEADER_EQUITY_FRACTION">;
211
+ }, z.core.$strip>], "mode">;
212
+ createdAt: z.ZodString;
213
+ endedAt: z.ZodOptional<z.ZodString>;
214
+ }, z.core.$strip>>;
215
+ }, z.core.$strip>;
216
+ export type CopySubscriptionListResponse = z.output<typeof CopySubscriptionListResponse>;
217
+ export declare const CopyActivityListResponse: z.ZodObject<{
218
+ activities: z.ZodArray<z.ZodObject<{
219
+ id: z.ZodUUID;
220
+ leaderAction: z.ZodEnum<{
221
+ OPEN: "OPEN";
222
+ ADJUST: "ADJUST";
223
+ CLOSE: "CLOSE";
224
+ REVERSE: "REVERSE";
225
+ }>;
226
+ executionSource: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
227
+ origin: z.ZodLiteral<"DIRECT">;
228
+ }, z.core.$strip>, z.ZodObject<{
229
+ origin: z.ZodLiteral<"SCHEDULE">;
230
+ scheduleId: z.ZodString;
231
+ }, z.core.$strip>, z.ZodObject<{
232
+ origin: z.ZodLiteral<"TRIGGER">;
233
+ triggerId: z.ZodString;
234
+ triggerIntent: z.ZodEnum<{
235
+ OPEN: "OPEN";
236
+ ADJUST: "ADJUST";
237
+ CLOSE: "CLOSE";
238
+ }>;
239
+ bracketType: z.ZodOptional<z.ZodString>;
240
+ ladderId: z.ZodOptional<z.ZodString>;
241
+ }, z.core.$strip>, z.ZodObject<{
242
+ origin: z.ZodLiteral<"AUTO_REBALANCE">;
243
+ configId: z.ZodString;
244
+ }, z.core.$strip>], "origin">>;
245
+ state: z.ZodEnum<{
246
+ RECORDED: "RECORDED";
247
+ DISPATCHED: "DISPATCHED";
248
+ SETTLED: "SETTLED";
249
+ }>;
250
+ outcome: z.ZodOptional<z.ZodEnum<{
251
+ COPIED: "COPIED";
252
+ PARTIAL: "PARTIAL";
253
+ SKIPPED: "SKIPPED";
254
+ FAILED: "FAILED";
255
+ }>>;
256
+ skipReason: z.ZodOptional<z.ZodEnum<{
257
+ SUBSCRIPTION_NOT_ACTIVE: "SUBSCRIPTION_NOT_ACTIVE";
258
+ POSITION_EXCLUDED: "POSITION_EXCLUDED";
259
+ INCLUDED_IN_JOIN: "INCLUDED_IN_JOIN";
260
+ VENUE_MISMATCH: "VENUE_MISMATCH";
261
+ BELOW_VENUE_MINIMUM: "BELOW_VENUE_MINIMUM";
262
+ PAIR_ALREADY_ENTERED: "PAIR_ALREADY_ENTERED";
263
+ ENTRY_EXPIRED: "ENTRY_EXPIRED";
264
+ FOLLOWER_LEG_ABSENT: "FOLLOWER_LEG_ABSENT";
265
+ LEADER_LEG_REOPENED: "LEADER_LEG_REOPENED";
266
+ NO_FOLLOWER_DELTA: "NO_FOLLOWER_DELTA";
267
+ LEADER_EQUITY_UNREADABLE: "LEADER_EQUITY_UNREADABLE";
268
+ FOLLOWER_EQUITY_UNREADABLE: "FOLLOWER_EQUITY_UNREADABLE";
269
+ PRICE_UNAVAILABLE: "PRICE_UNAVAILABLE";
270
+ LEVERAGE_NOT_APPLIED: "LEVERAGE_NOT_APPLIED";
271
+ }>>;
272
+ failureReason: z.ZodOptional<z.ZodString>;
273
+ followerLegs: z.ZodArray<z.ZodObject<{
274
+ symbol: z.ZodString;
275
+ targetQuantity: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
276
+ deltaQuantity: z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>;
277
+ }, z.core.$strip>>;
278
+ leaderEquityFraction: z.ZodOptional<z.ZodString>;
279
+ createdAt: z.ZodString;
280
+ }, z.core.$strip>>;
281
+ }, z.core.$strip>;
282
+ export type CopyActivityListResponse = z.output<typeof CopyActivityListResponse>;
283
+ /** Operational state of the PostgreSQL copy consumer exposed through the gateway health route. */
284
+ export declare const CopyHealthResponse: z.ZodObject<{
285
+ status: z.ZodEnum<{
286
+ ok: "ok";
287
+ degraded: "degraded";
288
+ }>;
289
+ consumerRunning: z.ZodBoolean;
290
+ acceptanceBlocked: z.ZodOptional<z.ZodBoolean>;
291
+ outbox: z.ZodOptional<z.ZodObject<{
292
+ pending: z.ZodNumber;
293
+ failed: z.ZodNumber;
294
+ }, z.core.$strip>>;
295
+ }, z.core.$strip>;
296
+ export type CopyHealthResponse = z.output<typeof CopyHealthResponse>;
297
+ /** Lifetime follower accounts, combining repeat subscriptions to the selected leader. */
298
+ export declare const CopyFollowerStats: z.ZodObject<{
299
+ tradeAccountId: z.ZodUUID;
300
+ xUserId: z.ZodOptional<z.ZodString>;
301
+ xHandle: z.ZodOptional<z.ZodString>;
302
+ xName: z.ZodOptional<z.ZodString>;
303
+ xAvatarUrl: z.ZodOptional<z.ZodString>;
304
+ status: z.ZodEnum<{
305
+ ACTIVE: "ACTIVE";
306
+ ENDED: "ENDED";
307
+ }>;
308
+ copiedTrades: z.ZodNumber;
309
+ copiedVolumeUsd: z.ZodString;
310
+ }, z.core.$strip>;
311
+ export type CopyFollowerStats = z.output<typeof CopyFollowerStats>;
312
+ /** Owner-only copy totals from tagged history; date filters apply only to trades and volume. */
313
+ export declare const CopyStatsResponse: z.ZodObject<{
314
+ currentFollowerCount: z.ZodNumber;
315
+ lifetimeFollowerCount: z.ZodNumber;
316
+ copiedTrades: z.ZodNumber;
317
+ copiedVolumeUsd: z.ZodString;
318
+ followers: z.ZodArray<z.ZodObject<{
319
+ tradeAccountId: z.ZodUUID;
320
+ xUserId: z.ZodOptional<z.ZodString>;
321
+ xHandle: z.ZodOptional<z.ZodString>;
322
+ xName: z.ZodOptional<z.ZodString>;
323
+ xAvatarUrl: z.ZodOptional<z.ZodString>;
324
+ status: z.ZodEnum<{
325
+ ACTIVE: "ACTIVE";
326
+ ENDED: "ENDED";
327
+ }>;
328
+ copiedTrades: z.ZodNumber;
329
+ copiedVolumeUsd: z.ZodString;
330
+ }, z.core.$strip>>;
331
+ }, z.core.$strip>;
332
+ export type CopyStatsResponse = z.output<typeof CopyStatsResponse>;
@@ -0,0 +1,91 @@
1
+ import { z } from 'zod';
2
+ import { UnsignedDecimalString } from '../common/schema';
3
+ import { CopySubscription, CopyFollower, CopySkipReason, CopyActivity, CopySubscriptionStatus } from './entities';
4
+
5
+ const CopyStateResponse = z.discriminatedUnion("state", [
6
+ z.object({
7
+ state: z.literal("NONE")
8
+ }),
9
+ z.object({
10
+ state: z.literal("ACTIVE"),
11
+ subscription: CopySubscription.extend({
12
+ status: z.literal("ACTIVE")
13
+ })
14
+ })
15
+ ]);
16
+ const CopyFollowersResponse = z.object({
17
+ followers: z.array(CopyFollower),
18
+ followerCount: z.number().int().nonnegative()
19
+ });
20
+ const CopySubscriptionResponse = z.object({
21
+ subscription: CopySubscription
22
+ });
23
+ const EndCopySubscriptionResponse = CopySubscriptionResponse;
24
+ const CopyJoinResult = z.discriminatedUnion("outcome", [
25
+ z.object({
26
+ leaderPositionId: z.uuid(),
27
+ outcome: z.literal("COPIED"),
28
+ positionId: z.uuid()
29
+ }),
30
+ z.object({
31
+ leaderPositionId: z.uuid(),
32
+ outcome: z.literal("PARTIAL"),
33
+ positionId: z.uuid(),
34
+ reason: z.string()
35
+ }),
36
+ z.object({
37
+ leaderPositionId: z.uuid(),
38
+ outcome: z.literal("SKIPPED"),
39
+ reason: CopySkipReason
40
+ }),
41
+ z.object({
42
+ leaderPositionId: z.uuid(),
43
+ outcome: z.literal("FAILED"),
44
+ reason: z.string()
45
+ }),
46
+ z.object({
47
+ leaderPositionId: z.uuid(),
48
+ outcome: z.literal("UNCONFIRMED")
49
+ })
50
+ ]);
51
+ const CreateCopySubscriptionResponse = CopySubscriptionResponse.extend({
52
+ joinResults: z.array(CopyJoinResult)
53
+ });
54
+ const CopySubscriptionListResponse = z.object({
55
+ subscriptions: z.array(CopySubscription)
56
+ });
57
+ const CopyActivityListResponse = z.object({
58
+ activities: z.array(CopyActivity)
59
+ });
60
+ const CopyHealthResponse = z.object({
61
+ status: z.enum([
62
+ "ok",
63
+ "degraded"
64
+ ]),
65
+ consumerRunning: z.boolean(),
66
+ acceptanceBlocked: z.boolean().optional(),
67
+ outbox: z.object({
68
+ pending: z.number().int().nonnegative(),
69
+ failed: z.number().int().nonnegative()
70
+ }).optional()
71
+ });
72
+ const CopyFollowerStats = CopyFollower.pick({
73
+ tradeAccountId: true,
74
+ xUserId: true,
75
+ xHandle: true,
76
+ xName: true,
77
+ xAvatarUrl: true
78
+ }).extend({
79
+ status: CopySubscriptionStatus,
80
+ copiedTrades: z.number().int().nonnegative(),
81
+ copiedVolumeUsd: UnsignedDecimalString
82
+ });
83
+ const CopyStatsResponse = z.object({
84
+ currentFollowerCount: z.number().int().nonnegative(),
85
+ lifetimeFollowerCount: z.number().int().nonnegative(),
86
+ copiedTrades: z.number().int().nonnegative(),
87
+ copiedVolumeUsd: UnsignedDecimalString,
88
+ followers: z.array(CopyFollowerStats)
89
+ });
90
+
91
+ export { CopyActivityListResponse, CopyFollowerStats, CopyFollowersResponse, CopyHealthResponse, CopyJoinResult, CopyStateResponse, CopyStatsResponse, CopySubscriptionListResponse, CopySubscriptionResponse, CreateCopySubscriptionResponse, EndCopySubscriptionResponse };