snaptrade-typescript-sdk 8.6.0 → 8.7.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.
@@ -25,24 +25,24 @@ Method | HTTP request | Description
25
25
 
26
26
 
27
27
  ```typescript
28
- import { Snaptrade } from "snaptrade-typescript-sdk"
28
+ import { Snaptrade } from "snaptrade-typescript-sdk";
29
29
 
30
30
  const snaptrade = new Snaptrade({
31
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
32
- // basePath: "https://api.snaptrade.com/api/v1",
33
- consumerKey: "YOUR_CONSUMER_KEY",
34
- clientId: "YOUR_CLIENT_ID",
35
- })
36
-
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)
45
-
31
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
32
+ // basePath: "https://api.snaptrade.com/api/v1",
33
+ consumerKey: "YOUR_CONSUMER_KEY",
34
+ clientId: "YOUR_CLIENT_ID",
35
+ });
36
+
37
+ const cancelUserAccountOrderResponse =
38
+ await snaptrade.trading.cancelUserAccountOrder({
39
+ userId: "John.doe@snaptrade.com",
40
+ userSecret: "USERSECRET123",
41
+ accountId: "accountId_example",
42
+ brokerage_order_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
43
+ });
44
+
45
+ console.log(cancelUserAccountOrderResponse);
46
46
  ```
47
47
 
48
48
 
@@ -84,23 +84,23 @@ Name | Type | Description | Notes
84
84
 
85
85
 
86
86
  ```typescript
87
- import { Snaptrade } from "snaptrade-typescript-sdk"
87
+ import { Snaptrade } from "snaptrade-typescript-sdk";
88
88
 
89
89
  const snaptrade = new Snaptrade({
90
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
91
- // basePath: "https://api.snaptrade.com/api/v1",
92
- consumerKey: "YOUR_CONSUMER_KEY",
93
- clientId: "YOUR_CLIENT_ID",
94
- })
95
-
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
-
90
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
91
+ // basePath: "https://api.snaptrade.com/api/v1",
92
+ consumerKey: "YOUR_CONSUMER_KEY",
93
+ clientId: "YOUR_CLIENT_ID",
94
+ });
95
+
96
+ const getCalculatedTradeImpactByIdResponse =
97
+ await snaptrade.trading.getCalculatedTradeImpactById({
98
+ portfolioGroupId: "portfolioGroupId_example",
99
+ calculatedTradeId: "calculatedTradeId_example",
100
+ tradeId: "tradeId_example",
101
+ });
102
+
103
+ console.log(getCalculatedTradeImpactByIdResponse);
104
104
  ```
105
105
 
106
106
 
@@ -139,22 +139,22 @@ Name | Type | Description | Notes
139
139
 
140
140
 
141
141
  ```typescript
142
- import { Snaptrade } from "snaptrade-typescript-sdk"
142
+ import { Snaptrade } from "snaptrade-typescript-sdk";
143
143
 
144
144
  const snaptrade = new Snaptrade({
145
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
146
- // basePath: "https://api.snaptrade.com/api/v1",
147
- consumerKey: "YOUR_CONSUMER_KEY",
148
- clientId: "YOUR_CLIENT_ID",
149
- })
150
-
151
- const getCalculatedTradesImpactResponse = await snaptrade.trading.getCalculatedTradesImpact({
152
- "portfolioGroupId": "portfolioGroupId_example",
153
- "calculatedTradeId": "calculatedTradeId_example",
154
- })
155
-
156
- console.log(getCalculatedTradesImpactResponse)
157
-
145
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
146
+ // basePath: "https://api.snaptrade.com/api/v1",
147
+ consumerKey: "YOUR_CONSUMER_KEY",
148
+ clientId: "YOUR_CLIENT_ID",
149
+ });
150
+
151
+ const getCalculatedTradesImpactResponse =
152
+ await snaptrade.trading.getCalculatedTradesImpact({
153
+ portfolioGroupId: "portfolioGroupId_example",
154
+ calculatedTradeId: "calculatedTradeId_example",
155
+ });
156
+
157
+ console.log(getCalculatedTradesImpactResponse);
158
158
  ```
