snaptrade-typescript-sdk 4.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/common.ts +2 -2
- 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/common.js +2 -2
- 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/dist/pagination/page-types.d.ts +27 -0
- package/dist/pagination/page-types.js +13 -0
- package/dist/pagination/page.d.ts +6 -1
- package/dist/pagination/page.js +3 -0
- package/dist/pagination/pageable.d.ts +8 -3
- package/dist/pagination/pageable.js +5 -6
- package/dist/pagination/paginate.d.ts +2 -2
- package/docs/AccountInformationApi.md +72 -88
- package/docs/ApiDisclaimerApi.md +8 -12
- package/docs/ApiStatusApi.md +6 -7
- package/docs/AuthenticationApi.md +41 -55
- package/docs/ConnectionsApi.md +26 -32
- package/docs/ErrorLogsApi.md +8 -10
- package/docs/OptionsApi.md +60 -67
- package/docs/PortfolioManagementApi.md +246 -326
- package/docs/ReferenceDataApi.md +68 -95
- package/docs/TradingApi.md +107 -136
- 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/pagination/page-types.ts +34 -0
- package/pagination/page.ts +9 -1
- package/pagination/pageable.ts +16 -10
- package/pagination/paginate.ts +3 -2
- package/tsconfig.json +1 -0
- package/dist/index.test.d.ts +0 -1
- package/dist/index.test.js +0 -175
|
@@ -15,7 +15,8 @@ Method | HTTP request | Description
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
# **getAllUserHoldings**
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
#### **GET** /holdings
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
### Example
|
|
@@ -31,12 +32,13 @@ const snaptrade = new Snaptrade({
|
|
|
31
32
|
clientId: "YOUR_CLIENT_ID",
|
|
32
33
|
})
|
|
33
34
|
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
})
|
|
39
|
-
|
|
35
|
+
const getAllUserHoldingsResponse = await snaptrade.accountInformation.getAllUserHoldings({
|
|
36
|
+
"userId": "John.doe@snaptrade.com",
|
|
37
|
+
"userSecret": "USERSECRET123",
|
|
38
|
+
"brokerageAuthorizations": "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
console.log(getAllUserHoldingsResponse)
|
|
40
42
|
|
|
41
43
|
```
|
|
42
44
|
|
|
@@ -54,10 +56,6 @@ Name | Type | Description | Notes
|
|
|
54
56
|
|
|
55
57
|
**Array<AccountHoldings>**
|
|
56
58
|
|
|
57
|
-
### Authorization
|
|
58
|
-
|
|
59
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
60
|
-
|
|
61
59
|
### HTTP request headers
|
|
62
60
|
|
|
63
61
|
- **Content-Type**: Not defined
|
|
@@ -75,7 +73,8 @@ Name | Type | Description | Notes
|
|
|
75
73
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
76
74
|
|
|
77
75
|
# **getUserAccountBalance**
|
|
78
|
-
|
|
76
|
+
|
|
77
|
+
#### **GET** /accounts/{accountId}/balances
|
|
79
78
|
|
|
80
79
|
|
|
81
80
|
### Example
|
|
@@ -91,12 +90,13 @@ const snaptrade = new Snaptrade({
|
|
|
91
90
|
clientId: "YOUR_CLIENT_ID",
|
|
92
91
|
})
|
|
93
92
|
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
})
|
|
99
|
-
|
|
93
|
+
const getUserAccountBalanceResponse = await snaptrade.accountInformation.getUserAccountBalance({
|
|
94
|
+
"userId": "John.doe@snaptrade.com",
|
|
95
|
+
"userSecret": "USERSECRET123",
|
|
96
|
+
"accountId": "accountId_example",
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
console.log(getUserAccountBalanceResponse)
|
|
100
100
|
|
|
101
101
|
```
|
|
102
102
|
|
|
@@ -114,10 +114,6 @@ Name | Type | Description | Notes
|
|
|
114
114
|
|
|
115
115
|
**Array<Balance>**
|
|
116
116
|
|
|
117
|
-
### Authorization
|
|
118
|
-
|
|
119
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
120
|
-
|
|
121
117
|
### HTTP request headers
|
|
122
118
|
|
|
123
119
|
- **Content-Type**: Not defined
|
|
@@ -133,7 +129,8 @@ Name | Type | Description | Notes
|
|
|
133
129
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
134
130
|
|
|
135
131
|
# **getUserAccountDetails**
|
|
136
|
-
|
|
132
|
+
|
|
133
|
+
#### **GET** /accounts/{accountId}
|
|
137
134
|
|
|
138
135
|
|
|
139
136
|
### Example
|
|
@@ -149,12 +146,13 @@ const snaptrade = new Snaptrade({
|
|
|
149
146
|
clientId: "YOUR_CLIENT_ID",
|
|
150
147
|
})
|
|
151
148
|
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
})
|
|
157
|
-
|
|
149
|
+
const getUserAccountDetailsResponse = await snaptrade.accountInformation.getUserAccountDetails({
|
|
150
|
+
"userId": "John.doe@snaptrade.com",
|
|
151
|
+
"userSecret": "USERSECRET123",
|
|
152
|
+
"accountId": "accountId_example",
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
console.log(getUserAccountDetailsResponse)
|
|
158
156
|
|
|
159
157
|
```
|
|
160
158
|
|
|
@@ -172,10 +170,6 @@ Name | Type | Description | Notes
|
|
|
172
170
|
|
|
173
171
|
**Array<Account>**
|
|
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
|
|
@@ -191,7 +185,8 @@ Name | Type | Description | Notes
|
|
|
191
185
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
192
186
|
|
|
193
187
|
# **getUserAccountOrders**
|
|
194
|
-
|
|
188
|
+
|
|
189
|
+
#### **GET** /accounts/{accountId}/orders
|
|
195
190
|
|
|
196
191
|
|
|
197
192
|
### Example
|
|
@@ -207,13 +202,14 @@ const snaptrade = new Snaptrade({
|
|
|
207
202
|
clientId: "YOUR_CLIENT_ID",
|
|
208
203
|
})
|
|
209
204
|
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
})
|
|
216
|
-
|
|
205
|
+
const getUserAccountOrdersResponse = await snaptrade.accountInformation.getUserAccountOrders({
|
|
206
|
+
"userId": "John.doe@snaptrade.com",
|
|
207
|
+
"userSecret": "USERSECRET123",
|
|
208
|
+
"state": "all",
|
|
209
|
+
"accountId": "accountId_example",
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
console.log(getUserAccountOrdersResponse)
|
|
217
213
|
|
|
218
214
|
```
|
|
219
215
|
|
|
@@ -232,10 +228,6 @@ Name | Type | Description | Notes
|
|
|
232
228
|
|
|
233
229
|
**Array<AccountOrderRecord>**
|
|
234
230
|
|
|
235
|
-
### Authorization
|
|
236
|
-
|
|
237
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
238
|
-
|
|
239
231
|
### HTTP request headers
|
|
240
232
|
|
|
241
233
|
- **Content-Type**: Not defined
|
|
@@ -251,7 +243,8 @@ Name | Type | Description | Notes
|
|
|
251
243
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
252
244
|
|
|
253
245
|
# **getUserAccountPositions**
|
|
254
|
-
|
|
246
|
+
|
|
247
|
+
#### **GET** /accounts/{accountId}/positions
|
|
255
248
|
|
|
256
249
|
|
|
257
250
|
### Example
|
|
@@ -267,12 +260,13 @@ const snaptrade = new Snaptrade({
|
|
|
267
260
|
clientId: "YOUR_CLIENT_ID",
|
|
268
261
|
})
|
|
269
262
|
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
})
|
|
275
|
-
|
|
263
|
+
const getUserAccountPositionsResponse = await snaptrade.accountInformation.getUserAccountPositions({
|
|
264
|
+
"userId": "John.doe@snaptrade.com",
|
|
265
|
+
"userSecret": "USERSECRET123",
|
|
266
|
+
"accountId": "accountId_example",
|
|
267
|
+
})
|
|
268
|
+
|
|
269
|
+
console.log(getUserAccountPositionsResponse)
|
|
276
270
|
|
|
277
271
|
```
|
|
278
272
|
|
|
@@ -290,10 +284,6 @@ Name | Type | Description | Notes
|
|
|
290
284
|
|
|
291
285
|
**Array<Position>**
|
|
292
286
|
|
|
293
|
-
### Authorization
|
|
294
|
-
|
|
295
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
296
|
-
|
|
297
287
|
### HTTP request headers
|
|
298
288
|
|
|
299
289
|
- **Content-Type**: Not defined
|
|
@@ -309,7 +299,8 @@ Name | Type | Description | Notes
|
|
|
309
299
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
310
300
|
|
|
311
301
|
# **getUserHoldings**
|
|
312
|
-
|
|
302
|
+
|
|
303
|
+
#### **GET** /accounts/{accountId}/holdings
|
|
313
304
|
|
|
314
305
|
|
|
315
306
|
### Example
|
|
@@ -325,12 +316,13 @@ const snaptrade = new Snaptrade({
|
|
|
325
316
|
clientId: "YOUR_CLIENT_ID",
|
|
326
317
|
})
|
|
327
318
|
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
})
|
|
333
|
-
|
|
319
|
+
const getUserHoldingsResponse = await snaptrade.accountInformation.getUserHoldings({
|
|
320
|
+
"accountId": "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
321
|
+
"userId": "John.doe@snaptrade.com",
|
|
322
|
+
"userSecret": "USERSECRET123",
|
|
323
|
+
})
|
|
324
|
+
|
|
325
|
+
console.log(getUserHoldingsResponse)
|
|
334
326
|
|
|
335
327
|
```
|
|
336
328
|
|
|
@@ -348,10 +340,6 @@ Name | Type | Description | Notes
|
|
|
348
340
|
|
|
349
341
|
**AccountHoldings**
|
|
350
342
|
|
|
351
|
-
### Authorization
|
|
352
|
-
|
|
353
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
354
|
-
|
|
355
343
|
### HTTP request headers
|
|
356
344
|
|
|
357
345
|
- **Content-Type**: Not defined
|
|
@@ -369,7 +357,8 @@ Name | Type | Description | Notes
|
|
|
369
357
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
370
358
|
|
|
371
359
|
# **listUserAccounts**
|
|
372
|
-
|
|
360
|
+
|
|
361
|
+
#### **GET** /accounts
|
|
373
362
|
|
|
374
363
|
|
|
375
364
|
### Example
|
|
@@ -385,11 +374,12 @@ const snaptrade = new Snaptrade({
|
|
|
385
374
|
clientId: "YOUR_CLIENT_ID",
|
|
386
375
|
})
|
|
387
376
|
|
|
388
|
-
const
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
})
|
|
392
|
-
|
|
377
|
+
const listUserAccountsResponse = await snaptrade.accountInformation.listUserAccounts({
|
|
378
|
+
"userId": "John.doe@snaptrade.com",
|
|
379
|
+
"userSecret": "USERSECRET123",
|
|
380
|
+
})
|
|
381
|
+
|
|
382
|
+
console.log(listUserAccountsResponse)
|
|
393
383
|
|
|
394
384
|
```
|
|
395
385
|
|
|
@@ -406,10 +396,6 @@ Name | Type | Description | Notes
|
|
|
406
396
|
|
|
407
397
|
**Array<Account>**
|
|
408
398
|
|
|
409
|
-
### Authorization
|
|
410
|
-
|
|
411
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
412
|
-
|
|
413
399
|
### HTTP request headers
|
|
414
400
|
|
|
415
401
|
- **Content-Type**: Not defined
|
|
@@ -425,7 +411,8 @@ Name | Type | Description | Notes
|
|
|
425
411
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
426
412
|
|
|
427
413
|
# **updateUserAccount**
|
|
428
|
-
|
|
414
|
+
|
|
415
|
+
#### **PUT** /accounts/{accountId}
|
|
429
416
|
|
|
430
417
|
|
|
431
418
|
### Example
|
|
@@ -441,12 +428,13 @@ const snaptrade = new Snaptrade({
|
|
|
441
428
|
clientId: "YOUR_CLIENT_ID",
|
|
442
429
|
})
|
|
443
430
|
|
|
444
|
-
const
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
})
|
|
449
|
-
|
|
431
|
+
const updateUserAccountResponse = await snaptrade.accountInformation.updateUserAccount({
|
|
432
|
+
"userId": "John.doe@snaptrade.com",
|
|
433
|
+
"userSecret": "USERSECRET123",
|
|
434
|
+
"accountId": "accountId_example",
|
|
435
|
+
})
|
|
436
|
+
|
|
437
|
+
console.log(updateUserAccountResponse)
|
|
450
438
|
|
|
451
439
|
```
|
|
452
440
|
|
|
@@ -464,10 +452,6 @@ Name | Type | Description | Notes
|
|
|
464
452
|
|
|
465
453
|
**Array<Account>**
|
|
466
454
|
|
|
467
|
-
### Authorization
|
|
468
|
-
|
|
469
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
470
|
-
|
|
471
455
|
### HTTP request headers
|
|
472
456
|
|
|
473
457
|
- **Content-Type**: Not defined
|
package/docs/ApiDisclaimerApi.md
CHANGED
|
@@ -8,7 +8,8 @@ Method | HTTP request | Description
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
# **accept**
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
#### **POST** /snapTrade/acceptDisclaimer
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
### Example
|
|
@@ -24,13 +25,12 @@ const snaptrade = new Snaptrade({
|
|
|
24
25
|
clientId: "YOUR_CLIENT_ID",
|
|
25
26
|
})
|
|
26
27
|
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
console.log(response)
|
|
28
|
+
const acceptResponse = await snaptrade.apiDisclaimer.accept({
|
|
29
|
+
"userId": "John.doe@snaptrade.com",
|
|
30
|
+
"userSecret": "USERSECRET123",
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
console.log(acceptResponse)
|
|
34
34
|
|
|
35
35
|
```
|
|
36
36
|
|
|
@@ -48,10 +48,6 @@ Name | Type | Description | Notes
|
|
|
48
48
|
|
|
49
49
|
**SnapTradeAPIDisclaimerAcceptStatus**
|
|
50
50
|
|
|
51
|
-
### Authorization
|
|
52
|
-
|
|
53
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
54
|
-
|
|
55
51
|
### HTTP request headers
|
|
56
52
|
|
|
57
53
|
- **Content-Type**: application/json
|
package/docs/ApiStatusApi.md
CHANGED
|
@@ -8,8 +8,10 @@ Method | HTTP request | Description
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
# **check**
|
|
11
|
-
> Status check()
|
|
12
11
|
|
|
12
|
+
#### **GET** /
|
|
13
|
+
|
|
14
|
+
### Description
|
|
13
15
|
Check whether the API is operational and verify timestamps.
|
|
14
16
|
|
|
15
17
|
### Example
|
|
@@ -25,8 +27,9 @@ const snaptrade = new Snaptrade({
|
|
|
25
27
|
clientId: "YOUR_CLIENT_ID",
|
|
26
28
|
})
|
|
27
29
|
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
+
const checkResponse = await snaptrade.apiStatus.check()
|
|
31
|
+
|
|
32
|
+
console.log(checkResponse)
|
|
30
33
|
|
|
31
34
|
```
|
|
32
35
|
|
|
@@ -39,10 +42,6 @@ This endpoint does not need any parameter.
|
|
|
39
42
|
|
|
40
43
|
**Status**
|
|
41
44
|
|
|
42
|
-
### Authorization
|
|
43
|
-
|
|
44
|
-
No authorization required
|
|
45
|
-
|
|
46
45
|
### HTTP request headers
|
|
47
46
|
|
|
48
47
|
- **Content-Type**: Not defined
|
|
@@ -12,7 +12,8 @@ Method | HTTP request | Description
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
# **deleteSnapTradeUser**
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
#### **DELETE** /snapTrade/deleteUser
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
### Example
|
|
@@ -28,10 +29,11 @@ const snaptrade = new Snaptrade({
|
|
|
28
29
|
clientId: "YOUR_CLIENT_ID",
|
|
29
30
|
})
|
|
30
31
|
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
})
|
|
34
|
-
|
|
32
|
+
const deleteSnapTradeUserResponse = await snaptrade.authentication.deleteSnapTradeUser({
|
|
33
|
+
"userId": "John.doe@snaptrade.com",
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
console.log(deleteSnapTradeUserResponse)
|
|
35
37
|
|
|
36
38
|
```
|
|
37
39
|
|
|
@@ -47,10 +49,6 @@ Name | Type | Description | Notes
|
|
|
47
49
|
|
|
48
50
|
**DeleteUserResponse**
|
|
49
51
|
|
|
50
|
-
### Authorization
|
|
51
|
-
|
|
52
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
53
|
-
|
|
54
52
|
### HTTP request headers
|
|
55
53
|
|
|
56
54
|
- **Content-Type**: Not defined
|
|
@@ -69,7 +67,8 @@ Name | Type | Description | Notes
|
|
|
69
67
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
70
68
|
|
|
71
69
|
# **getUserJWT**
|
|
72
|
-
|
|
70
|
+
|
|
71
|
+
#### **GET** /snapTrade/encryptedJWT
|
|
73
72
|
|
|
74
73
|
|
|
75
74
|
### Example
|
|
@@ -85,11 +84,12 @@ const snaptrade = new Snaptrade({
|
|
|
85
84
|
clientId: "YOUR_CLIENT_ID",
|
|
86
85
|
})
|
|
87
86
|
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
})
|
|
92
|
-
|
|
87
|
+
const getUserJWTResponse = await snaptrade.authentication.getUserJWT({
|
|
88
|
+
"userId": "John.doe@snaptrade.com",
|
|
89
|
+
"userSecret": "USERSECRET123",
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
console.log(getUserJWTResponse)
|
|
93
93
|
|
|
94
94
|
```
|
|
95
95
|
|
|
@@ -106,10 +106,6 @@ Name | Type | Description | Notes
|
|
|
106
106
|
|
|
107
107
|
**EncryptedResponse**
|
|
108
108
|
|
|
109
|
-
### Authorization
|
|
110
|
-
|
|
111
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
112
|
-
|
|
113
109
|
### HTTP request headers
|
|
114
110
|
|
|
115
111
|
- **Content-Type**: Not defined
|
|
@@ -128,7 +124,8 @@ Name | Type | Description | Notes
|
|
|
128
124
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
129
125
|
|
|
130
126
|
# **listSnapTradeUsers**
|
|
131
|
-
|
|
127
|
+
|
|
128
|
+
#### **GET** /snapTrade/listUsers
|
|
132
129
|
|
|
133
130
|
|
|
134
131
|
### Example
|
|
@@ -144,8 +141,9 @@ const snaptrade = new Snaptrade({
|
|
|
144
141
|
clientId: "YOUR_CLIENT_ID",
|
|
145
142
|
})
|
|
146
143
|
|
|
147
|
-
const
|
|
148
|
-
|
|
144
|
+
const listSnapTradeUsersResponse = await snaptrade.authentication.listSnapTradeUsers()
|
|
145
|
+
|
|
146
|
+
console.log(listSnapTradeUsersResponse)
|
|
149
147
|
|
|
150
148
|
```
|
|
151
149
|
|
|
@@ -158,10 +156,6 @@ This endpoint does not need any parameter.
|
|
|
158
156
|
|
|
159
157
|
**Array<string>**
|
|
160
158
|
|
|
161
|
-
### Authorization
|
|
162
|
-
|
|
163
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
164
|
-
|
|
165
159
|
### HTTP request headers
|
|
166
160
|
|
|
167
161
|
- **Content-Type**: Not defined
|
|
@@ -179,7 +173,8 @@ This endpoint does not need any parameter.
|
|
|
179
173
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
180
174
|
|
|
181
175
|
# **loginSnapTradeUser**
|
|
182
|
-
|
|
176
|
+
|
|
177
|
+
#### **POST** /snapTrade/login
|
|
183
178
|
|
|
184
179
|
|
|
185
180
|
### Example
|
|
@@ -195,18 +190,17 @@ const snaptrade = new Snaptrade({
|
|
|
195
190
|
clientId: "YOUR_CLIENT_ID",
|
|
196
191
|
})
|
|
197
192
|
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
console.log(response)
|
|
193
|
+
const loginSnapTradeUserResponse = await snaptrade.authentication.loginSnapTradeUser({
|
|
194
|
+
"userId": "John.doe@snaptrade.com",
|
|
195
|
+
"userSecret": "USERSECRET123",
|
|
196
|
+
"broker": "ALPACA",
|
|
197
|
+
"immediate_redirect": true,
|
|
198
|
+
"custom_redirect": "https://passiv.com",
|
|
199
|
+
"reconnect": "8b5f262d-4bb9-365d-888a-202bd3b15fa1",
|
|
200
|
+
"connection_type": "read",
|
|
201
|
+
})
|
|
202
|
+
|
|
203
|
+
console.log(loginSnapTradeUserResponse)
|
|
210
204
|
|
|
211
205
|
```
|
|
212
206
|
|
|
@@ -224,10 +218,6 @@ Name | Type | Description | Notes
|
|
|
224
218
|
|
|
225
219
|
**AuthenticationLoginSnapTradeUser200Response**
|
|
226
220
|
|
|
227
|
-
### Authorization
|
|
228
|
-
|
|
229
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
230
|
-
|
|
231
221
|
### HTTP request headers
|
|
232
222
|
|
|
233
223
|
- **Content-Type**: application/json
|
|
@@ -246,7 +236,8 @@ Name | Type | Description | Notes
|
|
|
246
236
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
247
237
|
|
|
248
238
|
# **registerSnapTradeUser**
|
|
249
|
-
|
|
239
|
+
|
|
240
|
+
#### **POST** /snapTrade/registerUser
|
|
250
241
|
|
|
251
242
|
|
|
252
243
|
### Example
|
|
@@ -262,13 +253,12 @@ const snaptrade = new Snaptrade({
|
|
|
262
253
|
clientId: "YOUR_CLIENT_ID",
|
|
263
254
|
})
|
|
264
255
|
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
console.log(response)
|
|
256
|
+
const registerSnapTradeUserResponse = await snaptrade.authentication.registerSnapTradeUser({
|
|
257
|
+
"user_id": "snaptrade-user-123",
|
|
258
|
+
"rsa_public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC7vbqajDw4o6gJy8UtmIbkcpnkO3Kwc4qsEnSZp/TR+fQi62F79RHWmwKOtFmwteURgLbj7D/WGuNLGOfa/2vse3G2eHnHl5CB8ruRX9fBl/KgwCVr2JaEuUm66bBQeP5XeBotdR4cvX38uPYivCDdPjJ1QWPdspTBKcxeFbccDw==",
|
|
259
|
+
})
|
|
260
|
+
|
|
261
|
+
console.log(registerSnapTradeUserResponse)
|
|
272
262
|
|
|
273
263
|
```
|
|
274
264
|
|
|
@@ -284,10 +274,6 @@ Name | Type | Description | Notes
|
|
|
284
274
|
|
|
285
275
|
**UserIDandSecret**
|
|
286
276
|
|
|
287
|
-
### Authorization
|
|
288
|
-
|
|
289
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
290
|
-
|
|
291
277
|
### HTTP request headers
|
|
292
278
|
|
|
293
279
|
- **Content-Type**: application/json
|