snaptrade-typescript-sdk 9.0.168 → 9.0.170
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 +75 -1
- package/dist/api/connections-api-generated.d.ts +61 -0
- package/dist/api/connections-api-generated.js +89 -0
- package/dist/api/experimental-endpoints-api-generated.d.ts +61 -0
- package/dist/api/experimental-endpoints-api-generated.js +89 -0
- package/dist/browser.js +1 -1
- package/dist/configuration.js +1 -1
- package/dist/models/account-value-history-item.d.ts +20 -0
- package/dist/models/account-value-history-item.js +2 -0
- package/dist/models/account-value-history-response.d.ts +21 -0
- package/dist/models/account-value-history-response.js +2 -0
- package/dist/models/brokerage.d.ts +6 -0
- package/dist/models/delete-connection-confirmation.d.ts +20 -0
- package/dist/models/delete-connection-confirmation.js +2 -0
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.js +3 -0
- package/dist/operationParameterMap.js +26 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Connect brokerage accounts to your app for live positions and trading
|
|
8
8
|
|
|
9
|
-
[](https://www.npmjs.com/package/snaptrade-typescript-sdk/v/9.0.170)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -36,6 +36,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
36
36
|
* [`snaptrade.authentication.loginSnapTradeUser`](#snaptradeauthenticationloginsnaptradeuser)
|
|
37
37
|
* [`snaptrade.authentication.registerSnapTradeUser`](#snaptradeauthenticationregistersnaptradeuser)
|
|
38
38
|
* [`snaptrade.authentication.resetSnapTradeUserSecret`](#snaptradeauthenticationresetsnaptradeusersecret)
|
|
39
|
+
* [`snaptrade.connections.deleteConnection`](#snaptradeconnectionsdeleteconnection)
|
|
39
40
|
* [`snaptrade.connections.detailBrokerageAuthorization`](#snaptradeconnectionsdetailbrokerageauthorization)
|
|
40
41
|
* [`snaptrade.connections.disableBrokerageAuthorization`](#snaptradeconnectionsdisablebrokerageauthorization)
|
|
41
42
|
* [`snaptrade.connections.listBrokerageAuthorizations`](#snaptradeconnectionslistbrokerageauthorizations)
|
|
@@ -43,6 +44,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
43
44
|
* [`snaptrade.connections.removeBrokerageAuthorization`](#snaptradeconnectionsremovebrokerageauthorization)
|
|
44
45
|
* [`snaptrade.connections.returnRates`](#snaptradeconnectionsreturnrates)
|
|
45
46
|
* [`snaptrade.connections.sessionEvents`](#snaptradeconnectionssessionevents)
|
|
47
|
+
* [`snaptrade.experimentalEndpoints.getAccountBalanceHistory`](#snaptradeexperimentalendpointsgetaccountbalancehistory)
|
|
46
48
|
* [`snaptrade.experimentalEndpoints.getUserAccountOrderDetailV2`](#snaptradeexperimentalendpointsgetuseraccountorderdetailv2)
|
|
47
49
|
* [`snaptrade.experimentalEndpoints.getUserAccountOrdersV2`](#snaptradeexperimentalendpointsgetuseraccountordersv2)
|
|
48
50
|
* [`snaptrade.experimentalEndpoints.getUserAccountRecentOrdersV2`](#snaptradeexperimentalendpointsgetuseraccountrecentordersv2)
|
|
@@ -957,6 +959,41 @@ SnapTrade User Secret. This is a randomly generated string and should be stored
|
|
|
957
959
|
---
|
|
958
960
|
|
|
959
961
|
|
|
962
|
+
### `snaptrade.connections.deleteConnection`<a id="snaptradeconnectionsdeleteconnection"></a>
|
|
963
|
+
|
|
964
|
+
Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [`CONNECTION_DELETED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
|
|
965
|
+
|
|
966
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
967
|
+
|
|
968
|
+
```typescript
|
|
969
|
+
const deleteConnectionResponse = await snaptrade.connections.deleteConnection({
|
|
970
|
+
connectionId: "87b24961-b51e-4db8-9226-f198f6518a89",
|
|
971
|
+
userId: "snaptrade-user-123",
|
|
972
|
+
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
973
|
+
});
|
|
974
|
+
```
|
|
975
|
+
|
|
976
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
977
|
+
|
|
978
|
+
##### connectionId: `string`<a id="connectionid-string"></a>
|
|
979
|
+
|
|
980
|
+
##### userId: `string`<a id="userid-string"></a>
|
|
981
|
+
|
|
982
|
+
##### userSecret: `string`<a id="usersecret-string"></a>
|
|
983
|
+
|
|
984
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
985
|
+
|
|
986
|
+
[DeleteConnectionConfirmation](./models/delete-connection-confirmation.ts)
|
|
987
|
+
|
|
988
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
989
|
+
|
|
990
|
+
`/connection/{connectionId}` `DELETE`
|
|
991
|
+
|
|
992
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
993
|
+
|
|
994
|
+
---
|
|
995
|
+
|
|
996
|
+
|
|
960
997
|
### `snaptrade.connections.detailBrokerageAuthorization`<a id="snaptradeconnectionsdetailbrokerageauthorization"></a>
|
|
961
998
|
|
|
962
999
|
Returns a single connection for the specified ID.
|
|
@@ -1220,6 +1257,43 @@ Optional comma separated list of session IDs used to filter the request on speci
|
|
|
1220
1257
|
---
|
|
1221
1258
|
|
|
1222
1259
|
|
|
1260
|
+
### `snaptrade.experimentalEndpoints.getAccountBalanceHistory`<a id="snaptradeexperimentalendpointsgetaccountbalancehistory"></a>
|
|
1261
|
+
|
|
1262
|
+
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 only available for certain brokerages with a maximum lookback of 1 year.
|
|
1263
|
+
|
|
1264
|
+
|
|
1265
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1266
|
+
|
|
1267
|
+
```typescript
|
|
1268
|
+
const getAccountBalanceHistoryResponse =
|
|
1269
|
+
await snaptrade.experimentalEndpoints.getAccountBalanceHistory({
|
|
1270
|
+
userId: "snaptrade-user-123",
|
|
1271
|
+
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1272
|
+
accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
1273
|
+
});
|
|
1274
|
+
```
|
|
1275
|
+
|
|
1276
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1277
|
+
|
|
1278
|
+
##### userId: `string`<a id="userid-string"></a>
|
|
1279
|
+
|
|
1280
|
+
##### userSecret: `string`<a id="usersecret-string"></a>
|
|
1281
|
+
|
|
1282
|
+
##### accountId: `string`<a id="accountid-string"></a>
|
|
1283
|
+
|
|
1284
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
1285
|
+
|
|
1286
|
+
[AccountValueHistoryResponse](./models/account-value-history-response.ts)
|
|
1287
|
+
|
|
1288
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1289
|
+
|
|
1290
|
+
`/accounts/{accountId}/balanceHistory` `GET`
|
|
1291
|
+
|
|
1292
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1293
|
+
|
|
1294
|
+
---
|
|
1295
|
+
|
|
1296
|
+
|
|
1223
1297
|
### `snaptrade.experimentalEndpoints.getUserAccountOrderDetailV2`<a id="snaptradeexperimentalendpointsgetuseraccountorderdetailv2"></a>
|
|
1224
1298
|
|
|
1225
1299
|
Returns the detail of a single order using the brokerage order ID provided as a path parameter.
|
|
@@ -5,12 +5,23 @@ import { BrokerageAuthorization } from '../models';
|
|
|
5
5
|
import { BrokerageAuthorizationDisabledConfirmation } from '../models';
|
|
6
6
|
import { BrokerageAuthorizationRefreshConfirmation } from '../models';
|
|
7
7
|
import { ConnectionsSessionEvents200ResponseInner } from '../models';
|
|
8
|
+
import { DeleteConnectionConfirmation } from '../models';
|
|
8
9
|
import { RateOfReturnResponse } from '../models';
|
|
9
10
|
/**
|
|
10
11
|
* ConnectionsApi - axios parameter creator
|
|
11
12
|
* @export
|
|
12
13
|
*/
|
|
13
14
|
export declare const ConnectionsApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
15
|
+
/**
|
|
16
|
+
* Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [`CONNECTION_DELETED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
|
|
17
|
+
* @summary Delete connection
|
|
18
|
+
* @param {string} connectionId
|
|
19
|
+
* @param {string} userId
|
|
20
|
+
* @param {string} userSecret
|
|
21
|
+
* @param {*} [options] Override http request option.
|
|
22
|
+
* @throws {RequiredError}
|
|
23
|
+
*/
|
|
24
|
+
deleteConnection: (connectionId: string, userId: string, userSecret: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
14
25
|
/**
|
|
15
26
|
* Returns a single connection for the specified ID.
|
|
16
27
|
* @summary Get connection detail
|
|
@@ -86,6 +97,14 @@ export declare const ConnectionsApiAxiosParamCreator: (configuration?: Configura
|
|
|
86
97
|
* @export
|
|
87
98
|
*/
|
|
88
99
|
export declare const ConnectionsApiFp: (configuration?: Configuration) => {
|
|
100
|
+
/**
|
|
101
|
+
* Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [`CONNECTION_DELETED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
|
|
102
|
+
* @summary Delete connection
|
|
103
|
+
* @param {ConnectionsApiDeleteConnectionRequest} requestParameters Request parameters.
|
|
104
|
+
* @param {*} [options] Override http request option.
|
|
105
|
+
* @throws {RequiredError}
|
|
106
|
+
*/
|
|
107
|
+
deleteConnection(requestParameters: ConnectionsApiDeleteConnectionRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DeleteConnectionConfirmation>>;
|
|
89
108
|
/**
|
|
90
109
|
* Returns a single connection for the specified ID.
|
|
91
110
|
* @summary Get connection detail
|
|
@@ -148,6 +167,14 @@ export declare const ConnectionsApiFp: (configuration?: Configuration) => {
|
|
|
148
167
|
* @export
|
|
149
168
|
*/
|
|
150
169
|
export declare const ConnectionsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
170
|
+
/**
|
|
171
|
+
* Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [`CONNECTION_DELETED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
|
|
172
|
+
* @summary Delete connection
|
|
173
|
+
* @param {ConnectionsApiDeleteConnectionRequest} requestParameters Request parameters.
|
|
174
|
+
* @param {*} [options] Override http request option.
|
|
175
|
+
* @throws {RequiredError}
|
|
176
|
+
*/
|
|
177
|
+
deleteConnection(requestParameters: ConnectionsApiDeleteConnectionRequest, options?: AxiosRequestConfig): AxiosPromise<DeleteConnectionConfirmation>;
|
|
151
178
|
/**
|
|
152
179
|
* Returns a single connection for the specified ID.
|
|
153
180
|
* @summary Get connection detail
|
|
@@ -205,6 +232,31 @@ export declare const ConnectionsApiFactory: (configuration?: Configuration, base
|
|
|
205
232
|
*/
|
|
206
233
|
sessionEvents(requestParameters: ConnectionsApiSessionEventsRequest, options?: AxiosRequestConfig): AxiosPromise<Array<ConnectionsSessionEvents200ResponseInner>>;
|
|
207
234
|
};
|
|
235
|
+
/**
|
|
236
|
+
* Request parameters for deleteConnection operation in ConnectionsApi.
|
|
237
|
+
* @export
|
|
238
|
+
* @interface ConnectionsApiDeleteConnectionRequest
|
|
239
|
+
*/
|
|
240
|
+
export type ConnectionsApiDeleteConnectionRequest = {
|
|
241
|
+
/**
|
|
242
|
+
*
|
|
243
|
+
* @type {string}
|
|
244
|
+
* @memberof ConnectionsApiDeleteConnection
|
|
245
|
+
*/
|
|
246
|
+
readonly connectionId: string;
|
|
247
|
+
/**
|
|
248
|
+
*
|
|
249
|
+
* @type {string}
|
|
250
|
+
* @memberof ConnectionsApiDeleteConnection
|
|
251
|
+
*/
|
|
252
|
+
readonly userId: string;
|
|
253
|
+
/**
|
|
254
|
+
*
|
|
255
|
+
* @type {string}
|
|
256
|
+
* @memberof ConnectionsApiDeleteConnection
|
|
257
|
+
*/
|
|
258
|
+
readonly userSecret: string;
|
|
259
|
+
};
|
|
208
260
|
/**
|
|
209
261
|
* Request parameters for detailBrokerageAuthorization operation in ConnectionsApi.
|
|
210
262
|
* @export
|
|
@@ -381,6 +433,15 @@ export type ConnectionsApiSessionEventsRequest = {
|
|
|
381
433
|
* @extends {BaseAPI}
|
|
382
434
|
*/
|
|
383
435
|
export declare class ConnectionsApiGenerated extends BaseAPI {
|
|
436
|
+
/**
|
|
437
|
+
* Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [`CONNECTION_DELETED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
|
|
438
|
+
* @summary Delete connection
|
|
439
|
+
* @param {ConnectionsApiDeleteConnectionRequest} requestParameters Request parameters.
|
|
440
|
+
* @param {*} [options] Override http request option.
|
|
441
|
+
* @throws {RequiredError}
|
|
442
|
+
* @memberof ConnectionsApiGenerated
|
|
443
|
+
*/
|
|
444
|
+
deleteConnection(requestParameters: ConnectionsApiDeleteConnectionRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<DeleteConnectionConfirmation, any>>;
|
|
384
445
|
/**
|
|
385
446
|
* Returns a single connection for the specified ID.
|
|
386
447
|
* @summary Get connection detail
|
|
@@ -35,6 +35,61 @@ const requestBeforeHook_1 = require("../requestBeforeHook");
|
|
|
35
35
|
*/
|
|
36
36
|
const ConnectionsApiAxiosParamCreator = function (configuration) {
|
|
37
37
|
return {
|
|
38
|
+
/**
|
|
39
|
+
* Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [`CONNECTION_DELETED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
|
|
40
|
+
* @summary Delete connection
|
|
41
|
+
* @param {string} connectionId
|
|
42
|
+
* @param {string} userId
|
|
43
|
+
* @param {string} userSecret
|
|
44
|
+
* @param {*} [options] Override http request option.
|
|
45
|
+
* @throws {RequiredError}
|
|
46
|
+
*/
|
|
47
|
+
deleteConnection: (connectionId, userId, userSecret, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
// verify required parameter 'connectionId' is not null or undefined
|
|
49
|
+
(0, common_1.assertParamExists)('deleteConnection', 'connectionId', connectionId);
|
|
50
|
+
// verify required parameter 'userId' is not null or undefined
|
|
51
|
+
(0, common_1.assertParamExists)('deleteConnection', 'userId', userId);
|
|
52
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
53
|
+
(0, common_1.assertParamExists)('deleteConnection', 'userSecret', userSecret);
|
|
54
|
+
const localVarPath = `/connection/{connectionId}`
|
|
55
|
+
.replace(`{${"connectionId"}}`, encodeURIComponent(String(connectionId !== undefined ? connectionId : `-connectionId-`)));
|
|
56
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
57
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
58
|
+
let baseOptions;
|
|
59
|
+
if (configuration) {
|
|
60
|
+
baseOptions = configuration.baseOptions;
|
|
61
|
+
}
|
|
62
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
|
|
63
|
+
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
64
|
+
const localVarQueryParameter = {};
|
|
65
|
+
// authentication PartnerClientId required
|
|
66
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
|
|
67
|
+
// authentication PartnerSignature required
|
|
68
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
|
|
69
|
+
// authentication PartnerTimestamp required
|
|
70
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
|
|
71
|
+
if (userId !== undefined) {
|
|
72
|
+
localVarQueryParameter['userId'] = userId;
|
|
73
|
+
}
|
|
74
|
+
if (userSecret !== undefined) {
|
|
75
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
76
|
+
}
|
|
77
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
78
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
79
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
80
|
+
queryParameters: localVarQueryParameter,
|
|
81
|
+
requestConfig: localVarRequestOptions,
|
|
82
|
+
path: localVarPath,
|
|
83
|
+
configuration,
|
|
84
|
+
pathTemplate: '/connection/{connectionId}',
|
|
85
|
+
httpMethod: 'DELETE'
|
|
86
|
+
});
|
|
87
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
88
|
+
return {
|
|
89
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
90
|
+
options: localVarRequestOptions,
|
|
91
|
+
};
|
|
92
|
+
}),
|
|
38
93
|
/**
|
|
39
94
|
* Returns a single connection for the specified ID.
|
|
40
95
|
* @summary Get connection detail
|
|
@@ -424,6 +479,19 @@ exports.ConnectionsApiAxiosParamCreator = ConnectionsApiAxiosParamCreator;
|
|
|
424
479
|
const ConnectionsApiFp = function (configuration) {
|
|
425
480
|
const localVarAxiosParamCreator = (0, exports.ConnectionsApiAxiosParamCreator)(configuration);
|
|
426
481
|
return {
|
|
482
|
+
/**
|
|
483
|
+
* Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [`CONNECTION_DELETED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
|
|
484
|
+
* @summary Delete connection
|
|
485
|
+
* @param {ConnectionsApiDeleteConnectionRequest} requestParameters Request parameters.
|
|
486
|
+
* @param {*} [options] Override http request option.
|
|
487
|
+
* @throws {RequiredError}
|
|
488
|
+
*/
|
|
489
|
+
deleteConnection(requestParameters, options) {
|
|
490
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
491
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteConnection(requestParameters.connectionId, requestParameters.userId, requestParameters.userSecret, options);
|
|
492
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
493
|
+
});
|
|
494
|
+
},
|
|
427
495
|
/**
|
|
428
496
|
* Returns a single connection for the specified ID.
|
|
429
497
|
* @summary Get connection detail
|
|
@@ -525,6 +593,16 @@ exports.ConnectionsApiFp = ConnectionsApiFp;
|
|
|
525
593
|
const ConnectionsApiFactory = function (configuration, basePath, axios) {
|
|
526
594
|
const localVarFp = (0, exports.ConnectionsApiFp)(configuration);
|
|
527
595
|
return {
|
|
596
|
+
/**
|
|
597
|
+
* Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [`CONNECTION_DELETED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
|
|
598
|
+
* @summary Delete connection
|
|
599
|
+
* @param {ConnectionsApiDeleteConnectionRequest} requestParameters Request parameters.
|
|
600
|
+
* @param {*} [options] Override http request option.
|
|
601
|
+
* @throws {RequiredError}
|
|
602
|
+
*/
|
|
603
|
+
deleteConnection(requestParameters, options) {
|
|
604
|
+
return localVarFp.deleteConnection(requestParameters, options).then((request) => request(axios, basePath));
|
|
605
|
+
},
|
|
528
606
|
/**
|
|
529
607
|
* Returns a single connection for the specified ID.
|
|
530
608
|
* @summary Get connection detail
|
|
@@ -605,6 +683,17 @@ exports.ConnectionsApiFactory = ConnectionsApiFactory;
|
|
|
605
683
|
* @extends {BaseAPI}
|
|
606
684
|
*/
|
|
607
685
|
class ConnectionsApiGenerated extends base_1.BaseAPI {
|
|
686
|
+
/**
|
|
687
|
+
* Deletes the SnapTrade connection specified by the ID. This will also remove the accounts and holdings data associated with the connection from SnapTrade. This action is irreversible. This endpoint is asynchronous, a 200 response indicates that a task has been queued to delete the connection. Listen for the [`CONNECTION_DELETED` webhook](https://docs.snaptrade.com/docs/webhooks#webhooks-connection_deleted) webhook to know when the deletion has been completed and the data has been removed.
|
|
688
|
+
* @summary Delete connection
|
|
689
|
+
* @param {ConnectionsApiDeleteConnectionRequest} requestParameters Request parameters.
|
|
690
|
+
* @param {*} [options] Override http request option.
|
|
691
|
+
* @throws {RequiredError}
|
|
692
|
+
* @memberof ConnectionsApiGenerated
|
|
693
|
+
*/
|
|
694
|
+
deleteConnection(requestParameters, options) {
|
|
695
|
+
return (0, exports.ConnectionsApiFp)(this.configuration).deleteConnection(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
696
|
+
}
|
|
608
697
|
/**
|
|
609
698
|
* Returns a single connection for the specified ID.
|
|
610
699
|
* @summary Get connection detail
|
|
@@ -3,11 +3,22 @@ import { Configuration } from '../configuration';
|
|
|
3
3
|
import { RequestArgs, BaseAPI } from '../base';
|
|
4
4
|
import { AccountOrderRecordV2 } from '../models';
|
|
5
5
|
import { AccountOrdersV2Response } from '../models';
|
|
6
|
+
import { AccountValueHistoryResponse } from '../models';
|
|
6
7
|
/**
|
|
7
8
|
* ExperimentalEndpointsApi - axios parameter creator
|
|
8
9
|
* @export
|
|
9
10
|
*/
|
|
10
11
|
export declare const ExperimentalEndpointsApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
12
|
+
/**
|
|
13
|
+
* 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 only available for certain brokerages with a maximum lookback of 1 year.
|
|
14
|
+
* @summary List historical account total value
|
|
15
|
+
* @param {string} userId
|
|
16
|
+
* @param {string} userSecret
|
|
17
|
+
* @param {string} accountId
|
|
18
|
+
* @param {*} [options] Override http request option.
|
|
19
|
+
* @throws {RequiredError}
|
|
20
|
+
*/
|
|
21
|
+
getAccountBalanceHistory: (userId: string, userSecret: string, accountId: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
11
22
|
/**
|
|
12
23
|
* 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.
|
|
13
24
|
* @summary Get account order detail (V2)
|
|
@@ -48,6 +59,14 @@ export declare const ExperimentalEndpointsApiAxiosParamCreator: (configuration?:
|
|
|
48
59
|
* @export
|
|
49
60
|
*/
|
|
50
61
|
export declare const ExperimentalEndpointsApiFp: (configuration?: Configuration) => {
|
|
62
|
+
/**
|
|
63
|
+
* 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 only available for certain brokerages with a maximum lookback of 1 year.
|
|
64
|
+
* @summary List historical account total value
|
|
65
|
+
* @param {ExperimentalEndpointsApiGetAccountBalanceHistoryRequest} requestParameters Request parameters.
|
|
66
|
+
* @param {*} [options] Override http request option.
|
|
67
|
+
* @throws {RequiredError}
|
|
68
|
+
*/
|
|
69
|
+
getAccountBalanceHistory(requestParameters: ExperimentalEndpointsApiGetAccountBalanceHistoryRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AccountValueHistoryResponse>>;
|
|
51
70
|
/**
|
|
52
71
|
* 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.
|
|
53
72
|
* @summary Get account order detail (V2)
|
|
@@ -78,6 +97,14 @@ export declare const ExperimentalEndpointsApiFp: (configuration?: Configuration)
|
|
|
78
97
|
* @export
|
|
79
98
|
*/
|
|
80
99
|
export declare const ExperimentalEndpointsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
100
|
+
/**
|
|
101
|
+
* 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 only available for certain brokerages with a maximum lookback of 1 year.
|
|
102
|
+
* @summary List historical account total value
|
|
103
|
+
* @param {ExperimentalEndpointsApiGetAccountBalanceHistoryRequest} requestParameters Request parameters.
|
|
104
|
+
* @param {*} [options] Override http request option.
|
|
105
|
+
* @throws {RequiredError}
|
|
106
|
+
*/
|
|
107
|
+
getAccountBalanceHistory(requestParameters: ExperimentalEndpointsApiGetAccountBalanceHistoryRequest, options?: AxiosRequestConfig): AxiosPromise<AccountValueHistoryResponse>;
|
|
81
108
|
/**
|
|
82
109
|
* 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.
|
|
83
110
|
* @summary Get account order detail (V2)
|
|
@@ -103,6 +130,31 @@ export declare const ExperimentalEndpointsApiFactory: (configuration?: Configura
|
|
|
103
130
|
*/
|
|
104
131
|
getUserAccountRecentOrdersV2(requestParameters: ExperimentalEndpointsApiGetUserAccountRecentOrdersV2Request, options?: AxiosRequestConfig): AxiosPromise<AccountOrdersV2Response>;
|
|
105
132
|
};
|
|
133
|
+
/**
|
|
134
|
+
* Request parameters for getAccountBalanceHistory operation in ExperimentalEndpointsApi.
|
|
135
|
+
* @export
|
|
136
|
+
* @interface ExperimentalEndpointsApiGetAccountBalanceHistoryRequest
|
|
137
|
+
*/
|
|
138
|
+
export type ExperimentalEndpointsApiGetAccountBalanceHistoryRequest = {
|
|
139
|
+
/**
|
|
140
|
+
*
|
|
141
|
+
* @type {string}
|
|
142
|
+
* @memberof ExperimentalEndpointsApiGetAccountBalanceHistory
|
|
143
|
+
*/
|
|
144
|
+
readonly userId: string;
|
|
145
|
+
/**
|
|
146
|
+
*
|
|
147
|
+
* @type {string}
|
|
148
|
+
* @memberof ExperimentalEndpointsApiGetAccountBalanceHistory
|
|
149
|
+
*/
|
|
150
|
+
readonly userSecret: string;
|
|
151
|
+
/**
|
|
152
|
+
*
|
|
153
|
+
* @type {string}
|
|
154
|
+
* @memberof ExperimentalEndpointsApiGetAccountBalanceHistory
|
|
155
|
+
*/
|
|
156
|
+
readonly accountId: string;
|
|
157
|
+
};
|
|
106
158
|
/**
|
|
107
159
|
* Request parameters for getUserAccountOrderDetailV2 operation in ExperimentalEndpointsApi.
|
|
108
160
|
* @export
|
|
@@ -209,6 +261,15 @@ export type ExperimentalEndpointsApiGetUserAccountRecentOrdersV2Request = {
|
|
|
209
261
|
* @extends {BaseAPI}
|
|
210
262
|
*/
|
|
211
263
|
export declare class ExperimentalEndpointsApiGenerated extends BaseAPI {
|
|
264
|
+
/**
|
|
265
|
+
* 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 only available for certain brokerages with a maximum lookback of 1 year.
|
|
266
|
+
* @summary List historical account total value
|
|
267
|
+
* @param {ExperimentalEndpointsApiGetAccountBalanceHistoryRequest} requestParameters Request parameters.
|
|
268
|
+
* @param {*} [options] Override http request option.
|
|
269
|
+
* @throws {RequiredError}
|
|
270
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
271
|
+
*/
|
|
272
|
+
getAccountBalanceHistory(requestParameters: ExperimentalEndpointsApiGetAccountBalanceHistoryRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<AccountValueHistoryResponse, any>>;
|
|
212
273
|
/**
|
|
213
274
|
* 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.
|
|
214
275
|
* @summary Get account order detail (V2)
|
|
@@ -35,6 +35,61 @@ const requestBeforeHook_1 = require("../requestBeforeHook");
|
|
|
35
35
|
*/
|
|
36
36
|
const ExperimentalEndpointsApiAxiosParamCreator = function (configuration) {
|
|
37
37
|
return {
|
|
38
|
+
/**
|
|
39
|
+
* 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 only available for certain brokerages with a maximum lookback of 1 year.
|
|
40
|
+
* @summary List historical account total value
|
|
41
|
+
* @param {string} userId
|
|
42
|
+
* @param {string} userSecret
|
|
43
|
+
* @param {string} accountId
|
|
44
|
+
* @param {*} [options] Override http request option.
|
|
45
|
+
* @throws {RequiredError}
|
|
46
|
+
*/
|
|
47
|
+
getAccountBalanceHistory: (userId, userSecret, accountId, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
// verify required parameter 'userId' is not null or undefined
|
|
49
|
+
(0, common_1.assertParamExists)('getAccountBalanceHistory', 'userId', userId);
|
|
50
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
51
|
+
(0, common_1.assertParamExists)('getAccountBalanceHistory', 'userSecret', userSecret);
|
|
52
|
+
// verify required parameter 'accountId' is not null or undefined
|
|
53
|
+
(0, common_1.assertParamExists)('getAccountBalanceHistory', 'accountId', accountId);
|
|
54
|
+
const localVarPath = `/accounts/{accountId}/balanceHistory`
|
|
55
|
+
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
56
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
57
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
58
|
+
let baseOptions;
|
|
59
|
+
if (configuration) {
|
|
60
|
+
baseOptions = configuration.baseOptions;
|
|
61
|
+
}
|
|
62
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
63
|
+
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
64
|
+
const localVarQueryParameter = {};
|
|
65
|
+
// authentication PartnerClientId required
|
|
66
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "clientId", keyParamName: "clientId", configuration });
|
|
67
|
+
// authentication PartnerSignature required
|
|
68
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, key: "Signature", keyParamName: "signature", configuration });
|
|
69
|
+
// authentication PartnerTimestamp required
|
|
70
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, key: "timestamp", keyParamName: "timestamp", configuration });
|
|
71
|
+
if (userId !== undefined) {
|
|
72
|
+
localVarQueryParameter['userId'] = userId;
|
|
73
|
+
}
|
|
74
|
+
if (userSecret !== undefined) {
|
|
75
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
76
|
+
}
|
|
77
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
78
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
79
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
80
|
+
queryParameters: localVarQueryParameter,
|
|
81
|
+
requestConfig: localVarRequestOptions,
|
|
82
|
+
path: localVarPath,
|
|
83
|
+
configuration,
|
|
84
|
+
pathTemplate: '/accounts/{accountId}/balanceHistory',
|
|
85
|
+
httpMethod: 'GET'
|
|
86
|
+
});
|
|
87
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
88
|
+
return {
|
|
89
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
90
|
+
options: localVarRequestOptions,
|
|
91
|
+
};
|
|
92
|
+
}),
|
|
38
93
|
/**
|
|
39
94
|
* 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.
|
|
40
95
|
* @summary Get account order detail (V2)
|
|
@@ -226,6 +281,19 @@ exports.ExperimentalEndpointsApiAxiosParamCreator = ExperimentalEndpointsApiAxio
|
|
|
226
281
|
const ExperimentalEndpointsApiFp = function (configuration) {
|
|
227
282
|
const localVarAxiosParamCreator = (0, exports.ExperimentalEndpointsApiAxiosParamCreator)(configuration);
|
|
228
283
|
return {
|
|
284
|
+
/**
|
|
285
|
+
* 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 only available for certain brokerages with a maximum lookback of 1 year.
|
|
286
|
+
* @summary List historical account total value
|
|
287
|
+
* @param {ExperimentalEndpointsApiGetAccountBalanceHistoryRequest} requestParameters Request parameters.
|
|
288
|
+
* @param {*} [options] Override http request option.
|
|
289
|
+
* @throws {RequiredError}
|
|
290
|
+
*/
|
|
291
|
+
getAccountBalanceHistory(requestParameters, options) {
|
|
292
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
293
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getAccountBalanceHistory(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, options);
|
|
294
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
295
|
+
});
|
|
296
|
+
},
|
|
229
297
|
/**
|
|
230
298
|
* 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.
|
|
231
299
|
* @summary Get account order detail (V2)
|
|
@@ -275,6 +343,16 @@ exports.ExperimentalEndpointsApiFp = ExperimentalEndpointsApiFp;
|
|
|
275
343
|
const ExperimentalEndpointsApiFactory = function (configuration, basePath, axios) {
|
|
276
344
|
const localVarFp = (0, exports.ExperimentalEndpointsApiFp)(configuration);
|
|
277
345
|
return {
|
|
346
|
+
/**
|
|
347
|
+
* 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 only available for certain brokerages with a maximum lookback of 1 year.
|
|
348
|
+
* @summary List historical account total value
|
|
349
|
+
* @param {ExperimentalEndpointsApiGetAccountBalanceHistoryRequest} requestParameters Request parameters.
|
|
350
|
+
* @param {*} [options] Override http request option.
|
|
351
|
+
* @throws {RequiredError}
|
|
352
|
+
*/
|
|
353
|
+
getAccountBalanceHistory(requestParameters, options) {
|
|
354
|
+
return localVarFp.getAccountBalanceHistory(requestParameters, options).then((request) => request(axios, basePath));
|
|
355
|
+
},
|
|
278
356
|
/**
|
|
279
357
|
* 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.
|
|
280
358
|
* @summary Get account order detail (V2)
|
|
@@ -315,6 +393,17 @@ exports.ExperimentalEndpointsApiFactory = ExperimentalEndpointsApiFactory;
|
|
|
315
393
|
* @extends {BaseAPI}
|
|
316
394
|
*/
|
|
317
395
|
class ExperimentalEndpointsApiGenerated extends base_1.BaseAPI {
|
|
396
|
+
/**
|
|
397
|
+
* 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 only available for certain brokerages with a maximum lookback of 1 year.
|
|
398
|
+
* @summary List historical account total value
|
|
399
|
+
* @param {ExperimentalEndpointsApiGetAccountBalanceHistoryRequest} requestParameters Request parameters.
|
|
400
|
+
* @param {*} [options] Override http request option.
|
|
401
|
+
* @throws {RequiredError}
|
|
402
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
403
|
+
*/
|
|
404
|
+
getAccountBalanceHistory(requestParameters, options) {
|
|
405
|
+
return (0, exports.ExperimentalEndpointsApiFp)(this.configuration).getAccountBalanceHistory(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
406
|
+
}
|
|
318
407
|
/**
|
|
319
408
|
* 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.
|
|
320
409
|
* @summary Get account order detail (V2)
|