159
159
 
160
160
 
@@ -192,29 +192,28 @@ Name | Type | Description | Notes
192
192
 
193
193
 
194
194
  ```typescript
195
- import { Snaptrade } from "snaptrade-typescript-sdk"
195
+ import { Snaptrade } from "snaptrade-typescript-sdk";
196
196
 
197
197
  const snaptrade = new Snaptrade({
198
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
199
- // basePath: "https://api.snaptrade.com/api/v1",
200
- consumerKey: "YOUR_CONSUMER_KEY",
201
- clientId: "YOUR_CLIENT_ID",
202
- })
198
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
199
+ // basePath: "https://api.snaptrade.com/api/v1",
200
+ consumerKey: "YOUR_CONSUMER_KEY",
201
+ clientId: "YOUR_CLIENT_ID",
202
+ });
203
203
 
204
204
  const getOrderImpactResponse = await snaptrade.trading.getOrderImpact({
205
- "userId": "John.doe@snaptrade.com",
206
- "userSecret": "USERSECRET123",
207
- "account_id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
208
- "action": "BUY",
209
- "order_type": "Limit",
210
- "price": 31.33,
211
- "stop": 31.33,
212
- "time_in_force": "Day",
213
- "universal_symbol_id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
214
- })
215
-
216
- console.log(getOrderImpactResponse)
217
-
205
+ userId: "John.doe@snaptrade.com",
206
+ userSecret: "USERSECRET123",
207
+ account_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
208
+ action: "BUY",
209
+ order_type: "Limit",
210
+ price: 31.33,
211
+ stop: 31.33,
212
+ time_in_force: "Day",
213
+ universal_symbol_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
214
+ });
215
+
216
+ console.log(getOrderImpactResponse);
218
217
  ```
219
218
 
220
219
 
@@ -256,24 +255,24 @@ Name | Type | Description | Notes
256
255
 
257
256
 
258
257
  ```typescript
259
- import { Snaptrade } from "snaptrade-typescript-sdk"
258
+ import { Snaptrade } from "snaptrade-typescript-sdk";
260
259
 
261
260
  const snaptrade = new Snaptrade({
262
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
263
- // basePath: "https://api.snaptrade.com/api/v1",
264
- consumerKey: "YOUR_CONSUMER_KEY",
265
- clientId: "YOUR_CLIENT_ID",
266
- })
267
-
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)
276
-
261
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
262
+ // basePath: "https://api.snaptrade.com/api/v1",
263
+ consumerKey: "YOUR_CONSUMER_KEY",
264
+ clientId: "YOUR_CLIENT_ID",
265
+ });
266
+
267
+ const getUserAccountQuotesResponse =
268
+ 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);
277
276
  ```
278
277
 
279
278
 
@@ -315,28 +314,28 @@ Name | Type | Description | Notes
315
314
 
316
315
 
