snaptrade-typescript-sdk 13.1.7 → 13.1.9

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.cjs CHANGED
@@ -492,7 +492,7 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
492
492
  },
493
493
  /**
494
494
  * Returns the account\'s balances in a single snapshot: total net value, cash per currency, buying power, and margin details for margin accounts. Every field is always present and is `null` when the institution doesn\'t report it. **Beta:** this endpoint is only available for partners it has been enabled for. Please contact the SnapTrade team to enable it. The response schema may change. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. `data_freshness.as_of` is the time the returned data was fetched from the institution. If the connection has become disabled, it can no longer access the latest data from the institution, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
495
- * @summary Get account balances
495
+ * @summary List account balances (V2)
496
496
  * @param {string} accountId
497
497
  * @param {string} [userId]
498
498
  * @param {string} [userSecret]
@@ -1508,7 +1508,7 @@ const AccountInformationApiFp = function(configuration) {
1508
1508
  },
1509
1509
  /**
1510
1510
  * Returns the account\'s balances in a single snapshot: total net value, cash per currency, buying power, and margin details for margin accounts. Every field is always present and is `null` when the institution doesn\'t report it. **Beta:** this endpoint is only available for partners it has been enabled for. Please contact the SnapTrade team to enable it. The response schema may change. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. `data_freshness.as_of` is the time the returned data was fetched from the institution. If the connection has become disabled, it can no longer access the latest data from the institution, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
1511
- * @summary Get account balances
1511
+ * @summary List account balances (V2)
1512
1512
  * @param {AccountInformationApiGetAccountBalancesV2Request<TAuth>} requestParameters Request parameters.
1513
1513
  * @param {*} [options] Override http request option.
1514
1514
  * @throws {RequiredError}
@@ -1840,7 +1840,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
1840
1840
  },
1841
1841
  /**
1842
1842
  * Returns the account\'s balances in a single snapshot: total net value, cash per currency, buying power, and margin details for margin accounts. Every field is always present and is `null` when the institution doesn\'t report it. **Beta:** this endpoint is only available for partners it has been enabled for. Please contact the SnapTrade team to enable it. The response schema may change. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. `data_freshness.as_of` is the time the returned data was fetched from the institution. If the connection has become disabled, it can no longer access the latest data from the institution, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
1843
- * @summary Get account balances
1843
+ * @summary List account balances (V2)
1844
1844
  * @param {AccountInformationApiGetAccountBalancesV2Request<TAuth>} requestParameters Request parameters.
1845
1845
  * @param {*} [options] Override http request option.
1846
1846
  * @throws {RequiredError}
@@ -2004,7 +2004,7 @@ var AccountInformationApiGenerated = class extends BaseAPI {
2004
2004
  }
2005
2005
  /**
2006
2006
  * Returns the account\'s balances in a single snapshot: total net value, cash per currency, buying power, and margin details for margin accounts. Every field is always present and is `null` when the institution doesn\'t report it. **Beta:** this endpoint is only available for partners it has been enabled for. Please contact the SnapTrade team to enable it. The response schema may change. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. `data_freshness.as_of` is the time the returned data was fetched from the institution. If the connection has become disabled, it can no longer access the latest data from the institution, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
2007
- * @summary Get account balances
2007
+ * @summary List account balances (V2)
2008
2008
  * @param {AccountInformationApiGetAccountBalancesV2Request<TAuth>} requestParameters Request parameters.
2009
2009
  * @param {*} [options] Override http request option.
2010
2010
  * @throws {RequiredError}
@@ -4055,6 +4055,83 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
4055
4055
  };
4056
4056
  },
4057
4057
  /**
4058
+ * Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Experimental:** this endpoint may change without notice. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
4059
+ * @summary List all account orders
4060
+ * @param {string} accountId
4061
+ * @param {'all' | 'open' | 'executed'} [state] defaults to \&quot;all\&quot;
4062
+ * @param {number} [days] Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. Values greater than 90 will be capped at 90.
4063
+ * @param {string} [userId]
4064
+ * @param {string} [userSecret]
4065
+ * @param {*} [options] Override http request option.
4066
+ * @throws {RequiredError}
4067
+ */
4068
+ getAllAccountOrders: async (accountId, state, days, userId, userSecret, options = {}) => {
4069
+ assertParamExists("getAllAccountOrders", "accountId", accountId);
4070
+ const localVarPath = `/accounts/{accountId}/orders/all`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
4071
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
4072
+ let baseOptions;
4073
+ if (configuration) baseOptions = configuration.baseOptions;
4074
+ const localVarRequestOptions = {
4075
+ method: "GET",
4076
+ ...baseOptions,
4077
+ ...options
4078
+ };
4079
+ const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
4080
+ const localVarQueryParameter = {};
4081
+ if (configuration?.authMode === "commercialApiKey") {
4082
+ await setApiKeyToObject({
4083
+ object: localVarQueryParameter,
4084
+ key: "clientId",
4085
+ keyParamName: "clientId",
4086
+ configuration
4087
+ });
4088
+ if (userId !== void 0) localVarQueryParameter["userId"] = userId;
4089
+ if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
4090
+ }
4091
+ if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
4092
+ object: localVarQueryParameter,
4093
+ key: "clientId",
4094
+ keyParamName: "clientId",
4095
+ configuration
4096
+ });
4097
+ if (state !== void 0) localVarQueryParameter["state"] = state;
4098
+ if (days !== void 0) localVarQueryParameter["days"] = days;
4099
+ const localVarOperationAuth = {
4100
+ authModes: ["commercialApiKey", "personalApiKey"],
4101
+ requestSigningByAuthMode: {
4102
+ "commercialApiKey": {
4103
+ secretParameter: "consumerKey",
4104
+ signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
4105
+ },
4106
+ "personalApiKey": {
4107
+ secretParameter: "consumerKey",
4108
+ signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
4109
+ }
4110
+ },
4111
+ selectedAuthMode: configuration?.authMode
4112
+ };
4113
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
4114
+ localVarRequestOptions.headers = {
4115
+ ...localVarHeaderParameter,
4116
+ ...headersFromBaseOptions,
4117
+ ...options.headers
4118
+ };
4119
+ requestBeforeHook({
4120
+ queryParameters: localVarQueryParameter,
4121
+ requestConfig: localVarRequestOptions,
4122
+ path: localVarPath,
4123
+ configuration,
4124
+ pathTemplate: "/accounts/{accountId}/orders/all",
4125
+ httpMethod: "GET",
4126
+ operationAuth: localVarOperationAuth
4127
+ });
4128
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
4129
+ return {
4130
+ url: toPathString(localVarUrlObj),
4131
+ options: localVarRequestOptions
4132
+ };
4133
+ },
4134
+ /**
4058
4135
  * Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
4059
4136
  * @summary Get account order detail (V2)
4060
4137
  * @param {string} accountId
@@ -4485,6 +4562,29 @@ const ExperimentalEndpointsApiFp = function(configuration) {
4485
4562
  });
4486
4563
  },
4487
4564
  /**
4565
+ * Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Experimental:** this endpoint may change without notice. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
4566
+ * @summary List all account orders
4567
+ * @param {ExperimentalEndpointsApiGetAllAccountOrdersRequest<TAuth>} requestParameters Request parameters.
4568
+ * @param {*} [options] Override http request option.
4569
+ * @throws {RequiredError}
4570
+ */
4571
+ async getAllAccountOrders(...args) {
4572
+ const [requestParameters = {}, options] = args;
4573
+ return createRequestFunction(await localVarAxiosParamCreator.getAllAccountOrders(requestParameters.accountId, requestParameters.state, requestParameters.days, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
4574
+ authModes: ["commercialApiKey", "personalApiKey"],
4575
+ requestSigningByAuthMode: {
4576
+ "commercialApiKey": {
4577
+ secretParameter: "consumerKey",
4578
+ signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
4579
+ },
4580
+ "personalApiKey": {
4581
+ secretParameter: "consumerKey",
4582
+ signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
4583
+ }
4584
+ }
4585
+ });
4586
+ },
4587
+ /**
4488
4588
  * Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
4489
4589
  * @summary Get account order detail (V2)
4490
4590
  * @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request<TAuth>} requestParameters Request parameters.
@@ -4640,6 +4740,16 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
4640
4740
  return localVarFp.cancelSubscription(...args).then((request) => request(axios$5, basePath));
4641
4741
  },
4642
4742
  /**
4743
+ * Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Experimental:** this endpoint may change without notice. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
4744
+ * @summary List all account orders
4745
+ * @param {ExperimentalEndpointsApiGetAllAccountOrdersRequest<TAuth>} requestParameters Request parameters.
4746
+ * @param {*} [options] Override http request option.
4747
+ * @throws {RequiredError}
4748
+ */
4749
+ getAllAccountOrders(...args) {
4750
+ return localVarFp.getAllAccountOrders(...args).then((request) => request(axios$5, basePath));
4751
+ },
4752
+ /**
4643
4753
  * Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
4644
4754
  * @summary Get account order detail (V2)
4645
4755
  * @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request<TAuth>} requestParameters Request parameters.
@@ -4720,6 +4830,17 @@ var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
4720
4830
  return ExperimentalEndpointsApiFp(this.configuration).cancelSubscription(...args).then((request) => request(this.axios, this.basePath));
4721
4831
  }
4722
4832
  /**
4833
+ * Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Experimental:** this endpoint may change without notice. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
4834
+ * @summary List all account orders
4835
+ * @param {ExperimentalEndpointsApiGetAllAccountOrdersRequest<TAuth>} requestParameters Request parameters.
4836
+ * @param {*} [options] Override http request option.
4837
+ * @throws {RequiredError}
4838
+ * @memberof ExperimentalEndpointsApiGenerated
4839
+ */
4840
+ getAllAccountOrders(...args) {
4841
+ return ExperimentalEndpointsApiFp(this.configuration).getAllAccountOrders(...args).then((request) => request(this.axios, this.basePath));
4842
+ }
4843
+ /**
4723
4844
  * Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
4724
4845
  * @summary Get account order detail (V2)
4725
4846
  * @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request<TAuth>} requestParameters Request parameters.
@@ -7907,7 +8028,7 @@ var Configuration = class {
7907
8028
  }
7908
8029
  this.basePath = param.basePath;
7909
8030
  this.baseOptions = param.baseOptions ?? {};
7910
- this.userAgent = param.userAgent === void 0 ? "Konfig/13.1.7/typescript" : param.userAgent;
8031
+ this.userAgent = param.userAgent === void 0 ? "Konfig/13.1.9/typescript" : param.userAgent;
7911
8032
  this.formDataCtor = param.formDataCtor;
7912
8033
  }
7913
8034
  /**