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.
@@ -19,23 +19,23 @@ Method | HTTP request | Description
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 detailBrokerageAuthorizationResponse = await snaptrade.connections.detailBrokerageAuthorization({
32
- "authorizationId": "2bcd7cc3-e922-4976-bce1-9858296801c3",
33
- "userId": "John.doe@snaptrade.com",
34
- "userSecret": "USERSECRET123",
35
- })
36
-
37
- console.log(detailBrokerageAuthorizationResponse)
38
-
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 detailBrokerageAuthorizationResponse =
32
+ await snaptrade.connections.detailBrokerageAuthorization({
33
+ authorizationId: "2bcd7cc3-e922-4976-bce1-9858296801c3",
34
+ userId: "John.doe@snaptrade.com",
35
+ userSecret: "USERSECRET123",
36
+ });
37
+
38
+ console.log(detailBrokerageAuthorizationResponse);
39
39
  ```
40
40
 
41
41
 
@@ -75,22 +75,22 @@ Name | Type | Description | Notes
75
75
 
76
76
 
77
77
  ```typescript
78
- import { Snaptrade } from "snaptrade-typescript-sdk"
78
+ import { Snaptrade } from "snaptrade-typescript-sdk";
79
79
 
80
80
  const snaptrade = new Snaptrade({
81
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
82
- // basePath: "https://api.snaptrade.com/api/v1",
83
- consumerKey: "YOUR_CONSUMER_KEY",
84
- clientId: "YOUR_CLIENT_ID",
85
- })
86
-
87
- const listBrokerageAuthorizationsResponse = await snaptrade.connections.listBrokerageAuthorizations({
88
- "userId": "John.doe@snaptrade.com",
89
- "userSecret": "USERSECRET123",
90
- })
91
-
92
- console.log(listBrokerageAuthorizationsResponse)
93
-
81
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
82
+ // basePath: "https://api.snaptrade.com/api/v1",
83
+ consumerKey: "YOUR_CONSUMER_KEY",
84
+ clientId: "YOUR_CLIENT_ID",
85
+ });
86
+
87
+ const listBrokerageAuthorizationsResponse =
88
+ await snaptrade.connections.listBrokerageAuthorizations({
89
+ userId: "John.doe@snaptrade.com",
90
+ userSecret: "USERSECRET123",
91
+ });
92
+
93
+ console.log(listBrokerageAuthorizationsResponse);
94
94
  ```
95
95
 
96
96
 
@@ -129,23 +129,23 @@ Name | Type | Description | Notes
129
129
 
130
130
 
131
131
  ```typescript
132
- import { Snaptrade } from "snaptrade-typescript-sdk"
132
+ import { Snaptrade } from "snaptrade-typescript-sdk";
133
133
 
134
134
  const snaptrade = new Snaptrade({
135
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
136
- // basePath: "https://api.snaptrade.com/api/v1",
137
- consumerKey: "YOUR_CONSUMER_KEY",
138
- clientId: "YOUR_CLIENT_ID",
139
- })
140
-
141
- const removeBrokerageAuthorizationResponse = await snaptrade.connections.removeBrokerageAuthorization({
142
- "authorizationId": "2bcd7cc3-e922-4976-bce1-9858296801c3",
143
- "userId": "John.doe@snaptrade.com",
144
- "userSecret": "USERSECRET123",
145
- })
146
-
147
- console.log(removeBrokerageAuthorizationResponse)
148
-
135
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
136
+ // basePath: "https://api.snaptrade.com/api/v1",
137
+ consumerKey: "YOUR_CONSUMER_KEY",
138
+ clientId: "YOUR_CLIENT_ID",
139
+ });
140
+
141
+ const removeBrokerageAuthorizationResponse =
142
+ await snaptrade.connections.removeBrokerageAuthorization({
143
+ authorizationId: "2bcd7cc3-e922-4976-bce1-9858296801c3",
144
+ userId: "John.doe@snaptrade.com",
145
+ userSecret: "USERSECRET123",
146
+ });
147
+
148
+ console.log(removeBrokerageAuthorizationResponse);
149
149
  ```
150
150
 
151
151
 
@@ -187,23 +187,24 @@ void (empty response body)
187
187
 
188
188
 
189
189
  ```typescript
190
- import { Snaptrade } from "snaptrade-typescript-sdk"
190
+ import { Snaptrade } from "snaptrade-typescript-sdk";
191
191
 
192
192
  const snaptrade = new Snaptrade({
193
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
194
- // basePath: "https://api.snaptrade.com/api/v1",
195
- consumerKey: "YOUR_CONSUMER_KEY",
196
- clientId: "YOUR_CLIENT_ID",
197
- })
193
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
194
+ // basePath: "https://api.snaptrade.com/api/v1",
195
+ consumerKey: "YOUR_CONSUMER_KEY",
196
+ clientId: "YOUR_CLIENT_ID",
197
+ });
198
198
 
