snaptrade-typescript-sdk 5.0.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.konfig/generate-id.txt +1 -1
- package/README.md +2 -2
- package/api/account-information-api.ts +136 -120
- package/api/api-disclaimer-api.ts +14 -19
- package/api/authentication-api.ts +37 -43
- package/api/connections-api.ts +46 -40
- package/api/error-logs-api.ts +12 -10
- package/api/options-api.ts +104 -108
- package/api/portfolio-management-api.ts +259 -253
- package/api/reference-data-api.ts +49 -53
- package/api/trading-api.ts +172 -185
- package/api/transactions-and-reporting-api.ts +64 -60
- package/client.ts +2 -0
- package/configuration.ts +1 -1
- package/dist/api/account-information-api.d.ts +112 -112
- package/dist/api/api-disclaimer-api.d.ts +10 -16
- package/dist/api/api-disclaimer-api.js +1 -1
- package/dist/api/authentication-api.d.ts +27 -40
- package/dist/api/authentication-api.js +2 -2
- package/dist/api/connections-api.d.ts +38 -38
- package/dist/api/error-logs-api.d.ts +10 -10
- package/dist/api/options-api.d.ts +82 -94
- package/dist/api/options-api.js +2 -2
- package/dist/api/portfolio-management-api.d.ts +214 -256
- package/dist/api/portfolio-management-api.js +7 -7
- package/dist/api/reference-data-api.d.ts +37 -50
- package/dist/api/reference-data-api.js +2 -2
- package/dist/api/trading-api.d.ts +131 -160
- package/dist/api/trading-api.js +10 -10
- package/dist/api/transactions-and-reporting-api.d.ts +52 -52
- package/dist/configuration.js +1 -1
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/dist/models/target-asset.d.ts +4 -2
- package/dist/models/trading-cancel-user-account-order-request.d.ts +24 -0
- package/dist/models/trading-cancel-user-account-order-request.js +15 -0
- package/docs/AccountInformationApi.md +72 -88
- package/docs/ApiDisclaimerApi.md +8 -12
- package/docs/ApiStatusApi.md +6 -7
- package/docs/AuthenticationApi.md +34 -48
- package/docs/ConnectionsApi.md +26 -32
- package/docs/ErrorLogsApi.md +8 -10
- package/docs/OptionsApi.md +55 -62
- package/docs/PortfolioManagementApi.md +229 -309
- package/docs/ReferenceDataApi.md +66 -93
- package/docs/TradingApi.md +88 -117
- package/docs/TransactionsAndReportingApi.md +26 -28
- package/index.test.ts +2 -4
- package/models/index.ts +1 -0
- package/models/target-asset.ts +2 -2
- package/models/trading-cancel-user-account-order-request.ts +29 -0
- package/package.json +1 -1
package/docs/TradingApi.md
CHANGED
|
@@ -17,7 +17,8 @@ Method | HTTP request | Description
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
# **cancelUserAccountOrder**
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
#### **POST** /accounts/{accountId}/orders/cancel
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
### Example
|
|
@@ -33,13 +34,14 @@ const snaptrade = new Snaptrade({
|
|
|
33
34
|
clientId: "YOUR_CLIENT_ID",
|
|
34
35
|
})
|
|
35
36
|
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
})
|
|
42
|
-
|
|
37
|
+
const cancelUserAccountOrderResponse = await snaptrade.trading.cancelUserAccountOrder({
|
|
38
|
+
"userId": "John.doe@snaptrade.com",
|
|
39
|
+
"userSecret": "USERSECRET123",
|
|
40
|
+
"accountId": "accountId_example",
|
|
41
|
+
"brokerage_order_id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
console.log(cancelUserAccountOrderResponse)
|
|
43
45
|
|
|
44
46
|
```
|
|
45
47
|
|
|
@@ -48,7 +50,7 @@ console.log(response)
|
|
|
48
50
|
|
|
49
51
|
Name | Type | Description | Notes
|
|
50
52
|
------------- | ------------- | ------------- | -------------
|
|
51
|
-
**
|
|
53
|
+
**tradingCancelUserAccountOrderRequest** | **TradingCancelUserAccountOrderRequest**| The Order ID to be canceled |
|
|
52
54
|
**userId** | [**string**] | | defaults to undefined
|
|
53
55
|
**userSecret** | [**string**] | | defaults to undefined
|
|
54
56
|
**accountId** | [**string**] | The ID of the account get positions. | defaults to undefined
|
|
@@ -58,10 +60,6 @@ Name | Type | Description | Notes
|
|
|
58
60
|
|
|
59
61
|
**AccountOrderRecord**
|
|
60
62
|
|
|
61
|
-
### Authorization
|
|
62
|
-
|
|
63
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
64
|
-
|
|
65
63
|
### HTTP request headers
|
|
66
64
|
|
|
67
65
|
- **Content-Type**: application/json
|
|
@@ -78,7 +76,8 @@ Name | Type | Description | Notes
|
|
|
78
76
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
79
77
|
|
|
80
78
|
# **getCalculatedTradeImpactById**
|
|
81
|
-
|
|
79
|
+
|
|
80
|
+
#### **GET** /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/modify/{tradeId}
|
|
82
81
|
|
|
83
82
|
|
|
84
83
|
### Example
|
|
@@ -94,12 +93,13 @@ const snaptrade = new Snaptrade({
|
|
|
94
93
|
clientId: "YOUR_CLIENT_ID",
|
|
95
94
|
})
|
|
96
95
|
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
})
|
|
102
|
-
|
|
96
|
+
const getCalculatedTradeImpactByIdResponse = await snaptrade.trading.getCalculatedTradeImpactById({
|
|
97
|
+
"portfolioGroupId": "portfolioGroupId_example",
|
|
98
|
+
"calculatedTradeId": "calculatedTradeId_example",
|
|
99
|
+
"tradeId": "tradeId_example",
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
console.log(getCalculatedTradeImpactByIdResponse)
|
|
103
103
|
|
|
104
104
|
```
|
|
105
105
|
|
|
@@ -117,10 +117,6 @@ Name | Type | Description | Notes
|
|
|
117
117
|
|
|
118
118
|
**Trade**
|
|
119
119
|
|
|
120
|
-
### Authorization
|
|
121
|
-
|
|
122
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
123
|
-
|
|
124
120
|
### HTTP request headers
|
|
125
121
|
|
|
126
122
|
- **Content-Type**: Not defined
|
|
@@ -135,7 +131,8 @@ Name | Type | Description | Notes
|
|
|
135
131
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
136
132
|
|
|
137
133
|
# **getCalculatedTradesImpact**
|
|
138
|
-
|
|
134
|
+
|
|
135
|
+
#### **GET** /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/impact
|
|
139
136
|
|
|
140
137
|
|
|
141
138
|
### Example
|
|
@@ -151,11 +148,12 @@ const snaptrade = new Snaptrade({
|
|
|
151
148
|
clientId: "YOUR_CLIENT_ID",
|
|
152
149
|
})
|
|
153
150
|
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
})
|
|
158
|
-
|
|
151
|
+
const getCalculatedTradesImpactResponse = await snaptrade.trading.getCalculatedTradesImpact({
|
|
152
|
+
"portfolioGroupId": "portfolioGroupId_example",
|
|
153
|
+
"calculatedTradeId": "calculatedTradeId_example",
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
console.log(getCalculatedTradesImpactResponse)
|
|
159
157
|
|
|
160
158
|
```
|
|
161
159
|
|
|
@@ -172,10 +170,6 @@ Name | Type | Description | Notes
|
|
|
172
170
|
|
|
173
171
|
**Array<TradeImpact>**
|
|
174
172
|
|
|
175
|
-
### Authorization
|
|
176
|
-
|
|
177
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
178
|
-
|
|
179
173
|
### HTTP request headers
|
|
180
174
|
|
|
181
175
|
- **Content-Type**: Not defined
|
|
@@ -190,7 +184,8 @@ Name | Type | Description | Notes
|
|
|
190
184
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
191
185
|
|
|
192
186
|
# **getOrderImpact**
|
|
193
|
-
|
|
187
|
+
|
|
188
|
+
#### **POST** /trade/impact
|
|
194
189
|
|
|
195
190
|
|
|
196
191
|
### Example
|
|
@@ -206,10 +201,9 @@ const snaptrade = new Snaptrade({
|
|
|
206
201
|
clientId: "YOUR_CLIENT_ID",
|
|
207
202
|
})
|
|
208
203
|
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
'requestBody': {
|
|
204
|
+
const getOrderImpactResponse = await snaptrade.trading.getOrderImpact({
|
|
205
|
+
"userId": "John.doe@snaptrade.com",
|
|
206
|
+
"userSecret": "USERSECRET123",
|
|
213
207
|
"account_id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
214
208
|
"action": "BUY",
|
|
215
209
|
"order_type": "Limit",
|
|
@@ -217,9 +211,9 @@ const response = await snaptrade.trading.getOrderImpact({
|
|
|
217
211
|
"stop": 31.33,
|
|
218
212
|
"time_in_force": "Day",
|
|
219
213
|
"universal_symbol_id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
console.log(
|
|
214
|
+
})
|
|
215
|
+
|
|
216
|
+
console.log(getOrderImpactResponse)
|
|
223
217
|
|
|
224
218
|
```
|
|
225
219
|
|
|
@@ -237,10 +231,6 @@ Name | Type | Description | Notes
|
|
|
237
231
|
|
|
238
232
|
**ManualTradeAndImpact**
|
|
239
233
|
|
|
240
|
-
### Authorization
|
|
241
|
-
|
|
242
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
243
|
-
|
|
244
234
|
### HTTP request headers
|
|
245
235
|
|
|
246
236
|
- **Content-Type**: application/json
|
|
@@ -258,7 +248,8 @@ Name | Type | Description | Notes
|
|
|
258
248
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
259
249
|
|
|
260
250
|
# **getUserAccountQuotes**
|
|
261
|
-
|
|
251
|
+
|
|
252
|
+
#### **GET** /accounts/{accountId}/quotes
|
|
262
253
|
|
|
263
254
|
|
|
264
255
|
### Example
|
|
@@ -274,14 +265,14 @@ const snaptrade = new Snaptrade({
|
|
|
274
265
|
clientId: "YOUR_CLIENT_ID",
|
|
275
266
|
})
|
|
276
267
|
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
console.log(
|
|
268
|
+
const getUserAccountQuotesResponse = await snaptrade.trading.getUserAccountQuotes({
|
|
269
|
+
"userId": "John.doe@snaptrade.com",
|
|
270
|
+
"userSecret": "USERSECRET123",
|
|
271
|
+
"symbols": "symbols_example",
|
|
272
|
+
"accountId": "accountId_example",
|
|
273
|
+
})
|
|
274
|
+
|
|
275
|
+
console.log(getUserAccountQuotesResponse)
|
|
285
276
|
|
|
286
277
|
```
|
|
287
278
|
|
|
@@ -301,10 +292,6 @@ Name | Type | Description | Notes
|
|
|
301
292
|
|
|
302
293
|
**SymbolsQuotes**
|
|
303
294
|
|
|
304
|
-
### Authorization
|
|
305
|
-
|
|
306
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
307
|
-
|
|
308
295
|
### HTTP request headers
|
|
309
296
|
|
|
310
297
|
- **Content-Type**: Not defined
|
|
@@ -320,7 +307,8 @@ Name | Type | Description | Notes
|
|
|
320
307
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
321
308
|
|
|
322
309
|
# **modifyCalculatedTradeById**
|
|
323
|
-
|
|
310
|
+
|
|
311
|
+
#### **PATCH** /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/modify/{tradeId}
|
|
324
312
|
|
|
325
313
|
|
|
326
314
|
### Example
|
|
@@ -336,19 +324,18 @@ const snaptrade = new Snaptrade({
|
|
|
336
324
|
clientId: "YOUR_CLIENT_ID",
|
|
337
325
|
})
|
|
338
326
|
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
'requestBody': {
|
|
327
|
+
const modifyCalculatedTradeByIdResponse = await snaptrade.trading.modifyCalculatedTradeById({
|
|
328
|
+
"portfolioGroupId": "portfolioGroupId_example",
|
|
329
|
+
"calculatedTradeId": "calculatedTradeId_example",
|
|
330
|
+
"tradeId": "tradeId_example",
|
|
344
331
|
"id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
345
332
|
"action": "BUY",
|
|
346
333
|
"units": 6,
|
|
347
334
|
"price": 24.81,
|
|
348
335
|
"sequence": 1,
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
console.log(
|
|
336
|
+
})
|
|
337
|
+
|
|
338
|
+
console.log(modifyCalculatedTradeByIdResponse)
|
|
352
339
|
|
|
353
340
|
```
|
|
354
341
|
|
|
@@ -367,10 +354,6 @@ Name | Type | Description | Notes
|
|
|
367
354
|
|
|
368
355
|
**Trade**
|
|
369
356
|
|
|
370
|
-
### Authorization
|
|
371
|
-
|
|
372
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
373
|
-
|
|
374
357
|
### HTTP request headers
|
|
375
358
|
|
|
376
359
|
- **Content-Type**: application/json
|
|
@@ -385,7 +368,8 @@ Name | Type | Description | Notes
|
|
|
385
368
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
386
369
|
|
|
387
370
|
# **placeCalculatedTrades**
|
|
388
|
-
|
|
371
|
+
|
|
372
|
+
#### **POST** /portfolioGroups/{portfolioGroupId}/calculatedtrades/{calculatedTradeId}/placeOrders
|
|
389
373
|
|
|
390
374
|
|
|
391
375
|
### Example
|
|
@@ -401,11 +385,12 @@ const snaptrade = new Snaptrade({
|
|
|
401
385
|
clientId: "YOUR_CLIENT_ID",
|
|
402
386
|
})
|
|
403
387
|
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
})
|
|
408
|
-
|
|
388
|
+
const placeCalculatedTradesResponse = await snaptrade.trading.placeCalculatedTrades({
|
|
389
|
+
"portfolioGroupId": "portfolioGroupId_example",
|
|
390
|
+
"calculatedTradeId": "calculatedTradeId_example",
|
|
391
|
+
})
|
|
392
|
+
|
|
393
|
+
console.log(placeCalculatedTradesResponse)
|
|
409
394
|
|
|
410
395
|
```
|
|
411
396
|
|
|
@@ -422,10 +407,6 @@ Name | Type | Description | Notes
|
|
|
422
407
|
|
|
423
408
|
**Array<TradeExecutionStatus>**
|
|
424
409
|
|
|
425
|
-
### Authorization
|
|
426
|
-
|
|
427
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
428
|
-
|
|
429
410
|
### HTTP request headers
|
|
430
411
|
|
|
431
412
|
- **Content-Type**: Not defined
|
|
@@ -440,7 +421,8 @@ Name | Type | Description | Notes
|
|
|
440
421
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
441
422
|
|
|
442
423
|
# **placeForceOrder**
|
|
443
|
-
|
|
424
|
+
|
|
425
|
+
#### **POST** /trade/place
|
|
444
426
|
|
|
445
427
|
|
|
446
428
|
### Example
|
|
@@ -456,10 +438,9 @@ const snaptrade = new Snaptrade({
|
|
|
456
438
|
clientId: "YOUR_CLIENT_ID",
|
|
457
439
|
})
|
|
458
440
|
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
'requestBody': {
|
|
441
|
+
const placeForceOrderResponse = await snaptrade.trading.placeForceOrder({
|
|
442
|
+
"userId": "John.doe@snaptrade.com",
|
|
443
|
+
"userSecret": "USERSECRET123",
|
|
463
444
|
"account_id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
464
445
|
"action": "BUY",
|
|
465
446
|
"order_type": "Limit",
|
|
@@ -467,9 +448,9 @@ const response = await snaptrade.trading.placeForceOrder({
|
|
|
467
448
|
"stop": 31.33,
|
|
468
449
|
"time_in_force": "Day",
|
|
469
450
|
"universal_symbol_id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
console.log(
|
|
451
|
+
})
|
|
452
|
+
|
|
453
|
+
console.log(placeForceOrderResponse)
|
|
473
454
|
|
|
474
455
|
```
|
|
475
456
|
|
|
@@ -487,10 +468,6 @@ Name | Type | Description | Notes
|
|
|
487
468
|
|
|
488
469
|
**AccountOrderRecord**
|
|
489
470
|
|
|
490
|
-
### Authorization
|
|
491
|
-
|
|
492
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
493
|
-
|
|
494
471
|
### HTTP request headers
|
|
495
472
|
|
|
496
473
|
- **Content-Type**: application/json
|
|
@@ -508,7 +485,8 @@ Name | Type | Description | Notes
|
|
|
508
485
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
509
486
|
|
|
510
487
|
# **placeOCOOrder**
|
|
511
|
-
|
|
488
|
+
|
|
489
|
+
#### **POST** /trade/oco
|
|
512
490
|
|
|
513
491
|
|
|
514
492
|
### Example
|
|
@@ -524,13 +502,12 @@ const snaptrade = new Snaptrade({
|
|
|
524
502
|
clientId: "YOUR_CLIENT_ID",
|
|
525
503
|
})
|
|
526
504
|
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
console.log(response)
|
|
505
|
+
const placeOCOOrderResponse = await snaptrade.trading.placeOCOOrder({
|
|
506
|
+
"userId": "John.doe@snaptrade.com",
|
|
507
|
+
"userSecret": "USERSECRET123",
|
|
508
|
+
})
|
|
509
|
+
|
|
510
|
+
console.log(placeOCOOrderResponse)
|
|
534
511
|
|
|
535
512
|
```
|
|
536
513
|
|
|
@@ -548,10 +525,6 @@ Name | Type | Description | Notes
|
|
|
548
525
|
|
|
549
526
|
**AccountOrderRecord**
|
|
550
527
|
|
|
551
|
-
### Authorization
|
|
552
|
-
|
|
553
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
554
|
-
|
|
555
528
|
### HTTP request headers
|
|
556
529
|
|
|
557
530
|
- **Content-Type**: application/json
|
|
@@ -568,7 +541,8 @@ Name | Type | Description | Notes
|
|
|
568
541
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
569
542
|
|
|
570
543
|
# **placeOrder**
|
|
571
|
-
|
|
544
|
+
|
|
545
|
+
#### **POST** /trade/{tradeId}
|
|
572
546
|
|
|
573
547
|
|
|
574
548
|
### Example
|
|
@@ -584,12 +558,13 @@ const snaptrade = new Snaptrade({
|
|
|
584
558
|
clientId: "YOUR_CLIENT_ID",
|
|
585
559
|
})
|
|
586
560
|
|
|
587
|
-
const
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
})
|
|
592
|
-
|
|
561
|
+
const placeOrderResponse = await snaptrade.trading.placeOrder({
|
|
562
|
+
"tradeId": "tradeId_example",
|
|
563
|
+
"userId": "John.doe@snaptrade.com",
|
|
564
|
+
"userSecret": "USERSECRET123",
|
|
565
|
+
})
|
|
566
|
+
|
|
567
|
+
console.log(placeOrderResponse)
|
|
593
568
|
|
|
594
569
|
```
|
|
595
570
|
|
|
@@ -607,10 +582,6 @@ Name | Type | Description | Notes
|
|
|
607
582
|
|
|
608
583
|
**AccountOrderRecord**
|
|
609
584
|
|
|
610
|
-
### Authorization
|
|
611
|
-
|
|
612
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
613
|
-
|
|
614
585
|
### HTTP request headers
|
|
615
586
|
|
|
616
587
|
- **Content-Type**: Not defined
|
|
@@ -9,8 +9,10 @@ Method | HTTP request | Description
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
# **getActivities**
|
|
12
|
-
> Array<UniversalActivity> getActivities()
|
|
13
12
|
|
|
13
|
+
#### **GET** /activities
|
|
14
|
+
|
|
15
|
+
### Description
|
|
14
16
|
Returns activities (transactions) for a user. Specifing start and end date is highly recommended for automatic calls for better performance
|
|
15
17
|
|
|
16
18
|
### Example
|
|
@@ -26,14 +28,15 @@ const snaptrade = new Snaptrade({
|
|
|
26
28
|
clientId: "YOUR_CLIENT_ID",
|
|
27
29
|
})
|
|
28
30
|
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
})
|
|
36
|
-
|
|
31
|
+
const getActivitiesResponse = await snaptrade.transactionsAndReporting.getActivities({
|
|
32
|
+
"startDate": "2022-01-24",
|
|
33
|
+
"endDate": "2022-01-24",
|
|
34
|
+
"accounts": "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
|
|
35
|
+
"userId": "John.doe@snaptrade.com",
|
|
36
|
+
"userSecret": "USERSECRET123",
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
console.log(getActivitiesResponse)
|
|
37
40
|
|
|
38
41
|
```
|
|
39
42
|
|
|
@@ -53,10 +56,6 @@ Name | Type | Description | Notes
|
|
|
53
56
|
|
|
54
57
|
**Array<UniversalActivity>**
|
|
55
58
|
|
|
56
|
-
### Authorization
|
|
57
|
-
|
|
58
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
59
|
-
|
|
60
59
|
### HTTP request headers
|
|
61
60
|
|
|
62
61
|
- **Content-Type**: Not defined
|
|
@@ -72,8 +71,10 @@ Name | Type | Description | Notes
|
|
|
72
71
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
73
72
|
|
|
74
73
|
# **getReportingCustomRange**
|
|
75
|
-
> PerformanceCustom getReportingCustomRange()
|
|
76
74
|
|
|
75
|
+
#### **GET** /performance/custom
|
|
76
|
+
|
|
77
|
+
### Description
|
|
77
78
|
Returns performance information (contributions, dividends, rate of return, etc) for a specific timeframe. Total Equity Timeframe and Rate of Returns are experimental and should not be trusted to be 100% accurate
|
|
78
79
|
|
|
79
80
|
### Example
|
|
@@ -89,16 +90,17 @@ const snaptrade = new Snaptrade({
|
|
|
89
90
|
clientId: "YOUR_CLIENT_ID",
|
|
90
91
|
})
|
|
91
92
|
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
})
|
|
101
|
-
|
|
93
|
+
const getReportingCustomRangeResponse = await snaptrade.transactionsAndReporting.getReportingCustomRange({
|
|
94
|
+
"startDate": "2022-01-24",
|
|
95
|
+
"endDate": "2022-01-24",
|
|
96
|
+
"accounts": "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
|
|
97
|
+
"detailed": true,
|
|
98
|
+
"frequency": "monthly",
|
|
99
|
+
"userId": "John.doe@snaptrade.com",
|
|
100
|
+
"userSecret": "USERSECRET123",
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
console.log(getReportingCustomRangeResponse)
|
|
102
104
|
|
|
103
105
|
```
|
|
104
106
|
|
|
@@ -120,10 +122,6 @@ Name | Type | Description | Notes
|
|
|
120
122
|
|
|
121
123
|
**PerformanceCustom**
|
|
122
124
|
|
|
123
|
-
### Authorization
|
|
124
|
-
|
|
125
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
126
|
-
|
|
127
125
|
### HTTP request headers
|
|
128
126
|
|
|
129
127
|
- **Content-Type**: Not defined
|
package/index.test.ts
CHANGED
|
@@ -37,9 +37,7 @@ it("getting started", async () => {
|
|
|
37
37
|
const userId = uuid();
|
|
38
38
|
const { userSecret } = (
|
|
39
39
|
await snaptrade.authentication.registerSnapTradeUser({
|
|
40
|
-
|
|
41
|
-
userId,
|
|
42
|
-
},
|
|
40
|
+
userId,
|
|
43
41
|
})
|
|
44
42
|
).data;
|
|
45
43
|
|
|
@@ -104,7 +102,7 @@ it.skip("getOptionsChain", async () => {
|
|
|
104
102
|
console.log(accounts.data);
|
|
105
103
|
const accountId = accounts.data[0].id;
|
|
106
104
|
const symbols = await snaptrade.referenceData.getSymbols({
|
|
107
|
-
|
|
105
|
+
substring: "apple",
|
|
108
106
|
});
|
|
109
107
|
console.log(symbols);
|
|
110
108
|
const symbol = symbols.data[0].id;
|
package/models/index.ts
CHANGED
|
@@ -91,6 +91,7 @@ export * from './time-in-force';
|
|
|
91
91
|
export * from './trade';
|
|
92
92
|
export * from './trade-execution-status';
|
|
93
93
|
export * from './trade-impact';
|
|
94
|
+
export * from './trading-cancel-user-account-order-request';
|
|
94
95
|
export * from './trading-place-ocoorder-request';
|
|
95
96
|
export * from './usexchange';
|
|
96
97
|
export * from './underlying-symbol';
|
package/models/target-asset.ts
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* SnapTrade
|
|
5
|
+
* Connect brokerage accounts to your app for live positions and trading
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: api@snaptrade.com
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This file is auto generated by Konfig (https://konfigthis.com).
|
|
11
|
+
* https://konfigthis.com
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface TradingCancelUserAccountOrderRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface TradingCancelUserAccountOrderRequest {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof TradingCancelUserAccountOrderRequest
|
|
26
|
+
*/
|
|
27
|
+
'brokerage_order_id'?: string;
|
|
28
|
+
}
|
|
29
|
+
|