snaptrade-typescript-sdk 13.1.15 → 13.2.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 +642 -1
- package/dist/browser.umd.js +5 -5
- package/dist/index.cjs +698 -166
- package/dist/index.d.cts +272 -16
- package/dist/index.d.mts +272 -16
- package/dist/index.d.ts +272 -16
- package/dist/index.mjs +689 -159
- package/package.json +1 -1
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$12 = axios.default) {
|
|
35
35
|
this.basePath = basePath;
|
|
36
|
-
this.axios = axios$
|
|
36
|
+
this.axios = axios$12;
|
|
37
37
|
if (configuration) {
|
|
38
38
|
this.configuration = configuration;
|
|
39
39
|
this.basePath = configuration.basePath || this.basePath;
|
|
@@ -223,6 +223,13 @@ const setApiKeyToObject = async function({ object, key, type, keyParamName, conf
|
|
|
223
223
|
object[key] = prefix !== void 0 ? `${prefix}${apiKey}` : apiKey;
|
|
224
224
|
if (type === "Cookie") object[key] = `${keyParamName}=${object[key]}`;
|
|
225
225
|
};
|
|
226
|
+
/**
|
|
227
|
+
*
|
|
228
|
+
* @export
|
|
229
|
+
*/
|
|
230
|
+
const setBearerAuthToObject = async function(object, configuration) {
|
|
231
|
+
if (configuration && configuration.accessToken) object["Authorization"] = "Bearer " + (typeof configuration.accessToken === "function" ? await configuration.accessToken() : await configuration.accessToken);
|
|
232
|
+
};
|
|
226
233
|
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
227
234
|
if (typeof parameter === "object") if (Array.isArray(parameter)) parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
228
235
|
else Object.keys(parameter).forEach((currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`));
|
|
@@ -297,7 +304,7 @@ async function wrapAxiosRequest(makeRequest) {
|
|
|
297
304
|
* @export
|
|
298
305
|
*/
|
|
299
306
|
const createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, configuration, operationAuth) {
|
|
300
|
-
return async (axios$
|
|
307
|
+
return async (axios$11 = globalAxios, basePath = BASE_PATH) => {
|
|
301
308
|
const url = (configuration?.basePath || basePath) + axiosArgs.url;
|
|
302
309
|
await requestAfterHook({
|
|
303
310
|
axiosArgs,
|
|
@@ -309,7 +316,7 @@ const createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, config
|
|
|
309
316
|
selectedAuthMode: configuration?.authMode
|
|
310
317
|
} : void 0
|
|
311
318
|
});
|
|
312
|
-
return wrapAxiosRequest(async () => await axios$
|
|
319
|
+
return wrapAxiosRequest(async () => await axios$11.request({
|
|
313
320
|
...axiosArgs.options,
|
|
314
321
|
url
|
|
315
322
|
}));
|
|
@@ -377,13 +384,18 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
377
384
|
keyParamName: "clientId",
|
|
378
385
|
configuration
|
|
379
386
|
});
|
|
387
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
380
388
|
if (startDate !== void 0) localVarQueryParameter["startDate"] = startDate instanceof Date ? startDate.toISOString().substr(0, 10) : startDate;
|
|
381
389
|
if (endDate !== void 0) localVarQueryParameter["endDate"] = endDate instanceof Date ? endDate.toISOString().substr(0, 10) : endDate;
|
|
382
390
|
if (offset !== void 0) localVarQueryParameter["offset"] = offset;
|
|
383
391
|
if (limit !== void 0) localVarQueryParameter["limit"] = limit;
|
|
384
392
|
if (type !== void 0) localVarQueryParameter["type"] = type;
|
|
385
393
|
const localVarOperationAuth = {
|
|
386
|
-
authModes: [
|
|
394
|
+
authModes: [
|
|
395
|
+
"commercialApiKey",
|
|
396
|
+
"personalApiKey",
|
|
397
|
+
"oauth"
|
|
398
|
+
],
|
|
387
399
|
requestSigningByAuthMode: {
|
|
388
400
|
"commercialApiKey": {
|
|
389
401
|
secretParameter: "consumerKey",
|
|
@@ -455,8 +467,13 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
455
467
|
keyParamName: "clientId",
|
|
456
468
|
configuration
|
|
457
469
|
});
|
|
470
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
458
471
|
const localVarOperationAuth = {
|
|
459
|
-
authModes: [
|
|
472
|
+
authModes: [
|
|
473
|
+
"commercialApiKey",
|
|
474
|
+
"personalApiKey",
|
|
475
|
+
"oauth"
|
|
476
|
+
],
|
|
460
477
|
requestSigningByAuthMode: {
|
|
461
478
|
"commercialApiKey": {
|
|
462
479
|
secretParameter: "consumerKey",
|
|
@@ -601,8 +618,13 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
601
618
|
keyParamName: "clientId",
|
|
602
619
|
configuration
|
|
603
620
|
});
|
|
621
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
604
622
|
const localVarOperationAuth = {
|
|
605
|
-
authModes: [
|
|
623
|
+
authModes: [
|
|
624
|
+
"commercialApiKey",
|
|
625
|
+
"personalApiKey",
|
|
626
|
+
"oauth"
|
|
627
|
+
],
|
|
606
628
|
requestSigningByAuthMode: {
|
|
607
629
|
"commercialApiKey": {
|
|
608
630
|
secretParameter: "consumerKey",
|
|
@@ -674,8 +696,13 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
674
696
|
keyParamName: "clientId",
|
|
675
697
|
configuration
|
|
676
698
|
});
|
|
699
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
677
700
|
const localVarOperationAuth = {
|
|
678
|
-
authModes: [
|
|
701
|
+
authModes: [
|
|
702
|
+
"commercialApiKey",
|
|
703
|
+
"personalApiKey",
|
|
704
|
+
"oauth"
|
|
705
|
+
],
|
|
679
706
|
requestSigningByAuthMode: {
|
|
680
707
|
"commercialApiKey": {
|
|
681
708
|
secretParameter: "consumerKey",
|
|
@@ -747,8 +774,13 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
747
774
|
keyParamName: "clientId",
|
|
748
775
|
configuration
|
|
749
776
|
});
|
|
777
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
750
778
|
const localVarOperationAuth = {
|
|
751
|
-
authModes: [
|
|
779
|
+
authModes: [
|
|
780
|
+
"commercialApiKey",
|
|
781
|
+
"personalApiKey",
|
|
782
|
+
"oauth"
|
|
783
|
+
],
|
|
752
784
|
requestSigningByAuthMode: {
|
|
753
785
|
"commercialApiKey": {
|
|
754
786
|
secretParameter: "consumerKey",
|
|
@@ -821,8 +853,13 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
821
853
|
keyParamName: "clientId",
|
|
822
854
|
configuration
|
|
823
855
|
});
|
|
856
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
824
857
|
const localVarOperationAuth = {
|
|
825
|
-
authModes: [
|
|
858
|
+
authModes: [
|
|
859
|
+
"commercialApiKey",
|
|
860
|
+
"personalApiKey",
|
|
861
|
+
"oauth"
|
|
862
|
+
],
|
|
826
863
|
requestSigningByAuthMode: {
|
|
827
864
|
"commercialApiKey": {
|
|
828
865
|
secretParameter: "consumerKey",
|
|
@@ -896,8 +933,13 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
896
933
|
keyParamName: "clientId",
|
|
897
934
|
configuration
|
|
898
935
|
});
|
|
936
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
899
937
|
const localVarOperationAuth = {
|
|
900
|
-
authModes: [
|
|
938
|
+
authModes: [
|
|
939
|
+
"commercialApiKey",
|
|
940
|
+
"personalApiKey",
|
|
941
|
+
"oauth"
|
|
942
|
+
],
|
|
901
943
|
requestSigningByAuthMode: {
|
|
902
944
|
"commercialApiKey": {
|
|
903
945
|
secretParameter: "consumerKey",
|
|
@@ -974,10 +1016,15 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
974
1016
|
keyParamName: "clientId",
|
|
975
1017
|
configuration
|
|
976
1018
|
});
|
|
1019
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
977
1020
|
if (state !== void 0) localVarQueryParameter["state"] = state;
|
|
978
1021
|
if (days !== void 0) localVarQueryParameter["days"] = days;
|
|
979
1022
|
const localVarOperationAuth = {
|
|
980
|
-
authModes: [
|
|
1023
|
+
authModes: [
|
|
1024
|
+
"commercialApiKey",
|
|
1025
|
+
"personalApiKey",
|
|
1026
|
+
"oauth"
|
|
1027
|
+
],
|
|
981
1028
|
requestSigningByAuthMode: {
|
|
982
1029
|
"commercialApiKey": {
|
|
983
1030
|
secretParameter: "consumerKey",
|
|
@@ -1050,9 +1097,14 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
1050
1097
|
keyParamName: "clientId",
|
|
1051
1098
|
configuration
|
|
1052
1099
|
});
|
|
1100
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
1053
1101
|
if (onlyExecuted !== void 0) localVarQueryParameter["only_executed"] = onlyExecuted;
|
|
1054
1102
|
const localVarOperationAuth = {
|
|
1055
|
-
authModes: [
|
|
1103
|
+
authModes: [
|
|
1104
|
+
"commercialApiKey",
|
|
1105
|
+
"personalApiKey",
|
|
1106
|
+
"oauth"
|
|
1107
|
+
],
|
|
1056
1108
|
requestSigningByAuthMode: {
|
|
1057
1109
|
"commercialApiKey": {
|
|
1058
1110
|
secretParameter: "consumerKey",
|
|
@@ -1200,8 +1252,13 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
1200
1252
|
keyParamName: "clientId",
|
|
1201
1253
|
configuration
|
|
1202
1254
|
});
|
|
1255
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
1203
1256
|
const localVarOperationAuth = {
|
|
1204
|
-
authModes: [
|
|
1257
|
+
authModes: [
|
|
1258
|
+
"commercialApiKey",
|
|
1259
|
+
"personalApiKey",
|
|
1260
|
+
"oauth"
|
|
1261
|
+
],
|
|
1205
1262
|
requestSigningByAuthMode: {
|
|
1206
1263
|
"commercialApiKey": {
|
|
1207
1264
|
secretParameter: "consumerKey",
|
|
@@ -1271,8 +1328,13 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
1271
1328
|
keyParamName: "clientId",
|
|
1272
1329
|
configuration
|
|
1273
1330
|
});
|
|
1331
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
1274
1332
|
const localVarOperationAuth = {
|
|
1275
|
-
authModes: [
|
|
1333
|
+
authModes: [
|
|
1334
|
+
"commercialApiKey",
|
|
1335
|
+
"personalApiKey",
|
|
1336
|
+
"oauth"
|
|
1337
|
+
],
|
|
1276
1338
|
requestSigningByAuthMode: {
|
|
1277
1339
|
"commercialApiKey": {
|
|
1278
1340
|
secretParameter: "consumerKey",
|
|
@@ -1343,8 +1405,13 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
1343
1405
|
keyParamName: "clientId",
|
|
1344
1406
|
configuration
|
|
1345
1407
|
});
|
|
1408
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
1346
1409
|
const localVarOperationAuth = {
|
|
1347
|
-
authModes: [
|
|
1410
|
+
authModes: [
|
|
1411
|
+
"commercialApiKey",
|
|
1412
|
+
"personalApiKey",
|
|
1413
|
+
"oauth"
|
|
1414
|
+
],
|
|
1348
1415
|
requestSigningByAuthMode: {
|
|
1349
1416
|
"commercialApiKey": {
|
|
1350
1417
|
secretParameter: "consumerKey",
|
|
@@ -1416,8 +1483,13 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
1416
1483
|
keyParamName: "clientId",
|
|
1417
1484
|
configuration
|
|
1418
1485
|
});
|
|
1486
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
1419
1487
|
const localVarOperationAuth = {
|
|
1420
|
-
authModes: [
|
|
1488
|
+
authModes: [
|
|
1489
|
+
"commercialApiKey",
|
|
1490
|
+
"personalApiKey",
|
|
1491
|
+
"oauth"
|
|
1492
|
+
],
|
|
1421
1493
|
requestSigningByAuthMode: {
|
|
1422
1494
|
"commercialApiKey": {
|
|
1423
1495
|
secretParameter: "consumerKey",
|
|
@@ -1470,7 +1542,11 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1470
1542
|
async getAccountActivities(...args) {
|
|
1471
1543
|
const [requestParameters = {}, options] = args;
|
|
1472
1544
|
return createRequestFunction(await localVarAxiosParamCreator.getAccountActivities(requestParameters.accountId, requestParameters.startDate, requestParameters.endDate, requestParameters.offset, requestParameters.limit, requestParameters.type, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
1473
|
-
authModes: [
|
|
1545
|
+
authModes: [
|
|
1546
|
+
"commercialApiKey",
|
|
1547
|
+
"personalApiKey",
|
|
1548
|
+
"oauth"
|
|
1549
|
+
],
|
|
1474
1550
|
requestSigningByAuthMode: {
|
|
1475
1551
|
"commercialApiKey": {
|
|
1476
1552
|
secretParameter: "consumerKey",
|
|
@@ -1493,7 +1569,11 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1493
1569
|
async getAccountBalanceHistory(...args) {
|
|
1494
1570
|
const [requestParameters = {}, options] = args;
|
|
1495
1571
|
return createRequestFunction(await localVarAxiosParamCreator.getAccountBalanceHistory(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
1496
|
-
authModes: [
|
|
1572
|
+
authModes: [
|
|
1573
|
+
"commercialApiKey",
|
|
1574
|
+
"personalApiKey",
|
|
1575
|
+
"oauth"
|
|
1576
|
+
],
|
|
1497
1577
|
requestSigningByAuthMode: {
|
|
1498
1578
|
"commercialApiKey": {
|
|
1499
1579
|
secretParameter: "consumerKey",
|
|
@@ -1539,7 +1619,11 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1539
1619
|
async getAccountDetails(...args) {
|
|
1540
1620
|
const [requestParameters = {}, options] = args;
|
|
1541
1621
|
return createRequestFunction(await localVarAxiosParamCreator.getAccountDetails(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
1542
|
-
authModes: [
|
|
1622
|
+
authModes: [
|
|
1623
|
+
"commercialApiKey",
|
|
1624
|
+
"personalApiKey",
|
|
1625
|
+
"oauth"
|
|
1626
|
+
],
|
|
1543
1627
|
requestSigningByAuthMode: {
|
|
1544
1628
|
"commercialApiKey": {
|
|
1545
1629
|
secretParameter: "consumerKey",
|
|
@@ -1562,7 +1646,11 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1562
1646
|
async getAllAccountPositions(...args) {
|
|
1563
1647
|
const [requestParameters = {}, options] = args;
|
|
1564
1648
|
return createRequestFunction(await localVarAxiosParamCreator.getAllAccountPositions(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
1565
|
-
authModes: [
|
|
1649
|
+
authModes: [
|
|
1650
|
+
"commercialApiKey",
|
|
1651
|
+
"personalApiKey",
|
|
1652
|
+
"oauth"
|
|
1653
|
+
],
|
|
1566
1654
|
requestSigningByAuthMode: {
|
|
1567
1655
|
"commercialApiKey": {
|
|
1568
1656
|
secretParameter: "consumerKey",
|
|
@@ -1585,7 +1673,11 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1585
1673
|
async getUserAccountBalance(...args) {
|
|
1586
1674
|
const [requestParameters = {}, options] = args;
|
|
1587
1675
|
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountBalance(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
1588
|
-
authModes: [
|
|
1676
|
+
authModes: [
|
|
1677
|
+
"commercialApiKey",
|
|
1678
|
+
"personalApiKey",
|
|
1679
|
+
"oauth"
|
|
1680
|
+
],
|
|
1589
1681
|
requestSigningByAuthMode: {
|
|
1590
1682
|
"commercialApiKey": {
|
|
1591
1683
|
secretParameter: "consumerKey",
|
|
@@ -1609,7 +1701,11 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1609
1701
|
async getUserAccountDetails(...args) {
|
|
1610
1702
|
const [requestParameters = {}, options] = args;
|
|
1611
1703
|
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountDetails(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
1612
|
-
authModes: [
|
|
1704
|
+
authModes: [
|
|
1705
|
+
"commercialApiKey",
|
|
1706
|
+
"personalApiKey",
|
|
1707
|
+
"oauth"
|
|
1708
|
+
],
|
|
1613
1709
|
requestSigningByAuthMode: {
|
|
1614
1710
|
"commercialApiKey": {
|
|
1615
1711
|
secretParameter: "consumerKey",
|
|
@@ -1633,7 +1729,11 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1633
1729
|
const [requestParameters = {}, options] = args;
|
|
1634
1730
|
const accountInformationGetUserAccountOrderDetailRequest = { brokerage_order_id: requestParameters.brokerage_order_id };
|
|
1635
1731
|
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountOrderDetail(requestParameters.accountId, accountInformationGetUserAccountOrderDetailRequest, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
1636
|
-
authModes: [
|
|
1732
|
+
authModes: [
|
|
1733
|
+
"commercialApiKey",
|
|
1734
|
+
"personalApiKey",
|
|
1735
|
+
"oauth"
|
|
1736
|
+
],
|
|
1637
1737
|
requestSigningByAuthMode: {
|
|
1638
1738
|
"commercialApiKey": {
|
|
1639
1739
|
secretParameter: "consumerKey",
|
|
@@ -1656,7 +1756,11 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1656
1756
|
async getUserAccountOrders(...args) {
|
|
1657
1757
|
const [requestParameters = {}, options] = args;
|
|
1658
1758
|
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountOrders(requestParameters.accountId, requestParameters.state, requestParameters.days, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
1659
|
-
authModes: [
|
|
1759
|
+
authModes: [
|
|
1760
|
+
"commercialApiKey",
|
|
1761
|
+
"personalApiKey",
|
|
1762
|
+
"oauth"
|
|
1763
|
+
],
|
|
1660
1764
|
requestSigningByAuthMode: {
|
|
1661
1765
|
"commercialApiKey": {
|
|
1662
1766
|
secretParameter: "consumerKey",
|
|
@@ -1679,7 +1783,11 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1679
1783
|
async getUserAccountRecentOrders(...args) {
|
|
1680
1784
|
const [requestParameters = {}, options] = args;
|
|
1681
1785
|
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountRecentOrders(requestParameters.accountId, requestParameters.onlyExecuted, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
1682
|
-
authModes: [
|
|
1786
|
+
authModes: [
|
|
1787
|
+
"commercialApiKey",
|
|
1788
|
+
"personalApiKey",
|
|
1789
|
+
"oauth"
|
|
1790
|
+
],
|
|
1683
1791
|
requestSigningByAuthMode: {
|
|
1684
1792
|
"commercialApiKey": {
|
|
1685
1793
|
secretParameter: "consumerKey",
|
|
@@ -1726,7 +1834,11 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1726
1834
|
async getUserHoldings(...args) {
|
|
1727
1835
|
const [requestParameters = {}, options] = args;
|
|
1728
1836
|
return createRequestFunction(await localVarAxiosParamCreator.getUserHoldings(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
1729
|
-
authModes: [
|
|
1837
|
+
authModes: [
|
|
1838
|
+
"commercialApiKey",
|
|
1839
|
+
"personalApiKey",
|
|
1840
|
+
"oauth"
|
|
1841
|
+
],
|
|
1730
1842
|
requestSigningByAuthMode: {
|
|
1731
1843
|
"commercialApiKey": {
|
|
1732
1844
|
secretParameter: "consumerKey",
|
|
@@ -1749,7 +1861,11 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1749
1861
|
async listAllUserAccounts(...args) {
|
|
1750
1862
|
const [requestParameters = {}, options] = args;
|
|
1751
1863
|
return createRequestFunction(await localVarAxiosParamCreator.listAllUserAccounts(requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
1752
|
-
authModes: [
|
|
1864
|
+
authModes: [
|
|
1865
|
+
"commercialApiKey",
|
|
1866
|
+
"personalApiKey",
|
|
1867
|
+
"oauth"
|
|
1868
|
+
],
|
|
1753
1869
|
requestSigningByAuthMode: {
|
|
1754
1870
|
"commercialApiKey": {
|
|
1755
1871
|
secretParameter: "consumerKey",
|
|
@@ -1773,7 +1889,11 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1773
1889
|
async listUserAccounts(...args) {
|
|
1774
1890
|
const [requestParameters = {}, options] = args;
|
|
1775
1891
|
return createRequestFunction(await localVarAxiosParamCreator.listUserAccounts(requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
1776
|
-
authModes: [
|
|
1892
|
+
authModes: [
|
|
1893
|
+
"commercialApiKey",
|
|
1894
|
+
"personalApiKey",
|
|
1895
|
+
"oauth"
|
|
1896
|
+
],
|
|
1777
1897
|
requestSigningByAuthMode: {
|
|
1778
1898
|
"commercialApiKey": {
|
|
1779
1899
|
secretParameter: "consumerKey",
|
|
@@ -1796,7 +1916,11 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1796
1916
|
async updateUserAccount(...args) {
|
|
1797
1917
|
const [requestParameters = {}, options] = args;
|
|
1798
1918
|
return createRequestFunction(await localVarAxiosParamCreator.updateUserAccount(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
1799
|
-
authModes: [
|
|
1919
|
+
authModes: [
|
|
1920
|
+
"commercialApiKey",
|
|
1921
|
+
"personalApiKey",
|
|
1922
|
+
"oauth"
|
|
1923
|
+
],
|
|
1800
1924
|
requestSigningByAuthMode: {
|
|
1801
1925
|
"commercialApiKey": {
|
|
1802
1926
|
secretParameter: "consumerKey",
|
|
@@ -1815,7 +1939,7 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1815
1939
|
* AccountInformationApi - factory interface
|
|
1816
1940
|
* @export
|
|
1817
1941
|
*/
|
|
1818
|
-
const AccountInformationApiFactory = function(configuration, basePath, axios$
|
|
1942
|
+
const AccountInformationApiFactory = function(configuration, basePath, axios$10) {
|
|
1819
1943
|
const localVarFp = AccountInformationApiFp(configuration);
|
|
1820
1944
|
return {
|
|
1821
1945
|
/**
|
|
@@ -1826,7 +1950,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1826
1950
|
* @throws {RequiredError}
|
|
1827
1951
|
*/
|
|
1828
1952
|
getAccountActivities(...args) {
|
|
1829
|
-
return localVarFp.getAccountActivities(...args).then((request) => request(axios$
|
|
1953
|
+
return localVarFp.getAccountActivities(...args).then((request) => request(axios$10, basePath));
|
|
1830
1954
|
},
|
|
1831
1955
|
/**
|
|
1832
1956
|
* 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. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons) The data may contain gaps and is best used for charting account value trends. It should not be relied on as a complete or exact record of historical account values.
|
|
@@ -1836,7 +1960,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1836
1960
|
* @throws {RequiredError}
|
|
1837
1961
|
*/
|
|
1838
1962
|
getAccountBalanceHistory(...args) {
|
|
1839
|
-
return localVarFp.getAccountBalanceHistory(...args).then((request) => request(axios$
|
|
1963
|
+
return localVarFp.getAccountBalanceHistory(...args).then((request) => request(axios$10, basePath));
|
|
1840
1964
|
},
|
|
1841
1965
|
/**
|
|
1842
1966
|
* Returns the account\'s balances in a single snapshot: total net value, cash per currency, buying power, and margin details for margin accounts. Every field is always present and is `null` when the institution doesn\'t report it. **Beta:** this endpoint is only available for partners it has been enabled for. Please contact the SnapTrade team to enable it. The response schema may change. 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 institution. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. `data_freshness.as_of` is the time the returned data was fetched from the institution. If the connection has become disabled, it can no longer access the latest data from the institution, 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.
|
|
@@ -1846,7 +1970,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1846
1970
|
* @throws {RequiredError}
|
|
1847
1971
|
*/
|
|
1848
1972
|
getAccountBalancesV2(...args) {
|
|
1849
|
-
return localVarFp.getAccountBalancesV2(...args).then((request) => request(axios$
|
|
1973
|
+
return localVarFp.getAccountBalancesV2(...args).then((request) => request(axios$10, basePath));
|
|
1850
1974
|
},
|
|
1851
1975
|
/**
|
|
1852
1976
|
* Returns the specified account for the authenticated user. The account can be an investment, deposit, line of credit, or annuity account. Use the `kind` discriminator to determine the schema for the account. On Pay as you Go / Real-time, this endpoint refreshes the account\'s opening date and total net value (`net_value`) live from the institution on each call, along with funding date for `investment` accounts. 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 institution. 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. If the connection has become disabled, it can no longer access the latest data from the institution, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
@@ -1856,7 +1980,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1856
1980
|
* @throws {RequiredError}
|
|
1857
1981
|
*/
|
|
1858
1982
|
getAccountDetails(...args) {
|
|
1859
|
-
return localVarFp.getAccountDetails(...args).then((request) => request(axios$
|
|
1983
|
+
return localVarFp.getAccountDetails(...args).then((request) => request(axios$10, basePath));
|
|
1860
1984
|
},
|
|
1861
1985
|
/**
|
|
1862
1986
|
* 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, bonds, crypto, futures, option positions, future option positions, CFD positions, and tokenized asset positions. Use the `instrument.kind` discriminator to determine the schema for each position\'s `instrument`. **Beta:** future option positions (`instrument.kind: future_option`) are in beta. They are currently returned only for tastytrade and Interactive Brokers connections, and only for partners they have been enabled for — please contact the SnapTrade team to enable them. The `FutureOptionInstrument` schema may change. Positions counted in account cash balance or buying power include `cash_equivalent: true`. Security positions (`stock`, `adr`, `etf`, `mutualfund`, `cef`, `crypto`, `bond`, and `other`) may include `tax_lots` when tax lot data is enabled for the account; derivative, CFD, tokenized asset, and cash positions never do. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages). 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.
|
|
@@ -1866,7 +1990,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1866
1990
|
* @throws {RequiredError}
|
|
1867
1991
|
*/
|
|
1868
1992
|
getAllAccountPositions(...args) {
|
|
1869
|
-
return localVarFp.getAllAccountPositions(...args).then((request) => request(axios$
|
|
1993
|
+
return localVarFp.getAllAccountPositions(...args).then((request) => request(axios$10, basePath));
|
|
1870
1994
|
},
|
|
1871
1995
|
/**
|
|
1872
1996
|
* 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.
|
|
@@ -1876,7 +2000,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1876
2000
|
* @throws {RequiredError}
|
|
1877
2001
|
*/
|
|
1878
2002
|
getUserAccountBalance(...args) {
|
|
1879
|
-
return localVarFp.getUserAccountBalance(...args).then((request) => request(axios$
|
|
2003
|
+
return localVarFp.getUserAccountBalance(...args).then((request) => request(axios$10, basePath));
|
|
1880
2004
|
},
|
|
1881
2005
|
/**
|
|
1882
2006
|
* **Deprecated.** Use the [get account details](/reference/Account%20Information/AccountInformation_getAccountDetails) endpoint instead, which supports all account types, including investment, deposit, line of credit, and annuity accounts. 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.
|
|
@@ -1887,7 +2011,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1887
2011
|
* @throws {RequiredError}
|
|
1888
2012
|
*/
|
|
1889
2013
|
getUserAccountDetails(...args) {
|
|
1890
|
-
return localVarFp.getUserAccountDetails(...args).then((request) => request(axios$
|
|
2014
|
+
return localVarFp.getUserAccountDetails(...args).then((request) => request(axios$10, basePath));
|
|
1891
2015
|
},
|
|
1892
2016
|
/**
|
|
1893
2017
|
* 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.
|
|
@@ -1897,7 +2021,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1897
2021
|
* @throws {RequiredError}
|
|
1898
2022
|
*/
|
|
1899
2023
|
getUserAccountOrderDetail(...args) {
|
|
1900
|
-
return localVarFp.getUserAccountOrderDetail(...args).then((request) => request(axios$
|
|
2024
|
+
return localVarFp.getUserAccountOrderDetail(...args).then((request) => request(axios$10, basePath));
|
|
1901
2025
|
},
|
|
1902
2026
|
/**
|
|
1903
2027
|
* 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.
|
|
@@ -1907,7 +2031,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1907
2031
|
* @throws {RequiredError}
|
|
1908
2032
|
*/
|
|
1909
2033
|
getUserAccountOrders(...args) {
|
|
1910
|
-
return localVarFp.getUserAccountOrders(...args).then((request) => request(axios$
|
|
2034
|
+
return localVarFp.getUserAccountOrders(...args).then((request) => request(axios$10, basePath));
|
|
1911
2035
|
},
|
|
1912
2036
|
/**
|
|
1913
2037
|
* 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
|
|
@@ -1917,7 +2041,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1917
2041
|
* @throws {RequiredError}
|
|
1918
2042
|
*/
|
|
1919
2043
|
getUserAccountRecentOrders(...args) {
|
|
1920
|
-
return localVarFp.getUserAccountRecentOrders(...args).then((request) => request(axios$
|
|
2044
|
+
return localVarFp.getUserAccountRecentOrders(...args).then((request) => request(axios$10, basePath));
|
|
1921
2045
|
},
|
|
1922
2046
|
/**
|
|
1923
2047
|
* DEPRECATED. Returns a list of rate of return percents for a given account.
|
|
@@ -1927,7 +2051,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1927
2051
|
* @throws {RequiredError}
|
|
1928
2052
|
*/
|
|
1929
2053
|
getUserAccountReturnRates(...args) {
|
|
1930
|
-
return localVarFp.getUserAccountReturnRates(...args).then((request) => request(axios$
|
|
2054
|
+
return localVarFp.getUserAccountReturnRates(...args).then((request) => request(axios$10, basePath));
|
|
1931
2055
|
},
|
|
1932
2056
|
/**
|
|
1933
2057
|
* **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. Concurrent live holdings requests for the same account fail immediately with HTTP 409 and error code `1166`. Wait for the in-flight request to complete before retrying.
|
|
@@ -1938,7 +2062,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1938
2062
|
* @throws {RequiredError}
|
|
1939
2063
|
*/
|
|
1940
2064
|
getUserHoldings(...args) {
|
|
1941
|
-
return localVarFp.getUserHoldings(...args).then((request) => request(axios$
|
|
2065
|
+
return localVarFp.getUserHoldings(...args).then((request) => request(axios$10, basePath));
|
|
1942
2066
|
},
|
|
1943
2067
|
/**
|
|
1944
2068
|
* Returns all accounts across all connections known to SnapTrade for the authenticated user. The `results` list can contain multiple account types in the same response, including investment, deposit, line of credit, and annuity accounts. Use the `kind` discriminator to determine the schema for each account. 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 institution. To get real-time data on Pay as you Go / Real-time, use the [list accounts for a connection endpoint](/reference/Connections/Connections_listConnectionAccounts). Customers on Pay as you Go / Daily can force a refresh with the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
@@ -1948,7 +2072,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1948
2072
|
* @throws {RequiredError}
|
|
1949
2073
|
*/
|
|
1950
2074
|
listAllUserAccounts(...args) {
|
|
1951
|
-
return localVarFp.listAllUserAccounts(...args).then((request) => request(axios$
|
|
2075
|
+
return localVarFp.listAllUserAccounts(...args).then((request) => request(axios$10, basePath));
|
|
1952
2076
|
},
|
|
1953
2077
|
/**
|
|
1954
2078
|
* **Deprecated.** Use the [list all user accounts](/reference/Account%20Information/AccountInformation_listAllUserAccounts) endpoint instead, which returns all account types in a single response, including investment, deposit, line of credit, and annuity accounts. 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).
|
|
@@ -1959,7 +2083,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1959
2083
|
* @throws {RequiredError}
|
|
1960
2084
|
*/
|
|
1961
2085
|
listUserAccounts(...args) {
|
|
1962
|
-
return localVarFp.listUserAccounts(...args).then((request) => request(axios$
|
|
2086
|
+
return localVarFp.listUserAccounts(...args).then((request) => request(axios$10, basePath));
|
|
1963
2087
|
},
|
|
1964
2088
|
/**
|
|
1965
2089
|
* Updates various properties of a specified account.
|
|
@@ -1969,7 +2093,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$9)
|
|
|
1969
2093
|
* @throws {RequiredError}
|
|
1970
2094
|
*/
|
|
1971
2095
|
updateUserAccount(...args) {
|
|
1972
|
-
return localVarFp.updateUserAccount(...args).then((request) => request(axios$
|
|
2096
|
+
return localVarFp.updateUserAccount(...args).then((request) => request(axios$10, basePath));
|
|
1973
2097
|
}
|
|
1974
2098
|
};
|
|
1975
2099
|
};
|
|
@@ -2225,7 +2349,7 @@ async check(options) {
|
|
|
2225
2349
|
* ApiStatusApi - factory interface
|
|
2226
2350
|
* @export
|
|
2227
2351
|
*/
|
|
2228
|
-
const ApiStatusApiFactory = function(configuration, basePath, axios$
|
|
2352
|
+
const ApiStatusApiFactory = function(configuration, basePath, axios$9) {
|
|
2229
2353
|
const localVarFp = ApiStatusApiFp(configuration);
|
|
2230
2354
|
return {
|
|
2231
2355
|
/**
|
|
@@ -2235,7 +2359,7 @@ const ApiStatusApiFactory = function(configuration, basePath, axios$8) {
|
|
|
2235
2359
|
* @throws {RequiredError}
|
|
2236
2360
|
*/
|
|
2237
2361
|
check(options) {
|
|
2238
|
-
return localVarFp.check(options).then((request) => request(axios$
|
|
2362
|
+
return localVarFp.check(options).then((request) => request(axios$9, basePath));
|
|
2239
2363
|
} };
|
|
2240
2364
|
};
|
|
2241
2365
|
/**
|
|
@@ -2414,8 +2538,13 @@ const AuthenticationApiAxiosParamCreator = function(configuration) {
|
|
|
2414
2538
|
keyParamName: "clientId",
|
|
2415
2539
|
configuration
|
|
2416
2540
|
});
|
|
2541
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
2417
2542
|
const localVarOperationAuth = {
|
|
2418
|
-
authModes: [
|
|
2543
|
+
authModes: [
|
|
2544
|
+
"commercialApiKey",
|
|
2545
|
+
"personalApiKey",
|
|
2546
|
+
"oauth"
|
|
2547
|
+
],
|
|
2419
2548
|
requestSigningByAuthMode: {
|
|
2420
2549
|
"commercialApiKey": {
|
|
2421
2550
|
secretParameter: "consumerKey",
|
|
@@ -2631,7 +2760,11 @@ const AuthenticationApiFp = function(configuration) {
|
|
|
2631
2760
|
connectionPortalVersion: requestParameters.connectionPortalVersion
|
|
2632
2761
|
};
|
|
2633
2762
|
return createRequestFunction(await localVarAxiosParamCreator.loginSnapTradeUser(snapTradeLoginUserRequestBody, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
2634
|
-
authModes: [
|
|
2763
|
+
authModes: [
|
|
2764
|
+
"commercialApiKey",
|
|
2765
|
+
"personalApiKey",
|
|
2766
|
+
"oauth"
|
|
2767
|
+
],
|
|
2635
2768
|
requestSigningByAuthMode: {
|
|
2636
2769
|
"commercialApiKey": {
|
|
2637
2770
|
secretParameter: "consumerKey",
|
|
@@ -2689,7 +2822,7 @@ const AuthenticationApiFp = function(configuration) {
|
|
|
2689
2822
|
* AuthenticationApi - factory interface
|
|
2690
2823
|
* @export
|
|
2691
2824
|
*/
|
|
2692
|
-
const AuthenticationApiFactory = function(configuration, basePath, axios$
|
|
2825
|
+
const AuthenticationApiFactory = function(configuration, basePath, axios$8) {
|
|
2693
2826
|
const localVarFp = AuthenticationApiFp(configuration);
|
|
2694
2827
|
return {
|
|
2695
2828
|
/**
|
|
@@ -2700,7 +2833,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$7) {
|
|
|
2700
2833
|
* @throws {RequiredError}
|
|
2701
2834
|
*/
|
|
2702
2835
|
deleteSnapTradeUser(...args) {
|
|
2703
|
-
return localVarFp.deleteSnapTradeUser(...args).then((request) => request(axios$
|
|
2836
|
+
return localVarFp.deleteSnapTradeUser(...args).then((request) => request(axios$8, basePath));
|
|
2704
2837
|
},
|
|
2705
2838
|
/**
|
|
2706
2839
|
* Returns a list of all registered user IDs. Please note that the response is not currently paginated.
|
|
@@ -2709,7 +2842,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$7) {
|
|
|
2709
2842
|
* @throws {RequiredError}
|
|
2710
2843
|
*/
|
|
2711
2844
|
listSnapTradeUsers(...args) {
|
|
2712
|
-
return localVarFp.listSnapTradeUsers(...args).then((request) => request(axios$
|
|
2845
|
+
return localVarFp.listSnapTradeUsers(...args).then((request) => request(axios$8, basePath));
|
|
2713
2846
|
},
|
|
2714
2847
|
/**
|
|
2715
2848
|
* 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.
|
|
@@ -2719,7 +2852,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$7) {
|
|
|
2719
2852
|
* @throws {RequiredError}
|
|
2720
2853
|
*/
|
|
2721
2854
|
loginSnapTradeUser(...args) {
|
|
2722
|
-
return localVarFp.loginSnapTradeUser(...args).then((request) => request(axios$
|
|
2855
|
+
return localVarFp.loginSnapTradeUser(...args).then((request) => request(axios$8, basePath));
|
|
2723
2856
|
},
|
|
2724
2857
|
/**
|
|
2725
2858
|
* 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.
|
|
@@ -2729,7 +2862,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$7) {
|
|
|
2729
2862
|
* @throws {RequiredError}
|
|
2730
2863
|
*/
|
|
2731
2864
|
registerSnapTradeUser(...args) {
|
|
2732
|
-
return localVarFp.registerSnapTradeUser(...args).then((request) => request(axios$
|
|
2865
|
+
return localVarFp.registerSnapTradeUser(...args).then((request) => request(axios$8, basePath));
|
|
2733
2866
|
},
|
|
2734
2867
|
/**
|
|
2735
2868
|
* 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.
|
|
@@ -2739,7 +2872,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$7) {
|
|
|
2739
2872
|
* @throws {RequiredError}
|
|
2740
2873
|
*/
|
|
2741
2874
|
resetSnapTradeUserSecret(...args) {
|
|
2742
|
-
return localVarFp.resetSnapTradeUserSecret(...args).then((request) => request(axios$
|
|
2875
|
+
return localVarFp.resetSnapTradeUserSecret(...args).then((request) => request(axios$8, basePath));
|
|
2743
2876
|
}
|
|
2744
2877
|
};
|
|
2745
2878
|
};
|
|
@@ -2927,8 +3060,13 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
2927
3060
|
keyParamName: "clientId",
|
|
2928
3061
|
configuration
|
|
2929
3062
|
});
|
|
3063
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
2930
3064
|
const localVarOperationAuth = {
|
|
2931
|
-
authModes: [
|
|
3065
|
+
authModes: [
|
|
3066
|
+
"commercialApiKey",
|
|
3067
|
+
"personalApiKey",
|
|
3068
|
+
"oauth"
|
|
3069
|
+
],
|
|
2932
3070
|
requestSigningByAuthMode: {
|
|
2933
3071
|
"commercialApiKey": {
|
|
2934
3072
|
secretParameter: "consumerKey",
|
|
@@ -3000,8 +3138,13 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3000
3138
|
keyParamName: "clientId",
|
|
3001
3139
|
configuration
|
|
3002
3140
|
});
|
|
3141
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
3003
3142
|
const localVarOperationAuth = {
|
|
3004
|
-
authModes: [
|
|
3143
|
+
authModes: [
|
|
3144
|
+
"commercialApiKey",
|
|
3145
|
+
"personalApiKey",
|
|
3146
|
+
"oauth"
|
|
3147
|
+
],
|
|
3005
3148
|
requestSigningByAuthMode: {
|
|
3006
3149
|
"commercialApiKey": {
|
|
3007
3150
|
secretParameter: "consumerKey",
|
|
@@ -3073,8 +3216,13 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3073
3216
|
keyParamName: "clientId",
|
|
3074
3217
|
configuration
|
|
3075
3218
|
});
|
|
3219
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
3076
3220
|
const localVarOperationAuth = {
|
|
3077
|
-
authModes: [
|
|
3221
|
+
authModes: [
|
|
3222
|
+
"commercialApiKey",
|
|
3223
|
+
"personalApiKey",
|
|
3224
|
+
"oauth"
|
|
3225
|
+
],
|
|
3078
3226
|
requestSigningByAuthMode: {
|
|
3079
3227
|
"commercialApiKey": {
|
|
3080
3228
|
secretParameter: "consumerKey",
|
|
@@ -3144,8 +3292,13 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3144
3292
|
keyParamName: "clientId",
|
|
3145
3293
|
configuration
|
|
3146
3294
|
});
|
|
3295
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
3147
3296
|
const localVarOperationAuth = {
|
|
3148
|
-
authModes: [
|
|
3297
|
+
authModes: [
|
|
3298
|
+
"commercialApiKey",
|
|
3299
|
+
"personalApiKey",
|
|
3300
|
+
"oauth"
|
|
3301
|
+
],
|
|
3149
3302
|
requestSigningByAuthMode: {
|
|
3150
3303
|
"commercialApiKey": {
|
|
3151
3304
|
secretParameter: "consumerKey",
|
|
@@ -3217,8 +3370,13 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3217
3370
|
keyParamName: "clientId",
|
|
3218
3371
|
configuration
|
|
3219
3372
|
});
|
|
3373
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
3220
3374
|
const localVarOperationAuth = {
|
|
3221
|
-
authModes: [
|
|
3375
|
+
authModes: [
|
|
3376
|
+
"commercialApiKey",
|
|
3377
|
+
"personalApiKey",
|
|
3378
|
+
"oauth"
|
|
3379
|
+
],
|
|
3222
3380
|
requestSigningByAuthMode: {
|
|
3223
3381
|
"commercialApiKey": {
|
|
3224
3382
|
secretParameter: "consumerKey",
|
|
@@ -3290,8 +3448,13 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3290
3448
|
keyParamName: "clientId",
|
|
3291
3449
|
configuration
|
|
3292
3450
|
});
|
|
3451
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
3293
3452
|
const localVarOperationAuth = {
|
|
3294
|
-
authModes: [
|
|
3453
|
+
authModes: [
|
|
3454
|
+
"commercialApiKey",
|
|
3455
|
+
"personalApiKey",
|
|
3456
|
+
"oauth"
|
|
3457
|
+
],
|
|
3295
3458
|
requestSigningByAuthMode: {
|
|
3296
3459
|
"commercialApiKey": {
|
|
3297
3460
|
secretParameter: "consumerKey",
|
|
@@ -3438,8 +3601,13 @@ const ConnectionsApiAxiosParamCreator = function(configuration) {
|
|
|
3438
3601
|
keyParamName: "clientId",
|
|
3439
3602
|
configuration
|
|
3440
3603
|
});
|
|
3604
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
3441
3605
|
const localVarOperationAuth = {
|
|
3442
|
-
authModes: [
|
|
3606
|
+
authModes: [
|
|
3607
|
+
"commercialApiKey",
|
|
3608
|
+
"personalApiKey",
|
|
3609
|
+
"oauth"
|
|
3610
|
+
],
|
|
3443
3611
|
requestSigningByAuthMode: {
|
|
3444
3612
|
"commercialApiKey": {
|
|
3445
3613
|
secretParameter: "consumerKey",
|
|
@@ -3515,7 +3683,11 @@ const ConnectionsApiFp = function(configuration) {
|
|
|
3515
3683
|
async detailBrokerageAuthorization(...args) {
|
|
3516
3684
|
const [requestParameters = {}, options] = args;
|
|
3517
3685
|
return createRequestFunction(await localVarAxiosParamCreator.detailBrokerageAuthorization(requestParameters.authorizationId, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
3518
|
-
authModes: [
|
|
3686
|
+
authModes: [
|
|
3687
|
+
"commercialApiKey",
|
|
3688
|
+
"personalApiKey",
|
|
3689
|
+
"oauth"
|
|
3690
|
+
],
|
|
3519
3691
|
requestSigningByAuthMode: {
|
|
3520
3692
|
"commercialApiKey": {
|
|
3521
3693
|
secretParameter: "consumerKey",
|
|
@@ -3538,7 +3710,11 @@ const ConnectionsApiFp = function(configuration) {
|
|
|
3538
3710
|
async disableBrokerageAuthorization(...args) {
|
|
3539
3711
|
const [requestParameters = {}, options] = args;
|
|
3540
3712
|
return createRequestFunction(await localVarAxiosParamCreator.disableBrokerageAuthorization(requestParameters.authorizationId, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
3541
|
-
authModes: [
|
|
3713
|
+
authModes: [
|
|
3714
|
+
"commercialApiKey",
|
|
3715
|
+
"personalApiKey",
|
|
3716
|
+
"oauth"
|
|
3717
|
+
],
|
|
3542
3718
|
requestSigningByAuthMode: {
|
|
3543
3719
|
"commercialApiKey": {
|
|
3544
3720
|
secretParameter: "consumerKey",
|
|
@@ -3561,7 +3737,11 @@ const ConnectionsApiFp = function(configuration) {
|
|
|
3561
3737
|
async listBrokerageAuthorizationAccounts(...args) {
|
|
3562
3738
|
const [requestParameters = {}, options] = args;
|
|
3563
3739
|
return createRequestFunction(await localVarAxiosParamCreator.listBrokerageAuthorizationAccounts(requestParameters.authorizationId, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
3564
|
-
authModes: [
|
|
3740
|
+
authModes: [
|
|
3741
|
+
"commercialApiKey",
|
|
3742
|
+
"personalApiKey",
|
|
3743
|
+
"oauth"
|
|
3744
|
+
],
|
|
3565
3745
|
requestSigningByAuthMode: {
|
|
3566
3746
|
"commercialApiKey": {
|
|
3567
3747
|
secretParameter: "consumerKey",
|
|
@@ -3584,7 +3764,11 @@ const ConnectionsApiFp = function(configuration) {
|
|
|
3584
3764
|
async listBrokerageAuthorizations(...args) {
|
|
3585
3765
|
const [requestParameters = {}, options] = args;
|
|
3586
3766
|
return createRequestFunction(await localVarAxiosParamCreator.listBrokerageAuthorizations(requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
3587
|
-
authModes: [
|
|
3767
|
+
authModes: [
|
|
3768
|
+
"commercialApiKey",
|
|
3769
|
+
"personalApiKey",
|
|
3770
|
+
"oauth"
|
|
3771
|
+
],
|
|
3588
3772
|
requestSigningByAuthMode: {
|
|
3589
3773
|
"commercialApiKey": {
|
|
3590
3774
|
secretParameter: "consumerKey",
|
|
@@ -3607,7 +3791,11 @@ const ConnectionsApiFp = function(configuration) {
|
|
|
3607
3791
|
async listConnectionAccounts(...args) {
|
|
3608
3792
|
const [requestParameters = {}, options] = args;
|
|
3609
3793
|
return createRequestFunction(await localVarAxiosParamCreator.listConnectionAccounts(requestParameters.connectionId, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
3610
|
-
authModes: [
|
|
3794
|
+
authModes: [
|
|
3795
|
+
"commercialApiKey",
|
|
3796
|
+
"personalApiKey",
|
|
3797
|
+
"oauth"
|
|
3798
|
+
],
|
|
3611
3799
|
requestSigningByAuthMode: {
|
|
3612
3800
|
"commercialApiKey": {
|
|
3613
3801
|
secretParameter: "consumerKey",
|
|
@@ -3630,7 +3818,11 @@ const ConnectionsApiFp = function(configuration) {
|
|
|
3630
3818
|
async refreshBrokerageAuthorization(...args) {
|
|
3631
3819
|
const [requestParameters = {}, options] = args;
|
|
3632
3820
|
return createRequestFunction(await localVarAxiosParamCreator.refreshBrokerageAuthorization(requestParameters.authorizationId, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
3633
|
-
authModes: [
|
|
3821
|
+
authModes: [
|
|
3822
|
+
"commercialApiKey",
|
|
3823
|
+
"personalApiKey",
|
|
3824
|
+
"oauth"
|
|
3825
|
+
],
|
|
3634
3826
|
requestSigningByAuthMode: {
|
|
3635
3827
|
"commercialApiKey": {
|
|
3636
3828
|
secretParameter: "consumerKey",
|
|
@@ -3676,7 +3868,11 @@ const ConnectionsApiFp = function(configuration) {
|
|
|
3676
3868
|
async syncBrokerageAuthorizationTransactions(...args) {
|
|
3677
3869
|
const [requestParameters = {}, options] = args;
|
|
3678
3870
|
return createRequestFunction(await localVarAxiosParamCreator.syncBrokerageAuthorizationTransactions(requestParameters.authorizationId, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
3679
|
-
authModes: [
|
|
3871
|
+
authModes: [
|
|
3872
|
+
"commercialApiKey",
|
|
3873
|
+
"personalApiKey",
|
|
3874
|
+
"oauth"
|
|
3875
|
+
],
|
|
3680
3876
|
requestSigningByAuthMode: {
|
|
3681
3877
|
"commercialApiKey": {
|
|
3682
3878
|
secretParameter: "consumerKey",
|
|
@@ -3695,7 +3891,7 @@ const ConnectionsApiFp = function(configuration) {
|
|
|
3695
3891
|
* ConnectionsApi - factory interface
|
|
3696
3892
|
* @export
|
|
3697
3893
|
*/
|
|
3698
|
-
const ConnectionsApiFactory = function(configuration, basePath, axios$
|
|
3894
|
+
const ConnectionsApiFactory = function(configuration, basePath, axios$7) {
|
|
3699
3895
|
const localVarFp = ConnectionsApiFp(configuration);
|
|
3700
3896
|
return {
|
|
3701
3897
|
/**
|
|
@@ -3706,7 +3902,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$6) {
|
|
|
3706
3902
|
* @throws {RequiredError}
|
|
3707
3903
|
*/
|
|
3708
3904
|
deleteConnection(...args) {
|
|
3709
|
-
return localVarFp.deleteConnection(...args).then((request) => request(axios$
|
|
3905
|
+
return localVarFp.deleteConnection(...args).then((request) => request(axios$7, basePath));
|
|
3710
3906
|
},
|
|
3711
3907
|
/**
|
|
3712
3908
|
* Returns a single connection for the specified ID.
|
|
@@ -3716,7 +3912,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$6) {
|
|
|
3716
3912
|
* @throws {RequiredError}
|
|
3717
3913
|
*/
|
|
3718
3914
|
detailBrokerageAuthorization(...args) {
|
|
3719
|
-
return localVarFp.detailBrokerageAuthorization(...args).then((request) => request(axios$
|
|
3915
|
+
return localVarFp.detailBrokerageAuthorization(...args).then((request) => request(axios$7, basePath));
|
|
3720
3916
|
},
|
|
3721
3917
|
/**
|
|
3722
3918
|
* 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.
|
|
@@ -3726,7 +3922,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$6) {
|
|
|
3726
3922
|
* @throws {RequiredError}
|
|
3727
3923
|
*/
|
|
3728
3924
|
disableBrokerageAuthorization(...args) {
|
|
3729
|
-
return localVarFp.disableBrokerageAuthorization(...args).then((request) => request(axios$
|
|
3925
|
+
return localVarFp.disableBrokerageAuthorization(...args).then((request) => request(axios$7, basePath));
|
|
3730
3926
|
},
|
|
3731
3927
|
/**
|
|
3732
3928
|
* 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.
|
|
@@ -3736,7 +3932,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$6) {
|
|
|
3736
3932
|
* @throws {RequiredError}
|
|
3737
3933
|
*/
|
|
3738
3934
|
listBrokerageAuthorizationAccounts(...args) {
|
|
3739
|
-
return localVarFp.listBrokerageAuthorizationAccounts(...args).then((request) => request(axios$
|
|
3935
|
+
return localVarFp.listBrokerageAuthorizationAccounts(...args).then((request) => request(axios$7, basePath));
|
|
3740
3936
|
},
|
|
3741
3937
|
/**
|
|
3742
3938
|
* 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.
|
|
@@ -3746,7 +3942,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$6) {
|
|
|
3746
3942
|
* @throws {RequiredError}
|
|
3747
3943
|
*/
|
|
3748
3944
|
listBrokerageAuthorizations(...args) {
|
|
3749
|
-
return localVarFp.listBrokerageAuthorizations(...args).then((request) => request(axios$
|
|
3945
|
+
return localVarFp.listBrokerageAuthorizations(...args).then((request) => request(axios$7, basePath));
|
|
3750
3946
|
},
|
|
3751
3947
|
/**
|
|
3752
3948
|
* Returns all accounts that belong to the specified connection for the authenticated user. The `results` list can contain multiple account types in the same response, including investment, deposit, line of credit, and annuity accounts. Use the `kind` discriminator to determine the schema for each account. On Pay as you Go / Real-time, this endpoint refreshes each account\'s opening date and total net value (`net_value`) live from the institution on each call, along with funding date for `investment` accounts. 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 institution. 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.
|
|
@@ -3756,7 +3952,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$6) {
|
|
|
3756
3952
|
* @throws {RequiredError}
|
|
3757
3953
|
*/
|
|
3758
3954
|
listConnectionAccounts(...args) {
|
|
3759
|
-
return localVarFp.listConnectionAccounts(...args).then((request) => request(axios$
|
|
3955
|
+
return localVarFp.listConnectionAccounts(...args).then((request) => request(axios$7, basePath));
|
|
3760
3956
|
},
|
|
3761
3957
|
/**
|
|
3762
3958
|
* 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 SnapTrade uses delayed data for the connection. Real-time connections do not benefit from this feature since data is refreshed when calls are made. Refer to `data_freshness_mode.snaptrade` on a connection to determine this.**
|
|
@@ -3766,7 +3962,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$6) {
|
|
|
3766
3962
|
* @throws {RequiredError}
|
|
3767
3963
|
*/
|
|
3768
3964
|
refreshBrokerageAuthorization(...args) {
|
|
3769
|
-
return localVarFp.refreshBrokerageAuthorization(...args).then((request) => request(axios$
|
|
3965
|
+
return localVarFp.refreshBrokerageAuthorization(...args).then((request) => request(axios$7, basePath));
|
|
3770
3966
|
},
|
|
3771
3967
|
/**
|
|
3772
3968
|
* DEPRECATED. Returns a list of rate of return percents for a given connection.
|
|
@@ -3776,7 +3972,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$6) {
|
|
|
3776
3972
|
* @throws {RequiredError}
|
|
3777
3973
|
*/
|
|
3778
3974
|
returnRates(...args) {
|
|
3779
|
-
return localVarFp.returnRates(...args).then((request) => request(axios$
|
|
3975
|
+
return localVarFp.returnRates(...args).then((request) => request(axios$7, basePath));
|
|
3780
3976
|
},
|
|
3781
3977
|
/**
|
|
3782
3978
|
* 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
|
|
@@ -3786,7 +3982,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$6) {
|
|
|
3786
3982
|
* @throws {RequiredError}
|
|
3787
3983
|
*/
|
|
3788
3984
|
syncBrokerageAuthorizationTransactions(...args) {
|
|
3789
|
-
return localVarFp.syncBrokerageAuthorizationTransactions(...args).then((request) => request(axios$
|
|
3985
|
+
return localVarFp.syncBrokerageAuthorizationTransactions(...args).then((request) => request(axios$7, basePath));
|
|
3790
3986
|
}
|
|
3791
3987
|
};
|
|
3792
3988
|
};
|
|
@@ -4171,8 +4367,13 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
|
4171
4367
|
keyParamName: "clientId",
|
|
4172
4368
|
configuration
|
|
4173
4369
|
});
|
|
4370
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
4174
4371
|
const localVarOperationAuth = {
|
|
4175
|
-
authModes: [
|
|
4372
|
+
authModes: [
|
|
4373
|
+
"commercialApiKey",
|
|
4374
|
+
"personalApiKey",
|
|
4375
|
+
"oauth"
|
|
4376
|
+
],
|
|
4176
4377
|
requestSigningByAuthMode: {
|
|
4177
4378
|
"commercialApiKey": {
|
|
4178
4379
|
secretParameter: "consumerKey",
|
|
@@ -4246,10 +4447,15 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
|
4246
4447
|
keyParamName: "clientId",
|
|
4247
4448
|
configuration
|
|
4248
4449
|
});
|
|
4450
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
4249
4451
|
if (state !== void 0) localVarQueryParameter["state"] = state;
|
|
4250
4452
|
if (days !== void 0) localVarQueryParameter["days"] = days;
|
|
4251
4453
|
const localVarOperationAuth = {
|
|
4252
|
-
authModes: [
|
|
4454
|
+
authModes: [
|
|
4455
|
+
"commercialApiKey",
|
|
4456
|
+
"personalApiKey",
|
|
4457
|
+
"oauth"
|
|
4458
|
+
],
|
|
4253
4459
|
requestSigningByAuthMode: {
|
|
4254
4460
|
"commercialApiKey": {
|
|
4255
4461
|
secretParameter: "consumerKey",
|
|
@@ -4322,9 +4528,14 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
|
4322
4528
|
keyParamName: "clientId",
|
|
4323
4529
|
configuration
|
|
4324
4530
|
});
|
|
4531
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
4325
4532
|
if (onlyExecuted !== void 0) localVarQueryParameter["only_executed"] = onlyExecuted;
|
|
4326
4533
|
const localVarOperationAuth = {
|
|
4327
|
-
authModes: [
|
|
4534
|
+
authModes: [
|
|
4535
|
+
"commercialApiKey",
|
|
4536
|
+
"personalApiKey",
|
|
4537
|
+
"oauth"
|
|
4538
|
+
],
|
|
4328
4539
|
requestSigningByAuthMode: {
|
|
4329
4540
|
"commercialApiKey": {
|
|
4330
4541
|
secretParameter: "consumerKey",
|
|
@@ -4463,8 +4674,13 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
|
4463
4674
|
keyParamName: "clientId",
|
|
4464
4675
|
configuration
|
|
4465
4676
|
});
|
|
4677
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
4466
4678
|
const localVarOperationAuth = {
|
|
4467
|
-
authModes: [
|
|
4679
|
+
authModes: [
|
|
4680
|
+
"commercialApiKey",
|
|
4681
|
+
"personalApiKey",
|
|
4682
|
+
"oauth"
|
|
4683
|
+
],
|
|
4468
4684
|
requestSigningByAuthMode: {
|
|
4469
4685
|
"commercialApiKey": {
|
|
4470
4686
|
secretParameter: "consumerKey",
|
|
@@ -4594,7 +4810,11 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4594
4810
|
async getUserAccountOrderDetailV2(...args) {
|
|
4595
4811
|
const [requestParameters = {}, options] = args;
|
|
4596
4812
|
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountOrderDetailV2(requestParameters.accountId, requestParameters.brokerageOrderId, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
4597
|
-
authModes: [
|
|
4813
|
+
authModes: [
|
|
4814
|
+
"commercialApiKey",
|
|
4815
|
+
"personalApiKey",
|
|
4816
|
+
"oauth"
|
|
4817
|
+
],
|
|
4598
4818
|
requestSigningByAuthMode: {
|
|
4599
4819
|
"commercialApiKey": {
|
|
4600
4820
|
secretParameter: "consumerKey",
|
|
@@ -4617,7 +4837,11 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4617
4837
|
async getUserAccountOrdersV2(...args) {
|
|
4618
4838
|
const [requestParameters = {}, options] = args;
|
|
4619
4839
|
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountOrdersV2(requestParameters.accountId, requestParameters.state, requestParameters.days, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
4620
|
-
authModes: [
|
|
4840
|
+
authModes: [
|
|
4841
|
+
"commercialApiKey",
|
|
4842
|
+
"personalApiKey",
|
|
4843
|
+
"oauth"
|
|
4844
|
+
],
|
|
4621
4845
|
requestSigningByAuthMode: {
|
|
4622
4846
|
"commercialApiKey": {
|
|
4623
4847
|
secretParameter: "consumerKey",
|
|
@@ -4640,7 +4864,11 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4640
4864
|
async getUserAccountRecentOrdersV2(...args) {
|
|
4641
4865
|
const [requestParameters = {}, options] = args;
|
|
4642
4866
|
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountRecentOrdersV2(requestParameters.accountId, requestParameters.onlyExecuted, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
4643
|
-
authModes: [
|
|
4867
|
+
authModes: [
|
|
4868
|
+
"commercialApiKey",
|
|
4869
|
+
"personalApiKey",
|
|
4870
|
+
"oauth"
|
|
4871
|
+
],
|
|
4644
4872
|
requestSigningByAuthMode: {
|
|
4645
4873
|
"commercialApiKey": {
|
|
4646
4874
|
secretParameter: "consumerKey",
|
|
@@ -4697,7 +4925,11 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4697
4925
|
trading_session: requestParameters.trading_session
|
|
4698
4926
|
};
|
|
4699
4927
|
return createRequestFunction(await localVarAxiosParamCreator.placeSimpleOrder(requestParameters.accountId, simpleTradeForm, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
4700
|
-
authModes: [
|
|
4928
|
+
authModes: [
|
|
4929
|
+
"commercialApiKey",
|
|
4930
|
+
"personalApiKey",
|
|
4931
|
+
"oauth"
|
|
4932
|
+
],
|
|
4701
4933
|
requestSigningByAuthMode: {
|
|
4702
4934
|
"commercialApiKey": {
|
|
4703
4935
|
secretParameter: "consumerKey",
|
|
@@ -4716,7 +4948,7 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4716
4948
|
* ExperimentalEndpointsApi - factory interface
|
|
4717
4949
|
* @export
|
|
4718
4950
|
*/
|
|
4719
|
-
const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
4951
|
+
const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$6) {
|
|
4720
4952
|
const localVarFp = ExperimentalEndpointsApiFp(configuration);
|
|
4721
4953
|
return {
|
|
4722
4954
|
/**
|
|
@@ -4727,7 +4959,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4727
4959
|
* @throws {RequiredError}
|
|
4728
4960
|
*/
|
|
4729
4961
|
addSubscription(...args) {
|
|
4730
|
-
return localVarFp.addSubscription(...args).then((request) => request(axios$
|
|
4962
|
+
return localVarFp.addSubscription(...args).then((request) => request(axios$6, basePath));
|
|
4731
4963
|
},
|
|
4732
4964
|
/**
|
|
4733
4965
|
* Cancels a Trade Detection subscription for a connected brokerage account. This endpoint requires partner signature authentication only and does not require `userId` or `userSecret`.
|
|
@@ -4737,7 +4969,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4737
4969
|
* @throws {RequiredError}
|
|
4738
4970
|
*/
|
|
4739
4971
|
cancelSubscription(...args) {
|
|
4740
|
-
return localVarFp.cancelSubscription(...args).then((request) => request(axios$
|
|
4972
|
+
return localVarFp.cancelSubscription(...args).then((request) => request(axios$6, basePath));
|
|
4741
4973
|
},
|
|
4742
4974
|
/**
|
|
4743
4975
|
* Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Experimental:** this endpoint may change without notice. 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.
|
|
@@ -4747,7 +4979,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4747
4979
|
* @throws {RequiredError}
|
|
4748
4980
|
*/
|
|
4749
4981
|
getAllAccountOrders(...args) {
|
|
4750
|
-
return localVarFp.getAllAccountOrders(...args).then((request) => request(axios$
|
|
4982
|
+
return localVarFp.getAllAccountOrders(...args).then((request) => request(axios$6, basePath));
|
|
4751
4983
|
},
|
|
4752
4984
|
/**
|
|
4753
4985
|
* 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.
|
|
@@ -4757,7 +4989,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4757
4989
|
* @throws {RequiredError}
|
|
4758
4990
|
*/
|
|
4759
4991
|
getUserAccountOrderDetailV2(...args) {
|
|
4760
|
-
return localVarFp.getUserAccountOrderDetailV2(...args).then((request) => request(axios$
|
|
4992
|
+
return localVarFp.getUserAccountOrderDetailV2(...args).then((request) => request(axios$6, basePath));
|
|
4761
4993
|
},
|
|
4762
4994
|
/**
|
|
4763
4995
|
* 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.
|
|
@@ -4767,7 +4999,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4767
4999
|
* @throws {RequiredError}
|
|
4768
5000
|
*/
|
|
4769
5001
|
getUserAccountOrdersV2(...args) {
|
|
4770
|
-
return localVarFp.getUserAccountOrdersV2(...args).then((request) => request(axios$
|
|
5002
|
+
return localVarFp.getUserAccountOrdersV2(...args).then((request) => request(axios$6, basePath));
|
|
4771
5003
|
},
|
|
4772
5004
|
/**
|
|
4773
5005
|
* 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)**
|
|
@@ -4777,7 +5009,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4777
5009
|
* @throws {RequiredError}
|
|
4778
5010
|
*/
|
|
4779
5011
|
getUserAccountRecentOrdersV2(...args) {
|
|
4780
|
-
return localVarFp.getUserAccountRecentOrdersV2(...args).then((request) => request(axios$
|
|
5012
|
+
return localVarFp.getUserAccountRecentOrdersV2(...args).then((request) => request(axios$6, basePath));
|
|
4781
5013
|
},
|
|
4782
5014
|
/**
|
|
4783
5015
|
* Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|
|
@@ -4786,7 +5018,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4786
5018
|
* @throws {RequiredError}
|
|
4787
5019
|
*/
|
|
4788
5020
|
listSubscriptions(...args) {
|
|
4789
|
-
return localVarFp.listSubscriptions(...args).then((request) => request(axios$
|
|
5021
|
+
return localVarFp.listSubscriptions(...args).then((request) => request(axios$6, basePath));
|
|
4790
5022
|
},
|
|
4791
5023
|
/**
|
|
4792
5024
|
* **Beta.** Places a single-leg or multi-leg order using a common request format for equities, equity options, futures, and future options. This endpoint is experimental; breaking changes are possible during the experimental phase. Equity and equity-option orders use the existing brokerage trading capabilities. Futures are supported on tastytrade and Webull US; future options are supported only on tastytrade. Order types, time in force, optional fields, and strategy combinations remain subject to brokerage support. See the [brokerage trading support page](https://support.snaptrade.com/brokerages). An order may contain equity/option legs or future/future_option legs, but cannot mix those two families. Equity/option strategies must share the same underlying symbol. Each strategy is submitted as one brokerage order; unsupported strategies are never split into independent orders. Tastytrade supports single-leg outright futures and up to four future-option legs, and does not support multi-leg market orders. Webull US supports single-leg futures orders with buy or sell actions and positive whole-contract quantities. Supported order types are market, limit, stop, and stop_limit, with day or gtc duration. Futures options, multi-leg futures, trailing stops, and Webull Canada futures trading are not supported. Webull determines contract availability, margin requirements, and valid price increments. All string choices use lower snake_case and are case-sensitive. Symbols retain their native format: equity tickers, OCC equity-option symbols, or brokerage-native futures symbols. For tastytrade, use the exact BrokerageInstrument ticker, including any spaces. For Webull US, use a specific unprefixed futures contract symbol such as ESZ6; slash-prefixed aliases, continuous/root-only symbols, and whitespace are not accepted. A futures symbol does not need to be present in SnapTrade\'s local instrument catalog to submit an order. A successful response contains only the brokerage order ID. Use the existing order endpoints to retrieve order details.
|
|
@@ -4796,7 +5028,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4796
5028
|
* @throws {RequiredError}
|
|
4797
5029
|
*/
|
|
4798
5030
|
placeSimpleOrder(...args) {
|
|
4799
|
-
return localVarFp.placeSimpleOrder(...args).then((request) => request(axios$
|
|
5031
|
+
return localVarFp.placeSimpleOrder(...args).then((request) => request(axios$6, basePath));
|
|
4800
5032
|
}
|
|
4801
5033
|
};
|
|
4802
5034
|
};
|
|
@@ -5103,7 +5335,7 @@ const ManagementApiFp = function(configuration) {
|
|
|
5103
5335
|
* ManagementApi - factory interface
|
|
5104
5336
|
* @export
|
|
5105
5337
|
*/
|
|
5106
|
-
const ManagementApiFactory = function(configuration, basePath, axios$
|
|
5338
|
+
const ManagementApiFactory = function(configuration, basePath, axios$5) {
|
|
5107
5339
|
const localVarFp = ManagementApiFp(configuration);
|
|
5108
5340
|
return {
|
|
5109
5341
|
/**
|
|
@@ -5114,7 +5346,7 @@ const ManagementApiFactory = function(configuration, basePath, axios$4) {
|
|
|
5114
5346
|
* @throws {RequiredError}
|
|
5115
5347
|
*/
|
|
5116
5348
|
getStats(...args) {
|
|
5117
|
-
return localVarFp.getStats(...args).then((request) => request(axios$
|
|
5349
|
+
return localVarFp.getStats(...args).then((request) => request(axios$5, basePath));
|
|
5118
5350
|
},
|
|
5119
5351
|
/**
|
|
5120
5352
|
* **Deprecated.** Use `GET /management/stats` for the beta response with connected asset field names. Returns user, connection, and connected asset totals for your SnapTrade Client ID. These are the same numbers shown on the Users & Connections page of the SnapTrade Dashboard. User and connection counts are cached for up to 5 minutes. Connected asset values come from a snapshot calculated once a day; `assets_under_management_calculated_at` indicates when it was last calculated.
|
|
@@ -5125,7 +5357,7 @@ const ManagementApiFactory = function(configuration, basePath, axios$4) {
|
|
|
5125
5357
|
* @throws {RequiredError}
|
|
5126
5358
|
*/
|
|
5127
5359
|
getStatsLegacy(...args) {
|
|
5128
|
-
return localVarFp.getStatsLegacy(...args).then((request) => request(axios$
|
|
5360
|
+
return localVarFp.getStatsLegacy(...args).then((request) => request(axios$5, basePath));
|
|
5129
5361
|
}
|
|
5130
5362
|
};
|
|
5131
5363
|
};
|
|
@@ -5201,8 +5433,13 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
|
5201
5433
|
keyParamName: "clientId",
|
|
5202
5434
|
configuration
|
|
5203
5435
|
});
|
|
5436
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
5204
5437
|
const localVarOperationAuth = {
|
|
5205
|
-
authModes: [
|
|
5438
|
+
authModes: [
|
|
5439
|
+
"commercialApiKey",
|
|
5440
|
+
"personalApiKey",
|
|
5441
|
+
"oauth"
|
|
5442
|
+
],
|
|
5206
5443
|
requestSigningByAuthMode: {
|
|
5207
5444
|
"commercialApiKey": {
|
|
5208
5445
|
secretParameter: "consumerKey",
|
|
@@ -5266,8 +5503,13 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
|
5266
5503
|
keyParamName: "clientId",
|
|
5267
5504
|
configuration
|
|
5268
5505
|
});
|
|
5506
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
5269
5507
|
const localVarOperationAuth = {
|
|
5270
|
-
authModes: [
|
|
5508
|
+
authModes: [
|
|
5509
|
+
"commercialApiKey",
|
|
5510
|
+
"personalApiKey",
|
|
5511
|
+
"oauth"
|
|
5512
|
+
],
|
|
5271
5513
|
requestSigningByAuthMode: {
|
|
5272
5514
|
"commercialApiKey": {
|
|
5273
5515
|
secretParameter: "consumerKey",
|
|
@@ -5332,8 +5574,13 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
|
5332
5574
|
keyParamName: "clientId",
|
|
5333
5575
|
configuration
|
|
5334
5576
|
});
|
|
5577
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
5335
5578
|
const localVarOperationAuth = {
|
|
5336
|
-
authModes: [
|
|
5579
|
+
authModes: [
|
|
5580
|
+
"commercialApiKey",
|
|
5581
|
+
"personalApiKey",
|
|
5582
|
+
"oauth"
|
|
5583
|
+
],
|
|
5337
5584
|
requestSigningByAuthMode: {
|
|
5338
5585
|
"commercialApiKey": {
|
|
5339
5586
|
secretParameter: "consumerKey",
|
|
@@ -5402,8 +5649,13 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
|
5402
5649
|
keyParamName: "clientId",
|
|
5403
5650
|
configuration
|
|
5404
5651
|
});
|
|
5652
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
5405
5653
|
const localVarOperationAuth = {
|
|
5406
|
-
authModes: [
|
|
5654
|
+
authModes: [
|
|
5655
|
+
"commercialApiKey",
|
|
5656
|
+
"personalApiKey",
|
|
5657
|
+
"oauth"
|
|
5658
|
+
],
|
|
5407
5659
|
requestSigningByAuthMode: {
|
|
5408
5660
|
"commercialApiKey": {
|
|
5409
5661
|
secretParameter: "consumerKey",
|
|
@@ -5536,8 +5788,13 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
|
5536
5788
|
keyParamName: "clientId",
|
|
5537
5789
|
configuration
|
|
5538
5790
|
});
|
|
5791
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
5539
5792
|
const localVarOperationAuth = {
|
|
5540
|
-
authModes: [
|
|
5793
|
+
authModes: [
|
|
5794
|
+
"commercialApiKey",
|
|
5795
|
+
"personalApiKey",
|
|
5796
|
+
"oauth"
|
|
5797
|
+
],
|
|
5541
5798
|
requestSigningByAuthMode: {
|
|
5542
5799
|
"commercialApiKey": {
|
|
5543
5800
|
secretParameter: "consumerKey",
|
|
@@ -5601,8 +5858,13 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
|
5601
5858
|
keyParamName: "clientId",
|
|
5602
5859
|
configuration
|
|
5603
5860
|
});
|
|
5861
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
5604
5862
|
const localVarOperationAuth = {
|
|
5605
|
-
authModes: [
|
|
5863
|
+
authModes: [
|
|
5864
|
+
"commercialApiKey",
|
|
5865
|
+
"personalApiKey",
|
|
5866
|
+
"oauth"
|
|
5867
|
+
],
|
|
5606
5868
|
requestSigningByAuthMode: {
|
|
5607
5869
|
"commercialApiKey": {
|
|
5608
5870
|
secretParameter: "consumerKey",
|
|
@@ -5718,8 +5980,13 @@ const ReferenceDataApiAxiosParamCreator = function(configuration) {
|
|
|
5718
5980
|
keyParamName: "clientId",
|
|
5719
5981
|
configuration
|
|
5720
5982
|
});
|
|
5983
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
5721
5984
|
const localVarOperationAuth = {
|
|
5722
|
-
authModes: [
|
|
5985
|
+
authModes: [
|
|
5986
|
+
"commercialApiKey",
|
|
5987
|
+
"personalApiKey",
|
|
5988
|
+
"oauth"
|
|
5989
|
+
],
|
|
5723
5990
|
requestSigningByAuthMode: {
|
|
5724
5991
|
"commercialApiKey": {
|
|
5725
5992
|
secretParameter: "consumerKey",
|
|
@@ -5774,7 +6041,11 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5774
6041
|
async getPartnerInfo(...args) {
|
|
5775
6042
|
const [options] = args;
|
|
5776
6043
|
return createRequestFunction(await localVarAxiosParamCreator.getPartnerInfo(options), axios.default, BASE_PATH, configuration, {
|
|
5777
|
-
authModes: [
|
|
6044
|
+
authModes: [
|
|
6045
|
+
"commercialApiKey",
|
|
6046
|
+
"personalApiKey",
|
|
6047
|
+
"oauth"
|
|
6048
|
+
],
|
|
5778
6049
|
requestSigningByAuthMode: {
|
|
5779
6050
|
"commercialApiKey": {
|
|
5780
6051
|
secretParameter: "consumerKey",
|
|
@@ -5796,7 +6067,11 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5796
6067
|
async getStockExchanges(...args) {
|
|
5797
6068
|
const [options] = args;
|
|
5798
6069
|
return createRequestFunction(await localVarAxiosParamCreator.getStockExchanges(options), axios.default, BASE_PATH, configuration, {
|
|
5799
|
-
authModes: [
|
|
6070
|
+
authModes: [
|
|
6071
|
+
"commercialApiKey",
|
|
6072
|
+
"personalApiKey",
|
|
6073
|
+
"oauth"
|
|
6074
|
+
],
|
|
5800
6075
|
requestSigningByAuthMode: {
|
|
5801
6076
|
"commercialApiKey": {
|
|
5802
6077
|
secretParameter: "consumerKey",
|
|
@@ -5820,7 +6095,11 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5820
6095
|
const [requestParameters = {}, options] = args;
|
|
5821
6096
|
const symbolQuery = { substring: requestParameters.substring };
|
|
5822
6097
|
return createRequestFunction(await localVarAxiosParamCreator.getSymbols(symbolQuery, options), axios.default, BASE_PATH, configuration, {
|
|
5823
|
-
authModes: [
|
|
6098
|
+
authModes: [
|
|
6099
|
+
"commercialApiKey",
|
|
6100
|
+
"personalApiKey",
|
|
6101
|
+
"oauth"
|
|
6102
|
+
],
|
|
5824
6103
|
requestSigningByAuthMode: {
|
|
5825
6104
|
"commercialApiKey": {
|
|
5826
6105
|
secretParameter: "consumerKey",
|
|
@@ -5843,7 +6122,11 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5843
6122
|
async getSymbolsByTicker(...args) {
|
|
5844
6123
|
const [requestParameters = {}, options] = args;
|
|
5845
6124
|
return createRequestFunction(await localVarAxiosParamCreator.getSymbolsByTicker(requestParameters.query, options), axios.default, BASE_PATH, configuration, {
|
|
5846
|
-
authModes: [
|
|
6125
|
+
authModes: [
|
|
6126
|
+
"commercialApiKey",
|
|
6127
|
+
"personalApiKey",
|
|
6128
|
+
"oauth"
|
|
6129
|
+
],
|
|
5847
6130
|
requestSigningByAuthMode: {
|
|
5848
6131
|
"commercialApiKey": {
|
|
5849
6132
|
secretParameter: "consumerKey",
|
|
@@ -5889,7 +6172,11 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5889
6172
|
async listAllBrokerageInstruments(...args) {
|
|
5890
6173
|
const [requestParameters = {}, options] = args;
|
|
5891
6174
|
return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerageInstruments(requestParameters.slug, options), axios.default, BASE_PATH, configuration, {
|
|
5892
|
-
authModes: [
|
|
6175
|
+
authModes: [
|
|
6176
|
+
"commercialApiKey",
|
|
6177
|
+
"personalApiKey",
|
|
6178
|
+
"oauth"
|
|
6179
|
+
],
|
|
5893
6180
|
requestSigningByAuthMode: {
|
|
5894
6181
|
"commercialApiKey": {
|
|
5895
6182
|
secretParameter: "consumerKey",
|
|
@@ -5911,7 +6198,11 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5911
6198
|
async listAllBrokerages(...args) {
|
|
5912
6199
|
const [options] = args;
|
|
5913
6200
|
return createRequestFunction(await localVarAxiosParamCreator.listAllBrokerages(options), axios.default, BASE_PATH, configuration, {
|
|
5914
|
-
authModes: [
|
|
6201
|
+
authModes: [
|
|
6202
|
+
"commercialApiKey",
|
|
6203
|
+
"personalApiKey",
|
|
6204
|
+
"oauth"
|
|
6205
|
+
],
|
|
5915
6206
|
requestSigningByAuthMode: {
|
|
5916
6207
|
"commercialApiKey": {
|
|
5917
6208
|
secretParameter: "consumerKey",
|
|
@@ -5944,7 +6235,11 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5944
6235
|
const [requestParameters = {}, options] = args;
|
|
5945
6236
|
const symbolQuery = { substring: requestParameters.substring };
|
|
5946
6237
|
return createRequestFunction(await localVarAxiosParamCreator.symbolSearchUserAccount(requestParameters.accountId, symbolQuery, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
5947
|
-
authModes: [
|
|
6238
|
+
authModes: [
|
|
6239
|
+
"commercialApiKey",
|
|
6240
|
+
"personalApiKey",
|
|
6241
|
+
"oauth"
|
|
6242
|
+
],
|
|
5948
6243
|
requestSigningByAuthMode: {
|
|
5949
6244
|
"commercialApiKey": {
|
|
5950
6245
|
secretParameter: "consumerKey",
|
|
@@ -5963,7 +6258,7 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
5963
6258
|
* ReferenceDataApi - factory interface
|
|
5964
6259
|
* @export
|
|
5965
6260
|
*/
|
|
5966
|
-
const ReferenceDataApiFactory = function(configuration, basePath, axios$
|
|
6261
|
+
const ReferenceDataApiFactory = function(configuration, basePath, axios$4) {
|
|
5967
6262
|
const localVarFp = ReferenceDataApiFp(configuration);
|
|
5968
6263
|
return {
|
|
5969
6264
|
/**
|
|
@@ -5973,7 +6268,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
|
5973
6268
|
* @throws {RequiredError}
|
|
5974
6269
|
*/
|
|
5975
6270
|
getPartnerInfo(...args) {
|
|
5976
|
-
return localVarFp.getPartnerInfo(...args).then((request) => request(axios$
|
|
6271
|
+
return localVarFp.getPartnerInfo(...args).then((request) => request(axios$4, basePath));
|
|
5977
6272
|
},
|
|
5978
6273
|
/**
|
|
5979
6274
|
* Returns a list of all supported Exchanges.
|
|
@@ -5982,7 +6277,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
|
5982
6277
|
* @throws {RequiredError}
|
|
5983
6278
|
*/
|
|
5984
6279
|
getStockExchanges(...args) {
|
|
5985
|
-
return localVarFp.getStockExchanges(...args).then((request) => request(axios$
|
|
6280
|
+
return localVarFp.getStockExchanges(...args).then((request) => request(axios$4, basePath));
|
|
5986
6281
|
},
|
|
5987
6282
|
/**
|
|
5988
6283
|
* 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.
|
|
@@ -5992,7 +6287,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
|
5992
6287
|
* @throws {RequiredError}
|
|
5993
6288
|
*/
|
|
5994
6289
|
getSymbols(...args) {
|
|
5995
|
-
return localVarFp.getSymbols(...args).then((request) => request(axios$
|
|
6290
|
+
return localVarFp.getSymbols(...args).then((request) => request(axios$4, basePath));
|
|
5996
6291
|
},
|
|
5997
6292
|
/**
|
|
5998
6293
|
* 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. Share classes and preferred series use SnapTrade\'s canonical dotted form: use `HBND.U.TO` (not Yahoo\'s `HBND-U.TO`), `FTN.PR.A.TO` (not `FTN-PA.TO`), and `ECF.PRA` (not `ECF-P-A`). Please use the ticker with the proper suffix and canonical share-class notation for the best results.
|
|
@@ -6002,7 +6297,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
|
6002
6297
|
* @throws {RequiredError}
|
|
6003
6298
|
*/
|
|
6004
6299
|
getSymbolsByTicker(...args) {
|
|
6005
|
-
return localVarFp.getSymbolsByTicker(...args).then((request) => request(axios$
|
|
6300
|
+
return localVarFp.getSymbolsByTicker(...args).then((request) => request(axios$4, basePath));
|
|
6006
6301
|
},
|
|
6007
6302
|
/**
|
|
6008
6303
|
* Returns a list of all defined Brokerage authorization Type objects.
|
|
@@ -6012,7 +6307,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
|
6012
6307
|
* @throws {RequiredError}
|
|
6013
6308
|
*/
|
|
6014
6309
|
listAllBrokerageAuthorizationType(...args) {
|
|
6015
|
-
return localVarFp.listAllBrokerageAuthorizationType(...args).then((request) => request(axios$
|
|
6310
|
+
return localVarFp.listAllBrokerageAuthorizationType(...args).then((request) => request(axios$4, basePath));
|
|
6016
6311
|
},
|
|
6017
6312
|
/**
|
|
6018
6313
|
* 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.
|
|
@@ -6022,7 +6317,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
|
6022
6317
|
* @throws {RequiredError}
|
|
6023
6318
|
*/
|
|
6024
6319
|
listAllBrokerageInstruments(...args) {
|
|
6025
|
-
return localVarFp.listAllBrokerageInstruments(...args).then((request) => request(axios$
|
|
6320
|
+
return localVarFp.listAllBrokerageInstruments(...args).then((request) => request(axios$4, basePath));
|
|
6026
6321
|
},
|
|
6027
6322
|
/**
|
|
6028
6323
|
* Returns a list of all defined Brokerage objects.
|
|
@@ -6031,7 +6326,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
|
6031
6326
|
* @throws {RequiredError}
|
|
6032
6327
|
*/
|
|
6033
6328
|
listAllBrokerages(...args) {
|
|
6034
|
-
return localVarFp.listAllBrokerages(...args).then((request) => request(axios$
|
|
6329
|
+
return localVarFp.listAllBrokerages(...args).then((request) => request(axios$4, basePath));
|
|
6035
6330
|
},
|
|
6036
6331
|
/**
|
|
6037
6332
|
* Returns the public catalog of institutions SnapTrade supports and what each one supports. The response is the same for every caller and needs no authentication. To list the brokerages a specific Client ID can connect to right now, use `GET /brokerages` instead. A `null` field means the information is not documented yet, never that the institution lacks it. New fields and new enum values may be added over time, so ignore any you don\'t recognize.
|
|
@@ -6040,7 +6335,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
|
6040
6335
|
* @throws {RequiredError}
|
|
6041
6336
|
*/
|
|
6042
6337
|
listInstitutions(options) {
|
|
6043
|
-
return localVarFp.listInstitutions(options).then((request) => request(axios$
|
|
6338
|
+
return localVarFp.listInstitutions(options).then((request) => request(axios$4, basePath));
|
|
6044
6339
|
},
|
|
6045
6340
|
/**
|
|
6046
6341
|
* 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.
|
|
@@ -6050,7 +6345,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
|
6050
6345
|
* @throws {RequiredError}
|
|
6051
6346
|
*/
|
|
6052
6347
|
symbolSearchUserAccount(...args) {
|
|
6053
|
-
return localVarFp.symbolSearchUserAccount(...args).then((request) => request(axios$
|
|
6348
|
+
return localVarFp.symbolSearchUserAccount(...args).then((request) => request(axios$4, basePath));
|
|
6054
6349
|
}
|
|
6055
6350
|
};
|
|
6056
6351
|
};
|
|
@@ -6208,8 +6503,13 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
6208
6503
|
keyParamName: "clientId",
|
|
6209
6504
|
configuration
|
|
6210
6505
|
});
|
|
6506
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
6211
6507
|
const localVarOperationAuth = {
|
|
6212
|
-
authModes: [
|
|
6508
|
+
authModes: [
|
|
6509
|
+
"commercialApiKey",
|
|
6510
|
+
"personalApiKey",
|
|
6511
|
+
"oauth"
|
|
6512
|
+
],
|
|
6213
6513
|
requestSigningByAuthMode: {
|
|
6214
6514
|
"commercialApiKey": {
|
|
6215
6515
|
secretParameter: "consumerKey",
|
|
@@ -6286,8 +6586,13 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
6286
6586
|
keyParamName: "clientId",
|
|
6287
6587
|
configuration
|
|
6288
6588
|
});
|
|
6589
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
6289
6590
|
const localVarOperationAuth = {
|
|
6290
|
-
authModes: [
|
|
6591
|
+
authModes: [
|
|
6592
|
+
"commercialApiKey",
|
|
6593
|
+
"personalApiKey",
|
|
6594
|
+
"oauth"
|
|
6595
|
+
],
|
|
6291
6596
|
requestSigningByAuthMode: {
|
|
6292
6597
|
"commercialApiKey": {
|
|
6293
6598
|
secretParameter: "consumerKey",
|
|
@@ -6361,8 +6666,13 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
6361
6666
|
keyParamName: "clientId",
|
|
6362
6667
|
configuration
|
|
6363
6668
|
});
|
|
6669
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
6364
6670
|
const localVarOperationAuth = {
|
|
6365
|
-
authModes: [
|
|
6671
|
+
authModes: [
|
|
6672
|
+
"commercialApiKey",
|
|
6673
|
+
"personalApiKey",
|
|
6674
|
+
"oauth"
|
|
6675
|
+
],
|
|
6366
6676
|
requestSigningByAuthMode: {
|
|
6367
6677
|
"commercialApiKey": {
|
|
6368
6678
|
secretParameter: "consumerKey",
|
|
@@ -6437,8 +6747,13 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
6437
6747
|
keyParamName: "clientId",
|
|
6438
6748
|
configuration
|
|
6439
6749
|
});
|
|
6750
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
6440
6751
|
const localVarOperationAuth = {
|
|
6441
|
-
authModes: [
|
|
6752
|
+
authModes: [
|
|
6753
|
+
"commercialApiKey",
|
|
6754
|
+
"personalApiKey",
|
|
6755
|
+
"oauth"
|
|
6756
|
+
],
|
|
6442
6757
|
requestSigningByAuthMode: {
|
|
6443
6758
|
"commercialApiKey": {
|
|
6444
6759
|
secretParameter: "consumerKey",
|
|
@@ -6593,10 +6908,15 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
6593
6908
|
keyParamName: "clientId",
|
|
6594
6909
|
configuration
|
|
6595
6910
|
});
|
|
6911
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
6596
6912
|
if (symbols !== void 0) localVarQueryParameter["symbols"] = symbols;
|
|
6597
6913
|
if (useTicker !== void 0) localVarQueryParameter["use_ticker"] = useTicker;
|
|
6598
6914
|
const localVarOperationAuth = {
|
|
6599
|
-
authModes: [
|
|
6915
|
+
authModes: [
|
|
6916
|
+
"commercialApiKey",
|
|
6917
|
+
"personalApiKey",
|
|
6918
|
+
"oauth"
|
|
6919
|
+
],
|
|
6600
6920
|
requestSigningByAuthMode: {
|
|
6601
6921
|
"commercialApiKey": {
|
|
6602
6922
|
secretParameter: "consumerKey",
|
|
@@ -6670,8 +6990,13 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
6670
6990
|
keyParamName: "clientId",
|
|
6671
6991
|
configuration
|
|
6672
6992
|
});
|
|
6993
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
6673
6994
|
const localVarOperationAuth = {
|
|
6674
|
-
authModes: [
|
|
6995
|
+
authModes: [
|
|
6996
|
+
"commercialApiKey",
|
|
6997
|
+
"personalApiKey",
|
|
6998
|
+
"oauth"
|
|
6999
|
+
],
|
|
6675
7000
|
requestSigningByAuthMode: {
|
|
6676
7001
|
"commercialApiKey": {
|
|
6677
7002
|
secretParameter: "consumerKey",
|
|
@@ -6748,8 +7073,13 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
6748
7073
|
keyParamName: "clientId",
|
|
6749
7074
|
configuration
|
|
6750
7075
|
});
|
|
7076
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
6751
7077
|
const localVarOperationAuth = {
|
|
6752
|
-
authModes: [
|
|
7078
|
+
authModes: [
|
|
7079
|
+
"commercialApiKey",
|
|
7080
|
+
"personalApiKey",
|
|
7081
|
+
"oauth"
|
|
7082
|
+
],
|
|
6753
7083
|
requestSigningByAuthMode: {
|
|
6754
7084
|
"commercialApiKey": {
|
|
6755
7085
|
secretParameter: "consumerKey",
|
|
@@ -6824,8 +7154,13 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
6824
7154
|
keyParamName: "clientId",
|
|
6825
7155
|
configuration
|
|
6826
7156
|
});
|
|
7157
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
6827
7158
|
const localVarOperationAuth = {
|
|
6828
|
-
authModes: [
|
|
7159
|
+
authModes: [
|
|
7160
|
+
"commercialApiKey",
|
|
7161
|
+
"personalApiKey",
|
|
7162
|
+
"oauth"
|
|
7163
|
+
],
|
|
6829
7164
|
requestSigningByAuthMode: {
|
|
6830
7165
|
"commercialApiKey": {
|
|
6831
7166
|
secretParameter: "consumerKey",
|
|
@@ -6902,8 +7237,13 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
6902
7237
|
keyParamName: "clientId",
|
|
6903
7238
|
configuration
|
|
6904
7239
|
});
|
|
7240
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
6905
7241
|
const localVarOperationAuth = {
|
|
6906
|
-
authModes: [
|
|
7242
|
+
authModes: [
|
|
7243
|
+
"commercialApiKey",
|
|
7244
|
+
"personalApiKey",
|
|
7245
|
+
"oauth"
|
|
7246
|
+
],
|
|
6907
7247
|
requestSigningByAuthMode: {
|
|
6908
7248
|
"commercialApiKey": {
|
|
6909
7249
|
secretParameter: "consumerKey",
|
|
@@ -6979,8 +7319,13 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
6979
7319
|
keyParamName: "clientId",
|
|
6980
7320
|
configuration
|
|
6981
7321
|
});
|
|
7322
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
6982
7323
|
const localVarOperationAuth = {
|
|
6983
|
-
authModes: [
|
|
7324
|
+
authModes: [
|
|
7325
|
+
"commercialApiKey",
|
|
7326
|
+
"personalApiKey",
|
|
7327
|
+
"oauth"
|
|
7328
|
+
],
|
|
6984
7329
|
requestSigningByAuthMode: {
|
|
6985
7330
|
"commercialApiKey": {
|
|
6986
7331
|
secretParameter: "consumerKey",
|
|
@@ -7057,8 +7402,13 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
7057
7402
|
keyParamName: "clientId",
|
|
7058
7403
|
configuration
|
|
7059
7404
|
});
|
|
7405
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
7060
7406
|
const localVarOperationAuth = {
|
|
7061
|
-
authModes: [
|
|
7407
|
+
authModes: [
|
|
7408
|
+
"commercialApiKey",
|
|
7409
|
+
"personalApiKey",
|
|
7410
|
+
"oauth"
|
|
7411
|
+
],
|
|
7062
7412
|
requestSigningByAuthMode: {
|
|
7063
7413
|
"commercialApiKey": {
|
|
7064
7414
|
secretParameter: "consumerKey",
|
|
@@ -7135,8 +7485,13 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
7135
7485
|
keyParamName: "clientId",
|
|
7136
7486
|
configuration
|
|
7137
7487
|
});
|
|
7488
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
7138
7489
|
const localVarOperationAuth = {
|
|
7139
|
-
authModes: [
|
|
7490
|
+
authModes: [
|
|
7491
|
+
"commercialApiKey",
|
|
7492
|
+
"personalApiKey",
|
|
7493
|
+
"oauth"
|
|
7494
|
+
],
|
|
7140
7495
|
requestSigningByAuthMode: {
|
|
7141
7496
|
"commercialApiKey": {
|
|
7142
7497
|
secretParameter: "consumerKey",
|
|
@@ -7213,10 +7568,15 @@ const TradingApiAxiosParamCreator = function(configuration) {
|
|
|
7213
7568
|
keyParamName: "clientId",
|
|
7214
7569
|
configuration
|
|
7215
7570
|
});
|
|
7571
|
+
if (configuration?.authMode === "oauth") await setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
7216
7572
|
if (base !== void 0) localVarQueryParameter["base"] = base;
|
|
7217
7573
|
if (quote !== void 0) localVarQueryParameter["quote"] = quote;
|
|
7218
7574
|
const localVarOperationAuth = {
|
|
7219
|
-
authModes: [
|
|
7575
|
+
authModes: [
|
|
7576
|
+
"commercialApiKey",
|
|
7577
|
+
"personalApiKey",
|
|
7578
|
+
"oauth"
|
|
7579
|
+
],
|
|
7220
7580
|
requestSigningByAuthMode: {
|
|
7221
7581
|
"commercialApiKey": {
|
|
7222
7582
|
secretParameter: "consumerKey",
|
|
@@ -7270,7 +7630,11 @@ const TradingApiFp = function(configuration) {
|
|
|
7270
7630
|
const [requestParameters = {}, options] = args;
|
|
7271
7631
|
const accountInformationGetUserAccountOrderDetailRequest = { brokerage_order_id: requestParameters.brokerage_order_id };
|
|
7272
7632
|
return createRequestFunction(await localVarAxiosParamCreator.cancelOrder(requestParameters.accountId, accountInformationGetUserAccountOrderDetailRequest, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
7273
|
-
authModes: [
|
|
7633
|
+
authModes: [
|
|
7634
|
+
"commercialApiKey",
|
|
7635
|
+
"personalApiKey",
|
|
7636
|
+
"oauth"
|
|
7637
|
+
],
|
|
7274
7638
|
requestSigningByAuthMode: {
|
|
7275
7639
|
"commercialApiKey": {
|
|
7276
7640
|
secretParameter: "consumerKey",
|
|
@@ -7293,7 +7657,11 @@ const TradingApiFp = function(configuration) {
|
|
|
7293
7657
|
async getCryptocurrencyPairQuote(...args) {
|
|
7294
7658
|
const [requestParameters = {}, options] = args;
|
|
7295
7659
|
return createRequestFunction(await localVarAxiosParamCreator.getCryptocurrencyPairQuote(requestParameters.accountId, requestParameters.instrumentSymbol, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
7296
|
-
authModes: [
|
|
7660
|
+
authModes: [
|
|
7661
|
+
"commercialApiKey",
|
|
7662
|
+
"personalApiKey",
|
|
7663
|
+
"oauth"
|
|
7664
|
+
],
|
|
7297
7665
|
requestSigningByAuthMode: {
|
|
7298
7666
|
"commercialApiKey": {
|
|
7299
7667
|
secretParameter: "consumerKey",
|
|
@@ -7324,7 +7692,11 @@ const TradingApiFp = function(configuration) {
|
|
|
7324
7692
|
legs: requestParameters.legs
|
|
7325
7693
|
};
|
|
7326
7694
|
return createRequestFunction(await localVarAxiosParamCreator.getOptionImpact(requestParameters.accountId, mlegTradeForm, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
7327
|
-
authModes: [
|
|
7695
|
+
authModes: [
|
|
7696
|
+
"commercialApiKey",
|
|
7697
|
+
"personalApiKey",
|
|
7698
|
+
"oauth"
|
|
7699
|
+
],
|
|
7328
7700
|
requestSigningByAuthMode: {
|
|
7329
7701
|
"commercialApiKey": {
|
|
7330
7702
|
secretParameter: "consumerKey",
|
|
@@ -7358,7 +7730,11 @@ const TradingApiFp = function(configuration) {
|
|
|
7358
7730
|
notional_value: requestParameters.notional_value
|
|
7359
7731
|
};
|
|
7360
7732
|
return createRequestFunction(await localVarAxiosParamCreator.getOrderImpact(manualTradeForm, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
7361
|
-
authModes: [
|
|
7733
|
+
authModes: [
|
|
7734
|
+
"commercialApiKey",
|
|
7735
|
+
"personalApiKey",
|
|
7736
|
+
"oauth"
|
|
7737
|
+
],
|
|
7362
7738
|
requestSigningByAuthMode: {
|
|
7363
7739
|
"commercialApiKey": {
|
|
7364
7740
|
secretParameter: "consumerKey",
|
|
@@ -7405,7 +7781,11 @@ const TradingApiFp = function(configuration) {
|
|
|
7405
7781
|
async getUserAccountQuotes(...args) {
|
|
7406
7782
|
const [requestParameters = {}, options] = args;
|
|
7407
7783
|
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountQuotes(requestParameters.symbols, requestParameters.accountId, requestParameters.useTicker, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
7408
|
-
authModes: [
|
|
7784
|
+
authModes: [
|
|
7785
|
+
"commercialApiKey",
|
|
7786
|
+
"personalApiKey",
|
|
7787
|
+
"oauth"
|
|
7788
|
+
],
|
|
7409
7789
|
requestSigningByAuthMode: {
|
|
7410
7790
|
"commercialApiKey": {
|
|
7411
7791
|
secretParameter: "consumerKey",
|
|
@@ -7433,7 +7813,11 @@ const TradingApiFp = function(configuration) {
|
|
|
7433
7813
|
client_order_id: requestParameters.client_order_id
|
|
7434
7814
|
};
|
|
7435
7815
|
return createRequestFunction(await localVarAxiosParamCreator.placeComplexOrder(requestParameters.accountId, manualTradeFormComplex, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
7436
|
-
authModes: [
|
|
7816
|
+
authModes: [
|
|
7817
|
+
"commercialApiKey",
|
|
7818
|
+
"personalApiKey",
|
|
7819
|
+
"oauth"
|
|
7820
|
+
],
|
|
7437
7821
|
requestSigningByAuthMode: {
|
|
7438
7822
|
"commercialApiKey": {
|
|
7439
7823
|
secretParameter: "consumerKey",
|
|
@@ -7467,7 +7851,11 @@ const TradingApiFp = function(configuration) {
|
|
|
7467
7851
|
expiration_date: requestParameters.expiration_date
|
|
7468
7852
|
};
|
|
7469
7853
|
return createRequestFunction(await localVarAxiosParamCreator.placeCryptoOrder(requestParameters.accountId, cryptoOrderForm, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
7470
|
-
authModes: [
|
|
7854
|
+
authModes: [
|
|
7855
|
+
"commercialApiKey",
|
|
7856
|
+
"personalApiKey",
|
|
7857
|
+
"oauth"
|
|
7858
|
+
],
|
|
7471
7859
|
requestSigningByAuthMode: {
|
|
7472
7860
|
"commercialApiKey": {
|
|
7473
7861
|
secretParameter: "consumerKey",
|
|
@@ -7505,7 +7893,11 @@ const TradingApiFp = function(configuration) {
|
|
|
7505
7893
|
client_order_id: requestParameters.client_order_id
|
|
7506
7894
|
};
|
|
7507
7895
|
return createRequestFunction(await localVarAxiosParamCreator.placeForceOrder(manualTradeFormWithOptions, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
7508
|
-
authModes: [
|
|
7896
|
+
authModes: [
|
|
7897
|
+
"commercialApiKey",
|
|
7898
|
+
"personalApiKey",
|
|
7899
|
+
"oauth"
|
|
7900
|
+
],
|
|
7509
7901
|
requestSigningByAuthMode: {
|
|
7510
7902
|
"commercialApiKey": {
|
|
7511
7903
|
secretParameter: "consumerKey",
|
|
@@ -7536,7 +7928,11 @@ const TradingApiFp = function(configuration) {
|
|
|
7536
7928
|
legs: requestParameters.legs
|
|
7537
7929
|
};
|
|
7538
7930
|
return createRequestFunction(await localVarAxiosParamCreator.placeMlegOrder(requestParameters.accountId, mlegTradeForm, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
7539
|
-
authModes: [
|
|
7931
|
+
authModes: [
|
|
7932
|
+
"commercialApiKey",
|
|
7933
|
+
"personalApiKey",
|
|
7934
|
+
"oauth"
|
|
7935
|
+
],
|
|
7540
7936
|
requestSigningByAuthMode: {
|
|
7541
7937
|
"commercialApiKey": {
|
|
7542
7938
|
secretParameter: "consumerKey",
|
|
@@ -7560,7 +7956,11 @@ const TradingApiFp = function(configuration) {
|
|
|
7560
7956
|
const [requestParameters = {}, options] = args;
|
|
7561
7957
|
const validatedTradeBody = { wait_to_confirm: requestParameters.wait_to_confirm };
|
|
7562
7958
|
return createRequestFunction(await localVarAxiosParamCreator.placeOrder(requestParameters.tradeId, validatedTradeBody, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
7563
|
-
authModes: [
|
|
7959
|
+
authModes: [
|
|
7960
|
+
"commercialApiKey",
|
|
7961
|
+
"personalApiKey",
|
|
7962
|
+
"oauth"
|
|
7963
|
+
],
|
|
7564
7964
|
requestSigningByAuthMode: {
|
|
7565
7965
|
"commercialApiKey": {
|
|
7566
7966
|
secretParameter: "consumerKey",
|
|
@@ -7594,7 +7994,11 @@ const TradingApiFp = function(configuration) {
|
|
|
7594
7994
|
expiration_date: requestParameters.expiration_date
|
|
7595
7995
|
};
|
|
7596
7996
|
return createRequestFunction(await localVarAxiosParamCreator.previewCryptoOrder(requestParameters.accountId, cryptoOrderForm, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
7597
|
-
authModes: [
|
|
7997
|
+
authModes: [
|
|
7998
|
+
"commercialApiKey",
|
|
7999
|
+
"personalApiKey",
|
|
8000
|
+
"oauth"
|
|
8001
|
+
],
|
|
7598
8002
|
requestSigningByAuthMode: {
|
|
7599
8003
|
"commercialApiKey": {
|
|
7600
8004
|
secretParameter: "consumerKey",
|
|
@@ -7627,7 +8031,11 @@ const TradingApiFp = function(configuration) {
|
|
|
7627
8031
|
units: requestParameters.units
|
|
7628
8032
|
};
|
|
7629
8033
|
return createRequestFunction(await localVarAxiosParamCreator.replaceOrder(requestParameters.accountId, manualTradeReplaceForm, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
7630
|
-
authModes: [
|
|
8034
|
+
authModes: [
|
|
8035
|
+
"commercialApiKey",
|
|
8036
|
+
"personalApiKey",
|
|
8037
|
+
"oauth"
|
|
8038
|
+
],
|
|
7631
8039
|
requestSigningByAuthMode: {
|
|
7632
8040
|
"commercialApiKey": {
|
|
7633
8041
|
secretParameter: "consumerKey",
|
|
@@ -7650,7 +8058,11 @@ const TradingApiFp = function(configuration) {
|
|
|
7650
8058
|
async searchCryptocurrencyPairInstruments(...args) {
|
|
7651
8059
|
const [requestParameters = {}, options] = args;
|
|
7652
8060
|
return createRequestFunction(await localVarAxiosParamCreator.searchCryptocurrencyPairInstruments(requestParameters.accountId, requestParameters.base, requestParameters.quote, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
7653
|
-
authModes: [
|
|
8061
|
+
authModes: [
|
|
8062
|
+
"commercialApiKey",
|
|
8063
|
+
"personalApiKey",
|
|
8064
|
+
"oauth"
|
|
8065
|
+
],
|
|
7654
8066
|
requestSigningByAuthMode: {
|
|
7655
8067
|
"commercialApiKey": {
|
|
7656
8068
|
secretParameter: "consumerKey",
|
|
@@ -7669,7 +8081,7 @@ const TradingApiFp = function(configuration) {
|
|
|
7669
8081
|
* TradingApi - factory interface
|
|
7670
8082
|
* @export
|
|
7671
8083
|
*/
|
|
7672
|
-
const TradingApiFactory = function(configuration, basePath, axios$
|
|
8084
|
+
const TradingApiFactory = function(configuration, basePath, axios$3) {
|
|
7673
8085
|
const localVarFp = TradingApiFp(configuration);
|
|
7674
8086
|
return {
|
|
7675
8087
|
/**
|
|
@@ -7680,7 +8092,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7680
8092
|
* @throws {RequiredError}
|
|
7681
8093
|
*/
|
|
7682
8094
|
cancelOrder(...args) {
|
|
7683
|
-
return localVarFp.cancelOrder(...args).then((request) => request(axios$
|
|
8095
|
+
return localVarFp.cancelOrder(...args).then((request) => request(axios$3, basePath));
|
|
7684
8096
|
},
|
|
7685
8097
|
/**
|
|
7686
8098
|
* Gets a quote for the specified account.
|
|
@@ -7690,7 +8102,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7690
8102
|
* @throws {RequiredError}
|
|
7691
8103
|
*/
|
|
7692
8104
|
getCryptocurrencyPairQuote(...args) {
|
|
7693
|
-
return localVarFp.getCryptocurrencyPairQuote(...args).then((request) => request(axios$
|
|
8105
|
+
return localVarFp.getCryptocurrencyPairQuote(...args).then((request) => request(axios$3, basePath));
|
|
7694
8106
|
},
|
|
7695
8107
|
/**
|
|
7696
8108
|
* 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.
|
|
@@ -7700,7 +8112,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7700
8112
|
* @throws {RequiredError}
|
|
7701
8113
|
*/
|
|
7702
8114
|
getOptionImpact(...args) {
|
|
7703
|
-
return localVarFp.getOptionImpact(...args).then((request) => request(axios$
|
|
8115
|
+
return localVarFp.getOptionImpact(...args).then((request) => request(axios$3, basePath));
|
|
7704
8116
|
},
|
|
7705
8117
|
/**
|
|
7706
8118
|
* 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.
|
|
@@ -7710,7 +8122,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7710
8122
|
* @throws {RequiredError}
|
|
7711
8123
|
*/
|
|
7712
8124
|
getOrderImpact(...args) {
|
|
7713
|
-
return localVarFp.getOrderImpact(...args).then((request) => request(axios$
|
|
8125
|
+
return localVarFp.getOrderImpact(...args).then((request) => request(axios$3, basePath));
|
|
7714
8126
|
},
|
|
7715
8127
|
/**
|
|
7716
8128
|
* **Deprecated.** This endpoint was sunset on October 1, 2026 and now always returns `410 Gone`. 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.
|
|
@@ -7721,7 +8133,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7721
8133
|
* @throws {RequiredError}
|
|
7722
8134
|
*/
|
|
7723
8135
|
getUserAccountOptionQuotes(...args) {
|
|
7724
|
-
return localVarFp.getUserAccountOptionQuotes(...args).then((request) => request(axios$
|
|
8136
|
+
return localVarFp.getUserAccountOptionQuotes(...args).then((request) => request(axios$3, basePath));
|
|
7725
8137
|
},
|
|
7726
8138
|
/**
|
|
7727
8139
|
* 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.
|
|
@@ -7731,7 +8143,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7731
8143
|
* @throws {RequiredError}
|
|
7732
8144
|
*/
|
|
7733
8145
|
getUserAccountQuotes(...args) {
|
|
7734
|
-
return localVarFp.getUserAccountQuotes(...args).then((request) => request(axios$
|
|
8146
|
+
return localVarFp.getUserAccountQuotes(...args).then((request) => request(axios$3, basePath));
|
|
7735
8147
|
},
|
|
7736
8148
|
/**
|
|
7737
8149
|
* 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. Option OCO peers must trade the same OCC option symbol with the same closing action and positive whole-contract quantity. On tastytrade, option OCO supports closing an existing long or short option position with one `Limit` order and one `Stop` or `StopLimit` order. Both `PEER` orders must use `SELL_TO_CLOSE` or both must use `BUY_TO_CLOSE`, with `Day` or `GTC` time in force. Opening option OCOs are not supported. On enabled Webull US v3 accounts, option OCO supports closing an existing long option position with one `Limit` take-profit order and one `Stop` stop-loss order. Both `PEER` orders must use `SELL_TO_CLOSE`, `Day`, the same OCC option symbol, and the same positive whole-contract quantity. Webull receives these as `STOP_PROFIT` and `STOP_LOSS` orders sharing a combo ID, without a MASTER order. Opening option OCOs, `BUY_TO_CLOSE`, `StopLimit`, and other option order pairs are not supported on Webull. Equity complex-order behavior is unchanged.
|
|
@@ -7741,7 +8153,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7741
8153
|
* @throws {RequiredError}
|
|
7742
8154
|
*/
|
|
7743
8155
|
placeComplexOrder(...args) {
|
|
7744
|
-
return localVarFp.placeComplexOrder(...args).then((request) => request(axios$
|
|
8156
|
+
return localVarFp.placeComplexOrder(...args).then((request) => request(axios$3, basePath));
|
|
7745
8157
|
},
|
|
7746
8158
|
/**
|
|
7747
8159
|
* 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.
|
|
@@ -7751,7 +8163,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7751
8163
|
* @throws {RequiredError}
|
|
7752
8164
|
*/
|
|
7753
8165
|
placeCryptoOrder(...args) {
|
|
7754
|
-
return localVarFp.placeCryptoOrder(...args).then((request) => request(axios$
|
|
8166
|
+
return localVarFp.placeCryptoOrder(...args).then((request) => request(axios$3, basePath));
|
|
7755
8167
|
},
|
|
7756
8168
|
/**
|
|
7757
8169
|
* 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.
|
|
@@ -7761,7 +8173,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7761
8173
|
* @throws {RequiredError}
|
|
7762
8174
|
*/
|
|
7763
8175
|
placeForceOrder(...args) {
|
|
7764
|
-
return localVarFp.placeForceOrder(...args).then((request) => request(axios$
|
|
8176
|
+
return localVarFp.placeForceOrder(...args).then((request) => request(axios$3, basePath));
|
|
7765
8177
|
},
|
|
7766
8178
|
/**
|
|
7767
8179
|
* Places a multi-leg option order. Only supported on certain option trading brokerages. https://support.snaptrade.com/brokerages has information on brokerage trading support
|
|
@@ -7771,7 +8183,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7771
8183
|
* @throws {RequiredError}
|
|
7772
8184
|
*/
|
|
7773
8185
|
placeMlegOrder(...args) {
|
|
7774
|
-
return localVarFp.placeMlegOrder(...args).then((request) => request(axios$
|
|
8186
|
+
return localVarFp.placeMlegOrder(...args).then((request) => request(axios$3, basePath));
|
|
7775
8187
|
},
|
|
7776
8188
|
/**
|
|
7777
8189
|
* 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.
|
|
@@ -7781,7 +8193,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7781
8193
|
* @throws {RequiredError}
|
|
7782
8194
|
*/
|
|
7783
8195
|
placeOrder(...args) {
|
|
7784
|
-
return localVarFp.placeOrder(...args).then((request) => request(axios$
|
|
8196
|
+
return localVarFp.placeOrder(...args).then((request) => request(axios$3, basePath));
|
|
7785
8197
|
},
|
|
7786
8198
|
/**
|
|
7787
8199
|
* Previews an order using the specified account.
|
|
@@ -7791,7 +8203,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7791
8203
|
* @throws {RequiredError}
|
|
7792
8204
|
*/
|
|
7793
8205
|
previewCryptoOrder(...args) {
|
|
7794
|
-
return localVarFp.previewCryptoOrder(...args).then((request) => request(axios$
|
|
8206
|
+
return localVarFp.previewCryptoOrder(...args).then((request) => request(axios$3, basePath));
|
|
7795
8207
|
},
|
|
7796
8208
|
/**
|
|
7797
8209
|
* 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
|
|
@@ -7801,7 +8213,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7801
8213
|
* @throws {RequiredError}
|
|
7802
8214
|
*/
|
|
7803
8215
|
replaceOrder(...args) {
|
|
7804
|
-
return localVarFp.replaceOrder(...args).then((request) => request(axios$
|
|
8216
|
+
return localVarFp.replaceOrder(...args).then((request) => request(axios$3, basePath));
|
|
7805
8217
|
},
|
|
7806
8218
|
/**
|
|
7807
8219
|
* Searches cryptocurrency pairs instruments accessible to the specified account. Both `base` and `quote` are optional. Omit both for a full list of cryptocurrency pairs.
|
|
@@ -7811,7 +8223,7 @@ const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
|
7811
8223
|
* @throws {RequiredError}
|
|
7812
8224
|
*/
|
|
7813
8225
|
searchCryptocurrencyPairInstruments(...args) {
|
|
7814
|
-
return localVarFp.searchCryptocurrencyPairInstruments(...args).then((request) => request(axios$
|
|
8226
|
+
return localVarFp.searchCryptocurrencyPairInstruments(...args).then((request) => request(axios$3, basePath));
|
|
7815
8227
|
}
|
|
7816
8228
|
};
|
|
7817
8229
|
};
|
|
@@ -8003,6 +8415,15 @@ var PersonalApiKeyAuth = class PersonalApiKeyAuth {
|
|
|
8003
8415
|
return new PersonalApiKeyAuth(params);
|
|
8004
8416
|
}
|
|
8005
8417
|
};
|
|
8418
|
+
var OAuthAuth = class OAuthAuth {
|
|
8419
|
+
constructor(params) {
|
|
8420
|
+
this.mode = "oauth";
|
|
8421
|
+
this.accessToken = params.accessToken;
|
|
8422
|
+
}
|
|
8423
|
+
static create(params) {
|
|
8424
|
+
return new OAuthAuth(params);
|
|
8425
|
+
}
|
|
8426
|
+
};
|
|
8006
8427
|
var SnaptradeAuth = class {
|
|
8007
8428
|
constructor() {}
|
|
8008
8429
|
static ["commercialApiKey"](params) {
|
|
@@ -8011,6 +8432,9 @@ var SnaptradeAuth = class {
|
|
|
8011
8432
|
static ["personalApiKey"](params) {
|
|
8012
8433
|
return PersonalApiKeyAuth.create(params);
|
|
8013
8434
|
}
|
|
8435
|
+
static ["oauth"](params) {
|
|
8436
|
+
return OAuthAuth.create(params);
|
|
8437
|
+
}
|
|
8014
8438
|
};
|
|
8015
8439
|
//#endregion
|
|
8016
8440
|
//#region configuration.ts
|
|
@@ -8026,9 +8450,10 @@ var Configuration = class {
|
|
|
8026
8450
|
this.consumerKey = param.auth.consumerKey;
|
|
8027
8451
|
if (param.auth.clientId !== void 0) this.apiKey["clientId"] = param.auth.clientId;
|
|
8028
8452
|
}
|
|
8453
|
+
if (param.auth.mode === "oauth") this.accessToken = param.auth.accessToken;
|
|
8029
8454
|
this.basePath = param.basePath;
|
|
8030
8455
|
this.baseOptions = param.baseOptions ?? {};
|
|
8031
|
-
this.userAgent = param.userAgent === void 0 ? "Konfig/13.
|
|
8456
|
+
this.userAgent = param.userAgent === void 0 ? "Konfig/13.2.0/typescript" : param.userAgent;
|
|
8032
8457
|
this.formDataCtor = param.formDataCtor;
|
|
8033
8458
|
}
|
|
8034
8459
|
/**
|
|
@@ -8067,6 +8492,111 @@ var Snaptrade = class extends SnaptradeCustom {
|
|
|
8067
8492
|
}
|
|
8068
8493
|
};
|
|
8069
8494
|
//#endregion
|
|
8495
|
+
//#region oauth-device.ts
|
|
8496
|
+
const expired = () => /* @__PURE__ */ new Error("Device authorization expired. Start a new authorization.");
|
|
8497
|
+
const aborted = () => Object.assign(/* @__PURE__ */ new Error("Device authorization cancelled."), { name: "AbortError" });
|
|
8498
|
+
const delay = (milliseconds, signal) => new Promise((resolve, reject) => {
|
|
8499
|
+
if (signal.aborted) {
|
|
8500
|
+
reject(aborted());
|
|
8501
|
+
return;
|
|
8502
|
+
}
|
|
8503
|
+
const cancel = () => {
|
|
8504
|
+
clearTimeout(timer);
|
|
8505
|
+
signal.removeEventListener("abort", cancel);
|
|
8506
|
+
reject(aborted());
|
|
8507
|
+
};
|
|
8508
|
+
const timer = setTimeout(() => {
|
|
8509
|
+
signal.removeEventListener("abort", cancel);
|
|
8510
|
+
resolve();
|
|
8511
|
+
}, milliseconds);
|
|
8512
|
+
signal.addEventListener("abort", cancel, { once: true });
|
|
8513
|
+
});
|
|
8514
|
+
/** Explicit device login for pre-registered public clients. Tokens remain application-owned. */
|
|
8515
|
+
var SnaptradeOAuthDevice = class {
|
|
8516
|
+
constructor(options = {}) {
|
|
8517
|
+
this.issuer = (options.issuer ?? new URL(BASE_PATH).origin).replace(/\/+$/, "");
|
|
8518
|
+
this.http = options.axios ?? axios.default;
|
|
8519
|
+
}
|
|
8520
|
+
/** Display userCode and verificationUri; keep deviceCode private. Access is read-only. */
|
|
8521
|
+
async startDeviceAuthorization(params) {
|
|
8522
|
+
const startedAt = Date.now();
|
|
8523
|
+
const { data } = await this.http.post(`${this.issuer}/oauth/device_authorization/`, new URLSearchParams({
|
|
8524
|
+
client_id: params.clientId,
|
|
8525
|
+
scope: "read"
|
|
8526
|
+
}).toString(), {
|
|
8527
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
8528
|
+
signal: params.signal
|
|
8529
|
+
});
|
|
8530
|
+
if (typeof data.device_code !== "string" || !data.device_code || typeof data.user_code !== "string" || !data.user_code || typeof data.verification_uri !== "string" || !data.verification_uri || !Number.isFinite(data.expires_in) || data.expires_in <= 0 || data.interval !== void 0 && (!Number.isFinite(data.interval) || data.interval <= 0)) throw new Error("Invalid device authorization response.");
|
|
8531
|
+
return {
|
|
8532
|
+
deviceCode: data.device_code,
|
|
8533
|
+
userCode: data.user_code,
|
|
8534
|
+
verificationUri: data.verification_uri,
|
|
8535
|
+
verificationUriComplete: data.verification_uri_complete,
|
|
8536
|
+
expiresAt: startedAt + data.expires_in * 1e3,
|
|
8537
|
+
interval: data.interval ?? 5
|
|
8538
|
+
};
|
|
8539
|
+
}
|
|
8540
|
+
/** Polls only for initial login. Does not store tokens or refresh them. */
|
|
8541
|
+
async waitForDeviceToken(params) {
|
|
8542
|
+
const { authorization, signal } = params;
|
|
8543
|
+
if (signal?.aborted) throw aborted();
|
|
8544
|
+
const remaining = authorization.expiresAt - Date.now();
|
|
8545
|
+
if (!Number.isFinite(remaining) || remaining <= 0) throw expired();
|
|
8546
|
+
if (!Number.isFinite(authorization.interval) || authorization.interval <= 0) throw new Error("Invalid polling interval.");
|
|
8547
|
+
const controller = new AbortController();
|
|
8548
|
+
const cancel = () => controller.abort();
|
|
8549
|
+
signal?.addEventListener("abort", cancel, { once: true });
|
|
8550
|
+
const deadline = setTimeout(cancel, Math.min(remaining, 2147483647));
|
|
8551
|
+
let interval = authorization.interval * 1e3;
|
|
8552
|
+
try {
|
|
8553
|
+
while (true) {
|
|
8554
|
+
await delay(Math.min(interval, Math.max(0, authorization.expiresAt - Date.now())), controller.signal);
|
|
8555
|
+
if (Date.now() >= authorization.expiresAt) throw expired();
|
|
8556
|
+
try {
|
|
8557
|
+
const { data } = await this.http.post(`${this.issuer}/oauth/token/`, new URLSearchParams({
|
|
8558
|
+
client_id: params.clientId,
|
|
8559
|
+
device_code: authorization.deviceCode,
|
|
8560
|
+
grant_type: "urn:ietf:params:oauth:grant-type:device_code"
|
|
8561
|
+
}).toString(), {
|
|
8562
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
8563
|
+
signal: controller.signal,
|
|
8564
|
+
timeout: Math.min(3e4, Math.max(1, authorization.expiresAt - Date.now()))
|
|
8565
|
+
});
|
|
8566
|
+
if (typeof data.access_token !== "string" || !data.access_token) throw new Error("OAuth response is missing access_token.");
|
|
8567
|
+
return {
|
|
8568
|
+
accessToken: data.access_token,
|
|
8569
|
+
refreshToken: data.refresh_token,
|
|
8570
|
+
tokenType: data.token_type,
|
|
8571
|
+
expiresIn: data.expires_in,
|
|
8572
|
+
scope: data.scope
|
|
8573
|
+
};
|
|
8574
|
+
} catch (error) {
|
|
8575
|
+
const response = error;
|
|
8576
|
+
const code = response.response?.data?.error;
|
|
8577
|
+
if (code === "authorization_pending") continue;
|
|
8578
|
+
if (code === "slow_down") {
|
|
8579
|
+
interval += 5e3;
|
|
8580
|
+
continue;
|
|
8581
|
+
}
|
|
8582
|
+
if (response.code === "ECONNABORTED" || response.code === "ETIMEDOUT") {
|
|
8583
|
+
interval *= 2;
|
|
8584
|
+
continue;
|
|
8585
|
+
}
|
|
8586
|
+
throw error;
|
|
8587
|
+
}
|
|
8588
|
+
}
|
|
8589
|
+
} catch (error) {
|
|
8590
|
+
if (signal?.aborted) throw aborted();
|
|
8591
|
+
if (controller.signal.aborted || Date.now() >= authorization.expiresAt) throw expired();
|
|
8592
|
+
throw error;
|
|
8593
|
+
} finally {
|
|
8594
|
+
clearTimeout(deadline);
|
|
8595
|
+
signal?.removeEventListener("abort", cancel);
|
|
8596
|
+
}
|
|
8597
|
+
}
|
|
8598
|
+
};
|
|
8599
|
+
//#endregion
|
|
8070
8600
|
exports.AccountInformationApi = AccountInformationApi;
|
|
8071
8601
|
exports.AccountInformationApiAxiosParamCreator = AccountInformationApiAxiosParamCreator;
|
|
8072
8602
|
exports.AccountInformationApiFactory = AccountInformationApiFactory;
|
|
@@ -8099,6 +8629,7 @@ exports.ManagementApiAxiosParamCreator = ManagementApiAxiosParamCreator;
|
|
|
8099
8629
|
exports.ManagementApiFactory = ManagementApiFactory;
|
|
8100
8630
|
exports.ManagementApiFp = ManagementApiFp;
|
|
8101
8631
|
exports.ManagementApiGenerated = ManagementApiGenerated;
|
|
8632
|
+
exports.OAuthAuth = OAuthAuth;
|
|
8102
8633
|
exports.PersonalApiKeyAuth = PersonalApiKeyAuth;
|
|
8103
8634
|
exports.ReferenceDataApi = ReferenceDataApi;
|
|
8104
8635
|
exports.ReferenceDataApiAxiosParamCreator = ReferenceDataApiAxiosParamCreator;
|
|
@@ -8108,6 +8639,7 @@ exports.ReferenceDataApiGenerated = ReferenceDataApiGenerated;
|
|
|
8108
8639
|
exports.Snaptrade = Snaptrade;
|
|
8109
8640
|
exports.SnaptradeAuth = SnaptradeAuth;
|
|
8110
8641
|
exports.SnaptradeError = SnaptradeError;
|
|
8642
|
+
exports.SnaptradeOAuthDevice = SnaptradeOAuthDevice;
|
|
8111
8643
|
exports.TradingApi = TradingApi;
|
|
8112
8644
|
exports.TradingApiAxiosParamCreator = TradingApiAxiosParamCreator;
|
|
8113
8645
|
exports.TradingApiFactory = TradingApiFactory;
|