snaptrade-typescript-sdk 11.1.0 → 12.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -538
- package/dist/browser.umd.js +2 -2
- package/dist/index.cjs +166 -1793
- package/dist/index.d.cts +58 -898
- package/dist/index.d.mts +58 -898
- package/dist/index.d.ts +58 -898
- package/dist/index.mjs +101 -1719
- package/package.json +1 -1
- package/dist/chunk-e9Ob2GDo.mjs +0 -26
package/dist/index.cjs
CHANGED
|
@@ -31,9 +31,9 @@ const BASE_PATH = "https://api.snaptrade.com".replace(/\/+$/, "");
|
|
|
31
31
|
* @class BaseAPI
|
|
32
32
|
*/
|
|
33
33
|
var BaseAPI = class {
|
|
34
|
-
constructor(configuration, basePath = BASE_PATH, axios$
|
|
34
|
+
constructor(configuration, basePath = BASE_PATH, axios$9 = axios.default) {
|
|
35
35
|
this.basePath = basePath;
|
|
36
|
-
this.axios = axios$
|
|
36
|
+
this.axios = axios$9;
|
|
37
37
|
if (configuration) {
|
|
38
38
|
this.configuration = configuration;
|
|
39
39
|
this.basePath = configuration.basePath || this.basePath;
|
|
@@ -55,15 +55,15 @@ var RequiredError = class extends Error {
|
|
|
55
55
|
};
|
|
56
56
|
//#endregion
|
|
57
57
|
//#region requestAfterHook.ts
|
|
58
|
-
function
|
|
59
|
-
|
|
58
|
+
function bytesToBase64(bytes) {
|
|
59
|
+
let binary = "";
|
|
60
|
+
for (const byte of bytes) binary += String.fromCharCode(byte);
|
|
61
|
+
if (typeof globalThis.btoa === "function") return globalThis.btoa(binary);
|
|
62
|
+
if (typeof Buffer !== "undefined") return Buffer.from(bytes).toString("base64");
|
|
63
|
+
throw Error("Base64 encoding is not available in this runtime");
|
|
60
64
|
}
|
|
61
65
|
async function computeHmacSha256(message, key) {
|
|
62
|
-
if (
|
|
63
|
-
const hmac = require("crypto").createHmac("sha256", key);
|
|
64
|
-
hmac.update(message);
|
|
65
|
-
return hmac.digest("base64");
|
|
66
|
-
}
|
|
66
|
+
if (!globalThis.crypto?.subtle) throw Error("Web Crypto API is required to compute SnapTrade request signatures");
|
|
67
67
|
const encoder = new TextEncoder();
|
|
68
68
|
const keyBuffer = encoder.encode(key);
|
|
69
69
|
const msgBuffer = encoder.encode(message);
|
|
@@ -72,8 +72,7 @@ async function computeHmacSha256(message, key) {
|
|
|
72
72
|
hash: "SHA-256"
|
|
73
73
|
}, false, ["sign"]);
|
|
74
74
|
const signature = await globalThis.crypto.subtle.sign("HMAC", cryptoKey, msgBuffer);
|
|
75
|
-
|
|
76
|
-
return btoa(String.fromCharCode.apply(null, byteArray));
|
|
75
|
+
return bytesToBase64(new Uint8Array(signature));
|
|
77
76
|
}
|
|
78
77
|
const JSONstringifyOrder = (obj) => {
|
|
79
78
|
var allKeys = [];
|
|
@@ -264,7 +263,7 @@ async function wrapAxiosRequest(makeRequest) {
|
|
|
264
263
|
* @export
|
|
265
264
|
*/
|
|
266
265
|
const createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, configuration, operationAuth) {
|
|
267
|
-
return async (axios$
|
|
266
|
+
return async (axios$8 = globalAxios, basePath = BASE_PATH) => {
|
|
268
267
|
const url = (configuration?.basePath || basePath) + axiosArgs.url;
|
|
269
268
|
await requestAfterHook({
|
|
270
269
|
axiosArgs,
|
|
@@ -276,7 +275,7 @@ const createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, config
|
|
|
276
275
|
selectedAuthMode: configuration?.authMode
|
|
277
276
|
} : void 0
|
|
278
277
|
});
|
|
279
|
-
return wrapAxiosRequest(async () => await axios$
|
|
278
|
+
return wrapAxiosRequest(async () => await axios$8.request({
|
|
280
279
|
...axiosArgs.options,
|
|
281
280
|
url
|
|
282
281
|
}));
|
|
@@ -531,80 +530,6 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
531
530
|
};
|
|
532
531
|
},
|
|
533
532
|
/**
|
|
534
|
-
* **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.
|
|
535
|
-
* @summary List all accounts for the user, plus balances, positions, and orders for each account.
|
|
536
|
-
* @param {string} [brokerageAuthorizations] Optional. Comma separated list of authorization IDs (only use if filtering is needed on one or more authorizations).
|
|
537
|
-
* @param {string} [userId]
|
|
538
|
-
* @param {string} [userSecret]
|
|
539
|
-
* @param {*} [options] Override http request option.
|
|
540
|
-
* @deprecated
|
|
541
|
-
* @throws {RequiredError}
|
|
542
|
-
*/
|
|
543
|
-
getAllUserHoldings: async (brokerageAuthorizations, userId, userSecret, options = {}) => {
|
|
544
|
-
const localVarPath = `/holdings`;
|
|
545
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
546
|
-
let baseOptions;
|
|
547
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
548
|
-
const localVarRequestOptions = {
|
|
549
|
-
method: "GET",
|
|
550
|
-
...baseOptions,
|
|
551
|
-
...options
|
|
552
|
-
};
|
|
553
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
554
|
-
const localVarQueryParameter = {};
|
|
555
|
-
if (configuration?.authMode === "commercialApiKey") {
|
|
556
|
-
await setApiKeyToObject({
|
|
557
|
-
object: localVarQueryParameter,
|
|
558
|
-
key: "clientId",
|
|
559
|
-
keyParamName: "clientId",
|
|
560
|
-
configuration
|
|
561
|
-
});
|
|
562
|
-
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
563
|
-
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
564
|
-
}
|
|
565
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
566
|
-
object: localVarQueryParameter,
|
|
567
|
-
key: "clientId",
|
|
568
|
-
keyParamName: "clientId",
|
|
569
|
-
configuration
|
|
570
|
-
});
|
|
571
|
-
if (brokerageAuthorizations !== void 0) localVarQueryParameter["brokerage_authorizations"] = brokerageAuthorizations;
|
|
572
|
-
const localVarOperationAuth = {
|
|
573
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
574
|
-
requestSigningByAuthMode: {
|
|
575
|
-
"commercialApiKey": {
|
|
576
|
-
secretParameter: "consumerKey",
|
|
577
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
578
|
-
},
|
|
579
|
-
"personalApiKey": {
|
|
580
|
-
secretParameter: "consumerKey",
|
|
581
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
582
|
-
}
|
|
583
|
-
},
|
|
584
|
-
selectedAuthMode: configuration?.authMode
|
|
585
|
-
};
|
|
586
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
587
|
-
localVarRequestOptions.headers = {
|
|
588
|
-
...localVarHeaderParameter,
|
|
589
|
-
...headersFromBaseOptions,
|
|
590
|
-
...options.headers
|
|
591
|
-
};
|
|
592
|
-
requestBeforeHook({
|
|
593
|
-
queryParameters: localVarQueryParameter,
|
|
594
|
-
requestConfig: localVarRequestOptions,
|
|
595
|
-
path: localVarPath,
|
|
596
|
-
configuration,
|
|
597
|
-
pathTemplate: "/holdings",
|
|
598
|
-
httpMethod: "GET",
|
|
599
|
-
operationAuth: localVarOperationAuth
|
|
600
|
-
});
|
|
601
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
602
|
-
return {
|
|
603
|
-
url: toPathString(localVarUrlObj),
|
|
604
|
-
options: localVarRequestOptions
|
|
605
|
-
};
|
|
606
|
-
},
|
|
607
|
-
/**
|
|
608
533
|
* 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.
|
|
609
534
|
* @summary List account balances
|
|
610
535
|
* @param {string} accountId
|
|
@@ -906,80 +831,6 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
906
831
|
};
|
|
907
832
|
},
|
|
908
833
|
/**
|
|
909
|
-
* **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.
|
|
910
|
-
* @summary List account positions
|
|
911
|
-
* @param {string} accountId
|
|
912
|
-
* @param {string} [userId]
|
|
913
|
-
* @param {string} [userSecret]
|
|
914
|
-
* @param {*} [options] Override http request option.
|
|
915
|
-
* @deprecated
|
|
916
|
-
* @throws {RequiredError}
|
|
917
|
-
*/
|
|
918
|
-
getUserAccountPositions: async (accountId, userId, userSecret, options = {}) => {
|
|
919
|
-
assertParamExists("getUserAccountPositions", "accountId", accountId);
|
|
920
|
-
const localVarPath = `/accounts/{accountId}/positions`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
|
|
921
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
922
|
-
let baseOptions;
|
|
923
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
924
|
-
const localVarRequestOptions = {
|
|
925
|
-
method: "GET",
|
|
926
|
-
...baseOptions,
|
|
927
|
-
...options
|
|
928
|
-
};
|
|
929
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
930
|
-
const localVarQueryParameter = {};
|
|
931
|
-
if (configuration?.authMode === "commercialApiKey") {
|
|
932
|
-
await setApiKeyToObject({
|
|
933
|
-
object: localVarQueryParameter,
|
|
934
|
-
key: "clientId",
|
|
935
|
-
keyParamName: "clientId",
|
|
936
|
-
configuration
|
|
937
|
-
});
|
|
938
|
-
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
939
|
-
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
940
|
-
}
|
|
941
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
942
|
-
object: localVarQueryParameter,
|
|
943
|
-
key: "clientId",
|
|
944
|
-
keyParamName: "clientId",
|
|
945
|
-
configuration
|
|
946
|
-
});
|
|
947
|
-
const localVarOperationAuth = {
|
|
948
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
949
|
-
requestSigningByAuthMode: {
|
|
950
|
-
"commercialApiKey": {
|
|
951
|
-
secretParameter: "consumerKey",
|
|
952
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
953
|
-
},
|
|
954
|
-
"personalApiKey": {
|
|
955
|
-
secretParameter: "consumerKey",
|
|
956
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
957
|
-
}
|
|
958
|
-
},
|
|
959
|
-
selectedAuthMode: configuration?.authMode
|
|
960
|
-
};
|
|
961
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
962
|
-
localVarRequestOptions.headers = {
|
|
963
|
-
...localVarHeaderParameter,
|
|
964
|
-
...headersFromBaseOptions,
|
|
965
|
-
...options.headers
|
|
966
|
-
};
|
|
967
|
-
requestBeforeHook({
|
|
968
|
-
queryParameters: localVarQueryParameter,
|
|
969
|
-
requestConfig: localVarRequestOptions,
|
|
970
|
-
path: localVarPath,
|
|
971
|
-
configuration,
|
|
972
|
-
pathTemplate: "/accounts/{accountId}/positions",
|
|
973
|
-
httpMethod: "GET",
|
|
974
|
-
operationAuth: localVarOperationAuth
|
|
975
|
-
});
|
|
976
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
977
|
-
return {
|
|
978
|
-
url: toPathString(localVarUrlObj),
|
|
979
|
-
options: localVarRequestOptions
|
|
980
|
-
};
|
|
981
|
-
},
|
|
982
|
-
/**
|
|
983
834
|
* 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
|
|
984
835
|
* @summary List account recent orders (last 24 hours only)
|
|
985
836
|
* @param {string} accountId
|
|
@@ -1423,29 +1274,6 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1423
1274
|
});
|
|
1424
1275
|
},
|
|
1425
1276
|
/**
|
|
1426
|
-
* **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.
|
|
1427
|
-
* @summary List all accounts for the user, plus balances, positions, and orders for each account.
|
|
1428
|
-
* @param {AccountInformationApiGetAllUserHoldingsRequest<TAuth>} requestParameters Request parameters.
|
|
1429
|
-
* @param {*} [options] Override http request option.
|
|
1430
|
-
* @deprecated
|
|
1431
|
-
* @throws {RequiredError}
|
|
1432
|
-
*/
|
|
1433
|
-
async getAllUserHoldings(requestParameters = {}, options) {
|
|
1434
|
-
return createRequestFunction(await localVarAxiosParamCreator.getAllUserHoldings(requestParameters.brokerageAuthorizations, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
1435
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
1436
|
-
requestSigningByAuthMode: {
|
|
1437
|
-
"commercialApiKey": {
|
|
1438
|
-
secretParameter: "consumerKey",
|
|
1439
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
1440
|
-
},
|
|
1441
|
-
"personalApiKey": {
|
|
1442
|
-
secretParameter: "consumerKey",
|
|
1443
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1446
|
-
});
|
|
1447
|
-
},
|
|
1448
|
-
/**
|
|
1449
1277
|
* 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.
|
|
1450
1278
|
* @summary List account balances
|
|
1451
1279
|
* @param {AccountInformationApiGetUserAccountBalanceRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -1535,29 +1363,6 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1535
1363
|
});
|
|
1536
1364
|
},
|
|
1537
1365
|
/**
|
|
1538
|
-
* **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.
|
|
1539
|
-
* @summary List account positions
|
|
1540
|
-
* @param {AccountInformationApiGetUserAccountPositionsRequest<TAuth>} requestParameters Request parameters.
|
|
1541
|
-
* @param {*} [options] Override http request option.
|
|
1542
|
-
* @deprecated
|
|
1543
|
-
* @throws {RequiredError}
|
|
1544
|
-
*/
|
|
1545
|
-
async getUserAccountPositions(requestParameters, options) {
|
|
1546
|
-
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountPositions(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
1547
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
1548
|
-
requestSigningByAuthMode: {
|
|
1549
|
-
"commercialApiKey": {
|
|
1550
|
-
secretParameter: "consumerKey",
|
|
1551
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
1552
|
-
},
|
|
1553
|
-
"personalApiKey": {
|
|
1554
|
-
secretParameter: "consumerKey",
|
|
1555
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
1556
|
-
}
|
|
1557
|
-
}
|
|
1558
|
-
});
|
|
1559
|
-
},
|
|
1560
|
-
/**
|
|
1561
1366
|
* 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
|
|
1562
1367
|
* @summary List account recent orders (last 24 hours only)
|
|
1563
1368
|
* @param {AccountInformationApiGetUserAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -1674,7 +1479,7 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1674
1479
|
* AccountInformationApi - factory interface
|
|
1675
1480
|
* @export
|
|
1676
1481
|
*/
|
|
1677
|
-
const AccountInformationApiFactory = function(configuration, basePath, axios$
|
|
1482
|
+
const AccountInformationApiFactory = function(configuration, basePath, axios$7) {
|
|
1678
1483
|
const localVarFp = AccountInformationApiFp(configuration);
|
|
1679
1484
|
return {
|
|
1680
1485
|
/**
|
|
@@ -1685,7 +1490,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1685
1490
|
* @throws {RequiredError}
|
|
1686
1491
|
*/
|
|
1687
1492
|
getAccountActivities(requestParameters, options) {
|
|
1688
|
-
return localVarFp.getAccountActivities(requestParameters, options).then((request) => request(axios$
|
|
1493
|
+
return localVarFp.getAccountActivities(requestParameters, options).then((request) => request(axios$7, basePath));
|
|
1689
1494
|
},
|
|
1690
1495
|
/**
|
|
1691
1496
|
* An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year.
|
|
@@ -1695,7 +1500,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1695
1500
|
* @throws {RequiredError}
|
|
1696
1501
|
*/
|
|
1697
1502
|
getAccountBalanceHistory(requestParameters, options) {
|
|
1698
|
-
return localVarFp.getAccountBalanceHistory(requestParameters, options).then((request) => request(axios$
|
|
1503
|
+
return localVarFp.getAccountBalanceHistory(requestParameters, options).then((request) => request(axios$7, basePath));
|
|
1699
1504
|
},
|
|
1700
1505
|
/**
|
|
1701
1506
|
* Returns a list of all positions in the specified account. The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, crypto, futures, option positions, and CFD positions. Use the `instrument.kind` discriminator to determine the schema for each position\'s `instrument`. `mutualfund` positions may also include `cash_equivalent`. `stock`, `etf`, and `mutualfund` positions may include `tax_lots` when tax lot data is enabled for the account. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
@@ -1705,18 +1510,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1705
1510
|
* @throws {RequiredError}
|
|
1706
1511
|
*/
|
|
1707
1512
|
getAllAccountPositions(requestParameters, options) {
|
|
1708
|
-
return localVarFp.getAllAccountPositions(requestParameters, options).then((request) => request(axios$
|
|
1709
|
-
},
|
|
1710
|
-
/**
|
|
1711
|
-
* **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.
|
|
1712
|
-
* @summary List all accounts for the user, plus balances, positions, and orders for each account.
|
|
1713
|
-
* @param {AccountInformationApiGetAllUserHoldingsRequest<TAuth>} requestParameters Request parameters.
|
|
1714
|
-
* @param {*} [options] Override http request option.
|
|
1715
|
-
* @deprecated
|
|
1716
|
-
* @throws {RequiredError}
|
|
1717
|
-
*/
|
|
1718
|
-
getAllUserHoldings(requestParameters = {}, options) {
|
|
1719
|
-
return localVarFp.getAllUserHoldings(requestParameters, options).then((request) => request(axios$9, basePath));
|
|
1513
|
+
return localVarFp.getAllAccountPositions(requestParameters, options).then((request) => request(axios$7, basePath));
|
|
1720
1514
|
},
|
|
1721
1515
|
/**
|
|
1722
1516
|
* 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.
|
|
@@ -1726,7 +1520,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1726
1520
|
* @throws {RequiredError}
|
|
1727
1521
|
*/
|
|
1728
1522
|
getUserAccountBalance(requestParameters, options) {
|
|
1729
|
-
return localVarFp.getUserAccountBalance(requestParameters, options).then((request) => request(axios$
|
|
1523
|
+
return localVarFp.getUserAccountBalance(requestParameters, options).then((request) => request(axios$7, basePath));
|
|
1730
1524
|
},
|
|
1731
1525
|
/**
|
|
1732
1526
|
* Returns account detail known to SnapTrade for the specified account. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
@@ -1736,7 +1530,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1736
1530
|
* @throws {RequiredError}
|
|
1737
1531
|
*/
|
|
1738
1532
|
getUserAccountDetails(requestParameters, options) {
|
|
1739
|
-
return localVarFp.getUserAccountDetails(requestParameters, options).then((request) => request(axios$
|
|
1533
|
+
return localVarFp.getUserAccountDetails(requestParameters, options).then((request) => request(axios$7, basePath));
|
|
1740
1534
|
},
|
|
1741
1535
|
/**
|
|
1742
1536
|
* Returns the detail of a single order using the external order ID provided in the request body. This endpoint only works for single-leg orders at this time. Support for multi-leg orders will be added in the future. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
@@ -1746,7 +1540,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1746
1540
|
* @throws {RequiredError}
|
|
1747
1541
|
*/
|
|
1748
1542
|
getUserAccountOrderDetail(requestParameters, options) {
|
|
1749
|
-
return localVarFp.getUserAccountOrderDetail(requestParameters, options).then((request) => request(axios$
|
|
1543
|
+
return localVarFp.getUserAccountOrderDetail(requestParameters, options).then((request) => request(axios$7, basePath));
|
|
1750
1544
|
},
|
|
1751
1545
|
/**
|
|
1752
1546
|
* Returns a list of recent orders in the specified account. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
@@ -1756,18 +1550,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1756
1550
|
* @throws {RequiredError}
|
|
1757
1551
|
*/
|
|
1758
1552
|
getUserAccountOrders(requestParameters, options) {
|
|
1759
|
-
return localVarFp.getUserAccountOrders(requestParameters, options).then((request) => request(axios$
|
|
1760
|
-
},
|
|
1761
|
-
/**
|
|
1762
|
-
* **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.
|
|
1763
|
-
* @summary List account positions
|
|
1764
|
-
* @param {AccountInformationApiGetUserAccountPositionsRequest<TAuth>} requestParameters Request parameters.
|
|
1765
|
-
* @param {*} [options] Override http request option.
|
|
1766
|
-
* @deprecated
|
|
1767
|
-
* @throws {RequiredError}
|
|
1768
|
-
*/
|
|
1769
|
-
getUserAccountPositions(requestParameters, options) {
|
|
1770
|
-
return localVarFp.getUserAccountPositions(requestParameters, options).then((request) => request(axios$9, basePath));
|
|
1553
|
+
return localVarFp.getUserAccountOrders(requestParameters, options).then((request) => request(axios$7, basePath));
|
|
1771
1554
|
},
|
|
1772
1555
|
/**
|
|
1773
1556
|
* 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
|
|
@@ -1777,7 +1560,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1777
1560
|
* @throws {RequiredError}
|
|
1778
1561
|
*/
|
|
1779
1562
|
getUserAccountRecentOrders(requestParameters, options) {
|
|
1780
|
-
return localVarFp.getUserAccountRecentOrders(requestParameters, options).then((request) => request(axios$
|
|
1563
|
+
return localVarFp.getUserAccountRecentOrders(requestParameters, options).then((request) => request(axios$7, basePath));
|
|
1781
1564
|
},
|
|
1782
1565
|
/**
|
|
1783
1566
|
* Returns a list of rate of return percents for a given account.
|
|
@@ -1787,7 +1570,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1787
1570
|
* @throws {RequiredError}
|
|
1788
1571
|
*/
|
|
1789
1572
|
getUserAccountReturnRates(requestParameters, options) {
|
|
1790
|
-
return localVarFp.getUserAccountReturnRates(requestParameters, options).then((request) => request(axios$
|
|
1573
|
+
return localVarFp.getUserAccountReturnRates(requestParameters, options).then((request) => request(axios$7, basePath));
|
|
1791
1574
|
},
|
|
1792
1575
|
/**
|
|
1793
1576
|
* **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). This endpoint will return HTTP 410 Gone for all customers that sign up after May 11, 2026. Returns a list of balances, positions, and recent orders for the specified account. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. If the connection has become disabled, it can no longer access the latest data from the brokerage, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
@@ -1798,7 +1581,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1798
1581
|
* @throws {RequiredError}
|
|
1799
1582
|
*/
|
|
1800
1583
|
getUserHoldings(requestParameters, options) {
|
|
1801
|
-
return localVarFp.getUserHoldings(requestParameters, options).then((request) => request(axios$
|
|
1584
|
+
return localVarFp.getUserHoldings(requestParameters, options).then((request) => request(axios$7, basePath));
|
|
1802
1585
|
},
|
|
1803
1586
|
/**
|
|
1804
1587
|
* Returns all brokerage accounts across all connections known to SnapTrade for the authenticated user. This endpoint returns Daily data regardless of the customer\'s plan. Daily data is cached and refreshed once a day, which makes this endpoint fast and well-suited to listing accounts across all of a user\'s connections in a single call. Exact refresh timing may vary by brokerage. To get real-time data on Pay as you Go / Real-time, use the [list accounts for a connection endpoint](/reference/Connections/Connections_listBrokerageAuthorizationAccounts). Customers on Pay as you Go / Daily can force a refresh with the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
@@ -1808,7 +1591,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1808
1591
|
* @throws {RequiredError}
|
|
1809
1592
|
*/
|
|
1810
1593
|
listUserAccounts(requestParameters = {}, options) {
|
|
1811
|
-
return localVarFp.listUserAccounts(requestParameters, options).then((request) => request(axios$
|
|
1594
|
+
return localVarFp.listUserAccounts(requestParameters, options).then((request) => request(axios$7, basePath));
|
|
1812
1595
|
},
|
|
1813
1596
|
/**
|
|
1814
1597
|
* Updates various properties of a specified account.
|
|
@@ -1818,7 +1601,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1818
1601
|
* @throws {RequiredError}
|
|
1819
1602
|
*/
|
|
1820
1603
|
updateUserAccount(requestParameters, options) {
|
|
1821
|
-
return localVarFp.updateUserAccount(requestParameters, options).then((request) => request(axios$
|
|
1604
|
+
return localVarFp.updateUserAccount(requestParameters, options).then((request) => request(axios$7, basePath));
|
|
1822
1605
|
}
|
|
1823
1606
|
};
|
|
1824
1607
|
};
|
|
@@ -1863,18 +1646,6 @@ var AccountInformationApiGenerated = class extends BaseAPI {
|
|
|
1863
1646
|
return AccountInformationApiFp(this.configuration).getAllAccountPositions(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1864
1647
|
}
|
|
1865
1648
|
/**
|
|
1866
|
-
* **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.
|
|
1867
|
-
* @summary List all accounts for the user, plus balances, positions, and orders for each account.
|
|
1868
|
-
* @param {AccountInformationApiGetAllUserHoldingsRequest<TAuth>} requestParameters Request parameters.
|
|
1869
|
-
* @param {*} [options] Override http request option.
|
|
1870
|
-
* @deprecated
|
|
1871
|
-
* @throws {RequiredError}
|
|
1872
|
-
* @memberof AccountInformationApiGenerated
|
|
1873
|
-
*/
|
|
1874
|
-
getAllUserHoldings(requestParameters = {}, options) {
|
|
1875
|
-
return AccountInformationApiFp(this.configuration).getAllUserHoldings(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1876
|
-
}
|
|
1877
|
-
/**
|
|
1878
1649
|
* 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.
|
|
1879
1650
|
* @summary List account balances
|
|
1880
1651
|
* @param {AccountInformationApiGetUserAccountBalanceRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -1919,18 +1690,6 @@ var AccountInformationApiGenerated = class extends BaseAPI {
|
|
|
1919
1690
|
return AccountInformationApiFp(this.configuration).getUserAccountOrders(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1920
1691
|
}
|
|
1921
1692
|
/**
|
|
1922
|
-
* **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.
|
|
1923
|
-
* @summary List account positions
|
|
1924
|
-
* @param {AccountInformationApiGetUserAccountPositionsRequest<TAuth>} requestParameters Request parameters.
|
|
1925
|
-
* @param {*} [options] Override http request option.
|
|
1926
|
-
* @deprecated
|
|
1927
|
-
* @throws {RequiredError}
|
|
1928
|
-
* @memberof AccountInformationApiGenerated
|
|
1929
|
-
*/
|
|
1930
|
-
getUserAccountPositions(requestParameters, options) {
|
|
1931
|
-
return AccountInformationApiFp(this.configuration).getUserAccountPositions(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1932
|
-
}
|
|
1933
|
-
/**
|
|
1934
1693
|
* 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
|
|
1935
1694
|
* @summary List account recent orders (last 24 hours only)
|
|
1936
1695
|
* @param {AccountInformationApiGetUserAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -2063,7 +1822,7 @@ async check(options) {
|
|
|
2063
1822
|
* ApiStatusApi - factory interface
|
|
2064
1823
|
* @export
|
|
2065
1824
|
*/
|
|
2066
|
-
const ApiStatusApiFactory = function(configuration, basePath, axios$
|
|
1825
|
+
const ApiStatusApiFactory = function(configuration, basePath, axios$6) {
|
|
2067
1826
|
const localVarFp = ApiStatusApiFp(configuration);
|
|
2068
1827
|
return {
|
|
2069
1828
|
/**
|
|
@@ -2073,7 +1832,7 @@ const ApiStatusApiFactory = function(configuration, basePath, axios$8) {
|
|
|
2073
1832
|
* @throws {RequiredError}
|
|
2074
1833
|
*/
|
|
2075
1834
|
check(options) {
|
|
2076
|
-
return localVarFp.check(options).then((request) => request(axios$
|
|
1835
|
+
return localVarFp.check(options).then((request) => request(axios$6, basePath));
|
|
2077
1836
|
} };
|
|
2078
1837
|
};
|
|
2079
1838
|
/**
|
|
@@ -2522,7 +2281,7 @@ const AuthenticationApiFp = function(configuration) {
|
|
|
2522
2281
|
* AuthenticationApi - factory interface
|
|
2523
2282
|
* @export
|
|
2524
2283
|
*/
|
|
2525
|
-
const AuthenticationApiFactory = function(configuration, basePath, axios$
|
|
2284
|
+
const AuthenticationApiFactory = function(configuration, basePath, axios$5) {
|
|
2526
2285
|
const localVarFp = AuthenticationApiFp(configuration);
|
|
2527
2286
|
return {
|
|
2528
2287
|
/**
|
|
@@ -2533,7 +2292,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$7) {
|
|
|
2533
2292
|
* @throws {RequiredError}
|
|
2534
2293
|
*/
|
|
2535
2294
|
deleteSnapTradeUser(requestParameters, options) {
|
|
2536
|
-
return localVarFp.deleteSnapTradeUser(requestParameters, options).then((request) => request(axios$
|
|
2295
|
+
return localVarFp.deleteSnapTradeUser(requestParameters, options).then((request) => request(axios$5, basePath));
|
|
2537
2296
|
},
|
|
2538
2297
|
/**
|
|
2539
2298
|
* Returns a list of all registered user IDs. Please note that the response is not currently paginated.
|
|
@@ -2542,7 +2301,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$7) {
|
|
|
2542
2301
|
* @throws {RequiredError}
|
|
2543
2302
|
*/
|
|
2544
2303
|
listSnapTradeUsers(...args) {
|
|
2545
|
-
return localVarFp.listSnapTradeUsers(...args).then((request) => request(axios$
|
|
2304
|
+
return localVarFp.listSnapTradeUsers(...args).then((request) => request(axios$5, basePath));
|
|
2546
2305
|
},
|
|
2547
2306
|
/**
|
|
2548
2307
|
* Authenticates a SnapTrade user and returns the Connection Portal URL used for connecting brokerage accounts. Please check [this guide](/docs/implement-connection-portal) for how to integrate the Connection Portal into your app. Please note that the returned URL expires in 5 minutes.
|
|
@@ -2552,7 +2311,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$7) {
|
|
|
2552
2311
|
* @throws {RequiredError}
|
|
2553
2312
|
*/
|
|
2554
2313
|
loginSnapTradeUser(requestParameters = {}, options) {
|
|
2555
|
-
return localVarFp.loginSnapTradeUser(requestParameters, options).then((request) => request(axios$
|
|
2314
|
+
return localVarFp.loginSnapTradeUser(requestParameters, options).then((request) => request(axios$5, basePath));
|
|
2556
2315
|
},
|
|
2557
2316
|
/**
|
|
2558
2317
|
* Registers a new SnapTrade user under your Client ID. A user secret will be automatically generated for you and must be properly stored in your system. Most SnapTrade operations require a user ID and user secret to be passed in as parameters.
|
|
@@ -2562,7 +2321,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$7) {
|
|
|
2562
2321
|
* @throws {RequiredError}
|
|
2563
2322
|
*/
|
|
2564
2323
|
registerSnapTradeUser(requestParameters, options) {
|
|
2565
|
-
return localVarFp.registerSnapTradeUser(requestParameters, options).then((request) => request(axios$
|
|
2324
|
+
return localVarFp.registerSnapTradeUser(requestParameters, options).then((request) => request(axios$5, basePath));
|
|
2566
2325
|
},
|
|
2567
2326
|
/**
|
|
2568
2327
|
* Rotates the secret for a SnapTrade user. You might use this if `userSecret` is compromised. Please note that if you call this endpoint and fail to save the new secret, you\'ll no longer be able to access any data for this user, and your only option will be to delete and recreate the user, then ask them to reconnect.
|
|
@@ -2572,7 +2331,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$7) {
|
|
|
2572
2331
|
* @throws {RequiredError}
|
|
2573
2332
|
*/
|
|
2574
2333
|
resetSnapTradeUserSecret(requestParameters, options) {
|
|
2575
|
-
return localVarFp.resetSnapTradeUserSecret(requestParameters, options).then((request) => request(axios$
|
|
2334
|
+
return localVarFp.resetSnapTradeUserSecret(requestParameters, options).then((request) => request(axios$5, basePath));
|
|
2576
2335
|
}
|
|
2577
2336
|
};
|
|
2578
2337
|
};
|
|
@@ -3086,22 +2845,23 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3086
2845
|
};
|
|
3087
2846
|
},
|
|
3088
2847
|
/**
|
|
3089
|
-
*
|
|
3090
|
-
* @summary
|
|
2848
|
+
* Returns a list of rate of return percents for a given connection.
|
|
2849
|
+
* @summary List connection rate of returns
|
|
3091
2850
|
* @param {string} authorizationId
|
|
2851
|
+
* @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.
|
|
3092
2852
|
* @param {string} [userId]
|
|
3093
2853
|
* @param {string} [userSecret]
|
|
3094
2854
|
* @param {*} [options] Override http request option.
|
|
3095
2855
|
* @throws {RequiredError}
|
|
3096
2856
|
*/
|
|
3097
|
-
|
|
3098
|
-
assertParamExists("
|
|
3099
|
-
const localVarPath = `/authorizations/{authorizationId}`.replace(`{authorizationId}`, encodeURIComponent(String(authorizationId !== void 0 ? authorizationId : `-authorizationId-`)));
|
|
2857
|
+
returnRates: async (authorizationId, timeframes, userId, userSecret, options = {}) => {
|
|
2858
|
+
assertParamExists("returnRates", "authorizationId", authorizationId);
|
|
2859
|
+
const localVarPath = `/authorizations/{authorizationId}/returnRates`.replace(`{authorizationId}`, encodeURIComponent(String(authorizationId !== void 0 ? authorizationId : `-authorizationId-`)));
|
|
3100
2860
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3101
2861
|
let baseOptions;
|
|
3102
2862
|
if (configuration) baseOptions = configuration.baseOptions;
|
|
3103
2863
|
const localVarRequestOptions = {
|
|
3104
|
-
method: "
|
|
2864
|
+
method: "GET",
|
|
3105
2865
|
...baseOptions,
|
|
3106
2866
|
...options
|
|
3107
2867
|
};
|
|
@@ -3123,6 +2883,7 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3123
2883
|
keyParamName: "clientId",
|
|
3124
2884
|
configuration
|
|
3125
2885
|
});
|
|
2886
|
+
if (timeframes !== void 0) localVarQueryParameter["timeframes"] = timeframes;
|
|
3126
2887
|
const localVarOperationAuth = {
|
|
3127
2888
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
3128
2889
|
requestSigningByAuthMode: {
|
|
@@ -3148,8 +2909,8 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3148
2909
|
requestConfig: localVarRequestOptions,
|
|
3149
2910
|
path: localVarPath,
|
|
3150
2911
|
configuration,
|
|
3151
|
-
pathTemplate: "/authorizations/{authorizationId}",
|
|
3152
|
-
httpMethod: "
|
|
2912
|
+
pathTemplate: "/authorizations/{authorizationId}/returnRates",
|
|
2913
|
+
httpMethod: "GET",
|
|
3153
2914
|
operationAuth: localVarOperationAuth
|
|
3154
2915
|
});
|
|
3155
2916
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
@@ -3159,23 +2920,22 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3159
2920
|
};
|
|
3160
2921
|
},
|
|
3161
2922
|
/**
|
|
3162
|
-
*
|
|
3163
|
-
* @summary
|
|
2923
|
+
* 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
|
|
2924
|
+
* @summary Sync transactions for a connection
|
|
3164
2925
|
* @param {string} authorizationId
|
|
3165
|
-
* @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.
|
|
3166
2926
|
* @param {string} [userId]
|
|
3167
2927
|
* @param {string} [userSecret]
|
|
3168
2928
|
* @param {*} [options] Override http request option.
|
|
3169
2929
|
* @throws {RequiredError}
|
|
3170
2930
|
*/
|
|
3171
|
-
|
|
3172
|
-
assertParamExists("
|
|
3173
|
-
const localVarPath = `/authorizations/{authorizationId}/
|
|
2931
|
+
syncBrokerageAuthorizationTransactions: async (authorizationId, userId, userSecret, options = {}) => {
|
|
2932
|
+
assertParamExists("syncBrokerageAuthorizationTransactions", "authorizationId", authorizationId);
|
|
2933
|
+
const localVarPath = `/authorizations/{authorizationId}/transactions/sync`.replace(`{authorizationId}`, encodeURIComponent(String(authorizationId !== void 0 ? authorizationId : `-authorizationId-`)));
|
|
3174
2934
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3175
2935
|
let baseOptions;
|
|
3176
2936
|
if (configuration) baseOptions = configuration.baseOptions;
|
|
3177
2937
|
const localVarRequestOptions = {
|
|
3178
|
-
method: "
|
|
2938
|
+
method: "POST",
|
|
3179
2939
|
...baseOptions,
|
|
3180
2940
|
...options
|
|
3181
2941
|
};
|
|
@@ -3197,7 +2957,6 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3197
2957
|
keyParamName: "clientId",
|
|
3198
2958
|
configuration
|
|
3199
2959
|
});
|
|
3200
|
-
if (timeframes !== void 0) localVarQueryParameter["timeframes"] = timeframes;
|
|
3201
2960
|
const localVarOperationAuth = {
|
|
3202
2961
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
3203
2962
|
requestSigningByAuthMode: {
|
|
@@ -3223,8 +2982,8 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3223
2982
|
requestConfig: localVarRequestOptions,
|
|
3224
2983
|
path: localVarPath,
|
|
3225
2984
|
configuration,
|
|
3226
|
-
pathTemplate: "/authorizations/{authorizationId}/
|
|
3227
|
-
httpMethod: "
|
|
2985
|
+
pathTemplate: "/authorizations/{authorizationId}/transactions/sync",
|
|
2986
|
+
httpMethod: "POST",
|
|
3228
2987
|
operationAuth: localVarOperationAuth
|
|
3229
2988
|
});
|
|
3230
2989
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
@@ -3232,165 +2991,20 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3232
2991
|
url: toPathString(localVarUrlObj),
|
|
3233
2992
|
options: localVarRequestOptions
|
|
3234
2993
|
};
|
|
3235
|
-
}
|
|
2994
|
+
}
|
|
2995
|
+
};
|
|
2996
|
+
};
|
|
2997
|
+
/**
|
|
2998
|
+
* ConnectionsApi - functional programming interface
|
|
2999
|
+
* @export
|
|
3000
|
+
*/
|
|
3001
|
+
const ConnectionsApiFp = function(configuration) {
|
|
3002
|
+
const localVarAxiosParamCreator = ConnectionsApiAxiosParamCreator(configuration);
|
|
3003
|
+
return {
|
|
3236
3004
|
/**
|
|
3237
|
-
*
|
|
3238
|
-
* @summary
|
|
3239
|
-
* @param {
|
|
3240
|
-
* @param {string} [userId] Optional comma separated list of user IDs used to filter the request on specific users
|
|
3241
|
-
* @param {string} [sessionId] Optional comma separated list of session IDs used to filter the request on specific users
|
|
3242
|
-
* @param {*} [options] Override http request option.
|
|
3243
|
-
* @throws {RequiredError}
|
|
3244
|
-
*/
|
|
3245
|
-
sessionEvents: async (partnerClientId, userId, sessionId, options = {}) => {
|
|
3246
|
-
assertParamExists("sessionEvents", "partnerClientId", partnerClientId);
|
|
3247
|
-
const localVarPath = `/sessionEvents`;
|
|
3248
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3249
|
-
let baseOptions;
|
|
3250
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
3251
|
-
const localVarRequestOptions = {
|
|
3252
|
-
method: "GET",
|
|
3253
|
-
...baseOptions,
|
|
3254
|
-
...options
|
|
3255
|
-
};
|
|
3256
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
3257
|
-
const localVarQueryParameter = {};
|
|
3258
|
-
if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
|
|
3259
|
-
object: localVarQueryParameter,
|
|
3260
|
-
key: "clientId",
|
|
3261
|
-
keyParamName: "clientId",
|
|
3262
|
-
configuration
|
|
3263
|
-
});
|
|
3264
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
3265
|
-
object: localVarQueryParameter,
|
|
3266
|
-
key: "clientId",
|
|
3267
|
-
keyParamName: "clientId",
|
|
3268
|
-
configuration
|
|
3269
|
-
});
|
|
3270
|
-
if (partnerClientId !== void 0) localVarQueryParameter["PartnerClientId"] = partnerClientId;
|
|
3271
|
-
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
3272
|
-
if (sessionId !== void 0) localVarQueryParameter["sessionId"] = sessionId;
|
|
3273
|
-
const localVarOperationAuth = {
|
|
3274
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
3275
|
-
requestSigningByAuthMode: {
|
|
3276
|
-
"commercialApiKey": {
|
|
3277
|
-
secretParameter: "consumerKey",
|
|
3278
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
3279
|
-
},
|
|
3280
|
-
"personalApiKey": {
|
|
3281
|
-
secretParameter: "consumerKey",
|
|
3282
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
3283
|
-
}
|
|
3284
|
-
},
|
|
3285
|
-
selectedAuthMode: configuration?.authMode
|
|
3286
|
-
};
|
|
3287
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3288
|
-
localVarRequestOptions.headers = {
|
|
3289
|
-
...localVarHeaderParameter,
|
|
3290
|
-
...headersFromBaseOptions,
|
|
3291
|
-
...options.headers
|
|
3292
|
-
};
|
|
3293
|
-
requestBeforeHook({
|
|
3294
|
-
queryParameters: localVarQueryParameter,
|
|
3295
|
-
requestConfig: localVarRequestOptions,
|
|
3296
|
-
path: localVarPath,
|
|
3297
|
-
configuration,
|
|
3298
|
-
pathTemplate: "/sessionEvents",
|
|
3299
|
-
httpMethod: "GET",
|
|
3300
|
-
operationAuth: localVarOperationAuth
|
|
3301
|
-
});
|
|
3302
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
3303
|
-
return {
|
|
3304
|
-
url: toPathString(localVarUrlObj),
|
|
3305
|
-
options: localVarRequestOptions
|
|
3306
|
-
};
|
|
3307
|
-
},
|
|
3308
|
-
/**
|
|
3309
|
-
* 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
|
|
3310
|
-
* @summary Sync transactions for a connection
|
|
3311
|
-
* @param {string} authorizationId
|
|
3312
|
-
* @param {string} [userId]
|
|
3313
|
-
* @param {string} [userSecret]
|
|
3314
|
-
* @param {*} [options] Override http request option.
|
|
3315
|
-
* @throws {RequiredError}
|
|
3316
|
-
*/
|
|
3317
|
-
syncBrokerageAuthorizationTransactions: async (authorizationId, userId, userSecret, options = {}) => {
|
|
3318
|
-
assertParamExists("syncBrokerageAuthorizationTransactions", "authorizationId", authorizationId);
|
|
3319
|
-
const localVarPath = `/authorizations/{authorizationId}/transactions/sync`.replace(`{authorizationId}`, encodeURIComponent(String(authorizationId !== void 0 ? authorizationId : `-authorizationId-`)));
|
|
3320
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3321
|
-
let baseOptions;
|
|
3322
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
3323
|
-
const localVarRequestOptions = {
|
|
3324
|
-
method: "POST",
|
|
3325
|
-
...baseOptions,
|
|
3326
|
-
...options
|
|
3327
|
-
};
|
|
3328
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
3329
|
-
const localVarQueryParameter = {};
|
|
3330
|
-
if (configuration?.authMode === "commercialApiKey") {
|
|
3331
|
-
await setApiKeyToObject({
|
|
3332
|
-
object: localVarQueryParameter,
|
|
3333
|
-
key: "clientId",
|
|
3334
|
-
keyParamName: "clientId",
|
|
3335
|
-
configuration
|
|
3336
|
-
});
|
|
3337
|
-
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
3338
|
-
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
3339
|
-
}
|
|
3340
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
3341
|
-
object: localVarQueryParameter,
|
|
3342
|
-
key: "clientId",
|
|
3343
|
-
keyParamName: "clientId",
|
|
3344
|
-
configuration
|
|
3345
|
-
});
|
|
3346
|
-
const localVarOperationAuth = {
|
|
3347
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
3348
|
-
requestSigningByAuthMode: {
|
|
3349
|
-
"commercialApiKey": {
|
|
3350
|
-
secretParameter: "consumerKey",
|
|
3351
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
3352
|
-
},
|
|
3353
|
-
"personalApiKey": {
|
|
3354
|
-
secretParameter: "consumerKey",
|
|
3355
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
3356
|
-
}
|
|
3357
|
-
},
|
|
3358
|
-
selectedAuthMode: configuration?.authMode
|
|
3359
|
-
};
|
|
3360
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3361
|
-
localVarRequestOptions.headers = {
|
|
3362
|
-
...localVarHeaderParameter,
|
|
3363
|
-
...headersFromBaseOptions,
|
|
3364
|
-
...options.headers
|
|
3365
|
-
};
|
|
3366
|
-
requestBeforeHook({
|
|
3367
|
-
queryParameters: localVarQueryParameter,
|
|
3368
|
-
requestConfig: localVarRequestOptions,
|
|
3369
|
-
path: localVarPath,
|
|
3370
|
-
configuration,
|
|
3371
|
-
pathTemplate: "/authorizations/{authorizationId}/transactions/sync",
|
|
3372
|
-
httpMethod: "POST",
|
|
3373
|
-
operationAuth: localVarOperationAuth
|
|
3374
|
-
});
|
|
3375
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
3376
|
-
return {
|
|
3377
|
-
url: toPathString(localVarUrlObj),
|
|
3378
|
-
options: localVarRequestOptions
|
|
3379
|
-
};
|
|
3380
|
-
}
|
|
3381
|
-
};
|
|
3382
|
-
};
|
|
3383
|
-
/**
|
|
3384
|
-
* ConnectionsApi - functional programming interface
|
|
3385
|
-
* @export
|
|
3386
|
-
*/
|
|
3387
|
-
const ConnectionsApiFp = function(configuration) {
|
|
3388
|
-
const localVarAxiosParamCreator = ConnectionsApiAxiosParamCreator(configuration);
|
|
3389
|
-
return {
|
|
3390
|
-
/**
|
|
3391
|
-
* 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.
|
|
3392
|
-
* @summary Delete connection
|
|
3393
|
-
* @param {ConnectionsApiDeleteConnectionRequest<TAuth>} requestParameters Request parameters.
|
|
3005
|
+
* 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.
|
|
3006
|
+
* @summary Delete connection
|
|
3007
|
+
* @param {ConnectionsApiDeleteConnectionRequest<TAuth>} requestParameters Request parameters.
|
|
3394
3008
|
* @param {*} [options] Override http request option.
|
|
3395
3009
|
* @throws {RequiredError}
|
|
3396
3010
|
*/
|
|
@@ -3520,28 +3134,6 @@ const ConnectionsApiFp = function(configuration) {
|
|
|
3520
3134
|
});
|
|
3521
3135
|
},
|
|
3522
3136
|
/**
|
|
3523
|
-
* 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.
|
|
3524
|
-
* @summary Delete connection
|
|
3525
|
-
* @param {ConnectionsApiRemoveBrokerageAuthorizationRequest<TAuth>} requestParameters Request parameters.
|
|
3526
|
-
* @param {*} [options] Override http request option.
|
|
3527
|
-
* @throws {RequiredError}
|
|
3528
|
-
*/
|
|
3529
|
-
async removeBrokerageAuthorization(requestParameters, options) {
|
|
3530
|
-
return createRequestFunction(await localVarAxiosParamCreator.removeBrokerageAuthorization(requestParameters.authorizationId, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
3531
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
3532
|
-
requestSigningByAuthMode: {
|
|
3533
|
-
"commercialApiKey": {
|
|
3534
|
-
secretParameter: "consumerKey",
|
|
3535
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
3536
|
-
},
|
|
3537
|
-
"personalApiKey": {
|
|
3538
|
-
secretParameter: "consumerKey",
|
|
3539
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
3540
|
-
}
|
|
3541
|
-
}
|
|
3542
|
-
});
|
|
3543
|
-
},
|
|
3544
|
-
/**
|
|
3545
3137
|
* Returns a list of rate of return percents for a given connection.
|
|
3546
3138
|
* @summary List connection rate of returns
|
|
3547
3139
|
* @param {ConnectionsApiReturnRatesRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -3564,28 +3156,6 @@ const ConnectionsApiFp = function(configuration) {
|
|
|
3564
3156
|
});
|
|
3565
3157
|
},
|
|
3566
3158
|
/**
|
|
3567
|
-
* Returns a list of session events associated with a user.
|
|
3568
|
-
* @summary Get all session events for a user
|
|
3569
|
-
* @param {ConnectionsApiSessionEventsRequest<TAuth>} requestParameters Request parameters.
|
|
3570
|
-
* @param {*} [options] Override http request option.
|
|
3571
|
-
* @throws {RequiredError}
|
|
3572
|
-
*/
|
|
3573
|
-
async sessionEvents(requestParameters, options) {
|
|
3574
|
-
return createRequestFunction(await localVarAxiosParamCreator.sessionEvents(requestParameters.partnerClientId, requestParameters.userId, requestParameters.sessionId, options), axios.default, BASE_PATH, configuration, {
|
|
3575
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
3576
|
-
requestSigningByAuthMode: {
|
|
3577
|
-
"commercialApiKey": {
|
|
3578
|
-
secretParameter: "consumerKey",
|
|
3579
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
3580
|
-
},
|
|
3581
|
-
"personalApiKey": {
|
|
3582
|
-
secretParameter: "consumerKey",
|
|
3583
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
3584
|
-
}
|
|
3585
|
-
}
|
|
3586
|
-
});
|
|
3587
|
-
},
|
|
3588
|
-
/**
|
|
3589
3159
|
* 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
|
|
3590
3160
|
* @summary Sync transactions for a connection
|
|
3591
3161
|
* @param {ConnectionsApiSyncBrokerageAuthorizationTransactionsRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -3613,7 +3183,7 @@ const ConnectionsApiFp = function(configuration) {
|
|
|
3613
3183
|
* ConnectionsApi - factory interface
|
|
3614
3184
|
* @export
|
|
3615
3185
|
*/
|
|
3616
|
-
const ConnectionsApiFactory = function(configuration, basePath, axios$
|
|
3186
|
+
const ConnectionsApiFactory = function(configuration, basePath, axios$4) {
|
|
3617
3187
|
const localVarFp = ConnectionsApiFp(configuration);
|
|
3618
3188
|
return {
|
|
3619
3189
|
/**
|
|
@@ -3624,7 +3194,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$6) {
|
|
|
3624
3194
|
* @throws {RequiredError}
|
|
3625
3195
|
*/
|
|
3626
3196
|
deleteConnection(requestParameters, options) {
|
|
3627
|
-
return localVarFp.deleteConnection(requestParameters, options).then((request) => request(axios$
|
|
3197
|
+
return localVarFp.deleteConnection(requestParameters, options).then((request) => request(axios$4, basePath));
|
|
3628
3198
|
},
|
|
3629
3199
|
/**
|
|
3630
3200
|
* Returns a single connection for the specified ID.
|
|
@@ -3634,7 +3204,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$6) {
|
|
|
3634
3204
|
* @throws {RequiredError}
|
|
3635
3205
|
*/
|
|
3636
3206
|
detailBrokerageAuthorization(requestParameters, options) {
|
|
3637
|
-
return localVarFp.detailBrokerageAuthorization(requestParameters, options).then((request) => request(axios$
|
|
3207
|
+
return localVarFp.detailBrokerageAuthorization(requestParameters, options).then((request) => request(axios$4, basePath));
|
|
3638
3208
|
},
|
|
3639
3209
|
/**
|
|
3640
3210
|
* Manually force the specified connection to become disabled. This should only be used for testing a reconnect flow, and never used on production connections. Will trigger a disconnect as if it happened naturally, and send a [`CONNECTION_BROKEN` webhook](/docs/webhooks#webhooks-connection_broken) for the connection. This endpoint is available on test keys. If you would like it enabled on production keys as well, please contact support as it is disabled by default.
|
|
@@ -3644,7 +3214,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$6) {
|
|
|
3644
3214
|
* @throws {RequiredError}
|
|
3645
3215
|
*/
|
|
3646
3216
|
disableBrokerageAuthorization(requestParameters, options) {
|
|
3647
|
-
return localVarFp.disableBrokerageAuthorization(requestParameters, options).then((request) => request(axios$
|
|
3217
|
+
return localVarFp.disableBrokerageAuthorization(requestParameters, options).then((request) => request(axios$4, basePath));
|
|
3648
3218
|
},
|
|
3649
3219
|
/**
|
|
3650
3220
|
* Returns all brokerage accounts that belong to the specified connection for the authenticated user. On Pay as you Go / Real-time, this endpoint refreshes each account\'s opening date, funding date, and total value live from the brokerage on each call. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
|
|
@@ -3654,7 +3224,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$6) {
|
|
|
3654
3224
|
* @throws {RequiredError}
|
|
3655
3225
|
*/
|
|
3656
3226
|
listBrokerageAuthorizationAccounts(requestParameters, options) {
|
|
3657
|
-
return localVarFp.listBrokerageAuthorizationAccounts(requestParameters, options).then((request) => request(axios$
|
|
3227
|
+
return localVarFp.listBrokerageAuthorizationAccounts(requestParameters, options).then((request) => request(axios$4, basePath));
|
|
3658
3228
|
},
|
|
3659
3229
|
/**
|
|
3660
3230
|
* Returns a list of all connections for the specified user. Note that `Connection` and `Brokerage Authorization` are interchangeable, but the term `Connection` is preferred and used in the doc for consistency. A connection is usually tied to a single login at a brokerage. A single connection can contain multiple brokerage accounts. SnapTrade performs de-duping on connections for a given user. If the user has an existing connection with the brokerage, when connecting the brokerage with the same credentials, SnapTrade will return the existing connection instead of creating a new one.
|
|
@@ -3664,7 +3234,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$6) {
|
|
|
3664
3234
|
* @throws {RequiredError}
|
|
3665
3235
|
*/
|
|
3666
3236
|
listBrokerageAuthorizations(requestParameters = {}, options) {
|
|
3667
|
-
return localVarFp.listBrokerageAuthorizations(requestParameters, options).then((request) => request(axios$
|
|
3237
|
+
return localVarFp.listBrokerageAuthorizations(requestParameters, options).then((request) => request(axios$4, basePath));
|
|
3668
3238
|
},
|
|
3669
3239
|
/**
|
|
3670
3240
|
* Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection. This endpoint will also trigger a transaction sync for the past day if one has not yet occurred. **Because of the cost of refreshing a connection, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)** **Please note this endpoint is disabled for Real-time plans (Personal and Pay as you go) unless the connection is delayed. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to the `data_freshness_mode` field on a connection to determine this.**
|
|
@@ -3674,17 +3244,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$6) {
|
|
|
3674
3244
|
* @throws {RequiredError}
|
|
3675
3245
|
*/
|
|
3676
3246
|
refreshBrokerageAuthorization(requestParameters, options) {
|
|
3677
|
-
return localVarFp.refreshBrokerageAuthorization(requestParameters, options).then((request) => request(axios$
|
|
3678
|
-
},
|
|
3679
|
-
/**
|
|
3680
|
-
* 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.
|
|
3681
|
-
* @summary Delete connection
|
|
3682
|
-
* @param {ConnectionsApiRemoveBrokerageAuthorizationRequest<TAuth>} requestParameters Request parameters.
|
|
3683
|
-
* @param {*} [options] Override http request option.
|
|
3684
|
-
* @throws {RequiredError}
|
|
3685
|
-
*/
|
|
3686
|
-
removeBrokerageAuthorization(requestParameters, options) {
|
|
3687
|
-
return localVarFp.removeBrokerageAuthorization(requestParameters, options).then((request) => request(axios$6, basePath));
|
|
3247
|
+
return localVarFp.refreshBrokerageAuthorization(requestParameters, options).then((request) => request(axios$4, basePath));
|
|
3688
3248
|
},
|
|
3689
3249
|
/**
|
|
3690
3250
|
* Returns a list of rate of return percents for a given connection.
|
|
@@ -3694,17 +3254,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$6) {
|
|
|
3694
3254
|
* @throws {RequiredError}
|
|
3695
3255
|
*/
|
|
3696
3256
|
returnRates(requestParameters, options) {
|
|
3697
|
-
return localVarFp.returnRates(requestParameters, options).then((request) => request(axios$
|
|
3698
|
-
},
|
|
3699
|
-
/**
|
|
3700
|
-
* Returns a list of session events associated with a user.
|
|
3701
|
-
* @summary Get all session events for a user
|
|
3702
|
-
* @param {ConnectionsApiSessionEventsRequest<TAuth>} requestParameters Request parameters.
|
|
3703
|
-
* @param {*} [options] Override http request option.
|
|
3704
|
-
* @throws {RequiredError}
|
|
3705
|
-
*/
|
|
3706
|
-
sessionEvents(requestParameters, options) {
|
|
3707
|
-
return localVarFp.sessionEvents(requestParameters, options).then((request) => request(axios$6, basePath));
|
|
3257
|
+
return localVarFp.returnRates(requestParameters, options).then((request) => request(axios$4, basePath));
|
|
3708
3258
|
},
|
|
3709
3259
|
/**
|
|
3710
3260
|
* 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
|
|
@@ -3714,7 +3264,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$6) {
|
|
|
3714
3264
|
* @throws {RequiredError}
|
|
3715
3265
|
*/
|
|
3716
3266
|
syncBrokerageAuthorizationTransactions(requestParameters, options) {
|
|
3717
|
-
return localVarFp.syncBrokerageAuthorizationTransactions(requestParameters, options).then((request) => request(axios$
|
|
3267
|
+
return localVarFp.syncBrokerageAuthorizationTransactions(requestParameters, options).then((request) => request(axios$4, basePath));
|
|
3718
3268
|
}
|
|
3719
3269
|
};
|
|
3720
3270
|
};
|
|
@@ -3792,17 +3342,6 @@ var ConnectionsApiGenerated = class extends BaseAPI {
|
|
|
3792
3342
|
return ConnectionsApiFp(this.configuration).refreshBrokerageAuthorization(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
3793
3343
|
}
|
|
3794
3344
|
/**
|
|
3795
|
-
* 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.
|
|
3796
|
-
* @summary Delete connection
|
|
3797
|
-
* @param {ConnectionsApiRemoveBrokerageAuthorizationRequest<TAuth>} requestParameters Request parameters.
|
|
3798
|
-
* @param {*} [options] Override http request option.
|
|
3799
|
-
* @throws {RequiredError}
|
|
3800
|
-
* @memberof ConnectionsApiGenerated
|
|
3801
|
-
*/
|
|
3802
|
-
removeBrokerageAuthorization(requestParameters, options) {
|
|
3803
|
-
return ConnectionsApiFp(this.configuration).removeBrokerageAuthorization(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
3804
|
-
}
|
|
3805
|
-
/**
|
|
3806
3345
|
* Returns a list of rate of return percents for a given connection.
|
|
3807
3346
|
* @summary List connection rate of returns
|
|
3808
3347
|
* @param {ConnectionsApiReturnRatesRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -3814,17 +3353,6 @@ var ConnectionsApiGenerated = class extends BaseAPI {
|
|
|
3814
3353
|
return ConnectionsApiFp(this.configuration).returnRates(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
3815
3354
|
}
|
|
3816
3355
|
/**
|
|
3817
|
-
* Returns a list of session events associated with a user.
|
|
3818
|
-
* @summary Get all session events for a user
|
|
3819
|
-
* @param {ConnectionsApiSessionEventsRequest<TAuth>} requestParameters Request parameters.
|
|
3820
|
-
* @param {*} [options] Override http request option.
|
|
3821
|
-
* @throws {RequiredError}
|
|
3822
|
-
* @memberof ConnectionsApiGenerated
|
|
3823
|
-
*/
|
|
3824
|
-
sessionEvents(requestParameters, options) {
|
|
3825
|
-
return ConnectionsApiFp(this.configuration).sessionEvents(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
3826
|
-
}
|
|
3827
|
-
/**
|
|
3828
3356
|
* 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
|
|
3829
3357
|
* @summary Sync transactions for a connection
|
|
3830
3358
|
* @param {ConnectionsApiSyncBrokerageAuthorizationTransactionsRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -4532,7 +4060,7 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4532
4060
|
* ExperimentalEndpointsApi - factory interface
|
|
4533
4061
|
* @export
|
|
4534
4062
|
*/
|
|
4535
|
-
const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
4063
|
+
const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$3) {
|
|
4536
4064
|
const localVarFp = ExperimentalEndpointsApiFp(configuration);
|
|
4537
4065
|
return {
|
|
4538
4066
|
/**
|
|
@@ -4543,7 +4071,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4543
4071
|
* @throws {RequiredError}
|
|
4544
4072
|
*/
|
|
4545
4073
|
addSubscription(requestParameters, options) {
|
|
4546
|
-
return localVarFp.addSubscription(requestParameters, options).then((request) => request(axios$
|
|
4074
|
+
return localVarFp.addSubscription(requestParameters, options).then((request) => request(axios$3, basePath));
|
|
4547
4075
|
},
|
|
4548
4076
|
/**
|
|
4549
4077
|
* Cancels a Trade Detection subscription for a connected brokerage account. This endpoint requires partner signature authentication only and does not require `userId` or `userSecret`.
|
|
@@ -4553,7 +4081,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4553
4081
|
* @throws {RequiredError}
|
|
4554
4082
|
*/
|
|
4555
4083
|
cancelSubscription(requestParameters, options) {
|
|
4556
|
-
return localVarFp.cancelSubscription(requestParameters, options).then((request) => request(axios$
|
|
4084
|
+
return localVarFp.cancelSubscription(requestParameters, options).then((request) => request(axios$3, basePath));
|
|
4557
4085
|
},
|
|
4558
4086
|
/**
|
|
4559
4087
|
* Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
@@ -4563,7 +4091,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4563
4091
|
* @throws {RequiredError}
|
|
4564
4092
|
*/
|
|
4565
4093
|
getUserAccountOrderDetailV2(requestParameters, options) {
|
|
4566
|
-
return localVarFp.getUserAccountOrderDetailV2(requestParameters, options).then((request) => request(axios$
|
|
4094
|
+
return localVarFp.getUserAccountOrderDetailV2(requestParameters, options).then((request) => request(axios$3, basePath));
|
|
4567
4095
|
},
|
|
4568
4096
|
/**
|
|
4569
4097
|
* 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.
|
|
@@ -4573,7 +4101,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4573
4101
|
* @throws {RequiredError}
|
|
4574
4102
|
*/
|
|
4575
4103
|
getUserAccountOrdersV2(requestParameters, options) {
|
|
4576
|
-
return localVarFp.getUserAccountOrdersV2(requestParameters, options).then((request) => request(axios$
|
|
4104
|
+
return localVarFp.getUserAccountOrdersV2(requestParameters, options).then((request) => request(axios$3, basePath));
|
|
4577
4105
|
},
|
|
4578
4106
|
/**
|
|
4579
4107
|
* 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)**
|
|
@@ -4583,7 +4111,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4583
4111
|
* @throws {RequiredError}
|
|
4584
4112
|
*/
|
|
4585
4113
|
getUserAccountRecentOrdersV2(requestParameters, options) {
|
|
4586
|
-
return localVarFp.getUserAccountRecentOrdersV2(requestParameters, options).then((request) => request(axios$
|
|
4114
|
+
return localVarFp.getUserAccountRecentOrdersV2(requestParameters, options).then((request) => request(axios$3, basePath));
|
|
4587
4115
|
},
|
|
4588
4116
|
/**
|
|
4589
4117
|
* 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.
|
|
@@ -4593,7 +4121,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4593
4121
|
* @throws {RequiredError}
|
|
4594
4122
|
*/
|
|
4595
4123
|
listConnectionAccounts(requestParameters, options) {
|
|
4596
|
-
return localVarFp.listConnectionAccounts(requestParameters, options).then((request) => request(axios$
|
|
4124
|
+
return localVarFp.listConnectionAccounts(requestParameters, options).then((request) => request(axios$3, basePath));
|
|
4597
4125
|
},
|
|
4598
4126
|
/**
|
|
4599
4127
|
* Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|
|
@@ -4602,7 +4130,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4602
4130
|
* @throws {RequiredError}
|
|
4603
4131
|
*/
|
|
4604
4132
|
listSubscriptions(...args) {
|
|
4605
|
-
return localVarFp.listSubscriptions(...args).then((request) => request(axios$
|
|
4133
|
+
return localVarFp.listSubscriptions(...args).then((request) => request(axios$3, basePath));
|
|
4606
4134
|
}
|
|
4607
4135
|
};
|
|
4608
4136
|
};
|
|
@@ -4694,277 +4222,54 @@ var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
|
|
|
4694
4222
|
//#region api/experimental-endpoints-api.ts
|
|
4695
4223
|
var ExperimentalEndpointsApi = class extends ExperimentalEndpointsApiGenerated {};
|
|
4696
4224
|
//#endregion
|
|
4697
|
-
//#region api/
|
|
4225
|
+
//#region api/reference-data-api-generated.ts
|
|
4698
4226
|
/**
|
|
4699
|
-
*
|
|
4227
|
+
* ReferenceDataApi - axios parameter creator
|
|
4700
4228
|
* @export
|
|
4701
4229
|
*/
|
|
4702
|
-
const
|
|
4703
|
-
return {
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
...options
|
|
4724
|
-
};
|
|
4725
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4726
|
-
const localVarQueryParameter = {};
|
|
4727
|
-
if (configuration?.authMode === "commercialApiKey") {
|
|
4728
|
-
await setApiKeyToObject({
|
|
4230
|
+
const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
4231
|
+
return {
|
|
4232
|
+
/**
|
|
4233
|
+
* Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
|
|
4234
|
+
* @summary Get Client Info
|
|
4235
|
+
* @param {*} [options] Override http request option.
|
|
4236
|
+
* @throws {RequiredError}
|
|
4237
|
+
*/
|
|
4238
|
+
getPartnerInfo: async (options = {}) => {
|
|
4239
|
+
const localVarPath = `/snapTrade/partners`;
|
|
4240
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
4241
|
+
let baseOptions;
|
|
4242
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
4243
|
+
const localVarRequestOptions = {
|
|
4244
|
+
method: "GET",
|
|
4245
|
+
...baseOptions,
|
|
4246
|
+
...options
|
|
4247
|
+
};
|
|
4248
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4249
|
+
const localVarQueryParameter = {};
|
|
4250
|
+
if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
|
|
4729
4251
|
object: localVarQueryParameter,
|
|
4730
4252
|
key: "clientId",
|
|
4731
4253
|
keyParamName: "clientId",
|
|
4732
4254
|
configuration
|
|
4733
4255
|
});
|
|
4734
|
-
if (
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
secretParameter: "consumerKey",
|
|
4752
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4753
|
-
}
|
|
4754
|
-
},
|
|
4755
|
-
selectedAuthMode: configuration?.authMode
|
|
4756
|
-
};
|
|
4757
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4758
|
-
localVarRequestOptions.headers = {
|
|
4759
|
-
...localVarHeaderParameter,
|
|
4760
|
-
...headersFromBaseOptions,
|
|
4761
|
-
...options.headers
|
|
4762
|
-
};
|
|
4763
|
-
requestBeforeHook({
|
|
4764
|
-
queryParameters: localVarQueryParameter,
|
|
4765
|
-
requestConfig: localVarRequestOptions,
|
|
4766
|
-
path: localVarPath,
|
|
4767
|
-
configuration,
|
|
4768
|
-
pathTemplate: "/accounts/{accountId}/options",
|
|
4769
|
-
httpMethod: "GET",
|
|
4770
|
-
operationAuth: localVarOperationAuth
|
|
4771
|
-
});
|
|
4772
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
4773
|
-
return {
|
|
4774
|
-
url: toPathString(localVarUrlObj),
|
|
4775
|
-
options: localVarRequestOptions
|
|
4776
|
-
};
|
|
4777
|
-
} };
|
|
4778
|
-
};
|
|
4779
|
-
/**
|
|
4780
|
-
* OptionsApi - functional programming interface
|
|
4781
|
-
* @export
|
|
4782
|
-
*/
|
|
4783
|
-
const OptionsApiFp = function(configuration) {
|
|
4784
|
-
const localVarAxiosParamCreator = OptionsApiAxiosParamCreator(configuration);
|
|
4785
|
-
return {
|
|
4786
|
-
/**
|
|
4787
|
-
* **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.
|
|
4788
|
-
* @summary List account option positions
|
|
4789
|
-
* @param {OptionsApiListOptionHoldingsRequest<TAuth>} requestParameters Request parameters.
|
|
4790
|
-
* @param {*} [options] Override http request option.
|
|
4791
|
-
* @deprecated
|
|
4792
|
-
* @throws {RequiredError}
|
|
4793
|
-
*/
|
|
4794
|
-
async listOptionHoldings(requestParameters, options) {
|
|
4795
|
-
return createRequestFunction(await localVarAxiosParamCreator.listOptionHoldings(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
4796
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4797
|
-
requestSigningByAuthMode: {
|
|
4798
|
-
"commercialApiKey": {
|
|
4799
|
-
secretParameter: "consumerKey",
|
|
4800
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4801
|
-
},
|
|
4802
|
-
"personalApiKey": {
|
|
4803
|
-
secretParameter: "consumerKey",
|
|
4804
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4805
|
-
}
|
|
4806
|
-
}
|
|
4807
|
-
});
|
|
4808
|
-
} };
|
|
4809
|
-
};
|
|
4810
|
-
/**
|
|
4811
|
-
* OptionsApi - factory interface
|
|
4812
|
-
* @export
|
|
4813
|
-
*/
|
|
4814
|
-
const OptionsApiFactory = function(configuration, basePath, axios$4) {
|
|
4815
|
-
const localVarFp = OptionsApiFp(configuration);
|
|
4816
|
-
return {
|
|
4817
|
-
/**
|
|
4818
|
-
* **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.
|
|
4819
|
-
* @summary List account option positions
|
|
4820
|
-
* @param {OptionsApiListOptionHoldingsRequest<TAuth>} requestParameters Request parameters.
|
|
4821
|
-
* @param {*} [options] Override http request option.
|
|
4822
|
-
* @deprecated
|
|
4823
|
-
* @throws {RequiredError}
|
|
4824
|
-
*/
|
|
4825
|
-
listOptionHoldings(requestParameters, options) {
|
|
4826
|
-
return localVarFp.listOptionHoldings(requestParameters, options).then((request) => request(axios$4, basePath));
|
|
4827
|
-
} };
|
|
4828
|
-
};
|
|
4829
|
-
/**
|
|
4830
|
-
* OptionsApiGenerated - object-oriented interface
|
|
4831
|
-
* @export
|
|
4832
|
-
* @class OptionsApiGenerated
|
|
4833
|
-
* @extends {BaseAPI}
|
|
4834
|
-
*/
|
|
4835
|
-
var OptionsApiGenerated = class extends BaseAPI {
|
|
4836
|
-
/**
|
|
4837
|
-
* **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.
|
|
4838
|
-
* @summary List account option positions
|
|
4839
|
-
* @param {OptionsApiListOptionHoldingsRequest<TAuth>} requestParameters Request parameters.
|
|
4840
|
-
* @param {*} [options] Override http request option.
|
|
4841
|
-
* @deprecated
|
|
4842
|
-
* @throws {RequiredError}
|
|
4843
|
-
* @memberof OptionsApiGenerated
|
|
4844
|
-
*/
|
|
4845
|
-
listOptionHoldings(requestParameters, options) {
|
|
4846
|
-
return OptionsApiFp(this.configuration).listOptionHoldings(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
4847
|
-
}
|
|
4848
|
-
};
|
|
4849
|
-
//#endregion
|
|
4850
|
-
//#region api/options-api.ts
|
|
4851
|
-
var OptionsApi = class extends OptionsApiGenerated {};
|
|
4852
|
-
//#endregion
|
|
4853
|
-
//#region api/reference-data-api-generated.ts
|
|
4854
|
-
/**
|
|
4855
|
-
* ReferenceDataApi - axios parameter creator
|
|
4856
|
-
* @export
|
|
4857
|
-
*/
|
|
4858
|
-
const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
4859
|
-
return {
|
|
4860
|
-
/**
|
|
4861
|
-
* Returns an Exchange Rate Pair object for the specified Currency Pair.
|
|
4862
|
-
* @summary Get exchange rate of a currency pair
|
|
4863
|
-
* @param {string} currencyPair A currency pair based on currency code for example, {CAD-USD}
|
|
4864
|
-
* @param {*} [options] Override http request option.
|
|
4865
|
-
* @throws {RequiredError}
|
|
4866
|
-
*/
|
|
4867
|
-
getCurrencyExchangeRatePair: async (currencyPair, options = {}) => {
|
|
4868
|
-
assertParamExists("getCurrencyExchangeRatePair", "currencyPair", currencyPair);
|
|
4869
|
-
const localVarPath = `/currencies/rates/{currencyPair}`.replace(`{currencyPair}`, encodeURIComponent(String(currencyPair !== void 0 ? currencyPair : `-currencyPair-`)));
|
|
4870
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
4871
|
-
let baseOptions;
|
|
4872
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
4873
|
-
const localVarRequestOptions = {
|
|
4874
|
-
method: "GET",
|
|
4875
|
-
...baseOptions,
|
|
4876
|
-
...options
|
|
4877
|
-
};
|
|
4878
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4879
|
-
const localVarQueryParameter = {};
|
|
4880
|
-
if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
|
|
4881
|
-
object: localVarQueryParameter,
|
|
4882
|
-
key: "clientId",
|
|
4883
|
-
keyParamName: "clientId",
|
|
4884
|
-
configuration
|
|
4885
|
-
});
|
|
4886
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
4887
|
-
object: localVarQueryParameter,
|
|
4888
|
-
key: "clientId",
|
|
4889
|
-
keyParamName: "clientId",
|
|
4890
|
-
configuration
|
|
4891
|
-
});
|
|
4892
|
-
const localVarOperationAuth = {
|
|
4893
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4894
|
-
requestSigningByAuthMode: {
|
|
4895
|
-
"commercialApiKey": {
|
|
4896
|
-
secretParameter: "consumerKey",
|
|
4897
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4898
|
-
},
|
|
4899
|
-
"personalApiKey": {
|
|
4900
|
-
secretParameter: "consumerKey",
|
|
4901
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4902
|
-
}
|
|
4903
|
-
},
|
|
4904
|
-
selectedAuthMode: configuration?.authMode
|
|
4905
|
-
};
|
|
4906
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4907
|
-
localVarRequestOptions.headers = {
|
|
4908
|
-
...localVarHeaderParameter,
|
|
4909
|
-
...headersFromBaseOptions,
|
|
4910
|
-
...options.headers
|
|
4911
|
-
};
|
|
4912
|
-
requestBeforeHook({
|
|
4913
|
-
queryParameters: localVarQueryParameter,
|
|
4914
|
-
requestConfig: localVarRequestOptions,
|
|
4915
|
-
path: localVarPath,
|
|
4916
|
-
configuration,
|
|
4917
|
-
pathTemplate: "/currencies/rates/{currencyPair}",
|
|
4918
|
-
httpMethod: "GET",
|
|
4919
|
-
operationAuth: localVarOperationAuth
|
|
4920
|
-
});
|
|
4921
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
4922
|
-
return {
|
|
4923
|
-
url: toPathString(localVarUrlObj),
|
|
4924
|
-
options: localVarRequestOptions
|
|
4925
|
-
};
|
|
4926
|
-
},
|
|
4927
|
-
/**
|
|
4928
|
-
* Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
|
|
4929
|
-
* @summary Get Client Info
|
|
4930
|
-
* @param {*} [options] Override http request option.
|
|
4931
|
-
* @throws {RequiredError}
|
|
4932
|
-
*/
|
|
4933
|
-
getPartnerInfo: async (options = {}) => {
|
|
4934
|
-
const localVarPath = `/snapTrade/partners`;
|
|
4935
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
4936
|
-
let baseOptions;
|
|
4937
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
4938
|
-
const localVarRequestOptions = {
|
|
4939
|
-
method: "GET",
|
|
4940
|
-
...baseOptions,
|
|
4941
|
-
...options
|
|
4942
|
-
};
|
|
4943
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4944
|
-
const localVarQueryParameter = {};
|
|
4945
|
-
if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
|
|
4946
|
-
object: localVarQueryParameter,
|
|
4947
|
-
key: "clientId",
|
|
4948
|
-
keyParamName: "clientId",
|
|
4949
|
-
configuration
|
|
4950
|
-
});
|
|
4951
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
4952
|
-
object: localVarQueryParameter,
|
|
4953
|
-
key: "clientId",
|
|
4954
|
-
keyParamName: "clientId",
|
|
4955
|
-
configuration
|
|
4956
|
-
});
|
|
4957
|
-
const localVarOperationAuth = {
|
|
4958
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4959
|
-
requestSigningByAuthMode: {
|
|
4960
|
-
"commercialApiKey": {
|
|
4961
|
-
secretParameter: "consumerKey",
|
|
4962
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4963
|
-
},
|
|
4964
|
-
"personalApiKey": {
|
|
4965
|
-
secretParameter: "consumerKey",
|
|
4966
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4967
|
-
}
|
|
4256
|
+
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
4257
|
+
object: localVarQueryParameter,
|
|
4258
|
+
key: "clientId",
|
|
4259
|
+
keyParamName: "clientId",
|
|
4260
|
+
configuration
|
|
4261
|
+
});
|
|
4262
|
+
const localVarOperationAuth = {
|
|
4263
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4264
|
+
requestSigningByAuthMode: {
|
|
4265
|
+
"commercialApiKey": {
|
|
4266
|
+
secretParameter: "consumerKey",
|
|
4267
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4268
|
+
},
|
|
4269
|
+
"personalApiKey": {
|
|
4270
|
+
secretParameter: "consumerKey",
|
|
4271
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4272
|
+
}
|
|
4968
4273
|
},
|
|
4969
4274
|
selectedAuthMode: configuration?.authMode
|
|
4970
4275
|
};
|
|
@@ -4990,71 +4295,6 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
|
4990
4295
|
};
|
|
4991
4296
|
},
|
|
4992
4297
|
/**
|
|
4993
|
-
* Return all available security types supported by SnapTrade.
|
|
4994
|
-
* @summary List security types
|
|
4995
|
-
* @param {*} [options] Override http request option.
|
|
4996
|
-
* @throws {RequiredError}
|
|
4997
|
-
*/
|
|
4998
|
-
getSecurityTypes: async (options = {}) => {
|
|
4999
|
-
const localVarPath = `/securityTypes`;
|
|
5000
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
5001
|
-
let baseOptions;
|
|
5002
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
5003
|
-
const localVarRequestOptions = {
|
|
5004
|
-
method: "GET",
|
|
5005
|
-
...baseOptions,
|
|
5006
|
-
...options
|
|
5007
|
-
};
|
|
5008
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
5009
|
-
const localVarQueryParameter = {};
|
|
5010
|
-
if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
|
|
5011
|
-
object: localVarQueryParameter,
|
|
5012
|
-
key: "clientId",
|
|
5013
|
-
keyParamName: "clientId",
|
|
5014
|
-
configuration
|
|
5015
|
-
});
|
|
5016
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
5017
|
-
object: localVarQueryParameter,
|
|
5018
|
-
key: "clientId",
|
|
5019
|
-
keyParamName: "clientId",
|
|
5020
|
-
configuration
|
|
5021
|
-
});
|
|
5022
|
-
const localVarOperationAuth = {
|
|
5023
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5024
|
-
requestSigningByAuthMode: {
|
|
5025
|
-
"commercialApiKey": {
|
|
5026
|
-
secretParameter: "consumerKey",
|
|
5027
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
5028
|
-
},
|
|
5029
|
-
"personalApiKey": {
|
|
5030
|
-
secretParameter: "consumerKey",
|
|
5031
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
5032
|
-
}
|
|
5033
|
-
},
|
|
5034
|
-
selectedAuthMode: configuration?.authMode
|
|
5035
|
-
};
|
|
5036
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
5037
|
-
localVarRequestOptions.headers = {
|
|
5038
|
-
...localVarHeaderParameter,
|
|
5039
|
-
...headersFromBaseOptions,
|
|
5040
|
-
...options.headers
|
|
5041
|
-
};
|
|
5042
|
-
requestBeforeHook({
|
|
5043
|
-
queryParameters: localVarQueryParameter,
|
|
5044
|
-
requestConfig: localVarRequestOptions,
|
|
5045
|
-
path: localVarPath,
|
|
5046
|
-
configuration,
|
|
5047
|
-
pathTemplate: "/securityTypes",
|
|
5048
|
-
httpMethod: "GET",
|
|
5049
|
-
operationAuth: localVarOperationAuth
|
|
5050
|
-
});
|
|
5051
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
5052
|
-
return {
|
|
5053
|
-
url: toPathString(localVarUrlObj),
|
|
5054
|
-
options: localVarRequestOptions
|
|
5055
|
-
};
|
|
5056
|
-
},
|
|
5057
|
-
/**
|
|
5058
4298
|
* Returns a list of all supported Exchanges.
|
|
5059
4299
|
* @summary Get exchanges
|
|
5060
4300
|
* @param {*} [options] Override http request option.
|
|
@@ -5455,136 +4695,6 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
|
5455
4695
|
};
|
|
5456
4696
|
},
|
|
5457
4697
|
/**
|
|
5458
|
-
* Returns a list of all defined Currency objects.
|
|
5459
|
-
* @summary Get currencies
|
|
5460
|
-
* @param {*} [options] Override http request option.
|
|
5461
|
-
* @throws {RequiredError}
|
|
5462
|
-
*/
|
|
5463
|
-
listAllCurrencies: async (options = {}) => {
|
|
5464
|
-
const localVarPath = `/currencies`;
|
|
5465
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
5466
|
-
let baseOptions;
|
|
5467
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
5468
|
-
const localVarRequestOptions = {
|
|
5469
|
-
method: "GET",
|
|
5470
|
-
...baseOptions,
|
|
5471
|
-
...options
|
|
5472
|
-
};
|
|
5473
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
5474
|
-
const localVarQueryParameter = {};
|
|
5475
|
-
if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
|
|
5476
|
-
object: localVarQueryParameter,
|
|
5477
|
-
key: "clientId",
|
|
5478
|
-
keyParamName: "clientId",
|
|
5479
|
-
configuration
|
|
5480
|
-
});
|
|
5481
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
5482
|
-
object: localVarQueryParameter,
|
|
5483
|
-
key: "clientId",
|
|
5484
|
-
keyParamName: "clientId",
|
|
5485
|
-
configuration
|
|
5486
|
-
});
|
|
5487
|
-
const localVarOperationAuth = {
|
|
5488
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5489
|
-
requestSigningByAuthMode: {
|
|
5490
|
-
"commercialApiKey": {
|
|
5491
|
-
secretParameter: "consumerKey",
|
|
5492
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
5493
|
-
},
|
|
5494
|
-
"personalApiKey": {
|
|
5495
|
-
secretParameter: "consumerKey",
|
|
5496
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
5497
|
-
}
|
|
5498
|
-
},
|
|
5499
|
-
selectedAuthMode: configuration?.authMode
|
|
5500
|
-
};
|
|
5501
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
5502
|
-
localVarRequestOptions.headers = {
|
|
5503
|
-
...localVarHeaderParameter,
|
|
5504
|
-
...headersFromBaseOptions,
|
|
5505
|
-
...options.headers
|
|
5506
|
-
};
|
|
5507
|
-
requestBeforeHook({
|
|
5508
|
-
queryParameters: localVarQueryParameter,
|
|
5509
|
-
requestConfig: localVarRequestOptions,
|
|
5510
|
-
path: localVarPath,
|
|
5511
|
-
configuration,
|
|
5512
|
-
pathTemplate: "/currencies",
|
|
5513
|
-
httpMethod: "GET",
|
|
5514
|
-
operationAuth: localVarOperationAuth
|
|
5515
|
-
});
|
|
5516
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
5517
|
-
return {
|
|
5518
|
-
url: toPathString(localVarUrlObj),
|
|
5519
|
-
options: localVarRequestOptions
|
|
5520
|
-
};
|
|
5521
|
-
},
|
|
5522
|
-
/**
|
|
5523
|
-
* Returns a list of all Exchange Rate Pairs for all supported Currencies.
|
|
5524
|
-
* @summary Get currency exchange rates
|
|
5525
|
-
* @param {*} [options] Override http request option.
|
|
5526
|
-
* @throws {RequiredError}
|
|
5527
|
-
*/
|
|
5528
|
-
listAllCurrenciesRates: async (options = {}) => {
|
|
5529
|
-
const localVarPath = `/currencies/rates`;
|
|
5530
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
5531
|
-
let baseOptions;
|
|
5532
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
5533
|
-
const localVarRequestOptions = {
|
|
5534
|
-
method: "GET",
|
|
5535
|
-
...baseOptions,
|
|
5536
|
-
...options
|
|
5537
|
-
};
|
|
5538
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
5539
|
-
const localVarQueryParameter = {};
|
|
5540
|
-
if (configuration?.authMode === "commercialApiKey") await setApiKeyToObject({
|
|
5541
|
-
object: localVarQueryParameter,
|
|
5542
|
-
key: "clientId",
|
|
5543
|
-
keyParamName: "clientId",
|
|
5544
|
-
configuration
|
|
5545
|
-
});
|
|
5546
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
5547
|
-
object: localVarQueryParameter,
|
|
5548
|
-
key: "clientId",
|
|
5549
|
-
keyParamName: "clientId",
|
|
5550
|
-
configuration
|
|
5551
|
-
});
|
|
5552
|
-
const localVarOperationAuth = {
|
|
5553
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5554
|
-
requestSigningByAuthMode: {
|
|
5555
|
-
"commercialApiKey": {
|
|
5556
|
-
secretParameter: "consumerKey",
|
|
5557
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
5558
|
-
},
|
|
5559
|
-
"personalApiKey": {
|
|
5560
|
-
secretParameter: "consumerKey",
|
|
5561
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
5562
|
-
}
|
|
5563
|
-
},
|
|
5564
|
-
selectedAuthMode: configuration?.authMode
|
|
5565
|
-
};
|
|
5566
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
5567
|
-
localVarRequestOptions.headers = {
|
|
5568
|
-
...localVarHeaderParameter,
|
|
5569
|
-
...headersFromBaseOptions,
|
|
5570
|
-
...options.headers
|
|
5571
|
-
};
|
|
5572
|
-
requestBeforeHook({
|
|
5573
|
-
queryParameters: localVarQueryParameter,
|
|
5574
|
-
requestConfig: localVarRequestOptions,
|
|
5575
|
-
path: localVarPath,
|
|
5576
|
-
configuration,
|
|
5577
|
-
pathTemplate: "/currencies/rates",
|
|
5578
|
-
httpMethod: "GET",
|
|
5579
|
-
operationAuth: localVarOperationAuth
|
|
5580
|
-
});
|
|
5581
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
5582
|
-
return {
|
|
5583
|
-
url: toPathString(localVarUrlObj),
|
|
5584
|
-
options: localVarRequestOptions
|
|
5585
|
-
};
|
|
5586
|
-
},
|
|
5587
|
-
/**
|
|
5588
4698
|
* 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.
|
|
5589
4699
|
* @summary Search account symbols
|
|
5590
4700
|
* @param {string} accountId
|
|
@@ -5670,28 +4780,6 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
|
5670
4780
|
const ReferenceDataApiFp = function(configuration) {
|
|
5671
4781
|
const localVarAxiosParamCreator = ReferenceDataApiAxiosParamCreator(configuration);
|
|
5672
4782
|
return {
|
|
5673
|
-
/**
|
|
5674
|
-
* Returns an Exchange Rate Pair object for the specified Currency Pair.
|
|
5675
|
-
* @summary Get exchange rate of a currency pair
|
|
5676
|
-
* @param {ReferenceDataApiGetCurrencyExchangeRatePairRequest<TAuth>} requestParameters Request parameters.
|
|
5677
|
-
* @param {*} [options] Override http request option.
|
|
5678
|
-
* @throws {RequiredError}
|
|
5679
|
-
*/
|
|
5680
|
-
async getCurrencyExchangeRatePair(requestParameters, options) {
|
|
5681
|
-
return createRequestFunction(await localVarAxiosParamCreator.getCurrencyExchangeRatePair(requestParameters.currencyPair, options), axios.default, BASE_PATH, configuration, {
|
|
5682
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5683
|
-
requestSigningByAuthMode: {
|
|
5684
|
-
"commercialApiKey": {
|
|
5685
|
-
secretParameter: "consumerKey",
|
|
5686
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
5687
|
-
},
|
|
5688
|
-
"personalApiKey": {
|
|
5689
|
-
secretParameter: "consumerKey",
|
|
5690
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
5691
|
-
}
|
|
5692
|
-
}
|
|
5693
|
-
});
|
|
5694
|
-
},
|
|
5695
4783
|
/**
|
|
5696
4784
|
* Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
|
|
5697
4785
|
* @summary Get Client Info
|
|
@@ -5715,28 +4803,6 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5715
4803
|
});
|
|
5716
4804
|
},
|
|
5717
4805
|
/**
|
|
5718
|
-
* Return all available security types supported by SnapTrade.
|
|
5719
|
-
* @summary List security types
|
|
5720
|
-
* @param {*} [options] Override http request option.
|
|
5721
|
-
* @throws {RequiredError}
|
|
5722
|
-
*/
|
|
5723
|
-
async getSecurityTypes(...args) {
|
|
5724
|
-
const [options] = args;
|
|
5725
|
-
return createRequestFunction(await localVarAxiosParamCreator.getSecurityTypes(options), axios.default, BASE_PATH, configuration, {
|
|
5726
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5727
|
-
requestSigningByAuthMode: {
|
|
5728
|
-
"commercialApiKey": {
|
|
5729
|
-
secretParameter: "consumerKey",
|
|
5730
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
5731
|
-
},
|
|
5732
|
-
"personalApiKey": {
|
|
5733
|
-
secretParameter: "consumerKey",
|
|
5734
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
5735
|
-
}
|
|
5736
|
-
}
|
|
5737
|
-
});
|
|
5738
|
-
},
|
|
5739
|
-
/**
|
|
5740
4806
|
* Returns a list of all supported Exchanges.
|
|
5741
4807
|
* @summary Get exchanges
|
|
5742
4808
|
* @param {*} [options] Override http request option.
|
|
@@ -5788,52 +4854,8 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5788
4854
|
* @param {*} [options] Override http request option.
|
|
5789
4855
|
* @throws {RequiredError}
|
|
5790
4856
|
*/
|
|
5791
|
-
async getSymbolsByTicker(requestParameters, options) {
|
|
5792
|
-
return createRequestFunction(await localVarAxiosParamCreator.getSymbolsByTicker(requestParameters.query, options), axios.default, BASE_PATH, configuration, {
|
|
5793
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5794
|
-
requestSigningByAuthMode: {
|
|
5795
|
-
"commercialApiKey": {
|
|
5796
|
-
secretParameter: "consumerKey",
|
|
5797
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
5798
|
-
},
|
|
5799
|
-
"personalApiKey": {
|
|
5800
|
-
secretParameter: "consumerKey",
|
|
5801
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
5802
|
-
}
|
|
5803
|
-
}
|
|
5804
|
-
});
|
|
5805
|
-
},
|
|
5806
|
-
/**
|
|
5807
|
-
* Returns a list of all defined Brokerage authorization Type objects.
|
|
5808
|
-
* @summary Get all brokerage authorization types
|
|
5809
|
-
* @param {ReferenceDataApiListAllBrokerageAuthorizationTypeRequest<TAuth>} requestParameters Request parameters.
|
|
5810
|
-
* @param {*} [options] Override http request option.
|
|
5811
|
-
* @throws {RequiredError}
|
|
5812
|
-
*/
|
|
5813
|
-
async listAllBrokerageAuthorizationType(requestParameters = {}, options) {
|
|
5814
|
-
return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerageAuthorizationType(requestParameters.brokerage, options), axios.default, BASE_PATH, configuration, {
|
|
5815
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5816
|
-
requestSigningByAuthMode: {
|
|
5817
|
-
"commercialApiKey": {
|
|
5818
|
-
secretParameter: "consumerKey",
|
|
5819
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
5820
|
-
},
|
|
5821
|
-
"personalApiKey": {
|
|
5822
|
-
secretParameter: "consumerKey",
|
|
5823
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
5824
|
-
}
|
|
5825
|
-
}
|
|
5826
|
-
});
|
|
5827
|
-
},
|
|
5828
|
-
/**
|
|
5829
|
-
* 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.
|
|
5830
|
-
* @summary Get brokerage instruments
|
|
5831
|
-
* @param {ReferenceDataApiListAllBrokerageInstrumentsRequest<TAuth>} requestParameters Request parameters.
|
|
5832
|
-
* @param {*} [options] Override http request option.
|
|
5833
|
-
* @throws {RequiredError}
|
|
5834
|
-
*/
|
|
5835
|
-
async listAllBrokerageInstruments(requestParameters, options) {
|
|
5836
|
-
return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerageInstruments(requestParameters.slug, options), axios.default, BASE_PATH, configuration, {
|
|
4857
|
+
async getSymbolsByTicker(requestParameters, options) {
|
|
4858
|
+
return createRequestFunction(await localVarAxiosParamCreator.getSymbolsByTicker(requestParameters.query, options), axios.default, BASE_PATH, configuration, {
|
|
5837
4859
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5838
4860
|
requestSigningByAuthMode: {
|
|
5839
4861
|
"commercialApiKey": {
|
|
@@ -5848,14 +4870,14 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5848
4870
|
});
|
|
5849
4871
|
},
|
|
5850
4872
|
/**
|
|
5851
|
-
* Returns a list of all defined Brokerage objects.
|
|
5852
|
-
* @summary Get
|
|
4873
|
+
* Returns a list of all defined Brokerage authorization Type objects.
|
|
4874
|
+
* @summary Get all brokerage authorization types
|
|
4875
|
+
* @param {ReferenceDataApiListAllBrokerageAuthorizationTypeRequest<TAuth>} requestParameters Request parameters.
|
|
5853
4876
|
* @param {*} [options] Override http request option.
|
|
5854
4877
|
* @throws {RequiredError}
|
|
5855
4878
|
*/
|
|
5856
|
-
async
|
|
5857
|
-
|
|
5858
|
-
return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerages(options), axios.default, BASE_PATH, configuration, {
|
|
4879
|
+
async listAllBrokerageAuthorizationType(requestParameters = {}, options) {
|
|
4880
|
+
return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerageAuthorizationType(requestParameters.brokerage, options), axios.default, BASE_PATH, configuration, {
|
|
5859
4881
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5860
4882
|
requestSigningByAuthMode: {
|
|
5861
4883
|
"commercialApiKey": {
|
|
@@ -5870,14 +4892,14 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5870
4892
|
});
|
|
5871
4893
|
},
|
|
5872
4894
|
/**
|
|
5873
|
-
* Returns a list of all
|
|
5874
|
-
* @summary Get
|
|
4895
|
+
* 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.
|
|
4896
|
+
* @summary Get brokerage instruments
|
|
4897
|
+
* @param {ReferenceDataApiListAllBrokerageInstrumentsRequest<TAuth>} requestParameters Request parameters.
|
|
5875
4898
|
* @param {*} [options] Override http request option.
|
|
5876
4899
|
* @throws {RequiredError}
|
|
5877
4900
|
*/
|
|
5878
|
-
async
|
|
5879
|
-
|
|
5880
|
-
return createRequestFunction(await localVarAxiosParamCreator.listAllCurrencies(options), axios.default, BASE_PATH, configuration, {
|
|
4901
|
+
async listAllBrokerageInstruments(requestParameters, options) {
|
|
4902
|
+
return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerageInstruments(requestParameters.slug, options), axios.default, BASE_PATH, configuration, {
|
|
5881
4903
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5882
4904
|
requestSigningByAuthMode: {
|
|
5883
4905
|
"commercialApiKey": {
|
|
@@ -5892,14 +4914,14 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5892
4914
|
});
|
|
5893
4915
|
},
|
|
5894
4916
|
/**
|
|
5895
|
-
* Returns a list of all
|
|
5896
|
-
* @summary Get
|
|
4917
|
+
* Returns a list of all defined Brokerage objects.
|
|
4918
|
+
* @summary Get brokerages
|
|
5897
4919
|
* @param {*} [options] Override http request option.
|
|
5898
4920
|
* @throws {RequiredError}
|
|
5899
4921
|
*/
|
|
5900
|
-
async
|
|
4922
|
+
async listAllBrokerages(...args) {
|
|
5901
4923
|
const [options] = args;
|
|
5902
|
-
return createRequestFunction(await localVarAxiosParamCreator.
|
|
4924
|
+
return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerages(options), axios.default, BASE_PATH, configuration, {
|
|
5903
4925
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
5904
4926
|
requestSigningByAuthMode: {
|
|
5905
4927
|
"commercialApiKey": {
|
|
@@ -5942,19 +4964,9 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5942
4964
|
* ReferenceDataApi - factory interface
|
|
5943
4965
|
* @export
|
|
5944
4966
|
*/
|
|
5945
|
-
const ReferenceDataApiFactory = function(configuration, basePath, axios$
|
|
4967
|
+
const ReferenceDataApiFactory = function(configuration, basePath, axios$2) {
|
|
5946
4968
|
const localVarFp = ReferenceDataApiFp(configuration);
|
|
5947
4969
|
return {
|
|
5948
|
-
/**
|
|
5949
|
-
* Returns an Exchange Rate Pair object for the specified Currency Pair.
|
|
5950
|
-
* @summary Get exchange rate of a currency pair
|
|
5951
|
-
* @param {ReferenceDataApiGetCurrencyExchangeRatePairRequest<TAuth>} requestParameters Request parameters.
|
|
5952
|
-
* @param {*} [options] Override http request option.
|
|
5953
|
-
* @throws {RequiredError}
|
|
5954
|
-
*/
|
|
5955
|
-
getCurrencyExchangeRatePair(requestParameters, options) {
|
|
5956
|
-
return localVarFp.getCurrencyExchangeRatePair(requestParameters, options).then((request) => request(axios$3, basePath));
|
|
5957
|
-
},
|
|
5958
4970
|
/**
|
|
5959
4971
|
* Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
|
|
5960
4972
|
* @summary Get Client Info
|
|
@@ -5962,16 +4974,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
|
5962
4974
|
* @throws {RequiredError}
|
|
5963
4975
|
*/
|
|
5964
4976
|
getPartnerInfo(...args) {
|
|
5965
|
-
return localVarFp.getPartnerInfo(...args).then((request) => request(axios$
|
|
5966
|
-
},
|
|
5967
|
-
/**
|
|
5968
|
-
* Return all available security types supported by SnapTrade.
|
|
5969
|
-
* @summary List security types
|
|
5970
|
-
* @param {*} [options] Override http request option.
|
|
5971
|
-
* @throws {RequiredError}
|
|
5972
|
-
*/
|
|
5973
|
-
getSecurityTypes(...args) {
|
|
5974
|
-
return localVarFp.getSecurityTypes(...args).then((request) => request(axios$3, basePath));
|
|
4977
|
+
return localVarFp.getPartnerInfo(...args).then((request) => request(axios$2, basePath));
|
|
5975
4978
|
},
|
|
5976
4979
|
/**
|
|
5977
4980
|
* Returns a list of all supported Exchanges.
|
|
@@ -5980,7 +4983,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
|
5980
4983
|
* @throws {RequiredError}
|
|
5981
4984
|
*/
|
|
5982
4985
|
getStockExchanges(...args) {
|
|
5983
|
-
return localVarFp.getStockExchanges(...args).then((request) => request(axios$
|
|
4986
|
+
return localVarFp.getStockExchanges(...args).then((request) => request(axios$2, basePath));
|
|
5984
4987
|
},
|
|
5985
4988
|
/**
|
|
5986
4989
|
* 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.
|
|
@@ -5990,7 +4993,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
|
5990
4993
|
* @throws {RequiredError}
|
|
5991
4994
|
*/
|
|
5992
4995
|
getSymbols(requestParameters = {}, options) {
|
|
5993
|
-
return localVarFp.getSymbols(requestParameters, options).then((request) => request(axios$
|
|
4996
|
+
return localVarFp.getSymbols(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
5994
4997
|
},
|
|
5995
4998
|
/**
|
|
5996
4999
|
* Returns the Universal Symbol object specified by the ticker or the Universal Symbol ID. When a ticker is specified, the first matching result is returned. We largely follow the [Yahoo Finance ticker format](https://help.yahoo.com/kb/SLN2310.html)(click on \"Yahoo Finance Market Coverage and Data Delays\"). For example, for securities traded on the Toronto Stock Exchange, the symbol has a \'.TO\' suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix. Please use the ticker with the proper suffix for the best results.
|
|
@@ -6000,7 +5003,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
|
6000
5003
|
* @throws {RequiredError}
|
|
6001
5004
|
*/
|
|
6002
5005
|
getSymbolsByTicker(requestParameters, options) {
|
|
6003
|
-
return localVarFp.getSymbolsByTicker(requestParameters, options).then((request) => request(axios$
|
|
5006
|
+
return localVarFp.getSymbolsByTicker(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6004
5007
|
},
|
|
6005
5008
|
/**
|
|
6006
5009
|
* Returns a list of all defined Brokerage authorization Type objects.
|
|
@@ -6010,7 +5013,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
|
6010
5013
|
* @throws {RequiredError}
|
|
6011
5014
|
*/
|
|
6012
5015
|
listAllBrokerageAuthorizationType(requestParameters = {}, options) {
|
|
6013
|
-
return localVarFp.listAllBrokerageAuthorizationType(requestParameters, options).then((request) => request(axios$
|
|
5016
|
+
return localVarFp.listAllBrokerageAuthorizationType(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6014
5017
|
},
|
|
6015
5018
|
/**
|
|
6016
5019
|
* 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.
|
|
@@ -6020,7 +5023,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
|
6020
5023
|
* @throws {RequiredError}
|
|
6021
5024
|
*/
|
|
6022
5025
|
listAllBrokerageInstruments(requestParameters, options) {
|
|
6023
|
-
return localVarFp.listAllBrokerageInstruments(requestParameters, options).then((request) => request(axios$
|
|
5026
|
+
return localVarFp.listAllBrokerageInstruments(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6024
5027
|
},
|
|
6025
5028
|
/**
|
|
6026
5029
|
* Returns a list of all defined Brokerage objects.
|
|
@@ -6029,25 +5032,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
|
6029
5032
|
* @throws {RequiredError}
|
|
6030
5033
|
*/
|
|
6031
5034
|
listAllBrokerages(...args) {
|
|
6032
|
-
return localVarFp.listAllBrokerages(...args).then((request) => request(axios$
|
|
6033
|
-
},
|
|
6034
|
-
/**
|
|
6035
|
-
* Returns a list of all defined Currency objects.
|
|
6036
|
-
* @summary Get currencies
|
|
6037
|
-
* @param {*} [options] Override http request option.
|
|
6038
|
-
* @throws {RequiredError}
|
|
6039
|
-
*/
|
|
6040
|
-
listAllCurrencies(...args) {
|
|
6041
|
-
return localVarFp.listAllCurrencies(...args).then((request) => request(axios$3, basePath));
|
|
6042
|
-
},
|
|
6043
|
-
/**
|
|
6044
|
-
* Returns a list of all Exchange Rate Pairs for all supported Currencies.
|
|
6045
|
-
* @summary Get currency exchange rates
|
|
6046
|
-
* @param {*} [options] Override http request option.
|
|
6047
|
-
* @throws {RequiredError}
|
|
6048
|
-
*/
|
|
6049
|
-
listAllCurrenciesRates(...args) {
|
|
6050
|
-
return localVarFp.listAllCurrenciesRates(...args).then((request) => request(axios$3, basePath));
|
|
5035
|
+
return localVarFp.listAllBrokerages(...args).then((request) => request(axios$2, basePath));
|
|
6051
5036
|
},
|
|
6052
5037
|
/**
|
|
6053
5038
|
* 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.
|
|
@@ -6057,7 +5042,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
|
6057
5042
|
* @throws {RequiredError}
|
|
6058
5043
|
*/
|
|
6059
5044
|
symbolSearchUserAccount(requestParameters, options) {
|
|
6060
|
-
return localVarFp.symbolSearchUserAccount(requestParameters, options).then((request) => request(axios$
|
|
5045
|
+
return localVarFp.symbolSearchUserAccount(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6061
5046
|
}
|
|
6062
5047
|
};
|
|
6063
5048
|
};
|
|
@@ -6068,17 +5053,6 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
|
6068
5053
|
* @extends {BaseAPI}
|
|
6069
5054
|
*/
|
|
6070
5055
|
var ReferenceDataApiGenerated = class extends BaseAPI {
|
|
6071
|
-
/**
|
|
6072
|
-
* Returns an Exchange Rate Pair object for the specified Currency Pair.
|
|
6073
|
-
* @summary Get exchange rate of a currency pair
|
|
6074
|
-
* @param {ReferenceDataApiGetCurrencyExchangeRatePairRequest<TAuth>} requestParameters Request parameters.
|
|
6075
|
-
* @param {*} [options] Override http request option.
|
|
6076
|
-
* @throws {RequiredError}
|
|
6077
|
-
* @memberof ReferenceDataApiGenerated
|
|
6078
|
-
*/
|
|
6079
|
-
getCurrencyExchangeRatePair(requestParameters, options) {
|
|
6080
|
-
return ReferenceDataApiFp(this.configuration).getCurrencyExchangeRatePair(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
6081
|
-
}
|
|
6082
5056
|
/**
|
|
6083
5057
|
* Returns configurations for your SnapTrade Client ID, including allowed brokerages and data access.
|
|
6084
5058
|
* @summary Get Client Info
|
|
@@ -6090,16 +5064,6 @@ var ReferenceDataApiGenerated = class extends BaseAPI {
|
|
|
6090
5064
|
return ReferenceDataApiFp(this.configuration).getPartnerInfo(...args).then((request) => request(this.axios, this.basePath));
|
|
6091
5065
|
}
|
|
6092
5066
|
/**
|
|
6093
|
-
* Return all available security types supported by SnapTrade.
|
|
6094
|
-
* @summary List security types
|
|
6095
|
-
* @param {*} [options] Override http request option.
|
|
6096
|
-
* @throws {RequiredError}
|
|
6097
|
-
* @memberof ReferenceDataApiGenerated
|
|
6098
|
-
*/
|
|
6099
|
-
getSecurityTypes(...args) {
|
|
6100
|
-
return ReferenceDataApiFp(this.configuration).getSecurityTypes(...args).then((request) => request(this.axios, this.basePath));
|
|
6101
|
-
}
|
|
6102
|
-
/**
|
|
6103
5067
|
* Returns a list of all supported Exchanges.
|
|
6104
5068
|
* @summary Get exchanges
|
|
6105
5069
|
* @param {*} [options] Override http request option.
|
|
@@ -6164,26 +5128,6 @@ var ReferenceDataApiGenerated = class extends BaseAPI {
|
|
|
6164
5128
|
return ReferenceDataApiFp(this.configuration).listAllBrokerages(...args).then((request) => request(this.axios, this.basePath));
|
|
6165
5129
|
}
|
|
6166
5130
|
/**
|
|
6167
|
-
* Returns a list of all defined Currency objects.
|
|
6168
|
-
* @summary Get currencies
|
|
6169
|
-
* @param {*} [options] Override http request option.
|
|
6170
|
-
* @throws {RequiredError}
|
|
6171
|
-
* @memberof ReferenceDataApiGenerated
|
|
6172
|
-
*/
|
|
6173
|
-
listAllCurrencies(...args) {
|
|
6174
|
-
return ReferenceDataApiFp(this.configuration).listAllCurrencies(...args).then((request) => request(this.axios, this.basePath));
|
|
6175
|
-
}
|
|
6176
|
-
/**
|
|
6177
|
-
* Returns a list of all Exchange Rate Pairs for all supported Currencies.
|
|
6178
|
-
* @summary Get currency exchange rates
|
|
6179
|
-
* @param {*} [options] Override http request option.
|
|
6180
|
-
* @throws {RequiredError}
|
|
6181
|
-
* @memberof ReferenceDataApiGenerated
|
|
6182
|
-
*/
|
|
6183
|
-
listAllCurrenciesRates(...args) {
|
|
6184
|
-
return ReferenceDataApiFp(this.configuration).listAllCurrenciesRates(...args).then((request) => request(this.axios, this.basePath));
|
|
6185
|
-
}
|
|
6186
|
-
/**
|
|
6187
5131
|
* 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.
|
|
6188
5132
|
* @summary Search account symbols
|
|
6189
5133
|
* @param {ReferenceDataApiSymbolSearchUserAccountRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -6285,85 +5229,6 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
6285
5229
|
};
|
|
6286
5230
|
},
|
|
6287
5231
|
/**
|
|
6288
|
-
* **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.
|
|
6289
|
-
* @summary Cancel equity order
|
|
6290
|
-
* @param {string} accountId
|
|
6291
|
-
* @param {AccountInformationGetUserAccountOrderDetailRequest} accountInformationGetUserAccountOrderDetailRequest
|
|
6292
|
-
* @param {string} [userId]
|
|
6293
|
-
* @param {string} [userSecret]
|
|
6294
|
-
* @param {*} [options] Override http request option.
|
|
6295
|
-
* @deprecated
|
|
6296
|
-
* @throws {RequiredError}
|
|
6297
|
-
*/
|
|
6298
|
-
cancelUserAccountOrder: async (accountId, accountInformationGetUserAccountOrderDetailRequest, userId, userSecret, options = {}) => {
|
|
6299
|
-
assertParamExists("cancelUserAccountOrder", "accountId", accountId);
|
|
6300
|
-
assertParamExists("cancelUserAccountOrder", "accountInformationGetUserAccountOrderDetailRequest", accountInformationGetUserAccountOrderDetailRequest);
|
|
6301
|
-
const localVarPath = `/accounts/{accountId}/orders/cancel`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
|
|
6302
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
6303
|
-
let baseOptions;
|
|
6304
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
6305
|
-
const localVarRequestOptions = {
|
|
6306
|
-
method: "POST",
|
|
6307
|
-
...baseOptions,
|
|
6308
|
-
...options
|
|
6309
|
-
};
|
|
6310
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
6311
|
-
const localVarQueryParameter = {};
|
|
6312
|
-
if (configuration?.authMode === "commercialApiKey") {
|
|
6313
|
-
await setApiKeyToObject({
|
|
6314
|
-
object: localVarQueryParameter,
|
|
6315
|
-
key: "clientId",
|
|
6316
|
-
keyParamName: "clientId",
|
|
6317
|
-
configuration
|
|
6318
|
-
});
|
|
6319
|
-
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
6320
|
-
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
6321
|
-
}
|
|
6322
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
6323
|
-
object: localVarQueryParameter,
|
|
6324
|
-
key: "clientId",
|
|
6325
|
-
keyParamName: "clientId",
|
|
6326
|
-
configuration
|
|
6327
|
-
});
|
|
6328
|
-
const localVarOperationAuth = {
|
|
6329
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
6330
|
-
requestSigningByAuthMode: {
|
|
6331
|
-
"commercialApiKey": {
|
|
6332
|
-
secretParameter: "consumerKey",
|
|
6333
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
6334
|
-
},
|
|
6335
|
-
"personalApiKey": {
|
|
6336
|
-
secretParameter: "consumerKey",
|
|
6337
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
6338
|
-
}
|
|
6339
|
-
},
|
|
6340
|
-
selectedAuthMode: configuration?.authMode
|
|
6341
|
-
};
|
|
6342
|
-
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
6343
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
6344
|
-
localVarRequestOptions.headers = {
|
|
6345
|
-
...localVarHeaderParameter,
|
|
6346
|
-
...headersFromBaseOptions,
|
|
6347
|
-
...options.headers
|
|
6348
|
-
};
|
|
6349
|
-
requestBeforeHook({
|
|
6350
|
-
requestBody: accountInformationGetUserAccountOrderDetailRequest,
|
|
6351
|
-
queryParameters: localVarQueryParameter,
|
|
6352
|
-
requestConfig: localVarRequestOptions,
|
|
6353
|
-
path: localVarPath,
|
|
6354
|
-
configuration,
|
|
6355
|
-
pathTemplate: "/accounts/{accountId}/orders/cancel",
|
|
6356
|
-
httpMethod: "POST",
|
|
6357
|
-
operationAuth: localVarOperationAuth
|
|
6358
|
-
});
|
|
6359
|
-
localVarRequestOptions.data = serializeDataIfNeeded(accountInformationGetUserAccountOrderDetailRequest, localVarRequestOptions, configuration);
|
|
6360
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
6361
|
-
return {
|
|
6362
|
-
url: toPathString(localVarUrlObj),
|
|
6363
|
-
options: localVarRequestOptions
|
|
6364
|
-
};
|
|
6365
|
-
},
|
|
6366
|
-
/**
|
|
6367
5232
|
* Gets a quote for the specified account.
|
|
6368
5233
|
* @summary Get crypto pair quote
|
|
6369
5234
|
* @param {string} accountId
|
|
@@ -6747,85 +5612,6 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
6747
5612
|
};
|
|
6748
5613
|
},
|
|
6749
5614
|
/**
|
|
6750
|
-
* **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
|
|
6751
|
-
* @summary Place bracket order
|
|
6752
|
-
* @param {string} accountId The ID of the account to execute the trade on.
|
|
6753
|
-
* @param {ManualTradeFormBracket} manualTradeFormBracket
|
|
6754
|
-
* @param {string} [userId]
|
|
6755
|
-
* @param {string} [userSecret]
|
|
6756
|
-
* @param {*} [options] Override http request option.
|
|
6757
|
-
* @deprecated
|
|
6758
|
-
* @throws {RequiredError}
|
|
6759
|
-
*/
|
|
6760
|
-
placeBracketOrder: async (accountId, manualTradeFormBracket, userId, userSecret, options = {}) => {
|
|
6761
|
-
assertParamExists("placeBracketOrder", "accountId", accountId);
|
|
6762
|
-
assertParamExists("placeBracketOrder", "manualTradeFormBracket", manualTradeFormBracket);
|
|
6763
|
-
const localVarPath = `/accounts/{accountId}/trading/bracket`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
|
|
6764
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
6765
|
-
let baseOptions;
|
|
6766
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
6767
|
-
const localVarRequestOptions = {
|
|
6768
|
-
method: "POST",
|
|
6769
|
-
...baseOptions,
|
|
6770
|
-
...options
|
|
6771
|
-
};
|
|
6772
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
6773
|
-
const localVarQueryParameter = {};
|
|
6774
|
-
if (configuration?.authMode === "commercialApiKey") {
|
|
6775
|
-
await setApiKeyToObject({
|
|
6776
|
-
object: localVarQueryParameter,
|
|
6777
|
-
key: "clientId",
|
|
6778
|
-
keyParamName: "clientId",
|
|
6779
|
-
configuration
|
|
6780
|
-
});
|
|
6781
|
-
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
6782
|
-
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
6783
|
-
}
|
|
6784
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
6785
|
-
object: localVarQueryParameter,
|
|
6786
|
-
key: "clientId",
|
|
6787
|
-
keyParamName: "clientId",
|
|
6788
|
-
configuration
|
|
6789
|
-
});
|
|
6790
|
-
const localVarOperationAuth = {
|
|
6791
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
6792
|
-
requestSigningByAuthMode: {
|
|
6793
|
-
"commercialApiKey": {
|
|
6794
|
-
secretParameter: "consumerKey",
|
|
6795
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
6796
|
-
},
|
|
6797
|
-
"personalApiKey": {
|
|
6798
|
-
secretParameter: "consumerKey",
|
|
6799
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
6800
|
-
}
|
|
6801
|
-
},
|
|
6802
|
-
selectedAuthMode: configuration?.authMode
|
|
6803
|
-
};
|
|
6804
|
-
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
6805
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
6806
|
-
localVarRequestOptions.headers = {
|
|
6807
|
-
...localVarHeaderParameter,
|
|
6808
|
-
...headersFromBaseOptions,
|
|
6809
|
-
...options.headers
|
|
6810
|
-
};
|
|
6811
|
-
requestBeforeHook({
|
|
6812
|
-
requestBody: manualTradeFormBracket,
|
|
6813
|
-
queryParameters: localVarQueryParameter,
|
|
6814
|
-
requestConfig: localVarRequestOptions,
|
|
6815
|
-
path: localVarPath,
|
|
6816
|
-
configuration,
|
|
6817
|
-
pathTemplate: "/accounts/{accountId}/trading/bracket",
|
|
6818
|
-
httpMethod: "POST",
|
|
6819
|
-
operationAuth: localVarOperationAuth
|
|
6820
|
-
});
|
|
6821
|
-
localVarRequestOptions.data = serializeDataIfNeeded(manualTradeFormBracket, localVarRequestOptions, configuration);
|
|
6822
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
6823
|
-
return {
|
|
6824
|
-
url: toPathString(localVarUrlObj),
|
|
6825
|
-
options: localVarRequestOptions
|
|
6826
|
-
};
|
|
6827
|
-
},
|
|
6828
|
-
/**
|
|
6829
5615
|
* 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.
|
|
6830
5616
|
* @summary Place complex order
|
|
6831
5617
|
* @param {string} accountId The ID of the account to execute the trade on.
|
|
@@ -7478,30 +6264,6 @@ const TradingApiFp = function(configuration) {
|
|
|
7478
6264
|
});
|
|
7479
6265
|
},
|
|
7480
6266
|
/**
|
|
7481
|
-
* **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.
|
|
7482
|
-
* @summary Cancel equity order
|
|
7483
|
-
* @param {TradingApiCancelUserAccountOrderRequest<TAuth>} requestParameters Request parameters.
|
|
7484
|
-
* @param {*} [options] Override http request option.
|
|
7485
|
-
* @deprecated
|
|
7486
|
-
* @throws {RequiredError}
|
|
7487
|
-
*/
|
|
7488
|
-
async cancelUserAccountOrder(requestParameters, options) {
|
|
7489
|
-
const accountInformationGetUserAccountOrderDetailRequest = { brokerage_order_id: requestParameters.brokerage_order_id };
|
|
7490
|
-
return createRequestFunction(await localVarAxiosParamCreator.cancelUserAccountOrder(requestParameters.accountId, accountInformationGetUserAccountOrderDetailRequest, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
7491
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
7492
|
-
requestSigningByAuthMode: {
|
|
7493
|
-
"commercialApiKey": {
|
|
7494
|
-
secretParameter: "consumerKey",
|
|
7495
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
7496
|
-
},
|
|
7497
|
-
"personalApiKey": {
|
|
7498
|
-
secretParameter: "consumerKey",
|
|
7499
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
7500
|
-
}
|
|
7501
|
-
}
|
|
7502
|
-
});
|
|
7503
|
-
},
|
|
7504
|
-
/**
|
|
7505
6267
|
* Gets a quote for the specified account.
|
|
7506
6268
|
* @summary Get crypto pair quote
|
|
7507
6269
|
* @param {TradingApiGetCryptocurrencyPairQuoteRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -7613,44 +6375,10 @@ const TradingApiFp = function(configuration) {
|
|
|
7613
6375
|
* @summary Get equity symbol quotes
|
|
7614
6376
|
* @param {TradingApiGetUserAccountQuotesRequest<TAuth>} requestParameters Request parameters.
|
|
7615
6377
|
* @param {*} [options] Override http request option.
|
|
7616
|
-
* @throws {RequiredError}
|
|
7617
|
-
*/
|
|
7618
|
-
async getUserAccountQuotes(requestParameters, options) {
|
|
7619
|
-
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountQuotes(requestParameters.symbols, requestParameters.accountId, requestParameters.useTicker, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
7620
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
7621
|
-
requestSigningByAuthMode: {
|
|
7622
|
-
"commercialApiKey": {
|
|
7623
|
-
secretParameter: "consumerKey",
|
|
7624
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
7625
|
-
},
|
|
7626
|
-
"personalApiKey": {
|
|
7627
|
-
secretParameter: "consumerKey",
|
|
7628
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
7629
|
-
}
|
|
7630
|
-
}
|
|
7631
|
-
});
|
|
7632
|
-
},
|
|
7633
|
-
/**
|
|
7634
|
-
* **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
|
|
7635
|
-
* @summary Place bracket order
|
|
7636
|
-
* @param {TradingApiPlaceBracketOrderRequest<TAuth>} requestParameters Request parameters.
|
|
7637
|
-
* @param {*} [options] Override http request option.
|
|
7638
|
-
* @deprecated
|
|
7639
|
-
* @throws {RequiredError}
|
|
7640
|
-
*/
|
|
7641
|
-
async placeBracketOrder(requestParameters, options) {
|
|
7642
|
-
const manualTradeFormBracket = {
|
|
7643
|
-
action: requestParameters.action,
|
|
7644
|
-
instrument: requestParameters.instrument,
|
|
7645
|
-
order_type: requestParameters.order_type,
|
|
7646
|
-
time_in_force: requestParameters.time_in_force,
|
|
7647
|
-
price: requestParameters.price,
|
|
7648
|
-
stop: requestParameters.stop,
|
|
7649
|
-
units: requestParameters.units,
|
|
7650
|
-
stop_loss: requestParameters.stop_loss,
|
|
7651
|
-
take_profit: requestParameters.take_profit
|
|
7652
|
-
};
|
|
7653
|
-
return createRequestFunction(await localVarAxiosParamCreator.placeBracketOrder(requestParameters.accountId, manualTradeFormBracket, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
6378
|
+
* @throws {RequiredError}
|
|
6379
|
+
*/
|
|
6380
|
+
async getUserAccountQuotes(requestParameters, options) {
|
|
6381
|
+
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountQuotes(requestParameters.symbols, requestParameters.accountId, requestParameters.useTicker, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
7654
6382
|
authModes: ["commercialApiKey", "personalApiKey"],
|
|
7655
6383
|
requestSigningByAuthMode: {
|
|
7656
6384
|
"commercialApiKey": {
|
|
@@ -7907,7 +6635,7 @@ const TradingApiFp = function(configuration) {
|
|
|
7907
6635
|
* TradingApi - factory interface
|
|
7908
6636
|
* @export
|
|
7909
6637
|
*/
|
|
7910
|
-
const TradingApiFactory = function(configuration, basePath, axios$
|
|
6638
|
+
const TradingApiFactory = function(configuration, basePath, axios$1) {
|
|
7911
6639
|
const localVarFp = TradingApiFp(configuration);
|
|
7912
6640
|
return {
|
|
7913
6641
|
/**
|
|
@@ -7918,18 +6646,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7918
6646
|
* @throws {RequiredError}
|
|
7919
6647
|
*/
|
|
7920
6648
|
cancelOrder(requestParameters, options) {
|
|
7921
|
-
return localVarFp.cancelOrder(requestParameters, options).then((request) => request(axios$
|
|
7922
|
-
},
|
|
7923
|
-
/**
|
|
7924
|
-
* **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.
|
|
7925
|
-
* @summary Cancel equity order
|
|
7926
|
-
* @param {TradingApiCancelUserAccountOrderRequest<TAuth>} requestParameters Request parameters.
|
|
7927
|
-
* @param {*} [options] Override http request option.
|
|
7928
|
-
* @deprecated
|
|
7929
|
-
* @throws {RequiredError}
|
|
7930
|
-
*/
|
|
7931
|
-
cancelUserAccountOrder(requestParameters, options) {
|
|
7932
|
-
return localVarFp.cancelUserAccountOrder(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6649
|
+
return localVarFp.cancelOrder(requestParameters, options).then((request) => request(axios$1, basePath));
|
|
7933
6650
|
},
|
|
7934
6651
|
/**
|
|
7935
6652
|
* Gets a quote for the specified account.
|
|
@@ -7939,7 +6656,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7939
6656
|
* @throws {RequiredError}
|
|
7940
6657
|
*/
|
|
7941
6658
|
getCryptocurrencyPairQuote(requestParameters, options) {
|
|
7942
|
-
return localVarFp.getCryptocurrencyPairQuote(requestParameters, options).then((request) => request(axios$
|
|
6659
|
+
return localVarFp.getCryptocurrencyPairQuote(requestParameters, options).then((request) => request(axios$1, basePath));
|
|
7943
6660
|
},
|
|
7944
6661
|
/**
|
|
7945
6662
|
* Simulates an option order with up to 4 legs and returns the estimated cost and transaction fees without placing it. Only supported for certain enabled brokerages. Please refer to the [brokerage trading support page](https://support.snaptrade.com/brokerages) for more information on which brokerages support this endpoint.
|
|
@@ -7949,7 +6666,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7949
6666
|
* @throws {RequiredError}
|
|
7950
6667
|
*/
|
|
7951
6668
|
getOptionImpact(requestParameters, options) {
|
|
7952
|
-
return localVarFp.getOptionImpact(requestParameters, options).then((request) => request(axios$
|
|
6669
|
+
return localVarFp.getOptionImpact(requestParameters, options).then((request) => request(axios$1, basePath));
|
|
7953
6670
|
},
|
|
7954
6671
|
/**
|
|
7955
6672
|
* Simulates an order and its impact on the account. This endpoint does not place the order with the brokerage. If successful, it returns a `Trade` object and the ID of the object can be used to place the order with the brokerage using the [place checked order endpoint](/reference/Trading/Trading_placeOrder). Please note that the `Trade` object returned expires after 5 minutes. Any order placed using an expired `Trade` will be rejected.
|
|
@@ -7959,7 +6676,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7959
6676
|
* @throws {RequiredError}
|
|
7960
6677
|
*/
|
|
7961
6678
|
getOrderImpact(requestParameters, options) {
|
|
7962
|
-
return localVarFp.getOrderImpact(requestParameters, options).then((request) => request(axios$
|
|
6679
|
+
return localVarFp.getOrderImpact(requestParameters, options).then((request) => request(axios$1, basePath));
|
|
7963
6680
|
},
|
|
7964
6681
|
/**
|
|
7965
6682
|
* Returns a quote for a single option contract. The option contract is specified using in the 21 character OCC format. For example `AAPL 251114C00240000` represents a call option on AAPL expiring on 2025-11-14 with a strike price of $240. For more information on the OCC format, see [here](https://en.wikipedia.org/wiki/Option_symbol#OCC_format) **Note:** These are derived values and are not suitable for trading purposes.
|
|
@@ -7969,7 +6686,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7969
6686
|
* @throws {RequiredError}
|
|
7970
6687
|
*/
|
|
7971
6688
|
getUserAccountOptionQuotes(requestParameters, options) {
|
|
7972
|
-
return localVarFp.getUserAccountOptionQuotes(requestParameters, options).then((request) => request(axios$
|
|
6689
|
+
return localVarFp.getUserAccountOptionQuotes(requestParameters, options).then((request) => request(axios$1, basePath));
|
|
7973
6690
|
},
|
|
7974
6691
|
/**
|
|
7975
6692
|
* Returns a maximum of 10 quotes from the brokerage for the specified symbols and account. The quotes returned can be delayed depending on the brokerage the account belongs to. It is highly recommended that you use your own market data provider for real-time quotes instead of relying on this endpoint. **This endpoint is not a substitute for a market data provider. Frequent polling of this endpoint may result in the disabling of your keys** This endpoint does not work for options quotes.
|
|
@@ -7979,18 +6696,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7979
6696
|
* @throws {RequiredError}
|
|
7980
6697
|
*/
|
|
7981
6698
|
getUserAccountQuotes(requestParameters, options) {
|
|
7982
|
-
return localVarFp.getUserAccountQuotes(requestParameters, options).then((request) => request(axios$
|
|
7983
|
-
},
|
|
7984
|
-
/**
|
|
7985
|
-
* **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
|
|
7986
|
-
* @summary Place bracket order
|
|
7987
|
-
* @param {TradingApiPlaceBracketOrderRequest<TAuth>} requestParameters Request parameters.
|
|
7988
|
-
* @param {*} [options] Override http request option.
|
|
7989
|
-
* @deprecated
|
|
7990
|
-
* @throws {RequiredError}
|
|
7991
|
-
*/
|
|
7992
|
-
placeBracketOrder(requestParameters, options) {
|
|
7993
|
-
return localVarFp.placeBracketOrder(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6699
|
+
return localVarFp.getUserAccountQuotes(requestParameters, options).then((request) => request(axios$1, basePath));
|
|
7994
6700
|
},
|
|
7995
6701
|
/**
|
|
7996
6702
|
* 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.
|
|
@@ -8000,7 +6706,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
8000
6706
|
* @throws {RequiredError}
|
|
8001
6707
|
*/
|
|
8002
6708
|
placeComplexOrder(requestParameters, options) {
|
|
8003
|
-
return localVarFp.placeComplexOrder(requestParameters, options).then((request) => request(axios$
|
|
6709
|
+
return localVarFp.placeComplexOrder(requestParameters, options).then((request) => request(axios$1, basePath));
|
|
8004
6710
|
},
|
|
8005
6711
|
/**
|
|
8006
6712
|
* Places an order in the specified account. This endpoint does not compute the impact to the account balance from the order before submitting the order.
|
|
@@ -8010,7 +6716,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
8010
6716
|
* @throws {RequiredError}
|
|
8011
6717
|
*/
|
|
8012
6718
|
placeCryptoOrder(requestParameters, options) {
|
|
8013
|
-
return localVarFp.placeCryptoOrder(requestParameters, options).then((request) => request(axios$
|
|
6719
|
+
return localVarFp.placeCryptoOrder(requestParameters, options).then((request) => request(axios$1, basePath));
|
|
8014
6720
|
},
|
|
8015
6721
|
/**
|
|
8016
6722
|
* Places a brokerage order in the specified account. The order could be rejected by the brokerage if it is invalid or if the account does not have sufficient funds. This endpoint does not compute the impact to the account balance from the order and any potential commissions before submitting the order to the brokerage. If that is desired, you can use the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
|
|
@@ -8020,7 +6726,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
8020
6726
|
* @throws {RequiredError}
|
|
8021
6727
|
*/
|
|
8022
6728
|
placeForceOrder(requestParameters, options) {
|
|
8023
|
-
return localVarFp.placeForceOrder(requestParameters, options).then((request) => request(axios$
|
|
6729
|
+
return localVarFp.placeForceOrder(requestParameters, options).then((request) => request(axios$1, basePath));
|
|
8024
6730
|
},
|
|
8025
6731
|
/**
|
|
8026
6732
|
* Places a multi-leg option order. Only supported on certain option trading brokerages. https://support.snaptrade.com/brokerages has information on brokerage trading support
|
|
@@ -8030,7 +6736,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
8030
6736
|
* @throws {RequiredError}
|
|
8031
6737
|
*/
|
|
8032
6738
|
placeMlegOrder(requestParameters, options) {
|
|
8033
|
-
return localVarFp.placeMlegOrder(requestParameters, options).then((request) => request(axios$
|
|
6739
|
+
return localVarFp.placeMlegOrder(requestParameters, options).then((request) => request(axios$1, basePath));
|
|
8034
6740
|
},
|
|
8035
6741
|
/**
|
|
8036
6742
|
* Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
|
|
@@ -8040,7 +6746,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
8040
6746
|
* @throws {RequiredError}
|
|
8041
6747
|
*/
|
|
8042
6748
|
placeOrder(requestParameters, options) {
|
|
8043
|
-
return localVarFp.placeOrder(requestParameters, options).then((request) => request(axios$
|
|
6749
|
+
return localVarFp.placeOrder(requestParameters, options).then((request) => request(axios$1, basePath));
|
|
8044
6750
|
},
|
|
8045
6751
|
/**
|
|
8046
6752
|
* Previews an order using the specified account.
|
|
@@ -8050,7 +6756,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
8050
6756
|
* @throws {RequiredError}
|
|
8051
6757
|
*/
|
|
8052
6758
|
previewCryptoOrder(requestParameters, options) {
|
|
8053
|
-
return localVarFp.previewCryptoOrder(requestParameters, options).then((request) => request(axios$
|
|
6759
|
+
return localVarFp.previewCryptoOrder(requestParameters, options).then((request) => request(axios$1, basePath));
|
|
8054
6760
|
},
|
|
8055
6761
|
/**
|
|
8056
6762
|
* Replaces an existing pending order with a new one. The way this works is brokerage dependent, but usually involves cancelling the existing order and placing a new one. The order\'s brokerage_order_id may or may not change, be sure to use the one returned in the response going forward. Only supported on some brokerages
|
|
@@ -8060,7 +6766,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
8060
6766
|
* @throws {RequiredError}
|
|
8061
6767
|
*/
|
|
8062
6768
|
replaceOrder(requestParameters, options) {
|
|
8063
|
-
return localVarFp.replaceOrder(requestParameters, options).then((request) => request(axios$
|
|
6769
|
+
return localVarFp.replaceOrder(requestParameters, options).then((request) => request(axios$1, basePath));
|
|
8064
6770
|
},
|
|
8065
6771
|
/**
|
|
8066
6772
|
* Searches cryptocurrency pairs instruments accessible to the specified account. Both `base` and `quote` are optional. Omit both for a full list of cryptocurrency pairs.
|
|
@@ -8070,7 +6776,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
8070
6776
|
* @throws {RequiredError}
|
|
8071
6777
|
*/
|
|
8072
6778
|
searchCryptocurrencyPairInstruments(requestParameters, options) {
|
|
8073
|
-
return localVarFp.searchCryptocurrencyPairInstruments(requestParameters, options).then((request) => request(axios$
|
|
6779
|
+
return localVarFp.searchCryptocurrencyPairInstruments(requestParameters, options).then((request) => request(axios$1, basePath));
|
|
8074
6780
|
}
|
|
8075
6781
|
};
|
|
8076
6782
|
};
|
|
@@ -8093,18 +6799,6 @@ var TradingApiGenerated = class extends BaseAPI {
|
|
|
8093
6799
|
return TradingApiFp(this.configuration).cancelOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
8094
6800
|
}
|
|
8095
6801
|
/**
|
|
8096
|
-
* **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.
|
|
8097
|
-
* @summary Cancel equity order
|
|
8098
|
-
* @param {TradingApiCancelUserAccountOrderRequest<TAuth>} requestParameters Request parameters.
|
|
8099
|
-
* @param {*} [options] Override http request option.
|
|
8100
|
-
* @deprecated
|
|
8101
|
-
* @throws {RequiredError}
|
|
8102
|
-
* @memberof TradingApiGenerated
|
|
8103
|
-
*/
|
|
8104
|
-
cancelUserAccountOrder(requestParameters, options) {
|
|
8105
|
-
return TradingApiFp(this.configuration).cancelUserAccountOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
8106
|
-
}
|
|
8107
|
-
/**
|
|
8108
6802
|
* Gets a quote for the specified account.
|
|
8109
6803
|
* @summary Get crypto pair quote
|
|
8110
6804
|
* @param {TradingApiGetCryptocurrencyPairQuoteRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -8160,18 +6854,6 @@ var TradingApiGenerated = class extends BaseAPI {
|
|
|
8160
6854
|
return TradingApiFp(this.configuration).getUserAccountQuotes(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
8161
6855
|
}
|
|
8162
6856
|
/**
|
|
8163
|
-
* **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
|
|
8164
|
-
* @summary Place bracket order
|
|
8165
|
-
* @param {TradingApiPlaceBracketOrderRequest<TAuth>} requestParameters Request parameters.
|
|
8166
|
-
* @param {*} [options] Override http request option.
|
|
8167
|
-
* @deprecated
|
|
8168
|
-
* @throws {RequiredError}
|
|
8169
|
-
* @memberof TradingApiGenerated
|
|
8170
|
-
*/
|
|
8171
|
-
placeBracketOrder(requestParameters, options) {
|
|
8172
|
-
return TradingApiFp(this.configuration).placeBracketOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
8173
|
-
}
|
|
8174
|
-
/**
|
|
8175
6857
|
* 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.
|
|
8176
6858
|
* @summary Place complex order
|
|
8177
6859
|
* @param {TradingApiPlaceComplexOrderRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -8264,303 +6946,6 @@ var TradingApiGenerated = class extends BaseAPI {
|
|
|
8264
6946
|
//#region api/trading-api.ts
|
|
8265
6947
|
var TradingApi = class extends TradingApiGenerated {};
|
|
8266
6948
|
//#endregion
|
|
8267
|
-
//#region api/transactions-and-reporting-api-generated.ts
|
|
8268
|
-
/**
|
|
8269
|
-
* TransactionsAndReportingApi - axios parameter creator
|
|
8270
|
-
* @export
|
|
8271
|
-
*/
|
|
8272
|
-
const TransactionsAndReportingApiAxiosParamCreator = function(configuration) {
|
|
8273
|
-
return {
|
|
8274
|
-
/**
|
|
8275
|
-
* **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.
|
|
8276
|
-
* @summary Get transaction history for a user
|
|
8277
|
-
* @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`.
|
|
8278
|
-
* @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`.
|
|
8279
|
-
* @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.
|
|
8280
|
-
* @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.
|
|
8281
|
-
* @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
|
|
8282
|
-
* @param {string} [userId]
|
|
8283
|
-
* @param {string} [userSecret]
|
|
8284
|
-
* @param {*} [options] Override http request option.
|
|
8285
|
-
* @deprecated
|
|
8286
|
-
* @throws {RequiredError}
|
|
8287
|
-
*/
|
|
8288
|
-
getActivities: async (startDate, endDate, accounts, brokerageAuthorizations, type, userId, userSecret, options = {}) => {
|
|
8289
|
-
const localVarPath = `/activities`;
|
|
8290
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
8291
|
-
let baseOptions;
|
|
8292
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
8293
|
-
const localVarRequestOptions = {
|
|
8294
|
-
method: "GET",
|
|
8295
|
-
...baseOptions,
|
|
8296
|
-
...options
|
|
8297
|
-
};
|
|
8298
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
8299
|
-
const localVarQueryParameter = {};
|
|
8300
|
-
if (configuration?.authMode === "commercialApiKey") {
|
|
8301
|
-
await setApiKeyToObject({
|
|
8302
|
-
object: localVarQueryParameter,
|
|
8303
|
-
key: "clientId",
|
|
8304
|
-
keyParamName: "clientId",
|
|
8305
|
-
configuration
|
|
8306
|
-
});
|
|
8307
|
-
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
8308
|
-
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
8309
|
-
}
|
|
8310
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
8311
|
-
object: localVarQueryParameter,
|
|
8312
|
-
key: "clientId",
|
|
8313
|
-
keyParamName: "clientId",
|
|
8314
|
-
configuration
|
|
8315
|
-
});
|
|
8316
|
-
if (startDate !== void 0) localVarQueryParameter["startDate"] = startDate instanceof Date ? startDate.toISOString().substr(0, 10) : startDate;
|
|
8317
|
-
if (endDate !== void 0) localVarQueryParameter["endDate"] = endDate instanceof Date ? endDate.toISOString().substr(0, 10) : endDate;
|
|
8318
|
-
if (accounts !== void 0) localVarQueryParameter["accounts"] = accounts;
|
|
8319
|
-
if (brokerageAuthorizations !== void 0) localVarQueryParameter["brokerageAuthorizations"] = brokerageAuthorizations;
|
|
8320
|
-
if (type !== void 0) localVarQueryParameter["type"] = type;
|
|
8321
|
-
const localVarOperationAuth = {
|
|
8322
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
8323
|
-
requestSigningByAuthMode: {
|
|
8324
|
-
"commercialApiKey": {
|
|
8325
|
-
secretParameter: "consumerKey",
|
|
8326
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
8327
|
-
},
|
|
8328
|
-
"personalApiKey": {
|
|
8329
|
-
secretParameter: "consumerKey",
|
|
8330
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
8331
|
-
}
|
|
8332
|
-
},
|
|
8333
|
-
selectedAuthMode: configuration?.authMode
|
|
8334
|
-
};
|
|
8335
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
8336
|
-
localVarRequestOptions.headers = {
|
|
8337
|
-
...localVarHeaderParameter,
|
|
8338
|
-
...headersFromBaseOptions,
|
|
8339
|
-
...options.headers
|
|
8340
|
-
};
|
|
8341
|
-
requestBeforeHook({
|
|
8342
|
-
queryParameters: localVarQueryParameter,
|
|
8343
|
-
requestConfig: localVarRequestOptions,
|
|
8344
|
-
path: localVarPath,
|
|
8345
|
-
configuration,
|
|
8346
|
-
pathTemplate: "/activities",
|
|
8347
|
-
httpMethod: "GET",
|
|
8348
|
-
operationAuth: localVarOperationAuth
|
|
8349
|
-
});
|
|
8350
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
8351
|
-
return {
|
|
8352
|
-
url: toPathString(localVarUrlObj),
|
|
8353
|
-
options: localVarRequestOptions
|
|
8354
|
-
};
|
|
8355
|
-
},
|
|
8356
|
-
/**
|
|
8357
|
-
* **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.
|
|
8358
|
-
* @summary Get performance information for a specific timeframe
|
|
8359
|
-
* @param {string | Date} startDate
|
|
8360
|
-
* @param {string | Date} endDate
|
|
8361
|
-
* @param {string} [accounts] Optional comma separated list of account IDs used to filter the request on specific accounts
|
|
8362
|
-
* @param {boolean} [detailed] Optional, increases frequency of data points for the total value and contribution charts if set to true
|
|
8363
|
-
* @param {string} [frequency] Optional frequency for the rate of return chart (defaults to monthly). Possible values are daily, weekly, monthly, quarterly, yearly.
|
|
8364
|
-
* @param {string} [userId]
|
|
8365
|
-
* @param {string} [userSecret]
|
|
8366
|
-
* @param {*} [options] Override http request option.
|
|
8367
|
-
* @deprecated
|
|
8368
|
-
* @throws {RequiredError}
|
|
8369
|
-
*/
|
|
8370
|
-
getReportingCustomRange: async (startDate, endDate, accounts, detailed, frequency, userId, userSecret, options = {}) => {
|
|
8371
|
-
assertParamExists("getReportingCustomRange", "startDate", startDate);
|
|
8372
|
-
assertParamExists("getReportingCustomRange", "endDate", endDate);
|
|
8373
|
-
const localVarPath = `/performance/custom`;
|
|
8374
|
-
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
8375
|
-
let baseOptions;
|
|
8376
|
-
if (configuration) baseOptions = configuration.baseOptions;
|
|
8377
|
-
const localVarRequestOptions = {
|
|
8378
|
-
method: "GET",
|
|
8379
|
-
...baseOptions,
|
|
8380
|
-
...options
|
|
8381
|
-
};
|
|
8382
|
-
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
8383
|
-
const localVarQueryParameter = {};
|
|
8384
|
-
if (configuration?.authMode === "commercialApiKey") {
|
|
8385
|
-
await setApiKeyToObject({
|
|
8386
|
-
object: localVarQueryParameter,
|
|
8387
|
-
key: "clientId",
|
|
8388
|
-
keyParamName: "clientId",
|
|
8389
|
-
configuration
|
|
8390
|
-
});
|
|
8391
|
-
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
8392
|
-
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
8393
|
-
}
|
|
8394
|
-
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
8395
|
-
object: localVarQueryParameter,
|
|
8396
|
-
key: "clientId",
|
|
8397
|
-
keyParamName: "clientId",
|
|
8398
|
-
configuration
|
|
8399
|
-
});
|
|
8400
|
-
if (startDate !== void 0) localVarQueryParameter["startDate"] = startDate instanceof Date ? startDate.toISOString().substr(0, 10) : startDate;
|
|
8401
|
-
if (endDate !== void 0) localVarQueryParameter["endDate"] = endDate instanceof Date ? endDate.toISOString().substr(0, 10) : endDate;
|
|
8402
|
-
if (accounts !== void 0) localVarQueryParameter["accounts"] = accounts;
|
|
8403
|
-
if (detailed !== void 0) localVarQueryParameter["detailed"] = detailed;
|
|
8404
|
-
if (frequency !== void 0) localVarQueryParameter["frequency"] = frequency;
|
|
8405
|
-
const localVarOperationAuth = {
|
|
8406
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
8407
|
-
requestSigningByAuthMode: {
|
|
8408
|
-
"commercialApiKey": {
|
|
8409
|
-
secretParameter: "consumerKey",
|
|
8410
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
8411
|
-
},
|
|
8412
|
-
"personalApiKey": {
|
|
8413
|
-
secretParameter: "consumerKey",
|
|
8414
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
8415
|
-
}
|
|
8416
|
-
},
|
|
8417
|
-
selectedAuthMode: configuration?.authMode
|
|
8418
|
-
};
|
|
8419
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
8420
|
-
localVarRequestOptions.headers = {
|
|
8421
|
-
...localVarHeaderParameter,
|
|
8422
|
-
...headersFromBaseOptions,
|
|
8423
|
-
...options.headers
|
|
8424
|
-
};
|
|
8425
|
-
requestBeforeHook({
|
|
8426
|
-
queryParameters: localVarQueryParameter,
|
|
8427
|
-
requestConfig: localVarRequestOptions,
|
|
8428
|
-
path: localVarPath,
|
|
8429
|
-
configuration,
|
|
8430
|
-
pathTemplate: "/performance/custom",
|
|
8431
|
-
httpMethod: "GET",
|
|
8432
|
-
operationAuth: localVarOperationAuth
|
|
8433
|
-
});
|
|
8434
|
-
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
8435
|
-
return {
|
|
8436
|
-
url: toPathString(localVarUrlObj),
|
|
8437
|
-
options: localVarRequestOptions
|
|
8438
|
-
};
|
|
8439
|
-
}
|
|
8440
|
-
};
|
|
8441
|
-
};
|
|
8442
|
-
/**
|
|
8443
|
-
* TransactionsAndReportingApi - functional programming interface
|
|
8444
|
-
* @export
|
|
8445
|
-
*/
|
|
8446
|
-
const TransactionsAndReportingApiFp = function(configuration) {
|
|
8447
|
-
const localVarAxiosParamCreator = TransactionsAndReportingApiAxiosParamCreator(configuration);
|
|
8448
|
-
return {
|
|
8449
|
-
/**
|
|
8450
|
-
* **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.
|
|
8451
|
-
* @summary Get transaction history for a user
|
|
8452
|
-
* @param {TransactionsAndReportingApiGetActivitiesRequest<TAuth>} requestParameters Request parameters.
|
|
8453
|
-
* @param {*} [options] Override http request option.
|
|
8454
|
-
* @deprecated
|
|
8455
|
-
* @throws {RequiredError}
|
|
8456
|
-
*/
|
|
8457
|
-
async getActivities(requestParameters = {}, options) {
|
|
8458
|
-
return createRequestFunction(await localVarAxiosParamCreator.getActivities(requestParameters.startDate, requestParameters.endDate, requestParameters.accounts, requestParameters.brokerageAuthorizations, requestParameters.type, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
8459
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
8460
|
-
requestSigningByAuthMode: {
|
|
8461
|
-
"commercialApiKey": {
|
|
8462
|
-
secretParameter: "consumerKey",
|
|
8463
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
8464
|
-
},
|
|
8465
|
-
"personalApiKey": {
|
|
8466
|
-
secretParameter: "consumerKey",
|
|
8467
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
8468
|
-
}
|
|
8469
|
-
}
|
|
8470
|
-
});
|
|
8471
|
-
},
|
|
8472
|
-
/**
|
|
8473
|
-
* **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.
|
|
8474
|
-
* @summary Get performance information for a specific timeframe
|
|
8475
|
-
* @param {TransactionsAndReportingApiGetReportingCustomRangeRequest<TAuth>} requestParameters Request parameters.
|
|
8476
|
-
* @param {*} [options] Override http request option.
|
|
8477
|
-
* @deprecated
|
|
8478
|
-
* @throws {RequiredError}
|
|
8479
|
-
*/
|
|
8480
|
-
async getReportingCustomRange(requestParameters, options) {
|
|
8481
|
-
return createRequestFunction(await localVarAxiosParamCreator.getReportingCustomRange(requestParameters.startDate, requestParameters.endDate, requestParameters.accounts, requestParameters.detailed, requestParameters.frequency, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
8482
|
-
authModes: ["commercialApiKey", "personalApiKey"],
|
|
8483
|
-
requestSigningByAuthMode: {
|
|
8484
|
-
"commercialApiKey": {
|
|
8485
|
-
secretParameter: "consumerKey",
|
|
8486
|
-
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
8487
|
-
},
|
|
8488
|
-
"personalApiKey": {
|
|
8489
|
-
secretParameter: "consumerKey",
|
|
8490
|
-
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
8491
|
-
}
|
|
8492
|
-
}
|
|
8493
|
-
});
|
|
8494
|
-
}
|
|
8495
|
-
};
|
|
8496
|
-
};
|
|
8497
|
-
/**
|
|
8498
|
-
* TransactionsAndReportingApi - factory interface
|
|
8499
|
-
* @export
|
|
8500
|
-
*/
|
|
8501
|
-
const TransactionsAndReportingApiFactory = function(configuration, basePath, axios$1) {
|
|
8502
|
-
const localVarFp = TransactionsAndReportingApiFp(configuration);
|
|
8503
|
-
return {
|
|
8504
|
-
/**
|
|
8505
|
-
* **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.
|
|
8506
|
-
* @summary Get transaction history for a user
|
|
8507
|
-
* @param {TransactionsAndReportingApiGetActivitiesRequest<TAuth>} requestParameters Request parameters.
|
|
8508
|
-
* @param {*} [options] Override http request option.
|
|
8509
|
-
* @deprecated
|
|
8510
|
-
* @throws {RequiredError}
|
|
8511
|
-
*/
|
|
8512
|
-
getActivities(requestParameters = {}, options) {
|
|
8513
|
-
return localVarFp.getActivities(requestParameters, options).then((request) => request(axios$1, basePath));
|
|
8514
|
-
},
|
|
8515
|
-
/**
|
|
8516
|
-
* **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.
|
|
8517
|
-
* @summary Get performance information for a specific timeframe
|
|
8518
|
-
* @param {TransactionsAndReportingApiGetReportingCustomRangeRequest<TAuth>} requestParameters Request parameters.
|
|
8519
|
-
* @param {*} [options] Override http request option.
|
|
8520
|
-
* @deprecated
|
|
8521
|
-
* @throws {RequiredError}
|
|
8522
|
-
*/
|
|
8523
|
-
getReportingCustomRange(requestParameters, options) {
|
|
8524
|
-
return localVarFp.getReportingCustomRange(requestParameters, options).then((request) => request(axios$1, basePath));
|
|
8525
|
-
}
|
|
8526
|
-
};
|
|
8527
|
-
};
|
|
8528
|
-
/**
|
|
8529
|
-
* TransactionsAndReportingApiGenerated - object-oriented interface
|
|
8530
|
-
* @export
|
|
8531
|
-
* @class TransactionsAndReportingApiGenerated
|
|
8532
|
-
* @extends {BaseAPI}
|
|
8533
|
-
*/
|
|
8534
|
-
var TransactionsAndReportingApiGenerated = class extends BaseAPI {
|
|
8535
|
-
/**
|
|
8536
|
-
* **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.
|
|
8537
|
-
* @summary Get transaction history for a user
|
|
8538
|
-
* @param {TransactionsAndReportingApiGetActivitiesRequest<TAuth>} requestParameters Request parameters.
|
|
8539
|
-
* @param {*} [options] Override http request option.
|
|
8540
|
-
* @deprecated
|
|
8541
|
-
* @throws {RequiredError}
|
|
8542
|
-
* @memberof TransactionsAndReportingApiGenerated
|
|
8543
|
-
*/
|
|
8544
|
-
getActivities(requestParameters = {}, options) {
|
|
8545
|
-
return TransactionsAndReportingApiFp(this.configuration).getActivities(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
8546
|
-
}
|
|
8547
|
-
/**
|
|
8548
|
-
* **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.
|
|
8549
|
-
* @summary Get performance information for a specific timeframe
|
|
8550
|
-
* @param {TransactionsAndReportingApiGetReportingCustomRangeRequest<TAuth>} requestParameters Request parameters.
|
|
8551
|
-
* @param {*} [options] Override http request option.
|
|
8552
|
-
* @deprecated
|
|
8553
|
-
* @throws {RequiredError}
|
|
8554
|
-
* @memberof TransactionsAndReportingApiGenerated
|
|
8555
|
-
*/
|
|
8556
|
-
getReportingCustomRange(requestParameters, options) {
|
|
8557
|
-
return TransactionsAndReportingApiFp(this.configuration).getReportingCustomRange(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
8558
|
-
}
|
|
8559
|
-
};
|
|
8560
|
-
//#endregion
|
|
8561
|
-
//#region api/transactions-and-reporting-api.ts
|
|
8562
|
-
var TransactionsAndReportingApi = class extends TransactionsAndReportingApiGenerated {};
|
|
8563
|
-
//#endregion
|
|
8564
6949
|
//#region auth.ts
|
|
8565
6950
|
var CommercialApiKeyAuth = class CommercialApiKeyAuth {
|
|
8566
6951
|
constructor(params) {
|
|
@@ -8607,7 +6992,7 @@ var Configuration = class {
|
|
|
8607
6992
|
}
|
|
8608
6993
|
this.basePath = param.basePath;
|
|
8609
6994
|
this.baseOptions = param.baseOptions ?? {};
|
|
8610
|
-
this.userAgent = param.userAgent === void 0 ? "Konfig/
|
|
6995
|
+
this.userAgent = param.userAgent === void 0 ? "Konfig/12.1.0/typescript" : param.userAgent;
|
|
8611
6996
|
this.formDataCtor = param.formDataCtor;
|
|
8612
6997
|
}
|
|
8613
6998
|
/**
|
|
@@ -8640,10 +7025,8 @@ var Snaptrade = class extends SnaptradeCustom {
|
|
|
8640
7025
|
this.authentication = new AuthenticationApi(configuration);
|
|
8641
7026
|
this.connections = new ConnectionsApi(configuration);
|
|
8642
7027
|
this.experimentalEndpoints = new ExperimentalEndpointsApi(configuration);
|
|
8643
|
-
this.options = new OptionsApi(configuration);
|
|
8644
7028
|
this.referenceData = new ReferenceDataApi(configuration);
|
|
8645
7029
|
this.trading = new TradingApi(configuration);
|
|
8646
|
-
this.transactionsAndReporting = new TransactionsAndReportingApi(configuration);
|
|
8647
7030
|
}
|
|
8648
7031
|
};
|
|
8649
7032
|
//#endregion
|
|
@@ -8674,11 +7057,6 @@ exports.ExperimentalEndpointsApiAxiosParamCreator = ExperimentalEndpointsApiAxio
|
|
|
8674
7057
|
exports.ExperimentalEndpointsApiFactory = ExperimentalEndpointsApiFactory;
|
|
8675
7058
|
exports.ExperimentalEndpointsApiFp = ExperimentalEndpointsApiFp;
|
|
8676
7059
|
exports.ExperimentalEndpointsApiGenerated = ExperimentalEndpointsApiGenerated;
|
|
8677
|
-
exports.OptionsApi = OptionsApi;
|
|
8678
|
-
exports.OptionsApiAxiosParamCreator = OptionsApiAxiosParamCreator;
|
|
8679
|
-
exports.OptionsApiFactory = OptionsApiFactory;
|
|
8680
|
-
exports.OptionsApiFp = OptionsApiFp;
|
|
8681
|
-
exports.OptionsApiGenerated = OptionsApiGenerated;
|
|
8682
7060
|
exports.PersonalApiKeyAuth = PersonalApiKeyAuth;
|
|
8683
7061
|
exports.ReferenceDataApi = ReferenceDataApi;
|
|
8684
7062
|
exports.ReferenceDataApiAxiosParamCreator = ReferenceDataApiAxiosParamCreator;
|
|
@@ -8693,10 +7071,5 @@ exports.TradingApiAxiosParamCreator = TradingApiAxiosParamCreator;
|
|
|
8693
7071
|
exports.TradingApiFactory = TradingApiFactory;
|
|
8694
7072
|
exports.TradingApiFp = TradingApiFp;
|
|
8695
7073
|
exports.TradingApiGenerated = TradingApiGenerated;
|
|
8696
|
-
exports.TransactionsAndReportingApi = TransactionsAndReportingApi;
|
|
8697
|
-
exports.TransactionsAndReportingApiAxiosParamCreator = TransactionsAndReportingApiAxiosParamCreator;
|
|
8698
|
-
exports.TransactionsAndReportingApiFactory = TransactionsAndReportingApiFactory;
|
|
8699
|
-
exports.TransactionsAndReportingApiFp = TransactionsAndReportingApiFp;
|
|
8700
|
-
exports.TransactionsAndReportingApiGenerated = TransactionsAndReportingApiGenerated;
|
|
8701
7074
|
exports.parseIfJson = parseIfJson;
|
|
8702
7075
|
exports.readableStreamToString = readableStreamToString;
|