199
199
  const sessionEventsResponse = await snaptrade.connections.sessionEvents({
200
- "partnerClientId": "PASSIVTEST",
201
- "userId": "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
202
- "sessionId": "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
203
- })
204
-
205
- console.log(sessionEventsResponse)
206
-
200
+ partnerClientId: "PASSIVTEST",
201
+ userId:
202
+ "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
203
+ sessionId:
204
+ "917c8734-8470-4a3e-a18f-57c3f2ee6631,65e839a3-9103-4cfb-9b72-2071ef80c5f2",
205
+ });
206
+
207
+ console.log(sessionEventsResponse);
207
208
  ```
208
209
 
209
210
 
@@ -16,22 +16,21 @@ Method | HTTP request | Description
16
16
 
17
17
 
18
18
  ```typescript
19
- import { Snaptrade } from "snaptrade-typescript-sdk"
19
+ import { Snaptrade } from "snaptrade-typescript-sdk";
20
20
 
21
21
  const snaptrade = new Snaptrade({
22
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
23
- // basePath: "https://api.snaptrade.com/api/v1",
24
- consumerKey: "YOUR_CONSUMER_KEY",
25
- clientId: "YOUR_CLIENT_ID",
26
- })
22
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
23
+ // basePath: "https://api.snaptrade.com/api/v1",
24
+ consumerKey: "YOUR_CONSUMER_KEY",
25
+ clientId: "YOUR_CLIENT_ID",
26
+ });
27
27
 
28
28
  const listUserErrorsResponse = await snaptrade.errorLogs.listUserErrors({
29
- "userId": "John.doe@snaptrade.com",
30
- "userSecret": "USERSECRET123",
31
- })
32
-
33
- console.log(listUserErrorsResponse)
29
+ userId: "John.doe@snaptrade.com",
30
+ userSecret: "USERSECRET123",
31
+ });
34
32
 
33
+ console.log(listUserErrorsResponse);
35
34
  ```
36
35
 
37
36
 
@@ -20,32 +20,31 @@ Method | HTTP request | Description
20
20
 
21
21
 
22
22
  ```typescript
23
- import { Snaptrade } from "snaptrade-typescript-sdk"
23
+ import { Snaptrade } from "snaptrade-typescript-sdk";
24
24
 
25
25
  const snaptrade = new Snaptrade({
26
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
27
- // basePath: "https://api.snaptrade.com/api/v1",
28
- consumerKey: "YOUR_CONSUMER_KEY",
29
- clientId: "YOUR_CLIENT_ID",
30
- })
26
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
27
+ // basePath: "https://api.snaptrade.com/api/v1",
28
+ consumerKey: "YOUR_CONSUMER_KEY",
29
+ clientId: "YOUR_CLIENT_ID",
30
+ });
31
31
 
32
32
  const getOptionStrategyResponse = await snaptrade.options.getOptionStrategy({
33
- "userId": "John.doe@snaptrade.com",
34
- "userSecret": "USERSECRET123",
35
- "accountId": "accountId_example",
36
- "underlying_symbol_id": "2bcd7cc3-e922-4976-bce1-9858296801c3",
37
- "legs": [
38
- {
39
- "action": "BUY_TO_OPEN",
40
- "option_symbol_id": "SPY220819P00200000",
41
- "quantity": 1,
42
- }
43
- ],
44
- "strategy_type": "CUSTOM",
45
- })
46
-
47
- console.log(getOptionStrategyResponse)
48
-
33
+ userId: "John.doe@snaptrade.com",
34
+ userSecret: "USERSECRET123",
35
+ accountId: "accountId_example",
36
+ underlying_symbol_id: "2bcd7cc3-e922-4976-bce1-9858296801c3",
37
+ legs: [
38
+ {
39
+ action: "BUY_TO_OPEN",
40
+ option_symbol_id: "SPY220819P00200000",
41
+ quantity: 1,
42
+ },
43
+ ],
44
+ strategy_type: "CUSTOM",
45
+ });
46
+
47
+ console.log(getOptionStrategyResponse);
49
48
  ```
50
49
 
51
50
 
@@ -86,24 +85,23 @@ Name | Type | Description | Notes
86
85
 
87
86
 
88
87
  ```typescript
89
- import { Snaptrade } from "snaptrade-typescript-sdk"
88
+ import { Snaptrade } from "snaptrade-typescript-sdk";
90
89
 
91
90
  const snaptrade = new Snaptrade({
92
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
93
- // basePath: "https://api.snaptrade.com/api/v1",
94
- consumerKey: "YOUR_CONSUMER_KEY",
95
- clientId: "YOUR_CLIENT_ID",
96
- })
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
+ });
97
96
 
98
97
  const getOptionsChainResponse = await snaptrade.options.getOptionsChain({
99
- "userId": "John.doe@snaptrade.com",
100
- "userSecret": "USERSECRET123",
101
- "accountId": "accountId_example",
102
- "symbol": "symbol_example",
103
- })
104
-
105
- console.log(getOptionsChainResponse)
98
+ userId: "John.doe@snaptrade.com",
99
+ userSecret: "USERSECRET123",
100
+ accountId: "accountId_example",
101
+ symbol: "symbol_example",
102
+ });
106
103
 
