snaptrade-typescript-sdk 12.1.14 → 12.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 +1 -1
- package/dist/browser.umd.js +2 -2
- package/dist/index.cjs +109 -75
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +44 -10
- 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$10 = axios.default) {
|
|
35
35
|
this.basePath = basePath;
|
|
36
|
-
this.axios = axios$
|
|
36
|
+
this.axios = axios$10;
|
|
37
37
|
if (configuration) {
|
|
38
38
|
this.configuration = configuration;
|
|
39
39
|
this.basePath = configuration.basePath || this.basePath;
|
|
@@ -107,17 +107,48 @@ async function requestAfterHook(request) {
|
|
|
107
107
|
}
|
|
108
108
|
//#endregion
|
|
109
109
|
//#region error.ts
|
|
110
|
+
const REDACTED_QUERY_VALUE = "[REDACTED]";
|
|
111
|
+
const SENSITIVE_QUERY_PARAMETER_NAMES = new Set([
|
|
112
|
+
"clientid",
|
|
113
|
+
"timestamp",
|
|
114
|
+
"userid",
|
|
115
|
+
"usersecret"
|
|
116
|
+
]);
|
|
117
|
+
function redactSensitiveQueryValues(url) {
|
|
118
|
+
if (url === void 0 || SENSITIVE_QUERY_PARAMETER_NAMES.size === 0) return url;
|
|
119
|
+
try {
|
|
120
|
+
const isAbsoluteUrl = /^[a-z][a-z\d+.-]*:/i.test(url);
|
|
121
|
+
const parsedUrl = new URL(url, "http://konfig.invalid");
|
|
122
|
+
const redactedSearchParams = new URLSearchParams();
|
|
123
|
+
for (const [name, value] of parsedUrl.searchParams.entries()) {
|
|
124
|
+
let redactedValue = value;
|
|
125
|
+
if (SENSITIVE_QUERY_PARAMETER_NAMES.has(name.toLowerCase())) redactedValue = REDACTED_QUERY_VALUE;
|
|
126
|
+
redactedSearchParams.append(name, redactedValue);
|
|
127
|
+
}
|
|
128
|
+
parsedUrl.search = redactedSearchParams.toString();
|
|
129
|
+
if (isAbsoluteUrl) return parsedUrl.toString();
|
|
130
|
+
return parsedUrl.pathname + parsedUrl.search + parsedUrl.hash;
|
|
131
|
+
} catch {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function redactUrlFromMessage(message, originalUrl, redactedUrl) {
|
|
136
|
+
if (originalUrl === void 0 || !message.includes(originalUrl)) return message;
|
|
137
|
+
return message.split(originalUrl).join(redactedUrl ?? "[REDACTED URL]");
|
|
138
|
+
}
|
|
110
139
|
/**
|
|
111
140
|
* This class provides a wrapper for network errors when making requests to SnapTrade
|
|
112
141
|
*/
|
|
113
142
|
var SnaptradeError = class extends Error {
|
|
114
143
|
constructor(axiosError, responseBody, headers) {
|
|
115
|
-
const
|
|
144
|
+
const originalUrl = axiosError.config?.url;
|
|
145
|
+
const redactedUrl = redactSensitiveQueryValues(originalUrl);
|
|
146
|
+
const message = redactUrlFromMessage(axiosError.message, originalUrl, redactedUrl) + "\nRESPONSE HEADERS:\n" + JSON.stringify(headers, null, 2);
|
|
116
147
|
super(message);
|
|
117
148
|
this.name = "SnaptradeError";
|
|
118
149
|
this.code = axiosError.code;
|
|
119
150
|
this.method = axiosError.config?.method?.toUpperCase();
|
|
120
|
-
this.url =
|
|
151
|
+
this.url = redactedUrl;
|
|
121
152
|
this.status = axiosError.response?.status;
|
|
122
153
|
this.statusText = axiosError.response?.statusText;
|
|
123
154
|
this.responseBody = responseBody;
|
|
@@ -238,7 +269,7 @@ async function wrapAxiosRequest(makeRequest) {
|
|
|
238
269
|
while (attempt < maxAttempts) try {
|
|
239
270
|
return await makeRequest();
|
|
240
271
|
} catch (e) {
|
|
241
|
-
if (
|
|
272
|
+
if (axios.default.isAxiosError(e)) {
|
|
242
273
|
if (e.response?.status == 429) {
|
|
243
274
|
attempt++;
|
|
244
275
|
console.log(`429 error encountered, retrying in ${delay / 1e3} seconds...`);
|
|
@@ -246,13 +277,16 @@ async function wrapAxiosRequest(makeRequest) {
|
|
|
246
277
|
delay *= 2;
|
|
247
278
|
continue;
|
|
248
279
|
}
|
|
280
|
+
let responseBody;
|
|
249
281
|
try {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
if (
|
|
253
|
-
|
|
254
|
-
|
|
282
|
+
const responseData = e.response?.data;
|
|
283
|
+
responseBody = responseData;
|
|
284
|
+
if (typeof ReadableStream !== "undefined" && responseData instanceof ReadableStream) responseBody = await readableStreamToString(responseData);
|
|
285
|
+
responseBody = parseIfJson(responseBody);
|
|
286
|
+
} catch {
|
|
287
|
+
responseBody = void 0;
|
|
255
288
|
}
|
|
289
|
+
throw new SnaptradeError(e, responseBody, e.response?.headers);
|
|
256
290
|
}
|
|
257
291
|
throw e;
|
|
258
292
|
}
|
|
@@ -263,7 +297,7 @@ async function wrapAxiosRequest(makeRequest) {
|
|
|
263
297
|
* @export
|
|
264
298
|
*/
|
|
265
299
|
const createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, configuration, operationAuth) {
|
|
266
|
-
return async (axios$
|
|
300
|
+
return async (axios$9 = globalAxios, basePath = BASE_PATH) => {
|
|
267
301
|
const url = (configuration?.basePath || basePath) + axiosArgs.url;
|
|
268
302
|
await requestAfterHook({
|
|
269
303
|
axiosArgs,
|
|
@@ -275,7 +309,7 @@ const createRequestFunction = function(axiosArgs, globalAxios, BASE_PATH, config
|
|
|
275
309
|
selectedAuthMode: configuration?.authMode
|
|
276
310
|
} : void 0
|
|
277
311
|
});
|
|
278
|
-
return wrapAxiosRequest(async () => await axios$
|
|
312
|
+
return wrapAxiosRequest(async () => await axios$9.request({
|
|
279
313
|
...axiosArgs.options,
|
|
280
314
|
url
|
|
281
315
|
}));
|
|
@@ -1479,7 +1513,7 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1479
1513
|
* AccountInformationApi - factory interface
|
|
1480
1514
|
* @export
|
|
1481
1515
|
*/
|
|
1482
|
-
const AccountInformationApiFactory = function(configuration, basePath, axios$
|
|
1516
|
+
const AccountInformationApiFactory = function(configuration, basePath, axios$8) {
|
|
1483
1517
|
const localVarFp = AccountInformationApiFp(configuration);
|
|
1484
1518
|
return {
|
|
1485
1519
|
/**
|
|
@@ -1490,7 +1524,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$7)
|
|
|
1490
1524
|
* @throws {RequiredError}
|
|
1491
1525
|
*/
|
|
1492
1526
|
getAccountActivities(requestParameters, options) {
|
|
1493
|
-
return localVarFp.getAccountActivities(requestParameters, options).then((request) => request(axios$
|
|
1527
|
+
return localVarFp.getAccountActivities(requestParameters, options).then((request) => request(axios$8, basePath));
|
|
1494
1528
|
},
|
|
1495
1529
|
/**
|
|
1496
1530
|
* 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. Enable this feature for free in the Add-on section of the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)
|
|
@@ -1500,7 +1534,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$7)
|
|
|
1500
1534
|
* @throws {RequiredError}
|
|
1501
1535
|
*/
|
|
1502
1536
|
getAccountBalanceHistory(requestParameters, options) {
|
|
1503
|
-
return localVarFp.getAccountBalanceHistory(requestParameters, options).then((request) => request(axios$
|
|
1537
|
+
return localVarFp.getAccountBalanceHistory(requestParameters, options).then((request) => request(axios$8, basePath));
|
|
1504
1538
|
},
|
|
1505
1539
|
/**
|
|
1506
1540
|
* 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, and CFD positions. Use the `instrument.kind` discriminator to determine the schema for each position\'s `instrument`. Positions counted in account cash balance or buying power include `cash_equivalent: true`. `stock`, `adr`, `etf`, `mutualfund`, and `crypto` positions may include `tax_lots` when tax lot data is enabled for the account. 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.
|
|
@@ -1510,7 +1544,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$7)
|
|
|
1510
1544
|
* @throws {RequiredError}
|
|
1511
1545
|
*/
|
|
1512
1546
|
getAllAccountPositions(requestParameters, options) {
|
|
1513
|
-
return localVarFp.getAllAccountPositions(requestParameters, options).then((request) => request(axios$
|
|
1547
|
+
return localVarFp.getAllAccountPositions(requestParameters, options).then((request) => request(axios$8, basePath));
|
|
1514
1548
|
},
|
|
1515
1549
|
/**
|
|
1516
1550
|
* 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.
|
|
@@ -1520,7 +1554,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$7)
|
|
|
1520
1554
|
* @throws {RequiredError}
|
|
1521
1555
|
*/
|
|
1522
1556
|
getUserAccountBalance(requestParameters, options) {
|
|
1523
|
-
return localVarFp.getUserAccountBalance(requestParameters, options).then((request) => request(axios$
|
|
1557
|
+
return localVarFp.getUserAccountBalance(requestParameters, options).then((request) => request(axios$8, basePath));
|
|
1524
1558
|
},
|
|
1525
1559
|
/**
|
|
1526
1560
|
* 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.
|
|
@@ -1530,7 +1564,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$7)
|
|
|
1530
1564
|
* @throws {RequiredError}
|
|
1531
1565
|
*/
|
|
1532
1566
|
getUserAccountDetails(requestParameters, options) {
|
|
1533
|
-
return localVarFp.getUserAccountDetails(requestParameters, options).then((request) => request(axios$
|
|
1567
|
+
return localVarFp.getUserAccountDetails(requestParameters, options).then((request) => request(axios$8, basePath));
|
|
1534
1568
|
},
|
|
1535
1569
|
/**
|
|
1536
1570
|
* 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.
|
|
@@ -1540,7 +1574,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$7)
|
|
|
1540
1574
|
* @throws {RequiredError}
|
|
1541
1575
|
*/
|
|
1542
1576
|
getUserAccountOrderDetail(requestParameters, options) {
|
|
1543
|
-
return localVarFp.getUserAccountOrderDetail(requestParameters, options).then((request) => request(axios$
|
|
1577
|
+
return localVarFp.getUserAccountOrderDetail(requestParameters, options).then((request) => request(axios$8, basePath));
|
|
1544
1578
|
},
|
|
1545
1579
|
/**
|
|
1546
1580
|
* 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.
|
|
@@ -1550,7 +1584,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$7)
|
|
|
1550
1584
|
* @throws {RequiredError}
|
|
1551
1585
|
*/
|
|
1552
1586
|
getUserAccountOrders(requestParameters, options) {
|
|
1553
|
-
return localVarFp.getUserAccountOrders(requestParameters, options).then((request) => request(axios$
|
|
1587
|
+
return localVarFp.getUserAccountOrders(requestParameters, options).then((request) => request(axios$8, basePath));
|
|
1554
1588
|
},
|
|
1555
1589
|
/**
|
|
1556
1590
|
* 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
|
|
@@ -1560,7 +1594,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$7)
|
|
|
1560
1594
|
* @throws {RequiredError}
|
|
1561
1595
|
*/
|
|
1562
1596
|
getUserAccountRecentOrders(requestParameters, options) {
|
|
1563
|
-
return localVarFp.getUserAccountRecentOrders(requestParameters, options).then((request) => request(axios$
|
|
1597
|
+
return localVarFp.getUserAccountRecentOrders(requestParameters, options).then((request) => request(axios$8, basePath));
|
|
1564
1598
|
},
|
|
1565
1599
|
/**
|
|
1566
1600
|
* Returns a list of rate of return percents for a given account.
|
|
@@ -1570,7 +1604,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$7)
|
|
|
1570
1604
|
* @throws {RequiredError}
|
|
1571
1605
|
*/
|
|
1572
1606
|
getUserAccountReturnRates(requestParameters, options) {
|
|
1573
|
-
return localVarFp.getUserAccountReturnRates(requestParameters, options).then((request) => request(axios$
|
|
1607
|
+
return localVarFp.getUserAccountReturnRates(requestParameters, options).then((request) => request(axios$8, basePath));
|
|
1574
1608
|
},
|
|
1575
1609
|
/**
|
|
1576
1610
|
* **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.
|
|
@@ -1581,7 +1615,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$7)
|
|
|
1581
1615
|
* @throws {RequiredError}
|
|
1582
1616
|
*/
|
|
1583
1617
|
getUserHoldings(requestParameters, options) {
|
|
1584
|
-
return localVarFp.getUserHoldings(requestParameters, options).then((request) => request(axios$
|
|
1618
|
+
return localVarFp.getUserHoldings(requestParameters, options).then((request) => request(axios$8, basePath));
|
|
1585
1619
|
},
|
|
1586
1620
|
/**
|
|
1587
1621
|
* 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).
|
|
@@ -1591,7 +1625,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$7)
|
|
|
1591
1625
|
* @throws {RequiredError}
|
|
1592
1626
|
*/
|
|
1593
1627
|
listUserAccounts(requestParameters = {}, options) {
|
|
1594
|
-
return localVarFp.listUserAccounts(requestParameters, options).then((request) => request(axios$
|
|
1628
|
+
return localVarFp.listUserAccounts(requestParameters, options).then((request) => request(axios$8, basePath));
|
|
1595
1629
|
},
|
|
1596
1630
|
/**
|
|
1597
1631
|
* Updates various properties of a specified account.
|
|
@@ -1601,7 +1635,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$7)
|
|
|
1601
1635
|
* @throws {RequiredError}
|
|
1602
1636
|
*/
|
|
1603
1637
|
updateUserAccount(requestParameters, options) {
|
|
1604
|
-
return localVarFp.updateUserAccount(requestParameters, options).then((request) => request(axios$
|
|
1638
|
+
return localVarFp.updateUserAccount(requestParameters, options).then((request) => request(axios$8, basePath));
|
|
1605
1639
|
}
|
|
1606
1640
|
};
|
|
1607
1641
|
};
|
|
@@ -1822,7 +1856,7 @@ async check(options) {
|
|
|
1822
1856
|
* ApiStatusApi - factory interface
|
|
1823
1857
|
* @export
|
|
1824
1858
|
*/
|
|
1825
|
-
const ApiStatusApiFactory = function(configuration, basePath, axios$
|
|
1859
|
+
const ApiStatusApiFactory = function(configuration, basePath, axios$7) {
|
|
1826
1860
|
const localVarFp = ApiStatusApiFp(configuration);
|
|
1827
1861
|
return {
|
|
1828
1862
|
/**
|
|
@@ -1832,7 +1866,7 @@ const ApiStatusApiFactory = function(configuration, basePath, axios$6) {
|
|
|
1832
1866
|
* @throws {RequiredError}
|
|
1833
1867
|
*/
|
|
1834
1868
|
check(options) {
|
|
1835
|
-
return localVarFp.check(options).then((request) => request(axios$
|
|
1869
|
+
return localVarFp.check(options).then((request) => request(axios$7, basePath));
|
|
1836
1870
|
} };
|
|
1837
1871
|
};
|
|
1838
1872
|
/**
|
|
@@ -2282,7 +2316,7 @@ const AuthenticationApiFp = function(configuration) {
|
|
|
2282
2316
|
* AuthenticationApi - factory interface
|
|
2283
2317
|
* @export
|
|
2284
2318
|
*/
|
|
2285
|
-
const AuthenticationApiFactory = function(configuration, basePath, axios$
|
|
2319
|
+
const AuthenticationApiFactory = function(configuration, basePath, axios$6) {
|
|
2286
2320
|
const localVarFp = AuthenticationApiFp(configuration);
|
|
2287
2321
|
return {
|
|
2288
2322
|
/**
|
|
@@ -2293,7 +2327,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$5) {
|
|
|
2293
2327
|
* @throws {RequiredError}
|
|
2294
2328
|
*/
|
|
2295
2329
|
deleteSnapTradeUser(requestParameters, options) {
|
|
2296
|
-
return localVarFp.deleteSnapTradeUser(requestParameters, options).then((request) => request(axios$
|
|
2330
|
+
return localVarFp.deleteSnapTradeUser(requestParameters, options).then((request) => request(axios$6, basePath));
|
|
2297
2331
|
},
|
|
2298
2332
|
/**
|
|
2299
2333
|
* Returns a list of all registered user IDs. Please note that the response is not currently paginated.
|
|
@@ -2302,7 +2336,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$5) {
|
|
|
2302
2336
|
* @throws {RequiredError}
|
|
2303
2337
|
*/
|
|
2304
2338
|
listSnapTradeUsers(...args) {
|
|
2305
|
-
return localVarFp.listSnapTradeUsers(...args).then((request) => request(axios$
|
|
2339
|
+
return localVarFp.listSnapTradeUsers(...args).then((request) => request(axios$6, basePath));
|
|
2306
2340
|
},
|
|
2307
2341
|
/**
|
|
2308
2342
|
* 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.
|
|
@@ -2312,7 +2346,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$5) {
|
|
|
2312
2346
|
* @throws {RequiredError}
|
|
2313
2347
|
*/
|
|
2314
2348
|
loginSnapTradeUser(requestParameters = {}, options) {
|
|
2315
|
-
return localVarFp.loginSnapTradeUser(requestParameters, options).then((request) => request(axios$
|
|
2349
|
+
return localVarFp.loginSnapTradeUser(requestParameters, options).then((request) => request(axios$6, basePath));
|
|
2316
2350
|
},
|
|
2317
2351
|
/**
|
|
2318
2352
|
* 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.
|
|
@@ -2322,7 +2356,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$5) {
|
|
|
2322
2356
|
* @throws {RequiredError}
|
|
2323
2357
|
*/
|
|
2324
2358
|
registerSnapTradeUser(requestParameters, options) {
|
|
2325
|
-
return localVarFp.registerSnapTradeUser(requestParameters, options).then((request) => request(axios$
|
|
2359
|
+
return localVarFp.registerSnapTradeUser(requestParameters, options).then((request) => request(axios$6, basePath));
|
|
2326
2360
|
},
|
|
2327
2361
|
/**
|
|
2328
2362
|
* 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.
|
|
@@ -2332,7 +2366,7 @@ const AuthenticationApiFactory = function(configuration, basePath, axios$5) {
|
|
|
2332
2366
|
* @throws {RequiredError}
|
|
2333
2367
|
*/
|
|
2334
2368
|
resetSnapTradeUserSecret(requestParameters, options) {
|
|
2335
|
-
return localVarFp.resetSnapTradeUserSecret(requestParameters, options).then((request) => request(axios$
|
|
2369
|
+
return localVarFp.resetSnapTradeUserSecret(requestParameters, options).then((request) => request(axios$6, basePath));
|
|
2336
2370
|
}
|
|
2337
2371
|
};
|
|
2338
2372
|
};
|
|
@@ -3184,7 +3218,7 @@ const ConnectionsApiFp = function(configuration) {
|
|
|
3184
3218
|
* ConnectionsApi - factory interface
|
|
3185
3219
|
* @export
|
|
3186
3220
|
*/
|
|
3187
|
-
const ConnectionsApiFactory = function(configuration, basePath, axios$
|
|
3221
|
+
const ConnectionsApiFactory = function(configuration, basePath, axios$5) {
|
|
3188
3222
|
const localVarFp = ConnectionsApiFp(configuration);
|
|
3189
3223
|
return {
|
|
3190
3224
|
/**
|
|
@@ -3195,7 +3229,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$4) {
|
|
|
3195
3229
|
* @throws {RequiredError}
|
|
3196
3230
|
*/
|
|
3197
3231
|
deleteConnection(requestParameters, options) {
|
|
3198
|
-
return localVarFp.deleteConnection(requestParameters, options).then((request) => request(axios$
|
|
3232
|
+
return localVarFp.deleteConnection(requestParameters, options).then((request) => request(axios$5, basePath));
|
|
3199
3233
|
},
|
|
3200
3234
|
/**
|
|
3201
3235
|
* Returns a single connection for the specified ID.
|
|
@@ -3205,7 +3239,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$4) {
|
|
|
3205
3239
|
* @throws {RequiredError}
|
|
3206
3240
|
*/
|
|
3207
3241
|
detailBrokerageAuthorization(requestParameters, options) {
|
|
3208
|
-
return localVarFp.detailBrokerageAuthorization(requestParameters, options).then((request) => request(axios$
|
|
3242
|
+
return localVarFp.detailBrokerageAuthorization(requestParameters, options).then((request) => request(axios$5, basePath));
|
|
3209
3243
|
},
|
|
3210
3244
|
/**
|
|
3211
3245
|
* 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.
|
|
@@ -3215,7 +3249,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$4) {
|
|
|
3215
3249
|
* @throws {RequiredError}
|
|
3216
3250
|
*/
|
|
3217
3251
|
disableBrokerageAuthorization(requestParameters, options) {
|
|
3218
|
-
return localVarFp.disableBrokerageAuthorization(requestParameters, options).then((request) => request(axios$
|
|
3252
|
+
return localVarFp.disableBrokerageAuthorization(requestParameters, options).then((request) => request(axios$5, basePath));
|
|
3219
3253
|
},
|
|
3220
3254
|
/**
|
|
3221
3255
|
* 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.
|
|
@@ -3225,7 +3259,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$4) {
|
|
|
3225
3259
|
* @throws {RequiredError}
|
|
3226
3260
|
*/
|
|
3227
3261
|
listBrokerageAuthorizationAccounts(requestParameters, options) {
|
|
3228
|
-
return localVarFp.listBrokerageAuthorizationAccounts(requestParameters, options).then((request) => request(axios$
|
|
3262
|
+
return localVarFp.listBrokerageAuthorizationAccounts(requestParameters, options).then((request) => request(axios$5, basePath));
|
|
3229
3263
|
},
|
|
3230
3264
|
/**
|
|
3231
3265
|
* 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.
|
|
@@ -3235,7 +3269,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$4) {
|
|
|
3235
3269
|
* @throws {RequiredError}
|
|
3236
3270
|
*/
|
|
3237
3271
|
listBrokerageAuthorizations(requestParameters = {}, options) {
|
|
3238
|
-
return localVarFp.listBrokerageAuthorizations(requestParameters, options).then((request) => request(axios$
|
|
3272
|
+
return localVarFp.listBrokerageAuthorizations(requestParameters, options).then((request) => request(axios$5, basePath));
|
|
3239
3273
|
},
|
|
3240
3274
|
/**
|
|
3241
3275
|
* 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.**
|
|
@@ -3245,7 +3279,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$4) {
|
|
|
3245
3279
|
* @throws {RequiredError}
|
|
3246
3280
|
*/
|
|
3247
3281
|
refreshBrokerageAuthorization(requestParameters, options) {
|
|
3248
|
-
return localVarFp.refreshBrokerageAuthorization(requestParameters, options).then((request) => request(axios$
|
|
3282
|
+
return localVarFp.refreshBrokerageAuthorization(requestParameters, options).then((request) => request(axios$5, basePath));
|
|
3249
3283
|
},
|
|
3250
3284
|
/**
|
|
3251
3285
|
* Returns a list of rate of return percents for a given connection.
|
|
@@ -3255,7 +3289,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$4) {
|
|
|
3255
3289
|
* @throws {RequiredError}
|
|
3256
3290
|
*/
|
|
3257
3291
|
returnRates(requestParameters, options) {
|
|
3258
|
-
return localVarFp.returnRates(requestParameters, options).then((request) => request(axios$
|
|
3292
|
+
return localVarFp.returnRates(requestParameters, options).then((request) => request(axios$5, basePath));
|
|
3259
3293
|
},
|
|
3260
3294
|
/**
|
|
3261
3295
|
* 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
|
|
@@ -3265,7 +3299,7 @@ const ConnectionsApiFactory = function(configuration, basePath, axios$4) {
|
|
|
3265
3299
|
* @throws {RequiredError}
|
|
3266
3300
|
*/
|
|
3267
3301
|
syncBrokerageAuthorizationTransactions(requestParameters, options) {
|
|
3268
|
-
return localVarFp.syncBrokerageAuthorizationTransactions(requestParameters, options).then((request) => request(axios$
|
|
3302
|
+
return localVarFp.syncBrokerageAuthorizationTransactions(requestParameters, options).then((request) => request(axios$5, basePath));
|
|
3269
3303
|
}
|
|
3270
3304
|
};
|
|
3271
3305
|
};
|
|
@@ -4061,7 +4095,7 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4061
4095
|
* ExperimentalEndpointsApi - factory interface
|
|
4062
4096
|
* @export
|
|
4063
4097
|
*/
|
|
4064
|
-
const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
4098
|
+
const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$4) {
|
|
4065
4099
|
const localVarFp = ExperimentalEndpointsApiFp(configuration);
|
|
4066
4100
|
return {
|
|
4067
4101
|
/**
|
|
@@ -4072,7 +4106,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4072
4106
|
* @throws {RequiredError}
|
|
4073
4107
|
*/
|
|
4074
4108
|
addSubscription(requestParameters, options) {
|
|
4075
|
-
return localVarFp.addSubscription(requestParameters, options).then((request) => request(axios$
|
|
4109
|
+
return localVarFp.addSubscription(requestParameters, options).then((request) => request(axios$4, basePath));
|
|
4076
4110
|
},
|
|
4077
4111
|
/**
|
|
4078
4112
|
* Cancels a Trade Detection subscription for a connected brokerage account. This endpoint requires partner signature authentication only and does not require `userId` or `userSecret`.
|
|
@@ -4082,7 +4116,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4082
4116
|
* @throws {RequiredError}
|
|
4083
4117
|
*/
|
|
4084
4118
|
cancelSubscription(requestParameters, options) {
|
|
4085
|
-
return localVarFp.cancelSubscription(requestParameters, options).then((request) => request(axios$
|
|
4119
|
+
return localVarFp.cancelSubscription(requestParameters, options).then((request) => request(axios$4, basePath));
|
|
4086
4120
|
},
|
|
4087
4121
|
/**
|
|
4088
4122
|
* 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.
|
|
@@ -4092,7 +4126,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4092
4126
|
* @throws {RequiredError}
|
|
4093
4127
|
*/
|
|
4094
4128
|
getUserAccountOrderDetailV2(requestParameters, options) {
|
|
4095
|
-
return localVarFp.getUserAccountOrderDetailV2(requestParameters, options).then((request) => request(axios$
|
|
4129
|
+
return localVarFp.getUserAccountOrderDetailV2(requestParameters, options).then((request) => request(axios$4, basePath));
|
|
4096
4130
|
},
|
|
4097
4131
|
/**
|
|
4098
4132
|
* 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.
|
|
@@ -4102,7 +4136,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4102
4136
|
* @throws {RequiredError}
|
|
4103
4137
|
*/
|
|
4104
4138
|
getUserAccountOrdersV2(requestParameters, options) {
|
|
4105
|
-
return localVarFp.getUserAccountOrdersV2(requestParameters, options).then((request) => request(axios$
|
|
4139
|
+
return localVarFp.getUserAccountOrdersV2(requestParameters, options).then((request) => request(axios$4, basePath));
|
|
4106
4140
|
},
|
|
4107
4141
|
/**
|
|
4108
4142
|
* 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)**
|
|
@@ -4112,7 +4146,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4112
4146
|
* @throws {RequiredError}
|
|
4113
4147
|
*/
|
|
4114
4148
|
getUserAccountRecentOrdersV2(requestParameters, options) {
|
|
4115
|
-
return localVarFp.getUserAccountRecentOrdersV2(requestParameters, options).then((request) => request(axios$
|
|
4149
|
+
return localVarFp.getUserAccountRecentOrdersV2(requestParameters, options).then((request) => request(axios$4, basePath));
|
|
4116
4150
|
},
|
|
4117
4151
|
/**
|
|
4118
4152
|
* Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (`investment`, `deposit`, and `line_of_credit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema. On Pay as you Go / Real-time, this endpoint refreshes each account\'s opening date 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.
|
|
@@ -4122,7 +4156,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4122
4156
|
* @throws {RequiredError}
|
|
4123
4157
|
*/
|
|
4124
4158
|
listConnectionAccounts(requestParameters, options) {
|
|
4125
|
-
return localVarFp.listConnectionAccounts(requestParameters, options).then((request) => request(axios$
|
|
4159
|
+
return localVarFp.listConnectionAccounts(requestParameters, options).then((request) => request(axios$4, basePath));
|
|
4126
4160
|
},
|
|
4127
4161
|
/**
|
|
4128
4162
|
* Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|
|
@@ -4131,7 +4165,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4131
4165
|
* @throws {RequiredError}
|
|
4132
4166
|
*/
|
|
4133
4167
|
listSubscriptions(...args) {
|
|
4134
|
-
return localVarFp.listSubscriptions(...args).then((request) => request(axios$
|
|
4168
|
+
return localVarFp.listSubscriptions(...args).then((request) => request(axios$4, basePath));
|
|
4135
4169
|
}
|
|
4136
4170
|
};
|
|
4137
4171
|
};
|
|
@@ -4965,7 +4999,7 @@ const ReferenceDataApiFp = function(configuration) {
|
|
|
4965
4999
|
* ReferenceDataApi - factory interface
|
|
4966
5000
|
* @export
|
|
4967
5001
|
*/
|
|
4968
|
-
const ReferenceDataApiFactory = function(configuration, basePath, axios$
|
|
5002
|
+
const ReferenceDataApiFactory = function(configuration, basePath, axios$3) {
|
|
4969
5003
|
const localVarFp = ReferenceDataApiFp(configuration);
|
|
4970
5004
|
return {
|
|
4971
5005
|
/**
|
|
@@ -4975,7 +5009,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$2) {
|
|
|
4975
5009
|
* @throws {RequiredError}
|
|
4976
5010
|
*/
|
|
4977
5011
|
getPartnerInfo(...args) {
|
|
4978
|
-
return localVarFp.getPartnerInfo(...args).then((request) => request(axios$
|
|
5012
|
+
return localVarFp.getPartnerInfo(...args).then((request) => request(axios$3, basePath));
|
|
4979
5013
|
},
|
|
4980
5014
|
/**
|
|
4981
5015
|
* Returns a list of all supported Exchanges.
|
|
@@ -4984,7 +5018,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$2) {
|
|
|
4984
5018
|
* @throws {RequiredError}
|
|
4985
5019
|
*/
|
|
4986
5020
|
getStockExchanges(...args) {
|
|
4987
|
-
return localVarFp.getStockExchanges(...args).then((request) => request(axios$
|
|
5021
|
+
return localVarFp.getStockExchanges(...args).then((request) => request(axios$3, basePath));
|
|
4988
5022
|
},
|
|
4989
5023
|
/**
|
|
4990
5024
|
* 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.
|
|
@@ -4994,7 +5028,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$2) {
|
|
|
4994
5028
|
* @throws {RequiredError}
|
|
4995
5029
|
*/
|
|
4996
5030
|
getSymbols(requestParameters = {}, options) {
|
|
4997
|
-
return localVarFp.getSymbols(requestParameters, options).then((request) => request(axios$
|
|
5031
|
+
return localVarFp.getSymbols(requestParameters, options).then((request) => request(axios$3, basePath));
|
|
4998
5032
|
},
|
|
4999
5033
|
/**
|
|
5000
5034
|
* Returns the Universal Symbol object specified by the ticker or the Universal Symbol ID. When a ticker is specified, the first matching result is returned. We largely follow the [Yahoo Finance ticker format](https://help.yahoo.com/kb/SLN2310.html)(click on \"Yahoo Finance Market Coverage and Data Delays\"). For example, for securities traded on the Toronto Stock Exchange, the symbol has a \'.TO\' suffix. For securities traded on NASDAQ or NYSE, the symbol does not have a suffix. Please use the ticker with the proper suffix for the best results.
|
|
@@ -5004,7 +5038,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$2) {
|
|
|
5004
5038
|
* @throws {RequiredError}
|
|
5005
5039
|
*/
|
|
5006
5040
|
getSymbolsByTicker(requestParameters, options) {
|
|
5007
|
-
return localVarFp.getSymbolsByTicker(requestParameters, options).then((request) => request(axios$
|
|
5041
|
+
return localVarFp.getSymbolsByTicker(requestParameters, options).then((request) => request(axios$3, basePath));
|
|
5008
5042
|
},
|
|
5009
5043
|
/**
|
|
5010
5044
|
* Returns a list of all defined Brokerage authorization Type objects.
|
|
@@ -5014,7 +5048,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$2) {
|
|
|
5014
5048
|
* @throws {RequiredError}
|
|
5015
5049
|
*/
|
|
5016
5050
|
listAllBrokerageAuthorizationType(requestParameters = {}, options) {
|
|
5017
|
-
return localVarFp.listAllBrokerageAuthorizationType(requestParameters, options).then((request) => request(axios$
|
|
5051
|
+
return localVarFp.listAllBrokerageAuthorizationType(requestParameters, options).then((request) => request(axios$3, basePath));
|
|
5018
5052
|
},
|
|
5019
5053
|
/**
|
|
5020
5054
|
* 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.
|
|
@@ -5024,7 +5058,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$2) {
|
|
|
5024
5058
|
* @throws {RequiredError}
|
|
5025
5059
|
*/
|
|
5026
5060
|
listAllBrokerageInstruments(requestParameters, options) {
|
|
5027
|
-
return localVarFp.listAllBrokerageInstruments(requestParameters, options).then((request) => request(axios$
|
|
5061
|
+
return localVarFp.listAllBrokerageInstruments(requestParameters, options).then((request) => request(axios$3, basePath));
|
|
5028
5062
|
},
|
|
5029
5063
|
/**
|
|
5030
5064
|
* Returns a list of all defined Brokerage objects.
|
|
@@ -5033,7 +5067,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$2) {
|
|
|
5033
5067
|
* @throws {RequiredError}
|
|
5034
5068
|
*/
|
|
5035
5069
|
listAllBrokerages(...args) {
|
|
5036
|
-
return localVarFp.listAllBrokerages(...args).then((request) => request(axios$
|
|
5070
|
+
return localVarFp.listAllBrokerages(...args).then((request) => request(axios$3, basePath));
|
|
5037
5071
|
},
|
|
5038
5072
|
/**
|
|
5039
5073
|
* 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.
|
|
@@ -5043,7 +5077,7 @@ const ReferenceDataApiFactory = function(configuration, basePath, axios$2) {
|
|
|
5043
5077
|
* @throws {RequiredError}
|
|
5044
5078
|
*/
|
|
5045
5079
|
symbolSearchUserAccount(requestParameters, options) {
|
|
5046
|
-
return localVarFp.symbolSearchUserAccount(requestParameters, options).then((request) => request(axios$
|
|
5080
|
+
return localVarFp.symbolSearchUserAccount(requestParameters, options).then((request) => request(axios$3, basePath));
|
|
5047
5081
|
}
|
|
5048
5082
|
};
|
|
5049
5083
|
};
|
|
@@ -6638,7 +6672,7 @@ const TradingApiFp = function(configuration) {
|
|
|
6638
6672
|
* TradingApi - factory interface
|
|
6639
6673
|
* @export
|
|
6640
6674
|
*/
|
|
6641
|
-
const TradingApiFactory = function(configuration, basePath, axios$
|
|
6675
|
+
const TradingApiFactory = function(configuration, basePath, axios$2) {
|
|
6642
6676
|
const localVarFp = TradingApiFp(configuration);
|
|
6643
6677
|
return {
|
|
6644
6678
|
/**
|
|
@@ -6649,7 +6683,7 @@ const TradingApiFactory = function(configuration, basePath, axios$1) {
|
|
|
6649
6683
|
* @throws {RequiredError}
|
|
6650
6684
|
*/
|
|
6651
6685
|
cancelOrder(requestParameters, options) {
|
|
6652
|
-
return localVarFp.cancelOrder(requestParameters, options).then((request) => request(axios$
|
|
6686
|
+
return localVarFp.cancelOrder(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6653
6687
|
},
|
|
6654
6688
|
/**
|
|
6655
6689
|
* Gets a quote for the specified account.
|
|
@@ -6659,7 +6693,7 @@ const TradingApiFactory = function(configuration, basePath, axios$1) {
|
|
|
6659
6693
|
* @throws {RequiredError}
|
|
6660
6694
|
*/
|
|
6661
6695
|
getCryptocurrencyPairQuote(requestParameters, options) {
|
|
6662
|
-
return localVarFp.getCryptocurrencyPairQuote(requestParameters, options).then((request) => request(axios$
|
|
6696
|
+
return localVarFp.getCryptocurrencyPairQuote(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6663
6697
|
},
|
|
6664
6698
|
/**
|
|
6665
6699
|
* 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.
|
|
@@ -6669,7 +6703,7 @@ const TradingApiFactory = function(configuration, basePath, axios$1) {
|
|
|
6669
6703
|
* @throws {RequiredError}
|
|
6670
6704
|
*/
|
|
6671
6705
|
getOptionImpact(requestParameters, options) {
|
|
6672
|
-
return localVarFp.getOptionImpact(requestParameters, options).then((request) => request(axios$
|
|
6706
|
+
return localVarFp.getOptionImpact(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6673
6707
|
},
|
|
6674
6708
|
/**
|
|
6675
6709
|
* 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.
|
|
@@ -6679,7 +6713,7 @@ const TradingApiFactory = function(configuration, basePath, axios$1) {
|
|
|
6679
6713
|
* @throws {RequiredError}
|
|
6680
6714
|
*/
|
|
6681
6715
|
getOrderImpact(requestParameters, options) {
|
|
6682
|
-
return localVarFp.getOrderImpact(requestParameters, options).then((request) => request(axios$
|
|
6716
|
+
return localVarFp.getOrderImpact(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6683
6717
|
},
|
|
6684
6718
|
/**
|
|
6685
6719
|
* 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. **This Endpoint is deprecated and will cease to return data as of October 1, 2026**
|
|
@@ -6690,7 +6724,7 @@ const TradingApiFactory = function(configuration, basePath, axios$1) {
|
|
|
6690
6724
|
* @throws {RequiredError}
|
|
6691
6725
|
*/
|
|
6692
6726
|
getUserAccountOptionQuotes(requestParameters, options) {
|
|
6693
|
-
return localVarFp.getUserAccountOptionQuotes(requestParameters, options).then((request) => request(axios$
|
|
6727
|
+
return localVarFp.getUserAccountOptionQuotes(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6694
6728
|
},
|
|
6695
6729
|
/**
|
|
6696
6730
|
* 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.
|
|
@@ -6700,7 +6734,7 @@ const TradingApiFactory = function(configuration, basePath, axios$1) {
|
|
|
6700
6734
|
* @throws {RequiredError}
|
|
6701
6735
|
*/
|
|
6702
6736
|
getUserAccountQuotes(requestParameters, options) {
|
|
6703
|
-
return localVarFp.getUserAccountQuotes(requestParameters, options).then((request) => request(axios$
|
|
6737
|
+
return localVarFp.getUserAccountQuotes(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6704
6738
|
},
|
|
6705
6739
|
/**
|
|
6706
6740
|
* 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.
|
|
@@ -6710,7 +6744,7 @@ const TradingApiFactory = function(configuration, basePath, axios$1) {
|
|
|
6710
6744
|
* @throws {RequiredError}
|
|
6711
6745
|
*/
|
|
6712
6746
|
placeComplexOrder(requestParameters, options) {
|
|
6713
|
-
return localVarFp.placeComplexOrder(requestParameters, options).then((request) => request(axios$
|
|
6747
|
+
return localVarFp.placeComplexOrder(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6714
6748
|
},
|
|
6715
6749
|
/**
|
|
6716
6750
|
* 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.
|
|
@@ -6720,7 +6754,7 @@ const TradingApiFactory = function(configuration, basePath, axios$1) {
|
|
|
6720
6754
|
* @throws {RequiredError}
|
|
6721
6755
|
*/
|
|
6722
6756
|
placeCryptoOrder(requestParameters, options) {
|
|
6723
|
-
return localVarFp.placeCryptoOrder(requestParameters, options).then((request) => request(axios$
|
|
6757
|
+
return localVarFp.placeCryptoOrder(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6724
6758
|
},
|
|
6725
6759
|
/**
|
|
6726
6760
|
* 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.
|
|
@@ -6730,7 +6764,7 @@ const TradingApiFactory = function(configuration, basePath, axios$1) {
|
|
|
6730
6764
|
* @throws {RequiredError}
|
|
6731
6765
|
*/
|
|
6732
6766
|
placeForceOrder(requestParameters, options) {
|
|
6733
|
-
return localVarFp.placeForceOrder(requestParameters, options).then((request) => request(axios$
|
|
6767
|
+
return localVarFp.placeForceOrder(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6734
6768
|
},
|
|
6735
6769
|
/**
|
|
6736
6770
|
* Places a multi-leg option order. Only supported on certain option trading brokerages. https://support.snaptrade.com/brokerages has information on brokerage trading support
|
|
@@ -6740,7 +6774,7 @@ const TradingApiFactory = function(configuration, basePath, axios$1) {
|
|
|
6740
6774
|
* @throws {RequiredError}
|
|
6741
6775
|
*/
|
|
6742
6776
|
placeMlegOrder(requestParameters, options) {
|
|
6743
|
-
return localVarFp.placeMlegOrder(requestParameters, options).then((request) => request(axios$
|
|
6777
|
+
return localVarFp.placeMlegOrder(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6744
6778
|
},
|
|
6745
6779
|
/**
|
|
6746
6780
|
* 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.
|
|
@@ -6750,7 +6784,7 @@ const TradingApiFactory = function(configuration, basePath, axios$1) {
|
|
|
6750
6784
|
* @throws {RequiredError}
|
|
6751
6785
|
*/
|
|
6752
6786
|
placeOrder(requestParameters, options) {
|
|
6753
|
-
return localVarFp.placeOrder(requestParameters, options).then((request) => request(axios$
|
|
6787
|
+
return localVarFp.placeOrder(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6754
6788
|
},
|
|
6755
6789
|
/**
|
|
6756
6790
|
* Previews an order using the specified account.
|
|
@@ -6760,7 +6794,7 @@ const TradingApiFactory = function(configuration, basePath, axios$1) {
|
|
|
6760
6794
|
* @throws {RequiredError}
|
|
6761
6795
|
*/
|
|
6762
6796
|
previewCryptoOrder(requestParameters, options) {
|
|
6763
|
-
return localVarFp.previewCryptoOrder(requestParameters, options).then((request) => request(axios$
|
|
6797
|
+
return localVarFp.previewCryptoOrder(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6764
6798
|
},
|
|
6765
6799
|
/**
|
|
6766
6800
|
* 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
|
|
@@ -6770,7 +6804,7 @@ const TradingApiFactory = function(configuration, basePath, axios$1) {
|
|
|
6770
6804
|
* @throws {RequiredError}
|
|
6771
6805
|
*/
|
|
6772
6806
|
replaceOrder(requestParameters, options) {
|
|
6773
|
-
return localVarFp.replaceOrder(requestParameters, options).then((request) => request(axios$
|
|
6807
|
+
return localVarFp.replaceOrder(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6774
6808
|
},
|
|
6775
6809
|
/**
|
|
6776
6810
|
* Searches cryptocurrency pairs instruments accessible to the specified account. Both `base` and `quote` are optional. Omit both for a full list of cryptocurrency pairs.
|
|
@@ -6780,7 +6814,7 @@ const TradingApiFactory = function(configuration, basePath, axios$1) {
|
|
|
6780
6814
|
* @throws {RequiredError}
|
|
6781
6815
|
*/
|
|
6782
6816
|
searchCryptocurrencyPairInstruments(requestParameters, options) {
|
|
6783
|
-
return localVarFp.searchCryptocurrencyPairInstruments(requestParameters, options).then((request) => request(axios$
|
|
6817
|
+
return localVarFp.searchCryptocurrencyPairInstruments(requestParameters, options).then((request) => request(axios$2, basePath));
|
|
6784
6818
|
}
|
|
6785
6819
|
};
|
|
6786
6820
|
};
|
|
@@ -6997,7 +7031,7 @@ var Configuration = class {
|
|
|
6997
7031
|
}
|
|
6998
7032
|
this.basePath = param.basePath;
|
|
6999
7033
|
this.baseOptions = param.baseOptions ?? {};
|
|
7000
|
-
this.userAgent = param.userAgent === void 0 ? "Konfig/12.
|
|
7034
|
+
this.userAgent = param.userAgent === void 0 ? "Konfig/12.2.0/typescript" : param.userAgent;
|
|
7001
7035
|
this.formDataCtor = param.formDataCtor;
|
|
7002
7036
|
}
|
|
7003
7037
|
/**
|