@finatic/client 0.0.140 → 0.0.141
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/README.md +72 -0
- package/dist/index.d.ts +218 -1
- package/dist/index.js +212 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +212 -0
- package/dist/index.mjs.map +1 -1
- package/dist/types/core/client/ApiClient.d.ts +69 -1
- package/dist/types/core/client/FinaticConnect.d.ts +33 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types/api/broker.d.ts +116 -0
- package/package.json +1 -1
- package/src/core/client/ApiClient.ts +257 -0
- package/src/core/client/FinaticConnect.ts +81 -0
- package/src/index.ts +12 -0
- package/src/types/api/broker.ts +131 -0
package/src/types/api/broker.ts
CHANGED
|
@@ -327,4 +327,135 @@ export interface DisconnectCompanyResponse {
|
|
|
327
327
|
};
|
|
328
328
|
message: string;
|
|
329
329
|
status_code: number;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// Order detail types
|
|
333
|
+
export interface OrderFill {
|
|
334
|
+
id: string;
|
|
335
|
+
order_id: string;
|
|
336
|
+
leg_id: string | null;
|
|
337
|
+
price: number;
|
|
338
|
+
quantity: number;
|
|
339
|
+
executed_at: string;
|
|
340
|
+
execution_id: string | null;
|
|
341
|
+
trade_id: string | null;
|
|
342
|
+
venue: string | null;
|
|
343
|
+
commission_fee: number | null;
|
|
344
|
+
created_at: string;
|
|
345
|
+
updated_at: string;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export interface OrderEvent {
|
|
349
|
+
id: string;
|
|
350
|
+
order_id: string;
|
|
351
|
+
order_group_id: string | null;
|
|
352
|
+
event_type: string | null;
|
|
353
|
+
event_time: string;
|
|
354
|
+
event_id: string | null;
|
|
355
|
+
order_status: string | null;
|
|
356
|
+
inferred: boolean;
|
|
357
|
+
confidence: number | null;
|
|
358
|
+
reason_code: string | null;
|
|
359
|
+
recorded_at: string | null;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export interface OrderLeg {
|
|
363
|
+
id: string;
|
|
364
|
+
order_id: string;
|
|
365
|
+
leg_index: number;
|
|
366
|
+
asset_type: string;
|
|
367
|
+
broker_provided_symbol: string | null;
|
|
368
|
+
quantity: number;
|
|
369
|
+
filled_quantity: number | null;
|
|
370
|
+
avg_fill_price: number | null;
|
|
371
|
+
created_at: string | null;
|
|
372
|
+
updated_at: string | null;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export interface OrderGroupOrder extends BrokerDataOrder {
|
|
376
|
+
legs: OrderLeg[];
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export interface OrderGroup {
|
|
380
|
+
id: string;
|
|
381
|
+
user_broker_connection_id: string | null;
|
|
382
|
+
created_at: string;
|
|
383
|
+
updated_at: string;
|
|
384
|
+
orders: OrderGroupOrder[];
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// Position detail types
|
|
388
|
+
export interface PositionLot {
|
|
389
|
+
id: string;
|
|
390
|
+
position_id: string | null;
|
|
391
|
+
user_broker_connection_id: string;
|
|
392
|
+
broker_provided_account_id: string;
|
|
393
|
+
instrument_key: string;
|
|
394
|
+
asset_type: string | null;
|
|
395
|
+
side: 'long' | 'short' | null;
|
|
396
|
+
open_quantity: number;
|
|
397
|
+
closed_quantity: number;
|
|
398
|
+
remaining_quantity: number;
|
|
399
|
+
open_price: number;
|
|
400
|
+
close_price_avg: number | null;
|
|
401
|
+
cost_basis: number;
|
|
402
|
+
cost_basis_w_commission: number;
|
|
403
|
+
realized_pl: number;
|
|
404
|
+
realized_pl_w_commission: number;
|
|
405
|
+
lot_opened_at: string;
|
|
406
|
+
lot_closed_at: string | null;
|
|
407
|
+
position_group_id: string | null;
|
|
408
|
+
created_at: string;
|
|
409
|
+
updated_at: string;
|
|
410
|
+
position_lot_fills?: PositionLotFill[];
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export interface PositionLotFill {
|
|
414
|
+
id: string;
|
|
415
|
+
lot_id: string;
|
|
416
|
+
order_fill_id: string;
|
|
417
|
+
fill_price: number;
|
|
418
|
+
fill_quantity: number;
|
|
419
|
+
executed_at: string;
|
|
420
|
+
commission_share: number | null;
|
|
421
|
+
created_at: string;
|
|
422
|
+
updated_at: string;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// Filter types for detail endpoints
|
|
426
|
+
export interface OrderFillsFilter {
|
|
427
|
+
connection_id?: string;
|
|
428
|
+
limit?: number;
|
|
429
|
+
offset?: number;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export interface OrderEventsFilter {
|
|
433
|
+
connection_id?: string;
|
|
434
|
+
limit?: number;
|
|
435
|
+
offset?: number;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
export interface OrderGroupsFilter {
|
|
439
|
+
broker_id?: string;
|
|
440
|
+
connection_id?: string;
|
|
441
|
+
limit?: number;
|
|
442
|
+
offset?: number;
|
|
443
|
+
created_after?: string;
|
|
444
|
+
created_before?: string;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
export interface PositionLotsFilter {
|
|
448
|
+
broker_id?: string;
|
|
449
|
+
connection_id?: string;
|
|
450
|
+
account_id?: string;
|
|
451
|
+
symbol?: string;
|
|
452
|
+
position_id?: string;
|
|
453
|
+
limit?: number;
|
|
454
|
+
offset?: number;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
export interface PositionLotFillsFilter {
|
|
458
|
+
connection_id?: string;
|
|
459
|
+
limit?: number;
|
|
460
|
+
offset?: number;
|
|
330
461
|
}
|