snaptrade-typescript-sdk 11.1.0 → 12.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,4 +1,3 @@
1
- import { n as __require } from "./chunk-e9Ob2GDo.mjs";
2
1
  import globalAxios, { AxiosError } from "axios";
3
2
  //#region base.ts
4
3
  const BASE_PATH = "https://api.snaptrade.com".replace(/\/+$/, "");
@@ -32,15 +31,15 @@ var RequiredError = class extends Error {
32
31
  };
33
32
  //#endregion
34
33
  //#region requestAfterHook.ts
35
- function isNodeEnvironment() {
36
- return typeof process !== "undefined" && process.versions && process.versions.node;
34
+ function bytesToBase64(bytes) {
35
+ let binary = "";
36
+ for (const byte of bytes) binary += String.fromCharCode(byte);
37
+ if (typeof globalThis.btoa === "function") return globalThis.btoa(binary);
38
+ if (typeof Buffer !== "undefined") return Buffer.from(bytes).toString("base64");
39
+ throw Error("Base64 encoding is not available in this runtime");
37
40
  }
38
41
  async function computeHmacSha256(message, key) {
39
- if (isNodeEnvironment()) {
40
- const hmac = __require("crypto").createHmac("sha256", key);
41
- hmac.update(message);
42
- return hmac.digest("base64");
43
- }
42
+ if (!globalThis.crypto?.subtle) throw Error("Web Crypto API is required to compute SnapTrade request signatures");
44
43
  const encoder = new TextEncoder();
45
44
  const keyBuffer = encoder.encode(key);
46
45
  const msgBuffer = encoder.encode(message);
@@ -49,8 +48,7 @@ async function computeHmacSha256(message, key) {
49
48
  hash: "SHA-256"
50
49
  }, false, ["sign"]);
51
50
  const signature = await globalThis.crypto.subtle.sign("HMAC", cryptoKey, msgBuffer);
52
- const byteArray = Array.from(new Uint8Array(signature));
53
- return btoa(String.fromCharCode.apply(null, byteArray));
51
+ return bytesToBase64(new Uint8Array(signature));
54
52
  }
55
53
  const JSONstringifyOrder = (obj) => {
56
54
  var allKeys = [];
@@ -508,80 +506,6 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
508
506
  };
509
507
  },
510
508
  /**
511
- * **Deprecated.** Use the account-specific holdings endpoint instead. This endpoint will return HTTP 410 Gone for all customers that sign up after April 25, 2026. List all accounts for the user, plus balances, positions, and orders for each account.
512
- * @summary List all accounts for the user, plus balances, positions, and orders for each account.
513
- * @param {string} [brokerageAuthorizations] Optional. Comma separated list of authorization IDs (only use if filtering is needed on one or more authorizations).
514
- * @param {string} [userId]
515
- * @param {string} [userSecret]
516
- * @param {*} [options] Override http request option.
517
- * @deprecated
518
- * @throws {RequiredError}
519
- */
520
- getAllUserHoldings: async (brokerageAuthorizations, userId, userSecret, options = {}) => {
521
- const localVarPath = `/holdings`;
522
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
523
- let baseOptions;
524
- if (configuration) baseOptions = configuration.baseOptions;
525
- const localVarRequestOptions = {
526
- method: "GET",
527
- ...baseOptions,
528
- ...options
529
- };
530
- const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
531
- const localVarQueryParameter = {};
532
- if (configuration?.authMode === "commercialApiKey") {
533
- await setApiKeyToObject({
534
- object: localVarQueryParameter,
535
- key: "clientId",
536
- keyParamName: "clientId",
537
- configuration
538
- });
539
- if (userId !== void 0) localVarQueryParameter["userId"] = userId;
540
- if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
541
- }
542
- if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
543
- object: localVarQueryParameter,
544
- key: "clientId",
545
- keyParamName: "clientId",
546
- configuration
547
- });
548
- if (brokerageAuthorizations !== void 0) localVarQueryParameter["brokerage_authorizations"] = brokerageAuthorizations;
549
- const localVarOperationAuth = {
550
- authModes: ["commercialApiKey", "personalApiKey"],
551
- requestSigningByAuthMode: {
552
- "commercialApiKey": {
553
- secretParameter: "consumerKey",
554
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
555
- },
556
- "personalApiKey": {
557
- secretParameter: "consumerKey",
558
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
559
- }
560
- },
561
- selectedAuthMode: configuration?.authMode
562
- };
563
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
564
- localVarRequestOptions.headers = {
565
- ...localVarHeaderParameter,
566
- ...headersFromBaseOptions,
567
- ...options.headers
568
- };
569
- requestBeforeHook({
570
- queryParameters: localVarQueryParameter,
571
- requestConfig: localVarRequestOptions,
572
- path: localVarPath,
573
- configuration,
574
- pathTemplate: "/holdings",
575
- httpMethod: "GET",
576
- operationAuth: localVarOperationAuth
577
- });
578
- setSearchParams(localVarUrlObj, localVarQueryParameter);
579
- return {
580
- url: toPathString(localVarUrlObj),
581
- options: localVarRequestOptions
582
- };
583
- },
584
- /**
585
509
  * 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.
586
510
  * @summary List account balances
587
511
  * @param {string} accountId
@@ -883,80 +807,6 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
883
807
  };
884
808
  },
885
809
  /**
886
- * **Deprecated.** Use the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions) instead. This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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). 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.
887
- * @summary List account positions
888
- * @param {string} accountId
889
- * @param {string} [userId]
890
- * @param {string} [userSecret]
891
- * @param {*} [options] Override http request option.
892
- * @deprecated
893
- * @throws {RequiredError}
894
- */
895
- getUserAccountPositions: async (accountId, userId, userSecret, options = {}) => {
896
- assertParamExists("getUserAccountPositions", "accountId", accountId);
897
- const localVarPath = `/accounts/{accountId}/positions`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
898
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
899
- let baseOptions;
900
- if (configuration) baseOptions = configuration.baseOptions;
901
- const localVarRequestOptions = {
902
- method: "GET",
903
- ...baseOptions,
904
- ...options
905
- };
906
- const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
907
- const localVarQueryParameter = {};
908
- if (configuration?.authMode === "commercialApiKey") {
909
- await setApiKeyToObject({
910
- object: localVarQueryParameter,
911
- key: "clientId",
912
- keyParamName: "clientId",
913
- configuration
914
- });
915
- if (userId !== void 0) localVarQueryParameter["userId"] = userId;
916
- if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
917
- }
918
- if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
919
- object: localVarQueryParameter,
920
- key: "clientId",
921
- keyParamName: "clientId",
922
- configuration
923
- });
924
- const localVarOperationAuth = {
925
- authModes: ["commercialApiKey", "personalApiKey"],
926
- requestSigningByAuthMode: {
927
- "commercialApiKey": {
928
- secretParameter: "consumerKey",
929
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
930
- },
931
- "personalApiKey": {
932
- secretParameter: "consumerKey",
933
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
934
- }
935
- },
936
- selectedAuthMode: configuration?.authMode
937
- };
938
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
939
- localVarRequestOptions.headers = {
940
- ...localVarHeaderParameter,
941
- ...headersFromBaseOptions,
942
- ...options.headers
943
- };
944
- requestBeforeHook({
945
- queryParameters: localVarQueryParameter,
946
- requestConfig: localVarRequestOptions,
947
- path: localVarPath,
948
- configuration,
949
- pathTemplate: "/accounts/{accountId}/positions",
950
- httpMethod: "GET",
951
- operationAuth: localVarOperationAuth
952
- });
953
- setSearchParams(localVarUrlObj, localVarQueryParameter);
954
- return {
955
- url: toPathString(localVarUrlObj),
956
- options: localVarRequestOptions
957
- };
958
- },
959
- /**
960
810
  * 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
961
811
  * @summary List account recent orders (last 24 hours only)
962
812
  * @param {string} accountId
@@ -1400,29 +1250,6 @@ const AccountInformationApiFp = function(configuration) {
1400
1250
  });
1401
1251
  },
1402
1252
  /**
1403
- * **Deprecated.** Use the account-specific holdings endpoint instead. This endpoint will return HTTP 410 Gone for all customers that sign up after April 25, 2026. List all accounts for the user, plus balances, positions, and orders for each account.
1404
- * @summary List all accounts for the user, plus balances, positions, and orders for each account.
1405
- * @param {AccountInformationApiGetAllUserHoldingsRequest<TAuth>} requestParameters Request parameters.
1406
- * @param {*} [options] Override http request option.
1407
- * @deprecated
1408
- * @throws {RequiredError}
1409
- */
1410
- async getAllUserHoldings(requestParameters = {}, options) {
1411
- return createRequestFunction(await localVarAxiosParamCreator.getAllUserHoldings(requestParameters.brokerageAuthorizations, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
1412
- authModes: ["commercialApiKey", "personalApiKey"],
1413
- requestSigningByAuthMode: {
1414
- "commercialApiKey": {
1415
- secretParameter: "consumerKey",
1416
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
1417
- },
1418
- "personalApiKey": {
1419
- secretParameter: "consumerKey",
1420
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
1421
- }
1422
- }
1423
- });
1424
- },
1425
- /**
1426
1253
  * 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.
1427
1254
  * @summary List account balances
1428
1255
  * @param {AccountInformationApiGetUserAccountBalanceRequest<TAuth>} requestParameters Request parameters.
@@ -1512,29 +1339,6 @@ const AccountInformationApiFp = function(configuration) {
1512
1339
  });
1513
1340
  },
1514
1341
  /**
1515
- * **Deprecated.** Use the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions) instead. This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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). 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.
1516
- * @summary List account positions
1517
- * @param {AccountInformationApiGetUserAccountPositionsRequest<TAuth>} requestParameters Request parameters.
1518
- * @param {*} [options] Override http request option.
1519
- * @deprecated
1520
- * @throws {RequiredError}
1521
- */
1522
- async getUserAccountPositions(requestParameters, options) {
1523
- return createRequestFunction(await localVarAxiosParamCreator.getUserAccountPositions(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
1524
- authModes: ["commercialApiKey", "personalApiKey"],
1525
- requestSigningByAuthMode: {
1526
- "commercialApiKey": {
1527
- secretParameter: "consumerKey",
1528
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
1529
- },
1530
- "personalApiKey": {
1531
- secretParameter: "consumerKey",
1532
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
1533
- }
1534
- }
1535
- });
1536
- },
1537
- /**
1538
1342
  * 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
1539
1343
  * @summary List account recent orders (last 24 hours only)
1540
1344
  * @param {AccountInformationApiGetUserAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
@@ -1685,17 +1489,6 @@ const AccountInformationApiFactory = function(configuration, basePath, axios) {
1685
1489
  return localVarFp.getAllAccountPositions(requestParameters, options).then((request) => request(axios, basePath));
1686
1490
  },
1687
1491
  /**
1688
- * **Deprecated.** Use the account-specific holdings endpoint instead. This endpoint will return HTTP 410 Gone for all customers that sign up after April 25, 2026. List all accounts for the user, plus balances, positions, and orders for each account.
1689
- * @summary List all accounts for the user, plus balances, positions, and orders for each account.
1690
- * @param {AccountInformationApiGetAllUserHoldingsRequest<TAuth>} requestParameters Request parameters.
1691
- * @param {*} [options] Override http request option.
1692
- * @deprecated
1693
- * @throws {RequiredError}
1694
- */
1695
- getAllUserHoldings(requestParameters = {}, options) {
1696
- return localVarFp.getAllUserHoldings(requestParameters, options).then((request) => request(axios, basePath));
1697
- },
1698
- /**
1699
1492
  * 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.
1700
1493
  * @summary List account balances
1701
1494
  * @param {AccountInformationApiGetUserAccountBalanceRequest<TAuth>} requestParameters Request parameters.
@@ -1736,17 +1529,6 @@ const AccountInformationApiFactory = function(configuration, basePath, axios) {
1736
1529
  return localVarFp.getUserAccountOrders(requestParameters, options).then((request) => request(axios, basePath));
1737
1530
  },
1738
1531
  /**
1739
- * **Deprecated.** Use the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions) instead. This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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). 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.
1740
- * @summary List account positions
1741
- * @param {AccountInformationApiGetUserAccountPositionsRequest<TAuth>} requestParameters Request parameters.
1742
- * @param {*} [options] Override http request option.
1743
- * @deprecated
1744
- * @throws {RequiredError}
1745
- */
1746
- getUserAccountPositions(requestParameters, options) {
1747
- return localVarFp.getUserAccountPositions(requestParameters, options).then((request) => request(axios, basePath));
1748
- },
1749
- /**
1750
1532
  * 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
1751
1533
  * @summary List account recent orders (last 24 hours only)
1752
1534
  * @param {AccountInformationApiGetUserAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
@@ -1840,18 +1622,6 @@ var AccountInformationApiGenerated = class extends BaseAPI {
1840
1622
  return AccountInformationApiFp(this.configuration).getAllAccountPositions(requestParameters, options).then((request) => request(this.axios, this.basePath));
1841
1623
  }
1842
1624
  /**
1843
- * **Deprecated.** Use the account-specific holdings endpoint instead. This endpoint will return HTTP 410 Gone for all customers that sign up after April 25, 2026. List all accounts for the user, plus balances, positions, and orders for each account.
1844
- * @summary List all accounts for the user, plus balances, positions, and orders for each account.
1845
- * @param {AccountInformationApiGetAllUserHoldingsRequest<TAuth>} requestParameters Request parameters.
1846
- * @param {*} [options] Override http request option.
1847
- * @deprecated
1848
- * @throws {RequiredError}
1849
- * @memberof AccountInformationApiGenerated
1850
- */
1851
- getAllUserHoldings(requestParameters = {}, options) {
1852
- return AccountInformationApiFp(this.configuration).getAllUserHoldings(requestParameters, options).then((request) => request(this.axios, this.basePath));
1853
- }
1854
- /**
1855
1625
  * 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.
1856
1626
  * @summary List account balances
1857
1627
  * @param {AccountInformationApiGetUserAccountBalanceRequest<TAuth>} requestParameters Request parameters.
@@ -1896,18 +1666,6 @@ var AccountInformationApiGenerated = class extends BaseAPI {
1896
1666
  return AccountInformationApiFp(this.configuration).getUserAccountOrders(requestParameters, options).then((request) => request(this.axios, this.basePath));
1897
1667
  }
1898
1668
  /**
1899
- * **Deprecated.** Use the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions) instead. This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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). 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.
1900
- * @summary List account positions
1901
- * @param {AccountInformationApiGetUserAccountPositionsRequest<TAuth>} requestParameters Request parameters.
1902
- * @param {*} [options] Override http request option.
1903
- * @deprecated
1904
- * @throws {RequiredError}
1905
- * @memberof AccountInformationApiGenerated
1906
- */
1907
- getUserAccountPositions(requestParameters, options) {
1908
- return AccountInformationApiFp(this.configuration).getUserAccountPositions(requestParameters, options).then((request) => request(this.axios, this.basePath));
1909
- }
1910
- /**
1911
1669
  * 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
1912
1670
  * @summary List account recent orders (last 24 hours only)
1913
1671
  * @param {AccountInformationApiGetUserAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
@@ -3063,22 +2821,23 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
3063
2821
  };
3064
2822
  },
3065
2823
  /**
3066
- * 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.
3067
- * @summary Delete connection
2824
+ * Returns a list of rate of return percents for a given connection.
2825
+ * @summary List connection rate of returns
3068
2826
  * @param {string} authorizationId
2827
+ * @param {string} [timeframes] Optional comma separated list of rate-of-return timeframes to return. Supported values are &#x60;ALL&#x60;, &#x60;1Y&#x60;, &#x60;YTD&#x60;, &#x60;1M&#x60;, &#x60;1W&#x60;, and &#x60;1D&#x60;. If omitted, SnapTrade returns all six supported timeframes.
3069
2828
  * @param {string} [userId]
3070
2829
  * @param {string} [userSecret]
3071
2830
  * @param {*} [options] Override http request option.
3072
2831
  * @throws {RequiredError}
3073
2832
  */
