snaptrade-typescript-sdk 9.0.47 → 9.0.49

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.
Files changed (32) hide show
  1. package/README.md +16 -9
  2. package/dist/api/trading-api-generated.d.ts +4 -3
  3. package/dist/api/trading-api-generated.js +9 -8
  4. package/dist/api/transactions-and-reporting-api-generated.d.ts +2 -2
  5. package/dist/api/transactions-and-reporting-api-generated.js +1 -1
  6. package/dist/browser.js +1 -1
  7. package/dist/configuration.js +1 -1
  8. package/dist/models/account-order-record-universal-symbol.d.ts +7 -7
  9. package/dist/models/account-order-record.d.ts +7 -7
  10. package/dist/models/action-strict-with-options.d.ts +6 -0
  11. package/dist/models/action-strict-with-options.js +2 -0
  12. package/dist/models/action-strict.d.ts +1 -1
  13. package/dist/models/brokerage-authorization.d.ts +7 -7
  14. package/dist/models/brokerage.d.ts +12 -12
  15. package/dist/models/holdings-status.d.ts +1 -1
  16. package/dist/models/index.d.ts +2 -0
  17. package/dist/models/index.js +2 -0
  18. package/dist/models/manual-trade-form-with-options.d.ts +71 -0
  19. package/dist/models/manual-trade-form-with-options.js +2 -0
  20. package/dist/models/manual-trade-form.d.ts +1 -1
  21. package/dist/models/manual-trade-symbol.d.ts +7 -7
  22. package/dist/models/manual-trade.d.ts +1 -1
  23. package/dist/models/option-brokerage-symbol.d.ts +6 -6
  24. package/dist/models/options-position.d.ts +6 -6
  25. package/dist/models/position-symbol.d.ts +6 -6
  26. package/dist/models/position.d.ts +5 -5
  27. package/dist/models/transactions-status.d.ts +1 -1
  28. package/dist/models/underlying-symbol.d.ts +7 -7
  29. package/dist/models/universal-activity.d.ts +1 -1
  30. package/dist/models/universal-symbol.d.ts +7 -7
  31. package/dist/operationParameterMap.js +6 -3
  32. package/package.json +1 -1
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Connect brokerage accounts to your app for live positions and trading
8
8
 