317
316
  ```typescript
318
- import { Snaptrade } from "snaptrade-typescript-sdk"
317
+ import { Snaptrade } from "snaptrade-typescript-sdk";
319
318
 
320
319
  const snaptrade = new Snaptrade({
321
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
322
- // basePath: "https://api.snaptrade.com/api/v1",
323
- consumerKey: "YOUR_CONSUMER_KEY",
324
- clientId: "YOUR_CLIENT_ID",
325
- })
326
-
327
- const modifyCalculatedTradeByIdResponse = await snaptrade.trading.modifyCalculatedTradeById({
328
- "portfolioGroupId": "portfolioGroupId_example",
329
- "calculatedTradeId": "calculatedTradeId_example",
330
- "tradeId": "tradeId_example",
331
- "id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
332
- "action": "BUY",
333
- "units": 6,
334
- "price": 24.81,
335
- "sequence": 1,
336
- })
337
-
338
- console.log(modifyCalculatedTradeByIdResponse)
339
-
320
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
321
+ // basePath: "https://api.snaptrade.com/api/v1",
322
+ consumerKey: "YOUR_CONSUMER_KEY",
323
+ clientId: "YOUR_CLIENT_ID",
324
+ });
325
+
326
+ const modifyCalculatedTradeByIdResponse =
327
+ await snaptrade.trading.modifyCalculatedTradeById({
328
+ portfolioGroupId: "portfolioGroupId_example",
329
+ calculatedTradeId: "calculatedTradeId_example",
330
+ tradeId: "tradeId_example",
331
+ id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
332
+ action: "BUY",
333
+ units: 6,
334
+ price: 24.81,
335
+ sequence: 1,
336
+ });
337
+
338
+ console.log(modifyCalculatedTradeByIdResponse);
340
339
  ```
341
340
 
342
341
 
@@ -376,22 +375,22 @@ Name | Type | Description | Notes
376
375
 
377
376
 
378
377
  ```typescript
379
- import { Snaptrade } from "snaptrade-typescript-sdk"
378
+ import { Snaptrade } from "snaptrade-typescript-sdk";
380
379
 
381
380
  const snaptrade = new Snaptrade({
382
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
383
- // basePath: "https://api.snaptrade.com/api/v1",
384
- consumerKey: "YOUR_CONSUMER_KEY",
385
- clientId: "YOUR_CLIENT_ID",
386
- })
387
-
388
- const placeCalculatedTradesResponse = await snaptrade.trading.placeCalculatedTrades({
389
- "portfolioGroupId": "portfolioGroupId_example",
390
- "calculatedTradeId": "calculatedTradeId_example",
391
- })
392
-
393
- console.log(placeCalculatedTradesResponse)
394
-
381
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
382
+ // basePath: "https://api.snaptrade.com/api/v1",
383
+ consumerKey: "YOUR_CONSUMER_KEY",
384
+ clientId: "YOUR_CLIENT_ID",
385
+ });
386
+
387
+ const placeCalculatedTradesResponse =
388
+ await snaptrade.trading.placeCalculatedTrades({
389
+ portfolioGroupId: "portfolioGroupId_example",
390
+ calculatedTradeId: "calculatedTradeId_example",
391
+ });
392
+
393
+ console.log(placeCalculatedTradesResponse);
395
394
  ```
396
395
 
397
396
 
@@ -429,29 +428,28 @@ Name | Type | Description | Notes
429
428
 
430
429
 
431
430
  ```typescript
432
- import { Snaptrade } from "snaptrade-typescript-sdk"
431
+ import { Snaptrade } from "snaptrade-typescript-sdk";
433
432
 
434
433
  const snaptrade = new Snaptrade({
435
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
436
- // basePath: "https://api.snaptrade.com/api/v1",
437
- consumerKey: "YOUR_CONSUMER_KEY",
438
- clientId: "YOUR_CLIENT_ID",
439
- })
434
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
435
+ // basePath: "https://api.snaptrade.com/api/v1",
436
+ consumerKey: "YOUR_CONSUMER_KEY",
437
+ clientId: "YOUR_CLIENT_ID",
438
+ });
440
439
 
441
440
  const placeForceOrderResponse = await snaptrade.trading.placeForceOrder({
442
- "userId": "John.doe@snaptrade.com",
443
- "userSecret": "USERSECRET123",
444
- "account_id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
445
- "action": "BUY",
446
- "order_type": "Limit",
447
- "price": 31.33,
448
- "stop": 31.33,
449
- "time_in_force": "Day",
450
- "universal_symbol_id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
451
- })
452
-
453
- console.log(placeForceOrderResponse)
454
-
441
+ userId: "John.doe@snaptrade.com",
442
+ userSecret: "USERSECRET123",
443
+ account_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
444
+ action: "BUY",
445
+ order_type: "Limit",
446
+ price: 31.33,
447
+ stop: 31.33,
448
+ time_in_force: "Day",
449
+ universal_symbol_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
450
+ });
451
+
452
+ console.log(placeForceOrderResponse);
455
453
  ```
