@huskly/ibkr-client 2.1.1 → 2.3.0

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 CHANGED
@@ -99,6 +99,51 @@ validated at runtime. Its broker-neutral account API includes:
99
99
  makes the read throw. `presentSummaryFieldNames` lists the sorted key NAMES present in the
100
100
  summary response, names only and never values, so an operator can confirm the live schema
101
101
  without seeing amounts. This method remains a separate read from `getAccountBalances()`.
102
+ - `getContractTransactionEvidence({ conids, currency, days, accountId? })` for the transaction
103
+ activity IBKR states about NAMED contracts. This read never consults held positions, so it
104
+ reaches a contract the account no longer holds - the shape an assigned, exercised, or expired
105
+ option leaves behind. `fetchTransactionHistory()` cannot do this: it loops over held conids only,
106
+ so a gone contract is unreachable through it. The caller states the currency and this read never
107
+ supplies a default, because IBKR converts every figure into the requested currency and a wrong
108
+ currency returns a converted number that looks exactly like a real one. It returns the account
109
+ id, one client-minted `observedAtEpochMillis`, the requested conids, currency, and window, and
110
+ one record for each row IBKR returned. Each record echoes `conid`, `accountId`, `date`,
111
+ `rawDate`, `type`, `description`, `currency`, `amount`, `quantity`, `price`, and `fxRate` exactly
112
+ as the broker stated them. Provider text is verbatim: `type` and `description` keep their own
113
+ case AND their own padding, because they are the only place IBKR names an assignment, and
114
+ trimming them would change what a consumer classifies. A field the broker did not state is
115
+ `null`, a stated zero remains `0`, and a stated whitespace-only string stays that string; a value
116
+ that is not a string reads `null`. `presentFieldNames` lists the sorted key NAMES the row
117
+ carried, names only and never values. The read refuses an empty conid list, a conid that is not a
118
+ positive safe integer, a blank currency, and a window outside 1 through 90 days; it also refuses
119
+ a response that states no transaction ARRAY, because an error envelope, an empty object, or an
120
+ explicit `null` is an unknown broker state and must never reach a consumer looking exactly like a
121
+ completed read that found nothing. A stated empty array is a real answer and is reported as one.
122
+ A missing field inside a row never makes it throw. It proves no event and infers nothing: an empty list
123
+ is not proof that nothing happened, and the CONSUMER decides whether a row states an assignment,
124
+ an exercise, or an expiration.
125
+ - `getOptionSeriesReference(conid)` for one reference read of ONE exact option contract, and
126
+ `getUnderlyingInstrumentReference(conid)` for the same read of an underlying contract. Both read
127
+ `iserver/contract/{conid}/info`. Use this endpoint, not the conid-only `iserver/secdef/info`
128
+ re-read: that re-read drops `multiplier` and `tradingClass`, so it cannot state the contract size
129
+ or the listing class. The option read reports `con_id`, `symbol`, `local_symbol` (the OSI symbol),
130
+ `instrument_type`, `right`, `strike`, `maturity_date`, `expiry_full`, `contract_month`,
131
+ `multiplier`, `trading_class`, `underlying_con_id`, `company_name`, `currency`, `exchange`,
132
+ `listing_exchange`, `valid_exchanges`, `cfi_code`, `contract_clarification_type`, `classifier`,
133
+ `underlying_issuer`, and `text`. The underlying read reports the same facts minus the option
134
+ terms, so a consumer can resolve `underlying_con_id` to `instrument_type` (`STK` for an equity or
135
+ an ETF, `IND` for an index) and to the venue (`exchange` and `valid_exchanges` read `BASKET` for
136
+ the pseudo-underlying of an adjusted class). Both reads state raw evidence and one client-minted
137
+ `observedAtEpochMillis`. A field the broker did not state reads `null`, no field is inferred, no
138
+ currency is defaulted, and one missing field never makes the read throw. A stated
139
+ `underlying_con_id` of `0` stays `0`, because a stated zero and an unstated field are different
140
+ facts. An explicit broker error still throws `IbkrBrokerResponseError`, because a refusal is not a
141
+ missing field. `presentFieldNames` lists the sorted key NAMES present in the response, names only
142
+ and never values, so an operator can confirm the live schema without seeing the contract terms.
143
+ These reads prove no deliverable: IBKR states no deliverable list, no adjusted flag, and no
144
+ settlement style on this endpoint, and a known adjusted class (`TLRY1`) reports the same
145
+ `multiplier` `"100"` and the same `cfi_code` `"OPXXXS"` as a standard class (`SPY`). The CONSUMER
146
+ decides what the facts qualify.
102
147
  - `getQuotes()` and `searchInstruments()` for equity/ETF discovery and quotes. Quote requests accept
