@huskly/schwab-client 0.4.0 → 0.5.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
@@ -153,6 +153,37 @@ const orders = await client.fetchOrders({
153
153
  });
154
154
  ```
155
155
 
156
+ `fetchAccountOrders()` and `fetchOrders()` return Schwab's order payloads
157
+ unchanged, including `orderActivityCollection` on terminal orders when Schwab
158
+ populates it. Use `getRealizedFills()` to aggregate serial/partial executions
159
+ and correlate each fill with its order-leg symbol:
160
+
161
+ ```typescript
162
+ import { getOrderFees, getRealizedFills } from "@huskly/schwab-client";
163
+
164
+ const [order] = await client.fetchAccountOrders(accountHash, {
165
+ fromEnteredTime,
166
+ toEnteredTime,
167
+ status: "FILLED",
168
+ });
169
+ const fills = getRealizedFills(order);
170
+ // [{ legId, instrumentId, symbol, filledQuantity, averageFillPrice }]
171
+
172
+ const transactions = await client.fetchAccountTransactionHistory(
173
+ accountHash,
174
+ fromEnteredTime,
175
+ toEnteredTime,
176
+ );
177
+ const fees = getOrderFees(order, transactions);
178
+ // { totalFees, items, transactions }
179
+ ```
180
+
181
+ Fee correlation uses `SchwabTransaction.orderId` and only includes `TRADE`
182
+ transactions. Schwab exposes fees on individual `transferItems`; `items`
183
+ preserves their symbols and transfer-item types. The payload does not provide a
184
+ reliable normalized commission-versus-regulatory-fee classification, so callers
185
+ should not infer one from an unlabeled fee.
186
+
156
187
  #### Place an Order
157
188
 
158
189
  ```typescript
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export { SchwabClient } from "./schwabClient.js";
2
+ export { getOrderFees, getRealizedFills } from "./orderEconomics.js";
3
+ export type { SchwabOrderFeeItem, SchwabOrderFees, SchwabRealizedFill, } from "./orderEconomics.js";
2
4
  export type { SchwabQuoteAssetMainType, SchwabQuoteReference, SchwabQuoteData, SchwabQuoteRegular, SchwabQuoteFundamental, SchwabQuoteResponse, OptionQuote, PutCreditSpread, ISODateTime, SchwabSession, SchwabDuration, SchwabOrderType, SchwabComplexOrderStrategyType, SchwabRequestedDestination, SchwabLinkBasis, SchwabLinkType, SchwabStopType, SchwabPriceLinkBasis, SchwabTaxLotMethod, SchwabOrderLegType, SchwabInstruction, SchwabPositionEffect, SchwabQuantityType, SchwabDivCapGains, SchwabSpecialInstruction, SchwabOrderStrategyType, SchwabOrderStatus, SchwabAssetType, SchwabAccountBaseInstrument, SchwabCashEquivalentType, SchwabAccountCashEquivalent, SchwabAccountEquity, SchwabAccountFixedIncome, SchwabAccountMutualFund, SchwabApiCurrencyType, SchwabDeliverableAssetType, SchwabPutCall, SchwabOptionType, SchwabAccountApiOptionDeliverable, SchwabAccountOption, SchwabAccountsInstrument, SchwabOrderLeg, SchwabOrderActivityType, SchwabExecutionType, SchwabExecutionLeg, SchwabOrderActivity, SchwabOrder, SchwabOrdersResponse, SchwabInstrumentSearchProjection, SchwabInstrumentAssetType, SchwabFundamentalInstrument, SchwabBasicInstrument, SchwabBondInstrument, SchwabInstrumentResponse, SchwabInstrumentSearchResponse, SchwabMoversIndexSymbol, SchwabMoversSort, SchwabMoversFrequency, SchwabMoversDirection, SchwabMover, SchwabMoversResponse, SchwabOrderRequestInstrument, SchwabOrderRequestLeg, SchwabOrderRequest, PriceHistoryCandle, PriceHistoryResponse, } from "./types.js";
3
5
  export type { SchwabAccountDetails, SchwabAccountPosition, SchwabAccount, SchwabPosition, SchwabInstrument, SchwabTransferItem, SchwabTransaction, SchwabAccountTransactionHistory, SchwabUserPreferenceAccount, SchwabStreamerInfo, SchwabOffer, SchwabUserPreference, } from "./schwabApiTypes.js";