3074
- removeBrokerageAuthorization: async (authorizationId, userId, userSecret, options = {}) => {
3075
- assertParamExists("removeBrokerageAuthorization", "authorizationId", authorizationId);
3076
- const localVarPath = `/authorizations/{authorizationId}`.replace(`{authorizationId}`, encodeURIComponent(String(authorizationId !== void 0 ? authorizationId : `-authorizationId-`)));
2833
+ returnRates: async (authorizationId, timeframes, userId, userSecret, options = {}) => {
2834
+ assertParamExists("returnRates", "authorizationId", authorizationId);
2835
+ const localVarPath = `/authorizations/{authorizationId}/returnRates`.replace(`{authorizationId}`, encodeURIComponent(String(authorizationId !== void 0 ? authorizationId : `-authorizationId-`)));
3077
2836
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3078
2837
  let baseOptions;
3079
2838
  if (configuration) baseOptions = configuration.baseOptions;
3080
2839
  const localVarRequestOptions = {
3081
- method: "DELETE",
2840
+ method: "GET",
3082
2841
  ...baseOptions,
3083
2842
  ...options
3084
2843
  };
@@ -3100,6 +2859,7 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
3100
2859
  keyParamName: "clientId",
3101
2860
  configuration
3102
2861
  });
2862
+ if (timeframes !== void 0) localVarQueryParameter["timeframes"] = timeframes;
3103
2863
  const localVarOperationAuth = {
3104
2864
  authModes: ["commercialApiKey", "personalApiKey"],
3105
2865
  requestSigningByAuthMode: {
@@ -3125,8 +2885,8 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
3125
2885
  requestConfig: localVarRequestOptions,
3126
2886
  path: localVarPath,
3127
2887
  configuration,
3128
- pathTemplate: "/authorizations/{authorizationId}",
3129
- httpMethod: "DELETE",
2888
+ pathTemplate: "/authorizations/{authorizationId}/returnRates",
2889
+ httpMethod: "GET",
3130
2890
  operationAuth: localVarOperationAuth
3131
2891
  });
3132
2892
  setSearchParams(localVarUrlObj, localVarQueryParameter);
@@ -3136,23 +2896,22 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
3136
2896
  };
3137
2897
  },
3138
2898
  /**
3139
- * Returns a list of rate of return percents for a given connection.
3140
- * @summary List connection rate of returns
2899
+ * 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
2900
+ * @summary Sync transactions for a connection
3141
2901
  * @param {string} authorizationId
3142
- * @param {string} [timeframes] Optional comma separated list of rate-of-return timeframes to return. Supported values are &#x60;ALL&#x60;, &#x60;1Y&#x60;, &#x60;YTD&#x60;, &#x60;1M&#x60;, &#x60;1W&#x60;, and &#x60;1D&#x60;. If omitted, SnapTrade returns all six supported timeframes.
3143
2902
  * @param {string} [userId]
3144
2903
  * @param {string} [userSecret]
3145
2904
  * @param {*} [options] Override http request option.
3146
2905
  * @throws {RequiredError}
3147
2906
  */
3148
- returnRates: async (authorizationId, timeframes, userId, userSecret, options = {}) => {
3149
- assertParamExists("returnRates", "authorizationId", authorizationId);
3150
- const localVarPath = `/authorizations/{authorizationId}/returnRates`.replace(`{authorizationId}`, encodeURIComponent(String(authorizationId !== void 0 ? authorizationId : `-authorizationId-`)));
2907
+ syncBrokerageAuthorizationTransactions: async (authorizationId, userId, userSecret, options = {}) => {
2908
+ assertParamExists("syncBrokerageAuthorizationTransactions", "authorizationId", authorizationId);
2909
+ const localVarPath = `/authorizations/{authorizationId}/transactions/sync`.replace(`{authorizationId}`, encodeURIComponent(String(authorizationId !== void 0 ? authorizationId : `-authorizationId-`)));
3151
2910
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3152
2911
  let baseOptions;
3153
2912
  if (configuration) baseOptions = configuration.baseOptions;
3154
2913
  const localVarRequestOptions = {
3155
- method: "GET",
2914
+ method: "POST",
3156
2915
  ...baseOptions,
3157
2916
  ...options
3158
2917
  };
@@ -3174,7 +2933,6 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
3174
2933
  keyParamName: "clientId",
3175
2934
  configuration
3176
2935
  });
3177
- if (timeframes !== void 0) localVarQueryParameter["timeframes"] = timeframes;
3178
2936
  const localVarOperationAuth = {
3179
2937
  authModes: ["commercialApiKey", "personalApiKey"],
3180
2938
  requestSigningByAuthMode: {
@@ -3200,8 +2958,8 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
3200
2958
  requestConfig: localVarRequestOptions,
3201
2959
  path: localVarPath,
3202
2960
  configuration,
3203
- pathTemplate: "/authorizations/{authorizationId}/returnRates",
3204
- httpMethod: "GET",
2961
+ pathTemplate: "/authorizations/{authorizationId}/transactions/sync",
2962
+ httpMethod: "POST",
3205
2963
  operationAuth: localVarOperationAuth
3206
2964
  });
3207
2965
  setSearchParams(localVarUrlObj, localVarQueryParameter);
@@ -3209,165 +2967,20 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
3209
2967
  url: toPathString(localVarUrlObj),
3210
2968
  options: localVarRequestOptions
3211
2969
  };
3212
- },
2970
+ }
2971
+ };
2972
+ };
2973
+ /**
2974
+ * ConnectionsApi - functional programming interface
2975
+ * @export
2976
+ */
2977
+ const ConnectionsApiFp = function(configuration) {
2978
+ const localVarAxiosParamCreator = ConnectionsApiAxiosParamCreator(configuration);
2979
+ return {
3213
2980
  /**
3214
- * Returns a list of session events associated with a user.
3215
- * @summary Get all session events for a user
3216
- * @param {string} partnerClientId
3217
- * @param {string} [userId] Optional comma separated list of user IDs used to filter the request on specific users
3218
- * @param {string} [sessionId] Optional comma separated list of session IDs used to filter the request on specific users
3219
- * @param {*} [options] Override http request option.
3220
- * @throws {RequiredError}
3221
- */
3222
- sessionEvents: async (partnerClientId, userId, sessionId, options = {}) => {
3223
- assertParamExists("sessionEvents", "partnerClientId", partnerClientId);
3224
- const localVarPath = `/sessionEvents`;
3225
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3226
- let baseOptions;
3227
- if (configuration) baseOptions = configuration.baseOptions;
3228
- const localVarRequestOptions = {
3229
- method: "GET",
3230
- ...baseOptions,
3231
- ...options
3232
- };
3233
- const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
3234
- const localVarQueryParameter = {};
3235
- if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
3236
- object: localVarQueryParameter,
3237
- key: "clientId",
3238
- keyParamName: "clientId",
3239
- configuration
3240
- });
3241
- if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
3242
- object: localVarQueryParameter,
3243
- key: "clientId",
3244
- keyParamName: "clientId",
3245
- configuration
3246
- });
3247
- if (partnerClientId !== void 0) localVarQueryParameter["PartnerClientId"] = partnerClientId;
3248
- if (userId !== void 0) localVarQueryParameter["userId"] = userId;
3249
- if (sessionId !== void 0) localVarQueryParameter["sessionId"] = sessionId;
3250
- const localVarOperationAuth = {
3251
- authModes: ["commercialApiKey", "personalApiKey"],
3252
- requestSigningByAuthMode: {
3253
- "commercialApiKey": {
3254
- secretParameter: "consumerKey",
3255
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
3256
- },
3257
- "personalApiKey": {
3258
- secretParameter: "consumerKey",
3259
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
3260
- }
3261
- },
3262
- selectedAuthMode: configuration?.authMode
3263
- };
3264
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3265
- localVarRequestOptions.headers = {
3266
- ...localVarHeaderParameter,
3267
- ...headersFromBaseOptions,
3268
- ...options.headers
3269
- };
3270
- requestBeforeHook({
3271
- queryParameters: localVarQueryParameter,
3272
- requestConfig: localVarRequestOptions,
3273
- path: localVarPath,
3274
- configuration,
3275
- pathTemplate: "/sessionEvents",
3276
- httpMethod: "GET",
3277
- operationAuth: localVarOperationAuth
3278
- });
3279
- setSearchParams(localVarUrlObj, localVarQueryParameter);
3280
- return {
3281
- url: toPathString(localVarUrlObj),
3282
- options: localVarRequestOptions
3283
- };
3284
- },
3285
- /**
3286
- * 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
3287
- * @summary Sync transactions for a connection
3288
- * @param {string} authorizationId
3289
- * @param {string} [userId]
3290
- * @param {string} [userSecret]
3291
- * @param {*} [options] Override http request option.
3292
- * @throws {RequiredError}
3293
- */
3294
- syncBrokerageAuthorizationTransactions: async (authorizationId, userId, userSecret, options = {}) => {
3295
- assertParamExists("syncBrokerageAuthorizationTransactions", "authorizationId", authorizationId);
3296
- const localVarPath = `/authorizations/{authorizationId}/transactions/sync`.replace(`{authorizationId}`, encodeURIComponent(String(authorizationId !== void 0 ? authorizationId : `-authorizationId-`)));
3297
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3298
- let baseOptions;
3299
- if (configuration) baseOptions = configuration.baseOptions;
3300
- const localVarRequestOptions = {
3301
- method: "POST",
3302
- ...baseOptions,
3303
- ...options
3304
- };
3305
- const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
3306
- const localVarQueryParameter = {};
3307
- if (configuration?.authMode === "commercialApiKey") {
3308
- await setApiKeyToObject({
3309
- object: localVarQueryParameter,
3310
- key: "clientId",
3311
- keyParamName: "clientId",
3312
- configuration
3313
- });
3314
- if (userId !== void 0) localVarQueryParameter["userId"] = userId;
3315
- if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
3316
- }
3317
- if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
3318
- object: localVarQueryParameter,
3319
- key: "clientId",
3320
- keyParamName: "clientId",
3321
- configuration
3322
- });
3323
- const localVarOperationAuth = {
3324
- authModes: ["commercialApiKey", "personalApiKey"],
3325
- requestSigningByAuthMode: {
3326
- "commercialApiKey": {
3327
- secretParameter: "consumerKey",
3328
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
3329
- },
3330
- "personalApiKey": {
3331
- secretParameter: "consumerKey",
3332
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
3333
- }
3334
- },
3335
- selectedAuthMode: configuration?.authMode
3336
- };
3337
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3338
- localVarRequestOptions.headers = {
3339
- ...localVarHeaderParameter,
3340
- ...headersFromBaseOptions,
3341
- ...options.headers
3342
- };
3343
- requestBeforeHook({
3344
- queryParameters: localVarQueryParameter,
3345
- requestConfig: localVarRequestOptions,
3346
- path: localVarPath,
3347
- configuration,
3348
- pathTemplate: "/authorizations/{authorizationId}/transactions/sync",
3349
- httpMethod: "POST",
3350
- operationAuth: localVarOperationAuth
3351
- });
3352
- setSearchParams(localVarUrlObj, localVarQueryParameter);
3353
- return {
3354
- url: toPathString(localVarUrlObj),
3355
- options: localVarRequestOptions
3356
- };
3357
- }
3358
- };
3359
- };
3360
- /**
3361
- * ConnectionsApi - functional programming interface
3362
- * @export
3363
- */
3364
- const ConnectionsApiFp = function(configuration) {
3365
- const localVarAxiosParamCreator = ConnectionsApiAxiosParamCreator(configuration);
3366
- return {
3367
- /**
3368
- * 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 asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [`CONNECTION_DELETED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
3369
- * @summary Delete connection
3370
- * @param {ConnectionsApiDeleteConnectionRequest<TAuth>} requestParameters Request parameters.
2981
+ * 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 asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [`CONNECTION_DELETED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
2982
+ * @summary Delete connection
2983
+ * @param {ConnectionsApiDeleteConnectionRequest<TAuth>} requestParameters Request parameters.
3371
2984
  * @param {*} [options] Override http request option.
3372
2985
  * @throws {RequiredError}
3373
2986
  */
@@ -3497,28 +3110,6 @@ const ConnectionsApiFp = function(configuration) {
3497
3110
  });
3498
3111
  },