103
148
  a symbol and an optional broker ID. A broker ID reads that exact contract without symbol
104
149
  discovery. A request without one can also resolve a complete OSI option symbol without loading
@@ -1,5 +1,5 @@
1
1
  import type { IbkrOauth1Config } from "./oauthConfig.js";
2
- import type { AccountBalances, AccountSettlementEvidence, ActiveDerivativeOrder, AuthStatus, IbkrSessionEvidence, IbkrSessionLifecycleClient, BrokerAccountOrders, BrokerClient, BrokerInstrument, BrokerInstrumentSearchProjection, BrokerOrdersOptions, BrokerPosition, BrokerQuote, BrokerQuoteOptions, BrokerQuoteRequest, BrokerTransactionHistory, BrokerErrorDetail, DerivativeContract, DerivativeContractQuery, DerivativeComboExecutionRequest, DerivativeComboReconciliation, DerivativeComboReconciliationRequest, DerivativeComboPreviewRequest, DerivativeComboPreviewResult, DerivativeContingentChildOrderRequest, DerivativeContingentParentOrderRequest, DerivativeDiscoveryClient, DerivativeExecutionClient, DerivativeExecution, DerivativeExecutionQuery, DerivativeMultiOrderResult, DerivativeOrderGraphLookup, DerivativeOrderGraphRequest, DerivativeOrderGraphResult, DerivativeOrderGraphWarningContinuation, DerivativeOrderCancellationResult, DerivativeOrderCancelRequest, DerivativeOrderLifecycle, DerivativeOrderLookup, DerivativeOrderSubmissionResult, DerivativeSingleOrderRequest, DerivativePreviewClient, DerivativeExpiry, DerivativeExpiryQuery, DerivativeQuote, DerivativeReferenceQuote, OptionChainSnapshot, OptionContract, OptionDefinitionCache, OptionDiscoveryTelemetry, OptionMarketQuote, OptionStrikeRange, OptionQuoteRequest, OptionRight, PriceHistoryContractCandidate, PriceHistoryRequest, PriceHistoryResult, PriceHistoryTelemetry, TradingDiagnostics } from "../types.js";
2
+ import type { AccountBalances, AccountSettlementEvidence, ContractTransactionEvidence, OptionSeriesReferenceEvidence, UnderlyingInstrumentReferenceEvidence, ActiveDerivativeOrder, AuthStatus, IbkrSessionEvidence, IbkrSessionLifecycleClient, BrokerAccountOrders, BrokerClient, BrokerInstrument, BrokerInstrumentSearchProjection, BrokerOrdersOptions, BrokerPosition, BrokerQuote, BrokerQuoteOptions, BrokerQuoteRequest, BrokerTransactionHistory, BrokerErrorDetail, DerivativeContract, DerivativeContractQuery, DerivativeComboExecutionRequest, DerivativeComboReconciliation, DerivativeComboReconciliationRequest, DerivativeComboPreviewRequest, DerivativeComboPreviewResult, DerivativeContingentChildOrderRequest, DerivativeContingentParentOrderRequest, DerivativeDiscoveryClient, DerivativeExecutionClient, DerivativeExecution, DerivativeExecutionQuery, DerivativeMultiOrderResult, DerivativeOrderGraphLookup, DerivativeOrderGraphRequest, DerivativeOrderGraphResult, DerivativeOrderGraphWarningContinuation, DerivativeOrderCancellationResult, DerivativeOrderCancelRequest, DerivativeOrderLifecycle, DerivativeOrderLookup, DerivativeOrderSubmissionResult, DerivativeSingleOrderRequest, DerivativePreviewClient, DerivativeExpiry, DerivativeExpiryQuery, DerivativeQuote, DerivativeReferenceQuote, OptionChainSnapshot, OptionContract, OptionDefinitionCache, OptionDiscoveryTelemetry, OptionMarketQuote, OptionStrikeRange, OptionQuoteRequest, OptionRight, PriceHistoryContractCandidate, PriceHistoryRequest, PriceHistoryResult, PriceHistoryTelemetry, TradingDiagnostics } from "../types.js";
3
3
  import { type IbkrRequestSchedulerOptions, type IbkrRequestTelemetry } from "./requestScheduler.js";