4
6
  export { ALL_SCHWAB_ORDER_TYPES, ALL_SCHWAB_INSTRUCTIONS } from "./types.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,YAAY,EAEV,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,WAAW,EACX,eAAe,EAEf,WAAW,EACX,aAAa,EACb,cAAc,EACd,eAAe,EACf,8BAA8B,EAC9B,0BAA0B,EAC1B,eAAe,EACf,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,2BAA2B,EAC3B,wBAAwB,EACxB,2BAA2B,EAC3B,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,aAAa,EACb,gBAAgB,EAChB,iCAAiC,EACjC,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACX,oBAAoB,EAEpB,gCAAgC,EAChC,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAE9B,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,oBAAoB,EAEpB,4BAA4B,EAC5B,qBAAqB,EACrB,kBAAkB,EAElB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAGpB,YAAY,EACV,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,+BAA+B,EAC/B,2BAA2B,EAC3B,kBAAkB,EAClB,WAAW,EACX,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.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AgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,+BAA+B,EAC/B,2BAA2B,EAC3B,kBAAkB,EAClB,WAAW,EACX,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  // Main client
2
2
  export { SchwabClient } from "./schwabClient.js";
3
+ // Order economics helpers
4
+ export { getOrderFees, getRealizedFills } from "./orderEconomics.js";
3
5
  // Constants
4
6
  export { ALL_SCHWAB_ORDER_TYPES, ALL_SCHWAB_INSTRUCTIONS } from "./types.js";