456
454
 
457
455
 
@@ -493,22 +491,21 @@ Name | Type | Description | Notes
493
491
 
494
492
 
495
493
  ```typescript
496
- import { Snaptrade } from "snaptrade-typescript-sdk"
494
+ import { Snaptrade } from "snaptrade-typescript-sdk";
497
495
 
498
496
  const snaptrade = new Snaptrade({
499
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
500
- // basePath: "https://api.snaptrade.com/api/v1",
501
- consumerKey: "YOUR_CONSUMER_KEY",
502
- clientId: "YOUR_CLIENT_ID",
503
- })
497
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
498
+ // basePath: "https://api.snaptrade.com/api/v1",
499
+ consumerKey: "YOUR_CONSUMER_KEY",
500
+ clientId: "YOUR_CLIENT_ID",
501
+ });
504
502
 
505
503
  const placeOCOOrderResponse = await snaptrade.trading.placeOCOOrder({
506
- "userId": "John.doe@snaptrade.com",
507
- "userSecret": "USERSECRET123",
508
- })
509
-
510
- console.log(placeOCOOrderResponse)
504
+ userId: "John.doe@snaptrade.com",
505
+ userSecret: "USERSECRET123",
506
+ });
511
507
 
508
+ console.log(placeOCOOrderResponse);
512
509
  ```
513
510
 
514
511
 
@@ -549,23 +546,22 @@ Name | Type | Description | Notes
549
546
 
550
547
 
551
548
  ```typescript
552
- import { Snaptrade } from "snaptrade-typescript-sdk"
549
+ import { Snaptrade } from "snaptrade-typescript-sdk";
553
550
 
554
551
  const snaptrade = new Snaptrade({
555
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
556
- // basePath: "https://api.snaptrade.com/api/v1",
557
- consumerKey: "YOUR_CONSUMER_KEY",
558
- clientId: "YOUR_CLIENT_ID",
559
- })
552
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
553
+ // basePath: "https://api.snaptrade.com/api/v1",
554
+ consumerKey: "YOUR_CONSUMER_KEY",
555
+ clientId: "YOUR_CLIENT_ID",
556
+ });
560
557
 
561
558
  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)
559
+ tradeId: "tradeId_example",
560
+ userId: "John.doe@snaptrade.com",
561
+ userSecret: "USERSECRET123",
562
+ });
568
563
 
564
+ console.log(placeOrderResponse);
569
565
  ```
570
566
 
571
567
 
@@ -19,26 +19,28 @@ Returns activities (transactions) for a user. Specifing start and end date is hi
19
19
 
20
20
 
21
21
  ```typescript
22
- import { Snaptrade } from "snaptrade-typescript-sdk"
22
+ import { Snaptrade } from "snaptrade-typescript-sdk";
23
23
 
24
24
  const snaptrade = new Snaptrade({
25
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
26
- // basePath: "https://api.snaptrade.com/api/v1",
27
- consumerKey: "YOUR_CONSUMER_KEY",
28
- clientId: "YOUR_CLIENT_ID",
29
- })
30
-
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
- "brokerageAuthorizations": "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
36
- "userId": "John.doe@snaptrade.com",
37
- "userSecret": "USERSECRET123",
38
- })
39
-
40
- console.log(getActivitiesResponse)
41
-
25
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
26
+ // basePath: "https://api.snaptrade.com/api/v1",
27
+ consumerKey: "YOUR_CONSUMER_KEY",
28
+ clientId: "YOUR_CLIENT_ID",
29
+ });
30
+
31
+ const getActivitiesResponse =
32
+ await snaptrade.transactionsAndReporting.getActivities({
33
+ startDate: "2022-01-24",
34
+ endDate: "2022-01-24",
35
+ accounts:
36
+ "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
37
+ brokerageAuthorizations:
38
+ "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
39
+ userId: "John.doe@snaptrade.com",
40
+ userSecret: "USERSECRET123",
41
+ });
42
+
43
+ console.log(getActivitiesResponse);
42
44
  ```