9
- [![npm](https://img.shields.io/badge/npm-v9.0.47-blue)](https://www.npmjs.com/package/snaptrade-typescript-sdk/v/9.0.47)
9
+ [![npm](https://img.shields.io/badge/npm-v9.0.49-blue)](https://www.npmjs.com/package/snaptrade-typescript-sdk/v/9.0.49)
10
10
  [![More Info](https://img.shields.io/badge/More%20Info-Click%20Here-orange)](https://snaptrade.com/)
11
11
 
12
12
  </div>
@@ -1559,7 +1559,7 @@ Unique identifier for the connected brokerage account. This is the UUID used to
1559
1559
 
1560
1560
  ##### action: [`ActionStrict`](./models/action-strict.ts)<a id="action-actionstrictmodelsaction-strictts"></a>
1561
1561
 
1562
- The action describes the intent or side of a trade. This is either `BUY` or `SELL`
1562
+ The action describes the intent or side of a trade. This is either `BUY` or `SELL`.
1563
1563
 
1564
1564
  ##### universal_symbol_id: `string`<a id="universal_symbol_id-string"></a>
1565
1565
 
@@ -1665,6 +1665,7 @@ const placeForceOrderResponse = await snaptrade.trading.placeForceOrder({
1665
1665
  account_id: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
1666
1666
  action: "BUY",
1667
1667
  universal_symbol_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
1668
+ symbol: "AAPL 131124C00240000",
1668
1669
  order_type: "Market",
1669
1670
  time_in_force: "FOK",
1670
1671
  price: 31.33,
@@ -1679,13 +1680,9 @@ const placeForceOrderResponse = await snaptrade.trading.placeForceOrder({
1679
1680
 
1680
1681
  Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
1681
1682
 
1682
- ##### action: [`ActionStrict`](./models/action-strict.ts)<a id="action-actionstrictmodelsaction-strictts"></a>
1683
-
1684
- The action describes the intent or side of a trade. This is either `BUY` or `SELL`
1685
-
1686
- ##### universal_symbol_id: `string`<a id="universal_symbol_id-string"></a>
1683
+ ##### action: [`ActionStrictWithOptions`](./models/action-strict-with-options.ts)<a id="action-actionstrictwithoptionsmodelsaction-strict-with-optionsts"></a>
1687
1684
 
1688
- Unique identifier for the symbol within SnapTrade. This is the ID used to reference the symbol in SnapTrade API calls.
1685
+ The action describes the intent or side of a trade. This is either `BUY` or `SELL` for Equity symbols or `BUY_TO_OPEN`, `BUY_TO_CLOSE`, `SELL_TO_OPEN` or `SELL_TO_CLOSE` for Options.
1689
1686
 
1690
1687
  ##### order_type: [`OrderTypeStrict`](./models/order-type-strict.ts)<a id="order_type-ordertypestrictmodelsorder-type-strictts"></a>
1691
1688
 
@@ -1699,6 +1696,14 @@ The Time in Force type for the order. This field indicates how long the order wi
1699
1696
 
1700
1697
  ##### userSecret: `string`<a id="usersecret-string"></a>
1701
1698
 
1699
+ ##### universal_symbol_id: [`string`](./models/model-string.ts)<a id="universal_symbol_id-stringmodelsmodel-stringts"></a>
1700
+
1701
+ The universal symbol ID of the security to trade. Must be \\\'null\\\' if `symbol` is provided, otherwise must be provided.
1702
+
1703
+ ##### symbol: `string`<a id="symbol-string"></a>
1704
+
1705
+ The security\\\'s trading ticker symbol. This currently only support Options symbols in the 21 character OCC format. For example \\\"AAPL 131124C00240000\\\" represents a call option on AAPL expiring on 2024-11-13 with a strike price of $240. For more information on the OCC format, see [here](https://en.wikipedia.org/wiki/Option_symbol#OCC_format). If \\\'symbol\\\' is provided, then \\\'universal_symbol_id\\\' must be \\\'null\\\'.
1706
+
1702
1707
  ##### price: `number`<a id="price-number"></a>
1703
1708
 
1704
1709
  The limit price for `Limit` and `StopLimit` orders.
@@ -1709,6 +1714,8 @@ The price at which a stop order is triggered for `Stop` and `StopLimit` orders.
1709
1714
 
1710
1715
  ##### units: [`number`](./models/number.ts)<a id="units-numbermodelsnumberts"></a>
1711
1716
 
1717
+ For Equity orders, this represents the number of shares for the order. This can be a decimal for fractional orders. Must be `null` if `notional_value` is provided. If placing an Option order, this field represents the number of contracts to buy or sell. (e.g., 1 contract = 100 shares).
1718
+
1712
1719
  ##### notional_value: [`ManualTradeFormNotionalValue`](./models/manual-trade-form-notional-value.ts)<a id="notional_value-manualtradeformnotionalvaluemodelsmanual-trade-form-notional-valuets"></a>
1713
1720
 
1714
1721
  #### 🔄 Return<a id="🔄-return"></a>
@@ -1819,7 +1826,7 @@ Optional comma separated list of SnapTrade Connection (Brokerage Authorization)
1819
1826
 
1820
1827
  ##### type: `string`<a id="type-string"></a>
1821
1828
 
1822
- Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account.
1829
+ Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event.
1823
1830
 
1824
1831
  #### 🔄 Return<a id="🔄-return"></a>
1825
1832
 
@@ -4,6 +4,7 @@ import { RequestArgs, BaseAPI } from '../base';
4
4
  import { AccountOrderRecord } from '../models';
5
5
  import { ManualTradeAndImpact } from '../models';
6
6
  import { ManualTradeForm } from '../models';
7
+ import { ManualTradeFormWithOptions } from '../models';
7
8
  import { SymbolsQuotesInner } from '../models';
8
9
  import { TradingCancelUserAccountOrderRequest } from '../models';
9
10
  import { ValidatedTradeBody } from '../models';
@@ -50,11 +51,11 @@ export declare const TradingApiAxiosParamCreator: (configuration?: Configuration
50
51
  * @summary Place order
51
52
  * @param {string} userId
52
53
  * @param {string} userSecret
53
- * @param {ManualTradeForm} manualTradeForm
54
+ * @param {ManualTradeFormWithOptions} manualTradeFormWithOptions
54
55
  * @param {*} [options] Override http request option.
55
56
  * @throws {RequiredError}
56
57
  */
57
- placeForceOrder: (userId: string, userSecret: string, manualTradeForm: ManualTradeForm, options?: AxiosRequestConfig) => Promise<RequestArgs>;
58
+ placeForceOrder: (userId: string, userSecret: string, manualTradeFormWithOptions: ManualTradeFormWithOptions, options?: AxiosRequestConfig) => Promise<RequestArgs>;
58
59
  /**
59
60
  * Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
60
61
  * @summary Place checked order
@@ -258,7 +259,7 @@ export type TradingApiPlaceForceOrderRequest = {
258
259
  * @memberof TradingApiPlaceForceOrder
259
260
  */
260
261
  readonly userSecret: string;
261
- } & ManualTradeForm;
262
+ } & ManualTradeFormWithOptions;
262
263
  /**
263
264
  * Request parameters for placeOrder operation in TradingApi.
264
265
  * @export
@@ -223,17 +223,17 @@ const TradingApiAxiosParamCreator = function (configuration) {
223
223
  * @summary Place order
224
224
  * @param {string} userId
225
225
  * @param {string} userSecret
226
- * @param {ManualTradeForm} manualTradeForm
226
+ * @param {ManualTradeFormWithOptions} manualTradeFormWithOptions
227
227
  * @param {*} [options] Override http request option.
228
228
  * @throws {RequiredError}
229
229
  */
230
- placeForceOrder: (userId, userSecret, manualTradeForm, options = {}) => __awaiter(this, void 0, void 0, function* () {
230
+ placeForceOrder: (userId, userSecret, manualTradeFormWithOptions, options = {}) => __awaiter(this, void 0, void 0, function* () {
231
231
  // verify required parameter 'userId' is not null or undefined
232
232
  (0, common_1.assertParamExists)('placeForceOrder', 'userId', userId);
233
233
  // verify required parameter 'userSecret' is not null or undefined
234
234
  (0, common_1.assertParamExists)('placeForceOrder', 'userSecret', userSecret);
235
- // verify required parameter 'manualTradeForm' is not null or undefined
236
- (0, common_1.assertParamExists)('placeForceOrder', 'manualTradeForm', manualTradeForm);
235
+ // verify required parameter 'manualTradeFormWithOptions' is not null or undefined
236
+ (0, common_1.assertParamExists)('placeForceOrder', 'manualTradeFormWithOptions', manualTradeFormWithOptions);
237
237
  const localVarPath = `/trade/place`;
238
238
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
239
239
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
@@ -260,7 +260,7 @@ const TradingApiAxiosParamCreator = function (configuration) {
260
260
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
261
261
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
262
262
  (0, requestBeforeHook_1.requestBeforeHook)({
263
- requestBody: manualTradeForm,
263
+ requestBody: manualTradeFormWithOptions,
264
264
  queryParameters: localVarQueryParameter,
265
265
  requestConfig: localVarRequestOptions,
266
266
  path: localVarPath,
@@ -268,7 +268,7 @@ const TradingApiAxiosParamCreator = function (configuration) {
268
268
  pathTemplate: '/trade/place',
269
269
  httpMethod: 'POST'
270
270
  });
271
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(manualTradeForm, localVarRequestOptions, configuration);
271
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(manualTradeFormWithOptions, localVarRequestOptions, configuration);
272
272
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
273
273
  return {
274
274
  url: (0, common_1.toPathString)(localVarUrlObj),
@@ -406,10 +406,11 @@ const TradingApiFp = function (configuration) {
406
406
  */
407
407
  placeForceOrder(requestParameters, options) {
408
408
  return __awaiter(this, void 0, void 0, function* () {
409
- const manualTradeForm = {
409
+ const manualTradeFormWithOptions = {
410
410
  account_id: requestParameters.account_id,
411
411
  action: requestParameters.action,
412
412
  universal_symbol_id: requestParameters.universal_symbol_id,
413
+ symbol: requestParameters.symbol,
413
414
  order_type: requestParameters.order_type,
414
415
  time_in_force: requestParameters.time_in_force,
415
416
  price: requestParameters.price,
@@ -417,7 +418,7 @@ const TradingApiFp = function (configuration) {
417
418
  units: requestParameters.units,
418
419
  notional_value: requestParameters.notional_value
419
420
  };
420
- const localVarAxiosArgs = yield localVarAxiosParamCreator.placeForceOrder(requestParameters.userId, requestParameters.userSecret, manualTradeForm, options);
421
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.placeForceOrder(requestParameters.userId, requestParameters.userSecret, manualTradeFormWithOptions, options);
421
422
  return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
422
423
  });
423
424
  },
@@ -17,7 +17,7 @@ export declare const TransactionsAndReportingApiAxiosParamCreator: (configuratio
17
17
  * @param {string | Date} [endDate] The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on &#x60;trade_date&#x60;.
18
18
  * @param {string} [accounts] Optional comma separated list of SnapTrade Account IDs used to filter the request to specific accounts. If not provided, the default is all known brokerage accounts for the user. The &#x60;brokerageAuthorizations&#x60; parameter takes precedence over this parameter.
19
19
  * @param {string} [brokerageAuthorizations] Optional comma separated list of SnapTrade Connection (Brokerage Authorization) IDs used to filter the request to only accounts that belong to those connections. If not provided, the default is all connections for the user. This parameter takes precedence over the &#x60;accounts&#x60; parameter.
20
- * @param {string} [type] Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - &#x60;BUY&#x60; - Asset bought. - &#x60;SELL&#x60; - Asset sold. - &#x60;DIVIDEND&#x60; - Dividend payout. - &#x60;CONTRIBUTION&#x60; - Cash contribution. - &#x60;WITHDRAWAL&#x60; - Cash withdrawal. - &#x60;REI&#x60; - Dividend reinvestment. - &#x60;INTEREST&#x60; - Interest deposited into the account. - &#x60;FEE&#x60; - Fee withdrawn from the account.
20
+ * @param {string} [type] Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - &#x60;BUY&#x60; - Asset bought. - &#x60;SELL&#x60; - Asset sold. - &#x60;DIVIDEND&#x60; - Dividend payout. - &#x60;CONTRIBUTION&#x60; - Cash contribution. - &#x60;WITHDRAWAL&#x60; - Cash withdrawal. - &#x60;REI&#x60; - Dividend reinvestment. - &#x60;INTEREST&#x60; - Interest deposited into the account. - &#x60;FEE&#x60; - Fee withdrawn from the account. - &#x60;OPTIONEXPIRATION&#x60; - Option expiration event. - &#x60;OPTIONASSIGNMENT&#x60; - Option assignment event. - &#x60;OPTIONEXERCISE&#x60; - Option exercise event.
21
21
  * @param {*} [options] Override http request option.
22
22
  * @throws {RequiredError}
23
23
  */
@@ -127,7 +127,7 @@ export type TransactionsAndReportingApiGetActivitiesRequest = {
127
127
  */
128
128
  readonly brokerageAuthorizations?: string;
129
129
  /**
130
- * Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account.
130
+ * Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event.
131
131
  * @type {string}
132
132
  * @memberof TransactionsAndReportingApiGetActivities
133
133
  */
@@ -44,7 +44,7 @@ const TransactionsAndReportingApiAxiosParamCreator = function (configuration) {
44
44
  * @param {string | Date} [endDate] The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on &#x60;trade_date&#x60;.
45
45
  * @param {string} [accounts] Optional comma separated list of SnapTrade Account IDs used to filter the request to specific accounts. If not provided, the default is all known brokerage accounts for the user. The &#x60;brokerageAuthorizations&#x60; parameter takes precedence over this parameter.
46
46
  * @param {string} [brokerageAuthorizations] Optional comma separated list of SnapTrade Connection (Brokerage Authorization) IDs used to filter the request to only accounts that belong to those connections. If not provided, the default is all connections for the user. This parameter takes precedence over the &#x60;accounts&#x60; parameter.
47
- * @param {string} [type] Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - &#x60;BUY&#x60; - Asset bought. - &#x60;SELL&#x60; - Asset sold. - &#x60;DIVIDEND&#x60; - Dividend payout. - &#x60;CONTRIBUTION&#x60; - Cash contribution. - &#x60;WITHDRAWAL&#x60; - Cash withdrawal. - &#x60;REI&#x60; - Dividend reinvestment. - &#x60;INTEREST&#x60; - Interest deposited into the account. - &#x60;FEE&#x60; - Fee withdrawn from the account.
47
+ * @param {string} [type] Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - &#x60;BUY&#x60; - Asset bought. - &#x60;SELL&#x60; - Asset sold. - &#x60;DIVIDEND&#x60; - Dividend payout. - &#x60;CONTRIBUTION&#x60; - Cash contribution. - &#x60;WITHDRAWAL&#x60; - Cash withdrawal. - &#x60;REI&#x60; - Dividend reinvestment. - &#x60;INTEREST&#x60; - Interest deposited into the account. - &#x60;FEE&#x60; - Fee withdrawn from the account. - &#x60;OPTIONEXPIRATION&#x60; - Option expiration event. - &#x60;OPTIONASSIGNMENT&#x60; - Option assignment event. - &#x60;OPTIONEXERCISE&#x60; - Option exercise event.
48
48
  * @param {*} [options] Override http request option.
49
49
  * @throws {RequiredError}
50
50
  */