atlaas 0.0.0-stage → 0.1.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.
@@ -0,0 +1,518 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const InstanceStateSchema: z.ZodEnum<["PENDING", "DEPLOYING", "DEPLOYED", "RUNNING", "STOPPED", "ERROR"]>;
4
+ declare const InstanceTypeSchema: z.ZodEnum<["TICK", "TICKS_TRADE", "TRADE"]>;
5
+ declare const OrderDirectionSchema: z.ZodEnum<["BUY", "SELL"]>;
6
+ declare const OrderTypeSchema: z.ZodEnum<["BUY", "SELL", "BUY_LIMIT", "SELL_LIMIT", "BUY_STOP", "SELL_STOP", "BUY_STOP_LIMIT", "SELL_STOP_LIMIT"]>;
7
+ declare const InstanceSchema: z.ZodObject<{
8
+ id: z.ZodString;
9
+ accountId: z.ZodString;
10
+ serverName: z.ZodNullable<z.ZodString>;
11
+ brokerName: z.ZodNullable<z.ZodString>;
12
+ name: z.ZodNullable<z.ZodString>;
13
+ state: z.ZodEnum<["PENDING", "DEPLOYING", "DEPLOYED", "RUNNING", "STOPPED", "ERROR"]>;
14
+ type: z.ZodEnum<["TICK", "TICKS_TRADE", "TRADE"]>;
15
+ enabled: z.ZodBoolean;
16
+ lastActiveAt: z.ZodNullable<z.ZodString>;
17
+ connectedAt: z.ZodNullable<z.ZodString>;
18
+ errorMessage: z.ZodNullable<z.ZodString>;
19
+ statusMessage: z.ZodNullable<z.ZodString>;
20
+ createdAt: z.ZodString;
21
+ updatedAt: z.ZodString;
22
+ }, "strip", z.ZodTypeAny, {
23
+ id: string;
24
+ accountId: string;
25
+ serverName: string | null;
26
+ brokerName: string | null;
27
+ name: string | null;
28
+ state: "PENDING" | "DEPLOYING" | "DEPLOYED" | "RUNNING" | "STOPPED" | "ERROR";
29
+ type: "TICK" | "TICKS_TRADE" | "TRADE";
30
+ enabled: boolean;
31
+ lastActiveAt: string | null;
32
+ connectedAt: string | null;
33
+ errorMessage: string | null;
34
+ statusMessage: string | null;
35
+ createdAt: string;
36
+ updatedAt: string;
37
+ }, {
38
+ id: string;
39
+ accountId: string;
40
+ serverName: string | null;
41
+ brokerName: string | null;
42
+ name: string | null;
43
+ state: "PENDING" | "DEPLOYING" | "DEPLOYED" | "RUNNING" | "STOPPED" | "ERROR";
44
+ type: "TICK" | "TICKS_TRADE" | "TRADE";
45
+ enabled: boolean;
46
+ lastActiveAt: string | null;
47
+ connectedAt: string | null;
48
+ errorMessage: string | null;
49
+ statusMessage: string | null;
50
+ createdAt: string;
51
+ updatedAt: string;
52
+ }>;
53
+ declare const AtlasInstanceSchema: z.ZodObject<{
54
+ id: z.ZodString;
55
+ externalRef: z.ZodNullable<z.ZodString>;
56
+ externalUserId: z.ZodNullable<z.ZodString>;
57
+ instanceKind: z.ZodNullable<z.ZodString>;
58
+ runnerId: z.ZodString;
59
+ state: z.ZodEnum<["PENDING", "DEPLOYING", "DEPLOYED", "RUNNING", "STOPPED", "ERROR"]>;
60
+ enabled: z.ZodBoolean;
61
+ registeredIp: z.ZodOptional<z.ZodNullable<z.ZodString>>;
62
+ lastActiveAt: z.ZodNullable<z.ZodString>;
63
+ connectedAt: z.ZodNullable<z.ZodString>;
64
+ disconnectedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
65
+ statusMessage: z.ZodNullable<z.ZodString>;
66
+ errorMessage: z.ZodNullable<z.ZodString>;
67
+ lastError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
68
+ lastErrorAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
69
+ displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
70
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
71
+ createdAt: z.ZodOptional<z.ZodString>;
72
+ updatedAt: z.ZodOptional<z.ZodString>;
73
+ }, "strip", z.ZodTypeAny, {
74
+ id: string;
75
+ state: "PENDING" | "DEPLOYING" | "DEPLOYED" | "RUNNING" | "STOPPED" | "ERROR";
76
+ enabled: boolean;
77
+ lastActiveAt: string | null;
78
+ connectedAt: string | null;
79
+ errorMessage: string | null;
80
+ statusMessage: string | null;
81
+ externalRef: string | null;
82
+ externalUserId: string | null;
83
+ instanceKind: string | null;
84
+ runnerId: string;
85
+ createdAt?: string | undefined;
86
+ updatedAt?: string | undefined;
87
+ registeredIp?: string | null | undefined;
88
+ disconnectedAt?: string | null | undefined;
89
+ lastError?: string | null | undefined;
90
+ lastErrorAt?: string | null | undefined;
91
+ displayName?: string | null | undefined;
92
+ metadata?: Record<string, unknown> | null | undefined;
93
+ }, {
94
+ id: string;
95
+ state: "PENDING" | "DEPLOYING" | "DEPLOYED" | "RUNNING" | "STOPPED" | "ERROR";
96
+ enabled: boolean;
97
+ lastActiveAt: string | null;
98
+ connectedAt: string | null;
99
+ errorMessage: string | null;
100
+ statusMessage: string | null;
101
+ externalRef: string | null;
102
+ externalUserId: string | null;
103
+ instanceKind: string | null;
104
+ runnerId: string;
105
+ createdAt?: string | undefined;
106
+ updatedAt?: string | undefined;
107
+ registeredIp?: string | null | undefined;
108
+ disconnectedAt?: string | null | undefined;
109
+ lastError?: string | null | undefined;
110
+ lastErrorAt?: string | null | undefined;
111
+ displayName?: string | null | undefined;
112
+ metadata?: Record<string, unknown> | null | undefined;
113
+ }>;
114
+ declare const AccountInfoSchema: z.ZodObject<{
115
+ accountId: z.ZodString;
116
+ balance: z.ZodNumber;
117
+ equity: z.ZodNumber;
118
+ margin: z.ZodNumber;
119
+ freeMargin: z.ZodNumber;
120
+ leverage: z.ZodOptional<z.ZodNumber>;
121
+ currency: z.ZodOptional<z.ZodString>;
122
+ server: z.ZodOptional<z.ZodString>;
123
+ name: z.ZodOptional<z.ZodString>;
124
+ credit: z.ZodOptional<z.ZodNumber>;
125
+ profit: z.ZodOptional<z.ZodNumber>;
126
+ marginLevel: z.ZodOptional<z.ZodNumber>;
127
+ tradeAllowed: z.ZodOptional<z.ZodBoolean>;
128
+ }, "strip", z.ZodTypeAny, {
129
+ accountId: string;
130
+ balance: number;
131
+ equity: number;
132
+ margin: number;
133
+ freeMargin: number;
134
+ name?: string | undefined;
135
+ leverage?: number | undefined;
136
+ currency?: string | undefined;
137
+ server?: string | undefined;
138
+ credit?: number | undefined;
139
+ profit?: number | undefined;
140
+ marginLevel?: number | undefined;
141
+ tradeAllowed?: boolean | undefined;
142
+ }, {
143
+ accountId: string;
144
+ balance: number;
145
+ equity: number;
146
+ margin: number;
147
+ freeMargin: number;
148
+ name?: string | undefined;
149
+ leverage?: number | undefined;
150
+ currency?: string | undefined;
151
+ server?: string | undefined;
152
+ credit?: number | undefined;
153
+ profit?: number | undefined;
154
+ marginLevel?: number | undefined;
155
+ tradeAllowed?: boolean | undefined;
156
+ }>;
157
+ declare const PositionSchema: z.ZodObject<{
158
+ ticket: z.ZodNumber;
159
+ symbol: z.ZodString;
160
+ type: z.ZodEnum<["BUY", "SELL"]>;
161
+ volume: z.ZodNumber;
162
+ openPrice: z.ZodNumber;
163
+ currentPrice: z.ZodNumber;
164
+ sl: z.ZodNumber;
165
+ tp: z.ZodNumber;
166
+ profit: z.ZodNumber;
167
+ swap: z.ZodNumber;
168
+ openTime: z.ZodNumber;
169
+ commission: z.ZodOptional<z.ZodNumber>;
170
+ comment: z.ZodOptional<z.ZodString>;
171
+ magic: z.ZodOptional<z.ZodNumber>;
172
+ }, "strip", z.ZodTypeAny, {
173
+ symbol: string;
174
+ type: "BUY" | "SELL";
175
+ profit: number;
176
+ ticket: number;
177
+ volume: number;
178
+ openPrice: number;
179
+ currentPrice: number;
180
+ sl: number;
181
+ tp: number;
182
+ swap: number;
183
+ openTime: number;
184
+ commission?: number | undefined;
185
+ comment?: string | undefined;
186
+ magic?: number | undefined;
187
+ }, {
188
+ symbol: string;
189
+ type: "BUY" | "SELL";
190
+ profit: number;
191
+ ticket: number;
192
+ volume: number;
193
+ openPrice: number;
194
+ currentPrice: number;
195
+ sl: number;
196
+ tp: number;
197
+ swap: number;
198
+ openTime: number;
199
+ commission?: number | undefined;
200
+ comment?: string | undefined;
201
+ magic?: number | undefined;
202
+ }>;
203
+ declare const OrderSchema: z.ZodObject<{
204
+ ticket: z.ZodNumber;
205
+ symbol: z.ZodString;
206
+ type: z.ZodString;
207
+ volume: z.ZodNumber;
208
+ price: z.ZodNumber;
209
+ sl: z.ZodNumber;
210
+ tp: z.ZodNumber;
211
+ openTime: z.ZodOptional<z.ZodNumber>;
212
+ comment: z.ZodOptional<z.ZodString>;
213
+ magic: z.ZodOptional<z.ZodNumber>;
214
+ state: z.ZodOptional<z.ZodString>;
215
+ expiration: z.ZodOptional<z.ZodNumber>;
216
+ volumeCurrent: z.ZodOptional<z.ZodNumber>;
217
+ }, "strip", z.ZodTypeAny, {
218
+ symbol: string;
219
+ type: string;
220
+ ticket: number;
221
+ volume: number;
222
+ sl: number;
223
+ tp: number;
224
+ price: number;
225
+ state?: string | undefined;
226
+ openTime?: number | undefined;
227
+ comment?: string | undefined;
228
+ magic?: number | undefined;
229
+ expiration?: number | undefined;
230
+ volumeCurrent?: number | undefined;
231
+ }, {
232
+ symbol: string;
233
+ type: string;
234
+ ticket: number;
235
+ volume: number;
236
+ sl: number;
237
+ tp: number;
238
+ price: number;
239
+ state?: string | undefined;
240
+ openTime?: number | undefined;
241
+ comment?: string | undefined;
242
+ magic?: number | undefined;
243
+ expiration?: number | undefined;
244
+ volumeCurrent?: number | undefined;
245
+ }>;
246
+ declare const PriceSchema: z.ZodObject<{
247
+ symbol: z.ZodString;
248
+ bid: z.ZodNumber;
249
+ ask: z.ZodNumber;
250
+ last: z.ZodOptional<z.ZodNumber>;
251
+ volume: z.ZodOptional<z.ZodNumber>;
252
+ timestamp: z.ZodOptional<z.ZodNumber>;
253
+ }, "strip", z.ZodTypeAny, {
254
+ symbol: string;
255
+ bid: number;
256
+ ask: number;
257
+ volume?: number | undefined;
258
+ last?: number | undefined;
259
+ timestamp?: number | undefined;
260
+ }, {
261
+ symbol: string;
262
+ bid: number;
263
+ ask: number;
264
+ volume?: number | undefined;
265
+ last?: number | undefined;
266
+ timestamp?: number | undefined;
267
+ }>;
268
+ declare const CandleSchema: z.ZodObject<{
269
+ time: z.ZodString;
270
+ open: z.ZodNumber;
271
+ high: z.ZodNumber;
272
+ low: z.ZodNumber;
273
+ close: z.ZodNumber;
274
+ tickVolume: z.ZodNumber;
275
+ spread: z.ZodNumber;
276
+ realVolume: z.ZodOptional<z.ZodNumber>;
277
+ }, "strip", z.ZodTypeAny, {
278
+ time: string;
279
+ open: number;
280
+ high: number;
281
+ low: number;
282
+ close: number;
283
+ tickVolume: number;
284
+ spread: number;
285
+ realVolume?: number | undefined;
286
+ }, {
287
+ time: string;
288
+ open: number;
289
+ high: number;
290
+ low: number;
291
+ close: number;
292
+ tickVolume: number;
293
+ spread: number;
294
+ realVolume?: number | undefined;
295
+ }>;
296
+ declare const MarginResultSchema: z.ZodObject<{
297
+ margin: z.ZodNumber;
298
+ currency: z.ZodOptional<z.ZodString>;
299
+ }, "strip", z.ZodTypeAny, {
300
+ margin: number;
301
+ currency?: string | undefined;
302
+ }, {
303
+ margin: number;
304
+ currency?: string | undefined;
305
+ }>;
306
+ declare const ServiceKeySchema: z.ZodObject<{
307
+ id: z.ZodString;
308
+ keyName: z.ZodString;
309
+ keyPrefix: z.ZodString;
310
+ description: z.ZodNullable<z.ZodString>;
311
+ isActive: z.ZodBoolean;
312
+ lastUsedAt: z.ZodNullable<z.ZodString>;
313
+ expiresAt: z.ZodNullable<z.ZodString>;
314
+ maxInstances: z.ZodNullable<z.ZodNumber>;
315
+ instanceCount: z.ZodNumber;
316
+ rateLimitPerMinute: z.ZodNullable<z.ZodNumber>;
317
+ rateLimitPerDay: z.ZodNullable<z.ZodNumber>;
318
+ requestCount: z.ZodNumber;
319
+ allowedIpAddresses: z.ZodArray<z.ZodString, "many">;
320
+ createdAt: z.ZodString;
321
+ updatedAt: z.ZodString;
322
+ }, "strip", z.ZodTypeAny, {
323
+ id: string;
324
+ createdAt: string;
325
+ updatedAt: string;
326
+ keyName: string;
327
+ keyPrefix: string;
328
+ description: string | null;
329
+ isActive: boolean;
330
+ lastUsedAt: string | null;
331
+ expiresAt: string | null;
332
+ maxInstances: number | null;
333
+ instanceCount: number;
334
+ rateLimitPerMinute: number | null;
335
+ rateLimitPerDay: number | null;
336
+ requestCount: number;
337
+ allowedIpAddresses: string[];
338
+ }, {
339
+ id: string;
340
+ createdAt: string;
341
+ updatedAt: string;
342
+ keyName: string;
343
+ keyPrefix: string;
344
+ description: string | null;
345
+ isActive: boolean;
346
+ lastUsedAt: string | null;
347
+ expiresAt: string | null;
348
+ maxInstances: number | null;
349
+ instanceCount: number;
350
+ rateLimitPerMinute: number | null;
351
+ rateLimitPerDay: number | null;
352
+ requestCount: number;
353
+ allowedIpAddresses: string[];
354
+ }>;
355
+ declare const TickSubscriptionsSchema: z.ZodObject<{
356
+ instanceId: z.ZodString;
357
+ accountId: z.ZodString;
358
+ symbols: z.ZodArray<z.ZodString, "many">;
359
+ count: z.ZodNumber;
360
+ }, "strip", z.ZodTypeAny, {
361
+ accountId: string;
362
+ instanceId: string;
363
+ symbols: string[];
364
+ count: number;
365
+ }, {
366
+ accountId: string;
367
+ instanceId: string;
368
+ symbols: string[];
369
+ count: number;
370
+ }>;
371
+ declare const CandleSubscriptionsSchema: z.ZodObject<{
372
+ instanceId: z.ZodString;
373
+ accountId: z.ZodString;
374
+ subscriptions: z.ZodArray<z.ZodObject<{
375
+ symbol: z.ZodString;
376
+ timeframe: z.ZodString;
377
+ }, "strip", z.ZodTypeAny, {
378
+ symbol: string;
379
+ timeframe: string;
380
+ }, {
381
+ symbol: string;
382
+ timeframe: string;
383
+ }>, "many">;
384
+ count: z.ZodNumber;
385
+ }, "strip", z.ZodTypeAny, {
386
+ accountId: string;
387
+ instanceId: string;
388
+ count: number;
389
+ subscriptions: {
390
+ symbol: string;
391
+ timeframe: string;
392
+ }[];
393
+ }, {
394
+ accountId: string;
395
+ instanceId: string;
396
+ count: number;
397
+ subscriptions: {
398
+ symbol: string;
399
+ timeframe: string;
400
+ }[];
401
+ }>;
402
+ declare const MT5TickSchema: z.ZodObject<{
403
+ type: z.ZodLiteral<"mt5_tick">;
404
+ accountId: z.ZodString;
405
+ symbol: z.ZodString;
406
+ bid: z.ZodNumber;
407
+ ask: z.ZodNumber;
408
+ ts: z.ZodNumber;
409
+ timestamp: z.ZodNumber;
410
+ }, "strip", z.ZodTypeAny, {
411
+ symbol: string;
412
+ accountId: string;
413
+ type: "mt5_tick";
414
+ bid: number;
415
+ ask: number;
416
+ timestamp: number;
417
+ ts: number;
418
+ }, {
419
+ symbol: string;
420
+ accountId: string;
421
+ type: "mt5_tick";
422
+ bid: number;
423
+ ask: number;
424
+ timestamp: number;
425
+ ts: number;
426
+ }>;
427
+ declare const MT5CandleSchema: z.ZodObject<{
428
+ type: z.ZodLiteral<"mt5_candle">;
429
+ accountId: z.ZodString;
430
+ symbol: z.ZodString;
431
+ timeframe: z.ZodString;
432
+ time: z.ZodNumber;
433
+ open: z.ZodNumber;
434
+ high: z.ZodNumber;
435
+ low: z.ZodNumber;
436
+ close: z.ZodNumber;
437
+ volume: z.ZodNumber;
438
+ isNew: z.ZodOptional<z.ZodBoolean>;
439
+ ts: z.ZodNumber;
440
+ timestamp: z.ZodNumber;
441
+ }, "strip", z.ZodTypeAny, {
442
+ symbol: string;
443
+ accountId: string;
444
+ type: "mt5_candle";
445
+ volume: number;
446
+ timestamp: number;
447
+ time: number;
448
+ open: number;
449
+ high: number;
450
+ low: number;
451
+ close: number;
452
+ timeframe: string;
453
+ ts: number;
454
+ isNew?: boolean | undefined;
455
+ }, {
456
+ symbol: string;
457
+ accountId: string;
458
+ type: "mt5_candle";
459
+ volume: number;
460
+ timestamp: number;
461
+ time: number;
462
+ open: number;
463
+ high: number;
464
+ low: number;
465
+ close: number;
466
+ timeframe: string;
467
+ ts: number;
468
+ isNew?: boolean | undefined;
469
+ }>;
470
+ declare const BrokerTickSchema: z.ZodObject<{
471
+ type: z.ZodLiteral<"broker_tick">;
472
+ brokerName: z.ZodString;
473
+ connectionId: z.ZodString;
474
+ kind: z.ZodEnum<["trade", "bidask", "oi"]>;
475
+ securityId: z.ZodString;
476
+ exchangeSegment: z.ZodString;
477
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
478
+ ts: z.ZodNumber;
479
+ }, "strip", z.ZodTypeAny, {
480
+ brokerName: string;
481
+ type: "broker_tick";
482
+ ts: number;
483
+ connectionId: string;
484
+ kind: "trade" | "bidask" | "oi";
485
+ securityId: string;
486
+ exchangeSegment: string;
487
+ data: Record<string, unknown>;
488
+ }, {
489
+ brokerName: string;
490
+ type: "broker_tick";
491
+ ts: number;
492
+ connectionId: string;
493
+ kind: "trade" | "bidask" | "oi";
494
+ securityId: string;
495
+ exchangeSegment: string;
496
+ data: Record<string, unknown>;
497
+ }>;
498
+ declare const BrokerOrderUpdateSchema: z.ZodObject<{
499
+ type: z.ZodLiteral<"broker_order_update">;
500
+ brokerName: z.ZodString;
501
+ connectionId: z.ZodString;
502
+ alert: z.ZodRecord<z.ZodString, z.ZodUnknown>;
503
+ ts: z.ZodNumber;
504
+ }, "strip", z.ZodTypeAny, {
505
+ brokerName: string;
506
+ type: "broker_order_update";
507
+ ts: number;
508
+ connectionId: string;
509
+ alert: Record<string, unknown>;
510
+ }, {
511
+ brokerName: string;
512
+ type: "broker_order_update";
513
+ ts: number;
514
+ connectionId: string;
515
+ alert: Record<string, unknown>;
516
+ }>;
517
+
518
+ export { AccountInfoSchema, AtlasInstanceSchema, BrokerOrderUpdateSchema, BrokerTickSchema, CandleSchema, CandleSubscriptionsSchema, InstanceSchema, InstanceStateSchema, InstanceTypeSchema, MT5CandleSchema, MT5TickSchema, MarginResultSchema, OrderDirectionSchema, OrderSchema, OrderTypeSchema, PositionSchema, PriceSchema, ServiceKeySchema, TickSubscriptionsSchema };
@@ -0,0 +1,191 @@
1
+ import { z } from 'zod';
2
+
3
+ // src/schemas.ts
4
+ var InstanceStateSchema = z.enum(["PENDING", "DEPLOYING", "DEPLOYED", "RUNNING", "STOPPED", "ERROR"]);
5
+ var InstanceTypeSchema = z.enum(["TICK", "TICKS_TRADE", "TRADE"]);
6
+ var OrderDirectionSchema = z.enum(["BUY", "SELL"]);
7
+ var OrderTypeSchema = z.enum(["BUY", "SELL", "BUY_LIMIT", "SELL_LIMIT", "BUY_STOP", "SELL_STOP", "BUY_STOP_LIMIT", "SELL_STOP_LIMIT"]);
8
+ var InstanceSchema = z.object({
9
+ id: z.string(),
10
+ accountId: z.string(),
11
+ serverName: z.string().nullable(),
12
+ brokerName: z.string().nullable(),
13
+ name: z.string().nullable(),
14
+ state: InstanceStateSchema,
15
+ type: InstanceTypeSchema,
16
+ enabled: z.boolean(),
17
+ lastActiveAt: z.string().nullable(),
18
+ connectedAt: z.string().nullable(),
19
+ errorMessage: z.string().nullable(),
20
+ statusMessage: z.string().nullable(),
21
+ createdAt: z.string(),
22
+ updatedAt: z.string()
23
+ });
24
+ var AtlasInstanceSchema = z.object({
25
+ id: z.string(),
26
+ externalRef: z.string().nullable(),
27
+ externalUserId: z.string().nullable(),
28
+ instanceKind: z.string().nullable(),
29
+ runnerId: z.string(),
30
+ state: InstanceStateSchema,
31
+ enabled: z.boolean(),
32
+ registeredIp: z.string().nullable().optional(),
33
+ lastActiveAt: z.string().nullable(),
34
+ connectedAt: z.string().nullable(),
35
+ disconnectedAt: z.string().nullable().optional(),
36
+ statusMessage: z.string().nullable(),
37
+ errorMessage: z.string().nullable(),
38
+ lastError: z.string().nullable().optional(),
39
+ lastErrorAt: z.string().nullable().optional(),
40
+ displayName: z.string().nullable().optional(),
41
+ metadata: z.record(z.unknown()).nullable().optional(),
42
+ createdAt: z.string().optional(),
43
+ updatedAt: z.string().optional()
44
+ });
45
+ var AccountInfoSchema = z.object({
46
+ accountId: z.string(),
47
+ balance: z.number(),
48
+ equity: z.number(),
49
+ margin: z.number(),
50
+ freeMargin: z.number(),
51
+ leverage: z.number().optional(),
52
+ currency: z.string().optional(),
53
+ server: z.string().optional(),
54
+ name: z.string().optional(),
55
+ credit: z.number().optional(),
56
+ profit: z.number().optional(),
57
+ marginLevel: z.number().optional(),
58
+ tradeAllowed: z.boolean().optional()
59
+ });
60
+ var PositionSchema = z.object({
61
+ ticket: z.number(),
62
+ symbol: z.string(),
63
+ type: OrderDirectionSchema,
64
+ volume: z.number(),
65
+ openPrice: z.number(),
66
+ currentPrice: z.number(),
67
+ sl: z.number(),
68
+ tp: z.number(),
69
+ profit: z.number(),
70
+ swap: z.number(),
71
+ openTime: z.number(),
72
+ commission: z.number().optional(),
73
+ comment: z.string().optional(),
74
+ magic: z.number().optional()
75
+ });
76
+ var OrderSchema = z.object({
77
+ ticket: z.number(),
78
+ symbol: z.string(),
79
+ type: z.string(),
80
+ volume: z.number(),
81
+ price: z.number(),
82
+ sl: z.number(),
83
+ tp: z.number(),
84
+ openTime: z.number().optional(),
85
+ comment: z.string().optional(),
86
+ magic: z.number().optional(),
87
+ state: z.string().optional(),
88
+ expiration: z.number().optional(),
89
+ volumeCurrent: z.number().optional()
90
+ });
91
+ var PriceSchema = z.object({
92
+ symbol: z.string(),
93
+ bid: z.number(),
94
+ ask: z.number(),
95
+ last: z.number().optional(),
96
+ volume: z.number().optional(),
97
+ timestamp: z.number().optional()
98
+ });
99
+ var CandleSchema = z.object({
100
+ time: z.string(),
101
+ open: z.number(),
102
+ high: z.number(),
103
+ low: z.number(),
104
+ close: z.number(),
105
+ tickVolume: z.number(),
106
+ spread: z.number(),
107
+ realVolume: z.number().optional()
108
+ });
109
+ var MarginResultSchema = z.object({
110
+ margin: z.number(),
111
+ currency: z.string().optional()
112
+ });
113
+ var ServiceKeySchema = z.object({
114
+ id: z.string(),
115
+ keyName: z.string(),
116
+ keyPrefix: z.string(),
117
+ description: z.string().nullable(),
118
+ isActive: z.boolean(),
119
+ lastUsedAt: z.string().nullable(),
120
+ expiresAt: z.string().nullable(),
121
+ maxInstances: z.number().nullable(),
122
+ instanceCount: z.number(),
123
+ rateLimitPerMinute: z.number().nullable(),
124
+ rateLimitPerDay: z.number().nullable(),
125
+ requestCount: z.number(),
126
+ allowedIpAddresses: z.array(z.string()),
127
+ createdAt: z.string(),
128
+ updatedAt: z.string()
129
+ });
130
+ var TickSubscriptionsSchema = z.object({
131
+ instanceId: z.string(),
132
+ accountId: z.string(),
133
+ symbols: z.array(z.string()),
134
+ count: z.number()
135
+ });
136
+ var CandleSubscriptionsSchema = z.object({
137
+ instanceId: z.string(),
138
+ accountId: z.string(),
139
+ subscriptions: z.array(
140
+ z.object({
141
+ symbol: z.string(),
142
+ timeframe: z.string()
143
+ })
144
+ ),
145
+ count: z.number()
146
+ });
147
+ var MT5TickSchema = z.object({
148
+ type: z.literal("mt5_tick"),
149
+ accountId: z.string(),
150
+ symbol: z.string(),
151
+ bid: z.number(),
152
+ ask: z.number(),
153
+ ts: z.number(),
154
+ timestamp: z.number()
155
+ });
156
+ var MT5CandleSchema = z.object({
157
+ type: z.literal("mt5_candle"),
158
+ accountId: z.string(),
159
+ symbol: z.string(),
160
+ timeframe: z.string(),
161
+ time: z.number(),
162
+ open: z.number(),
163
+ high: z.number(),
164
+ low: z.number(),
165
+ close: z.number(),
166
+ volume: z.number(),
167
+ isNew: z.boolean().optional(),
168
+ ts: z.number(),
169
+ timestamp: z.number()
170
+ });
171
+ var BrokerTickSchema = z.object({
172
+ type: z.literal("broker_tick"),
173
+ brokerName: z.string(),
174
+ connectionId: z.string(),
175
+ kind: z.enum(["trade", "bidask", "oi"]),
176
+ securityId: z.string(),
177
+ exchangeSegment: z.string(),
178
+ data: z.record(z.unknown()),
179
+ ts: z.number()
180
+ });
181
+ var BrokerOrderUpdateSchema = z.object({
182
+ type: z.literal("broker_order_update"),
183
+ brokerName: z.string(),
184
+ connectionId: z.string(),
185
+ alert: z.record(z.unknown()),
186
+ ts: z.number()
187
+ });
188
+
189
+ export { AccountInfoSchema, AtlasInstanceSchema, BrokerOrderUpdateSchema, BrokerTickSchema, CandleSchema, CandleSubscriptionsSchema, InstanceSchema, InstanceStateSchema, InstanceTypeSchema, MT5CandleSchema, MT5TickSchema, MarginResultSchema, OrderDirectionSchema, OrderSchema, OrderTypeSchema, PositionSchema, PriceSchema, ServiceKeySchema, TickSubscriptionsSchema };
190
+ //# sourceMappingURL=schemas.js.map
191
+ //# sourceMappingURL=schemas.js.map