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/ReferenceDataApi.md
CHANGED
|
@@ -18,7 +18,8 @@ Method | HTTP request | Description
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
# **getCurrencyExchangeRatePair**
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
#### **GET** /currencies/rates/{currencyPair}
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
### Example
|
|
@@ -34,10 +35,11 @@ const snaptrade = new Snaptrade({
|
|
|
34
35
|
clientId: "YOUR_CLIENT_ID",
|
|
35
36
|
})
|
|
36
37
|
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
})
|
|
40
|
-
|
|
38
|
+
const getCurrencyExchangeRatePairResponse = await snaptrade.referenceData.getCurrencyExchangeRatePair({
|
|
39
|
+
"currencyPair": "currencyPair_example",
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
console.log(getCurrencyExchangeRatePairResponse)
|
|
41
43
|
|
|
42
44
|
```
|
|
43
45
|
|
|
@@ -53,10 +55,6 @@ Name | Type | Description | Notes
|
|
|
53
55
|
|
|
54
56
|
**ExchangeRatePairs**
|
|
55
57
|
|
|
56
|
-
### Authorization
|
|
57
|
-
|
|
58
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
59
|
-
|
|
60
58
|
### HTTP request headers
|
|
61
59
|
|
|
62
60
|
- **Content-Type**: Not defined
|
|
@@ -71,7 +69,8 @@ Name | Type | Description | Notes
|
|
|
71
69
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
72
70
|
|
|
73
71
|
# **getPartnerInfo**
|
|
74
|
-
|
|
72
|
+
|
|
73
|
+
#### **GET** /snapTrade/partners
|
|
75
74
|
|
|
76
75
|
|
|
77
76
|
### Example
|
|
@@ -87,8 +86,9 @@ const snaptrade = new Snaptrade({
|
|
|
87
86
|
clientId: "YOUR_CLIENT_ID",
|
|
88
87
|
})
|
|
89
88
|
|
|
90
|
-
const
|
|
91
|
-
|
|
89
|
+
const getPartnerInfoResponse = await snaptrade.referenceData.getPartnerInfo()
|
|
90
|
+
|
|
91
|
+
console.log(getPartnerInfoResponse)
|
|
92
92
|
|
|
93
93
|
```
|
|
94
94
|
|
|
@@ -101,10 +101,6 @@ This endpoint does not need any parameter.
|
|
|
101
101
|
|
|
102
102
|
**PartnerData**
|
|
103
103
|
|
|
104
|
-
### Authorization
|
|
105
|
-
|
|
106
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
107
|
-
|
|
108
104
|
### HTTP request headers
|
|
109
105
|
|
|
110
106
|
- **Content-Type**: Not defined
|
|
@@ -123,7 +119,8 @@ This endpoint does not need any parameter.
|
|
|
123
119
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
124
120
|
|
|
125
121
|
# **getSecurityTypes**
|
|
126
|
-
|
|
122
|
+
|
|
123
|
+
#### **GET** /securityTypes
|
|
127
124
|
|
|
128
125
|
|
|
129
126
|
### Example
|
|
@@ -139,8 +136,9 @@ const snaptrade = new Snaptrade({
|
|
|
139
136
|
clientId: "YOUR_CLIENT_ID",
|
|
140
137
|
})
|
|
141
138
|
|
|
142
|
-
const
|
|
143
|
-
|
|
139
|
+
const getSecurityTypesResponse = await snaptrade.referenceData.getSecurityTypes()
|
|
140
|
+
|
|
141
|
+
console.log(getSecurityTypesResponse)
|
|
144
142
|
|
|
145
143
|
```
|
|
146
144
|
|
|
@@ -153,10 +151,6 @@ This endpoint does not need any parameter.
|
|
|
153
151
|
|
|
154
152
|
**Array<SecurityType>**
|
|
155
153
|
|
|
156
|
-
### Authorization
|
|
157
|
-
|
|
158
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
159
|
-
|
|
160
154
|
### HTTP request headers
|
|
161
155
|
|
|
162
156
|
- **Content-Type**: Not defined
|
|
@@ -172,7 +166,8 @@ This endpoint does not need any parameter.
|
|
|
172
166
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
173
167
|
|
|
174
168
|
# **getStockExchanges**
|
|
175
|
-
|
|
169
|
+
|
|
170
|
+
#### **GET** /exchanges
|
|
176
171
|
|
|
177
172
|
|
|
178
173
|
### Example
|
|
@@ -188,8 +183,9 @@ const snaptrade = new Snaptrade({
|
|
|
188
183
|
clientId: "YOUR_CLIENT_ID",
|
|
189
184
|
})
|
|
190
185
|
|
|
191
|
-
const
|
|
192
|
-
|
|
186
|
+
const getStockExchangesResponse = await snaptrade.referenceData.getStockExchanges()
|
|
187
|
+
|
|
188
|
+
console.log(getStockExchangesResponse)
|
|
193
189
|
|
|
194
190
|
```
|
|
195
191
|
|
|
@@ -202,10 +198,6 @@ This endpoint does not need any parameter.
|
|
|
202
198
|
|
|
203
199
|
**Array<Exchange>**
|
|
204
200
|
|
|
205
|
-
### Authorization
|
|
206
|
-
|
|
207
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
208
|
-
|
|
209
201
|
### HTTP request headers
|
|
210
202
|
|
|
211
203
|
- **Content-Type**: Not defined
|
|
@@ -220,7 +212,8 @@ This endpoint does not need any parameter.
|
|
|
220
212
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
221
213
|
|
|
222
214
|
# **getSymbols**
|
|
223
|
-
|
|
215
|
+
|
|
216
|
+
#### **POST** /symbols
|
|
224
217
|
|
|
225
218
|
|
|
226
219
|
### Example
|
|
@@ -236,12 +229,11 @@ const snaptrade = new Snaptrade({
|
|
|
236
229
|
clientId: "YOUR_CLIENT_ID",
|
|
237
230
|
})
|
|
238
231
|
|
|
239
|
-
const
|
|
240
|
-
'requestBody': {
|
|
232
|
+
const getSymbolsResponse = await snaptrade.referenceData.getSymbols({
|
|
241
233
|
"substring": "apple",
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
console.log(
|
|
234
|
+
})
|
|
235
|
+
|
|
236
|
+
console.log(getSymbolsResponse)
|
|
245
237
|
|
|
246
238
|
```
|
|
247
239
|
|
|
@@ -257,10 +249,6 @@ Name | Type | Description | Notes
|
|
|
257
249
|
|
|
258
250
|
**Array<UniversalSymbol>**
|
|
259
251
|
|
|
260
|
-
### Authorization
|
|
261
|
-
|
|
262
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
263
|
-
|
|
264
252
|
### HTTP request headers
|
|
265
253
|
|
|
266
254
|
- **Content-Type**: application/json
|
|
@@ -276,7 +264,8 @@ Name | Type | Description | Notes
|
|
|
276
264
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
277
265
|
|
|
278
266
|
# **getSymbolsByTicker**
|
|
279
|
-
|
|
267
|
+
|
|
268
|
+
#### **GET** /symbols/{ticker}
|
|
280
269
|
|
|
281
270
|
|
|
282
271
|
### Example
|
|
@@ -292,11 +281,11 @@ const snaptrade = new Snaptrade({
|
|
|
292
281
|
clientId: "YOUR_CLIENT_ID",
|
|
293
282
|
})
|
|
294
283
|
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
console.log(
|
|
284
|
+
const getSymbolsByTickerResponse = await snaptrade.referenceData.getSymbolsByTicker({
|
|
285
|
+
"ticker": "ticker_example",
|
|
286
|
+
})
|
|
287
|
+
|
|
288
|
+
console.log(getSymbolsByTickerResponse)
|
|
300
289
|
|
|
301
290
|
```
|
|
302
291
|
|
|
@@ -313,10 +302,6 @@ Name | Type | Description | Notes
|
|
|
313
302
|
|
|
314
303
|
**UniversalSymbol**
|
|
315
304
|
|
|
316
|
-
### Authorization
|
|
317
|
-
|
|
318
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
319
|
-
|
|
320
305
|
### HTTP request headers
|
|
321
306
|
|
|
322
307
|
- **Content-Type**: Not defined
|
|
@@ -333,7 +318,8 @@ Name | Type | Description | Notes
|
|
|
333
318
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
334
319
|
|
|
335
320
|
# **listAllBrokerageAuthorizationType**
|
|
336
|
-
|
|
321
|
+
|
|
322
|
+
#### **GET** /brokerageAuthorizationTypes
|
|
337
323
|
|
|
338
324
|
|
|
339
325
|
### Example
|
|
@@ -349,10 +335,11 @@ const snaptrade = new Snaptrade({
|
|
|
349
335
|
clientId: "YOUR_CLIENT_ID",
|
|
350
336
|
})
|
|
351
337
|
|
|
352
|
-
const
|
|
353
|
-
|
|
354
|
-
})
|
|
355
|
-
|
|
338
|
+
const listAllBrokerageAuthorizationTypeResponse = await snaptrade.referenceData.listAllBrokerageAuthorizationType({
|
|
339
|
+
"brokerage": "QUESTRADE,ALPACA",
|
|
340
|
+
})
|
|
341
|
+
|
|
342
|
+
console.log(listAllBrokerageAuthorizationTypeResponse)
|
|
356
343
|
|
|
357
344
|
```
|
|
358
345
|
|
|
@@ -368,10 +355,6 @@ Name | Type | Description | Notes
|
|
|
368
355
|
|
|
369
356
|
**Array<BrokerageAuthorizationTypeReadOnly>**
|
|
370
357
|
|
|
371
|
-
### Authorization
|
|
372
|
-
|
|
373
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
374
|
-
|
|
375
358
|
### HTTP request headers
|
|
376
359
|
|
|
377
360
|
- **Content-Type**: Not defined
|
|
@@ -387,7 +370,8 @@ Name | Type | Description | Notes
|
|
|
387
370
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
388
371
|
|
|
389
372
|
# **listAllBrokerages**
|
|
390
|
-
|
|
373
|
+
|
|
374
|
+
#### **GET** /brokerages
|
|
391
375
|
|
|
392
376
|
|
|
393
377
|
### Example
|
|
@@ -403,8 +387,9 @@ const snaptrade = new Snaptrade({
|
|
|
403
387
|
clientId: "YOUR_CLIENT_ID",
|
|
404
388
|
})
|
|
405
389
|
|
|
406
|
-
const
|
|
407
|
-
|
|
390
|
+
const listAllBrokeragesResponse = await snaptrade.referenceData.listAllBrokerages()
|
|
391
|
+
|
|
392
|
+
console.log(listAllBrokeragesResponse)
|
|
408
393
|
|
|
409
394
|
```
|
|
410
395
|
|
|
@@ -417,10 +402,6 @@ This endpoint does not need any parameter.
|
|
|
417
402
|
|
|
418
403
|
**Array<Brokerage>**
|
|
419
404
|
|
|
420
|
-
### Authorization
|
|
421
|
-
|
|
422
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
423
|
-
|
|
424
405
|
### HTTP request headers
|
|
425
406
|
|
|
426
407
|
- **Content-Type**: Not defined
|
|
@@ -436,7 +417,8 @@ This endpoint does not need any parameter.
|
|
|
436
417
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
437
418
|
|
|
438
419
|
# **listAllCurrencies**
|
|
439
|
-
|
|
420
|
+
|
|
421
|
+
#### **GET** /currencies
|
|
440
422
|
|
|
441
423
|
|
|
442
424
|
### Example
|
|
@@ -452,8 +434,9 @@ const snaptrade = new Snaptrade({
|
|
|
452
434
|
clientId: "YOUR_CLIENT_ID",
|
|
453
435
|
})
|
|
454
436
|
|
|
455
|
-
const
|
|
456
|
-
|
|
437
|
+
const listAllCurrenciesResponse = await snaptrade.referenceData.listAllCurrencies()
|
|
438
|
+
|
|
439
|
+
console.log(listAllCurrenciesResponse)
|
|
457
440
|
|
|
458
441
|
```
|
|
459
442
|
|
|
@@ -466,10 +449,6 @@ This endpoint does not need any parameter.
|
|
|
466
449
|
|
|
467
450
|
**Array<Currency>**
|
|
468
451
|
|
|
469
|
-
### Authorization
|
|
470
|
-
|
|
471
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
472
|
-
|
|
473
452
|
### HTTP request headers
|
|
474
453
|
|
|
475
454
|
- **Content-Type**: Not defined
|
|
@@ -485,7 +464,8 @@ This endpoint does not need any parameter.
|
|
|
485
464
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
486
465
|
|
|
487
466
|
# **listAllCurrenciesRates**
|
|
488
|
-
|
|
467
|
+
|
|
468
|
+
#### **GET** /currencies/rates
|
|
489
469
|
|
|
490
470
|
|
|
491
471
|
### Example
|
|
@@ -501,8 +481,9 @@ const snaptrade = new Snaptrade({
|
|
|
501
481
|
clientId: "YOUR_CLIENT_ID",
|
|
502
482
|
})
|
|
503
483
|
|
|
504
|
-
const
|
|
505
|
-
|
|
484
|
+
const listAllCurrenciesRatesResponse = await snaptrade.referenceData.listAllCurrenciesRates()
|
|
485
|
+
|
|
486
|
+
console.log(listAllCurrenciesRatesResponse)
|
|
506
487
|
|
|
507
488
|
```
|
|
508
489
|
|
|
@@ -515,10 +496,6 @@ This endpoint does not need any parameter.
|
|
|
515
496
|
|
|
516
497
|
**Array<ExchangeRatePairs>**
|
|
517
498
|
|
|
518
|
-
### Authorization
|
|
519
|
-
|
|
520
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
521
|
-
|
|
522
499
|
### HTTP request headers
|
|
523
500
|
|
|
524
501
|
- **Content-Type**: Not defined
|
|
@@ -533,7 +510,8 @@ This endpoint does not need any parameter.
|
|
|
533
510
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
534
511
|
|
|
535
512
|
# **symbolSearchUserAccount**
|
|
536
|
-
|
|
513
|
+
|
|
514
|
+
#### **POST** /accounts/{accountId}/symbols
|
|
537
515
|
|
|
538
516
|
|
|
539
517
|
### Example
|
|
@@ -549,15 +527,14 @@ const snaptrade = new Snaptrade({
|
|
|
549
527
|
clientId: "YOUR_CLIENT_ID",
|
|
550
528
|
})
|
|
551
529
|
|
|
552
|
-
const
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
'requestBody': {
|
|
530
|
+
const symbolSearchUserAccountResponse = await snaptrade.referenceData.symbolSearchUserAccount({
|
|
531
|
+
"userId": "John.doe@snaptrade.com",
|
|
532
|
+
"userSecret": "USERSECRET123",
|
|
533
|
+
"accountId": "accountId_example",
|
|
557
534
|
"substring": "apple",
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
console.log(
|
|
535
|
+
})
|
|
536
|
+
|
|
537
|
+
console.log(symbolSearchUserAccountResponse)
|
|
561
538
|
|
|
562
539
|
```
|
|
563
540
|
|
|
@@ -576,10 +553,6 @@ Name | Type | Description | Notes
|
|
|
576
553
|
|
|
577
554
|
**Array<UniversalSymbol>**
|
|
578
555
|
|
|
579
|
-
### Authorization
|
|
580
|
-
|
|
581
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
582
|
-
|
|
583
556
|
### HTTP request headers
|
|
584
557
|
|
|
585
558
|
- **Content-Type**: application/json
|