snaptrade-typescript-sdk 8.5.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.
- package/.konfig/generate-id.txt +1 -1
- package/README.md +9 -11
- package/configuration.ts +1 -1
- package/dist/configuration.js +1 -1
- package/dist/models/options-holdings.d.ts +1 -1
- package/dist/models/options-position.d.ts +1 -1
- package/dist/models/position.d.ts +1 -1
- package/dist/models/session-event.d.ts +6 -0
- package/dist/models/symbol.d.ts +7 -0
- package/docs/AccountInformationApi.md +120 -120
- package/docs/ApiDisclaimerApi.md +10 -11
- package/docs/ApiStatusApi.md +8 -9
- package/docs/AuthenticationApi.md +66 -66
- package/docs/ConnectionsApi.md +58 -57
- package/docs/ErrorLogsApi.md +10 -11
- package/docs/OptionsApi.md +80 -82
- package/docs/PortfolioManagementApi.md +433 -434
- package/docs/ReferenceDataApi.md +117 -119
- package/docs/TradingApi.md +152 -156
- package/docs/TransactionsAndReportingApi.md +40 -37
- package/models/options-holdings.ts +1 -1
- package/models/options-position.ts +1 -1
- package/models/position.ts +1 -1
- package/models/session-event.ts +6 -0
- package/models/symbol.ts +9 -0
- package/package.json +1 -1
|
@@ -20,21 +20,21 @@ 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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
const deleteSnapTradeUserResponse =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
+
|
|
32
|
+
const deleteSnapTradeUserResponse =
|
|
33
|
+
await snaptrade.authentication.deleteSnapTradeUser({
|
|
34
|
+
userId: "John.doe@snaptrade.com",
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
console.log(deleteSnapTradeUserResponse);
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
|
|
@@ -75,22 +75,21 @@ 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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
})
|
|
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
86
|
|
|
87
87
|
const getUserJWTResponse = await snaptrade.authentication.getUserJWT({
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
console.log(getUserJWTResponse)
|
|
88
|
+
userId: "John.doe@snaptrade.com",
|
|
89
|
+
userSecret: "USERSECRET123",
|
|
90
|
+
});
|
|
93
91
|
|
|
92
|
+
console.log(getUserJWTResponse);
|
|
94
93
|
```
|
|
95
94
|
|
|
96
95
|
|
|
@@ -132,19 +131,19 @@ Name | Type | Description | Notes
|
|
|
132
131
|
|
|
133
132
|
|
|
134
133
|
```typescript
|
|
135
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
134
|
+
import { Snaptrade } from "snaptrade-typescript-sdk";
|
|
136
135
|
|
|
137
136
|
const snaptrade = new Snaptrade({
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
})
|
|
143
|
-
|
|
144
|
-
const listSnapTradeUsersResponse = await snaptrade.authentication.listSnapTradeUsers()
|
|
137
|
+
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
138
|
+
// basePath: "https://api.snaptrade.com/api/v1",
|
|
139
|
+
consumerKey: "YOUR_CONSUMER_KEY",
|
|
140
|
+
clientId: "YOUR_CLIENT_ID",
|
|
141
|
+
});
|
|
145
142
|
|
|
146
|
-
|
|
143
|
+
const listSnapTradeUsersResponse =
|
|
144
|
+
await snaptrade.authentication.listSnapTradeUsers();
|
|
147
145
|
|
|
146
|
+
console.log(listSnapTradeUsersResponse);
|
|
148
147
|
```
|
|
149
148
|
|
|
150
149
|
|
|
@@ -181,27 +180,27 @@ This endpoint does not need any parameter.
|
|
|
181
180
|
|
|
182
181
|
|
|
183
182
|
```typescript
|
|
184
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
183
|
+
import { Snaptrade } from "snaptrade-typescript-sdk";
|
|
185
184
|
|
|
186
185
|
const snaptrade = new Snaptrade({
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
})
|
|
192
|
-
|
|
193
|
-
const loginSnapTradeUserResponse =
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
186
|
+
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
187
|
+
// basePath: "https://api.snaptrade.com/api/v1",
|
|
188
|
+
consumerKey: "YOUR_CONSUMER_KEY",
|
|
189
|
+
clientId: "YOUR_CLIENT_ID",
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
const loginSnapTradeUserResponse =
|
|
193
|
+
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);
|
|
205
204
|
```
|
|
206
205
|
|
|
207
206
|
|
|
@@ -244,22 +243,23 @@ Name | Type | Description | Notes
|
|
|
244
243
|
|
|
245
244
|
|
|
246
245
|
```typescript
|
|
247
|
-
import { Snaptrade } from "snaptrade-typescript-sdk"
|
|
246
|
+
import { Snaptrade } from "snaptrade-typescript-sdk";
|
|
248
247
|
|
|
249
248
|
const snaptrade = new Snaptrade({
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
})
|
|
255
|
-
|
|
256
|
-
const registerSnapTradeUserResponse =
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
249
|
+
// Defining the base path is optional and defaults to https://api.snaptrade.com/api/v1
|
|
250
|
+
// basePath: "https://api.snaptrade.com/api/v1",
|
|
251
|
+
consumerKey: "YOUR_CONSUMER_KEY",
|
|
252
|
+
clientId: "YOUR_CLIENT_ID",
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
const registerSnapTradeUserResponse =
|
|
256
|
+
await snaptrade.authentication.registerSnapTradeUser({
|
|
257
|
+
user_id: "snaptrade-user-123",
|
|
258
|
+
rsa_public_key:
|
|
259
|
+
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC7vbqajDw4o6gJy8UtmIbkcpnkO3Kwc4qsEnSZp/TR+fQi62F79RHWmwKOtFmwteURgLbj7D/WGuNLGOfa/2vse3G2eHnHl5CB8ruRX9fBl/KgwCVr2JaEuUm66bBQeP5XeBotdR4cvX38uPYivCDdPjJ1QWPdspTBKcxeFbccDw==",
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
console.log(registerSnapTradeUserResponse);
|
|
263
263
|
```
|
|
264
264
|
|
|
265
265
|
|
package/docs/ConnectionsApi.md
CHANGED
|
@@ -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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
const detailBrokerageAuthorizationResponse =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
const listBrokerageAuthorizationsResponse =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
})
|
|
140
|
-
|
|
141
|
-
const removeBrokerageAuthorizationResponse =
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
|
package/docs/ErrorLogsApi.md
CHANGED
|
@@ -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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
30
|
-
|
|
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
|
|
package/docs/OptionsApi.md
CHANGED
|
@@ -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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
})
|
|
155
|
-
|
|
156
|
-
const getOptionsStrategyQuoteResponse =
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
})
|
|
269
|
-
|
|
270
|
-
const placeOptionStrategyResponse = await snaptrade.options.placeOptionStrategy(
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
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
|
|