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.
Files changed (68) hide show
  1. package/.konfig/generate-id.txt +1 -1
  2. package/README.md +2 -2
  3. package/api/account-information-api.ts +136 -120
  4. package/api/api-disclaimer-api.ts +14 -19
  5. package/api/authentication-api.ts +37 -43
  6. package/api/connections-api.ts +46 -40
  7. package/api/error-logs-api.ts +12 -10
  8. package/api/options-api.ts +104 -108
  9. package/api/portfolio-management-api.ts +259 -253
  10. package/api/reference-data-api.ts +49 -53
  11. package/api/trading-api.ts +172 -185
  12. package/api/transactions-and-reporting-api.ts +64 -60
  13. package/client.ts +2 -0
  14. package/common.ts +2 -2
  15. package/configuration.ts +1 -1
  16. package/dist/api/account-information-api.d.ts +112 -112
  17. package/dist/api/api-disclaimer-api.d.ts +10 -16
  18. package/dist/api/api-disclaimer-api.js +1 -1
  19. package/dist/api/authentication-api.d.ts +27 -40
  20. package/dist/api/authentication-api.js +2 -2
  21. package/dist/api/connections-api.d.ts +38 -38
  22. package/dist/api/error-logs-api.d.ts +10 -10
  23. package/dist/api/options-api.d.ts +82 -94
  24. package/dist/api/options-api.js +2 -2
  25. package/dist/api/portfolio-management-api.d.ts +214 -256
  26. package/dist/api/portfolio-management-api.js +7 -7
  27. package/dist/api/reference-data-api.d.ts +37 -50
  28. package/dist/api/reference-data-api.js +2 -2
  29. package/dist/api/trading-api.d.ts +131 -160
  30. package/dist/api/trading-api.js +10 -10
  31. package/dist/api/transactions-and-reporting-api.d.ts +52 -52
  32. package/dist/common.js +2 -2
  33. package/dist/configuration.js +1 -1
  34. package/dist/models/index.d.ts +1 -0
  35. package/dist/models/index.js +1 -0
  36. package/dist/models/target-asset.d.ts +4 -2
  37. package/dist/models/trading-cancel-user-account-order-request.d.ts +24 -0
  38. package/dist/models/trading-cancel-user-account-order-request.js +15 -0
  39. package/dist/pagination/page-types.d.ts +27 -0
  40. package/dist/pagination/page-types.js +13 -0
  41. package/dist/pagination/page.d.ts +6 -1
  42. package/dist/pagination/page.js +3 -0
  43. package/dist/pagination/pageable.d.ts +8 -3
  44. package/dist/pagination/pageable.js +5 -6
  45. package/dist/pagination/paginate.d.ts +2 -2
  46. package/docs/AccountInformationApi.md +72 -88
  47. package/docs/ApiDisclaimerApi.md +8 -12
  48. package/docs/ApiStatusApi.md +6 -7
  49. package/docs/AuthenticationApi.md +41 -55
  50. package/docs/ConnectionsApi.md +26 -32
  51. package/docs/ErrorLogsApi.md +8 -10
  52. package/docs/OptionsApi.md +60 -67
  53. package/docs/PortfolioManagementApi.md +246 -326
  54. package/docs/ReferenceDataApi.md +68 -95
  55. package/docs/TradingApi.md +107 -136
  56. package/docs/TransactionsAndReportingApi.md +26 -28
  57. package/index.test.ts +2 -4
  58. package/models/index.ts +1 -0
  59. package/models/target-asset.ts +2 -2
  60. package/models/trading-cancel-user-account-order-request.ts +29 -0
  61. package/package.json +1 -1
  62. package/pagination/page-types.ts +34 -0
  63. package/pagination/page.ts +9 -1
  64. package/pagination/pageable.ts +16 -10
  65. package/pagination/paginate.ts +3 -2
  66. package/tsconfig.json +1 -0
  67. package/dist/index.test.d.ts +0 -1
  68. package/dist/index.test.js +0 -175