5
7
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AA8FjD,YAAY;AACZ,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,0BAA0B;AAC1B,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAmGrE,YAAY;AACZ,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,35 @@
1
+ import type { SchwabTransaction } from "./schwabApiTypes.js";
2
+ import type { SchwabOrder } from "./types.js";
3
+ export interface SchwabRealizedFill {
4
+ legId?: number;
5
+ instrumentId?: number;
6
+ symbol?: string;
7
+ filledQuantity: number;
8
+ averageFillPrice: number;
9
+ }
10
+ export interface SchwabOrderFeeItem {
11
+ activityId: number;
12
+ transactionId?: number;
13
+ transferItemType?: string;
14
+ symbol?: string;
15
+ fee: number;
16
+ }
17
+ export interface SchwabOrderFees {
18
+ orderId: number;
19
+ totalFees: number;
20
+ items: SchwabOrderFeeItem[];
21
+ transactions: SchwabTransaction[];
22
+ }
23
+ /**
24
+ * Aggregate an order's EXECUTION activities into one realized fill per order
25
+ * leg. Only execution legs with finite, positive quantities and finite prices
26
+ * are included.
27
+ */
28
+ export declare function getRealizedFills(order: SchwabOrder): SchwabRealizedFill[];
29
+ /**
30
+ * Correlate TRADE transactions and their fee-bearing transfer items to an
31
+ * order. Fee categories are preserved exactly as Schwab returns them; the API
32
+ * does not expose a reliable normalized commission/regulatory-fee breakdown.
33
+ */
34
+ export declare function getOrderFees(order: SchwabOrder | number, transactions: readonly SchwabTransaction[]): SchwabOrderFees;
35
+ //# sourceMappingURL=orderEconomics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orderEconomics.d.ts","sourceRoot":"","sources":["../src/orderEconomics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAEV,WAAW,EAEZ,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,YAAY,EAAE,iBAAiB,EAAE,CAAC;CACnC;AAoCD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,kBAAkB,EAAE,CAwDzE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,WAAW,GAAG,MAAM,EAC3B,YAAY,EAAE,SAAS,iBAAiB,EAAE,GACzC,eAAe,CAgCjB"}
@@ -0,0 +1,95 @@
1
+ function matchingOrderLeg(executionLeg, orderLegs) {
2
+ if (executionLeg.legId !== undefined) {
3
+ const index = orderLegs.findIndex((leg) => leg.legId === executionLeg.legId);
4
+ if (index !== -1)
5
+ return { leg: orderLegs[index], index };
6
+ }
7
+ if (executionLeg.instrumentId !== undefined) {
8
+ const index = orderLegs.findIndex((leg) => leg.instrument?.instrumentId === executionLeg.instrumentId);
9
+ if (index !== -1)
10
+ return { leg: orderLegs[index], index };
11
+ }
12
+ return orderLegs.length === 1 ? { leg: orderLegs[0], index: 0 } : undefined;
13
+ }
14
+ /**
15
+ * Aggregate an order's EXECUTION activities into one realized fill per order
16
+ * leg. Only execution legs with finite, positive quantities and finite prices
17
+ * are included.
18
+ */
19
+ export function getRealizedFills(order) {
20
+ const orderLegs = order.orderLegCollection ?? [];
21
+ const fills = new Map();
22
+ for (const activity of order.orderActivityCollection ?? []) {
23
+ if (activity.activityType !== "EXECUTION")
24
+ continue;
25
+ for (const executionLeg of activity.executionLegs ?? []) {
26
+ const { price, quantity } = executionLeg;
27
+ if (price === undefined ||
28
+ quantity === undefined ||
29
+ !Number.isFinite(price) ||
30
+ !Number.isFinite(quantity) ||
31
+ quantity <= 0) {
32
+ continue;
33
+ }
34
+ const match = matchingOrderLeg(executionLeg, orderLegs);
35
+ const orderLeg = match?.leg;
36
+ const legId = executionLeg.legId ?? orderLeg?.legId;
37
+ const instrumentId = executionLeg.instrumentId ?? orderLeg?.instrument?.instrumentId;
38
+ const key = match !== undefined
39
+ ? `order-leg:${String(match.index)}`
40
+ : legId !== undefined
41
+ ? `leg:${String(legId)}`
42
+ : instrumentId !== undefined
43
+ ? `instrument:${String(instrumentId)}`
44
+ : undefined;
45
+ // An execution leg without any usable correlation identifier cannot be
46
+ // safely attributed in a multi-leg order.
47
+ if (!key)
48
+ continue;
49
+ const existing = fills.get(key) ?? {
50
+ legId,
51
+ instrumentId,
52
+ symbol: orderLeg?.instrument?.symbol,
53
+ filledQuantity: 0,
54
+ weightedPrice: 0,
55
+ };
56
+ existing.filledQuantity += quantity;
57
+ existing.weightedPrice += price * quantity;
58
+ fills.set(key, existing);
59
+ }
60
+ }
61
+ return [...fills.values()].map(({ weightedPrice, ...fill }) => ({
62
+ ...fill,
63
+ averageFillPrice: weightedPrice / fill.filledQuantity,
64
+ }));
65
+ }
66
+ /**
67
+ * Correlate TRADE transactions and their fee-bearing transfer items to an
68
+ * order. Fee categories are preserved exactly as Schwab returns them; the API
69
+ * does not expose a reliable normalized commission/regulatory-fee breakdown.
70
+ */
71
+ export function getOrderFees(order, transactions) {
72
+ const orderId = typeof order === "number" ? order : order.orderId;
73
+ if (orderId === undefined || !Number.isFinite(orderId)) {
74
+ throw new Error("A valid order id is required to correlate order fees");
75
+ }
76
+ const matchingTransactions = transactions.filter((transaction) => transaction.orderId === orderId && transaction.type === "TRADE");
77
+ const items = matchingTransactions.flatMap((transaction) => (transaction.transferItems ?? []).flatMap((item) => item.fee === undefined || !Number.isFinite(item.fee)
78
+ ? []
79
+ : [
80
+ {
81
+ activityId: transaction.activityId,
82
+ transactionId: item.transactionId,
83
+ transferItemType: item.transferItemType,
84
+ symbol: item.instrument?.symbol,
85
+ fee: item.fee,
86
+ },
87
+ ]));
88
+ return {
89
+ orderId,
90
+ totalFees: items.reduce((total, item) => total + item.fee, 0),
91
+ items,
92
+ transactions: matchingTransactions,
93
+ };
94
+ }
95
+ //# sourceMappingURL=orderEconomics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orderEconomics.js","s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W,CAAC,UAAU;gBAClC,aAAa,EAAE,IAAI,CAAC,aAAa;gBACjC,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;gBACvC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM;gBAC/B,GAAG,EAAE,IAAI,CAAC,GAAG;aACd;SACF,CACN,CACF,CAAC;IAEF,OAAO;QACL,OAAO;QACP,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QAC7D,KAAK;QACL,YAAY,EAAE,oBAAoB;KACnC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huskly/schwab-client",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Schwab Market Data and Trading API client",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -24,6 +24,7 @@
24
24
  "format:check": "prettier --check 'src/**/*.ts' 'package.json' 'tsconfig.json'",
25
25
  "lint": "eslint src --ext .ts",
26
26
  "lint:fix": "eslint src --ext .ts --fix",
27
+ "test": "npm run build && node --test test/*.test.js",
27
28
  "prepublishOnly": "npm run clean && npm run build"
28
29
  },
29
30
  "keywords": [