@tradejs/types 3.1.29-beta.303 → 3.1.29-beta.304
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/index.d.mts +17 -0
- package/dist/index.d.ts +17 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -134,6 +134,8 @@ interface PortfolioOrderObservation {
|
|
|
134
134
|
id: string;
|
|
135
135
|
status: 'pending' | 'partial' | 'filled' | 'cancelled' | 'rejected';
|
|
136
136
|
filledQty: number;
|
|
137
|
+
/** Durable receipt: original order terminal and compensation confirmed flat. */
|
|
138
|
+
compensated?: boolean;
|
|
137
139
|
positionId?: string;
|
|
138
140
|
}
|
|
139
141
|
interface PortfolioObservation {
|
|
@@ -1219,6 +1221,8 @@ type Order = {
|
|
|
1219
1221
|
qty: number;
|
|
1220
1222
|
/** Simulation connectors may supply their actual modeled execution price. */
|
|
1221
1223
|
executionPrice?: number;
|
|
1224
|
+
/** Await before persisting a portfolio reservation for the given client ID. */
|
|
1225
|
+
beforeAdmission?: (orderId: string) => Promise<void>;
|
|
1222
1226
|
}) => Promise<void | string>;
|
|
1223
1227
|
};
|
|
1224
1228
|
type Position = {
|
|
@@ -1373,10 +1377,23 @@ interface Connector {
|
|
|
1373
1377
|
symbol: string;
|
|
1374
1378
|
orderId: string;
|
|
1375
1379
|
}) => Promise<PortfolioOrderObservation | null>;
|
|
1380
|
+
/** Cancel by the same client identifier supplied to placeOrder. Acknowledgement is not terminality. */
|
|
1381
|
+
cancelEntryOrder?: (params: {
|
|
1382
|
+
symbol: string;
|
|
1383
|
+
orderId: string;
|
|
1384
|
+
}) => Promise<boolean>;
|
|
1385
|
+
/** Fresh authoritative position; null means confirmed flat. Failures must throw. */
|
|
1386
|
+
getEntryPositionObservation?: (params: {
|
|
1387
|
+
symbol: string;
|
|
1388
|
+
}) => Promise<(Position & {
|
|
1389
|
+
priceTickSize: number;
|
|
1390
|
+
}) | null>;
|
|
1376
1391
|
placeOrder: PlaceOrder;
|
|
1377
1392
|
setPositionProtection?: SetPositionProtection;
|
|
1378
1393
|
setTakeProfits: SetTakeProfits;
|
|
1379
1394
|
setStopLoss: SetStopLoss;
|
|
1395
|
+
/** Reconciliation-aware connectors return false only for proven pre-acceptance rejection.
|
|
1396
|
+
* Transport, timeout and ambiguous outcomes must throw so callers retain their safety claim. */
|
|
1380
1397
|
closePosition: ClosePosition;
|
|
1381
1398
|
getTickers: GetTickers;
|
|
1382
1399
|
getFundingRateHistory?: GetFundingRateHistory;
|
package/dist/index.d.ts
CHANGED
|
@@ -134,6 +134,8 @@ interface PortfolioOrderObservation {
|
|
|
134
134
|
id: string;
|
|
135
135
|
status: 'pending' | 'partial' | 'filled' | 'cancelled' | 'rejected';
|
|
136
136
|
filledQty: number;
|
|
137
|
+
/** Durable receipt: original order terminal and compensation confirmed flat. */
|
|
138
|
+
compensated?: boolean;
|
|
137
139
|
positionId?: string;
|
|
138
140
|
}
|
|
139
141
|
interface PortfolioObservation {
|
|
@@ -1219,6 +1221,8 @@ type Order = {
|
|
|
1219
1221
|
qty: number;
|
|
1220
1222
|
/** Simulation connectors may supply their actual modeled execution price. */
|
|
1221
1223
|
executionPrice?: number;
|
|
1224
|
+
/** Await before persisting a portfolio reservation for the given client ID. */
|
|
1225
|
+
beforeAdmission?: (orderId: string) => Promise<void>;
|
|
1222
1226
|
}) => Promise<void | string>;
|
|
1223
1227
|
};
|
|
1224
1228
|
type Position = {
|
|
@@ -1373,10 +1377,23 @@ interface Connector {
|
|
|
1373
1377
|
symbol: string;
|
|
1374
1378
|
orderId: string;
|
|
1375
1379
|
}) => Promise<PortfolioOrderObservation | null>;
|
|
1380
|
+
/** Cancel by the same client identifier supplied to placeOrder. Acknowledgement is not terminality. */
|
|
1381
|
+
cancelEntryOrder?: (params: {
|
|
1382
|
+
symbol: string;
|
|
1383
|
+
orderId: string;
|
|
1384
|
+
}) => Promise<boolean>;
|
|
1385
|
+
/** Fresh authoritative position; null means confirmed flat. Failures must throw. */
|
|
1386
|
+
getEntryPositionObservation?: (params: {
|
|
1387
|
+
symbol: string;
|
|
1388
|
+
}) => Promise<(Position & {
|
|
1389
|
+
priceTickSize: number;
|
|
1390
|
+
}) | null>;
|
|
1376
1391
|
placeOrder: PlaceOrder;
|
|
1377
1392
|
setPositionProtection?: SetPositionProtection;
|
|
1378
1393
|
setTakeProfits: SetTakeProfits;
|
|
1379
1394
|
setStopLoss: SetStopLoss;
|
|
1395
|
+
/** Reconciliation-aware connectors return false only for proven pre-acceptance rejection.
|
|
1396
|
+
* Transport, timeout and ambiguous outcomes must throw so callers retain their safety claim. */
|
|
1380
1397
|
closePosition: ClosePosition;
|
|
1381
1398
|
getTickers: GetTickers;
|
|
1382
1399
|
getFundingRateHistory?: GetFundingRateHistory;
|