3499
3112
  /**
3500
- * 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.
3501
- * @summary Delete connection
3502
- * @param {ConnectionsApiRemoveBrokerageAuthorizationRequest<TAuth>} requestParameters Request parameters.
3503
- * @param {*} [options] Override http request option.
3504
- * @throws {RequiredError}
3505
- */
3506
- async removeBrokerageAuthorization(requestParameters, options) {
3507
- return createRequestFunction(await localVarAxiosParamCreator.removeBrokerageAuthorization(requestParameters.authorizationId, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
3508
- authModes: ["commercialApiKey", "personalApiKey"],
3509
- requestSigningByAuthMode: {
3510
- "commercialApiKey": {
3511
- secretParameter: "consumerKey",
3512
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
3513
- },
3514
- "personalApiKey": {
3515
- secretParameter: "consumerKey",
3516
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
3517
- }
3518
- }
3519
- });
3520
- },
3521
- /**
3522
3113
  * Returns a list of rate of return percents for a given connection.
3523
3114
  * @summary List connection rate of returns
3524
3115
  * @param {ConnectionsApiReturnRatesRequest<TAuth>} requestParameters Request parameters.
@@ -3541,28 +3132,6 @@ const ConnectionsApiFp = function(configuration) {
3541
3132
  });
3542
3133
  },
3543
3134
  /**
3544
- * Returns a list of session events associated with a user.
3545
- * @summary Get all session events for a user
3546
- * @param {ConnectionsApiSessionEventsRequest<TAuth>} requestParameters Request parameters.
3547
- * @param {*} [options] Override http request option.
3548
- * @throws {RequiredError}
3549
- */
3550
- async sessionEvents(requestParameters, options) {
3551
- return createRequestFunction(await localVarAxiosParamCreator.sessionEvents(requestParameters.partnerClientId, requestParameters.userId, requestParameters.sessionId, options), globalAxios, BASE_PATH, configuration, {
3552
- authModes: ["commercialApiKey", "personalApiKey"],
3553
- requestSigningByAuthMode: {
3554
- "commercialApiKey": {
3555
- secretParameter: "consumerKey",
3556
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
3557
- },
3558
- "personalApiKey": {
3559
- secretParameter: "consumerKey",
3560
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
3561
- }
3562
- }
3563
- });
3564
- },
3565
- /**
3566
3135
  * 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
3567
3136
  * @summary Sync transactions for a connection
3568
3137
  * @param {ConnectionsApiSyncBrokerageAuthorizationTransactionsRequest<TAuth>} requestParameters Request parameters.
@@ -3654,16 +3223,6 @@ const ConnectionsApiFactory = function(configuration, basePath, axios) {
3654
3223
  return localVarFp.refreshBrokerageAuthorization(requestParameters, options).then((request) => request(axios, basePath));
3655
3224
  },
3656
3225
  /**
3657
- * 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.
3658
- * @summary Delete connection
3659
- * @param {ConnectionsApiRemoveBrokerageAuthorizationRequest<TAuth>} requestParameters Request parameters.
3660
- * @param {*} [options] Override http request option.
3661
- * @throws {RequiredError}
3662
- */
3663
- removeBrokerageAuthorization(requestParameters, options) {
3664
- return localVarFp.removeBrokerageAuthorization(requestParameters, options).then((request) => request(axios, basePath));
3665
- },
3666
- /**
3667
3226
  * Returns a list of rate of return percents for a given connection.
3668
3227
  * @summary List connection rate of returns
3669
3228
  * @param {ConnectionsApiReturnRatesRequest<TAuth>} requestParameters Request parameters.
@@ -3674,16 +3233,6 @@ const ConnectionsApiFactory = function(configuration, basePath, axios) {
3674
3233
  return localVarFp.returnRates(requestParameters, options).then((request) => request(axios, basePath));
3675
3234
  },
3676
3235
  /**
3677
- * Returns a list of session events associated with a user.
3678
- * @summary Get all session events for a user
3679
- * @param {ConnectionsApiSessionEventsRequest<TAuth>} requestParameters Request parameters.
3680
- * @param {*} [options] Override http request option.
3681
- * @throws {RequiredError}
3682
- */
3683
- sessionEvents(requestParameters, options) {
3684
- return localVarFp.sessionEvents(requestParameters, options).then((request) => request(axios, basePath));
3685
- },
3686
- /**
3687
3236
  * 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
3688
3237
  * @summary Sync transactions for a connection
3689
3238
  * @param {ConnectionsApiSyncBrokerageAuthorizationTransactionsRequest<TAuth>} requestParameters Request parameters.
@@ -3769,17 +3318,6 @@ var ConnectionsApiGenerated = class extends BaseAPI {
3769
3318
  return ConnectionsApiFp(this.configuration).refreshBrokerageAuthorization(requestParameters, options).then((request) => request(this.axios, this.basePath));
3770
3319
  }
3771
3320
  /**
3772
- * 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.
3773
- * @summary Delete connection
3774
- * @param {ConnectionsApiRemoveBrokerageAuthorizationRequest<TAuth>} requestParameters Request parameters.
3775
- * @param {*} [options] Override http request option.
3776
- * @throws {RequiredError}
3777
- * @memberof ConnectionsApiGenerated
3778
- */
3779
- removeBrokerageAuthorization(requestParameters, options) {
3780
- return ConnectionsApiFp(this.configuration).removeBrokerageAuthorization(requestParameters, options).then((request) => request(this.axios, this.basePath));
3781
- }
3782
- /**
3783
3321
  * Returns a list of rate of return percents for a given connection.
3784
3322
  * @summary List connection rate of returns
3785
3323
  * @param {ConnectionsApiReturnRatesRequest<TAuth>} requestParameters Request parameters.
@@ -3791,17 +3329,6 @@ var ConnectionsApiGenerated = class extends BaseAPI {
3791
3329
  return ConnectionsApiFp(this.configuration).returnRates(requestParameters, options).then((request) => request(this.axios, this.basePath));
3792
3330
  }
3793
3331
  /**
3794
- * Returns a list of session events associated with a user.
3795
- * @summary Get all session events for a user
3796
- * @param {ConnectionsApiSessionEventsRequest<TAuth>} requestParameters Request parameters.
3797
- * @param {*} [options] Override http request option.
3798
- * @throws {RequiredError}
3799
- * @memberof ConnectionsApiGenerated
3800
- */
3801
- sessionEvents(requestParameters, options) {
3802
- return ConnectionsApiFp(this.configuration).sessionEvents(requestParameters, options).then((request) => request(this.axios, this.basePath));
3803
- }
3804
- /**
3805
3332
  * 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
3806
3333
  * @summary Sync transactions for a connection
3807
3334
  * @param {ConnectionsApiSyncBrokerageAuthorizationTransactionsRequest<TAuth>} requestParameters Request parameters.
@@ -4671,277 +4198,54 @@ var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
4671
4198
  //#region api/experimental-endpoints-api.ts
4672
4199
  var ExperimentalEndpointsApi = class extends ExperimentalEndpointsApiGenerated {};
4673
4200
  //#endregion
4674
- //#region api/options-api-generated.ts
4201
+ //#region api/reference-data-api-generated.ts
4675
4202
  /**
4676
- * OptionsApi - axios parameter creator
4203
+ * ReferenceDataApi - axios parameter creator
4677
4204
  * @export
4678
4205
  */
