snaptrade-typescript-sdk 11.0.4 → 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 +22 -517
- package/dist/browser.umd.js +1 -1
- package/dist/index.cjs +331 -1841
- package/dist/index.d.cts +243 -868
- package/dist/index.d.mts +243 -868
- package/dist/index.d.ts +243 -868
- package/dist/index.mjs +260 -1757
- 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.
|
|
@@ -4198,13 +3730,17 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
|
4198
3730
|
};
|
|
4199
3731
|
},
|
|
4200
3732
|
/**
|
|
4201
|
-
* Returns
|
|
4202
|
-
* @summary List
|
|
3733
|
+
* Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently only `investment` is implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema. On Pay as you Go / Real-time, this endpoint refreshes each account\'s opening date, funding date, and market value live from the brokerage on each call. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
|
|
3734
|
+
* @summary List accounts for a connection (discriminated union)
|
|
3735
|
+
* @param {string} authorizationId
|
|
3736
|
+
* @param {string} [userId]
|
|
3737
|
+
* @param {string} [userSecret]
|
|
4203
3738
|
* @param {*} [options] Override http request option.
|
|
4204
3739
|
* @throws {RequiredError}
|
|
4205
3740
|
*/
|
|
4206
|
-
|
|
4207
|
-
|
|
3741
|
+
listConnectionAccounts: async (authorizationId, userId, userSecret, options = {}) => {
|
|
3742
|
+
assertParamExists("listConnectionAccounts", "authorizationId", authorizationId);
|
|
3743
|
+
const localVarPath = `/connections/{authorizationId}/accounts`.replace(`{authorizationId}`, encodeURIComponent(String(authorizationId !== void 0 ? authorizationId : `-authorizationId-`)));
|
|
4208
3744
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
4209
3745
|
let baseOptions;
|
|
4210
3746
|
if (configuration) baseOptions = configuration.baseOptions;
|
|
@@ -4215,12 +3751,16 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
|
4215
3751
|
};
|
|
4216
3752
|
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4217
3753
|
const localVarQueryParameter = {};
|
|
4218
|
-
if (configuration?.authMode === "commercialApiKey")
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
3754
|
+
if (configuration?.authMode === "commercialApiKey") {
|
|
3755
|
+
await setApiKeyToObject({
|
|
3756
|
+
object: localVarQueryParameter,
|
|
3757
|
+
key: "clientId",
|
|
3758
|
+
keyParamName: "clientId",
|
|
3759
|
+
configuration
|
|
3760
|
+
});
|
|
3761
|
+
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
3762
|
+
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
3763
|
+
}
|
|
4224
3764
|
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
4225
3765
|
object: localVarQueryParameter,
|
|
4226
3766
|
key: "clientId",
|
|
@@ -4252,7 +3792,7 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
|
4252
3792
|
requestConfig: localVarRequestOptions,
|
|
4253
3793
|
path: localVarPath,
|
|
4254
3794
|
configuration,
|
|
4255
|
-
pathTemplate: "/
|
|
3795
|
+
pathTemplate: "/connections/{authorizationId}/accounts",
|
|
4256
3796
|
httpMethod: "GET",
|
|
4257
3797
|
operationAuth: localVarOperationAuth
|
|
4258
3798
|
});
|
|
@@ -4261,38 +3801,103 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
|
4261
3801
|
url: toPathString(localVarUrlObj),
|
|
4262
3802
|
options: localVarRequestOptions
|
|
4263
3803
|
};
|
|
4264
|
-
}
|
|
4265
|
-
};
|
|
4266
|
-
};
|
|
4267
|
-
/**
|
|
4268
|
-
* ExperimentalEndpointsApi - functional programming interface
|
|
4269
|
-
* @export
|
|
4270
|
-
*/
|
|
4271
|
-
const ExperimentalEndpointsApiFp = function(configuration) {
|
|
4272
|
-
const localVarAxiosParamCreator = ExperimentalEndpointsApiAxiosParamCreator(configuration);
|
|
4273
|
-
return {
|
|
3804
|
+
},
|
|
4274
3805
|
/**
|
|
4275
|
-
*
|
|
4276
|
-
* @summary
|
|
4277
|
-
* @param {ExperimentalEndpointsApiAddSubscriptionRequest<TAuth>} requestParameters Request parameters.
|
|
3806
|
+
* Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|
|
3807
|
+
* @summary List active Trade Detection subscriptions
|
|
4278
3808
|
* @param {*} [options] Override http request option.
|
|
4279
3809
|
* @throws {RequiredError}
|
|
4280
3810
|
*/
|
|
4281
|
-
async
|
|
4282
|
-
const
|
|
4283
|
-
|
|
4284
|
-
|
|
3811
|
+
listSubscriptions: async (options = {}) => {
|
|
3812
|
+
const localVarPath = `/snapTrade/tradeDetection/subscriptions`;
|
|
3813
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3814
|
+
let baseOptions;
|
|
3815
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
3816
|
+
const localVarRequestOptions = {
|
|
3817
|
+
method: "GET",
|
|
3818
|
+
...baseOptions,
|
|
3819
|
+
...options
|
|
4285
3820
|
};
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
3821
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
3822
|
+
const localVarQueryParameter = {};
|
|
3823
|
+
if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
|
|
3824
|
+
object: localVarQueryParameter,
|
|
3825
|
+
key: "clientId",
|
|
3826
|
+
keyParamName: "clientId",
|
|
3827
|
+
configuration
|
|
3828
|
+
});
|
|
3829
|
+
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
3830
|
+
object: localVarQueryParameter,
|
|
3831
|
+
key: "clientId",
|
|
3832
|
+
keyParamName: "clientId",
|
|
3833
|
+
configuration
|
|
3834
|
+
});
|
|
3835
|
+
const localVarOperationAuth = {
|
|
3836
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
3837
|
+
requestSigningByAuthMode: {
|
|
3838
|
+
"commercialApiKey": {
|
|
3839
|
+
secretParameter: "consumerKey",
|
|
3840
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
3841
|
+
},
|
|
3842
|
+
"personalApiKey": {
|
|
3843
|
+
secretParameter: "consumerKey",
|
|
3844
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
3845
|
+
}
|
|
3846
|
+
},
|
|
3847
|
+
selectedAuthMode: configuration?.authMode
|
|
3848
|
+
};
|
|
3849
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3850
|
+
localVarRequestOptions.headers = {
|
|
3851
|
+
...localVarHeaderParameter,
|
|
3852
|
+
...headersFromBaseOptions,
|
|
3853
|
+
...options.headers
|
|
3854
|
+
};
|
|
3855
|
+
requestBeforeHook({
|
|
3856
|
+
queryParameters: localVarQueryParameter,
|
|
3857
|
+
requestConfig: localVarRequestOptions,
|
|
3858
|
+
path: localVarPath,
|
|
3859
|
+
configuration,
|
|
3860
|
+
pathTemplate: "/snapTrade/tradeDetection/subscriptions",
|
|
3861
|
+
httpMethod: "GET",
|
|
3862
|
+
operationAuth: localVarOperationAuth
|
|
3863
|
+
});
|
|
3864
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
3865
|
+
return {
|
|
3866
|
+
url: toPathString(localVarUrlObj),
|
|
3867
|
+
options: localVarRequestOptions
|
|
3868
|
+
};
|
|
3869
|
+
}
|
|
3870
|
+
};
|
|
3871
|
+
};
|
|
3872
|
+
/**
|
|
3873
|
+
* ExperimentalEndpointsApi - functional programming interface
|
|
3874
|
+
* @export
|
|
3875
|
+
*/
|
|
3876
|
+
const ExperimentalEndpointsApiFp = function(configuration) {
|
|
3877
|
+
const localVarAxiosParamCreator = ExperimentalEndpointsApiAxiosParamCreator(configuration);
|
|
3878
|
+
return {
|
|
3879
|
+
/**
|
|
3880
|
+
* Adds or restores a Trade Detection subscription for a connected brokerage account. This endpoint requires `userId` and `userSecret` in addition to the partner signature.
|
|
3881
|
+
* @summary Add a Trade Detection subscription
|
|
3882
|
+
* @param {ExperimentalEndpointsApiAddSubscriptionRequest<TAuth>} requestParameters Request parameters.
|
|
3883
|
+
* @param {*} [options] Override http request option.
|
|
3884
|
+
* @throws {RequiredError}
|
|
3885
|
+
*/
|
|
3886
|
+
async addSubscription(requestParameters, options) {
|
|
3887
|
+
const tradeDetectionAddSubscriptionRequest = {
|
|
3888
|
+
account_id: requestParameters.account_id,
|
|
3889
|
+
check_interval_seconds: requestParameters.check_interval_seconds
|
|
3890
|
+
};
|
|
3891
|
+
return createRequestFunction(await localVarAxiosParamCreator.addSubscription(tradeDetectionAddSubscriptionRequest, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
|
|
3892
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
3893
|
+
requestSigningByAuthMode: {
|
|
3894
|
+
"commercialApiKey": {
|
|
3895
|
+
secretParameter: "consumerKey",
|
|
3896
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
3897
|
+
},
|
|
3898
|
+
"personalApiKey": {
|
|
3899
|
+
secretParameter: "consumerKey",
|
|
3900
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4296
3901
|
}
|
|
4297
3902
|
}
|
|
4298
3903
|
});
|
|
@@ -4387,6 +3992,28 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4387
3992
|
});
|
|
4388
3993
|
},
|
|
4389
3994
|
/**
|
|
3995
|
+
* Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently only `investment` is implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema. On Pay as you Go / Real-time, this endpoint refreshes each account\'s opening date, funding date, and market value live from the brokerage on each call. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
|
|
3996
|
+
* @summary List accounts for a connection (discriminated union)
|
|
3997
|
+
* @param {ExperimentalEndpointsApiListConnectionAccountsRequest<TAuth>} requestParameters Request parameters.
|
|
3998
|
+
* @param {*} [options] Override http request option.
|
|
3999
|
+
* @throws {RequiredError}
|
|
4000
|
+
*/
|
|
4001
|
+
async listConnectionAccounts(requestParameters, options) {
|
|
4002
|
+
return createRequestFunction(await localVarAxiosParamCreator.listConnectionAccounts(requestParameters.authorizationId, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
|
|
4003
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4004
|
+
requestSigningByAuthMode: {
|
|
4005
|
+
"commercialApiKey": {
|
|
4006
|
+
secretParameter: "consumerKey",
|
|
4007
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4008
|
+
},
|
|
4009
|
+
"personalApiKey": {
|
|
4010
|
+
secretParameter: "consumerKey",
|
|
4011
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4012
|
+
}
|
|
4013
|
+
}
|
|
4014
|
+
});
|
|
4015
|
+
},
|
|
4016
|
+
/**
|
|
4390
4017
|
* Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|
|
4391
4018
|
* @summary List active Trade Detection subscriptions
|
|
4392
4019
|
* @param {*} [options] Override http request option.
|
|
@@ -4468,6 +4095,16 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios)
|
|
|
4468
4095
|
return localVarFp.getUserAccountRecentOrdersV2(requestParameters, options).then((request) => request(axios, basePath));
|
|
4469
4096
|
},
|
|
4470
4097
|
/**
|
|
4098
|
+
* Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently only `investment` is implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema. On Pay as you Go / Real-time, this endpoint refreshes each account\'s opening date, funding date, and market value live from the brokerage on each call. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
|
|
4099
|
+
* @summary List accounts for a connection (discriminated union)
|
|
4100
|
+
* @param {ExperimentalEndpointsApiListConnectionAccountsRequest<TAuth>} requestParameters Request parameters.
|
|
4101
|
+
* @param {*} [options] Override http request option.
|
|
4102
|
+
* @throws {RequiredError}
|
|
4103
|
+
*/
|
|
4104
|
+
listConnectionAccounts(requestParameters, options) {
|
|
4105
|
+
return localVarFp.listConnectionAccounts(requestParameters, options).then((request) => request(axios, basePath));
|
|
4106
|
+
},
|
|
4107
|
+
/**
|
|
4471
4108
|
* Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|
|
4472
4109
|
* @summary List active Trade Detection subscriptions
|
|
4473
4110
|
* @param {*} [options] Override http request option.
|
|
@@ -4518,346 +4155,69 @@ var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
|
|
|
4518
4155
|
getUserAccountOrderDetailV2(requestParameters, options) {
|
|
4519
4156
|
return ExperimentalEndpointsApiFp(this.configuration).getUserAccountOrderDetailV2(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
4520
4157
|
}
|
|
4521
|
-
/**
|
|
4522
|
-
* Returns a list of recent orders in the specified account. The V2 order response format will include all legs of each order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
4523
|
-
* @summary List account orders v2
|
|
4524
|
-
* @param {ExperimentalEndpointsApiGetUserAccountOrdersV2Request<TAuth>} requestParameters Request parameters.
|
|
4525
|
-
* @param {*} [options] Override http request option.
|
|
4526
|
-
* @throws {RequiredError}
|
|
4527
|
-
* @memberof ExperimentalEndpointsApiGenerated
|
|
4528
|
-
*/
|
|
4529
|
-
getUserAccountOrdersV2(requestParameters, options) {
|
|
4530
|
-
return ExperimentalEndpointsApiFp(this.configuration).getUserAccountOrdersV2(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
4531
|
-
}
|
|
4532
|
-
/**
|
|
4533
|
-
* A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account using the V2 order format. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from /orders in that it is realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
|
|
4534
|
-
* @summary List account recent orders (V2, last 24 hours only)
|
|
4535
|
-
* @param {ExperimentalEndpointsApiGetUserAccountRecentOrdersV2Request<TAuth>} requestParameters Request parameters.
|
|
4536
|
-
* @param {*} [options] Override http request option.
|
|
4537
|
-
* @throws {RequiredError}
|
|
4538
|
-
* @memberof ExperimentalEndpointsApiGenerated
|
|
4539
|
-
*/
|
|
4540
|
-
getUserAccountRecentOrdersV2(requestParameters, options) {
|
|
4541
|
-
return ExperimentalEndpointsApiFp(this.configuration).getUserAccountRecentOrdersV2(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
4542
|
-
}
|
|
4543
|
-
/**
|
|
4544
|
-
* Returns
|
|
4545
|
-
* @summary List
|
|
4546
|
-
* @param {
|
|
4547
|
-
* @
|
|
4548
|
-
* @
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
}
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
assertParamExists("listOptionHoldings", "accountId", accountId);
|
|
4577
|
-
const localVarPath = `/accounts/{accountId}/options`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
|
|
4578
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
4579
|
-
let baseOptions;
|
|
4580
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
4581
|
-
const localVarRequestOptions = {
|
|
4582
|
-
method: "GET",
|
|
4583
|
-
...baseOptions,
|
|
4584
|
-
...options
|
|
4585
|
-
};
|
|
4586
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4587
|
-
const localVarQueryParameter = {};
|
|
4588
|
-
if (configuration?.authMode === "commercialApiKey") {
|
|
4589
|
-
await setApiKeyToObject({
|
|
4590
|
-
object: localVarQueryParameter,
|
|
4591
|
-
key: "clientId",
|
|
4592
|
-
keyParamName: "clientId",
|
|
4593
|
-
configuration
|
|
4594
|
-
});
|
|
4595
|
-
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
4596
|
-
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
4597
|
-
}
|
|
4598
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
4599
|
-
object: localVarQueryParameter,
|
|
4600
|
-
key: "clientId",
|
|
4601
|
-
keyParamName: "clientId",
|
|
4602
|
-
configuration
|
|
4603
|
-
});
|
|
4604
|
-
const localVarOperationAuth = {
|
|
4605
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4606
|
-
requestSigningByAuthMode: {
|
|
4607
|
-
"commercialApiKey": {
|
|
4608
|
-
secretParameter: "consumerKey",
|
|
4609
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4610
|
-
},
|
|
4611
|
-
"personalApiKey": {
|
|
4612
|
-
secretParameter: "consumerKey",
|
|
4613
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4614
|
-
}
|
|
4615
|
-
},
|
|
4616
|
-
selectedAuthMode: configuration?.authMode
|
|
4617
|
-
};
|
|
4618
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4619
|
-
localVarRequestOptions.headers = {
|
|
4620
|
-
...localVarHeaderParameter,
|
|
4621
|
-
...headersFromBaseOptions,
|
|
4622
|
-
...options.headers
|
|
4623
|
-
};
|
|
4624
|
-
requestBeforeHook({
|
|
4625
|
-
queryParameters: localVarQueryParameter,
|
|
4626
|
-
requestConfig: localVarRequestOptions,
|
|
4627
|
-
path: localVarPath,
|
|
4628
|
-
configuration,
|
|
4629
|
-
pathTemplate: "/accounts/{accountId}/options",
|
|
4630
|
-
httpMethod: "GET",
|
|
4631
|
-
operationAuth: localVarOperationAuth
|
|
4632
|
-
});
|
|
4633
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
4634
|
-
return {
|
|
4635
|
-
url: toPathString(localVarUrlObj),
|
|
4636
|
-
options: localVarRequestOptions
|
|
4637
|
-
};
|
|
4638
|
-
} };
|
|
4639
|
-
};
|
|
4640
|
-
/**
|
|
4641
|
-
* OptionsApi - functional programming interface
|
|
4642
|
-
* @export
|
|
4643
|
-
*/
|
|
4644
|
-
const OptionsApiFp = function(configuration) {
|
|
4645
|
-
const localVarAxiosParamCreator = OptionsApiAxiosParamCreator(configuration);
|
|
4646
|
-
return {
|
|
4647
|
-
/**
|
|
4648
|
-
* **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.
|
|
4649
|
-
* @summary List account option positions
|
|
4650
|
-
* @param {OptionsApiListOptionHoldingsRequest<TAuth>} requestParameters Request parameters.
|
|
4651
|
-
* @param {*} [options] Override http request option.
|
|
4652
|
-
* @deprecated
|
|
4653
|
-
* @throws {RequiredError}
|
|
4654
|
-
*/
|
|
4655
|
-
async listOptionHoldings(requestParameters, options) {
|
|
4656
|
-
return createRequestFunction(await localVarAxiosParamCreator.listOptionHoldings(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
|
|
4657
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4658
|
-
requestSigningByAuthMode: {
|
|
4659
|
-
"commercialApiKey": {
|
|
4660
|
-
secretParameter: "consumerKey",
|
|
4661
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4662
|
-
},
|
|
4663
|
-
"personalApiKey": {
|
|
4664
|
-
secretParameter: "consumerKey",
|
|
4665
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4666
|
-
}
|
|
4667
|
-
}
|
|
4668
|
-
});
|
|
4669
|
-
} };
|
|
4670
|
-
};
|
|
4671
|
-
/**
|
|
4672
|
-
* OptionsApi - factory interface
|
|
4673
|
-
* @export
|
|
4674
|
-
*/
|
|
4675
|
-
const OptionsApiFactory = function(configuration, basePath, axios) {
|
|
4676
|
-
const localVarFp = OptionsApiFp(configuration);
|
|
4677
|
-
return {
|
|
4678
|
-
/**
|
|
4679
|
-
* **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.
|
|
4680
|
-
* @summary List account option positions
|
|
4681
|
-
* @param {OptionsApiListOptionHoldingsRequest<TAuth>} requestParameters Request parameters.
|
|
4682
|
-
* @param {*} [options] Override http request option.
|
|
4683
|
-
* @deprecated
|
|
4684
|
-
* @throws {RequiredError}
|
|
4685
|
-
*/
|
|
4686
|
-
listOptionHoldings(requestParameters, options) {
|
|
4687
|
-
return localVarFp.listOptionHoldings(requestParameters, options).then((request) => request(axios, basePath));
|
|
4688
|
-
} };
|
|
4689
|
-
};
|
|
4690
|
-
/**
|
|
4691
|
-
* OptionsApiGenerated - object-oriented interface
|
|
4692
|
-
* @export
|
|
4693
|
-
* @class OptionsApiGenerated
|
|
4694
|
-
* @extends {BaseAPI}
|
|
4695
|
-
*/
|
|
4696
|
-
var OptionsApiGenerated = class extends BaseAPI {
|
|
4697
|
-
/**
|
|
4698
|
-
* **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.
|
|
4699
|
-
* @summary List account option positions
|
|
4700
|
-
* @param {OptionsApiListOptionHoldingsRequest<TAuth>} requestParameters Request parameters.
|
|
4701
|
-
* @param {*} [options] Override http request option.
|
|
4702
|
-
* @deprecated
|
|
4703
|
-
* @throws {RequiredError}
|
|
4704
|
-
* @memberof OptionsApiGenerated
|
|
4705
|
-
*/
|
|
4706
|
-
listOptionHoldings(requestParameters, options) {
|
|
4707
|
-
return OptionsApiFp(this.configuration).listOptionHoldings(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
4708
|
-
}
|
|
4709
|
-
};
|
|
4710
|
-
//#endregion
|
|
4711
|
-
//#region api/options-api.ts
|
|
4712
|
-
var OptionsApi = class extends OptionsApiGenerated {};
|
|
4713
|
-
//#endregion
|
|
4714
|
-
//#region api/reference-data-api-generated.ts
|
|
4715
|
-
/**
|
|
4716
|
-
* ReferenceDataApi - axios parameter creator
|
|
4717
|
-
* @export
|
|
4718
|
-
*/
|
|
4719
|
-
const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
4720
|
-
return {
|
|
4721
|
-
/**
|
|
4722
|
-
* Returns an Exchange Rate Pair object for the specified Currency Pair.
|
|
4723
|
-
* @summary Get exchange rate of a currency pair
|
|
4724
|
-
* @param {string} currencyPair A currency pair based on currency code for example, {CAD-USD}
|
|
4725
|
-
* @param {*} [options] Override http request option.
|
|
4726
|
-
* @throws {RequiredError}
|
|
4727
|
-
*/
|
|
4728
|
-
getCurrencyExchangeRatePair: async (currencyPair, options = {}) => {
|
|
4729
|
-
assertParamExists("getCurrencyExchangeRatePair", "currencyPair", currencyPair);
|
|
4730
|
-
const localVarPath = `/currencies/rates/{currencyPair}`.replace(`{currencyPair}`, encodeURIComponent(String(currencyPair !== void 0 ? currencyPair : `-currencyPair-`)));
|
|
4731
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
4732
|
-
let baseOptions;
|
|
4733
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
4734
|
-
const localVarRequestOptions = {
|
|
4735
|
-
method: "GET",
|
|
4736
|
-
...baseOptions,
|
|
4737
|
-
...options
|
|
4738
|
-
};
|
|
4739
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4740
|
-
const localVarQueryParameter = {};
|
|
4741
|
-
if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
|
|
4742
|
-
object: localVarQueryParameter,
|
|
4743
|
-
key: "clientId",
|
|
4744
|
-
keyParamName: "clientId",
|
|
4745
|
-
configuration
|
|
4746
|
-
});
|
|
4747
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
4748
|
-
object: localVarQueryParameter,
|
|
4749
|
-
key: "clientId",
|
|
4750
|
-
keyParamName: "clientId",
|
|
4751
|
-
configuration
|
|
4752
|
-
});
|
|
4753
|
-
const localVarOperationAuth = {
|
|
4754
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4755
|
-
requestSigningByAuthMode: {
|
|
4756
|
-
"commercialApiKey": {
|
|
4757
|
-
secretParameter: "consumerKey",
|
|
4758
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4759
|
-
},
|
|
4760
|
-
"personalApiKey": {
|
|
4761
|
-
secretParameter: "consumerKey",
|
|
4762
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4763
|
-
}
|
|
4764
|
-
},
|
|
4765
|
-
selectedAuthMode: configuration?.authMode
|
|
4766
|
-
};
|
|
4767
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4768
|
-
localVarRequestOptions.headers = {
|
|
4769
|
-
...localVarHeaderParameter,
|
|
4770
|
-
...headersFromBaseOptions,
|
|
4771
|
-
...options.headers
|
|
4772
|
-
};
|
|
4773
|
-
requestBeforeHook({
|
|
4774
|
-
queryParameters: localVarQueryParameter,
|
|
4775
|
-
requestConfig: localVarRequestOptions,
|
|
4776
|
-
path: localVarPath,
|
|
4777
|
-
configuration,
|
|
4778
|
-
pathTemplate: "/currencies/rates/{currencyPair}",
|
|
4779
|
-
httpMethod: "GET",
|
|
4780
|
-
operationAuth: localVarOperationAuth
|
|
4781
|
-
});
|
|
4782
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
4783
|
-
return {
|
|
4784
|
-
url: toPathString(localVarUrlObj),
|
|
4785
|
-
options: localVarRequestOptions
|
|
4786
|
-
};
|
|
4787
|
-
},
|
|
4788
|
-
/**
|
|
4789
|
-
* Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
|
|
4790
|
-
* @summary Get Client Info
|
|
4791
|
-
* @param {*} [options] Override http request option.
|
|
4792
|
-
* @throws {RequiredError}
|
|
4793
|
-
*/
|
|
4794
|
-
getPartnerInfo: async (options = {}) => {
|
|
4795
|
-
const localVarPath = `/snapTrade/partners`;
|
|
4796
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
4797
|
-
let baseOptions;
|
|
4798
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
4799
|
-
const localVarRequestOptions = {
|
|
4800
|
-
method: "GET",
|
|
4801
|
-
...baseOptions,
|
|
4802
|
-
...options
|
|
4803
|
-
};
|
|
4804
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4805
|
-
const localVarQueryParameter = {};
|
|
4806
|
-
if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
|
|
4807
|
-
object: localVarQueryParameter,
|
|
4808
|
-
key: "clientId",
|
|
4809
|
-
keyParamName: "clientId",
|
|
4810
|
-
configuration
|
|
4811
|
-
});
|
|
4812
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
4813
|
-
object: localVarQueryParameter,
|
|
4814
|
-
key: "clientId",
|
|
4815
|
-
keyParamName: "clientId",
|
|
4816
|
-
configuration
|
|
4817
|
-
});
|
|
4818
|
-
const localVarOperationAuth = {
|
|
4819
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4820
|
-
requestSigningByAuthMode: {
|
|
4821
|
-
"commercialApiKey": {
|
|
4822
|
-
secretParameter: "consumerKey",
|
|
4823
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4824
|
-
},
|
|
4825
|
-
"personalApiKey": {
|
|
4826
|
-
secretParameter: "consumerKey",
|
|
4827
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4828
|
-
}
|
|
4829
|
-
},
|
|
4830
|
-
selectedAuthMode: configuration?.authMode
|
|
4831
|
-
};
|
|
4832
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4833
|
-
localVarRequestOptions.headers = {
|
|
4834
|
-
...localVarHeaderParameter,
|
|
4835
|
-
...headersFromBaseOptions,
|
|
4836
|
-
...options.headers
|
|
4837
|
-
};
|
|
4838
|
-
requestBeforeHook({
|
|
4839
|
-
queryParameters: localVarQueryParameter,
|
|
4840
|
-
requestConfig: localVarRequestOptions,
|
|
4841
|
-
path: localVarPath,
|
|
4842
|
-
configuration,
|
|
4843
|
-
pathTemplate: "/snapTrade/partners",
|
|
4844
|
-
httpMethod: "GET",
|
|
4845
|
-
operationAuth: localVarOperationAuth
|
|
4846
|
-
});
|
|
4847
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
4848
|
-
return {
|
|
4849
|
-
url: toPathString(localVarUrlObj),
|
|
4850
|
-
options: localVarRequestOptions
|
|
4851
|
-
};
|
|
4852
|
-
},
|
|
4158
|
+
/**
|
|
4159
|
+
* Returns a list of recent orders in the specified account. The V2 order response format will include all legs of each order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
4160
|
+
* @summary List account orders v2
|
|
4161
|
+
* @param {ExperimentalEndpointsApiGetUserAccountOrdersV2Request<TAuth>} requestParameters Request parameters.
|
|
4162
|
+
* @param {*} [options] Override http request option.
|
|
4163
|
+
* @throws {RequiredError}
|
|
4164
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
4165
|
+
*/
|
|
4166
|
+
getUserAccountOrdersV2(requestParameters, options) {
|
|
4167
|
+
return ExperimentalEndpointsApiFp(this.configuration).getUserAccountOrdersV2(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
4168
|
+
}
|
|
4169
|
+
/**
|
|
4170
|
+
* A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account using the V2 order format. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from /orders in that it is realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
|
|
4171
|
+
* @summary List account recent orders (V2, last 24 hours only)
|
|
4172
|
+
* @param {ExperimentalEndpointsApiGetUserAccountRecentOrdersV2Request<TAuth>} requestParameters Request parameters.
|
|
4173
|
+
* @param {*} [options] Override http request option.
|
|
4174
|
+
* @throws {RequiredError}
|
|
4175
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
4176
|
+
*/
|
|
4177
|
+
getUserAccountRecentOrdersV2(requestParameters, options) {
|
|
4178
|
+
return ExperimentalEndpointsApiFp(this.configuration).getUserAccountRecentOrdersV2(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
4179
|
+
}
|
|
4180
|
+
/**
|
|
4181
|
+
* Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently only `investment` is implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema. On Pay as you Go / Real-time, this endpoint refreshes each account\'s opening date, funding date, and market value live from the brokerage on each call. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
|
|
4182
|
+
* @summary List accounts for a connection (discriminated union)
|
|
4183
|
+
* @param {ExperimentalEndpointsApiListConnectionAccountsRequest<TAuth>} requestParameters Request parameters.
|
|
4184
|
+
* @param {*} [options] Override http request option.
|
|
4185
|
+
* @throws {RequiredError}
|
|
4186
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
4187
|
+
*/
|
|
4188
|
+
listConnectionAccounts(requestParameters, options) {
|
|
4189
|
+
return ExperimentalEndpointsApiFp(this.configuration).listConnectionAccounts(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
4190
|
+
}
|
|
4191
|
+
/**
|
|
4192
|
+
* Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|
|
4193
|
+
* @summary List active Trade Detection subscriptions
|
|
4194
|
+
* @param {*} [options] Override http request option.
|
|
4195
|
+
* @throws {RequiredError}
|
|
4196
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
4197
|
+
*/
|
|
4198
|
+
listSubscriptions(...args) {
|
|
4199
|
+
return ExperimentalEndpointsApiFp(this.configuration).listSubscriptions(...args).then((request) => request(this.axios, this.basePath));
|
|
4200
|
+
}
|
|
4201
|
+
};
|
|
4202
|
+
//#endregion
|
|
4203
|
+
//#region api/experimental-endpoints-api.ts
|
|
4204
|
+
var ExperimentalEndpointsApi = class extends ExperimentalEndpointsApiGenerated {};
|
|
4205
|
+
//#endregion
|
|
4206
|
+
//#region api/reference-data-api-generated.ts
|
|
4207
|
+
/**
|
|
4208
|
+
* ReferenceDataApi - axios parameter creator
|
|
4209
|
+
* @export
|
|
4210
|
+
*/
|
|
4211
|
+
const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
4212
|
+
return {
|
|
4853
4213
|
/**
|
|
4854
|
-
*
|
|
4855
|
-
* @summary
|
|
4214
|
+
* Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
|
|
4215
|
+
* @summary Get Client Info
|
|
4856
4216
|
* @param {*} [options] Override http request option.
|
|
4857
4217
|
* @throws {RequiredError}
|
|
4858
4218
|
*/
|
|
4859
|
-
|
|
4860
|
-
const localVarPath = `/
|
|
4219
|
+
getPartnerInfo: async (options = {}) => {
|
|
4220
|
+
const localVarPath = `/snapTrade/partners`;
|
|
4861
4221
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
4862
4222
|
let baseOptions;
|
|
4863
4223
|
if (configuration) baseOptions = configuration.baseOptions;
|
|
@@ -4905,7 +4265,7 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
|
4905
4265
|
requestConfig: localVarRequestOptions,
|
|
4906
4266
|
path: localVarPath,
|
|
4907
4267
|
configuration,
|
|
4908
|
-
pathTemplate: "/
|
|
4268
|
+
pathTemplate: "/snapTrade/partners",
|
|
4909
4269
|
httpMethod: "GET",
|
|
4910
4270
|
operationAuth: localVarOperationAuth
|
|
4911
4271
|
});
|
|
@@ -5316,136 +4676,6 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
|
5316
4676
|
};
|
|
5317
4677
|
},
|
|
5318
4678
|
/**
|
|
5319
|
-
* Returns a list of all defined Currency objects.
|
|
5320
|
-
* @summary Get currencies
|
|
5321
|
-
* @param {*} [options] Override http request option.
|
|
5322
|
-
* @throws {RequiredError}
|
|
5323
|
-
*/
|
|
5324
|
-
listAllCurrencies: async (options = {}) => {
|
|
5325
|
-
const localVarPath = `/currencies`;
|
|
5326
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
5327
|
-
let baseOptions;
|
|
5328
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
5329
|
-
const localVarRequestOptions = {
|
|
5330
|
-
method: "GET",
|
|
5331
|
-
...baseOptions,
|
|
5332
|
-
...options
|
|
5333
|
-
};
|
|
5334
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
5335
|
-
const localVarQueryParameter = {};
|
|
5336
|
-
if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
|
|
5337
|
-
object: localVarQueryParameter,
|
|
5338
|
-
key: "clientId",
|
|
5339
|
-
keyParamName: "clientId",
|
|
5340
|
-
configuration
|
|
5341
|
-
});
|
|
5342
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
5343
|
-
object: localVarQueryParameter,
|
|
5344
|
-
key: "clientId",
|
|
5345
|
-
keyParamName: "clientId",
|
|
5346
|
-
configuration
|
|
5347
|
-
});
|
|
5348
|
-
const localVarOperationAuth = {
|
|
5349
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5350
|
-
requestSigningByAuthMode: {
|
|
5351
|
-
"commercialApiKey": {
|
|
5352
|
-
secretParameter: "consumerKey",
|
|
5353
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
5354
|
-
},
|
|
5355
|
-
"personalApiKey": {
|
|
5356
|
-
secretParameter: "consumerKey",
|
|
5357
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
5358
|
-
}
|
|
5359
|
-
},
|
|
5360
|
-
selectedAuthMode: configuration?.authMode
|
|
5361
|
-
};
|
|
5362
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
5363
|
-
localVarRequestOptions.headers = {
|
|
5364
|
-
...localVarHeaderParameter,
|
|
5365
|
-
...headersFromBaseOptions,
|
|
5366
|
-
...options.headers
|
|
5367
|
-
};
|
|
5368
|
-
requestBeforeHook({
|
|
5369
|
-
queryParameters: localVarQueryParameter,
|
|
5370
|
-
requestConfig: localVarRequestOptions,
|
|
5371
|
-
path: localVarPath,
|
|
5372
|
-
configuration,
|
|
5373
|
-
pathTemplate: "/currencies",
|
|
5374
|
-
httpMethod: "GET",
|
|
5375
|
-
operationAuth: localVarOperationAuth
|
|
5376
|
-
});
|
|
5377
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
5378
|
-
return {
|
|
5379
|
-
url: toPathString(localVarUrlObj),
|
|
5380
|
-
options: localVarRequestOptions
|
|
5381
|
-
};
|
|
5382
|
-
},
|
|
5383
|
-
/**
|
|
5384
|
-
* Returns a list of all Exchange Rate Pairs for all supported Currencies.
|
|
5385
|
-
* @summary Get currency exchange rates
|
|
5386
|
-
* @param {*} [options] Override http request option.
|
|
5387
|
-
* @throws {RequiredError}
|
|
5388
|
-
*/
|
|
5389
|
-
listAllCurrenciesRates: async (options = {}) => {
|
|
5390
|
-
const localVarPath = `/currencies/rates`;
|
|
5391
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
5392
|
-
let baseOptions;
|
|
5393
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
5394
|
-
const localVarRequestOptions = {
|
|
5395
|
-
method: "GET",
|
|
5396
|
-
...baseOptions,
|
|
5397
|
-
...options
|
|
5398
|
-
};
|
|
5399
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
5400
|
-
const localVarQueryParameter = {};
|
|
5401
|
-
if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
|
|
5402
|
-
object: localVarQueryParameter,
|
|
5403
|
-
key: "clientId",
|
|
5404
|
-
keyParamName: "clientId",
|
|
5405
|
-
configuration
|
|
5406
|
-
});
|
|
5407
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
5408
|
-
object: localVarQueryParameter,
|
|
5409
|
-
key: "clientId",
|
|
5410
|
-
keyParamName: "clientId",
|
|
5411
|
-
configuration
|
|
5412
|
-
});
|
|
5413
|
-
const localVarOperationAuth = {
|
|
5414
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5415
|
-
requestSigningByAuthMode: {
|
|
5416
|
-
"commercialApiKey": {
|
|
5417
|
-
secretParameter: "consumerKey",
|
|
5418
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
5419
|
-
},
|
|
5420
|
-
"personalApiKey": {
|
|
5421
|
-
secretParameter: "consumerKey",
|
|
5422
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
5423
|
-
}
|
|
5424
|
-
},
|
|
5425
|
-
selectedAuthMode: configuration?.authMode
|
|
5426
|
-
};
|
|
5427
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
5428
|
-
localVarRequestOptions.headers = {
|
|
5429
|
-
...localVarHeaderParameter,
|
|
5430
|
-
...headersFromBaseOptions,
|
|
5431
|
-
...options.headers
|
|
5432
|
-
};
|
|
5433
|
-
requestBeforeHook({
|
|
5434
|
-
queryParameters: localVarQueryParameter,
|
|
5435
|
-
requestConfig: localVarRequestOptions,
|
|
5436
|
-
path: localVarPath,
|
|
5437
|
-
configuration,
|
|
5438
|
-
pathTemplate: "/currencies/rates",
|
|
5439
|
-
httpMethod: "GET",
|
|
5440
|
-
operationAuth: localVarOperationAuth
|
|
5441
|
-
});
|
|
5442
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
5443
|
-
return {
|
|
5444
|
-
url: toPathString(localVarUrlObj),
|
|
5445
|
-
options: localVarRequestOptions
|
|
5446
|
-
};
|
|
5447
|
-
},
|
|
5448
|
-
/**
|
|
5449
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.
|
|
5450
4680
|
* @summary Search account symbols
|
|
5451
4681
|
* @param {string} accountId
|
|
@@ -5531,28 +4761,6 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
|
5531
4761
|
const ReferenceDataApiFp = function(configuration) {
|
|
5532
4762
|
const localVarAxiosParamCreator = ReferenceDataApiAxiosParamCreator(configuration);
|
|
5533
4763
|
return {
|
|
5534
|
-
/**
|
|
5535
|
-
* Returns an Exchange Rate Pair object for the specified Currency Pair.
|
|
5536
|
-
* @summary Get exchange rate of a currency pair
|
|
5537
|
-
* @param {ReferenceDataApiGetCurrencyExchangeRatePairRequest<TAuth>} requestParameters Request parameters.
|
|
5538
|
-
* @param {*} [options] Override http request option.
|
|
5539
|
-
* @throws {RequiredError}
|
|
5540
|
-
*/
|
|
5541
|
-
async getCurrencyExchangeRatePair(requestParameters, options) {
|
|
5542
|
-
return createRequestFunction(await localVarAxiosParamCreator.getCurrencyExchangeRatePair(requestParameters.currencyPair, options), globalAxios, BASE_PATH, configuration, {
|
|
5543
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5544
|
-
requestSigningByAuthMode: {
|
|
5545
|
-
"commercialApiKey": {
|
|
5546
|
-
secretParameter: "consumerKey",
|
|
5547
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
5548
|
-
},
|
|
5549
|
-
"personalApiKey": {
|
|
5550
|
-
secretParameter: "consumerKey",
|
|
5551
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
5552
|
-
}
|
|
5553
|
-
}
|
|
5554
|
-
});
|
|
5555
|
-
},
|
|
5556
4764
|
/**
|
|
5557
4765
|
* Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
|
|
5558
4766
|
* @summary Get Client Info
|
|
@@ -5576,28 +4784,6 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5576
4784
|
});
|
|
5577
4785
|
},
|
|
5578
4786
|
/**
|
|
5579
|
-
* Return all available security types supported by SnapTrade.
|
|
5580
|
-
* @summary List security types
|
|
5581
|
-
* @param {*} [options] Override http request option.
|
|
5582
|
-
* @throws {RequiredError}
|
|
5583
|
-
*/
|
|
5584
|
-
async getSecurityTypes(...args) {
|
|
5585
|
-
const [options] = args;
|
|
5586
|
-
return createRequestFunction(await localVarAxiosParamCreator.getSecurityTypes(options), globalAxios, BASE_PATH, configuration, {
|
|
5587
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5588
|
-
requestSigningByAuthMode: {
|
|
5589
|
-
"commercialApiKey": {
|
|
5590
|
-
secretParameter: "consumerKey",
|
|
5591
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
5592
|
-
},
|
|
5593
|
-
"personalApiKey": {
|
|
5594
|
-
secretParameter: "consumerKey",
|
|
5595
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
5596
|
-
}
|
|
5597
|
-
}
|
|
5598
|
-
});
|
|
5599
|
-
},
|
|
5600
|
-
/**
|
|
5601
4787
|
* Returns a list of all supported Exchanges.
|
|
5602
4788
|
* @summary Get exchanges
|
|
5603
4789
|
* @param {*} [options] Override http request option.
|
|
@@ -5649,52 +4835,8 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5649
4835
|
* @param {*} [options] Override http request option.
|
|
5650
4836
|
* @throws {RequiredError}
|
|
5651
4837
|
*/
|
|
5652
|
-
async getSymbolsByTicker(requestParameters, options) {
|
|
5653
|
-
return createRequestFunction(await localVarAxiosParamCreator.getSymbolsByTicker(requestParameters.query, options), globalAxios, BASE_PATH, configuration, {
|
|
5654
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5655
|
-
requestSigningByAuthMode: {
|
|
5656
|
-
"commercialApiKey": {
|
|
5657
|
-
secretParameter: "consumerKey",
|
|
5658
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
5659
|
-
},
|
|
5660
|
-
"personalApiKey": {
|
|
5661
|
-
secretParameter: "consumerKey",
|
|
5662
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
5663
|
-
}
|
|
5664
|
-
}
|
|
5665
|
-
});
|
|
5666
|
-
},
|
|
5667
|
-
/**
|
|
5668
|
-
* Returns a list of all defined Brokerage authorization Type objects.
|
|
5669
|
-
* @summary Get all brokerage authorization types
|
|
5670
|
-
* @param {ReferenceDataApiListAllBrokerageAuthorizationTypeRequest<TAuth>} requestParameters Request parameters.
|
|
5671
|
-
* @param {*} [options] Override http request option.
|
|
5672
|
-
* @throws {RequiredError}
|
|
5673
|
-
*/
|
|
5674
|
-
async listAllBrokerageAuthorizationType(requestParameters = {}, options) {
|
|
5675
|
-
return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerageAuthorizationType(requestParameters.brokerage, options), globalAxios, BASE_PATH, configuration, {
|
|
5676
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5677
|
-
requestSigningByAuthMode: {
|
|
5678
|
-
"commercialApiKey": {
|
|
5679
|
-
secretParameter: "consumerKey",
|
|
5680
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
5681
|
-
},
|
|
5682
|
-
"personalApiKey": {
|
|
5683
|
-
secretParameter: "consumerKey",
|
|
5684
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
5685
|
-
}
|
|
5686
|
-
}
|
|
5687
|
-
});
|
|
5688
|
-
},
|
|
5689
|
-
/**
|
|
5690
|
-
* 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.
|
|
5691
|
-
* @summary Get brokerage instruments
|
|
5692
|
-
* @param {ReferenceDataApiListAllBrokerageInstrumentsRequest<TAuth>} requestParameters Request parameters.
|
|
5693
|
-
* @param {*} [options] Override http request option.
|
|
5694
|
-
* @throws {RequiredError}
|
|
5695
|
-
*/
|
|
5696
|
-
async listAllBrokerageInstruments(requestParameters, options) {
|
|
5697
|
-
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, {
|
|
5698
4840
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5699
4841
|
requestSigningByAuthMode: {
|
|
5700
4842
|
"commercialApiKey": {
|
|
@@ -5709,14 +4851,14 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5709
4851
|
});
|
|
5710
4852
|
},
|
|
5711
4853
|
/**
|
|
5712
|
-
* Returns a list of all defined Brokerage objects.
|
|
5713
|
-
* @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.
|
|
5714
4857
|
* @param {*} [options] Override http request option.
|
|
5715
4858
|
* @throws {RequiredError}
|
|
5716
4859
|
*/
|
|
5717
|
-
async
|
|
5718
|
-
|
|
5719
|
-
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, {
|
|
5720
4862
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5721
4863
|
requestSigningByAuthMode: {
|
|
5722
4864
|
"commercialApiKey": {
|
|
@@ -5731,14 +4873,14 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5731
4873
|
});
|
|
5732
4874
|
},
|
|
5733
4875
|
/**
|
|
5734
|
-
* Returns a list of all
|
|
5735
|
-
* @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.
|
|
5736
4879
|
* @param {*} [options] Override http request option.
|
|
5737
4880
|
* @throws {RequiredError}
|
|
5738
4881
|
*/
|
|
5739
|
-
async
|
|
5740
|
-
|
|
5741
|
-
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, {
|
|
5742
4884
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5743
4885
|
requestSigningByAuthMode: {
|
|
5744
4886
|
"commercialApiKey": {
|
|
@@ -5753,14 +4895,14 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5753
4895
|
});
|
|
5754
4896
|
},
|
|
5755
4897
|
/**
|
|
5756
|
-
* Returns a list of all
|
|
5757
|
-
* @summary Get
|
|
4898
|
+
* Returns a list of all defined Brokerage objects.
|
|
4899
|
+
* @summary Get brokerages
|
|
5758
4900
|
* @param {*} [options] Override http request option.
|
|
5759
4901
|
* @throws {RequiredError}
|
|
5760
4902
|
*/
|
|
5761
|
-
async
|
|
4903
|
+
async listAllBrokerages(...args) {
|
|
5762
4904
|
const [options] = args;
|
|
5763
|
-
return createRequestFunction(await localVarAxiosParamCreator.
|
|
4905
|
+
return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerages(options), globalAxios, BASE_PATH, configuration, {
|
|
5764
4906
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5765
4907
|
requestSigningByAuthMode: {
|
|
5766
4908
|
"commercialApiKey": {
|
|
@@ -5806,16 +4948,6 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5806
4948
|
const ReferenceDataApiFactory = function(configuration, basePath, axios) {
|
|
5807
4949
|
const localVarFp = ReferenceDataApiFp(configuration);
|
|
5808
4950
|
return {
|
|
5809
|
-
/**
|
|
5810
|
-
* Returns an Exchange Rate Pair object for the specified Currency Pair.
|
|
5811
|
-
* @summary Get exchange rate of a currency pair
|
|
5812
|
-
* @param {ReferenceDataApiGetCurrencyExchangeRatePairRequest<TAuth>} requestParameters Request parameters.
|
|
5813
|
-
* @param {*} [options] Override http request option.
|
|
5814
|
-
* @throws {RequiredError}
|
|
5815
|
-
*/
|
|
5816
|
-
getCurrencyExchangeRatePair(requestParameters, options) {
|
|
5817
|
-
return localVarFp.getCurrencyExchangeRatePair(requestParameters, options).then((request) => request(axios, basePath));
|
|
5818
|
-
},
|
|
5819
4951
|
/**
|
|
5820
4952
|
* Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
|
|
5821
4953
|
* @summary Get Client Info
|
|
@@ -5826,15 +4958,6 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios) {
|
|
|
5826
4958
|
return localVarFp.getPartnerInfo(...args).then((request) => request(axios, basePath));
|
|
5827
4959
|
},
|
|
5828
4960
|
/**
|
|
5829
|
-
* Return all available security types supported by SnapTrade.
|
|
5830
|
-
* @summary List security types
|
|
5831
|
-
* @param {*} [options] Override http request option.
|
|
5832
|
-
* @throws {RequiredError}
|
|
5833
|
-
*/
|
|
5834
|
-
getSecurityTypes(...args) {
|
|
5835
|
-
return localVarFp.getSecurityTypes(...args).then((request) => request(axios, basePath));
|
|
5836
|
-
},
|
|
5837
|
-
/**
|
|
5838
4961
|
* Returns a list of all supported Exchanges.
|
|
5839
4962
|
* @summary Get exchanges
|
|
5840
4963
|
* @param {*} [options] Override http request option.
|
|
@@ -5893,24 +5016,6 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios) {
|
|
|
5893
5016
|
return localVarFp.listAllBrokerages(...args).then((request) => request(axios, basePath));
|
|
5894
5017
|
},
|
|
5895
5018
|
/**
|
|
5896
|
-
* Returns a list of all defined Currency objects.
|
|
5897
|
-
* @summary Get currencies
|
|
5898
|
-
* @param {*} [options] Override http request option.
|
|
5899
|
-
* @throws {RequiredError}
|
|
5900
|
-
*/
|
|
5901
|
-
listAllCurrencies(...args) {
|
|
5902
|
-
return localVarFp.listAllCurrencies(...args).then((request) => request(axios, basePath));
|
|
5903
|
-
},
|
|
5904
|
-
/**
|
|
5905
|
-
* Returns a list of all Exchange Rate Pairs for all supported Currencies.
|
|
5906
|
-
* @summary Get currency exchange rates
|
|
5907
|
-
* @param {*} [options] Override http request option.
|
|
5908
|
-
* @throws {RequiredError}
|
|
5909
|
-
*/
|
|
5910
|
-
listAllCurrenciesRates(...args) {
|
|
5911
|
-
return localVarFp.listAllCurrenciesRates(...args).then((request) => request(axios, basePath));
|
|
5912
|
-
},
|
|
5913
|
-
/**
|
|
5914
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.
|
|
5915
5020
|
* @summary Search account symbols
|
|
5916
5021
|
* @param {ReferenceDataApiSymbolSearchUserAccountRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -5929,17 +5034,6 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios) {
|
|
|
5929
5034
|
* @extends {BaseAPI}
|
|
5930
5035
|
*/
|
|
5931
5036
|
var ReferenceDataApiGenerated = class extends BaseAPI {
|
|
5932
|
-
/**
|
|
5933
|
-
* Returns an Exchange Rate Pair object for the specified Currency Pair.
|
|
5934
|
-
* @summary Get exchange rate of a currency pair
|
|
5935
|
-
* @param {ReferenceDataApiGetCurrencyExchangeRatePairRequest<TAuth>} requestParameters Request parameters.
|
|
5936
|
-
* @param {*} [options] Override http request option.
|
|
5937
|
-
* @throws {RequiredError}
|
|
5938
|
-
* @memberof ReferenceDataApiGenerated
|
|
5939
|
-
*/
|
|
5940
|
-
getCurrencyExchangeRatePair(requestParameters, options) {
|
|
5941
|
-
return ReferenceDataApiFp(this.configuration).getCurrencyExchangeRatePair(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
5942
|
-
}
|
|
5943
5037
|
/**
|
|
5944
5038
|
* Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
|
|
5945
5039
|
* @summary Get Client Info
|
|
@@ -5951,16 +5045,6 @@ var ReferenceDataApiGenerated = class extends BaseAPI {
|
|
|
5951
5045
|
return ReferenceDataApiFp(this.configuration).getPartnerInfo(...args).then((request) => request(this.axios, this.basePath));
|
|
5952
5046
|
}
|
|
5953
5047
|
/**
|
|
5954
|
-
* Return all available security types supported by SnapTrade.
|
|
5955
|
-
* @summary List security types
|
|
5956
|
-
* @param {*} [options] Override http request option.
|
|
5957
|
-
* @throws {RequiredError}
|
|
5958
|
-
* @memberof ReferenceDataApiGenerated
|
|
5959
|
-
*/
|
|
5960
|
-
getSecurityTypes(...args) {
|
|
5961
|
-
return ReferenceDataApiFp(this.configuration).getSecurityTypes(...args).then((request) => request(this.axios, this.basePath));
|
|
5962
|
-
}
|
|
5963
|
-
/**
|
|
5964
5048
|
* Returns a list of all supported Exchanges.
|
|
5965
5049
|
* @summary Get exchanges
|
|
5966
5050
|
* @param {*} [options] Override http request option.
|
|
@@ -6025,26 +5109,6 @@ var ReferenceDataApiGenerated = class extends BaseAPI {
|
|
|
6025
5109
|
return ReferenceDataApiFp(this.configuration).listAllBrokerages(...args).then((request) => request(this.axios, this.basePath));
|
|
6026
5110
|
}
|
|
6027
5111
|
/**
|
|
6028
|
-
* Returns a list of all defined Currency objects.
|
|
6029
|
-
* @summary Get currencies
|
|
6030
|
-
* @param {*} [options] Override http request option.
|
|
6031
|
-
* @throws {RequiredError}
|
|
6032
|
-
* @memberof ReferenceDataApiGenerated
|
|
6033
|
-
*/
|
|
6034
|
-
listAllCurrencies(...args) {
|
|
6035
|
-
return ReferenceDataApiFp(this.configuration).listAllCurrencies(...args).then((request) => request(this.axios, this.basePath));
|
|
6036
|
-
}
|
|
6037
|
-
/**
|
|
6038
|
-
* Returns a list of all Exchange Rate Pairs for all supported Currencies.
|
|
6039
|
-
* @summary Get currency exchange rates
|
|
6040
|
-
* @param {*} [options] Override http request option.
|
|
6041
|
-
* @throws {RequiredError}
|
|
6042
|
-
* @memberof ReferenceDataApiGenerated
|
|
6043
|
-
*/
|
|
6044
|
-
listAllCurrenciesRates(...args) {
|
|
6045
|
-
return ReferenceDataApiFp(this.configuration).listAllCurrenciesRates(...args).then((request) => request(this.axios, this.basePath));
|
|
6046
|
-
}
|
|
6047
|
-
/**
|
|
6048
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.
|
|
6049
5113
|
* @summary Search account symbols
|
|
6050
5114
|
* @param {ReferenceDataApiSymbolSearchUserAccountRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -6146,85 +5210,6 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
6146
5210
|
};
|
|
6147
5211
|
},
|
|
6148
5212
|
/**
|
|
6149
|
-
* **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.
|
|
6150
|
-
* @summary Cancel equity order
|
|
6151
|
-
* @param {string} accountId
|
|
6152
|
-
* @param {AccountInformationGetUserAccountOrderDetailRequest} accountInformationGetUserAccountOrderDetailRequest
|
|
6153
|
-
* @param {string} [userId]
|
|
6154
|
-
* @param {string} [userSecret]
|
|
6155
|
-
* @param {*} [options] Override http request option.
|
|
6156
|
-
* @deprecated
|
|
6157
|
-
* @throws {RequiredError}
|
|
6158
|
-
*/
|
|
6159
|
-
cancelUserAccountOrder: async (accountId, accountInformationGetUserAccountOrderDetailRequest, userId, userSecret, options = {}) => {
|
|
6160
|
-
assertParamExists("cancelUserAccountOrder", "accountId", accountId);
|
|
6161
|
-
assertParamExists("cancelUserAccountOrder", "accountInformationGetUserAccountOrderDetailRequest", accountInformationGetUserAccountOrderDetailRequest);
|
|
6162
|
-
const localVarPath = `/accounts/{accountId}/orders/cancel`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
|
|
6163
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
6164
|
-
let baseOptions;
|
|
6165
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
6166
|
-
const localVarRequestOptions = {
|
|
6167
|
-
method: "POST",
|
|
6168
|
-
...baseOptions,
|
|
6169
|
-
...options
|
|
6170
|
-
};
|
|
6171
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
6172
|
-
const localVarQueryParameter = {};
|
|
6173
|
-
if (configuration?.authMode === "commercialApiKey") {
|
|
6174
|
-
await setApiKeyToObject({
|
|
6175
|
-
object: localVarQueryParameter,
|
|
6176
|
-
key: "clientId",
|
|
6177
|
-
keyParamName: "clientId",
|
|
6178
|
-
configuration
|
|
6179
|
-
});
|
|
6180
|
-
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
6181
|
-
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
6182
|
-
}
|
|
6183
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
6184
|
-
object: localVarQueryParameter,
|
|
6185
|
-
key: "clientId",
|
|
6186
|
-
keyParamName: "clientId",
|
|
6187
|
-
configuration
|
|
6188
|
-
});
|
|
6189
|
-
const localVarOperationAuth = {
|
|
6190
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
6191
|
-
requestSigningByAuthMode: {
|
|
6192
|
-
"commercialApiKey": {
|
|
6193
|
-
secretParameter: "consumerKey",
|
|
6194
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
6195
|
-
},
|
|
6196
|
-
"personalApiKey": {
|
|
6197
|
-
secretParameter: "consumerKey",
|
|
6198
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
6199
|
-
}
|
|
6200
|
-
},
|
|
6201
|
-
selectedAuthMode: configuration?.authMode
|
|
6202
|
-
};
|
|
6203
|
-
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
6204
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
6205
|
-
localVarRequestOptions.headers = {
|
|
6206
|
-
...localVarHeaderParameter,
|
|
6207
|
-
...headersFromBaseOptions,
|
|
6208
|
-
...options.headers
|
|
6209
|
-
};
|
|
6210
|
-
requestBeforeHook({
|
|
6211
|
-
requestBody: accountInformationGetUserAccountOrderDetailRequest,
|
|
6212
|
-
queryParameters: localVarQueryParameter,
|
|
6213
|
-
requestConfig: localVarRequestOptions,
|
|
6214
|
-
path: localVarPath,
|
|
6215
|
-
configuration,
|
|
6216
|
-
pathTemplate: "/accounts/{accountId}/orders/cancel",
|
|
6217
|
-
httpMethod: "POST",
|
|
6218
|
-
operationAuth: localVarOperationAuth
|
|
6219
|
-
});
|
|
6220
|
-
localVarRequestOptions.data = serializeDataIfNeeded(accountInformationGetUserAccountOrderDetailRequest, localVarRequestOptions, configuration);
|
|
6221
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
6222
|
-
return {
|
|
6223
|
-
url: toPathString(localVarUrlObj),
|
|
6224
|
-
options: localVarRequestOptions
|
|
6225
|
-
};
|
|
6226
|
-
},
|
|
6227
|
-
/**
|
|
6228
5213
|
* Gets a quote for the specified account.
|
|
6229
5214
|
* @summary Get crypto pair quote
|
|
6230
5215
|
* @param {string} accountId
|
|
@@ -6608,85 +5593,6 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
6608
5593
|
};
|
|
6609
5594
|
},
|
|
6610
5595
|
/**
|
|
6611
|
-
* **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
|
|
6612
|
-
* @summary Place bracket order
|
|
6613
|
-
* @param {string} accountId The ID of the account to execute the trade on.
|
|
6614
|
-
* @param {ManualTradeFormBracket} manualTradeFormBracket
|
|
6615
|
-
* @param {string} [userId]
|
|
6616
|
-
* @param {string} [userSecret]
|
|
6617
|
-
* @param {*} [options] Override http request option.
|
|
6618
|
-
* @deprecated
|
|
6619
|
-
* @throws {RequiredError}
|
|
6620
|
-
*/
|
|
6621
|
-
placeBracketOrder: async (accountId, manualTradeFormBracket, userId, userSecret, options = {}) => {
|
|
6622
|
-
assertParamExists("placeBracketOrder", "accountId", accountId);
|
|
6623
|
-
assertParamExists("placeBracketOrder", "manualTradeFormBracket", manualTradeFormBracket);
|
|
6624
|
-
const localVarPath = `/accounts/{accountId}/trading/bracket`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
|
|
6625
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
6626
|
-
let baseOptions;
|
|
6627
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
6628
|
-
const localVarRequestOptions = {
|
|
6629
|
-
method: "POST",
|
|
6630
|
-
...baseOptions,
|
|
6631
|
-
...options
|
|
6632
|
-
};
|
|
6633
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
6634
|
-
const localVarQueryParameter = {};
|
|
6635
|
-
if (configuration?.authMode === "commercialApiKey") {
|
|
6636
|
-
await setApiKeyToObject({
|
|
6637
|
-
object: localVarQueryParameter,
|
|
6638
|
-
key: "clientId",
|
|
6639
|
-
keyParamName: "clientId",
|
|
6640
|
-
configuration
|
|
6641
|
-
});
|
|
6642
|
-
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
6643
|
-
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
6644
|
-
}
|
|
6645
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
6646
|
-
object: localVarQueryParameter,
|
|
6647
|
-
key: "clientId",
|
|
6648
|
-
keyParamName: "clientId",
|
|
6649
|
-
configuration
|
|
6650
|
-
});
|
|
6651
|
-
const localVarOperationAuth = {
|
|
6652
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
6653
|
-
requestSigningByAuthMode: {
|
|
6654
|
-
"commercialApiKey": {
|
|
6655
|
-
secretParameter: "consumerKey",
|
|
6656
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
6657
|
-
},
|
|
6658
|
-
"personalApiKey": {
|
|
6659
|
-
secretParameter: "consumerKey",
|
|
6660
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
6661
|
-
}
|
|
6662
|
-
},
|
|
6663
|
-
selectedAuthMode: configuration?.authMode
|
|
6664
|
-
};
|
|
6665
|
-
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
6666
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
6667
|
-
localVarRequestOptions.headers = {
|
|
6668
|
-
...localVarHeaderParameter,
|
|
6669
|
-
...headersFromBaseOptions,
|
|
6670
|
-
...options.headers
|
|
6671
|
-
};
|
|
6672
|
-
requestBeforeHook({
|
|
6673
|
-
requestBody: manualTradeFormBracket,
|
|
6674
|
-
queryParameters: localVarQueryParameter,
|
|
6675
|
-
requestConfig: localVarRequestOptions,
|
|
6676
|
-
path: localVarPath,
|
|
6677
|
-
configuration,
|
|
6678
|
-
pathTemplate: "/accounts/{accountId}/trading/bracket",
|
|
6679
|
-
httpMethod: "POST",
|
|
6680
|
-
operationAuth: localVarOperationAuth
|
|
6681
|
-
});
|
|
6682
|
-
localVarRequestOptions.data = serializeDataIfNeeded(manualTradeFormBracket, localVarRequestOptions, configuration);
|
|
6683
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
6684
|
-
return {
|
|
6685
|
-
url: toPathString(localVarUrlObj),
|
|
6686
|
-
options: localVarRequestOptions
|
|
6687
|
-
};
|
|
6688
|
-
},
|
|
6689
|
-
/**
|
|
6690
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.
|
|
6691
5597
|
* @summary Place complex order
|
|
6692
5598
|
* @param {string} accountId The ID of the account to execute the trade on.
|
|
@@ -7339,30 +6245,6 @@ const TradingApiFp = function(configuration) {
|
|
|
7339
6245
|
});
|
|
7340
6246
|
},
|
|
7341
6247
|
/**
|
|
7342
|
-
* **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.
|
|
7343
|
-
* @summary Cancel equity order
|
|
7344
|
-
* @param {TradingApiCancelUserAccountOrderRequest<TAuth>} requestParameters Request parameters.
|
|
7345
|
-
* @param {*} [options] Override http request option.
|
|
7346
|
-
* @deprecated
|
|
7347
|
-
* @throws {RequiredError}
|
|
7348
|
-
*/
|
|
7349
|
-
async cancelUserAccountOrder(requestParameters, options) {
|
|
7350
|
-
const accountInformationGetUserAccountOrderDetailRequest = { brokerage_order_id: requestParameters.brokerage_order_id };
|
|
7351
|
-
return createRequestFunction(await localVarAxiosParamCreator.cancelUserAccountOrder(requestParameters.accountId, accountInformationGetUserAccountOrderDetailRequest, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
|
|
7352
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
7353
|
-
requestSigningByAuthMode: {
|
|
7354
|
-
"commercialApiKey": {
|
|
7355
|
-
secretParameter: "consumerKey",
|
|
7356
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
7357
|
-
},
|
|
7358
|
-
"personalApiKey": {
|
|
7359
|
-
secretParameter: "consumerKey",
|
|
7360
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
7361
|
-
}
|
|
7362
|
-
}
|
|
7363
|
-
});
|
|
7364
|
-
},
|
|
7365
|
-
/**
|
|
7366
6248
|
* Gets a quote for the specified account.
|
|
7367
6249
|
* @summary Get crypto pair quote
|
|
7368
6250
|
* @param {TradingApiGetCryptocurrencyPairQuoteRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -7474,44 +6356,10 @@ const TradingApiFp = function(configuration) {
|
|
|
7474
6356
|
* @summary Get equity symbol quotes
|
|
7475
6357
|
* @param {TradingApiGetUserAccountQuotesRequest<TAuth>} requestParameters Request parameters.
|
|
7476
6358
|
* @param {*} [options] Override http request option.
|
|
7477
|
-
* @throws {RequiredError}
|
|
7478
|
-
*/
|
|
7479
|
-
async getUserAccountQuotes(requestParameters, options) {
|
|
7480
|
-
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountQuotes(requestParameters.symbols, requestParameters.accountId, requestParameters.useTicker, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
|
|
7481
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
7482
|
-
requestSigningByAuthMode: {
|
|
7483
|
-
"commercialApiKey": {
|
|
7484
|
-
secretParameter: "consumerKey",
|
|
7485
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
7486
|
-
},
|
|
7487
|
-
"personalApiKey": {
|
|
7488
|
-
secretParameter: "consumerKey",
|
|
7489
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
7490
|
-
}
|
|
7491
|
-
}
|
|
7492
|
-
});
|
|
7493
|
-
},
|
|
7494
|
-
/**
|
|
7495
|
-
* **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
|
|
7496
|
-
* @summary Place bracket order
|
|
7497
|
-
* @param {TradingApiPlaceBracketOrderRequest<TAuth>} requestParameters Request parameters.
|
|
7498
|
-
* @param {*} [options] Override http request option.
|
|
7499
|
-
* @deprecated
|
|
7500
|
-
* @throws {RequiredError}
|
|
7501
|
-
*/
|
|
7502
|
-
async placeBracketOrder(requestParameters, options) {
|
|
7503
|
-
const manualTradeFormBracket = {
|
|
7504
|
-
action: requestParameters.action,
|
|
7505
|
-
instrument: requestParameters.instrument,
|
|
7506
|
-
order_type: requestParameters.order_type,
|
|
7507
|
-
time_in_force: requestParameters.time_in_force,
|
|
7508
|
-
price: requestParameters.price,
|
|
7509
|
-
stop: requestParameters.stop,
|
|
7510
|
-
units: requestParameters.units,
|
|
7511
|
-
stop_loss: requestParameters.stop_loss,
|
|
7512
|
-
take_profit: requestParameters.take_profit
|
|
7513
|
-
};
|
|
7514
|
-
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, {
|
|
7515
6363
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
7516
6364
|
requestSigningByAuthMode: {
|
|
7517
6365
|
"commercialApiKey": {
|
|
@@ -7782,17 +6630,6 @@ const TradingApiFactory = function(configuration, basePath, axios) {
|
|
|
7782
6630
|
return localVarFp.cancelOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
7783
6631
|
},
|
|
7784
6632
|
/**
|
|
7785
|
-
* **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.
|
|
7786
|
-
* @summary Cancel equity order
|
|
7787
|
-
* @param {TradingApiCancelUserAccountOrderRequest<TAuth>} requestParameters Request parameters.
|
|
7788
|
-
* @param {*} [options] Override http request option.
|
|
7789
|
-
* @deprecated
|
|
7790
|
-
* @throws {RequiredError}
|
|
7791
|
-
*/
|
|
7792
|
-
cancelUserAccountOrder(requestParameters, options) {
|
|
7793
|
-
return localVarFp.cancelUserAccountOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
7794
|
-
},
|
|
7795
|
-
/**
|
|
7796
6633
|
* Gets a quote for the specified account.
|
|
7797
6634
|
* @summary Get crypto pair quote
|
|
7798
6635
|
* @param {TradingApiGetCryptocurrencyPairQuoteRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -7843,17 +6680,6 @@ const TradingApiFactory = function(configuration, basePath, axios) {
|
|
|
7843
6680
|
return localVarFp.getUserAccountQuotes(requestParameters, options).then((request) => request(axios, basePath));
|
|
7844
6681
|
},
|
|
7845
6682
|
/**
|
|
7846
|
-
* **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
|
|
7847
|
-
* @summary Place bracket order
|
|
7848
|
-
* @param {TradingApiPlaceBracketOrderRequest<TAuth>} requestParameters Request parameters.
|
|
7849
|
-
* @param {*} [options] Override http request option.
|
|
7850
|
-
* @deprecated
|
|
7851
|
-
* @throws {RequiredError}
|
|
7852
|
-
*/
|
|
7853
|
-
placeBracketOrder(requestParameters, options) {
|
|
7854
|
-
return localVarFp.placeBracketOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
7855
|
-
},
|
|
7856
|
-
/**
|
|
7857
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.
|
|
7858
6684
|
* @summary Place complex order
|
|
7859
6685
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -7954,18 +6780,6 @@ var TradingApiGenerated = class extends BaseAPI {
|
|
|
7954
6780
|
return TradingApiFp(this.configuration).cancelOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
7955
6781
|
}
|
|
7956
6782
|
/**
|
|
7957
|
-
* **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.
|
|
7958
|
-
* @summary Cancel equity order
|
|
7959
|
-
* @param {TradingApiCancelUserAccountOrderRequest<TAuth>} requestParameters Request parameters.
|
|
7960
|
-
* @param {*} [options] Override http request option.
|
|
7961
|
-
* @deprecated
|
|
7962
|
-
* @throws {RequiredError}
|
|
7963
|
-
* @memberof TradingApiGenerated
|
|
7964
|
-
*/
|
|
7965
|
-
cancelUserAccountOrder(requestParameters, options) {
|
|
7966
|
-
return TradingApiFp(this.configuration).cancelUserAccountOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
7967
|
-
}
|
|
7968
|
-
/**
|
|
7969
6783
|
* Gets a quote for the specified account.
|
|
7970
6784
|
* @summary Get crypto pair quote
|
|
7971
6785
|
* @param {TradingApiGetCryptocurrencyPairQuoteRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -8021,18 +6835,6 @@ var TradingApiGenerated = class extends BaseAPI {
|
|
|
8021
6835
|
return TradingApiFp(this.configuration).getUserAccountQuotes(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
8022
6836
|
}
|
|
8023
6837
|
/**
|
|
8024
|
-
* **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
|
|
8025
|
-
* @summary Place bracket order
|
|
8026
|
-
* @param {TradingApiPlaceBracketOrderRequest<TAuth>} requestParameters Request parameters.
|
|
8027
|
-
* @param {*} [options] Override http request option.
|
|
8028
|
-
* @deprecated
|
|
8029
|
-
* @throws {RequiredError}
|
|
8030
|
-
* @memberof TradingApiGenerated
|
|
8031
|
-
*/
|
|
8032
|
-
placeBracketOrder(requestParameters, options) {
|
|
8033
|
-
return TradingApiFp(this.configuration).placeBracketOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
8034
|
-
}
|
|
8035
|
-
/**
|
|
8036
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.
|
|
8037
6839
|
* @summary Place complex order
|
|
8038
6840
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -8125,303 +6927,6 @@ var TradingApiGenerated = class extends BaseAPI {
|
|
|
8125
6927
|
//#region api/trading-api.ts
|
|
8126
6928
|
var TradingApi = class extends TradingApiGenerated {};
|
|
8127
6929
|
//#endregion
|
|
8128
|
-
//#region api/transactions-and-reporting-api-generated.ts
|
|
8129
|
-
/**
|
|
8130
|
-
* TransactionsAndReportingApi - axios parameter creator
|
|
8131
|
-
* @export
|
|
8132
|
-
*/
|
|
8133
|
-
const TransactionsAndReportingApiAxiosParamCreator = function(configuration) {
|
|
8134
|
-
return {
|
|
8135
|
-
/**
|
|
8136
|
-
* **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.
|
|
8137
|
-
* @summary Get transaction history for a user
|
|
8138
|
-
* @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`.
|
|
8139
|
-
* @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`.
|
|
8140
|
-
* @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.
|
|
8141
|
-
* @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.
|
|
8142
|
-
* @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
|
|
8143
|
-
* @param {string} [userId]
|
|
8144
|
-
* @param {string} [userSecret]
|
|
8145
|
-
* @param {*} [options] Override http request option.
|
|
8146
|
-
* @deprecated
|
|
8147
|
-
* @throws {RequiredError}
|
|
8148
|
-
*/
|
|
8149
|
-
getActivities: async (startDate, endDate, accounts, brokerageAuthorizations, type, userId, userSecret, options = {}) => {
|
|
8150
|
-
const localVarPath = `/activities`;
|
|
8151
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
8152
|
-
let baseOptions;
|
|
8153
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
8154
|
-
const localVarRequestOptions = {
|
|
8155
|
-
method: "GET",
|
|
8156
|
-
...baseOptions,
|
|
8157
|
-
...options
|
|
8158
|
-
};
|
|
8159
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
8160
|
-
const localVarQueryParameter = {};
|
|
8161
|
-
if (configuration?.authMode === "commercialApiKey") {
|
|
8162
|
-
await setApiKeyToObject({
|
|
8163
|
-
object: localVarQueryParameter,
|
|
8164
|
-
key: "clientId",
|
|
8165
|
-
keyParamName: "clientId",
|
|
8166
|
-
configuration
|
|
8167
|
-
});
|
|
8168
|
-
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
8169
|
-
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
8170
|
-
}
|
|
8171
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
8172
|
-
object: localVarQueryParameter,
|
|
8173
|
-
key: "clientId",
|
|
8174
|
-
keyParamName: "clientId",
|
|
8175
|
-
configuration
|
|
8176
|
-
});
|
|
8177
|
-
if (startDate !== void 0) localVarQueryParameter["startDate"] = startDate instanceof Date ? startDate.toISOString().substr(0, 10) : startDate;
|
|
8178
|
-
if (endDate !== void 0) localVarQueryParameter["endDate"] = endDate instanceof Date ? endDate.toISOString().substr(0, 10) : endDate;
|
|
8179
|
-
if (accounts !== void 0) localVarQueryParameter["accounts"] = accounts;
|
|
8180
|
-
if (brokerageAuthorizations !== void 0) localVarQueryParameter["brokerageAuthorizations"] = brokerageAuthorizations;
|
|
8181
|
-
if (type !== void 0) localVarQueryParameter["type"] = type;
|
|
8182
|
-
const localVarOperationAuth = {
|
|
8183
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
8184
|
-
requestSigningByAuthMode: {
|
|
8185
|
-
"commercialApiKey": {
|
|
8186
|
-
secretParameter: "consumerKey",
|
|
8187
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
8188
|
-
},
|
|
8189
|
-
"personalApiKey": {
|
|
8190
|
-
secretParameter: "consumerKey",
|
|
8191
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
8192
|
-
}
|
|
8193
|
-
},
|
|
8194
|
-
selectedAuthMode: configuration?.authMode
|
|
8195
|
-
};
|
|
8196
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
8197
|
-
localVarRequestOptions.headers = {
|
|
8198
|
-
...localVarHeaderParameter,
|
|
8199
|
-
...headersFromBaseOptions,
|
|
8200
|
-
...options.headers
|
|
8201
|
-
};
|
|
8202
|
-
requestBeforeHook({
|
|
8203
|
-
queryParameters: localVarQueryParameter,
|
|
8204
|
-
requestConfig: localVarRequestOptions,
|
|
8205
|
-
path: localVarPath,
|
|
8206
|
-
configuration,
|
|
8207
|
-
pathTemplate: "/activities",
|
|
8208
|
-
httpMethod: "GET",
|
|
8209
|
-
operationAuth: localVarOperationAuth
|
|
8210
|
-
});
|
|
8211
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
8212
|
-
return {
|
|
8213
|
-
url: toPathString(localVarUrlObj),
|
|
8214
|
-
options: localVarRequestOptions
|
|
8215
|
-
};
|
|
8216
|
-
},
|
|
8217
|
-
/**
|
|
8218
|
-
* **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.
|
|
8219
|
-
* @summary Get performance information for a specific timeframe
|
|
8220
|
-
* @param {string | Date} startDate
|
|
8221
|
-
* @param {string | Date} endDate
|
|
8222
|
-
* @param {string} [accounts] Optional comma separated list of account IDs used to filter the request on specific accounts
|
|
8223
|
-
* @param {boolean} [detailed] Optional, increases frequency of data points for the total value and contribution charts if set to true
|
|
8224
|
-
* @param {string} [frequency] Optional frequency for the rate of return chart (defaults to monthly). Possible values are daily, weekly, monthly, quarterly, yearly.
|
|
8225
|
-
* @param {string} [userId]
|
|
8226
|
-
* @param {string} [userSecret]
|
|
8227
|
-
* @param {*} [options] Override http request option.
|
|
8228
|
-
* @deprecated
|
|
8229
|
-
* @throws {RequiredError}
|
|
8230
|
-
*/
|
|
8231
|
-
getReportingCustomRange: async (startDate, endDate, accounts, detailed, frequency, userId, userSecret, options = {}) => {
|
|
8232
|
-
assertParamExists("getReportingCustomRange", "startDate", startDate);
|
|
8233
|
-
assertParamExists("getReportingCustomRange", "endDate", endDate);
|
|
8234
|
-
const localVarPath = `/performance/custom`;
|
|
8235
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
8236
|
-
let baseOptions;
|
|
8237
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
8238
|
-
const localVarRequestOptions = {
|
|
8239
|
-
method: "GET",
|
|
8240
|
-
...baseOptions,
|
|
8241
|
-
...options
|
|
8242
|
-
};
|
|
8243
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
8244
|
-
const localVarQueryParameter = {};
|
|
8245
|
-
if (configuration?.authMode === "commercialApiKey") {
|
|
8246
|
-
await setApiKeyToObject({
|
|
8247
|
-
object: localVarQueryParameter,
|
|
8248
|
-
key: "clientId",
|
|
8249
|
-
keyParamName: "clientId",
|
|
8250
|
-
configuration
|
|
8251
|
-
});
|
|
8252
|
-
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
8253
|
-
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
8254
|
-
}
|
|
8255
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
8256
|
-
object: localVarQueryParameter,
|
|
8257
|
-
key: "clientId",
|
|
8258
|
-
keyParamName: "clientId",
|
|
8259
|
-
configuration
|
|
8260
|
-
});
|
|
8261
|
-
if (startDate !== void 0) localVarQueryParameter["startDate"] = startDate instanceof Date ? startDate.toISOString().substr(0, 10) : startDate;
|
|
8262
|
-
if (endDate !== void 0) localVarQueryParameter["endDate"] = endDate instanceof Date ? endDate.toISOString().substr(0, 10) : endDate;
|
|
8263
|
-
if (accounts !== void 0) localVarQueryParameter["accounts"] = accounts;
|
|
8264
|
-
if (detailed !== void 0) localVarQueryParameter["detailed"] = detailed;
|
|
8265
|
-
if (frequency !== void 0) localVarQueryParameter["frequency"] = frequency;
|
|
8266
|
-
const localVarOperationAuth = {
|
|
8267
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
8268
|
-
requestSigningByAuthMode: {
|
|
8269
|
-
"commercialApiKey": {
|
|
8270
|
-
secretParameter: "consumerKey",
|
|
8271
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
8272
|
-
},
|
|
8273
|
-
"personalApiKey": {
|
|
8274
|
-
secretParameter: "consumerKey",
|
|
8275
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
8276
|
-
}
|
|
8277
|
-
},
|
|
8278
|
-
selectedAuthMode: configuration?.authMode
|
|
8279
|
-
};
|
|
8280
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
8281
|
-
localVarRequestOptions.headers = {
|
|
8282
|
-
...localVarHeaderParameter,
|
|
8283
|
-
...headersFromBaseOptions,
|
|
8284
|
-
...options.headers
|
|
8285
|
-
};
|
|
8286
|
-
requestBeforeHook({
|
|
8287
|
-
queryParameters: localVarQueryParameter,
|
|
8288
|
-
requestConfig: localVarRequestOptions,
|
|
8289
|
-
path: localVarPath,
|
|
8290
|
-
configuration,
|
|
8291
|
-
pathTemplate: "/performance/custom",
|
|
8292
|
-
httpMethod: "GET",
|
|
8293
|
-
operationAuth: localVarOperationAuth
|
|
8294
|
-
});
|
|
8295
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
8296
|
-
return {
|
|
8297
|
-
url: toPathString(localVarUrlObj),
|
|
8298
|
-
options: localVarRequestOptions
|
|
8299
|
-
};
|
|
8300
|
-
}
|
|
8301
|
-
};
|
|
8302
|
-
};
|
|
8303
|
-
/**
|
|
8304
|
-
* TransactionsAndReportingApi - functional programming interface
|
|
8305
|
-
* @export
|
|
8306
|
-
*/
|
|
8307
|
-
const TransactionsAndReportingApiFp = function(configuration) {
|
|
8308
|
-
const localVarAxiosParamCreator = TransactionsAndReportingApiAxiosParamCreator(configuration);
|
|
8309
|
-
return {
|
|
8310
|
-
/**
|
|
8311
|
-
* **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.
|
|
8312
|
-
* @summary Get transaction history for a user
|
|
8313
|
-
* @param {TransactionsAndReportingApiGetActivitiesRequest<TAuth>} requestParameters Request parameters.
|
|
8314
|
-
* @param {*} [options] Override http request option.
|
|
8315
|
-
* @deprecated
|
|
8316
|
-
* @throws {RequiredError}
|
|
8317
|
-
*/
|
|
8318
|
-
async getActivities(requestParameters = {}, options) {
|
|
8319
|
-
return createRequestFunction(await localVarAxiosParamCreator.getActivities(requestParameters.startDate, requestParameters.endDate, requestParameters.accounts, requestParameters.brokerageAuthorizations, requestParameters.type, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
|
|
8320
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
8321
|
-
requestSigningByAuthMode: {
|
|
8322
|
-
"commercialApiKey": {
|
|
8323
|
-
secretParameter: "consumerKey",
|
|
8324
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
8325
|
-
},
|
|
8326
|
-
"personalApiKey": {
|
|
8327
|
-
secretParameter: "consumerKey",
|
|
8328
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
8329
|
-
}
|
|
8330
|
-
}
|
|
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 {TransactionsAndReportingApiGetReportingCustomRangeRequest<TAuth>} requestParameters Request parameters.
|
|
8337
|
-
* @param {*} [options] Override http request option.
|
|
8338
|
-
* @deprecated
|
|
8339
|
-
* @throws {RequiredError}
|
|
8340
|
-
*/
|
|
8341
|
-
async getReportingCustomRange(requestParameters, options) {
|
|
8342
|
-
return createRequestFunction(await localVarAxiosParamCreator.getReportingCustomRange(requestParameters.startDate, requestParameters.endDate, requestParameters.accounts, requestParameters.detailed, requestParameters.frequency, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
|
|
8343
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
8344
|
-
requestSigningByAuthMode: {
|
|
8345
|
-
"commercialApiKey": {
|
|
8346
|
-
secretParameter: "consumerKey",
|
|
8347
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
8348
|
-
},
|
|
8349
|
-
"personalApiKey": {
|
|
8350
|
-
secretParameter: "consumerKey",
|
|
8351
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
8352
|
-
}
|
|
8353
|
-
}
|
|
8354
|
-
});
|
|
8355
|
-
}
|
|
8356
|
-
};
|
|
8357
|
-
};
|
|
8358
|
-
/**
|
|
8359
|
-
* TransactionsAndReportingApi - factory interface
|
|
8360
|
-
* @export
|
|
8361
|
-
*/
|
|
8362
|
-
const TransactionsAndReportingApiFactory = function(configuration, basePath, axios) {
|
|
8363
|
-
const localVarFp = TransactionsAndReportingApiFp(configuration);
|
|
8364
|
-
return {
|
|
8365
|
-
/**
|
|
8366
|
-
* **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.
|
|
8367
|
-
* @summary Get transaction history for a user
|
|
8368
|
-
* @param {TransactionsAndReportingApiGetActivitiesRequest<TAuth>} requestParameters Request parameters.
|
|
8369
|
-
* @param {*} [options] Override http request option.
|
|
8370
|
-
* @deprecated
|
|
8371
|
-
* @throws {RequiredError}
|
|
8372
|
-
*/
|
|
8373
|
-
getActivities(requestParameters = {}, options) {
|
|
8374
|
-
return localVarFp.getActivities(requestParameters, options).then((request) => request(axios, basePath));
|
|
8375
|
-
},
|
|
8376
|
-
/**
|
|
8377
|
-
* **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.
|
|
8378
|
-
* @summary Get performance information for a specific timeframe
|
|
8379
|
-
* @param {TransactionsAndReportingApiGetReportingCustomRangeRequest<TAuth>} requestParameters Request parameters.
|
|
8380
|
-
* @param {*} [options] Override http request option.
|
|
8381
|
-
* @deprecated
|
|
8382
|
-
* @throws {RequiredError}
|
|
8383
|
-
*/
|
|
8384
|
-
getReportingCustomRange(requestParameters, options) {
|
|
8385
|
-
return localVarFp.getReportingCustomRange(requestParameters, options).then((request) => request(axios, basePath));
|
|
8386
|
-
}
|
|
8387
|
-
};
|
|
8388
|
-
};
|
|
8389
|
-
/**
|
|
8390
|
-
* TransactionsAndReportingApiGenerated - object-oriented interface
|
|
8391
|
-
* @export
|
|
8392
|
-
* @class TransactionsAndReportingApiGenerated
|
|
8393
|
-
* @extends {BaseAPI}
|
|
8394
|
-
*/
|
|
8395
|
-
var TransactionsAndReportingApiGenerated = class extends BaseAPI {
|
|
8396
|
-
/**
|
|
8397
|
-
* **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.
|
|
8398
|
-
* @summary Get transaction history for a user
|
|
8399
|
-
* @param {TransactionsAndReportingApiGetActivitiesRequest<TAuth>} requestParameters Request parameters.
|
|
8400
|
-
* @param {*} [options] Override http request option.
|
|
8401
|
-
* @deprecated
|
|
8402
|
-
* @throws {RequiredError}
|
|
8403
|
-
* @memberof TransactionsAndReportingApiGenerated
|
|
8404
|
-
*/
|
|
8405
|
-
getActivities(requestParameters = {}, options) {
|
|
8406
|
-
return TransactionsAndReportingApiFp(this.configuration).getActivities(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
8407
|
-
}
|
|
8408
|
-
/**
|
|
8409
|
-
* **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.
|
|
8410
|
-
* @summary Get performance information for a specific timeframe
|
|
8411
|
-
* @param {TransactionsAndReportingApiGetReportingCustomRangeRequest<TAuth>} requestParameters Request parameters.
|
|
8412
|
-
* @param {*} [options] Override http request option.
|
|
8413
|
-
* @deprecated
|
|
8414
|
-
* @throws {RequiredError}
|
|
8415
|
-
* @memberof TransactionsAndReportingApiGenerated
|
|
8416
|
-
*/
|
|
8417
|
-
getReportingCustomRange(requestParameters, options) {
|
|
8418
|
-
return TransactionsAndReportingApiFp(this.configuration).getReportingCustomRange(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
8419
|
-
}
|
|
8420
|
-
};
|
|
8421
|
-
//#endregion
|
|
8422
|
-
//#region api/transactions-and-reporting-api.ts
|
|
8423
|
-
var TransactionsAndReportingApi = class extends TransactionsAndReportingApiGenerated {};
|
|
8424
|
-
//#endregion
|
|
8425
6930
|
//#region auth.ts
|
|
8426
6931
|
var CommercialApiKeyAuth = class CommercialApiKeyAuth {
|
|
8427
6932
|
constructor(params) {
|
|
@@ -8468,7 +6973,7 @@ var Configuration = class {
|
|
|
8468
6973
|
}
|
|
8469
6974
|
this.basePath = param.basePath;
|
|
8470
6975
|
this.baseOptions = param.baseOptions ?? {};
|
|
8471
|
-
this.userAgent = param.userAgent === void 0 ? "Konfig/
|
|
6976
|
+
this.userAgent = param.userAgent === void 0 ? "Konfig/12.0.0/typescript" : param.userAgent;
|
|
8472
6977
|
this.formDataCtor = param.formDataCtor;
|
|
8473
6978
|
}
|
|
8474
6979
|
/**
|
|
@@ -8501,11 +7006,9 @@ var Snaptrade = class extends SnaptradeCustom {
|
|
|
8501
7006
|
this.authentication = new AuthenticationApi(configuration);
|
|
8502
7007
|
this.connections = new ConnectionsApi(configuration);
|
|
8503
7008
|
this.experimentalEndpoints = new ExperimentalEndpointsApi(configuration);
|
|
8504
|
-
this.options = new OptionsApi(configuration);
|
|
8505
7009
|
this.referenceData = new ReferenceDataApi(configuration);
|
|
8506
7010
|
this.trading = new TradingApi(configuration);
|
|
8507
|
-
this.transactionsAndReporting = new TransactionsAndReportingApi(configuration);
|
|
8508
7011
|
}
|
|
8509
7012
|
};
|
|
8510
7013
|
//#endregion
|
|
8511
|
-
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 };
|