snaptrade-typescript-sdk 10.0.1 → 10.0.3

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
@@ -31,9 +31,9 @@ const BASE_PATH = "https://api.snaptrade.com/api/v1".replace(/\/+$/, "");
31
31
  * @class BaseAPI
32
32
  */
33
33
  var BaseAPI = class {
34
- constructor(configuration, basePath = BASE_PATH, axios$10 = axios.default) {
34
+ constructor(configuration, basePath = BASE_PATH, axios$11 = axios.default) {
35
35
  this.basePath = basePath;
36
- this.axios = axios$10;
36
+ this.axios = axios$11;
37
37
  if (configuration) {
38
38
  this.configuration = configuration;
39
39
  this.basePath = configuration.basePath || this.basePath;
@@ -260,7 +260,7 @@ async function wrapAxiosRequest(makeRequest) {
260
260
  * @export
261
261
  */
262
262
  const createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, configuration) {
263
- return async (axios$9 = globalAxios, basePath = BASE_PATH) => {
263
+ return async (axios$10 = globalAxios, basePath = BASE_PATH) => {
264
264
  const url = (configuration?.basePath || basePath) + axiosArgs.url;
265
265
  await requestAfterHook({
266
266
  axiosArgs,
@@ -268,7 +268,7 @@ const createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, config
268
268
  url,
269
269
  configuration
270
270
  });
271
- return wrapAxiosRequest(async () => await axios$9.request({
271
+ return wrapAxiosRequest(async () => await axios$10.request({
272
272
  ...axiosArgs.options,
273
273
  url
274
274
  }));
@@ -824,12 +824,13 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
824
824
  };
825
825
  },
826
826
  /**
827
- * Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
827
+ * Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). This endpoint is deprecated. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
828
828
  * @summary List account positions
829
829
  * @param {string} userId
830
830
  * @param {string} userSecret
831
831
  * @param {string} accountId
832
832
  * @param {*} [options] Override http request option.
833
+ * @deprecated
833
834
  * @throws {RequiredError}
834
835
  */
835
836
  getUserAccountPositions: async (userId, userSecret, accountId, options = {}) => {
@@ -1303,10 +1304,11 @@ const AccountInformationApiFp = function(configuration) {
1303
1304
  return createRequestFunction(await localVarAxiosParamCreator.getUserAccountOrders(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.state, requestParameters.days, options), axios.default, BASE_PATH, configuration);
1304
1305
  },
1305
1306
  /**
1306
- * Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
1307
+ * Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). This endpoint is deprecated. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
1307
1308
  * @summary List account positions
1308
1309
  * @param {AccountInformationApiGetUserAccountPositionsRequest} requestParameters Request parameters.
1309
1310
  * @param {*} [options] Override http request option.
1311
+ * @deprecated
1310
1312
  * @throws {RequiredError}
1311
1313
  */
1312
1314
  async getUserAccountPositions(requestParameters, options) {
@@ -1370,7 +1372,7 @@ const AccountInformationApiFp = function(configuration) {
1370
1372
  * AccountInformationApi - factory interface
1371
1373
  * @export
1372
1374
  */
1373
- const AccountInformationApiFactory = function(configuration, basePath, axios$8) {
1375
+ const AccountInformationApiFactory = function(configuration, basePath, axios$9) {
1374
1376
  const localVarFp = AccountInformationApiFp(configuration);
1375
1377
  return {
1376
1378
  /**
@@ -1381,7 +1383,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$8)
1381
1383
  * @throws {RequiredError}
1382
1384
  */
1383
1385
  getAccountActivities(requestParameters, options) {
1384
- return localVarFp.getAccountActivities(requestParameters, options).then((request) => request(axios$8, basePath));
1386
+ return localVarFp.getAccountActivities(requestParameters, options).then((request) => request(axios$9, basePath));
1385
1387
  },
1386
1388
  /**
1387
1389
  * An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year.
@@ -1391,7 +1393,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$8)
1391
1393
  * @throws {RequiredError}
1392
1394
  */
1393
1395
  getAccountBalanceHistory(requestParameters, options) {
1394
- return localVarFp.getAccountBalanceHistory(requestParameters, options).then((request) => request(axios$8, basePath));
1396
+ return localVarFp.getAccountBalanceHistory(requestParameters, options).then((request) => request(axios$9, basePath));
1395
1397
  },
1396
1398
  /**
1397
1399
  * Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, and option positions. Use the `instrument.kind` discriminator to determine the schema for each position\'s `instrument`. `mutualfund` positions may also include `cash_equivalent`. `stock` positions may include `tax_lots` when tax lot data is enabled for the account. 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.
@@ -1401,7 +1403,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$8)
1401
1403
  * @throws {RequiredError}
1402
1404
  */
1403
1405
  getAllAccountPositions(requestParameters, options) {
1404
- return localVarFp.getAllAccountPositions(requestParameters, options).then((request) => request(axios$8, basePath));
1406
+ return localVarFp.getAllAccountPositions(requestParameters, options).then((request) => request(axios$9, basePath));
1405
1407
  },
1406
1408
  /**
1407
1409
  * **Deprecated, please use the account-specific holdings endpoint instead.** List all accounts for the user, plus balances, positions, and orders for each account. **Note:** This endpoint will return HTTP 410 Gone for all customers that sign up after April 25, 2026.
@@ -1412,7 +1414,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$8)
1412
1414
  * @throws {RequiredError}
1413
1415
  */
1414
1416
  getAllUserHoldings(requestParameters, options) {
1415
- return localVarFp.getAllUserHoldings(requestParameters, options).then((request) => request(axios$8, basePath));
1417
+ return localVarFp.getAllUserHoldings(requestParameters, options).then((request) => request(axios$9, basePath));
1416
1418
  },
1417
1419
  /**
1418
1420
  * Returns a list of balances for the account. Each element of the list has a distinct currency. Some brokerages like Questrade [allows holding multiple currencies in the same account](https://www.questrade.com/learning/questrade-basics/balances-and-reports/understanding-your-account-balances). 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
@@ -1422,7 +1424,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$8)
1422
1424
  * @throws {RequiredError}
1423
1425
  */
1424
1426
  getUserAccountBalance(requestParameters, options) {
1425
- return localVarFp.getUserAccountBalance(requestParameters, options).then((request) => request(axios$8, basePath));
1427
+ return localVarFp.getUserAccountBalance(requestParameters, options).then((request) => request(axios$9, basePath));
1426
1428
  },
1427
1429
  /**
1428
1430
  * Returns account detail known to SnapTrade for the specified account. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
@@ -1432,7 +1434,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$8)
1432
1434
  * @throws {RequiredError}
1433
1435
  */
1434
1436
  getUserAccountDetails(requestParameters, options) {
1435
- return localVarFp.getUserAccountDetails(requestParameters, options).then((request) => request(axios$8, basePath));
1437
+ return localVarFp.getUserAccountDetails(requestParameters, options).then((request) => request(axios$9, basePath));
1436
1438
  },
1437
1439
  /**
1438
1440
  * Returns the detail of a single order using the external order ID provided in the request body. This endpoint only works for single-leg orders at this time. Support for multi-leg orders will be added in the future. 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.
@@ -1442,7 +1444,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$8)
1442
1444
  * @throws {RequiredError}
1443
1445
  */
1444
1446
  getUserAccountOrderDetail(requestParameters, options) {
1445
- return localVarFp.getUserAccountOrderDetail(requestParameters, options).then((request) => request(axios$8, basePath));
1447
+ return localVarFp.getUserAccountOrderDetail(requestParameters, options).then((request) => request(axios$9, basePath));
1446
1448
  },
1447
1449
  /**
1448
1450
  * Returns a list of recent orders in the specified account. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
@@ -1452,17 +1454,18 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$8)
1452
1454
  * @throws {RequiredError}
1453
1455
  */
1454
1456
  getUserAccountOrders(requestParameters, options) {
1455
- return localVarFp.getUserAccountOrders(requestParameters, options).then((request) => request(axios$8, basePath));
1457
+ return localVarFp.getUserAccountOrders(requestParameters, options).then((request) => request(axios$9, basePath));
1456
1458
  },
1457
1459
  /**
1458
- * Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
1460
+ * Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). This endpoint is deprecated. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
1459
1461
  * @summary List account positions
1460
1462
  * @param {AccountInformationApiGetUserAccountPositionsRequest} requestParameters Request parameters.
1461
1463
  * @param {*} [options] Override http request option.
1464
+ * @deprecated
1462
1465
  * @throws {RequiredError}
1463
1466
  */
1464
1467
  getUserAccountPositions(requestParameters, options) {
1465
- return localVarFp.getUserAccountPositions(requestParameters, options).then((request) => request(axios$8, basePath));
1468
+ return localVarFp.getUserAccountPositions(requestParameters, options).then((request) => request(axios$9, basePath));
1466
1469
  },
1467
1470
  /**
1468
1471
  * A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders Differs from /orders in that it is always realtime, and only checks the last 24 hours By default only returns executed orders, but that can be changed by setting *only_executed* to false
@@ -1472,7 +1475,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$8)
1472
1475
  * @throws {RequiredError}
1473
1476
  */
1474
1477
  getUserAccountRecentOrders(requestParameters, options) {
1475
- return localVarFp.getUserAccountRecentOrders(requestParameters, options).then((request) => request(axios$8, basePath));
1478
+ return localVarFp.getUserAccountRecentOrders(requestParameters, options).then((request) => request(axios$9, basePath));
1476
1479
  },
1477
1480
  /**
1478
1481
  * Returns a list of rate of return percents for a given account.
@@ -1482,7 +1485,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$8)
1482
1485
  * @throws {RequiredError}
1483
1486
  */
1484
1487
  getUserAccountReturnRates(requestParameters, options) {
1485
- return localVarFp.getUserAccountReturnRates(requestParameters, options).then((request) => request(axios$8, basePath));
1488
+ return localVarFp.getUserAccountReturnRates(requestParameters, options).then((request) => request(axios$9, basePath));
1486
1489
  },
1487
1490
  /**
1488
1491
  * **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). Returns a list of balances, positions, and recent orders for the specified account. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
@@ -1493,7 +1496,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$8)
1493
1496
  * @throws {RequiredError}
1494
1497
  */
1495
1498
  getUserHoldings(requestParameters, options) {
1496
- return localVarFp.getUserHoldings(requestParameters, options).then((request) => request(axios$8, basePath));
1499
+ return localVarFp.getUserHoldings(requestParameters, options).then((request) => request(axios$9, basePath));
1497
1500
  },
1498
1501
  /**
1499
1502
  * **Deprecated, please use the [list accounts for a connection endpoint](/reference/Connections/Connections_listBrokerageAuthorizationAccounts) instead.** Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. This endpoint returns Daily data regardless of the customer\'s plan. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To get real-time data on Pay as you Go / Real-time, use the connection-scoped endpoint linked above. Customers on Pay as you Go / Daily can force a refresh with the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
@@ -1504,7 +1507,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$8)
1504
1507
  * @throws {RequiredError}
1505
1508
  */
1506
1509
  listUserAccounts(requestParameters, options) {
1507
- return localVarFp.listUserAccounts(requestParameters, options).then((request) => request(axios$8, basePath));
1510
+ return localVarFp.listUserAccounts(requestParameters, options).then((request) => request(axios$9, basePath));
1508
1511
  },
1509
1512
  /**
1510
1513
  * Updates various properties of a specified account.
@@ -1514,7 +1517,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$8)
1514
1517
  * @throws {RequiredError}
1515
1518
  */
1516
1519
  updateUserAccount(requestParameters, options) {
1517
- return localVarFp.updateUserAccount(requestParameters, options).then((request) => request(axios$8, basePath));
1520
+ return localVarFp.updateUserAccount(requestParameters, options).then((request) => request(axios$9, basePath));
1518
1521
  }
1519
1522
  };
1520
1523
  };
@@ -1615,10 +1618,11 @@ var AccountInformationApiGenerated = class extends BaseAPI {
1615
1618
  return AccountInformationApiFp(this.configuration).getUserAccountOrders(requestParameters, options).then((request) => request(this.axios, this.basePath));
1616
1619
  }
1617
1620
  /**
1618
- * Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
1621
+ * Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). This endpoint is deprecated. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
1619
1622
  * @summary List account positions
1620
1623
  * @param {AccountInformationApiGetUserAccountPositionsRequest} requestParameters Request parameters.
1621
1624
  * @param {*} [options] Override http request option.
1625
+ * @deprecated
1622
1626
  * @throws {RequiredError}
1623
1627
  * @memberof AccountInformationApiGenerated
1624
1628
  */
@@ -1754,7 +1758,7 @@ async check(options) {
1754
1758
  * ApiStatusApi - factory interface
1755
1759
  * @export
1756
1760
  */
1757
- const ApiStatusApiFactory = function(configuration, basePath, axios$7) {
1761
+ const ApiStatusApiFactory = function(configuration, basePath, axios$8) {
1758
1762
  const localVarFp = ApiStatusApiFp(configuration);
1759
1763
  return {
1760
1764
  /**
@@ -1764,7 +1768,7 @@ const ApiStatusApiFactory = function(configuration, basePath, axios$7) {
1764
1768
  * @throws {RequiredError}
1765
1769
  */
1766
1770
  check(options) {
1767
- return localVarFp.check(options).then((request) => request(axios$7, basePath));
1771
+ return localVarFp.check(options).then((request) => request(axios$8, basePath));
1768
1772
  } };
1769
1773
  };
1770
1774
  /**
@@ -2178,7 +2182,7 @@ const AuthenticationApiFp = function(configuration) {
2178
2182
  * AuthenticationApi - factory interface
2179
2183
  * @export
2180
2184
  */
2181
- const AuthenticationApiFactory = function(configuration, basePath, axios$6) {
2185
+ const AuthenticationApiFactory = function(configuration, basePath, axios$7) {
2182
2186
  const localVarFp = AuthenticationApiFp(configuration);
2183
2187
  return {
2184
2188
  /**
@@ -2189,7 +2193,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$6) {
2189
2193
  * @throws {RequiredError}
2190
2194
  */
2191
2195
  deleteSnapTradeUser(requestParameters, options) {
2192
- return localVarFp.deleteSnapTradeUser(requestParameters, options).then((request) => request(axios$6, basePath));
2196
+ return localVarFp.deleteSnapTradeUser(requestParameters, options).then((request) => request(axios$7, basePath));
2193
2197
  },
2194
2198
  /**
2195
2199
  * Returns a list of all registered user IDs. Please note that the response is not currently paginated.
@@ -2198,7 +2202,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$6) {
2198
2202
  * @throws {RequiredError}
2199
2203
  */
2200
2204
  listSnapTradeUsers(options) {
2201
- return localVarFp.listSnapTradeUsers(options).then((request) => request(axios$6, basePath));
2205
+ return localVarFp.listSnapTradeUsers(options).then((request) => request(axios$7, basePath));
2202
2206
  },
2203
2207
  /**
2204
2208
  * Authenticates a SnapTrade user and returns the Connection Portal URL used for connecting brokerage accounts. Please check [this guide](/docs/implement-connection-portal) for how to integrate the Connection Portal into your app. Please note that the returned URL expires in 5 minutes.
@@ -2208,7 +2212,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$6) {
2208
2212
  * @throws {RequiredError}
2209
2213
  */
2210
2214
  loginSnapTradeUser(requestParameters, options) {
2211
- return localVarFp.loginSnapTradeUser(requestParameters, options).then((request) => request(axios$6, basePath));
2215
+ return localVarFp.loginSnapTradeUser(requestParameters, options).then((request) => request(axios$7, basePath));
2212
2216
  },
2213
2217
  /**
2214
2218
  * Registers a new SnapTrade user under your Client ID. A user secret will be automatically generated for you and must be properly stored in your system. Most SnapTrade operations require a user ID and user secret to be passed in as parameters.
@@ -2218,7 +2222,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$6) {
2218
2222
  * @throws {RequiredError}
2219
2223
  */
2220
2224
  registerSnapTradeUser(requestParameters, options) {
2221
- return localVarFp.registerSnapTradeUser(requestParameters, options).then((request) => request(axios$6, basePath));
2225
+ return localVarFp.registerSnapTradeUser(requestParameters, options).then((request) => request(axios$7, basePath));
2222
2226
  },
2223
2227
  /**
2224
2228
  * Rotates the secret for a SnapTrade user. You might use this if `userSecret` is compromised. Please note that if you call this endpoint and fail to save the new secret, you\'ll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect.
@@ -2228,7 +2232,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$6) {
2228
2232
  * @throws {RequiredError}
2229
2233
  */
2230
2234
  resetSnapTradeUserSecret(requestParameters, options) {
2231
- return localVarFp.resetSnapTradeUserSecret(requestParameters, options).then((request) => request(axios$6, basePath));
2235
+ return localVarFp.resetSnapTradeUserSecret(requestParameters, options).then((request) => request(axios$7, basePath));
2232
2236
  }
2233
2237
  };
2234
2238
  };
@@ -2624,7 +2628,7 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
2624
2628
  };
2625
2629
  },
2626
2630
  /**
2627
- * Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Pay as you Go / Real-time plans. Pay as you Go / Real-time plans do not benefit from this feature since data is refreshed when calls are made**
2631
+ * Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Personal and Pay as you Go Real-time plans. Real-time plans do not benefit from this feature since data is refreshed when calls are made**
2628
2632
  * @summary Refresh holdings for a connection
2629
2633
  * @param {string} authorizationId
2630
2634
  * @param {string} userId
@@ -3004,7 +3008,7 @@ const ConnectionsApiFp = function(configuration) {
3004
3008
  return createRequestFunction(await localVarAxiosParamCreator.listBrokerageAuthorizations(requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration);
3005
3009
  },
3006
3010
  /**
3007
- * Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Pay as you Go / Real-time plans. Pay as you Go / Real-time plans do not benefit from this feature since data is refreshed when calls are made**
3011
+ * Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Personal and Pay as you Go Real-time plans. Real-time plans do not benefit from this feature since data is refreshed when calls are made**
3008
3012
  * @summary Refresh holdings for a connection
3009
3013
  * @param {ConnectionsApiRefreshBrokerageAuthorizationRequest} requestParameters Request parameters.
3010
3014
  * @param {*} [options] Override http request option.
@@ -3059,7 +3063,7 @@ const ConnectionsApiFp = function(configuration) {
3059
3063
  * ConnectionsApi - factory interface
3060
3064
  * @export
3061
3065
  */
3062
- const ConnectionsApiFactory = function(configuration, basePath, axios$5) {
3066
+ const ConnectionsApiFactory = function(configuration, basePath, axios$6) {
3063
3067
  const localVarFp = ConnectionsApiFp(configuration);
3064
3068
  return {
3065
3069
  /**
@@ -3070,7 +3074,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$5) {
3070
3074
  * @throws {RequiredError}
3071
3075
  */
3072
3076
  deleteConnection(requestParameters, options) {
3073
- return localVarFp.deleteConnection(requestParameters, options).then((request) => request(axios$5, basePath));
3077
+ return localVarFp.deleteConnection(requestParameters, options).then((request) => request(axios$6, basePath));
3074
3078
  },
3075
3079
  /**
3076
3080
  * Returns a single connection for the specified ID.
@@ -3080,7 +3084,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$5) {
3080
3084
  * @throws {RequiredError}
3081
3085
  */
3082
3086
  detailBrokerageAuthorization(requestParameters, options) {
3083
- return localVarFp.detailBrokerageAuthorization(requestParameters, options).then((request) => request(axios$5, basePath));
3087
+ return localVarFp.detailBrokerageAuthorization(requestParameters, options).then((request) => request(axios$6, basePath));
3084
3088
  },
3085
3089
  /**
3086
3090
  * Manually force the specified connection to become disabled. This should only be used for testing a reconnect flow, and never used on production connections. Will trigger a disconnect as if it happened naturally, and send a [`CONNECTION_BROKEN` webhook](/docs/webhooks#webhooks-connection_broken) for the connection. This endpoint is available on test keys. If you would like it enabled on production keys as well, please contact support as it is disabled by default.
@@ -3090,7 +3094,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$5) {
3090
3094
  * @throws {RequiredError}
3091
3095
  */
3092
3096
  disableBrokerageAuthorization(requestParameters, options) {
3093
- return localVarFp.disableBrokerageAuthorization(requestParameters, options).then((request) => request(axios$5, basePath));
3097
+ return localVarFp.disableBrokerageAuthorization(requestParameters, options).then((request) => request(axios$6, basePath));
3094
3098
  },
3095
3099
  /**
3096
3100
  * Returns all brokerage accounts that belong to the specified connection for the authenticated user. On Pay as you Go / Real-time, this endpoint refreshes each account\'s opening date, funding date, and total value live from the brokerage on each call. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
@@ -3100,7 +3104,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$5) {
3100
3104
  * @throws {RequiredError}
3101
3105
  */
3102
3106
  listBrokerageAuthorizationAccounts(requestParameters, options) {
3103
- return localVarFp.listBrokerageAuthorizationAccounts(requestParameters, options).then((request) => request(axios$5, basePath));
3107
+ return localVarFp.listBrokerageAuthorizationAccounts(requestParameters, options).then((request) => request(axios$6, basePath));
3104
3108
  },
3105
3109
  /**
3106
3110
  * Returns a list of all connections for the specified user. Note that `Connection` and `Brokerage Authorization` are interchangeable, but the term `Connection` is preferred and used in the doc for consistency. A connection is usually tied to a single login at a brokerage. A single connection can contain multiple brokerage accounts. SnapTrade performs de-duping on connections for a given user. If the user has an existing connection with the brokerage, when connecting the brokerage with the same credentials, SnapTrade will return the existing connection instead of creating a new one.
@@ -3110,17 +3114,17 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$5) {
3110
3114
  * @throws {RequiredError}
3111
3115
  */
3112
3116
  listBrokerageAuthorizations(requestParameters, options) {
3113
- return localVarFp.listBrokerageAuthorizations(requestParameters, options).then((request) => request(axios$5, basePath));
3117
+ return localVarFp.listBrokerageAuthorizations(requestParameters, options).then((request) => request(axios$6, basePath));
3114
3118
  },
3115
3119
  /**
3116
- * Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Pay as you Go / Real-time plans. Pay as you Go / Real-time plans do not benefit from this feature since data is refreshed when calls are made**
3120
+ * Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Personal and Pay as you Go Real-time plans. Real-time plans do not benefit from this feature since data is refreshed when calls are made**
3117
3121
  * @summary Refresh holdings for a connection
3118
3122
  * @param {ConnectionsApiRefreshBrokerageAuthorizationRequest} requestParameters Request parameters.
3119
3123
  * @param {*} [options] Override http request option.
3120
3124
  * @throws {RequiredError}
3121
3125
  */
3122
3126
  refreshBrokerageAuthorization(requestParameters, options) {
3123
- return localVarFp.refreshBrokerageAuthorization(requestParameters, options).then((request) => request(axios$5, basePath));
3127
+ return localVarFp.refreshBrokerageAuthorization(requestParameters, options).then((request) => request(axios$6, basePath));
3124
3128
  },
3125
3129
  /**
3126
3130
  * Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is synchronous, a 204 response indicates that the data has been successfully deleted.
@@ -3130,7 +3134,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$5) {
3130
3134
  * @throws {RequiredError}
3131
3135
  */
3132
3136
  removeBrokerageAuthorization(requestParameters, options) {
3133
- return localVarFp.removeBrokerageAuthorization(requestParameters, options).then((request) => request(axios$5, basePath));
3137
+ return localVarFp.removeBrokerageAuthorization(requestParameters, options).then((request) => request(axios$6, basePath));
3134
3138
  },
3135
3139
  /**
3136
3140
  * Returns a list of rate of return percents for a given connection.
@@ -3140,7 +3144,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$5) {
3140
3144
  * @throws {RequiredError}
3141
3145
  */
3142
3146
  returnRates(requestParameters, options) {
3143
- return localVarFp.returnRates(requestParameters, options).then((request) => request(axios$5, basePath));
3147
+ return localVarFp.returnRates(requestParameters, options).then((request) => request(axios$6, basePath));
3144
3148
  },
3145
3149
  /**
3146
3150
  * Returns a list of session events associated with a user.
@@ -3150,7 +3154,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$5) {
3150
3154
  * @throws {RequiredError}
3151
3155
  */
3152
3156
  sessionEvents(requestParameters, options) {
3153
- return localVarFp.sessionEvents(requestParameters, options).then((request) => request(axios$5, basePath));
3157
+ return localVarFp.sessionEvents(requestParameters, options).then((request) => request(axios$6, basePath));
3154
3158
  },
3155
3159
  /**
3156
3160
  * Trigger a transactions sync for all accounts under this connection. Updates will be queued asynchronously. Transactions are not updated intra-day, but calling this endpoint can ensure that the previous day\'s transactions have been synced. For more information on sync behaviour, see: https://docs.snaptrade.com/docs/syncing
@@ -3160,7 +3164,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$5) {
3160
3164
  * @throws {RequiredError}
3161
3165
  */
3162
3166
  syncBrokerageAuthorizationTransactions(requestParameters, options) {
3163
- return localVarFp.syncBrokerageAuthorizationTransactions(requestParameters, options).then((request) => request(axios$5, basePath));
3167
+ return localVarFp.syncBrokerageAuthorizationTransactions(requestParameters, options).then((request) => request(axios$6, basePath));
3164
3168
  }
3165
3169
  };
3166
3170
  };
@@ -3227,7 +3231,7 @@ var ConnectionsApiGenerated = class extends BaseAPI {
3227
3231
  return ConnectionsApiFp(this.configuration).listBrokerageAuthorizations(requestParameters, options).then((request) => request(this.axios, this.basePath));
3228
3232
  }
3229
3233
  /**
3230
- * Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Pay as you Go / Real-time plans. Pay as you Go / Real-time plans do not benefit from this feature since data is refreshed when calls are made**
3234
+ * Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Personal and Pay as you Go Real-time plans. Real-time plans do not benefit from this feature since data is refreshed when calls are made**
3231
3235
  * @summary Refresh holdings for a connection
3232
3236
  * @param {ConnectionsApiRefreshBrokerageAuthorizationRequest} requestParameters Request parameters.
3233
3237
  * @param {*} [options] Override http request option.
@@ -3286,6 +3290,614 @@ var ConnectionsApiGenerated = class extends BaseAPI {
3286
3290
  //#region api/connections-api.ts
3287
3291
  var ConnectionsApi = class extends ConnectionsApiGenerated {};
3288
3292
  //#endregion
3293
+ //#region api/experimental-endpoints-api-generated.ts
3294
+ /**
3295
+ * ExperimentalEndpointsApi - axios parameter creator
3296
+ * @export
3297
+ */
3298
+ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
3299
+ return {
3300
+ /**
3301
+ * Adds or restores a Trade Detection subscription for a connected brokerage account. This endpoint requires `userId` and `userSecret` in addition to the partner signature.
3302
+ * @summary Add a Trade Detection subscription
3303
+ * @param {string} userId
3304
+ * @param {string} userSecret
3305
+ * @param {TradeDetectionAddSubscriptionRequest} tradeDetectionAddSubscriptionRequest
3306
+ * @param {*} [options] Override http request option.
3307
+ * @throws {RequiredError}
3308
+ */
3309
+ addSubscription: async (userId, userSecret, tradeDetectionAddSubscriptionRequest, options = {}) => {
3310
+ assertParamExists("addSubscription", "userId", userId);
3311
+ assertParamExists("addSubscription", "userSecret", userSecret);
3312
+ assertParamExists("addSubscription", "tradeDetectionAddSubscriptionRequest", tradeDetectionAddSubscriptionRequest);
3313
+ const localVarPath = `/snapTrade/tradeDetection/subscriptions`;
3314
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3315
+ let baseOptions;
3316
+ if (configuration) baseOptions = configuration.baseOptions;
3317
+ const localVarRequestOptions = {
3318
+ method: "POST",
3319
+ ...baseOptions,
3320
+ ...options
3321
+ };
3322
+ const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
3323
+ const localVarQueryParameter = {};
3324
+ await setApiKeyToObject({
3325
+ object: localVarQueryParameter,
3326
+ key: "clientId",
3327
+ keyParamName: "clientId",
3328
+ configuration
3329
+ });
3330
+ await setApiKeyToObject({
3331
+ object: localVarHeaderParameter,
3332
+ key: "Signature",
3333
+ keyParamName: "signature",
3334
+ configuration
3335
+ });
3336
+ await setApiKeyToObject({
3337
+ object: localVarQueryParameter,
3338
+ key: "timestamp",
3339
+ keyParamName: "timestamp",
3340
+ configuration
3341
+ });
3342
+ if (userId !== void 0) localVarQueryParameter["userId"] = userId;
3343
+ if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
3344
+ localVarHeaderParameter["Content-Type"] = "application/json";
3345
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3346
+ localVarRequestOptions.headers = {
3347
+ ...localVarHeaderParameter,
3348
+ ...headersFromBaseOptions,
3349
+ ...options.headers
3350
+ };
3351
+ requestBeforeHook({
3352
+ requestBody: tradeDetectionAddSubscriptionRequest,
3353
+ queryParameters: localVarQueryParameter,
3354
+ requestConfig: localVarRequestOptions,
3355
+ path: localVarPath,
3356
+ configuration,
3357
+ pathTemplate: "/snapTrade/tradeDetection/subscriptions",
3358
+ httpMethod: "POST"
3359
+ });
3360
+ localVarRequestOptions.data = serializeDataIfNeeded(tradeDetectionAddSubscriptionRequest, localVarRequestOptions, configuration);
3361
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3362
+ return {
3363
+ url: toPathString(localVarUrlObj),
3364
+ options: localVarRequestOptions
3365
+ };
3366
+ },
3367
+ /**
3368
+ * Cancels a Trade Detection subscription for a connected brokerage account. This endpoint requires partner signature authentication only and does not require `userId` or `userSecret`.
3369
+ * @summary Cancel a Trade Detection subscription
3370
+ * @param {TradeDetectionAddSubscriptionRequest} tradeDetectionAddSubscriptionRequest
3371
+ * @param {*} [options] Override http request option.
3372
+ * @throws {RequiredError}
3373
+ */
3374
+ cancelSubscription: async (tradeDetectionAddSubscriptionRequest, options = {}) => {
3375
+ assertParamExists("cancelSubscription", "tradeDetectionAddSubscriptionRequest", tradeDetectionAddSubscriptionRequest);
3376
+ const localVarPath = `/snapTrade/tradeDetection/subscriptions/cancel`;
3377
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3378
+ let baseOptions;
3379
+ if (configuration) baseOptions = configuration.baseOptions;
3380
+ const localVarRequestOptions = {
3381
+ method: "POST",
3382
+ ...baseOptions,
3383
+ ...options
3384
+ };
3385
+ const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
3386
+ const localVarQueryParameter = {};
3387
+ await setApiKeyToObject({
3388
+ object: localVarQueryParameter,
3389
+ key: "clientId",
3390
+ keyParamName: "clientId",
3391
+ configuration
3392
+ });
3393
+ await setApiKeyToObject({
3394
+ object: localVarHeaderParameter,
3395
+ key: "Signature",
3396
+ keyParamName: "signature",
3397
+ configuration
3398
+ });
3399
+ await setApiKeyToObject({
3400
+ object: localVarQueryParameter,
3401
+ key: "timestamp",
3402
+ keyParamName: "timestamp",
3403
+ configuration
3404
+ });
3405
+ localVarHeaderParameter["Content-Type"] = "application/json";
3406
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3407
+ localVarRequestOptions.headers = {
3408
+ ...localVarHeaderParameter,
3409
+ ...headersFromBaseOptions,
3410
+ ...options.headers
3411
+ };
3412
+ requestBeforeHook({
3413
+ requestBody: tradeDetectionAddSubscriptionRequest,
3414
+ queryParameters: localVarQueryParameter,
3415
+ requestConfig: localVarRequestOptions,
3416
+ path: localVarPath,
3417
+ configuration,
3418
+ pathTemplate: "/snapTrade/tradeDetection/subscriptions/cancel",
3419
+ httpMethod: "POST"
3420
+ });
3421
+ localVarRequestOptions.data = serializeDataIfNeeded(tradeDetectionAddSubscriptionRequest, localVarRequestOptions, configuration);
3422
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3423
+ return {
3424
+ url: toPathString(localVarUrlObj),
3425
+ options: localVarRequestOptions
3426
+ };
3427
+ },
3428
+ /**
3429
+ * 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.
3430
+ * @summary Get account order detail (V2)
3431
+ * @param {string} accountId
3432
+ * @param {string} brokerageOrderId
3433
+ * @param {string} userId
3434
+ * @param {string} userSecret
3435
+ * @param {*} [options] Override http request option.
3436
+ * @throws {RequiredError}
3437
+ */
3438
+ getUserAccountOrderDetailV2: async (accountId, brokerageOrderId, userId, userSecret, options = {}) => {
3439
+ assertParamExists("getUserAccountOrderDetailV2", "accountId", accountId);
3440
+ assertParamExists("getUserAccountOrderDetailV2", "brokerageOrderId", brokerageOrderId);
3441
+ assertParamExists("getUserAccountOrderDetailV2", "userId", userId);
3442
+ assertParamExists("getUserAccountOrderDetailV2", "userSecret", userSecret);
3443
+ const localVarPath = `/accounts/{accountId}/orders/details/v2/{brokerageOrderId}`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`))).replace(`{brokerageOrderId}`, encodeURIComponent(String(brokerageOrderId !== void 0 ? brokerageOrderId : `-brokerageOrderId-`)));
3444
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3445
+ let baseOptions;
3446
+ if (configuration) baseOptions = configuration.baseOptions;
3447
+ const localVarRequestOptions = {
3448
+ method: "GET",
3449
+ ...baseOptions,
3450
+ ...options
3451
+ };
3452
+ const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
3453
+ const localVarQueryParameter = {};
3454
+ await setApiKeyToObject({
3455
+ object: localVarQueryParameter,
3456
+ key: "clientId",
3457
+ keyParamName: "clientId",
3458
+ configuration
3459
+ });
3460
+ await setApiKeyToObject({
3461
+ object: localVarHeaderParameter,
3462
+ key: "Signature",
3463
+ keyParamName: "signature",
3464
+ configuration
3465
+ });
3466
+ await setApiKeyToObject({
3467
+ object: localVarQueryParameter,
3468
+ key: "timestamp",
3469
+ keyParamName: "timestamp",
3470
+ configuration
3471
+ });
3472
+ if (userId !== void 0) localVarQueryParameter["userId"] = userId;
3473
+ if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
3474
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3475
+ localVarRequestOptions.headers = {
3476
+ ...localVarHeaderParameter,
3477
+ ...headersFromBaseOptions,
3478
+ ...options.headers
3479
+ };
3480
+ requestBeforeHook({
3481
+ queryParameters: localVarQueryParameter,
3482
+ requestConfig: localVarRequestOptions,
3483
+ path: localVarPath,
3484
+ configuration,
3485
+ pathTemplate: "/accounts/{accountId}/orders/details/v2/{brokerageOrderId}",
3486
+ httpMethod: "GET"
3487
+ });
3488
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3489
+ return {
3490
+ url: toPathString(localVarUrlObj),
3491
+ options: localVarRequestOptions
3492
+ };
3493
+ },
3494
+ /**
3495
+ * Returns a list of recent orders in the specified account. The V2 order response format will include all legs of each order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. 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.
3496
+ * @summary List account orders v2
3497
+ * @param {string} userId
3498
+ * @param {string} userSecret
3499
+ * @param {string} accountId
3500
+ * @param {'all' | 'open' | 'executed'} [state] defaults to \"all\"
3501
+ * @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.
3502
+ * @param {*} [options] Override http request option.
3503
+ * @throws {RequiredError}
3504
+ */
3505
+ getUserAccountOrdersV2: async (userId, userSecret, accountId, state, days, options = {}) => {
3506
+ assertParamExists("getUserAccountOrdersV2", "userId", userId);
3507
+ assertParamExists("getUserAccountOrdersV2", "userSecret", userSecret);
3508
+ assertParamExists("getUserAccountOrdersV2", "accountId", accountId);
3509
+ const localVarPath = `/accounts/{accountId}/orders/v2`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
3510
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3511
+ let baseOptions;
3512
+ if (configuration) baseOptions = configuration.baseOptions;
3513
+ const localVarRequestOptions = {
3514
+ method: "GET",
3515
+ ...baseOptions,
3516
+ ...options
3517
+ };
3518
+ const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
3519
+ const localVarQueryParameter = {};
3520
+ await setApiKeyToObject({
3521
+ object: localVarQueryParameter,
3522
+ key: "clientId",
3523
+ keyParamName: "clientId",
3524
+ configuration
3525
+ });
3526
+ await setApiKeyToObject({
3527
+ object: localVarHeaderParameter,
3528
+ key: "Signature",
3529
+ keyParamName: "signature",
3530
+ configuration
3531
+ });
3532
+ await setApiKeyToObject({
3533
+ object: localVarQueryParameter,
3534
+ key: "timestamp",
3535
+ keyParamName: "timestamp",
3536
+ configuration
3537
+ });
3538
+ if (userId !== void 0) localVarQueryParameter["userId"] = userId;
3539
+ if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
3540
+ if (state !== void 0) localVarQueryParameter["state"] = state;
3541
+ if (days !== void 0) localVarQueryParameter["days"] = days;
3542
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3543
+ localVarRequestOptions.headers = {
3544
+ ...localVarHeaderParameter,
3545
+ ...headersFromBaseOptions,
3546
+ ...options.headers
3547
+ };
3548
+ requestBeforeHook({
3549
+ queryParameters: localVarQueryParameter,
3550
+ requestConfig: localVarRequestOptions,
3551
+ path: localVarPath,
3552
+ configuration,
3553
+ pathTemplate: "/accounts/{accountId}/orders/v2",
3554
+ httpMethod: "GET"
3555
+ });
3556
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3557
+ return {
3558
+ url: toPathString(localVarUrlObj),
3559
+ options: localVarRequestOptions
3560
+ };
3561
+ },
3562
+ /**
3563
+ * A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account using the V2 order format. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from /orders in that it is realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
3564
+ * @summary List account recent orders (V2, last 24 hours only)
3565
+ * @param {string} userId
3566
+ * @param {string} userSecret
3567
+ * @param {string} accountId
3568
+ * @param {boolean} [onlyExecuted] Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well
3569
+ * @param {*} [options] Override http request option.
3570
+ * @throws {RequiredError}
3571
+ */
3572
+ getUserAccountRecentOrdersV2: async (userId, userSecret, accountId, onlyExecuted, options = {}) => {
3573
+ assertParamExists("getUserAccountRecentOrdersV2", "userId", userId);
3574
+ assertParamExists("getUserAccountRecentOrdersV2", "userSecret", userSecret);
3575
+ assertParamExists("getUserAccountRecentOrdersV2", "accountId", accountId);
3576
+ const localVarPath = `/accounts/{accountId}/recentOrders/v2`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
3577
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3578
+ let baseOptions;
3579
+ if (configuration) baseOptions = configuration.baseOptions;
3580
+ const localVarRequestOptions = {
3581
+ method: "GET",
3582
+ ...baseOptions,
3583
+ ...options
3584
+ };
3585
+ const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
3586
+ const localVarQueryParameter = {};
3587
+ await setApiKeyToObject({
3588
+ object: localVarQueryParameter,
3589
+ key: "clientId",
3590
+ keyParamName: "clientId",
3591
+ configuration
3592
+ });
3593
+ await setApiKeyToObject({
3594
+ object: localVarHeaderParameter,
3595
+ key: "Signature",
3596
+ keyParamName: "signature",
3597
+ configuration
3598
+ });
3599
+ await setApiKeyToObject({
3600
+ object: localVarQueryParameter,
3601
+ key: "timestamp",
3602
+ keyParamName: "timestamp",
3603
+ configuration
3604
+ });
3605
+ if (userId !== void 0) localVarQueryParameter["userId"] = userId;
3606
+ if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
3607
+ if (onlyExecuted !== void 0) localVarQueryParameter["only_executed"] = onlyExecuted;
3608
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3609
+ localVarRequestOptions.headers = {
3610
+ ...localVarHeaderParameter,
3611
+ ...headersFromBaseOptions,
3612
+ ...options.headers
3613
+ };
3614
+ requestBeforeHook({
3615
+ queryParameters: localVarQueryParameter,
3616
+ requestConfig: localVarRequestOptions,
3617
+ path: localVarPath,
3618
+ configuration,
3619
+ pathTemplate: "/accounts/{accountId}/recentOrders/v2",
3620
+ httpMethod: "GET"
3621
+ });
3622
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3623
+ return {
3624
+ url: toPathString(localVarUrlObj),
3625
+ options: localVarRequestOptions
3626
+ };
3627
+ },
3628
+ /**
3629
+ * Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
3630
+ * @summary List active Trade Detection subscriptions
3631
+ * @param {*} [options] Override http request option.
3632
+ * @throws {RequiredError}
3633
+ */
3634
+ listSubscriptions: async (options = {}) => {
3635
+ const localVarPath = `/snapTrade/tradeDetection/subscriptions`;
3636
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3637
+ let baseOptions;
3638
+ if (configuration) baseOptions = configuration.baseOptions;
3639
+ const localVarRequestOptions = {
3640
+ method: "GET",
3641
+ ...baseOptions,
3642
+ ...options
3643
+ };
3644
+ const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
3645
+ const localVarQueryParameter = {};
3646
+ await setApiKeyToObject({
3647
+ object: localVarQueryParameter,
3648
+ key: "clientId",
3649
+ keyParamName: "clientId",
3650
+ configuration
3651
+ });
3652
+ await setApiKeyToObject({
3653
+ object: localVarHeaderParameter,
3654
+ key: "Signature",
3655
+ keyParamName: "signature",
3656
+ configuration
3657
+ });
3658
+ await setApiKeyToObject({
3659
+ object: localVarQueryParameter,
3660
+ key: "timestamp",
3661
+ keyParamName: "timestamp",
3662
+ configuration
3663
+ });
3664
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3665
+ localVarRequestOptions.headers = {
3666
+ ...localVarHeaderParameter,
3667
+ ...headersFromBaseOptions,
3668
+ ...options.headers
3669
+ };
3670
+ requestBeforeHook({
3671
+ queryParameters: localVarQueryParameter,
3672
+ requestConfig: localVarRequestOptions,
3673
+ path: localVarPath,
3674
+ configuration,
3675
+ pathTemplate: "/snapTrade/tradeDetection/subscriptions",
3676
+ httpMethod: "GET"
3677
+ });
3678
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3679
+ return {
3680
+ url: toPathString(localVarUrlObj),
3681
+ options: localVarRequestOptions
3682
+ };
3683
+ }
3684
+ };
3685
+ };
3686
+ /**
3687
+ * ExperimentalEndpointsApi - functional programming interface
3688
+ * @export
3689
+ */
3690
+ const ExperimentalEndpointsApiFp = function(configuration) {
3691
+ const localVarAxiosParamCreator = ExperimentalEndpointsApiAxiosParamCreator(configuration);
3692
+ return {
3693
+ /**
3694
+ * Adds or restores a Trade Detection subscription for a connected brokerage account. This endpoint requires `userId` and `userSecret` in addition to the partner signature.
3695
+ * @summary Add a Trade Detection subscription
3696
+ * @param {ExperimentalEndpointsApiAddSubscriptionRequest} requestParameters Request parameters.
3697
+ * @param {*} [options] Override http request option.
3698
+ * @throws {RequiredError}
3699
+ */
3700
+ async addSubscription(requestParameters, options) {
3701
+ const tradeDetectionAddSubscriptionRequest = { account_id: requestParameters.account_id };
3702
+ return createRequestFunction(await localVarAxiosParamCreator.addSubscription(requestParameters.userId, requestParameters.userSecret, tradeDetectionAddSubscriptionRequest, options), axios.default, BASE_PATH, configuration);
3703
+ },
3704
+ /**
3705
+ * Cancels a Trade Detection subscription for a connected brokerage account. This endpoint requires partner signature authentication only and does not require `userId` or `userSecret`.
3706
+ * @summary Cancel a Trade Detection subscription
3707
+ * @param {ExperimentalEndpointsApiCancelSubscriptionRequest} requestParameters Request parameters.
3708
+ * @param {*} [options] Override http request option.
3709
+ * @throws {RequiredError}
3710
+ */
3711
+ async cancelSubscription(requestParameters, options) {
3712
+ const tradeDetectionAddSubscriptionRequest = { account_id: requestParameters.account_id };
3713
+ return createRequestFunction(await localVarAxiosParamCreator.cancelSubscription(tradeDetectionAddSubscriptionRequest, options), axios.default, BASE_PATH, configuration);
3714
+ },
3715
+ /**
3716
+ * 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.
3717
+ * @summary Get account order detail (V2)
3718
+ * @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request} requestParameters Request parameters.
3719
+ * @param {*} [options] Override http request option.
3720
+ * @throws {RequiredError}
3721
+ */
3722
+ async getUserAccountOrderDetailV2(requestParameters, options) {
3723
+ return createRequestFunction(await localVarAxiosParamCreator.getUserAccountOrderDetailV2(requestParameters.accountId, requestParameters.brokerageOrderId, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration);
3724
+ },
3725
+ /**
3726
+ * Returns a list of recent orders in the specified account. The V2 order response format will include all legs of each order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. 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.
3727
+ * @summary List account orders v2
3728
+ * @param {ExperimentalEndpointsApiGetUserAccountOrdersV2Request} requestParameters Request parameters.
3729
+ * @param {*} [options] Override http request option.
3730
+ * @throws {RequiredError}
3731
+ */
3732
+ async getUserAccountOrdersV2(requestParameters, options) {
3733
+ return createRequestFunction(await localVarAxiosParamCreator.getUserAccountOrdersV2(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.state, requestParameters.days, options), axios.default, BASE_PATH, configuration);
3734
+ },
3735
+ /**
3736
+ * A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account using the V2 order format. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from /orders in that it is realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
3737
+ * @summary List account recent orders (V2, last 24 hours only)
3738
+ * @param {ExperimentalEndpointsApiGetUserAccountRecentOrdersV2Request} requestParameters Request parameters.
3739
+ * @param {*} [options] Override http request option.
3740
+ * @throws {RequiredError}
3741
+ */
3742
+ async getUserAccountRecentOrdersV2(requestParameters, options) {
3743
+ return createRequestFunction(await localVarAxiosParamCreator.getUserAccountRecentOrdersV2(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.onlyExecuted, options), axios.default, BASE_PATH, configuration);
3744
+ },
3745
+ /**
3746
+ * Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
3747
+ * @summary List active Trade Detection subscriptions
3748
+ * @param {*} [options] Override http request option.
3749
+ * @throws {RequiredError}
3750
+ */
3751
+ async listSubscriptions(options) {
3752
+ return createRequestFunction(await localVarAxiosParamCreator.listSubscriptions(options), axios.default, BASE_PATH, configuration);
3753
+ }
3754
+ };
3755
+ };
3756
+ /**
3757
+ * ExperimentalEndpointsApi - factory interface
3758
+ * @export
3759
+ */
3760
+ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$5) {
3761
+ const localVarFp = ExperimentalEndpointsApiFp(configuration);
3762
+ return {
3763
+ /**
3764
+ * Adds or restores a Trade Detection subscription for a connected brokerage account. This endpoint requires `userId` and `userSecret` in addition to the partner signature.
3765
+ * @summary Add a Trade Detection subscription
3766
+ * @param {ExperimentalEndpointsApiAddSubscriptionRequest} requestParameters Request parameters.
3767
+ * @param {*} [options] Override http request option.
3768
+ * @throws {RequiredError}
3769
+ */
3770
+ addSubscription(requestParameters, options) {
3771
+ return localVarFp.addSubscription(requestParameters, options).then((request) => request(axios$5, basePath));
3772
+ },
3773
+ /**
3774
+ * Cancels a Trade Detection subscription for a connected brokerage account. This endpoint requires partner signature authentication only and does not require `userId` or `userSecret`.
3775
+ * @summary Cancel a Trade Detection subscription
3776
+ * @param {ExperimentalEndpointsApiCancelSubscriptionRequest} requestParameters Request parameters.
3777
+ * @param {*} [options] Override http request option.
3778
+ * @throws {RequiredError}
3779
+ */
3780
+ cancelSubscription(requestParameters, options) {
3781
+ return localVarFp.cancelSubscription(requestParameters, options).then((request) => request(axios$5, basePath));
3782
+ },
3783
+ /**
3784
+ * 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.
3785
+ * @summary Get account order detail (V2)
3786
+ * @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request} requestParameters Request parameters.
3787
+ * @param {*} [options] Override http request option.
3788
+ * @throws {RequiredError}
3789
+ */
3790
+ getUserAccountOrderDetailV2(requestParameters, options) {
3791
+ return localVarFp.getUserAccountOrderDetailV2(requestParameters, options).then((request) => request(axios$5, basePath));
3792
+ },
3793
+ /**
3794
+ * Returns a list of recent orders in the specified account. The V2 order response format will include all legs of each order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. 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.
3795
+ * @summary List account orders v2
3796
+ * @param {ExperimentalEndpointsApiGetUserAccountOrdersV2Request} requestParameters Request parameters.
3797
+ * @param {*} [options] Override http request option.
3798
+ * @throws {RequiredError}
3799
+ */
3800
+ getUserAccountOrdersV2(requestParameters, options) {
3801
+ return localVarFp.getUserAccountOrdersV2(requestParameters, options).then((request) => request(axios$5, basePath));
3802
+ },
3803
+ /**
3804
+ * A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account using the V2 order format. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from /orders in that it is realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
3805
+ * @summary List account recent orders (V2, last 24 hours only)
3806
+ * @param {ExperimentalEndpointsApiGetUserAccountRecentOrdersV2Request} requestParameters Request parameters.
3807
+ * @param {*} [options] Override http request option.
3808
+ * @throws {RequiredError}
3809
+ */
3810
+ getUserAccountRecentOrdersV2(requestParameters, options) {
3811
+ return localVarFp.getUserAccountRecentOrdersV2(requestParameters, options).then((request) => request(axios$5, basePath));
3812
+ },
3813
+ /**
3814
+ * Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
3815
+ * @summary List active Trade Detection subscriptions
3816
+ * @param {*} [options] Override http request option.
3817
+ * @throws {RequiredError}
3818
+ */
3819
+ listSubscriptions(options) {
3820
+ return localVarFp.listSubscriptions(options).then((request) => request(axios$5, basePath));
3821
+ }
3822
+ };
3823
+ };
3824
+ /**
3825
+ * ExperimentalEndpointsApiGenerated - object-oriented interface
3826
+ * @export
3827
+ * @class ExperimentalEndpointsApiGenerated
3828
+ * @extends {BaseAPI}
3829
+ */
3830
+ var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
3831
+ /**
3832
+ * Adds or restores a Trade Detection subscription for a connected brokerage account. This endpoint requires `userId` and `userSecret` in addition to the partner signature.
3833
+ * @summary Add a Trade Detection subscription
3834
+ * @param {ExperimentalEndpointsApiAddSubscriptionRequest} requestParameters Request parameters.
3835
+ * @param {*} [options] Override http request option.
3836
+ * @throws {RequiredError}
3837
+ * @memberof ExperimentalEndpointsApiGenerated
3838
+ */
3839
+ addSubscription(requestParameters, options) {
3840
+ return ExperimentalEndpointsApiFp(this.configuration).addSubscription(requestParameters, options).then((request) => request(this.axios, this.basePath));
3841
+ }
3842
+ /**
3843
+ * Cancels a Trade Detection subscription for a connected brokerage account. This endpoint requires partner signature authentication only and does not require `userId` or `userSecret`.
3844
+ * @summary Cancel a Trade Detection subscription
3845
+ * @param {ExperimentalEndpointsApiCancelSubscriptionRequest} requestParameters Request parameters.
3846
+ * @param {*} [options] Override http request option.
3847
+ * @throws {RequiredError}
3848
+ * @memberof ExperimentalEndpointsApiGenerated
3849
+ */
3850
+ cancelSubscription(requestParameters, options) {
3851
+ return ExperimentalEndpointsApiFp(this.configuration).cancelSubscription(requestParameters, options).then((request) => request(this.axios, this.basePath));
3852
+ }
3853
+ /**
3854
+ * 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.
3855
+ * @summary Get account order detail (V2)
3856
+ * @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request} requestParameters Request parameters.
3857
+ * @param {*} [options] Override http request option.
3858
+ * @throws {RequiredError}
3859
+ * @memberof ExperimentalEndpointsApiGenerated
3860
+ */
3861
+ getUserAccountOrderDetailV2(requestParameters, options) {
3862
+ return ExperimentalEndpointsApiFp(this.configuration).getUserAccountOrderDetailV2(requestParameters, options).then((request) => request(this.axios, this.basePath));
3863
+ }
3864
+ /**
3865
+ * Returns a list of recent orders in the specified account. The V2 order response format will include all legs of each order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. 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.
3866
+ * @summary List account orders v2
3867
+ * @param {ExperimentalEndpointsApiGetUserAccountOrdersV2Request} requestParameters Request parameters.
3868
+ * @param {*} [options] Override http request option.
3869
+ * @throws {RequiredError}
3870
+ * @memberof ExperimentalEndpointsApiGenerated
3871
+ */
3872
+ getUserAccountOrdersV2(requestParameters, options) {
3873
+ return ExperimentalEndpointsApiFp(this.configuration).getUserAccountOrdersV2(requestParameters, options).then((request) => request(this.axios, this.basePath));
3874
+ }
3875
+ /**
3876
+ * A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account using the V2 order format. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from /orders in that it is realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
3877
+ * @summary List account recent orders (V2, last 24 hours only)
3878
+ * @param {ExperimentalEndpointsApiGetUserAccountRecentOrdersV2Request} requestParameters Request parameters.
3879
+ * @param {*} [options] Override http request option.
3880
+ * @throws {RequiredError}
3881
+ * @memberof ExperimentalEndpointsApiGenerated
3882
+ */
3883
+ getUserAccountRecentOrdersV2(requestParameters, options) {
3884
+ return ExperimentalEndpointsApiFp(this.configuration).getUserAccountRecentOrdersV2(requestParameters, options).then((request) => request(this.axios, this.basePath));
3885
+ }
3886
+ /**
3887
+ * Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
3888
+ * @summary List active Trade Detection subscriptions
3889
+ * @param {*} [options] Override http request option.
3890
+ * @throws {RequiredError}
3891
+ * @memberof ExperimentalEndpointsApiGenerated
3892
+ */
3893
+ listSubscriptions(options) {
3894
+ return ExperimentalEndpointsApiFp(this.configuration).listSubscriptions(options).then((request) => request(this.axios, this.basePath));
3895
+ }
3896
+ };
3897
+ //#endregion
3898
+ //#region api/experimental-endpoints-api.ts
3899
+ var ExperimentalEndpointsApi = class extends ExperimentalEndpointsApiGenerated {};
3900
+ //#endregion
3289
3901
  //#region api/options-api-generated.ts
3290
3902
  /**
3291
3903
  * OptionsApi - axios parameter creator
@@ -3294,12 +3906,13 @@ var ConnectionsApi = class extends ConnectionsApiGenerated {};
3294
3906
  const OptionsApiAxiosParamCreator = function(configuration) {
3295
3907
  return {
3296
3908
  /**
3297
- * Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
3909
+ * Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). This endpoint is deprecatd. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
3298
3910
  * @summary List account option positions
3299
3911
  * @param {string} userId
3300
3912
  * @param {string} userSecret
3301
3913
  * @param {string} accountId
3302
3914
  * @param {*} [options] Override http request option.
3915
+ * @deprecated
3303
3916
  * @throws {RequiredError}
3304
3917
  */
3305
3918
  listOptionHoldings: async (userId, userSecret, accountId, options = {}) => {
@@ -3366,10 +3979,11 @@ const OptionsApiFp = function(configuration) {
3366
3979
  const localVarAxiosParamCreator = OptionsApiAxiosParamCreator(configuration);
3367
3980
  return {
3368
3981
  /**
3369
- * Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
3982
+ * Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). This endpoint is deprecatd. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
3370
3983
  * @summary List account option positions
3371
3984
  * @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
3372
3985
  * @param {*} [options] Override http request option.
3986
+ * @deprecated
3373
3987
  * @throws {RequiredError}
3374
3988
  */
3375
3989
  async listOptionHoldings(requestParameters, options) {
@@ -3384,10 +3998,11 @@ const OptionsApiFactory = function(configuration, basePath, axios$4) {
3384
3998
  const localVarFp = OptionsApiFp(configuration);
3385
3999
  return {
3386
4000
  /**
3387
- * Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
4001
+ * Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). This endpoint is deprecatd. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
3388
4002
  * @summary List account option positions
3389
4003
  * @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
3390
4004
  * @param {*} [options] Override http request option.
4005
+ * @deprecated
3391
4006
  * @throws {RequiredError}
3392
4007
  */
3393
4008
  listOptionHoldings(requestParameters, options) {
@@ -3402,10 +4017,11 @@ listOptionHoldings(requestParameters, options) {
3402
4017
  */
3403
4018
  var OptionsApiGenerated = class extends BaseAPI {
3404
4019
  /**
3405
- * Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
4020
+ * Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). This endpoint is deprecatd. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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 brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
3406
4021
  * @summary List account option positions
3407
4022
  * @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
3408
4023
  * @param {*} [options] Override http request option.
4024
+ * @deprecated
3409
4025
  * @throws {RequiredError}
3410
4026
  * @memberof OptionsApiGenerated
3411
4027
  */
@@ -6506,7 +7122,7 @@ var Configuration = class {
6506
7122
  this.accessToken = param.accessToken;
6507
7123
  this.basePath = param.basePath;
6508
7124
  this.baseOptions = param.baseOptions ?? {};
6509
- this.userAgent = param.userAgent === void 0 ? "Konfig/10.0.1/typescript" : param.userAgent;
7125
+ this.userAgent = param.userAgent === void 0 ? "Konfig/10.0.3/typescript" : param.userAgent;
6510
7126
  this.formDataCtor = param.formDataCtor;
6511
7127
  }
6512
7128
  /**
@@ -6538,6 +7154,7 @@ var Snaptrade = class extends SnaptradeCustom {
6538
7154
  this.apiStatus = new ApiStatusApi(configuration);
6539
7155
  this.authentication = new AuthenticationApi(configuration);
6540
7156
  this.connections = new ConnectionsApi(configuration);
7157
+ this.experimentalEndpoints = new ExperimentalEndpointsApi(configuration);
6541
7158
  this.options = new OptionsApi(configuration);
6542
7159
  this.referenceData = new ReferenceDataApi(configuration);
6543
7160
  this.trading = new TradingApi(configuration);
@@ -6566,6 +7183,11 @@ exports.ConnectionsApiAxiosParamCreator = ConnectionsApiAxiosParamCreator;
6566
7183
  exports.ConnectionsApiFactory = ConnectionsApiFactory;
6567
7184
  exports.ConnectionsApiFp = ConnectionsApiFp;
6568
7185
  exports.ConnectionsApiGenerated = ConnectionsApiGenerated;
7186
+ exports.ExperimentalEndpointsApi = ExperimentalEndpointsApi;
7187
+ exports.ExperimentalEndpointsApiAxiosParamCreator = ExperimentalEndpointsApiAxiosParamCreator;
7188
+ exports.ExperimentalEndpointsApiFactory = ExperimentalEndpointsApiFactory;
7189
+ exports.ExperimentalEndpointsApiFp = ExperimentalEndpointsApiFp;
7190
+ exports.ExperimentalEndpointsApiGenerated = ExperimentalEndpointsApiGenerated;
6569
7191
  exports.OptionsApi = OptionsApi;
6570
7192
  exports.OptionsApiAxiosParamCreator = OptionsApiAxiosParamCreator;
6571
7193
  exports.OptionsApiFactory = OptionsApiFactory;
@@ -6590,5 +7212,3 @@ exports.TransactionsAndReportingApiFp = TransactionsAndReportingApiFp;
6590
7212
  exports.TransactionsAndReportingApiGenerated = TransactionsAndReportingApiGenerated;
6591
7213
  exports.parseIfJson = parseIfJson;
6592
7214
  exports.readableStreamToString = readableStreamToString;
6593
-
6594
- //# sourceMappingURL=index.cjs.map