4
4
  interface IbkrRequestInput {
5
5
  path: string;
@@ -219,6 +219,49 @@ export declare class IbkrClient implements BrokerClient, IbkrSessionLifecycleCli
219
219
  private settlementFigure;
220
220
  /** The sorted key names present in the summary response. Names only, never values. */
221
221
  private presentSummaryFieldNames;
222
+ /**
223
+ * Read every reference fact IBKR states about ONE exact option conid, from
224
+ * `iserver/contract/{conid}/info`.
225
+ *
226
+ * This endpoint is the only per-conid read that states `multiplier` and
227
+ * `trading_class`; the conid-only `iserver/secdef/info` re-read drops both.
228
+ *
229
+ * The result is raw evidence. A field the broker did not state reads `null`,
230
+ * no field is inferred, no currency is defaulted, and one missing field never
231
+ * makes this method throw. A stated `underlying_con_id` of `0` is reported as
232
+ * `0`, never as `null`.
233
+ *
234
+ * IBKR states no deliverable list, no adjusted flag, and no settlement style
235
+ * here: a known adjusted class (`TLRY1`) and a standard class (`SPY`) report
236
+ * the same `multiplier` `"100"` and the same `cfi_code` `"OPXXXS"`. So this
237
+ * evidence can never prove a standard series. The CONSUMER, not this package,
238
+ * decides what qualifies.
239
+ *
240
+ * @param conid The exact option contract id. It must be a positive integer.
241
+ */
242
+ getOptionSeriesReference(conid: number): Promise<OptionSeriesReferenceEvidence>;
243
+ /**
244
+ * Read the same reference facts for an UNDERLYING conid, so a consumer can
245
+ * resolve the option's `underlying_con_id` to its instrument type and venue.
246
+ *
247
+ * `instrument_type` reads `"STK"` for an equity or an ETF and `"IND"` for an
248
+ * index. `exchange` and `valid_exchanges` read `"BASKET"` for the
249
+ * pseudo-underlying of an adjusted class. This method reports those facts and
250
+ * judges none of them. The join is a second, non-atomic read of a different
251
+ * contract; the consumer owns its freshness and ambiguity policy.
252
+ *
253
+ * @param conid The exact underlying contract id. It must be a positive integer.
254
+ */
255
+ getUnderlyingInstrumentReference(conid: number): Promise<UnderlyingInstrumentReferenceEvidence>;
256
+ /**
257
+ * Fetch one `iserver/contract/{conid}/info` record. An explicit broker error
258
+ * is raised, because it is a refusal and not a missing field. A response that
259
+ * is not one object reads as no record at all, which states every field
260
+ * `null` instead of guessing a shape.
261
+ */
262
+ private readContractReference;
263
+ /** Narrow one contract-reference record into the facts IBKR stated, verbatim. */
264
+ private contractReferenceEvidence;
222
265
  getPositions(symbol?: string): Promise<BrokerPosition[]>;
223
266
  /** Page through the positions endpoint until it stops returning rows. */
224
267
  private fetchAllPositions;
@@ -229,6 +272,56 @@ export declare class IbkrClient implements BrokerClient, IbkrSessionLifecycleCli
229
272
  private fetchQuotes;
230
273
  /** Resolve equity/ETF symbols to IBKR contracts via `trsrv/stocks`. */
231
274
  searchInstruments(symbol: string, projection?: BrokerInstrumentSearchProjection): Promise<BrokerInstrument[]>;
275
+ /**
276
+ * Read the transaction activity IBKR states for named contracts, without ever
277
+ * asking which contracts the account still holds.
278
+ *
279
+ * {@link fetchTransactionHistory} loops over HELD conids, so a contract that
280
+ * left the account - assigned, exercised, or expired - can never be reached
281
+ * through it. The `pa/transactions` endpoint does not require a conid to be
282
+ * held: it answers for the conids it is given. This method gives it the conids
283
+ * the caller names, so the row of a gone contract stays reachable.
284
+ *
285
+ * The caller states the currency, and this method never supplies a default.
286
+ * IBKR converts every figure into the requested currency, so a wrong currency
287
+ * returns a converted number that looks exactly like a real one.
288
+ * {@link fetchTransactionHistory} reads it from the environment and falls back
289
+ * to `"USD"`; that habit is deliberately not repeated here.
290
+ *
291
+ * Every field is echoed as the broker stated it. A field the broker did not
292
+ * state reads `null`, a stated zero stays `0`, and `type` and `desc` keep
293
+ * their own case. A missing field never makes this method throw. Only an
294
+ * identity or a window this read could not ask about at all is refused.
295
+ *
296
+ * This method proves no event and infers nothing. An empty list is not proof
297
+ * that nothing happened. The CONSUMER, not this package, decides whether a row
298
+ * states an assignment, an exercise, or an expiration.
299
+ */
300
+ getContractTransactionEvidence(input: {
301
+ /** The conids to ask about. They need not be held. */
302
+ conids: readonly number[];
303
+ /** The currency IBKR must report in. Never defaulted. */
304
+ currency: string;
305
+ /** The window in days back from the broker's today. IBKR serves 1 through 90. */
306
+ days: number;
307
+ /** The account to ask for. Discovered when the caller states none. */
308
+ accountId?: string;
309
+ }): Promise<ContractTransactionEvidence>;
310
+ /**
311
+ * One provider string, echoed exactly as the broker wrote it.
312
+ *
313
+ * {@link trimmedString} is deliberately NOT used here. `type` and `desc` are the only place IBKR
314
+ * names an assignment, an exercise, or an expiration, and the public type states they are echoed
315
+ * exactly. Trimming would change what a consumer classifies and what an audit comparison sees,
316
+ * and a stated whitespace-only string is still a statement, never silence. A value that is not a
317
+ * string is not text the broker stated, so it reads `null`.
318
+ */
319
+ private verbatimString;
320
+ /**
321
+ * One `pa/transactions` row, echoed. Nothing here maps, classifies, or
322
+ * defaults a value; a field the broker did not state reads `null`.
323
+ */
324
+ private contractTransactionRecord;
232
325
  fetchTransactionHistory(startDate: Date, endDate: Date): Promise<BrokerTransactionHistory[]>;
233
326
  fetchOrders(options: BrokerOrdersOptions): Promise<BrokerAccountOrders[]>;
234
327
  private validateComboPreview;
@@ -1 +1 @@
1
- {"version":3,"file":"ibkrClient.d.ts","sourceRoot":"","sources":["../../src/ibkr/ibkrClient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EACV,eAAe,EAEf,yBAAyB,EAEzB,qBAAqB,EAGrB,UAAU,EACV,mBAAmB,EAEnB,0BAA0B,EAC1B,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,gCAAgC,EAGhC,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAElB,wBAAwB,EACxB,iBAAiB,EAGjB,kBAAkB,EAClB,uBAAuB,EACvB,+BAA+B,EAC/B,6BAA6B,EAC7B,oCAAoC,EACpC,6BAA6B,EAC7B,4BAA4B,EAC5B,qCAAqC,EAErC,sCAAsC,EACtC,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACnB,wBAAwB,EAGxB,0BAA0B,EAE1B,0BAA0B,EAE1B,2BAA2B,EAC3B,0BAA0B,EAC1B,uCAAuC,EACvC,iCAAiC,EAEjC,4BAA4B,EAC5B,wBAAwB,EACxB,qBAAqB,EAErB,+BAA+B,EAC/B,4BAA4B,EAE5B,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,wBAAwB,EACxB,mBAAmB,EAInB,cAAc,EACd,qBAAqB,EAGrB,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EAIX,6BAA6B,EAC7B,mBAAmB,EAEnB,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAiCrB,OAAO,EAIL,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EAC1B,MAAM,uBAAuB,CAAC;AAgY/B,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,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,CAAC,eAAe;IAevB,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,oBAAoB;IAwB5B,OAAO,CAAC,gBAAgB;IAsBxB,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,2BAA2B;IAKnC,OAAO,CAAC,mBAAmB;IAoB3B,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,yBAAyB;IAcjC,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,WAAW;CAuBpB"}
@@ -1744,6 +1744,102 @@ export class IbkrClient {
1744
1744
  return [];
1745
1745
  return Object.keys(record).sort();
1746
1746
  }
1747
+ /**
1748
+ * Read every reference fact IBKR states about ONE exact option conid, from
1749
+ * `iserver/contract/{conid}/info`.
1750
+ *
1751
+ * This endpoint is the only per-conid read that states `multiplier` and
1752
+ * `trading_class`; the conid-only `iserver/secdef/info` re-read drops both.
1753
+ *
1754
+ * The result is raw evidence. A field the broker did not state reads `null`,
1755
+ * no field is inferred, no currency is defaulted, and one missing field never
1756
+ * makes this method throw. A stated `underlying_con_id` of `0` is reported as
1757
+ * `0`, never as `null`.
1758
+ *
1759
+ * IBKR states no deliverable list, no adjusted flag, and no settlement style
1760
+ * here: a known adjusted class (`TLRY1`) and a standard class (`SPY`) report
1761
+ * the same `multiplier` `"100"` and the same `cfi_code` `"OPXXXS"`. So this
1762
+ * evidence can never prove a standard series. The CONSUMER, not this package,
1763
+ * decides what qualifies.
1764
+ *
1765
+ * @param conid The exact option contract id. It must be a positive integer.
1766
+ */
1767
+ async getOptionSeriesReference(conid) {
1768
+ this.assertOpen();
1769
+ const record = await this.readContractReference(conid);
1770
+ return {
1771
+ ...this.contractReferenceEvidence(conid, record),
1772
+ right: this.trimmedString(record?.["right"]),
1773
+ strike: toNullableNumber(record?.["strike"]),
1774
+ strikeRaw: this.trimmedString(record?.["strike"]),
1775
+ maturityDate: this.trimmedString(record?.["maturity_date"]),
1776
+ expiryFull: this.trimmedString(record?.["expiry_full"]),
1777
+ contractMonth: this.trimmedString(record?.["contract_month"]),
1778
+ };
1779
+ }
1780
+ /**
1781
+ * Read the same reference facts for an UNDERLYING conid, so a consumer can
1782
+ * resolve the option's `underlying_con_id` to its instrument type and venue.
1783
+ *
1784
+ * `instrument_type` reads `"STK"` for an equity or an ETF and `"IND"` for an
1785
+ * index. `exchange` and `valid_exchanges` read `"BASKET"` for the
1786
+ * pseudo-underlying of an adjusted class. This method reports those facts and
1787
+ * judges none of them. The join is a second, non-atomic read of a different
1788
+ * contract; the consumer owns its freshness and ambiguity policy.
1789
+ *
1790
+ * @param conid The exact underlying contract id. It must be a positive integer.
1791
+ */
1792
+ async getUnderlyingInstrumentReference(conid) {
1793
+ this.assertOpen();
1794
+ return this.contractReferenceEvidence(conid, await this.readContractReference(conid));
1795
+ }
1796
+ /**
1797
+ * Fetch one `iserver/contract/{conid}/info` record. An explicit broker error
1798
+ * is raised, because it is a refusal and not a missing field. A response that
1799
+ * is not one object reads as no record at all, which states every field
1800
+ * `null` instead of guessing a shape.
1801
+ */
1802
+ async readContractReference(conid) {
1803
+ if (!Number.isSafeInteger(conid) || conid <= 0) {
1804
+ throw new Error(`An exact positive IBKR conid is required, received ${String(conid)}`);
1805
+ }
1806
+ const response = await this.req({
1807
+ path: `iserver/contract/${String(conid)}/info`,
1808
+ });
1809
+ if (isUnknownRecord(response) &&
1810
+ response["error"] !== undefined &&
1811
+ response["error"] !== null) {
1812
+ const detail = this.normalizeBrokerError(response["error"], response, "IBKR rejected the contract reference request");
1813
+ throw new IbkrBrokerResponseError(detail.message, detail);
1814
+ }
1815
+ return isUnknownRecord(response) ? response : null;
1816
+ }
1817
+ /** Narrow one contract-reference record into the facts IBKR stated, verbatim. */
1818
+ contractReferenceEvidence(requestedConid, record) {
1819
+ return {
1820
+ requestedConid,
1821
+ observedAtEpochMillis: this.now(),
1822
+ conid: toNullableNumber(record?.["con_id"]),
1823
+ symbol: this.trimmedString(record?.["symbol"]),
1824
+ localSymbol: this.trimmedString(record?.["local_symbol"]),
1825
+ instrumentType: this.trimmedString(record?.["instrument_type"]),
1826
+ tradingClass: this.trimmedString(record?.["trading_class"]),
1827
+ underlyingConid: toNullableNumber(record?.["underlying_con_id"]),
1828
+ multiplier: toNullableNumber(record?.["multiplier"]),
1829
+ multiplierRaw: this.trimmedString(record?.["multiplier"]),
1830
+ companyName: this.trimmedString(record?.["company_name"]),
1831
+ currency: this.trimmedString(record?.["currency"]),
1832
+ exchange: this.trimmedString(record?.["exchange"]),
1833
+ listingExchange: this.trimmedString(record?.["listing_exchange"]),
1834
+ validExchanges: this.trimmedString(record?.["valid_exchanges"]),
1835
+ cfiCode: this.trimmedString(record?.["cfi_code"]),
1836
+ contractClarificationType: this.trimmedString(record?.["contract_clarification_type"]),
1837
+ classifier: this.trimmedString(record?.["classifier"]),
1838
+ underlyingIssuer: this.trimmedString(record?.["underlying_issuer"]),
1839
+ description: this.trimmedString(record?.["text"]),
1840
+ presentFieldNames: record === null ? [] : Object.keys(record).sort(),
1841
+ };
1842
+ }
1747
1843
  async getPositions(symbol) {
1748
1844
  this.assertOpen();
1749
1845
  const accountId = await this.getAccountId();
@@ -1895,6 +1991,114 @@ export class IbkrClient {
1895
1991
  });
1896
1992
  return (response[query] ?? []).flatMap((listing) => this.normalizeStockListing(query, listing));
1897
1993
  }
1994
+ /**
1995
+ * Read the transaction activity IBKR states for named contracts, without ever
1996
+ * asking which contracts the account still holds.
1997
+ *
1998
+ * {@link fetchTransactionHistory} loops over HELD conids, so a contract that
1999
+ * left the account - assigned, exercised, or expired - can never be reached
2000
+ * through it. The `pa/transactions` endpoint does not require a conid to be
2001
+ * held: it answers for the conids it is given. This method gives it the conids
2002
+ * the caller names, so the row of a gone contract stays reachable.
2003
+ *
2004
+ * The caller states the currency, and this method never supplies a default.
2005
+ * IBKR converts every figure into the requested currency, so a wrong currency
2006
+ * returns a converted number that looks exactly like a real one.
2007
+ * {@link fetchTransactionHistory} reads it from the environment and falls back
2008
+ * to `"USD"`; that habit is deliberately not repeated here.
2009
+ *
2010
+ * Every field is echoed as the broker stated it. A field the broker did not
2011
+ * state reads `null`, a stated zero stays `0`, and `type` and `desc` keep
2012
+ * their own case. A missing field never makes this method throw. Only an
2013
+ * identity or a window this read could not ask about at all is refused.
2014
+ *
2015
+ * This method proves no event and infers nothing. An empty list is not proof
2016
+ * that nothing happened. The CONSUMER, not this package, decides whether a row
2017
+ * states an assignment, an exercise, or an expiration.
2018
+ */
2019
+ async getContractTransactionEvidence(input) {
2020
+ this.assertOpen();
2021
+ const currency = input.currency.trim();
2022
+ if (!currency) {
2023
+ throw new Error("Contract transaction evidence requires an explicit currency; it is never defaulted");
2024
+ }
2025
+ if (input.conids.length === 0) {
2026
+ throw new Error("Contract transaction evidence requires at least one conid");
2027
+ }
2028
+ for (const conid of input.conids) {
2029
+ if (!Number.isSafeInteger(conid) || conid <= 0) {
2030
+ throw new Error(`Contract transaction evidence received an unusable conid: ${String(conid)}`);
2031
+ }
2032
+ }
2033
+ if (!Number.isSafeInteger(input.days) || input.days < 1 || input.days > 90) {
2034
+ throw new Error("Contract transaction evidence days must be an integer from 1 through 90");
2035
+ }
2036
+ // Every value the evidence reports is captured BEFORE the await, so a caller that reuses and
2037
+ // mutates its own input object while this read is in flight can never receive evidence that
2038
+ // claims a window or an identity IBKR was not asked for.
2039
+ const conids = [...input.conids];
2040
+ const days = input.days;
2041
+ const accountId = input.accountId ?? (await this.getAccountId());
2042
+ // Read as `unknown`: the declared wire type describes the SUCCESS shape, and the whole point of
2043
+ // the guard below is that IBKR does not always send it.
2044
+ const response = await this.req({
2045
+ path: "pa/transactions",
2046
+ method: "POST",
2047
+ data: { acctIds: [accountId], conids, currency, days },
2048
+ });
2049
+ const envelope = typeof response === "object" && response !== null ? response : {};
2050
+ // A response that states no transaction ARRAY did not answer this question. An error envelope,
2051
+ // an empty object, and an explicit null are unknown broker states, and this package never
2052
+ // reports an unknown state as a successful empty read: the consumer of this evidence decides
2053
+ // whether an assignment happened, and it must not read a refusal as "no activity". A STATED
2054
+ // empty array is a real answer and passes through untouched.
2055
+ if (!Array.isArray(envelope.transactions)) {
2056
+ const present = Object.keys(envelope).sort();
2057
+ throw new Error("IBKR stated no transaction list for this contract transaction read; " +
2058
+ `present response keys: ${present.length === 0 ? "(none)" : present.join(", ")}`);
2059
+ }
2060
+ const rows = envelope.transactions;
2061
+ return {
2062
+ accountId,
2063
+ observedAtEpochMillis: this.now(),
2064
+ requestedConids: conids,
2065
+ requestedCurrency: currency,
2066
+ requestedDays: days,
2067
+ transactions: rows.map((transaction) => this.contractTransactionRecord(transaction)),
2068
+ };
2069
+ }
2070
+ /**
2071
+ * One provider string, echoed exactly as the broker wrote it.
2072
+ *
2073
+ * {@link trimmedString} is deliberately NOT used here. `type` and `desc` are the only place IBKR
2074
+ * names an assignment, an exercise, or an expiration, and the public type states they are echoed
2075
+ * exactly. Trimming would change what a consumer classifies and what an audit comparison sees,
2076
+ * and a stated whitespace-only string is still a statement, never silence. A value that is not a
2077
+ * string is not text the broker stated, so it reads `null`.
2078
+ */
2079
+ verbatimString(value) {
2080
+ return typeof value === "string" ? value : null;
2081
+ }
2082
+ /**
2083
+ * One `pa/transactions` row, echoed. Nothing here maps, classifies, or
2084
+ * defaults a value; a field the broker did not state reads `null`.
2085
+ */
2086
+ contractTransactionRecord(transaction) {
2087
+ return {
2088
+ conid: toNullableNumber(transaction.conid),
2089
+ accountId: this.verbatimString(transaction.acctid),
2090
+ date: this.verbatimString(transaction.date),
2091
+ rawDate: this.verbatimString(transaction.rawDate),
2092
+ type: this.verbatimString(transaction.type),
2093
+ description: this.verbatimString(transaction.desc),
2094
+ currency: this.verbatimString(transaction.cur),
2095
+ amount: toNullableNumber(transaction.amt),
2096
+ quantity: toNullableNumber(transaction.qty),
2097
+ price: toNullableNumber(transaction.pr),
2098
+ fxRate: toNullableNumber(transaction.fxRate),
2099
+ presentFieldNames: Object.keys(transaction).sort(),
2100
+ };
2101
+ }
1898
2102
  async fetchTransactionHistory(startDate, endDate) {
1899
2103
  this.assertOpen();
1900
2104
  const accountId = await this.getAccountId();