4679
- const OptionsApiAxiosParamCreator = function(configuration) {
4680
- return {
4681
- /**
4682
- * **Deprecated.** Use the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions) instead. This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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). 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.
4683
- * @summary List account option positions
4684
- * @param {string} accountId
4685
- * @param {string} [userId]
4686
- * @param {string} [userSecret]
4687
- * @param {*} [options] Override http request option.
4688
- * @deprecated
4689
- * @throws {RequiredError}
4690
- */
4691
- listOptionHoldings: async (accountId, userId, userSecret, options = {}) => {
4692
- assertParamExists("listOptionHoldings", "accountId", accountId);
4693
- const localVarPath = `/accounts/{accountId}/options`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
4694
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
4695
- let baseOptions;
4696
- if (configuration) baseOptions = configuration.baseOptions;
4697
- const localVarRequestOptions = {
4698
- method: "GET",
4699
- ...baseOptions,
4700
- ...options
4701
- };
4702
- const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
4703
- const localVarQueryParameter = {};
4704
- if (configuration?.authMode === "commercialApiKey") {
4705
- await setApiKeyToObject({
4206
+ const ReferenceDataApiAxiosParamCreator = function(configuration) {
4207
+ return {
4208
+ /**
4209
+ * Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
4210
+ * @summary Get Client Info
4211
+ * @param {*} [options] Override http request option.
4212
+ * @throws {RequiredError}
4213
+ */
4214
+ getPartnerInfo: async (options = {}) => {
4215
+ const localVarPath = `/snapTrade/partners`;
4216
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
4217
+ let baseOptions;
4218
+ if (configuration) baseOptions = configuration.baseOptions;
4219
+ const localVarRequestOptions = {
4220
+ method: "GET",
4221
+ ...baseOptions,
4222
+ ...options
4223
+ };
4224
+ const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
4225
+ const localVarQueryParameter = {};
4226
+ if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
4706
4227
  object: localVarQueryParameter,
4707
4228
  key: "clientId",
4708
4229
  keyParamName: "clientId",
4709
4230
  configuration
4710
4231
  });
4711
- if (userId !== void 0) localVarQueryParameter["userId"] = userId;
4712
- if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
4713
- }
4714
- if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
4715
- object: localVarQueryParameter,
4716
- key: "clientId",
4717
- keyParamName: "clientId",
4718
- configuration
4719
- });
4720
- const localVarOperationAuth = {
4721
- authModes: ["commercialApiKey", "personalApiKey"],
4722
- requestSigningByAuthMode: {
4723
- "commercialApiKey": {
4724
- secretParameter: "consumerKey",
4725
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
4726
- },
4727
- "personalApiKey": {
4728
- secretParameter: "consumerKey",
4729
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
4730
- }
4731
- },
4732
- selectedAuthMode: configuration?.authMode
4733
- };
4734
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
4735
- localVarRequestOptions.headers = {
4736
- ...localVarHeaderParameter,
4737
- ...headersFromBaseOptions,
4738
- ...options.headers
4739
- };
4740
- requestBeforeHook({
4741
- queryParameters: localVarQueryParameter,
4742
- requestConfig: localVarRequestOptions,
4743
- path: localVarPath,
4744
- configuration,
4745
- pathTemplate: "/accounts/{accountId}/options",
4746
- httpMethod: "GET",
4747
- operationAuth: localVarOperationAuth
4748
- });
4749
- setSearchParams(localVarUrlObj, localVarQueryParameter);
4750
- return {
4751
- url: toPathString(localVarUrlObj),
4752
- options: localVarRequestOptions
4753
- };
4754
- } };
4755
- };
4756
- /**
4757
- * OptionsApi - functional programming interface
4758
- * @export
4759
- */
4760
- const OptionsApiFp = function(configuration) {
4761
- const localVarAxiosParamCreator = OptionsApiAxiosParamCreator(configuration);
4762
- return {
4763
- /**
4764
- * **Deprecated.** Use the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions) instead. This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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). 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.
4765
- * @summary List account option positions
4766
- * @param {OptionsApiListOptionHoldingsRequest<TAuth>} requestParameters Request parameters.
4767
- * @param {*} [options] Override http request option.
4768
- * @deprecated
4769
- * @throws {RequiredError}
4770
- */
4771
- async listOptionHoldings(requestParameters, options) {
4772
- return createRequestFunction(await localVarAxiosParamCreator.listOptionHoldings(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
4773
- authModes: ["commercialApiKey", "personalApiKey"],
4774
- requestSigningByAuthMode: {
4775
- "commercialApiKey": {
4776
- secretParameter: "consumerKey",
4777
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
4778
- },
4779
- "personalApiKey": {
4780
- secretParameter: "consumerKey",
4781
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
4782
- }
4783
- }
4784
- });
4785
- } };
4786
- };
4787
- /**
4788
- * OptionsApi - factory interface
4789
- * @export
4790
- */
4791
- const OptionsApiFactory = function(configuration, basePath, axios) {
4792
- const localVarFp = OptionsApiFp(configuration);
4793
- return {
4794
- /**
4795
- * **Deprecated.** Use the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions) instead. This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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). 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.
4796
- * @summary List account option positions
4797
- * @param {OptionsApiListOptionHoldingsRequest<TAuth>} requestParameters Request parameters.
4798
- * @param {*} [options] Override http request option.
4799
- * @deprecated
4800
- * @throws {RequiredError}
4801
- */
4802
- listOptionHoldings(requestParameters, options) {
4803
- return localVarFp.listOptionHoldings(requestParameters, options).then((request) => request(axios, basePath));
4804
- } };
4805
- };
4806
- /**
4807
- * OptionsApiGenerated - object-oriented interface
4808
- * @export
4809
- * @class OptionsApiGenerated
4810
- * @extends {BaseAPI}
4811
- */
4812
- var OptionsApiGenerated = class extends BaseAPI {
4813
- /**
4814
- * **Deprecated.** Use the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions) instead. This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. 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). 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.
4815
- * @summary List account option positions
4816
- * @param {OptionsApiListOptionHoldingsRequest<TAuth>} requestParameters Request parameters.
4817
- * @param {*} [options] Override http request option.
4818
- * @deprecated
4819
- * @throws {RequiredError}
4820
- * @memberof OptionsApiGenerated
4821
- */
4822
- listOptionHoldings(requestParameters, options) {
4823
- return OptionsApiFp(this.configuration).listOptionHoldings(requestParameters, options).then((request) => request(this.axios, this.basePath));
4824
- }
4825
- };
4826
- //#endregion
4827
- //#region api/options-api.ts
4828
- var OptionsApi = class extends OptionsApiGenerated {};
4829
- //#endregion
4830
- //#region api/reference-data-api-generated.ts
4831
- /**
4832
- * ReferenceDataApi - axios parameter creator
4833
- * @export
4834
- */
4835
- const ReferenceDataApiAxiosParamCreator = function(configuration) {
4836
- return {
4837
- /**
4838
- * Returns an Exchange Rate Pair object for the specified Currency Pair.
4839
- * @summary Get exchange rate of a currency pair
4840
- * @param {string} currencyPair A currency pair based on currency code for example, {CAD-USD}
4841
- * @param {*} [options] Override http request option.
4842
- * @throws {RequiredError}
4843
- */
4844
- getCurrencyExchangeRatePair: async (currencyPair, options = {}) => {
4845
- assertParamExists("getCurrencyExchangeRatePair", "currencyPair", currencyPair);
4846
- const localVarPath = `/currencies/rates/{currencyPair}`.replace(`{currencyPair}`, encodeURIComponent(String(currencyPair !== void 0 ? currencyPair : `-currencyPair-`)));
4847
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
4848
- let baseOptions;
4849
- if (configuration) baseOptions = configuration.baseOptions;
4850
- const localVarRequestOptions = {
4851
- method: "GET",
4852
- ...baseOptions,
4853
- ...options
4854
- };
4855
- const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
4856
- const localVarQueryParameter = {};
4857
- if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
4858
- object: localVarQueryParameter,
4859
- key: "clientId",
4860
- keyParamName: "clientId",
4861
- configuration
4862
- });
4863
- if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
4864
- object: localVarQueryParameter,
4865
- key: "clientId",
4866
- keyParamName: "clientId",
4867
- configuration
4868
- });
4869
- const localVarOperationAuth = {
4870
- authModes: ["commercialApiKey", "personalApiKey"],
4871
- requestSigningByAuthMode: {
4872
- "commercialApiKey": {
4873
- secretParameter: "consumerKey",
4874
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
4875
- },
4876
- "personalApiKey": {
4877
- secretParameter: "consumerKey",
4878
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
4879
- }
4880
- },
4881
- selectedAuthMode: configuration?.authMode
4882
- };
4883
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
4884
- localVarRequestOptions.headers = {
4885
- ...localVarHeaderParameter,
4886
- ...headersFromBaseOptions,
4887
- ...options.headers
4888
- };
4889
- requestBeforeHook({
4890
- queryParameters: localVarQueryParameter,
4891
- requestConfig: localVarRequestOptions,
4892
- path: localVarPath,
4893
- configuration,
4894
- pathTemplate: "/currencies/rates/{currencyPair}",
4895
- httpMethod: "GET",
4896
- operationAuth: localVarOperationAuth
4897
- });
4898
- setSearchParams(localVarUrlObj, localVarQueryParameter);
4899
- return {
4900
- url: toPathString(localVarUrlObj),
4901
- options: localVarRequestOptions
4902
- };
4903
- },
4904
- /**
4905
- * Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
4906
- * @summary Get Client Info
4907
- * @param {*} [options] Override http request option.
4908
- * @throws {RequiredError}
4909
- */
4910
- getPartnerInfo: async (options = {}) => {
4911
- const localVarPath = `/snapTrade/partners`;
4912
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
4913
- let baseOptions;
4914
- if (configuration) baseOptions = configuration.baseOptions;
4915
- const localVarRequestOptions = {
4916
- method: "GET",
4917
- ...baseOptions,
4918
- ...options
4919
- };
4920
- const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
4921
- const localVarQueryParameter = {};
4922
- if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
4923
- object: localVarQueryParameter,
4924
- key: "clientId",
4925
- keyParamName: "clientId",
4926
- configuration
4927
- });
4928
- if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
4929
- object: localVarQueryParameter,
4930
- key: "clientId",
4931
- keyParamName: "clientId",
4932
- configuration
4933
- });
4934
- const localVarOperationAuth = {
4935
- authModes: ["commercialApiKey", "personalApiKey"],
4936
- requestSigningByAuthMode: {
4937
- "commercialApiKey": {
4938
- secretParameter: "consumerKey",
4939
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
4940
- },
4941
- "personalApiKey": {
4942
- secretParameter: "consumerKey",
4943
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
4944
- }
4232
+ if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
4233
+ object: localVarQueryParameter,
4234
+ key: "clientId",
4235
+ keyParamName: "clientId",
4236
+ configuration
4237
+ });
4238
+ const localVarOperationAuth = {
4239
+ authModes: ["commercialApiKey", "personalApiKey"],
4240
+ requestSigningByAuthMode: {
4241
+ "commercialApiKey": {
4242
+ secretParameter: "consumerKey",
4243
+ signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
4244
+ },
4245
+ "personalApiKey": {
4246
+ secretParameter: "consumerKey",
4247
+ signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
4248
+ }
4945
4249
  },
4946
4250
  selectedAuthMode: configuration?.authMode
4947
4251
  };
@@ -4967,71 +4271,6 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
4967
4271
  };
4968
4272
  },
4969
4273
  /**
4970
- * Return all available security types supported by SnapTrade.
4971
- * @summary List security types
4972
- * @param {*} [options] Override http request option.
4973
- * @throws {RequiredError}
4974
- */
4975
- getSecurityTypes: async (options = {}) => {
4976
- const localVarPath = `/securityTypes`;
4977
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
4978
- let baseOptions;
4979
- if (configuration) baseOptions = configuration.baseOptions;
4980
- const localVarRequestOptions = {
4981
- method: "GET",
4982
- ...baseOptions,
4983
- ...options
4984
- };
4985
- const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
4986
- const localVarQueryParameter = {};
4987
- if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
4988
- object: localVarQueryParameter,
4989
- key: "clientId",
4990
- keyParamName: "clientId",
4991
- configuration
4992
- });
4993
- if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
4994
- object: localVarQueryParameter,
4995
- key: "clientId",
4996
- keyParamName: "clientId",
4997
- configuration
4998
- });
4999
- const localVarOperationAuth = {
5000
- authModes: ["commercialApiKey", "personalApiKey"],
5001
- requestSigningByAuthMode: {
5002
- "commercialApiKey": {
5003
- secretParameter: "consumerKey",
5004
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
5005
- },
5006
- "personalApiKey": {
5007
- secretParameter: "consumerKey",
5008
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
5009
- }
5010
- },
5011
- selectedAuthMode: configuration?.authMode
5012
- };
5013
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
5014
- localVarRequestOptions.headers = {
5015
- ...localVarHeaderParameter,
5016
- ...headersFromBaseOptions,
5017
- ...options.headers
5018
- };
5019
- requestBeforeHook({
5020
- queryParameters: localVarQueryParameter,
5021
- requestConfig: localVarRequestOptions,
5022
- path: localVarPath,
5023
- configuration,
5024
- pathTemplate: "/securityTypes",
5025
- httpMethod: "GET",
5026
- operationAuth: localVarOperationAuth
5027
- });
5028
- setSearchParams(localVarUrlObj, localVarQueryParameter);
5029
- return {
5030
- url: toPathString(localVarUrlObj),
5031
- options: localVarRequestOptions
5032
- };
5033
- },
5034
- /**
5035
4274
  * Returns a list of all supported Exchanges.
5036
4275
  * @summary Get exchanges
5037
4276
  * @param {*} [options] Override http request option.
@@ -5432,136 +4671,6 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
5432
4671
  };
5433
4672
  },
5434
4673
  /**
5435
- * Returns a list of all defined Currency objects.
5436
- * @summary Get currencies
5437
- * @param {*} [options] Override http request option.
5438
- * @throws {RequiredError}
5439
- */
5440
- listAllCurrencies: async (options = {}) => {
5441
- const localVarPath = `/currencies`;
5442
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
5443
- let baseOptions;
5444
- if (configuration) baseOptions = configuration.baseOptions;
5445
- const localVarRequestOptions = {
5446
- method: "GET",
5447
- ...baseOptions,
5448
- ...options
5449
- };
5450
- const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
5451
- const localVarQueryParameter = {};
5452
- if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
5453
- object: localVarQueryParameter,
5454
- key: "clientId",
5455
- keyParamName: "clientId",
5456
- configuration
5457
- });
5458
- if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
5459
- object: localVarQueryParameter,
5460
- key: "clientId",
5461
- keyParamName: "clientId",
5462
- configuration
5463
- });
5464
- const localVarOperationAuth = {
5465
- authModes: ["commercialApiKey", "personalApiKey"],
5466
- requestSigningByAuthMode: {
5467
- "commercialApiKey": {
5468
- secretParameter: "consumerKey",
5469
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
5470
- },
5471
- "personalApiKey": {
5472
- secretParameter: "consumerKey",
5473
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
5474
- }
5475
- },
5476
- selectedAuthMode: configuration?.authMode
5477
- };
5478
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
5479
- localVarRequestOptions.headers = {
5480
- ...localVarHeaderParameter,
5481
- ...headersFromBaseOptions,
5482
- ...options.headers
5483
- };
5484
- requestBeforeHook({
5485
- queryParameters: localVarQueryParameter,
5486
- requestConfig: localVarRequestOptions,
5487
- path: localVarPath,
5488
- configuration,
5489
- pathTemplate: "/currencies",
5490
- httpMethod: "GET",
5491
- operationAuth: localVarOperationAuth
5492
- });
5493
- setSearchParams(localVarUrlObj, localVarQueryParameter);
5494
- return {
5495
- url: toPathString(localVarUrlObj),
5496
- options: localVarRequestOptions
5497
- };
5498
- },
5499
- /**
5500
- * Returns a list of all Exchange Rate Pairs for all supported Currencies.
5501
- * @summary Get currency exchange rates
5502
- * @param {*} [options] Override http request option.
5503
- * @throws {RequiredError}
5504
- */
5505
- listAllCurrenciesRates: async (options = {}) => {
5506
- const localVarPath = `/currencies/rates`;
5507
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
5508
- let baseOptions;
5509
- if (configuration) baseOptions = configuration.baseOptions;
5510
- const localVarRequestOptions = {
5511
- method: "GET",
5512
- ...baseOptions,
5513
- ...options
5514
- };
5515
- const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
5516
- const localVarQueryParameter = {};
5517
- if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
5518
- object: localVarQueryParameter,
5519
- key: "clientId",
5520
- keyParamName: "clientId",
5521
- configuration
5522
- });
5523
- if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
5524
- object: localVarQueryParameter,
5525
- key: "clientId",
5526
- keyParamName: "clientId",
5527
- configuration
5528
- });
5529
- const localVarOperationAuth = {
5530
- authModes: ["commercialApiKey", "personalApiKey"],
5531
- requestSigningByAuthMode: {
5532
- "commercialApiKey": {
5533
- secretParameter: "consumerKey",
5534
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
5535
- },
5536
- "personalApiKey": {
5537
- secretParameter: "consumerKey",
5538
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
5539
- }
5540
- },
5541
- selectedAuthMode: configuration?.authMode
5542
- };
5543
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
5544
- localVarRequestOptions.headers = {
5545
- ...localVarHeaderParameter,
5546
- ...headersFromBaseOptions,
5547
- ...options.headers
5548
- };
5549
- requestBeforeHook({
5550
- queryParameters: localVarQueryParameter,
5551
- requestConfig: localVarRequestOptions,
5552
- path: localVarPath,
5553
- configuration,
5554
- pathTemplate: "/currencies/rates",
5555
- httpMethod: "GET",
5556
- operationAuth: localVarOperationAuth
5557
- });
5558
- setSearchParams(localVarUrlObj, localVarQueryParameter);
5559
- return {
5560
- url: toPathString(localVarUrlObj),
5561
- options: localVarRequestOptions
5562
- };
5563
- },
5564
- /**
5565
4674
  * Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned. The search results are further limited to the symbols supported by the brokerage for which the account is under.
5566
4675
  * @summary Search account symbols
5567
4676
  * @param {string} accountId
@@ -5647,28 +4756,6 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
5647
4756
  const ReferenceDataApiFp = function(configuration) {
5648
4757
  const localVarAxiosParamCreator = ReferenceDataApiAxiosParamCreator(configuration);
5649
4758
  return {
5650
- /**
5651
- * Returns an Exchange Rate Pair object for the specified Currency Pair.
5652
- * @summary Get exchange rate of a currency pair
5653
- * @param {ReferenceDataApiGetCurrencyExchangeRatePairRequest<TAuth>} requestParameters Request parameters.
5654
- * @param {*} [options] Override http request option.
5655
- * @throws {RequiredError}
5656
- */
5657
- async getCurrencyExchangeRatePair(requestParameters, options) {
5658
- return createRequestFunction(await localVarAxiosParamCreator.getCurrencyExchangeRatePair(requestParameters.currencyPair, options), globalAxios, BASE_PATH, configuration, {
5659
- authModes: ["commercialApiKey", "personalApiKey"],
5660
- requestSigningByAuthMode: {
5661
- "commercialApiKey": {
5662
- secretParameter: "consumerKey",
5663
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
5664
- },
5665
- "personalApiKey": {
5666
- secretParameter: "consumerKey",
5667
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
5668
- }
5669
- }
5670
- });
5671
- },
5672
4759
  /**
5673
4760
  * Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
5674
4761
  * @summary Get Client Info
@@ -5692,28 +4779,6 @@ const ReferenceDataApiFp = function(configuration) {
5692
4779
  });
5693
4780
  },
5694
4781
  /**
5695
- * Return all available security types supported by SnapTrade.
5696
- * @summary List security types
5697
- * @param {*} [options] Override http request option.
5698
- * @throws {RequiredError}
5699
- */
5700
- async getSecurityTypes(...args) {
5701
- const [options] = args;
5702
- return createRequestFunction(await localVarAxiosParamCreator.getSecurityTypes(options), globalAxios, BASE_PATH, configuration, {
5703
- authModes: ["commercialApiKey", "personalApiKey"],
5704
- requestSigningByAuthMode: {
5705
- "commercialApiKey": {
5706
- secretParameter: "consumerKey",
5707
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
5708
- },
5709
- "personalApiKey": {
5710
- secretParameter: "consumerKey",
5711
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
5712
- }
5713
- }
5714
- });
5715
- },
5716
- /**
5717
4782
  * Returns a list of all supported Exchanges.
5718
4783
  * @summary Get exchanges
5719
4784
  * @param {*} [options] Override http request option.
@@ -5765,52 +4830,8 @@ const ReferenceDataApiFp = function(configuration) {
5765
4830
  * @param {*} [options] Override http request option.
5766
4831
  * @throws {RequiredError}
5767
4832
  */