43
45
 
44
46
 
@@ -83,27 +85,28 @@ Returns performance information (contributions, dividends, rate of return, etc)
83
85
 
84
86
 
85
87
  ```typescript
86
- import { Snaptrade } from "snaptrade-typescript-sdk"
88
+ import { Snaptrade } from "snaptrade-typescript-sdk";
87
89
 
88
90
  const snaptrade = new Snaptrade({
89
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
90
- // basePath: "https://api.snaptrade.com/api/v1",
91
- consumerKey: "YOUR_CONSUMER_KEY",
92
- clientId: "YOUR_CLIENT_ID",
93
- })
94
-
95
- const getReportingCustomRangeResponse = await snaptrade.transactionsAndReporting.getReportingCustomRange({
96
- "startDate": "2022-01-24",
97
- "endDate": "2022-01-24",
98
- "accounts": "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
99
- "detailed": true,
100
- "frequency": "monthly",
101
- "userId": "John.doe@snaptrade.com",
102
- "userSecret": "USERSECRET123",
103
- })
104
-
105
- console.log(getReportingCustomRangeResponse)
106
-
91
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
92
+ // basePath: "https://api.snaptrade.com/api/v1",
93
+ consumerKey: "YOUR_CONSUMER_KEY",
94
+ clientId: "YOUR_CLIENT_ID",
95
+ });
96
+
97
+ const getReportingCustomRangeResponse =
98
+ await snaptrade.transactionsAndReporting.getReportingCustomRange({
99
+ startDate: "2022-01-24",
100
+ endDate: "2022-01-24",
101
+ accounts:
102
+ "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
103
+ detailed: true,
104
+ frequency: "monthly",
105
+ userId: "John.doe@snaptrade.com",
106
+ userSecret: "USERSECRET123",
107
+ });
108
+
109
+ console.log(getReportingCustomRangeResponse);
107
110
  ```
108
111
 
109
112
 
@@ -57,6 +57,12 @@ export interface SessionEvent {
57
57
  * @memberof SessionEvent
58
58
  */
59
59
  'brokerage_status_code'?: number | null;
60
+ /**
61
+ *
62
+ * @type {string}
63
+ * @memberof SessionEvent
64
+ */
65
+ 'brokerage_authorization_id'?: string;
60
66
  }
61
67
 
62
68
  export const SessionEventSessionEventTypeEnum = {
package/models/symbol.ts CHANGED
@@ -18,6 +18,9 @@ import { Currency } from './currency';
18
18
  // May contain unused imports in some cases
19
19
  // @ts-ignore
20
20
  import { Exchange } from './exchange';
21
+ // May contain unused imports in some cases
22
+ // @ts-ignore
23
+ import { SecurityType } from './security-type';
21
24
 
22
25
  /**
23
26
  * Symbol
@@ -63,5 +66,11 @@ export interface Symbol {
63
66
  * @memberof Symbol
64
67
  */
65
68
  'exchange'?: Exchange;
69
+ /**
70
+ *
71
+ * @type {SecurityType}
72
+ * @memberof Symbol
73
+ */
74
+ 'type'?: SecurityType;
66
75
  }
67
76
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snaptrade-typescript-sdk",
3
- "version": "8.6.0",
3
+ "version": "8.7.0",
4
4
  "description": "Client for SnapTrade",
5
5
  "author": "Konfig",
6
6
  "engines": {