104
+ console.log(getOptionsChainResponse);
107
105
  ```
108
106
 
109
107
 
@@ -144,24 +142,24 @@ Name | Type | Description | Notes
144
142
 
145
143
 
146
144
  ```typescript
147
- import { Snaptrade } from "snaptrade-typescript-sdk"
145
+ import { Snaptrade } from "snaptrade-typescript-sdk";
148
146
 
149
147
  const snaptrade = new Snaptrade({
150
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
151
- // basePath: "https://api.snaptrade.com/api/v1",
152
- consumerKey: "YOUR_CONSUMER_KEY",
153
- clientId: "YOUR_CLIENT_ID",
154
- })
155
-
156
- const getOptionsStrategyQuoteResponse = await snaptrade.options.getOptionsStrategyQuote({
157
- "userId": "John.doe@snaptrade.com",
158
- "userSecret": "USERSECRET123",
159
- "accountId": "accountId_example",
160
- "optionStrategyId": "2bcd7cc3-e922-4976-bce1-9858296801c3",
161
- })
162
-
163
- console.log(getOptionsStrategyQuoteResponse)
164
-
148
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
149
+ // basePath: "https://api.snaptrade.com/api/v1",
150
+ consumerKey: "YOUR_CONSUMER_KEY",
151
+ clientId: "YOUR_CLIENT_ID",
152
+ });
153
+
154
+ const getOptionsStrategyQuoteResponse =
155
+ await snaptrade.options.getOptionsStrategyQuote({
156
+ userId: "John.doe@snaptrade.com",
157
+ userSecret: "USERSECRET123",
158
+ accountId: "accountId_example",
159
+ optionStrategyId: "2bcd7cc3-e922-4976-bce1-9858296801c3",
160
+ });
161
+
162
+ console.log(getOptionsStrategyQuoteResponse);
165
163
  ```
166
164
 
167
165
 
@@ -202,23 +200,22 @@ Name | Type | Description | Notes
202
200
 
203
201
 
204
202
  ```typescript
205
- import { Snaptrade } from "snaptrade-typescript-sdk"
203
+ import { Snaptrade } from "snaptrade-typescript-sdk";
206
204
 
207
205
  const snaptrade = new Snaptrade({
208
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
209
- // basePath: "https://api.snaptrade.com/api/v1",
210
- consumerKey: "YOUR_CONSUMER_KEY",
211
- clientId: "YOUR_CLIENT_ID",
212
- })
206
+ // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
207
+ // basePath: "https://api.snaptrade.com/api/v1",
208
+ consumerKey: "YOUR_CONSUMER_KEY",
209
+ clientId: "YOUR_CLIENT_ID",
210
+ });
213
211
 
214
212
  const listOptionHoldingsResponse = await snaptrade.options.listOptionHoldings({
215
- "userId": "John.doe@snaptrade.com",
216
- "userSecret": "USERSECRET123",
217
- "accountId": "accountId_example",
218
- })
219
-
220
- console.log(listOptionHoldingsResponse)
213
+ userId: "John.doe@snaptrade.com",
214
+ userSecret: "USERSECRET123",
215
+ accountId: "accountId_example",
216
+ });
221
217
 
218
+ console.log(listOptionHoldingsResponse);
222
219
  ```
223
220
 
224
221
 
@@ -258,27 +255,28 @@ Name | Type | Description | Notes
258
255
 
259
256
 
260
257
  ```typescript
261
- import { Snaptrade } from "snaptrade-typescript-sdk"
258
+ import { Snaptrade } from "snaptrade-typescript-sdk";
262
259
 
263
260
  const snaptrade = new Snaptrade({
264
- // Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
265
- // basePath: "https://api.snaptrade.com/api/v1",
266
- consumerKey: "YOUR_CONSUMER_KEY",
267
- clientId: "YOUR_CLIENT_ID",
268
- })
269
-
270
- const placeOptionStrategyResponse = await snaptrade.options.placeOptionStrategy({
271
- "userId": "John.doe@snaptrade.com",
272
- "userSecret": "USERSECRET123",
273
- "accountId": "2bcd7cc3-e922-4976-bce1-9858296801c3",
274
- "optionStrategyId": "2bcd7cc3-e922-4976-bce1-9858296801c3",
275
- "order_type": "Limit",
276
- "time_in_force": "DAY",
277
- "price": 31.33,
278
- })
279
-
280
- console.log(placeOptionStrategyResponse)
281
-
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 placeOptionStrategyResponse = await snaptrade.options.placeOptionStrategy(
268
+ {
269
+ userId: "John.doe@snaptrade.com",
270
+ userSecret: "USERSECRET123",
271
+ accountId: "2bcd7cc3-e922-4976-bce1-9858296801c3",
272
+ optionStrategyId: "2bcd7cc3-e922-4976-bce1-9858296801c3",
273
+ order_type: "Limit",
274
+ time_in_force: "DAY",
275
+ price: 31.33,
276
+ }
277
+ );
278
+
279
+ console.log(placeOptionStrategyResponse);
282
280
  ```
283
281
 
284
282