5768
- async getSymbolsByTicker(requestParameters, options) {
5769
- return createRequestFunction(await localVarAxiosParamCreator.getSymbolsByTicker(requestParameters.query, options), globalAxios, BASE_PATH, configuration, {
5770
- authModes: ["commercialApiKey", "personalApiKey"],
5771
- requestSigningByAuthMode: {
5772
- "commercialApiKey": {
5773
- secretParameter: "consumerKey",
5774
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
5775
- },
5776
- "personalApiKey": {
5777
- secretParameter: "consumerKey",
5778
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
5779
- }
5780
- }
5781
- });
5782
- },
5783
- /**
5784
- * Returns a list of all defined Brokerage authorization Type objects.
5785
- * @summary Get all brokerage authorization types
5786
- * @param {ReferenceDataApiListAllBrokerageAuthorizationTypeRequest<TAuth>} requestParameters Request parameters.
5787
- * @param {*} [options] Override http request option.
5788
- * @throws {RequiredError}
5789
- */
5790
- async listAllBrokerageAuthorizationType(requestParameters = {}, options) {
5791
- return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerageAuthorizationType(requestParameters.brokerage, options), globalAxios, BASE_PATH, configuration, {
5792
- authModes: ["commercialApiKey", "personalApiKey"],
5793
- requestSigningByAuthMode: {
5794
- "commercialApiKey": {
5795
- secretParameter: "consumerKey",
5796
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
5797
- },
5798
- "personalApiKey": {
5799
- secretParameter: "consumerKey",
5800
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
5801
- }
5802
- }
5803
- });
5804
- },
5805
- /**
5806
- * Returns a list of all brokerage instruments available for a given brokerage. Not all brokerages support this. The ones that don\'t will return an empty list.
5807
- * @summary Get brokerage instruments
5808
- * @param {ReferenceDataApiListAllBrokerageInstrumentsRequest<TAuth>} requestParameters Request parameters.
5809
- * @param {*} [options] Override http request option.
5810
- * @throws {RequiredError}
5811
- */
5812
- async listAllBrokerageInstruments(requestParameters, options) {
5813
- return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerageInstruments(requestParameters.slug, options), globalAxios, BASE_PATH, configuration, {
4833
+ async getSymbolsByTicker(requestParameters, options) {
4834
+ return createRequestFunction(await localVarAxiosParamCreator.getSymbolsByTicker(requestParameters.query, options), globalAxios, BASE_PATH, configuration, {
5814
4835
  authModes: ["commercialApiKey", "personalApiKey"],
5815
4836
  requestSigningByAuthMode: {
5816
4837
  "commercialApiKey": {
@@ -5825,14 +4846,14 @@ const ReferenceDataApiFp = function(configuration) {
5825
4846
  });
5826
4847
  },
5827
4848
  /**
5828
- * Returns a list of all defined Brokerage objects.
5829
- * @summary Get brokerages
4849
+ * Returns a list of all defined Brokerage authorization Type objects.
4850
+ * @summary Get all brokerage authorization types
4851
+ * @param {ReferenceDataApiListAllBrokerageAuthorizationTypeRequest<TAuth>} requestParameters Request parameters.
5830
4852
  * @param {*} [options] Override http request option.
5831
4853
  * @throws {RequiredError}
5832
4854
  */
5833
- async listAllBrokerages(...args) {
5834
- const [options] = args;
5835
- return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerages(options), globalAxios, BASE_PATH, configuration, {
4855
+ async listAllBrokerageAuthorizationType(requestParameters = {}, options) {
4856
+ return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerageAuthorizationType(requestParameters.brokerage, options), globalAxios, BASE_PATH, configuration, {
5836
4857
  authModes: ["commercialApiKey", "personalApiKey"],
5837
4858
  requestSigningByAuthMode: {
5838
4859
  "commercialApiKey": {
@@ -5847,14 +4868,14 @@ const ReferenceDataApiFp = function(configuration) {
5847
4868
  });
5848
4869
  },
5849
4870
  /**
5850
- * Returns a list of all defined Currency objects.
5851
- * @summary Get currencies
4871
+ * Returns a list of all brokerage instruments available for a given brokerage. Not all brokerages support this. The ones that don\'t will return an empty list.
4872
+ * @summary Get brokerage instruments
4873
+ * @param {ReferenceDataApiListAllBrokerageInstrumentsRequest<TAuth>} requestParameters Request parameters.
5852
4874
  * @param {*} [options] Override http request option.
5853
4875
  * @throws {RequiredError}
5854
4876
  */
5855
- async listAllCurrencies(...args) {
5856
- const [options] = args;
5857
- return createRequestFunction(await localVarAxiosParamCreator.listAllCurrencies(options), globalAxios, BASE_PATH, configuration, {
4877
+ async listAllBrokerageInstruments(requestParameters, options) {
4878
+ return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerageInstruments(requestParameters.slug, options), globalAxios, BASE_PATH, configuration, {
5858
4879
  authModes: ["commercialApiKey", "personalApiKey"],
5859
4880
  requestSigningByAuthMode: {
5860
4881
  "commercialApiKey": {
@@ -5869,14 +4890,14 @@ const ReferenceDataApiFp = function(configuration) {
5869
4890
  });
5870
4891
  },
5871
4892
  /**
5872
- * Returns a list of all Exchange Rate Pairs for all supported Currencies.
5873
- * @summary Get currency exchange rates
4893
+ * Returns a list of all defined Brokerage objects.
4894
+ * @summary Get brokerages
5874
4895
  * @param {*} [options] Override http request option.
5875
4896
  * @throws {RequiredError}
5876
4897
  */
5877
- async listAllCurrenciesRates(...args) {
4898
+ async listAllBrokerages(...args) {
5878
4899
  const [options] = args;
5879
- return createRequestFunction(await localVarAxiosParamCreator.listAllCurrenciesRates(options), globalAxios, BASE_PATH, configuration, {
4900
+ return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerages(options), globalAxios, BASE_PATH, configuration, {
5880
4901
  authModes: ["commercialApiKey", "personalApiKey"],
5881
4902
  requestSigningByAuthMode: {
5882
4903
  "commercialApiKey": {
@@ -5922,16 +4943,6 @@ const ReferenceDataApiFp = function(configuration) {
5922
4943
  const ReferenceDataApiFactory = function(configuration, basePath, axios) {
5923
4944
  const localVarFp = ReferenceDataApiFp(configuration);
5924
4945
  return {
5925
- /**
5926
- * Returns an Exchange Rate Pair object for the specified Currency Pair.
5927
- * @summary Get exchange rate of a currency pair
5928
- * @param {ReferenceDataApiGetCurrencyExchangeRatePairRequest<TAuth>} requestParameters Request parameters.
5929
- * @param {*} [options] Override http request option.
5930
- * @throws {RequiredError}
5931
- */
5932
- getCurrencyExchangeRatePair(requestParameters, options) {
5933
- return localVarFp.getCurrencyExchangeRatePair(requestParameters, options).then((request) => request(axios, basePath));
5934
- },
5935
4946
  /**
5936
4947
  * Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
5937
4948
  * @summary Get Client Info
@@ -5942,15 +4953,6 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios) {
5942
4953
  return localVarFp.getPartnerInfo(...args).then((request) => request(axios, basePath));
5943
4954
  },
5944
4955
  /**
5945
- * Return all available security types supported by SnapTrade.
5946
- * @summary List security types
5947
- * @param {*} [options] Override http request option.
5948
- * @throws {RequiredError}
5949
- */
5950
- getSecurityTypes(...args) {
5951
- return localVarFp.getSecurityTypes(...args).then((request) => request(axios, basePath));
5952
- },
5953
- /**
5954
4956
  * Returns a list of all supported Exchanges.
5955
4957
  * @summary Get exchanges
5956
4958
  * @param {*} [options] Override http request option.
@@ -6009,24 +5011,6 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios) {
6009
5011
  return localVarFp.listAllBrokerages(...args).then((request) => request(axios, basePath));
6010
5012
  },
6011
5013
  /**
6012
- * Returns a list of all defined Currency objects.
6013
- * @summary Get currencies
6014
- * @param {*} [options] Override http request option.
6015
- * @throws {RequiredError}
6016
- */
6017
- listAllCurrencies(...args) {
6018
- return localVarFp.listAllCurrencies(...args).then((request) => request(axios, basePath));
6019
- },
6020
- /**
6021
- * Returns a list of all Exchange Rate Pairs for all supported Currencies.
6022
- * @summary Get currency exchange rates
6023
- * @param {*} [options] Override http request option.
6024
- * @throws {RequiredError}
6025
- */
6026
- listAllCurrenciesRates(...args) {
6027
- return localVarFp.listAllCurrenciesRates(...args).then((request) => request(axios, basePath));
6028
- },
6029
- /**
6030
5014
  * Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned. The search results are further limited to the symbols supported by the brokerage for which the account is under.
6031
5015
  * @summary Search account symbols
6032
5016
  * @param {ReferenceDataApiSymbolSearchUserAccountRequest<TAuth>} requestParameters Request parameters.
@@ -6045,17 +5029,6 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios) {
6045
5029
  * @extends {BaseAPI}
6046
5030
  */
6047
5031
  var ReferenceDataApiGenerated = class extends BaseAPI {
6048
- /**
6049
- * Returns an Exchange Rate Pair object for the specified Currency Pair.
6050
- * @summary Get exchange rate of a currency pair
6051
- * @param {ReferenceDataApiGetCurrencyExchangeRatePairRequest<TAuth>} requestParameters Request parameters.
6052
- * @param {*} [options] Override http request option.
6053
- * @throws {RequiredError}
6054
- * @memberof ReferenceDataApiGenerated
6055
- */
6056
- getCurrencyExchangeRatePair(requestParameters, options) {
6057
- return ReferenceDataApiFp(this.configuration).getCurrencyExchangeRatePair(requestParameters, options).then((request) => request(this.axios, this.basePath));
6058
- }
6059
5032
  /**
6060
5033
  * Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
6061
5034
  * @summary Get Client Info
@@ -6067,16 +5040,6 @@ var ReferenceDataApiGenerated = class extends BaseAPI {
6067
5040
  return ReferenceDataApiFp(this.configuration).getPartnerInfo(...args).then((request) => request(this.axios, this.basePath));
6068
5041
  }
6069
5042
  /**
6070
- * Return all available security types supported by SnapTrade.
6071
- * @summary List security types
6072
- * @param {*} [options] Override http request option.
6073
- * @throws {RequiredError}
6074
- * @memberof ReferenceDataApiGenerated
6075
- */
6076
- getSecurityTypes(...args) {
6077
- return ReferenceDataApiFp(this.configuration).getSecurityTypes(...args).then((request) => request(this.axios, this.basePath));
6078
- }
6079
- /**
6080
5043
  * Returns a list of all supported Exchanges.
6081
5044
  * @summary Get exchanges
6082
5045
  * @param {*} [options] Override http request option.
@@ -6141,26 +5104,6 @@ var ReferenceDataApiGenerated = class extends BaseAPI {
6141
5104
  return ReferenceDataApiFp(this.configuration).listAllBrokerages(...args).then((request) => request(this.axios, this.basePath));
6142
5105
  }
6143
5106
  /**
6144
- * Returns a list of all defined Currency objects.
6145
- * @summary Get currencies
6146
- * @param {*} [options] Override http request option.
6147
- * @throws {RequiredError}
6148
- * @memberof ReferenceDataApiGenerated
6149
- */
6150
- listAllCurrencies(...args) {
6151
- return ReferenceDataApiFp(this.configuration).listAllCurrencies(...args).then((request) => request(this.axios, this.basePath));
6152
- }
6153
- /**
6154
- * Returns a list of all Exchange Rate Pairs for all supported Currencies.
6155
- * @summary Get currency exchange rates
6156
- * @param {*} [options] Override http request option.
6157
- * @throws {RequiredError}
6158
- * @memberof ReferenceDataApiGenerated
6159
- */
6160
- listAllCurrenciesRates(...args) {
6161
- return ReferenceDataApiFp(this.configuration).listAllCurrenciesRates(...args).then((request) => request(this.axios, this.basePath));
6162
- }
6163
- /**
6164
5107
  * Returns a list of Universal Symbol objects that match the given query. The matching takes into consideration both the ticker and the name of the symbol. Only the first 20 results are returned. The search results are further limited to the symbols supported by the brokerage for which the account is under.
6165
5108
  * @summary Search account symbols
6166
5109
  * @param {ReferenceDataApiSymbolSearchUserAccountRequest<TAuth>} requestParameters Request parameters.
@@ -6262,85 +5205,6 @@ const TradingApiAxiosParamCreator = function(configuration) {
6262
5205
  };
6263
5206
  },
6264
5207
  /**
6265
- * **Deprecated.** Use [the new cancel order endpoint](/reference/Trading/Trading_cancelOrder) instead. Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
6266
- * @summary Cancel equity order
6267
- * @param {string} accountId
6268
- * @param {AccountInformationGetUserAccountOrderDetailRequest} accountInformationGetUserAccountOrderDetailRequest
6269
- * @param {string} [userId]
6270
- * @param {string} [userSecret]
6271
- * @param {*} [options] Override http request option.
6272
- * @deprecated
6273
- * @throws {RequiredError}
6274
- */
6275
- cancelUserAccountOrder: async (accountId, accountInformationGetUserAccountOrderDetailRequest, userId, userSecret, options = {}) => {
6276
- assertParamExists("cancelUserAccountOrder", "accountId", accountId);
6277
- assertParamExists("cancelUserAccountOrder", "accountInformationGetUserAccountOrderDetailRequest", accountInformationGetUserAccountOrderDetailRequest);
6278
- const localVarPath = `/accounts/{accountId}/orders/cancel`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
6279
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
6280
- let baseOptions;
6281
- if (configuration) baseOptions = configuration.baseOptions;
6282
- const localVarRequestOptions = {
6283
- method: "POST",
6284
- ...baseOptions,
6285
- ...options
6286
- };
6287
- const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
6288
- const localVarQueryParameter = {};
6289
- if (configuration?.authMode === "commercialApiKey") {
6290
- await setApiKeyToObject({
6291
- object: localVarQueryParameter,
6292
- key: "clientId",
6293
- keyParamName: "clientId",
6294
- configuration
6295
- });
6296
- if (userId !== void 0) localVarQueryParameter["userId"] = userId;
6297
- if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
6298
- }
6299
- if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
6300
- object: localVarQueryParameter,
6301
- key: "clientId",
6302
- keyParamName: "clientId",
6303
- configuration
6304
- });
6305
- const localVarOperationAuth = {
6306
- authModes: ["commercialApiKey", "personalApiKey"],
6307
- requestSigningByAuthMode: {
6308
- "commercialApiKey": {
6309
- secretParameter: "consumerKey",
6310
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
6311
- },
6312
- "personalApiKey": {
6313
- secretParameter: "consumerKey",
6314
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
6315
- }
6316
- },
6317
- selectedAuthMode: configuration?.authMode
6318
- };
6319
- localVarHeaderParameter["Content-Type"] = "application/json";
6320
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
6321
- localVarRequestOptions.headers = {
6322
- ...localVarHeaderParameter,
6323
- ...headersFromBaseOptions,
6324
- ...options.headers
6325
- };
6326
- requestBeforeHook({
6327
- requestBody: accountInformationGetUserAccountOrderDetailRequest,
6328
- queryParameters: localVarQueryParameter,
6329
- requestConfig: localVarRequestOptions,
6330
- path: localVarPath,
6331
- configuration,
6332
- pathTemplate: "/accounts/{accountId}/orders/cancel",
6333
- httpMethod: "POST",
6334
- operationAuth: localVarOperationAuth
6335
- });
6336
- localVarRequestOptions.data = serializeDataIfNeeded(accountInformationGetUserAccountOrderDetailRequest, localVarRequestOptions, configuration);
6337
- setSearchParams(localVarUrlObj, localVarQueryParameter);
6338
- return {
6339
- url: toPathString(localVarUrlObj),
6340
- options: localVarRequestOptions
6341
- };
6342
- },
6343
- /**
6344
5208
  * Gets a quote for the specified account.
6345
5209
  * @summary Get crypto pair quote
6346
5210
  * @param {string} accountId
@@ -6724,85 +5588,6 @@ const TradingApiAxiosParamCreator = function(configuration) {
6724
5588
  };
6725
5589
  },
6726
5590
  /**
6727
- * **Deprecated.** Use [the new complex order endpoint](/reference/Trading/Trading_placeComplexOrder) instead. Places a bracket order (entry order + OCO of stop loss and take profit). Disabled by default please contact support for use. Only supported on certain brokerages
6728
- * @summary Place bracket order
6729
- * @param {string} accountId The ID of the account to execute the trade on.
6730
- * @param {ManualTradeFormBracket} manualTradeFormBracket
6731
- * @param {string} [userId]
6732
- * @param {string} [userSecret]
6733
- * @param {*} [options] Override http request option.
6734
- * @deprecated
6735
- * @throws {RequiredError}
6736
- */
6737
- placeBracketOrder: async (accountId, manualTradeFormBracket, userId, userSecret, options = {}) => {
6738
- assertParamExists("placeBracketOrder", "accountId", accountId);
6739
- assertParamExists("placeBracketOrder", "manualTradeFormBracket", manualTradeFormBracket);
6740
- const localVarPath = `/accounts/{accountId}/trading/bracket`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
6741
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
6742
- let baseOptions;
6743
- if (configuration) baseOptions = configuration.baseOptions;
6744
- const localVarRequestOptions = {
6745
- method: "POST",
6746
- ...baseOptions,
6747
- ...options
6748
- };
6749
- const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
6750
- const localVarQueryParameter = {};
6751
- if (configuration?.authMode === "commercialApiKey") {
6752
- await setApiKeyToObject({
6753
- object: localVarQueryParameter,
6754
- key: "clientId",
6755
- keyParamName: "clientId",
6756
- configuration
6757
- });
6758
- if (userId !== void 0) localVarQueryParameter["userId"] = userId;
6759
- if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
6760
- }
6761
- if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
6762
- object: localVarQueryParameter,
6763
- key: "clientId",
6764
- keyParamName: "clientId",
6765
- configuration
6766
- });
6767
- const localVarOperationAuth = {
6768
- authModes: ["commercialApiKey", "personalApiKey"],
6769
- requestSigningByAuthMode: {
6770
- "commercialApiKey": {
6771
- secretParameter: "consumerKey",
6772
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
6773
- },
6774
- "personalApiKey": {
6775
- secretParameter: "consumerKey",
6776
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
6777
- }
6778
- },
6779
- selectedAuthMode: configuration?.authMode
6780
- };
6781
- localVarHeaderParameter["Content-Type"] = "application/json";
6782
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
6783
- localVarRequestOptions.headers = {
6784
- ...localVarHeaderParameter,
6785
- ...headersFromBaseOptions,
6786
- ...options.headers
6787
- };
6788
- requestBeforeHook({
6789
- requestBody: manualTradeFormBracket,
6790
- queryParameters: localVarQueryParameter,
6791
- requestConfig: localVarRequestOptions,
6792
- path: localVarPath,
6793
- configuration,
6794
- pathTemplate: "/accounts/{accountId}/trading/bracket",
6795
- httpMethod: "POST",
6796
- operationAuth: localVarOperationAuth
6797
- });
6798
- localVarRequestOptions.data = serializeDataIfNeeded(manualTradeFormBracket, localVarRequestOptions, configuration);
6799
- setSearchParams(localVarUrlObj, localVarQueryParameter);
6800
- return {
6801
- url: toPathString(localVarUrlObj),
6802
- options: localVarRequestOptions
6803
- };
6804
- },
6805
- /**
6806
5591
  * Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
6807
5592
  * @summary Place complex order
6808
5593
  * @param {string} accountId The ID of the account to execute the trade on.
@@ -7455,30 +6240,6 @@ const TradingApiFp = function(configuration) {
7455
6240
  });
7456
6241
  },
7457
6242
  /**
7458
- * **Deprecated.** Use [the new cancel order endpoint](/reference/Trading/Trading_cancelOrder) instead. Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
7459
- * @summary Cancel equity order
7460
- * @param {TradingApiCancelUserAccountOrderRequest<TAuth>} requestParameters Request parameters.
7461
- * @param {*} [options] Override http request option.
7462
- * @deprecated
7463
- * @throws {RequiredError}
7464
- */
7465
- async cancelUserAccountOrder(requestParameters, options) {
7466
- const accountInformationGetUserAccountOrderDetailRequest = { brokerage_order_id: requestParameters.brokerage_order_id };
7467
- return createRequestFunction(await localVarAxiosParamCreator.cancelUserAccountOrder(requestParameters.accountId, accountInformationGetUserAccountOrderDetailRequest, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
7468
- authModes: ["commercialApiKey", "personalApiKey"],
7469
- requestSigningByAuthMode: {
7470
- "commercialApiKey": {
7471
- secretParameter: "consumerKey",
7472
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
7473
- },
7474
- "personalApiKey": {
7475
- secretParameter: "consumerKey",
7476
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
7477
- }
7478
- }
7479
- });
7480
- },
7481
- /**
7482
6243
  * Gets a quote for the specified account.
7483
6244
  * @summary Get crypto pair quote
7484
6245
  * @param {TradingApiGetCryptocurrencyPairQuoteRequest<TAuth>} requestParameters Request parameters.
@@ -7590,44 +6351,10 @@ const TradingApiFp = function(configuration) {
7590
6351
  * @summary Get equity symbol quotes
7591
6352
  * @param {TradingApiGetUserAccountQuotesRequest<TAuth>} requestParameters Request parameters.
7592
6353
  * @param {*} [options] Override http request option.
7593
- * @throws {RequiredError}
7594
- */
7595
- async getUserAccountQuotes(requestParameters, options) {
7596
- return createRequestFunction(await localVarAxiosParamCreator.getUserAccountQuotes(requestParameters.symbols, requestParameters.accountId, requestParameters.useTicker, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
7597
- authModes: ["commercialApiKey", "personalApiKey"],
7598
- requestSigningByAuthMode: {
7599
- "commercialApiKey": {
7600
- secretParameter: "consumerKey",
7601
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
7602
- },
7603
- "personalApiKey": {
7604
- secretParameter: "consumerKey",
7605
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
7606
- }
7607
- }
7608
- });
7609
- },
7610
- /**
7611
- * **Deprecated.** Use [the new complex order endpoint](/reference/Trading/Trading_placeComplexOrder) instead. Places a bracket order (entry order + OCO of stop loss and take profit). Disabled by default please contact support for use. Only supported on certain brokerages
7612
- * @summary Place bracket order
7613
- * @param {TradingApiPlaceBracketOrderRequest<TAuth>} requestParameters Request parameters.
7614
- * @param {*} [options] Override http request option.
7615
- * @deprecated
7616
- * @throws {RequiredError}
7617
- */
7618
- async placeBracketOrder(requestParameters, options) {
7619
- const manualTradeFormBracket = {
7620
- action: requestParameters.action,
7621
- instrument: requestParameters.instrument,
7622
- order_type: requestParameters.order_type,
7623
- time_in_force: requestParameters.time_in_force,
7624
- price: requestParameters.price,
7625
- stop: requestParameters.stop,
7626
- units: requestParameters.units,
7627
- stop_loss: requestParameters.stop_loss,
7628
- take_profit: requestParameters.take_profit
7629
- };
7630
- return createRequestFunction(await localVarAxiosParamCreator.placeBracketOrder(requestParameters.accountId, manualTradeFormBracket, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
6354
+ * @throws {RequiredError}
6355
+ */
6356
+ async getUserAccountQuotes(requestParameters, options) {
6357
+ return createRequestFunction(await localVarAxiosParamCreator.getUserAccountQuotes(requestParameters.symbols, requestParameters.accountId, requestParameters.useTicker, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
7631
6358
  authModes: ["commercialApiKey", "personalApiKey"],
7632
6359
  requestSigningByAuthMode: {
7633
6360
  "commercialApiKey": {
@@ -7898,17 +6625,6 @@ const TradingApiFactory = function(configuration, basePath, axios) {
7898
6625
  return localVarFp.cancelOrder(requestParameters, options).then((request) => request(axios, basePath));
7899
6626
  },
7900
6627
  /**
7901
- * **Deprecated.** Use [the new cancel order endpoint](/reference/Trading/Trading_cancelOrder) instead. Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
7902
- * @summary Cancel equity order
7903
- * @param {TradingApiCancelUserAccountOrderRequest<TAuth>} requestParameters Request parameters.
7904
- * @param {*} [options] Override http request option.
7905
- * @deprecated
7906
- * @throws {RequiredError}
7907
- */
7908
- cancelUserAccountOrder(requestParameters, options) {
7909
- return localVarFp.cancelUserAccountOrder(requestParameters, options).then((request) => request(axios, basePath));
7910
- },
7911
- /**
7912
6628
  * Gets a quote for the specified account.
7913
6629
  * @summary Get crypto pair quote
7914
6630
  * @param {TradingApiGetCryptocurrencyPairQuoteRequest<TAuth>} requestParameters Request parameters.
@@ -7959,17 +6675,6 @@ const TradingApiFactory = function(configuration, basePath, axios) {
7959
6675
  return localVarFp.getUserAccountQuotes(requestParameters, options).then((request) => request(axios, basePath));
7960
6676
  },
7961
6677
  /**
7962
- * **Deprecated.** Use [the new complex order endpoint](/reference/Trading/Trading_placeComplexOrder) instead. Places a bracket order (entry order + OCO of stop loss and take profit). Disabled by default please contact support for use. Only supported on certain brokerages
7963
- * @summary Place bracket order
7964
- * @param {TradingApiPlaceBracketOrderRequest<TAuth>} requestParameters Request parameters.
7965
- * @param {*} [options] Override http request option.
7966
- * @deprecated
7967
- * @throws {RequiredError}
7968
- */
7969
- placeBracketOrder(requestParameters, options) {
7970
- return localVarFp.placeBracketOrder(requestParameters, options).then((request) => request(axios, basePath));
7971
- },
7972
- /**
7973
6678
  * Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
7974
6679
  * @summary Place complex order
7975
6680
  * @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
@@ -8070,18 +6775,6 @@ var TradingApiGenerated = class extends BaseAPI {
8070
6775
  return TradingApiFp(this.configuration).cancelOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
8071
6776
  }
8072
6777
  /**
8073
- * **Deprecated.** Use [the new cancel order endpoint](/reference/Trading/Trading_cancelOrder) instead. Attempts to cancel an open order with the brokerage. If the order is no longer cancellable, the request will be rejected.
8074
- * @summary Cancel equity order
8075
- * @param {TradingApiCancelUserAccountOrderRequest<TAuth>} requestParameters Request parameters.
8076
- * @param {*} [options] Override http request option.
8077
- * @deprecated
8078
- * @throws {RequiredError}
8079
- * @memberof TradingApiGenerated
8080
- */
8081
- cancelUserAccountOrder(requestParameters, options) {
8082
- return TradingApiFp(this.configuration).cancelUserAccountOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
8083
- }
8084
- /**
8085
6778
  * Gets a quote for the specified account.
8086
6779
  * @summary Get crypto pair quote
8087
6780
  * @param {TradingApiGetCryptocurrencyPairQuoteRequest<TAuth>} requestParameters Request parameters.
@@ -8137,18 +6830,6 @@ var TradingApiGenerated = class extends BaseAPI {
8137
6830
  return TradingApiFp(this.configuration).getUserAccountQuotes(requestParameters, options).then((request) => request(this.axios, this.basePath));
8138
6831
  }
8139
6832
  /**
8140
- * **Deprecated.** Use [the new complex order endpoint](/reference/Trading/Trading_placeComplexOrder) instead. Places a bracket order (entry order + OCO of stop loss and take profit). Disabled by default please contact support for use. Only supported on certain brokerages
8141
- * @summary Place bracket order
8142
- * @param {TradingApiPlaceBracketOrderRequest<TAuth>} requestParameters Request parameters.
8143
- * @param {*} [options] Override http request option.
8144
- * @deprecated
8145
- * @throws {RequiredError}
8146
- * @memberof TradingApiGenerated
8147
- */
8148
- placeBracketOrder(requestParameters, options) {
8149
- return TradingApiFp(this.configuration).placeBracketOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
8150
- }
8151
- /**
8152
6833
  * Places a complex conditional order (OCO, OTO, or OTOCO). Only supported on certain brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for details on which brokerages support complex orders and which types they support. - **OCO** (One Cancels the Other): Two peer orders; when one fills the other is cancelled. - **OTO** (One Triggers the Other): A trigger order that, when filled, activates a conditional order. - **OTOCO** (One Triggers a One Cancels the Other): A trigger order that, when filled, activates an OCO pair of two peer orders.
8153
6834
  * @summary Place complex order
8154
6835
  * @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
@@ -8241,303 +6922,6 @@ var TradingApiGenerated = class extends BaseAPI {
8241
6922
  //#region api/trading-api.ts
8242
6923
  var TradingApi = class extends TradingApiGenerated {};
8243
6924
  //#endregion
8244
- //#region api/transactions-and-reporting-api-generated.ts
8245
- /**
8246
- * TransactionsAndReportingApi - axios parameter creator
8247
- * @export
8248
- */
8249
- const TransactionsAndReportingApiAxiosParamCreator = function(configuration) {
8250
- return {
8251
- /**
8252
- * **Deprecated.** Use [the account level endpoint](/reference/Account%20Information/AccountInformation_getAccountActivities) instead, if possible. This endpoint will return HTTP 410 Gone for all customers that sign up after April 25, 2026. Returns all historical transactions for the specified user and filtering criteria. It\'s recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There\'s a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. This endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage.
8253
- * @summary Get transaction history for a user
8254
- * @param {string | Date} [startDate] The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on &#x60;trade_date&#x60;.
8255
- * @param {string | Date} [endDate] The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on &#x60;trade_date&#x60;.
8256
- * @param {string} [accounts] Optional comma separated list of SnapTrade Account IDs used to filter the request to specific accounts. If not provided, the default is all known brokerage accounts for the user. The &#x60;brokerageAuthorizations&#x60; parameter takes precedence over this parameter.
8257
- * @param {string} [brokerageAuthorizations] Optional comma separated list of SnapTrade Connection (Brokerage Authorization) IDs used to filter the request to only accounts that belong to those connections. If not provided, the default is all connections for the user. This parameter takes precedence over the &#x60;accounts&#x60; parameter.
8258
- * @param {string} [type] Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - &#x60;BUY&#x60; - Asset bought. - &#x60;SELL&#x60; - Asset sold. - &#x60;DIVIDEND&#x60; - Dividend payout. - &#x60;SUBSTITUTE_DIVIDEND&#x60; - Payment in lieu of a dividend. - &#x60;CONTRIBUTION&#x60; - Cash contribution. - &#x60;WITHDRAWAL&#x60; - Cash withdrawal. - &#x60;REI&#x60; - Dividend reinvestment. - &#x60;INTEREST&#x60; - Interest deposited into the account. - &#x60;FEE&#x60; - Fee withdrawn from the account. - &#x60;OPTIONEXPIRATION&#x60; - Option expiration event. - &#x60;OPTIONASSIGNMENT&#x60; - Option assignment event. - &#x60;OPTIONEXERCISE&#x60; - Option exercise event. - &#x60;TRANSFER&#x60; - Transfer of assets from one account to another
8259
- * @param {string} [userId]
8260
- * @param {string} [userSecret]
8261
- * @param {*} [options] Override http request option.
8262
- * @deprecated
8263
- * @throws {RequiredError}
8264
- */
8265
- getActivities: async (startDate, endDate, accounts, brokerageAuthorizations, type, userId, userSecret, options = {}) => {
8266
- const localVarPath = `/activities`;
8267
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
8268
- let baseOptions;
8269
- if (configuration) baseOptions = configuration.baseOptions;
8270
- const localVarRequestOptions = {
8271
- method: "GET",
8272
- ...baseOptions,
8273
- ...options
8274
- };
8275
- const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
8276
- const localVarQueryParameter = {};
8277
- if (configuration?.authMode === "commercialApiKey") {
8278
- await setApiKeyToObject({
8279
- object: localVarQueryParameter,
8280
- key: "clientId",
8281
- keyParamName: "clientId",
8282
- configuration
8283
- });
8284
- if (userId !== void 0) localVarQueryParameter["userId"] = userId;
8285
- if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
8286
- }
8287
- if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
8288
- object: localVarQueryParameter,
8289
- key: "clientId",
8290
- keyParamName: "clientId",
8291
- configuration
8292
- });
8293
- if (startDate !== void 0) localVarQueryParameter["startDate"] = startDate instanceof Date ? startDate.toISOString().substr(0, 10) : startDate;
8294
- if (endDate !== void 0) localVarQueryParameter["endDate"] = endDate instanceof Date ? endDate.toISOString().substr(0, 10) : endDate;
8295
- if (accounts !== void 0) localVarQueryParameter["accounts"] = accounts;
8296
- if (brokerageAuthorizations !== void 0) localVarQueryParameter["brokerageAuthorizations"] = brokerageAuthorizations;
8297
- if (type !== void 0) localVarQueryParameter["type"] = type;
8298
- const localVarOperationAuth = {
8299
- authModes: ["commercialApiKey", "personalApiKey"],
8300
- requestSigningByAuthMode: {
8301
- "commercialApiKey": {
8302
- secretParameter: "consumerKey",
8303
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
8304
- },
8305
- "personalApiKey": {
8306
- secretParameter: "consumerKey",
8307
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
8308
- }
8309
- },
8310
- selectedAuthMode: configuration?.authMode
8311
- };
8312
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
8313
- localVarRequestOptions.headers = {
8314
- ...localVarHeaderParameter,
8315
- ...headersFromBaseOptions,
8316
- ...options.headers
8317
- };
8318
- requestBeforeHook({
8319
- queryParameters: localVarQueryParameter,
8320
- requestConfig: localVarRequestOptions,
8321
- path: localVarPath,
8322
- configuration,
8323
- pathTemplate: "/activities",
8324
- httpMethod: "GET",
8325
- operationAuth: localVarOperationAuth
8326
- });
8327
- setSearchParams(localVarUrlObj, localVarQueryParameter);
8328
- return {
8329
- url: toPathString(localVarUrlObj),
8330
- options: localVarRequestOptions
8331
- };
8332
- },
8333
- /**
8334
- * **Deprecated.** Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Please note that Total Equity Timeframe and Rate of Returns are experimental features. Please contact support@snaptrade.com if you notice any inconsistencies.
8335
- * @summary Get performance information for a specific timeframe
8336
- * @param {string | Date} startDate
8337
- * @param {string | Date} endDate
8338
- * @param {string} [accounts] Optional comma separated list of account IDs used to filter the request on specific accounts
8339
- * @param {boolean} [detailed] Optional, increases frequency of data points for the total value and contribution charts if set to true
8340
- * @param {string} [frequency] Optional frequency for the rate of return chart (defaults to monthly). Possible values are daily, weekly, monthly, quarterly, yearly.
8341
- * @param {string} [userId]
8342
- * @param {string} [userSecret]
8343
- * @param {*} [options] Override http request option.
8344
- * @deprecated
8345
- * @throws {RequiredError}
8346
- */
8347
- getReportingCustomRange: async (startDate, endDate, accounts, detailed, frequency, userId, userSecret, options = {}) => {
8348
- assertParamExists("getReportingCustomRange", "startDate", startDate);
8349
- assertParamExists("getReportingCustomRange", "endDate", endDate);
8350
- const localVarPath = `/performance/custom`;
8351
- const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
8352
- let baseOptions;
8353
- if (configuration) baseOptions = configuration.baseOptions;
8354
- const localVarRequestOptions = {
8355
- method: "GET",
8356
- ...baseOptions,
8357
- ...options
8358
- };
8359
- const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
8360
- const localVarQueryParameter = {};
8361
- if (configuration?.authMode === "commercialApiKey") {
8362
- await setApiKeyToObject({
8363
- object: localVarQueryParameter,
8364
- key: "clientId",
8365
- keyParamName: "clientId",
8366
- configuration
8367
- });
8368
- if (userId !== void 0) localVarQueryParameter["userId"] = userId;
8369
- if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
8370
- }
8371
- if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
8372
- object: localVarQueryParameter,
8373
- key: "clientId",
8374
- keyParamName: "clientId",
8375
- configuration
8376
- });
8377
- if (startDate !== void 0) localVarQueryParameter["startDate"] = startDate instanceof Date ? startDate.toISOString().substr(0, 10) : startDate;
8378
- if (endDate !== void 0) localVarQueryParameter["endDate"] = endDate instanceof Date ? endDate.toISOString().substr(0, 10) : endDate;
8379
- if (accounts !== void 0) localVarQueryParameter["accounts"] = accounts;
8380
- if (detailed !== void 0) localVarQueryParameter["detailed"] = detailed;
8381
- if (frequency !== void 0) localVarQueryParameter["frequency"] = frequency;
8382
- const localVarOperationAuth = {
8383
- authModes: ["commercialApiKey", "personalApiKey"],
8384
- requestSigningByAuthMode: {
8385
- "commercialApiKey": {
8386
- secretParameter: "consumerKey",
8387
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
8388
- },
8389
- "personalApiKey": {
8390
- secretParameter: "consumerKey",
8391
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
8392
- }
8393
- },
8394
- selectedAuthMode: configuration?.authMode
8395
- };
8396
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
8397
- localVarRequestOptions.headers = {
8398
- ...localVarHeaderParameter,
8399
- ...headersFromBaseOptions,
8400
- ...options.headers
8401
- };
8402
- requestBeforeHook({
8403
- queryParameters: localVarQueryParameter,
8404
- requestConfig: localVarRequestOptions,
8405
- path: localVarPath,
8406
- configuration,
8407
- pathTemplate: "/performance/custom",
8408
- httpMethod: "GET",
8409
- operationAuth: localVarOperationAuth
8410
- });
8411
- setSearchParams(localVarUrlObj, localVarQueryParameter);
8412
- return {
8413
- url: toPathString(localVarUrlObj),
8414
- options: localVarRequestOptions
8415
- };
8416
- }
8417
- };
8418
- };
8419
- /**
8420
- * TransactionsAndReportingApi - functional programming interface
8421
- * @export
8422
- */
8423
- const TransactionsAndReportingApiFp = function(configuration) {
8424
- const localVarAxiosParamCreator = TransactionsAndReportingApiAxiosParamCreator(configuration);
8425
- return {
8426
- /**
8427
- * **Deprecated.** Use [the account level endpoint](/reference/Account%20Information/AccountInformation_getAccountActivities) instead, if possible. This endpoint will return HTTP 410 Gone for all customers that sign up after April 25, 2026. Returns all historical transactions for the specified user and filtering criteria. It\'s recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There\'s a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. This endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage.
8428
- * @summary Get transaction history for a user
8429
- * @param {TransactionsAndReportingApiGetActivitiesRequest<TAuth>} requestParameters Request parameters.
8430
- * @param {*} [options] Override http request option.
8431
- * @deprecated
8432
- * @throws {RequiredError}
8433
- */
8434
- async getActivities(requestParameters = {}, options) {
8435
- return createRequestFunction(await localVarAxiosParamCreator.getActivities(requestParameters.startDate, requestParameters.endDate, requestParameters.accounts, requestParameters.brokerageAuthorizations, requestParameters.type, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
8436
- authModes: ["commercialApiKey", "personalApiKey"],
8437
- requestSigningByAuthMode: {
8438
- "commercialApiKey": {
8439
- secretParameter: "consumerKey",
8440
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
8441
- },
8442
- "personalApiKey": {
8443
- secretParameter: "consumerKey",
8444
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
8445
- }
8446
- }
8447
- });
8448
- },
8449
- /**
8450
- * **Deprecated.** Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Please note that Total Equity Timeframe and Rate of Returns are experimental features. Please contact support@snaptrade.com if you notice any inconsistencies.
8451
- * @summary Get performance information for a specific timeframe
8452
- * @param {TransactionsAndReportingApiGetReportingCustomRangeRequest<TAuth>} requestParameters Request parameters.
8453
- * @param {*} [options] Override http request option.
8454
- * @deprecated
8455
- * @throws {RequiredError}
8456
- */
8457
- async getReportingCustomRange(requestParameters, options) {
8458
- return createRequestFunction(await localVarAxiosParamCreator.getReportingCustomRange(requestParameters.startDate, requestParameters.endDate, requestParameters.accounts, requestParameters.detailed, requestParameters.frequency, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
8459
- authModes: ["commercialApiKey", "personalApiKey"],
8460
- requestSigningByAuthMode: {
8461
- "commercialApiKey": {
8462
- secretParameter: "consumerKey",
8463
- signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
8464
- },
8465
- "personalApiKey": {
8466
- secretParameter: "consumerKey",
8467
- signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
8468
- }
8469
- }
8470
- });
8471
- }
8472
- };
8473
- };
8474
- /**
8475
- * TransactionsAndReportingApi - factory interface
8476
- * @export
8477
- */
8478
- const TransactionsAndReportingApiFactory = function(configuration, basePath, axios) {
8479
- const localVarFp = TransactionsAndReportingApiFp(configuration);
8480
- return {
8481
- /**
8482
- * **Deprecated.** Use [the account level endpoint](/reference/Account%20Information/AccountInformation_getAccountActivities) instead, if possible. This endpoint will return HTTP 410 Gone for all customers that sign up after April 25, 2026. Returns all historical transactions for the specified user and filtering criteria. It\'s recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There\'s a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. This endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage.
8483
- * @summary Get transaction history for a user
8484
- * @param {TransactionsAndReportingApiGetActivitiesRequest<TAuth>} requestParameters Request parameters.
8485
- * @param {*} [options] Override http request option.
8486
- * @deprecated
8487
- * @throws {RequiredError}
8488
- */
8489
- getActivities(requestParameters = {}, options) {
8490
- return localVarFp.getActivities(requestParameters, options).then((request) => request(axios, basePath));
8491
- },
8492
- /**
8493
- * **Deprecated.** Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Please note that Total Equity Timeframe and Rate of Returns are experimental features. Please contact support@snaptrade.com if you notice any inconsistencies.
8494
- * @summary Get performance information for a specific timeframe
8495
- * @param {TransactionsAndReportingApiGetReportingCustomRangeRequest<TAuth>} requestParameters Request parameters.
8496
- * @param {*} [options] Override http request option.
8497
- * @deprecated
8498
- * @throws {RequiredError}
8499
- */
8500
- getReportingCustomRange(requestParameters, options) {
8501
- return localVarFp.getReportingCustomRange(requestParameters, options).then((request) => request(axios, basePath));
8502
- }
8503
- };
8504
- };
8505
- /**
8506
- * TransactionsAndReportingApiGenerated - object-oriented interface
8507
- * @export
8508
- * @class TransactionsAndReportingApiGenerated
8509
- * @extends {BaseAPI}
8510
- */
8511
- var TransactionsAndReportingApiGenerated = class extends BaseAPI {
8512
- /**
8513
- * **Deprecated.** Use [the account level endpoint](/reference/Account%20Information/AccountInformation_getAccountActivities) instead, if possible. This endpoint will return HTTP 410 Gone for all customers that sign up after April 25, 2026. Returns all historical transactions for the specified user and filtering criteria. It\'s recommended to use `startDate` and `endDate` to paginate through the data, as the response may be very large for accounts with a long history and/or a lot of activity. There\'s a max number of 10000 transactions returned per request. There is no guarantee to the ordering of the transactions returned. Please sort the transactions based on the `trade_date` field if you need them in a specific order. This endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage.
8514
- * @summary Get transaction history for a user
8515
- * @param {TransactionsAndReportingApiGetActivitiesRequest<TAuth>} requestParameters Request parameters.
8516
- * @param {*} [options] Override http request option.
8517
- * @deprecated
8518
- * @throws {RequiredError}
8519
- * @memberof TransactionsAndReportingApiGenerated
8520
- */
8521
- getActivities(requestParameters = {}, options) {
8522
- return TransactionsAndReportingApiFp(this.configuration).getActivities(requestParameters, options).then((request) => request(this.axios, this.basePath));
8523
- }
8524
- /**
8525
- * **Deprecated.** Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Please note that Total Equity Timeframe and Rate of Returns are experimental features. Please contact support@snaptrade.com if you notice any inconsistencies.
8526
- * @summary Get performance information for a specific timeframe
8527
- * @param {TransactionsAndReportingApiGetReportingCustomRangeRequest<TAuth>} requestParameters Request parameters.
8528
- * @param {*} [options] Override http request option.
8529
- * @deprecated
8530
- * @throws {RequiredError}
8531
- * @memberof TransactionsAndReportingApiGenerated
8532
- */
8533
- getReportingCustomRange(requestParameters, options) {
8534
- return TransactionsAndReportingApiFp(this.configuration).getReportingCustomRange(requestParameters, options).then((request) => request(this.axios, this.basePath));
8535
- }
8536
- };
8537
- //#endregion
8538
- //#region api/transactions-and-reporting-api.ts
8539
- var TransactionsAndReportingApi = class extends TransactionsAndReportingApiGenerated {};
8540
- //#endregion
8541
6925
  //#region auth.ts
8542
6926
  var CommercialApiKeyAuth = class CommercialApiKeyAuth {
8543
6927
  constructor(params) {
@@ -8584,7 +6968,7 @@ var Configuration = class {
8584
6968
  }
8585
6969
  this.basePath = param.basePath;
8586
6970
  this.baseOptions = param.baseOptions ?? {};
8587
- this.userAgent = param.userAgent === void 0 ? "Konfig/11.1.0/typescript" : param.userAgent;
6971
+ this.userAgent = param.userAgent === void 0 ? "Konfig/12.1.0/typescript" : param.userAgent;
8588
6972
  this.formDataCtor = param.formDataCtor;
8589
6973
  }
8590
6974
  /**
@@ -8617,11 +7001,9 @@ var Snaptrade = class extends SnaptradeCustom {
8617
7001
  this.authentication = new AuthenticationApi(configuration);
8618
7002
  this.connections = new ConnectionsApi(configuration);
8619
7003
  this.experimentalEndpoints = new ExperimentalEndpointsApi(configuration);
8620
- this.options = new OptionsApi(configuration);
8621
7004
  this.referenceData = new ReferenceDataApi(configuration);
8622
7005
  this.trading = new TradingApi(configuration);
8623
- this.transactionsAndReporting = new TransactionsAndReportingApi(configuration);
8624
7006
  }
8625
7007
  };
8626
7008
  //#endregion
8627
- export { AccountInformationApi, AccountInformationApiAxiosParamCreator, AccountInformationApiFactory, AccountInformationApiFp, AccountInformationApiGenerated, ApiStatusApi, ApiStatusApiAxiosParamCreator, ApiStatusApiFactory, ApiStatusApiFp, ApiStatusApiGenerated, AuthenticationApi, AuthenticationApiAxiosParamCreator, AuthenticationApiFactory, AuthenticationApiFp, AuthenticationApiGenerated, CommercialApiKeyAuth, Configuration, ConnectionsApi, ConnectionsApiAxiosParamCreator, ConnectionsApiFactory, ConnectionsApiFp, ConnectionsApiGenerated, ExperimentalEndpointsApi, ExperimentalEndpointsApiAxiosParamCreator, ExperimentalEndpointsApiFactory, ExperimentalEndpointsApiFp, ExperimentalEndpointsApiGenerated, OptionsApi, OptionsApiAxiosParamCreator, OptionsApiFactory, OptionsApiFp, OptionsApiGenerated, PersonalApiKeyAuth, ReferenceDataApi, ReferenceDataApiAxiosParamCreator, ReferenceDataApiFactory, ReferenceDataApiFp, ReferenceDataApiGenerated, Snaptrade, SnaptradeAuth, SnaptradeError, TradingApi, TradingApiAxiosParamCreator, TradingApiFactory, TradingApiFp, TradingApiGenerated, TransactionsAndReportingApi, TransactionsAndReportingApiAxiosParamCreator, TransactionsAndReportingApiFactory, TransactionsAndReportingApiFp, TransactionsAndReportingApiGenerated, parseIfJson, readableStreamToString };
7009
+ export { AccountInformationApi, AccountInformationApiAxiosParamCreator, AccountInformationApiFactory, AccountInformationApiFp, AccountInformationApiGenerated, ApiStatusApi, ApiStatusApiAxiosParamCreator, ApiStatusApiFactory, ApiStatusApiFp, ApiStatusApiGenerated, AuthenticationApi, AuthenticationApiAxiosParamCreator, AuthenticationApiFactory, AuthenticationApiFp, AuthenticationApiGenerated, CommercialApiKeyAuth, Configuration, ConnectionsApi, ConnectionsApiAxiosParamCreator, ConnectionsApiFactory, ConnectionsApiFp, ConnectionsApiGenerated, ExperimentalEndpointsApi, ExperimentalEndpointsApiAxiosParamCreator, ExperimentalEndpointsApiFactory, ExperimentalEndpointsApiFp, ExperimentalEndpointsApiGenerated, PersonalApiKeyAuth, ReferenceDataApi, ReferenceDataApiAxiosParamCreator, ReferenceDataApiFactory, ReferenceDataApiFp, ReferenceDataApiGenerated, Snaptrade, SnaptradeAuth, SnaptradeError, TradingApi, TradingApiAxiosParamCreator, TradingApiFactory, TradingApiFp, TradingApiGenerated, parseIfJson, readableStreamToString };