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
package/docs/ConnectionsApi.md
CHANGED
|
@@ -10,7 +10,8 @@ Method | HTTP request | Description
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
# **detailBrokerageAuthorization**
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
#### **GET** /authorizations/{authorizationId}
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
### Example
|
|
@@ -26,12 +27,13 @@ const snaptrade = new Snaptrade({
|
|
|
26
27
|
clientId: "YOUR_CLIENT_ID",
|
|
27
28
|
})
|
|
28
29
|
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
})
|
|
34
|
-
|
|
30
|
+
const detailBrokerageAuthorizationResponse = await snaptrade.connections.detailBrokerageAuthorization({
|
|
31
|
+
"authorizationId": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
32
|
+
"userId": "John.doe@snaptrade.com",
|
|
33
|
+
"userSecret": "USERSECRET123",
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
console.log(detailBrokerageAuthorizationResponse)
|
|
35
37
|
|
|
36
38
|
```
|
|
37
39
|
|
|
@@ -49,10 +51,6 @@ Name | Type | Description | Notes
|
|
|
49
51
|
|
|
50
52
|
**BrokerageAuthorization**
|
|
51
53
|
|
|
52
|
-
### Authorization
|
|
53
|
-
|
|
54
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
55
|
-
|
|
56
54
|
### HTTP request headers
|
|
57
55
|
|
|
58
56
|
- **Content-Type**: Not defined
|
|
@@ -68,7 +66,8 @@ Name | Type | Description | Notes
|
|
|
68
66
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
69
67
|
|
|
70
68
|
# **listBrokerageAuthorizations**
|
|
71
|
-
|
|
69
|
+
|
|
70
|
+
#### **GET** /authorizations
|
|
72
71
|
|
|
73
72
|
|
|
74
73
|
### Example
|
|
@@ -84,11 +83,12 @@ const snaptrade = new Snaptrade({
|
|
|
84
83
|
clientId: "YOUR_CLIENT_ID",
|
|
85
84
|
})
|
|
86
85
|
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
})
|
|
91
|
-
|
|
86
|
+
const listBrokerageAuthorizationsResponse = await snaptrade.connections.listBrokerageAuthorizations({
|
|
87
|
+
"userId": "John.doe@snaptrade.com",
|
|
88
|
+
"userSecret": "USERSECRET123",
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
console.log(listBrokerageAuthorizationsResponse)
|
|
92
92
|
|
|
93
93
|
```
|
|
94
94
|
|
|
@@ -105,10 +105,6 @@ Name | Type | Description | Notes
|
|
|
105
105
|
|
|
106
106
|
**Array<BrokerageAuthorization>**
|
|
107
107
|
|
|
108
|
-
### Authorization
|
|
109
|
-
|
|
110
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
111
|
-
|
|
112
108
|
### HTTP request headers
|
|
113
109
|
|
|
114
110
|
- **Content-Type**: Not defined
|
|
@@ -124,7 +120,8 @@ Name | Type | Description | Notes
|
|
|
124
120
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
125
121
|
|
|
126
122
|
# **removeBrokerageAuthorization**
|
|
127
|
-
|
|
123
|
+
|
|
124
|
+
#### **DELETE** /authorizations/{authorizationId}
|
|
128
125
|
|
|
129
126
|
|
|
130
127
|
### Example
|
|
@@ -140,12 +137,13 @@ const snaptrade = new Snaptrade({
|
|
|
140
137
|
clientId: "YOUR_CLIENT_ID",
|
|
141
138
|
})
|
|
142
139
|
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
})
|
|
148
|
-
|
|
140
|
+
const removeBrokerageAuthorizationResponse = await snaptrade.connections.removeBrokerageAuthorization({
|
|
141
|
+
"authorizationId": "2bcd7cc3-e922-4976-bce1-9858296801c3",
|
|
142
|
+
"userId": "John.doe@snaptrade.com",
|
|
143
|
+
"userSecret": "USERSECRET123",
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
console.log(removeBrokerageAuthorizationResponse)
|
|
149
147
|
|
|
150
148
|
```
|
|
151
149
|
|
|
@@ -163,10 +161,6 @@ Name | Type | Description | Notes
|
|
|
163
161
|
|
|
164
162
|
void (empty response body)
|
|
165
163
|
|
|
166
|
-
### Authorization
|
|
167
|
-
|
|
168
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
169
|
-
|
|
170
164
|
### HTTP request headers
|
|
171
165
|
|
|
172
166
|
- **Content-Type**: Not defined
|
package/docs/ErrorLogsApi.md
CHANGED
|
@@ -8,7 +8,8 @@ Method | HTTP request | Description
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
# **listUserErrors**
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
#### **GET** /snapTrade/listUserErrors
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
### Example
|
|
@@ -24,11 +25,12 @@ const snaptrade = new Snaptrade({
|
|
|
24
25
|
clientId: "YOUR_CLIENT_ID",
|
|
25
26
|
})
|
|
26
27
|
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
})
|
|
31
|
-
|
|
28
|
+
const listUserErrorsResponse = await snaptrade.errorLogs.listUserErrors({
|
|
29
|
+
"userId": "John.doe@snaptrade.com",
|
|
30
|
+
"userSecret": "USERSECRET123",
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
console.log(listUserErrorsResponse)
|
|
32
34
|
|
|
33
35
|
```
|
|
34
36
|
|
|
@@ -45,10 +47,6 @@ Name | Type | Description | Notes
|
|
|
45
47
|
|
|
46
48
|
**Array<UserErrorLog>**
|
|
47
49
|
|
|
48
|
-
### Authorization
|
|
49
|
-
|
|
50
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
51
|
-
|
|
52
50
|
### HTTP request headers
|
|
53
51
|
|
|
54
52
|
- **Content-Type**: Not defined
|
package/docs/OptionsApi.md
CHANGED
|
@@ -12,7 +12,8 @@ Method | HTTP request | Description
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
# **getOptionStrategy**
|
|
15
|
-
|
|
15
|
+
|
|
16
|
+
#### **POST** /accounts/{accountId}/optionStrategy
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
### Example
|
|
@@ -28,16 +29,22 @@ const snaptrade = new Snaptrade({
|
|
|
28
29
|
clientId: "YOUR_CLIENT_ID",
|
|
29
30
|
})
|
|
30
31
|
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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)
|
|
41
48
|
|
|
42
49
|
```
|
|
43
50
|
|
|
@@ -56,10 +63,6 @@ Name | Type | Description | Notes
|
|
|
56
63
|
|
|
57
64
|
**StrategyQuotes**
|
|
58
65
|
|
|
59
|
-
### Authorization
|
|
60
|
-
|
|
61
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
62
|
-
|
|
63
66
|
### HTTP request headers
|
|
64
67
|
|
|
65
68
|
- **Content-Type**: application/json
|
|
@@ -75,7 +78,8 @@ Name | Type | Description | Notes
|
|
|
75
78
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
76
79
|
|
|
77
80
|
# **getOptionsChain**
|
|
78
|
-
|
|
81
|
+
|
|
82
|
+
#### **GET** /accounts/{accountId}/optionsChain
|
|
79
83
|
|
|
80
84
|
|
|
81
85
|
### Example
|
|
@@ -91,13 +95,14 @@ const snaptrade = new Snaptrade({
|
|
|
91
95
|
clientId: "YOUR_CLIENT_ID",
|
|
92
96
|
})
|
|
93
97
|
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
})
|
|
100
|
-
|
|
98
|
+
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)
|
|
101
106
|
|
|
102
107
|
```
|
|
103
108
|
|
|
@@ -116,10 +121,6 @@ Name | Type | Description | Notes
|
|
|
116
121
|
|
|
117
122
|
**Array<OptionChainInner>**
|
|
118
123
|
|
|
119
|
-
### Authorization
|
|
120
|
-
|
|
121
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
122
|
-
|
|
123
124
|
### HTTP request headers
|
|
124
125
|
|
|
125
126
|
- **Content-Type**: Not defined
|
|
@@ -135,7 +136,8 @@ Name | Type | Description | Notes
|
|
|
135
136
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
136
137
|
|
|
137
138
|
# **getOptionsStrategyQuote**
|
|
138
|
-
|
|
139
|
+
|
|
140
|
+
#### **GET** /accounts/{accountId}/optionStrategy/{optionStrategyId}
|
|
139
141
|
|
|
140
142
|
|
|
141
143
|
### Example
|
|
@@ -151,13 +153,14 @@ const snaptrade = new Snaptrade({
|
|
|
151
153
|
clientId: "YOUR_CLIENT_ID",
|
|
152
154
|
})
|
|
153
155
|
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
})
|
|
160
|
-
|
|
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)
|
|
161
164
|
|
|
162
165
|
```
|
|
163
166
|
|
|
@@ -176,10 +179,6 @@ Name | Type | Description | Notes
|
|
|
176
179
|
|
|
177
180
|
**StrategyQuotes**
|
|
178
181
|
|
|
179
|
-
### Authorization
|
|
180
|
-
|
|
181
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
182
|
-
|
|
183
182
|
### HTTP request headers
|
|
184
183
|
|
|
185
184
|
- **Content-Type**: Not defined
|
|
@@ -195,7 +194,8 @@ Name | Type | Description | Notes
|
|
|
195
194
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
196
195
|
|
|
197
196
|
# **listOptionHoldings**
|
|
198
|
-
|
|
197
|
+
|
|
198
|
+
#### **GET** /accounts/{accountId}/options
|
|
199
199
|
|
|
200
200
|
|
|
201
201
|
### Example
|
|
@@ -211,12 +211,13 @@ const snaptrade = new Snaptrade({
|
|
|
211
211
|
clientId: "YOUR_CLIENT_ID",
|
|
212
212
|
})
|
|
213
213
|
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
})
|
|
219
|
-
|
|
214
|
+
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)
|
|
220
221
|
|
|
221
222
|
```
|
|
222
223
|
|
|
@@ -234,10 +235,6 @@ Name | Type | Description | Notes
|
|
|
234
235
|
|
|
235
236
|
**OptionsHoldings**
|
|
236
237
|
|
|
237
|
-
### Authorization
|
|
238
|
-
|
|
239
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
240
|
-
|
|
241
238
|
### HTTP request headers
|
|
242
239
|
|
|
243
240
|
- **Content-Type**: Not defined
|
|
@@ -253,7 +250,8 @@ Name | Type | Description | Notes
|
|
|
253
250
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
254
251
|
|
|
255
252
|
# **placeOptionStrategy**
|
|
256
|
-
|
|
253
|
+
|
|
254
|
+
#### **POST** /accounts/{accountId}/optionStrategy/{optionStrategyId}/execute
|
|
257
255
|
|
|
258
256
|
|
|
259
257
|
### Example
|
|
@@ -269,18 +267,17 @@ const snaptrade = new Snaptrade({
|
|
|
269
267
|
clientId: "YOUR_CLIENT_ID",
|
|
270
268
|
})
|
|
271
269
|
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
console.log(response)
|
|
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)
|
|
284
281
|
|
|
285
282
|
```
|
|
286
283
|
|
|
@@ -300,10 +297,6 @@ Name | Type | Description | Notes
|
|
|
300
297
|
|
|
301
298
|
**StrategyOrderRecord**
|
|
302
299
|
|
|
303
|
-
### Authorization
|
|
304
|
-
|
|
305
|
-
[PartnerClientId](README.md#PartnerClientId), [PartnerSignature](README.md#PartnerSignature), [PartnerTimestamp](README.md#PartnerTimestamp)
|
|
306
|
-
|
|
307
300
|
### HTTP request headers
|
|
308
301
|
|
|
309
302
|
- **Content-Type**: application/json
|