@@ -10,7 +10,8 @@ Method | HTTP request | Description
10
10
 
11
11
 
12
12
  # **detailBrokerageAuthorization**
13
- > BrokerageAuthorization detailBrokerageAuthorization()
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 response = await snaptrade.connections.detailBrokerageAuthorization({
30
- 'authorizationId': "2bcd7cc3-e922-4976-bce1-9858296801c3",
31
- 'userId': "John.doe@snaptrade.com",
32
- 'userSecret': "USERSECRET123",
33
- })
34
- console.log(response)
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
- > Array<BrokerageAuthorization> listBrokerageAuthorizations()
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 response = await snaptrade.connections.listBrokerageAuthorizations({
88
- 'userId': "John.doe@snaptrade.com",
89
- 'userSecret': "USERSECRET123",
90
- })
91
- console.log(response)
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
- > removeBrokerageAuthorization()
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 response = await snaptrade.connections.removeBrokerageAuthorization({
144
- 'authorizationId': "2bcd7cc3-e922-4976-bce1-9858296801c3",
145
- 'userId': "John.doe@snaptrade.com",
146
- 'userSecret': "USERSECRET123",
147
- })
148
- console.log(response)
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
@@ -8,7 +8,8 @@ Method | HTTP request | Description
8
8
 
9
9
 
10
10
  # **listUserErrors**
11
- > Array<UserErrorLog> listUserErrors()
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 response = await snaptrade.errorLogs.listUserErrors({
28
- 'userId': "John.doe@snaptrade.com",
29
- 'userSecret': "USERSECRET123",
30
- })
31
- console.log(response)
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
@@ -12,7 +12,8 @@ Method | HTTP request | Description
12
12
 
13
13
 
14
14
  # **getOptionStrategy**
15
- > StrategyQuotes getOptionStrategy(optionsGetOptionStrategyRequest)
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 response = await snaptrade.options.getOptionStrategy({
32
- 'userId': "John.doe@snaptrade.com",
33
- 'userSecret': "USERSECRET123",
34
- 'accountId': "accountId_example",
35
- 'requestBody': {
36
- 'underlying_symbol_id': "2bcd7cc3-e922-4976-bce1-9858296801c3",
37
- 'strategy_type': "CUSTOM",
38
- },
39
- })
40
- console.log(response)
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
- > Array<OptionChainInner> getOptionsChain()
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 response = await snaptrade.options.getOptionsChain({
95
- 'userId': "John.doe@snaptrade.com",
96
- 'userSecret': "USERSECRET123",
97
- 'accountId': "accountId_example",
98
- 'symbol': "symbol_example",
99
- })
100
- console.log(response)
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
- > StrategyQuotes getOptionsStrategyQuote()
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 response = await snaptrade.options.getOptionsStrategyQuote({
155
- 'userId': "John.doe@snaptrade.com",
156
- 'userSecret': "USERSECRET123",
157
- 'accountId': "accountId_example",
158
- 'optionStrategyId': "2bcd7cc3-e922-4976-bce1-9858296801c3",
159
- })
160
- console.log(response)
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
- > OptionsHoldings listOptionHoldings()
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 response = await snaptrade.options.listOptionHoldings({
215
- 'userId': "John.doe@snaptrade.com",
216
- 'userSecret': "USERSECRET123",
217
- 'accountId': "accountId_example",
218
- })
219
- console.log(response)
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
- > StrategyOrderRecord placeOptionStrategy(optionsPlaceOptionStrategyRequest)
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 response = await snaptrade.options.placeOptionStrategy({
273
- 'userId': "John.doe@snaptrade.com",
274
- 'userSecret': "USERSECRET123",
275
- 'accountId': "2bcd7cc3-e922-4976-bce1-9858296801c3",
276
- 'optionStrategyId': "2bcd7cc3-e922-4976-bce1-9858296801c3",
277
- 'requestBody': {
278
- 'order_type': "Limit",
279
- 'time_in_force': "DAY",
280
- 'price': 31.33,
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