snaptrade-typescript-sdk 11.1.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -538
- package/dist/browser.umd.js +1 -1
- package/dist/index.cjs +158 -1784
- package/dist/index.d.cts +58 -898
- package/dist/index.d.mts +58 -898
- package/dist/index.d.ts +58 -898
- package/dist/index.mjs +97 -1710
- package/package.json +1 -1
- package/dist/chunk-e9Ob2GDo.mjs +0 -26
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
2
|
import globalAxios, { AxiosError } from "axios";
|
|
3
|
+
//#region \0rolldown/runtime.js
|
|
4
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
5
|
+
//#endregion
|
|
3
6
|
//#region base.ts
|
|
4
7
|
const BASE_PATH = "https://api.snaptrade.com".replace(/\/+$/, "");
|
|
5
8
|
/**
|
|
@@ -508,80 +511,6 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
508
511
|
};
|
|
509
512
|
},
|
|
510
513
|
/**
|
|
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
514
|
* 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
515
|
* @summary List account balances
|
|
587
516
|
* @param {string} accountId
|
|
@@ -883,80 +812,6 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
883
812
|
};
|
|
884
813
|
},
|
|
885
814
|
/**
|
|
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
815
|
* 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
816
|
* @summary List account recent orders (last 24 hours only)
|
|
962
817
|
* @param {string} accountId
|
|
@@ -1400,29 +1255,6 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1400
1255
|
});
|
|
1401
1256
|
},
|
|
1402
1257
|
/**
|
|
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
1258
|
* 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
1259
|
* @summary List account balances
|
|
1428
1260
|
* @param {AccountInformationApiGetUserAccountBalanceRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -1512,29 +1344,6 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1512
1344
|
});
|
|
1513
1345
|
},
|
|
1514
1346
|
/**
|
|
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
1347
|
* 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
1348
|
* @summary List account recent orders (last 24 hours only)
|
|
1540
1349
|
* @param {AccountInformationApiGetUserAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -1685,17 +1494,6 @@ const AccountInformationApiFactory = function(configuration, basePath, axios) {
|
|
|
1685
1494
|
return localVarFp.getAllAccountPositions(requestParameters, options).then((request) => request(axios, basePath));
|
|
1686
1495
|
},
|
|
1687
1496
|
/**
|
|
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
1497
|
* 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
1498
|
* @summary List account balances
|
|
1701
1499
|
* @param {AccountInformationApiGetUserAccountBalanceRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -1736,17 +1534,6 @@ const AccountInformationApiFactory = function(configuration, basePath, axios) {
|
|
|
1736
1534
|
return localVarFp.getUserAccountOrders(requestParameters, options).then((request) => request(axios, basePath));
|
|
1737
1535
|
},
|
|
1738
1536
|
/**
|
|
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
1537
|
* 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
1538
|
* @summary List account recent orders (last 24 hours only)
|
|
1752
1539
|
* @param {AccountInformationApiGetUserAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -1840,18 +1627,6 @@ var AccountInformationApiGenerated = class extends BaseAPI {
|
|
|
1840
1627
|
return AccountInformationApiFp(this.configuration).getAllAccountPositions(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1841
1628
|
}
|
|
1842
1629
|
/**
|
|
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
1630
|
* 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
1631
|
* @summary List account balances
|
|
1857
1632
|
* @param {AccountInformationApiGetUserAccountBalanceRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -1896,18 +1671,6 @@ var AccountInformationApiGenerated = class extends BaseAPI {
|
|
|
1896
1671
|
return AccountInformationApiFp(this.configuration).getUserAccountOrders(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1897
1672
|
}
|
|
1898
1673
|
/**
|
|
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
1674
|
* 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
1675
|
* @summary List account recent orders (last 24 hours only)
|
|
1913
1676
|
* @param {AccountInformationApiGetUserAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -3063,22 +2826,23 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3063
2826
|
};
|
|
3064
2827
|
},
|
|
3065
2828
|
/**
|
|
3066
|
-
*
|
|
3067
|
-
* @summary
|
|
2829
|
+
* Returns a list of rate of return percents for a given connection.
|
|
2830
|
+
* @summary List connection rate of returns
|
|
3068
2831
|
* @param {string} authorizationId
|
|
2832
|
+
* @param {string} [timeframes] Optional comma separated list of rate-of-return timeframes to return. Supported values are `ALL`, `1Y`, `YTD`, `1M`, `1W`, and `1D`. If omitted, SnapTrade returns all six supported timeframes.
|
|
3069
2833
|
* @param {string} [userId]
|
|
3070
2834
|
* @param {string} [userSecret]
|
|
3071
2835
|
* @param {*} [options] Override http request option.
|
|
3072
2836
|
* @throws {RequiredError}
|
|
3073
2837
|
*/
|
|
3074
|
-
|
|
3075
|
-
assertParamExists("
|
|
3076
|
-
const localVarPath = `/authorizations/{authorizationId}`.replace(`{authorizationId}`, encodeURIComponent(String(authorizationId !== void 0 ? authorizationId : `-authorizationId-`)));
|
|
2838
|
+
returnRates: async (authorizationId, timeframes, userId, userSecret, options = {}) => {
|
|
2839
|
+
assertParamExists("returnRates", "authorizationId", authorizationId);
|
|
2840
|
+
const localVarPath = `/authorizations/{authorizationId}/returnRates`.replace(`{authorizationId}`, encodeURIComponent(String(authorizationId !== void 0 ? authorizationId : `-authorizationId-`)));
|
|
3077
2841
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3078
2842
|
let baseOptions;
|
|
3079
2843
|
if (configuration) baseOptions = configuration.baseOptions;
|
|
3080
2844
|
const localVarRequestOptions = {
|
|
3081
|
-
method: "
|
|
2845
|
+
method: "GET",
|
|
3082
2846
|
...baseOptions,
|
|
3083
2847
|
...options
|
|
3084
2848
|
};
|
|
@@ -3100,6 +2864,7 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3100
2864
|
keyParamName: "clientId",
|
|
3101
2865
|
configuration
|
|
3102
2866
|
});
|
|
2867
|
+
if (timeframes !== void 0) localVarQueryParameter["timeframes"] = timeframes;
|
|
3103
2868
|
const localVarOperationAuth = {
|
|
3104
2869
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
3105
2870
|
requestSigningByAuthMode: {
|
|
@@ -3125,8 +2890,8 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3125
2890
|
requestConfig: localVarRequestOptions,
|
|
3126
2891
|
path: localVarPath,
|
|
3127
2892
|
configuration,
|
|
3128
|
-
pathTemplate: "/authorizations/{authorizationId}",
|
|
3129
|
-
httpMethod: "
|
|
2893
|
+
pathTemplate: "/authorizations/{authorizationId}/returnRates",
|
|
2894
|
+
httpMethod: "GET",
|
|
3130
2895
|
operationAuth: localVarOperationAuth
|
|
3131
2896
|
});
|
|
3132
2897
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
@@ -3136,23 +2901,22 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3136
2901
|
};
|
|
3137
2902
|
},
|
|
3138
2903
|
/**
|
|
3139
|
-
*
|
|
3140
|
-
* @summary
|
|
2904
|
+
* 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
|
|
2905
|
+
* @summary Sync transactions for a connection
|
|
3141
2906
|
* @param {string} authorizationId
|
|
3142
|
-
* @param {string} [timeframes] Optional comma separated list of rate-of-return timeframes to return. Supported values are `ALL`, `1Y`, `YTD`, `1M`, `1W`, and `1D`. If omitted, SnapTrade returns all six supported timeframes.
|
|
3143
2907
|
* @param {string} [userId]
|
|
3144
2908
|
* @param {string} [userSecret]
|
|
3145
2909
|
* @param {*} [options] Override http request option.
|
|
3146
2910
|
* @throws {RequiredError}
|
|
3147
2911
|
*/
|
|
3148
|
-
|
|
3149
|
-
assertParamExists("
|
|
3150
|
-
const localVarPath = `/authorizations/{authorizationId}/
|
|
2912
|
+
syncBrokerageAuthorizationTransactions: async (authorizationId, userId, userSecret, options = {}) => {
|
|
2913
|
+
assertParamExists("syncBrokerageAuthorizationTransactions", "authorizationId", authorizationId);
|
|
2914
|
+
const localVarPath = `/authorizations/{authorizationId}/transactions/sync`.replace(`{authorizationId}`, encodeURIComponent(String(authorizationId !== void 0 ? authorizationId : `-authorizationId-`)));
|
|
3151
2915
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3152
2916
|
let baseOptions;
|
|
3153
2917
|
if (configuration) baseOptions = configuration.baseOptions;
|
|
3154
2918
|
const localVarRequestOptions = {
|
|
3155
|
-
method: "
|
|
2919
|
+
method: "POST",
|
|
3156
2920
|
...baseOptions,
|
|
3157
2921
|
...options
|
|
3158
2922
|
};
|
|
@@ -3174,7 +2938,6 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3174
2938
|
keyParamName: "clientId",
|
|
3175
2939
|
configuration
|
|
3176
2940
|
});
|
|
3177
|
-
if (timeframes !== void 0) localVarQueryParameter["timeframes"] = timeframes;
|
|
3178
2941
|
const localVarOperationAuth = {
|
|
3179
2942
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
3180
2943
|
requestSigningByAuthMode: {
|
|
@@ -3200,8 +2963,8 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3200
2963
|
requestConfig: localVarRequestOptions,
|
|
3201
2964
|
path: localVarPath,
|
|
3202
2965
|
configuration,
|
|
3203
|
-
pathTemplate: "/authorizations/{authorizationId}/
|
|
3204
|
-
httpMethod: "
|
|
2966
|
+
pathTemplate: "/authorizations/{authorizationId}/transactions/sync",
|
|
2967
|
+
httpMethod: "POST",
|
|
3205
2968
|
operationAuth: localVarOperationAuth
|
|
3206
2969
|
});
|
|
3207
2970
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
@@ -3209,165 +2972,20 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3209
2972
|
url: toPathString(localVarUrlObj),
|
|
3210
2973
|
options: localVarRequestOptions
|
|
3211
2974
|
};
|
|
3212
|
-
}
|
|
2975
|
+
}
|
|
2976
|
+
};
|
|
2977
|
+
};
|
|
2978
|
+
/**
|
|
2979
|
+
* ConnectionsApi - functional programming interface
|
|
2980
|
+
* @export
|
|
2981
|
+
*/
|
|
2982
|
+
const ConnectionsApiFp = function(configuration) {
|
|
2983
|
+
const localVarAxiosParamCreator = ConnectionsApiAxiosParamCreator(configuration);
|
|
2984
|
+
return {
|
|
3213
2985
|
/**
|
|
3214
|
-
*
|
|
3215
|
-
* @summary
|
|
3216
|
-
* @param {
|
|
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.
|
|
2986
|
+
* 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.
|
|
2987
|
+
* @summary Delete connection
|
|
2988
|
+
* @param {ConnectionsApiDeleteConnectionRequest<TAuth>} requestParameters Request parameters.
|
|
3371
2989
|
* @param {*} [options] Override http request option.
|
|
3372
2990
|
* @throws {RequiredError}
|
|
3373
2991
|
*/
|
|
@@ -3497,28 +3115,6 @@ const ConnectionsApiFp = function(configuration) {
|
|
|
3497
3115
|
});
|
|
3498
3116
|
},
|
|
3499
3117
|
/**
|
|
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
3118
|
* Returns a list of rate of return percents for a given connection.
|
|
3523
3119
|
* @summary List connection rate of returns
|
|
3524
3120
|
* @param {ConnectionsApiReturnRatesRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -3541,28 +3137,6 @@ const ConnectionsApiFp = function(configuration) {
|
|
|
3541
3137
|
});
|
|
3542
3138
|
},
|
|
3543
3139
|
/**
|
|
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
3140
|
* 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
3141
|
* @summary Sync transactions for a connection
|
|
3568
3142
|
* @param {ConnectionsApiSyncBrokerageAuthorizationTransactionsRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -3654,16 +3228,6 @@ const ConnectionsApiFactory = function(configuration, basePath, axios) {
|
|
|
3654
3228
|
return localVarFp.refreshBrokerageAuthorization(requestParameters, options).then((request) => request(axios, basePath));
|
|
3655
3229
|
},
|
|
3656
3230
|
/**
|
|
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
3231
|
* Returns a list of rate of return percents for a given connection.
|
|
3668
3232
|
* @summary List connection rate of returns
|
|
3669
3233
|
* @param {ConnectionsApiReturnRatesRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -3674,16 +3238,6 @@ const ConnectionsApiFactory = function(configuration, basePath, axios) {
|
|
|
3674
3238
|
return localVarFp.returnRates(requestParameters, options).then((request) => request(axios, basePath));
|
|
3675
3239
|
},
|
|
3676
3240
|
/**
|
|
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
3241
|
* 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
3242
|
* @summary Sync transactions for a connection
|
|
3689
3243
|
* @param {ConnectionsApiSyncBrokerageAuthorizationTransactionsRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -3769,17 +3323,6 @@ var ConnectionsApiGenerated = class extends BaseAPI {
|
|
|
3769
3323
|
return ConnectionsApiFp(this.configuration).refreshBrokerageAuthorization(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
3770
3324
|
}
|
|
3771
3325
|
/**
|
|
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
3326
|
* Returns a list of rate of return percents for a given connection.
|
|
3784
3327
|
* @summary List connection rate of returns
|
|
3785
3328
|
* @param {ConnectionsApiReturnRatesRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -3791,17 +3334,6 @@ var ConnectionsApiGenerated = class extends BaseAPI {
|
|
|
3791
3334
|
return ConnectionsApiFp(this.configuration).returnRates(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
3792
3335
|
}
|
|
3793
3336
|
/**
|
|
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
3337
|
* 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
3338
|
* @summary Sync transactions for a connection
|
|
3807
3339
|
* @param {ConnectionsApiSyncBrokerageAuthorizationTransactionsRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -4671,277 +4203,54 @@ var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
|
|
|
4671
4203
|
//#region api/experimental-endpoints-api.ts
|
|
4672
4204
|
var ExperimentalEndpointsApi = class extends ExperimentalEndpointsApiGenerated {};
|
|
4673
4205
|
//#endregion
|
|
4674
|
-
//#region api/
|
|
4206
|
+
//#region api/reference-data-api-generated.ts
|
|
4675
4207
|
/**
|
|
4676
|
-
*
|
|
4208
|
+
* ReferenceDataApi - axios parameter creator
|
|
4677
4209
|
* @export
|
|
4678
4210
|
*/
|
|
4679
|
-
const
|
|
4680
|
-
return {
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
...options
|
|
4701
|
-
};
|
|
4702
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4703
|
-
const localVarQueryParameter = {};
|
|
4704
|
-
if (configuration?.authMode === "commercialApiKey") {
|
|
4705
|
-
await setApiKeyToObject({
|
|
4211
|
+
const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
4212
|
+
return {
|
|
4213
|
+
/**
|
|
4214
|
+
* Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
|
|
4215
|
+
* @summary Get Client Info
|
|
4216
|
+
* @param {*} [options] Override http request option.
|
|
4217
|
+
* @throws {RequiredError}
|
|
4218
|
+
*/
|
|
4219
|
+
getPartnerInfo: async (options = {}) => {
|
|
4220
|
+
const localVarPath = `/snapTrade/partners`;
|
|
4221
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
4222
|
+
let baseOptions;
|
|
4223
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
4224
|
+
const localVarRequestOptions = {
|
|
4225
|
+
method: "GET",
|
|
4226
|
+
...baseOptions,
|
|
4227
|
+
...options
|
|
4228
|
+
};
|
|
4229
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4230
|
+
const localVarQueryParameter = {};
|
|
4231
|
+
if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
|
|
4706
4232
|
object: localVarQueryParameter,
|
|
4707
4233
|
key: "clientId",
|
|
4708
4234
|
keyParamName: "clientId",
|
|
4709
4235
|
configuration
|
|
4710
4236
|
});
|
|
4711
|
-
if (
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
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
|
-
}
|
|
4237
|
+
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
4238
|
+
object: localVarQueryParameter,
|
|
4239
|
+
key: "clientId",
|
|
4240
|
+
keyParamName: "clientId",
|
|
4241
|
+
configuration
|
|
4242
|
+
});
|
|
4243
|
+
const localVarOperationAuth = {
|
|
4244
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4245
|
+
requestSigningByAuthMode: {
|
|
4246
|
+
"commercialApiKey": {
|
|
4247
|
+
secretParameter: "consumerKey",
|
|
4248
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4249
|
+
},
|
|
4250
|
+
"personalApiKey": {
|
|
4251
|
+
secretParameter: "consumerKey",
|
|
4252
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4253
|
+
}
|
|
4945
4254
|
},
|
|
4946
4255
|
selectedAuthMode: configuration?.authMode
|
|
4947
4256
|
};
|
|
@@ -4967,71 +4276,6 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
|
4967
4276
|
};
|
|
4968
4277
|
},
|
|
4969
4278
|
/**
|
|
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
4279
|
* Returns a list of all supported Exchanges.
|
|
5036
4280
|
* @summary Get exchanges
|
|
5037
4281
|
* @param {*} [options] Override http request option.
|
|
@@ -5432,136 +4676,6 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
|
5432
4676
|
};
|
|
5433
4677
|
},
|
|
5434
4678
|
/**
|
|
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
4679
|
* 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
4680
|
* @summary Search account symbols
|
|
5567
4681
|
* @param {string} accountId
|
|
@@ -5647,28 +4761,6 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
|
5647
4761
|
const ReferenceDataApiFp = function(configuration) {
|
|
5648
4762
|
const localVarAxiosParamCreator = ReferenceDataApiAxiosParamCreator(configuration);
|
|
5649
4763
|
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
4764
|
/**
|
|
5673
4765
|
* Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
|
|
5674
4766
|
* @summary Get Client Info
|
|
@@ -5692,28 +4784,6 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5692
4784
|
});
|
|
5693
4785
|
},
|
|
5694
4786
|
/**
|
|
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
4787
|
* Returns a list of all supported Exchanges.
|
|
5718
4788
|
* @summary Get exchanges
|
|
5719
4789
|
* @param {*} [options] Override http request option.
|
|
@@ -5765,52 +4835,8 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5765
4835
|
* @param {*} [options] Override http request option.
|
|
5766
4836
|
* @throws {RequiredError}
|
|
5767
4837
|
*/
|
|
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, {
|
|
4838
|
+
async getSymbolsByTicker(requestParameters, options) {
|
|
4839
|
+
return createRequestFunction(await localVarAxiosParamCreator.getSymbolsByTicker(requestParameters.query, options), globalAxios, BASE_PATH, configuration, {
|
|
5814
4840
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5815
4841
|
requestSigningByAuthMode: {
|
|
5816
4842
|
"commercialApiKey": {
|
|
@@ -5825,14 +4851,14 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5825
4851
|
});
|
|
5826
4852
|
},
|
|
5827
4853
|
/**
|
|
5828
|
-
* Returns a list of all defined Brokerage objects.
|
|
5829
|
-
* @summary Get
|
|
4854
|
+
* Returns a list of all defined Brokerage authorization Type objects.
|
|
4855
|
+
* @summary Get all brokerage authorization types
|
|
4856
|
+
* @param {ReferenceDataApiListAllBrokerageAuthorizationTypeRequest<TAuth>} requestParameters Request parameters.
|
|
5830
4857
|
* @param {*} [options] Override http request option.
|
|
5831
4858
|
* @throws {RequiredError}
|
|
5832
4859
|
*/
|
|
5833
|
-
async
|
|
5834
|
-
|
|
5835
|
-
return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerages(options), globalAxios, BASE_PATH, configuration, {
|
|
4860
|
+
async listAllBrokerageAuthorizationType(requestParameters = {}, options) {
|
|
4861
|
+
return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerageAuthorizationType(requestParameters.brokerage, options), globalAxios, BASE_PATH, configuration, {
|
|
5836
4862
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5837
4863
|
requestSigningByAuthMode: {
|
|
5838
4864
|
"commercialApiKey": {
|
|
@@ -5847,14 +4873,14 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5847
4873
|
});
|
|
5848
4874
|
},
|
|
5849
4875
|
/**
|
|
5850
|
-
* Returns a list of all
|
|
5851
|
-
* @summary Get
|
|
4876
|
+
* 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.
|
|
4877
|
+
* @summary Get brokerage instruments
|
|
4878
|
+
* @param {ReferenceDataApiListAllBrokerageInstrumentsRequest<TAuth>} requestParameters Request parameters.
|
|
5852
4879
|
* @param {*} [options] Override http request option.
|
|
5853
4880
|
* @throws {RequiredError}
|
|
5854
4881
|
*/
|
|
5855
|
-
async
|
|
5856
|
-
|
|
5857
|
-
return createRequestFunction(await localVarAxiosParamCreator.listAllCurrencies(options), globalAxios, BASE_PATH, configuration, {
|
|
4882
|
+
async listAllBrokerageInstruments(requestParameters, options) {
|
|
4883
|
+
return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerageInstruments(requestParameters.slug, options), globalAxios, BASE_PATH, configuration, {
|
|
5858
4884
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5859
4885
|
requestSigningByAuthMode: {
|
|
5860
4886
|
"commercialApiKey": {
|
|
@@ -5869,14 +4895,14 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5869
4895
|
});
|
|
5870
4896
|
},
|
|
5871
4897
|
/**
|
|
5872
|
-
* Returns a list of all
|
|
5873
|
-
* @summary Get
|
|
4898
|
+
* Returns a list of all defined Brokerage objects.
|
|
4899
|
+
* @summary Get brokerages
|
|
5874
4900
|
* @param {*} [options] Override http request option.
|
|
5875
4901
|
* @throws {RequiredError}
|
|
5876
4902
|
*/
|
|
5877
|
-
async
|
|
4903
|
+
async listAllBrokerages(...args) {
|
|
5878
4904
|
const [options] = args;
|
|
5879
|
-
return createRequestFunction(await localVarAxiosParamCreator.
|
|
4905
|
+
return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerages(options), globalAxios, BASE_PATH, configuration, {
|
|
5880
4906
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5881
4907
|
requestSigningByAuthMode: {
|
|
5882
4908
|
"commercialApiKey": {
|
|
@@ -5922,16 +4948,6 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5922
4948
|
const ReferenceDataApiFactory = function(configuration, basePath, axios) {
|
|
5923
4949
|
const localVarFp = ReferenceDataApiFp(configuration);
|
|
5924
4950
|
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
4951
|
/**
|
|
5936
4952
|
* Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
|
|
5937
4953
|
* @summary Get Client Info
|
|
@@ -5942,15 +4958,6 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios) {
|
|
|
5942
4958
|
return localVarFp.getPartnerInfo(...args).then((request) => request(axios, basePath));
|
|
5943
4959
|
},
|
|
5944
4960
|
/**
|
|
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
4961
|
* Returns a list of all supported Exchanges.
|
|
5955
4962
|
* @summary Get exchanges
|
|
5956
4963
|
* @param {*} [options] Override http request option.
|
|
@@ -6009,24 +5016,6 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios) {
|
|
|
6009
5016
|
return localVarFp.listAllBrokerages(...args).then((request) => request(axios, basePath));
|
|
6010
5017
|
},
|
|
6011
5018
|
/**
|
|
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
5019
|
* 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
5020
|
* @summary Search account symbols
|
|
6032
5021
|
* @param {ReferenceDataApiSymbolSearchUserAccountRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -6045,17 +5034,6 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios) {
|
|
|
6045
5034
|
* @extends {BaseAPI}
|
|
6046
5035
|
*/
|
|
6047
5036
|
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
5037
|
/**
|
|
6060
5038
|
* Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
|
|
6061
5039
|
* @summary Get Client Info
|
|
@@ -6067,16 +5045,6 @@ var ReferenceDataApiGenerated = class extends BaseAPI {
|
|
|
6067
5045
|
return ReferenceDataApiFp(this.configuration).getPartnerInfo(...args).then((request) => request(this.axios, this.basePath));
|
|
6068
5046
|
}
|
|
6069
5047
|
/**
|
|
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
5048
|
* Returns a list of all supported Exchanges.
|
|
6081
5049
|
* @summary Get exchanges
|
|
6082
5050
|
* @param {*} [options] Override http request option.
|
|
@@ -6141,26 +5109,6 @@ var ReferenceDataApiGenerated = class extends BaseAPI {
|
|
|
6141
5109
|
return ReferenceDataApiFp(this.configuration).listAllBrokerages(...args).then((request) => request(this.axios, this.basePath));
|
|
6142
5110
|
}
|
|
6143
5111
|
/**
|
|
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
5112
|
* 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
5113
|
* @summary Search account symbols
|
|
6166
5114
|
* @param {ReferenceDataApiSymbolSearchUserAccountRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -6262,85 +5210,6 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
6262
5210
|
};
|
|
6263
5211
|
},
|
|
6264
5212
|
/**
|
|
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
5213
|
* Gets a quote for the specified account.
|
|
6345
5214
|
* @summary Get crypto pair quote
|
|
6346
5215
|
* @param {string} accountId
|
|
@@ -6724,85 +5593,6 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
6724
5593
|
};
|
|
6725
5594
|
},
|
|
6726
5595
|
/**
|
|
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
5596
|
* 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
5597
|
* @summary Place complex order
|
|
6808
5598
|
* @param {string} accountId The ID of the account to execute the trade on.
|
|
@@ -7455,30 +6245,6 @@ const TradingApiFp = function(configuration) {
|
|
|
7455
6245
|
});
|
|
7456
6246
|
},
|
|
7457
6247
|
/**
|
|
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
6248
|
* Gets a quote for the specified account.
|
|
7483
6249
|
* @summary Get crypto pair quote
|
|
7484
6250
|
* @param {TradingApiGetCryptocurrencyPairQuoteRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -7590,44 +6356,10 @@ const TradingApiFp = function(configuration) {
|
|
|
7590
6356
|
* @summary Get equity symbol quotes
|
|
7591
6357
|
* @param {TradingApiGetUserAccountQuotesRequest<TAuth>} requestParameters Request parameters.
|
|
7592
6358
|
* @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, {
|
|
6359
|
+
* @throws {RequiredError}
|
|
6360
|
+
*/
|
|
6361
|
+
async getUserAccountQuotes(requestParameters, options) {
|
|
6362
|
+
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountQuotes(requestParameters.symbols, requestParameters.accountId, requestParameters.useTicker, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
|
|
7631
6363
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
7632
6364
|
requestSigningByAuthMode: {
|
|
7633
6365
|
"commercialApiKey": {
|
|
@@ -7898,17 +6630,6 @@ const TradingApiFactory = function(configuration, basePath, axios) {
|
|
|
7898
6630
|
return localVarFp.cancelOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
7899
6631
|
},
|
|
7900
6632
|
/**
|
|
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
6633
|
* Gets a quote for the specified account.
|
|
7913
6634
|
* @summary Get crypto pair quote
|
|
7914
6635
|
* @param {TradingApiGetCryptocurrencyPairQuoteRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -7959,17 +6680,6 @@ const TradingApiFactory = function(configuration, basePath, axios) {
|
|
|
7959
6680
|
return localVarFp.getUserAccountQuotes(requestParameters, options).then((request) => request(axios, basePath));
|
|
7960
6681
|
},
|
|
7961
6682
|
/**
|
|
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
6683
|
* 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
6684
|
* @summary Place complex order
|
|
7975
6685
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -8070,18 +6780,6 @@ var TradingApiGenerated = class extends BaseAPI {
|
|
|
8070
6780
|
return TradingApiFp(this.configuration).cancelOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
8071
6781
|
}
|
|
8072
6782
|
/**
|
|
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
6783
|
* Gets a quote for the specified account.
|
|
8086
6784
|
* @summary Get crypto pair quote
|
|
8087
6785
|
* @param {TradingApiGetCryptocurrencyPairQuoteRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -8137,18 +6835,6 @@ var TradingApiGenerated = class extends BaseAPI {
|
|
|
8137
6835
|
return TradingApiFp(this.configuration).getUserAccountQuotes(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
8138
6836
|
}
|
|
8139
6837
|
/**
|
|
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
6838
|
* 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
6839
|
* @summary Place complex order
|
|
8154
6840
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -8241,303 +6927,6 @@ var TradingApiGenerated = class extends BaseAPI {
|
|
|
8241
6927
|
//#region api/trading-api.ts
|
|
8242
6928
|
var TradingApi = class extends TradingApiGenerated {};
|
|
8243
6929
|
//#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 `trade_date`.
|
|
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 `trade_date`.
|
|
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 `brokerageAuthorizations` 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 `accounts` 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: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `SUBSTITUTE_DIVIDEND` - Payment in lieu of a dividend. - `CONTRIBUTION` - Cash contribution. - `WITHDRAWAL` - Cash withdrawal. - `REI` - Dividend reinvestment. - `INTEREST` - Interest deposited into the account. - `FEE` - Fee withdrawn from the account. - `OPTIONEXPIRATION` - Option expiration event. - `OPTIONASSIGNMENT` - Option assignment event. - `OPTIONEXERCISE` - Option exercise event. - `TRANSFER` - 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
6930
|
//#region auth.ts
|
|
8542
6931
|
var CommercialApiKeyAuth = class CommercialApiKeyAuth {
|
|
8543
6932
|
constructor(params) {
|
|
@@ -8584,7 +6973,7 @@ var Configuration = class {
|
|
|
8584
6973
|
}
|
|
8585
6974
|
this.basePath = param.basePath;
|
|
8586
6975
|
this.baseOptions = param.baseOptions ?? {};
|
|
8587
|
-
this.userAgent = param.userAgent === void 0 ? "Konfig/
|
|
6976
|
+
this.userAgent = param.userAgent === void 0 ? "Konfig/12.0.0/typescript" : param.userAgent;
|
|
8588
6977
|
this.formDataCtor = param.formDataCtor;
|
|
8589
6978
|
}
|
|
8590
6979
|
/**
|
|
@@ -8617,11 +7006,9 @@ var Snaptrade = class extends SnaptradeCustom {
|
|
|
8617
7006
|
this.authentication = new AuthenticationApi(configuration);
|
|
8618
7007
|
this.connections = new ConnectionsApi(configuration);
|
|
8619
7008
|
this.experimentalEndpoints = new ExperimentalEndpointsApi(configuration);
|
|
8620
|
-
this.options = new OptionsApi(configuration);
|
|
8621
7009
|
this.referenceData = new ReferenceDataApi(configuration);
|
|
8622
7010
|
this.trading = new TradingApi(configuration);
|
|
8623
|
-
this.transactionsAndReporting = new TransactionsAndReportingApi(configuration);
|
|
8624
7011
|
}
|
|
8625
7012
|
};
|
|
8626
7013
|
//#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,
|
|
7014
|
+
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 };
|