snaptrade-typescript-sdk 6.2.0 → 6.4.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 +12 -24
- package/api/account-information-api-custom.ts +3 -0
- package/api/account-information-api.ts +42 -73
- package/api/api-disclaimer-api-custom.ts +3 -0
- package/api/api-disclaimer-api.ts +9 -11
- package/api/api-status-api-custom.ts +3 -0
- package/api/api-status-api.ts +6 -6
- package/api/authentication-api-custom.ts +3 -0
- package/api/authentication-api.ts +31 -48
- package/api/connections-api-custom.ts +3 -0
- package/api/connections-api.ts +128 -27
- package/api/error-logs-api-custom.ts +3 -0
- package/api/error-logs-api.ts +7 -10
- package/api/options-api-custom.ts +3 -0
- package/api/options-api.ts +31 -48
- package/api/portfolio-management-api-custom.ts +3 -0
- package/api/portfolio-management-api.ts +183 -306
- package/api/reference-data-api-custom.ts +3 -0
- package/api/reference-data-api.ts +61 -102
- package/api/trading-api-custom.ts +3 -0
- package/api/trading-api.ts +62 -96
- package/api/transactions-and-reporting-api-custom.ts +3 -0
- package/api/transactions-and-reporting-api.ts +26 -21
- package/client-custom.ts +5 -0
- package/client.ts +3 -1
- package/common.ts +9 -4
- package/configuration.ts +3 -2
- package/dist/api/account-information-api-custom.d.ts +3 -0
- package/dist/api/account-information-api-custom.js +27 -0
- package/dist/api/account-information-api.d.ts +3 -2
- package/dist/api/account-information-api.js +2 -1
- package/dist/api/api-disclaimer-api-custom.d.ts +3 -0
- package/dist/api/api-disclaimer-api-custom.js +27 -0
- package/dist/api/api-disclaimer-api.d.ts +3 -2
- package/dist/api/api-disclaimer-api.js +4 -2
- package/dist/api/api-status-api-custom.d.ts +3 -0
- package/dist/api/api-status-api-custom.js +27 -0
- package/dist/api/api-status-api.d.ts +3 -2
- package/dist/api/api-status-api.js +2 -1
- package/dist/api/authentication-api-custom.d.ts +3 -0
- package/dist/api/authentication-api-custom.js +27 -0
- package/dist/api/authentication-api.d.ts +3 -2
- package/dist/api/authentication-api.js +6 -3
- package/dist/api/connections-api-custom.d.ts +3 -0
- package/dist/api/connections-api-custom.js +27 -0
- package/dist/api/connections-api.d.ts +57 -2
- package/dist/api/connections-api.js +111 -1
- package/dist/api/error-logs-api-custom.d.ts +3 -0
- package/dist/api/error-logs-api-custom.js +27 -0
- package/dist/api/error-logs-api.d.ts +3 -2
- package/dist/api/error-logs-api.js +2 -1
- package/dist/api/options-api-custom.d.ts +3 -0
- package/dist/api/options-api-custom.js +27 -0
- package/dist/api/options-api.d.ts +3 -2
- package/dist/api/options-api.js +6 -3
- package/dist/api/portfolio-management-api-custom.d.ts +3 -0
- package/dist/api/portfolio-management-api-custom.js +27 -0
- package/dist/api/portfolio-management-api.d.ts +3 -2
- package/dist/api/portfolio-management-api.js +18 -9
- package/dist/api/reference-data-api-custom.d.ts +3 -0
- package/dist/api/reference-data-api-custom.js +27 -0
- package/dist/api/reference-data-api.d.ts +3 -2
- package/dist/api/reference-data-api.js +6 -3
- package/dist/api/trading-api-custom.d.ts +3 -0
- package/dist/api/trading-api-custom.js +27 -0
- package/dist/api/trading-api.d.ts +3 -2
- package/dist/api/trading-api.js +12 -6
- package/dist/api/transactions-and-reporting-api-custom.d.ts +3 -0
- package/dist/api/transactions-and-reporting-api-custom.js +27 -0
- package/dist/api/transactions-and-reporting-api.d.ts +11 -3
- package/dist/api/transactions-and-reporting-api.js +8 -3
- package/dist/client-custom.d.ts +4 -0
- package/dist/client-custom.js +9 -0
- package/dist/client.d.ts +2 -1
- package/dist/client.js +32 -13
- package/dist/common.d.ts +2 -1
- package/dist/common.js +12 -10
- package/dist/configuration.js +3 -2
- package/dist/models/connections-session-events200-response-inner.d.ts +17 -0
- package/dist/models/connections-session-events200-response-inner.js +15 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/dist/models/session-event.d.ts +59 -0
- package/dist/models/session-event.js +25 -0
- package/dist/models/symbol.d.ts +6 -0
- package/dist/requestBeforeHook.d.ts +1 -0
- package/docs/ConnectionsApi.md +55 -0
- package/docs/TransactionsAndReportingApi.md +2 -0
- package/models/connections-session-events200-response-inner.ts +25 -0
- package/models/index.ts +2 -0
- package/models/session-event.ts +68 -0
- package/models/symbol.ts +6 -0
- package/package.json +1 -1
- package/requestBeforeHook.ts +1 -0
package/api/trading-api.ts
CHANGED
|
@@ -43,6 +43,7 @@ import { TradingCancelUserAccountOrderRequest } from '../models';
|
|
|
43
43
|
import { TradingPlaceOCOOrderRequest } from '../models';
|
|
44
44
|
import { paginate } from "../pagination/paginate";
|
|
45
45
|
import { requestBeforeHook } from '../requestBeforeHook';
|
|
46
|
+
import { TradingApiCustom } from "./trading-api-custom";
|
|
46
47
|
/**
|
|
47
48
|
* TradingApi - axios parameter creator
|
|
48
49
|
* @export
|
|
@@ -83,13 +84,10 @@ export const TradingApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
83
84
|
|
|
84
85
|
// authentication PartnerClientId required
|
|
85
86
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "clientId", configuration})
|
|
86
|
-
|
|
87
87
|
// authentication PartnerSignature required
|
|
88
|
-
await setApiKeyToObject({object: localVarHeaderParameter, keyParamName: "Signature", configuration})
|
|
89
|
-
|
|
88
|
+
await setApiKeyToObject({ object: localVarHeaderParameter, keyParamName: "Signature", configuration })
|
|
90
89
|
// authentication PartnerTimestamp required
|
|
91
90
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "timestamp", configuration})
|
|
92
|
-
|
|
93
91
|
if (userId !== undefined) {
|
|
94
92
|
localVarQueryParameter['userId'] = userId;
|
|
95
93
|
}
|
|
@@ -104,14 +102,14 @@ export const TradingApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
104
102
|
|
|
105
103
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
106
104
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
107
|
-
localVarRequestOptions.data = serializeDataIfNeeded(tradingCancelUserAccountOrderRequest, localVarRequestOptions, configuration)
|
|
108
|
-
|
|
109
105
|
requestBeforeHook({
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
106
|
+
requestBody: tradingCancelUserAccountOrderRequest,
|
|
107
|
+
queryParameters: localVarQueryParameter,
|
|
108
|
+
requestConfig: localVarRequestOptions,
|
|
109
|
+
path: localVarPath,
|
|
110
|
+
configuration
|
|
114
111
|
});
|
|
112
|
+
localVarRequestOptions.data = serializeDataIfNeeded(tradingCancelUserAccountOrderRequest, localVarRequestOptions, configuration)
|
|
115
113
|
|
|
116
114
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
117
115
|
return {
|
|
@@ -152,23 +150,19 @@ export const TradingApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
152
150
|
|
|
153
151
|
// authentication PartnerClientId required
|
|
154
152
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "clientId", configuration})
|
|
155
|
-
|
|
156
153
|
// authentication PartnerSignature required
|
|
157
|
-
await setApiKeyToObject({object: localVarHeaderParameter, keyParamName: "Signature", configuration})
|
|
158
|
-
|
|
154
|
+
await setApiKeyToObject({ object: localVarHeaderParameter, keyParamName: "Signature", configuration })
|
|
159
155
|
// authentication PartnerTimestamp required
|
|
160
156
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "timestamp", configuration})
|
|
161
157
|
|
|
162
|
-
|
|
163
158
|
|
|
164
159
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
165
160
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
166
|
-
|
|
167
161
|
requestBeforeHook({
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
162
|
+
queryParameters: localVarQueryParameter,
|
|
163
|
+
requestConfig: localVarRequestOptions,
|
|
164
|
+
path: localVarPath,
|
|
165
|
+
configuration
|
|
172
166
|
});
|
|
173
167
|
|
|
174
168
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
@@ -206,23 +200,19 @@ export const TradingApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
206
200
|
|
|
207
201
|
// authentication PartnerClientId required
|
|
208
202
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "clientId", configuration})
|
|
209
|
-
|
|
210
203
|
// authentication PartnerSignature required
|
|
211
|
-
await setApiKeyToObject({object: localVarHeaderParameter, keyParamName: "Signature", configuration})
|
|
212
|
-
|
|
204
|
+
await setApiKeyToObject({ object: localVarHeaderParameter, keyParamName: "Signature", configuration })
|
|
213
205
|
// authentication PartnerTimestamp required
|
|
214
206
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "timestamp", configuration})
|
|
215
207
|
|
|
216
|
-
|
|
217
208
|
|
|
218
209
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
219
210
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
220
|
-
|
|
221
211
|
requestBeforeHook({
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
212
|
+
queryParameters: localVarQueryParameter,
|
|
213
|
+
requestConfig: localVarRequestOptions,
|
|
214
|
+
path: localVarPath,
|
|
215
|
+
configuration
|
|
226
216
|
});
|
|
227
217
|
|
|
228
218
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
@@ -261,13 +251,10 @@ export const TradingApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
261
251
|
|
|
262
252
|
// authentication PartnerClientId required
|
|
263
253
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "clientId", configuration})
|
|
264
|
-
|
|
265
254
|
// authentication PartnerSignature required
|
|
266
|
-
await setApiKeyToObject({object: localVarHeaderParameter, keyParamName: "Signature", configuration})
|
|
267
|
-
|
|
255
|
+
await setApiKeyToObject({ object: localVarHeaderParameter, keyParamName: "Signature", configuration })
|
|
268
256
|
// authentication PartnerTimestamp required
|
|
269
257
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "timestamp", configuration})
|
|
270
|
-
|
|
271
258
|
if (userId !== undefined) {
|
|
272
259
|
localVarQueryParameter['userId'] = userId;
|
|
273
260
|
}
|
|
@@ -282,14 +269,14 @@ export const TradingApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
282
269
|
|
|
283
270
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
284
271
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
285
|
-
localVarRequestOptions.data = serializeDataIfNeeded(manualTradeForm, localVarRequestOptions, configuration)
|
|
286
|
-
|
|
287
272
|
requestBeforeHook({
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
273
|
+
requestBody: manualTradeForm,
|
|
274
|
+
queryParameters: localVarQueryParameter,
|
|
275
|
+
requestConfig: localVarRequestOptions,
|
|
276
|
+
path: localVarPath,
|
|
277
|
+
configuration
|
|
292
278
|
});
|
|
279
|
+
localVarRequestOptions.data = serializeDataIfNeeded(manualTradeForm, localVarRequestOptions, configuration)
|
|
293
280
|
|
|
294
281
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
295
282
|
return {
|
|
@@ -332,13 +319,10 @@ export const TradingApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
332
319
|
|
|
333
320
|
// authentication PartnerClientId required
|
|
334
321
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "clientId", configuration})
|
|
335
|
-
|
|
336
322
|
// authentication PartnerSignature required
|
|
337
|
-
await setApiKeyToObject({object: localVarHeaderParameter, keyParamName: "Signature", configuration})
|
|
338
|
-
|
|
323
|
+
await setApiKeyToObject({ object: localVarHeaderParameter, keyParamName: "Signature", configuration })
|
|
339
324
|
// authentication PartnerTimestamp required
|
|
340
325
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "timestamp", configuration})
|
|
341
|
-
|
|
342
326
|
if (userId !== undefined) {
|
|
343
327
|
localVarQueryParameter['userId'] = userId;
|
|
344
328
|
}
|
|
@@ -359,12 +343,11 @@ export const TradingApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
359
343
|
|
|
360
344
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
361
345
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
362
|
-
|
|
363
346
|
requestBeforeHook({
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
347
|
+
queryParameters: localVarQueryParameter,
|
|
348
|
+
requestConfig: localVarRequestOptions,
|
|
349
|
+
path: localVarPath,
|
|
350
|
+
configuration
|
|
368
351
|
});
|
|
369
352
|
|
|
370
353
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
@@ -407,27 +390,24 @@ export const TradingApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
407
390
|
|
|
408
391
|
// authentication PartnerClientId required
|
|
409
392
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "clientId", configuration})
|
|
410
|
-
|
|
411
393
|
// authentication PartnerSignature required
|
|
412
|
-
await setApiKeyToObject({object: localVarHeaderParameter, keyParamName: "Signature", configuration})
|
|
413
|
-
|
|
394
|
+
await setApiKeyToObject({ object: localVarHeaderParameter, keyParamName: "Signature", configuration })
|
|
414
395
|
// authentication PartnerTimestamp required
|
|
415
396
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "timestamp", configuration})
|
|
416
397
|
|
|
417
|
-
|
|
418
398
|
|
|
419
399
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
420
400
|
|
|
421
401
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
422
402
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
423
|
-
localVarRequestOptions.data = serializeDataIfNeeded(trade, localVarRequestOptions, configuration)
|
|
424
|
-
|
|
425
403
|
requestBeforeHook({
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
404
|
+
requestBody: trade,
|
|
405
|
+
queryParameters: localVarQueryParameter,
|
|
406
|
+
requestConfig: localVarRequestOptions,
|
|
407
|
+
path: localVarPath,
|
|
408
|
+
configuration
|
|
430
409
|
});
|
|
410
|
+
localVarRequestOptions.data = serializeDataIfNeeded(trade, localVarRequestOptions, configuration)
|
|
431
411
|
|
|
432
412
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
433
413
|
return {
|
|
@@ -464,23 +444,19 @@ export const TradingApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
464
444
|
|
|
465
445
|
// authentication PartnerClientId required
|
|
466
446
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "clientId", configuration})
|
|
467
|
-
|
|
468
447
|
// authentication PartnerSignature required
|
|
469
|
-
await setApiKeyToObject({object: localVarHeaderParameter, keyParamName: "Signature", configuration})
|
|
470
|
-
|
|
448
|
+
await setApiKeyToObject({ object: localVarHeaderParameter, keyParamName: "Signature", configuration })
|
|
471
449
|
// authentication PartnerTimestamp required
|
|
472
450
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "timestamp", configuration})
|
|
473
451
|
|
|
474
|
-
|
|
475
452
|
|
|
476
453
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
477
454
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
478
|
-
|
|
479
455
|
requestBeforeHook({
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
456
|
+
queryParameters: localVarQueryParameter,
|
|
457
|
+
requestConfig: localVarRequestOptions,
|
|
458
|
+
path: localVarPath,
|
|
459
|
+
configuration
|
|
484
460
|
});
|
|
485
461
|
|
|
486
462
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
@@ -519,13 +495,10 @@ export const TradingApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
519
495
|
|
|
520
496
|
// authentication PartnerClientId required
|
|
521
497
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "clientId", configuration})
|
|
522
|
-
|
|
523
498
|
// authentication PartnerSignature required
|
|
524
|
-
await setApiKeyToObject({object: localVarHeaderParameter, keyParamName: "Signature", configuration})
|
|
525
|
-
|
|
499
|
+
await setApiKeyToObject({ object: localVarHeaderParameter, keyParamName: "Signature", configuration })
|
|
526
500
|
// authentication PartnerTimestamp required
|
|
527
501
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "timestamp", configuration})
|
|
528
|
-
|
|
529
502
|
if (userId !== undefined) {
|
|
530
503
|
localVarQueryParameter['userId'] = userId;
|
|
531
504
|
}
|
|
@@ -540,14 +513,14 @@ export const TradingApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
540
513
|
|
|
541
514
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
542
515
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
543
|
-
localVarRequestOptions.data = serializeDataIfNeeded(manualTradeForm, localVarRequestOptions, configuration)
|
|
544
|
-
|
|
545
516
|
requestBeforeHook({
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
517
|
+
requestBody: manualTradeForm,
|
|
518
|
+
queryParameters: localVarQueryParameter,
|
|
519
|
+
requestConfig: localVarRequestOptions,
|
|
520
|
+
path: localVarPath,
|
|
521
|
+
configuration
|
|
550
522
|
});
|
|
523
|
+
localVarRequestOptions.data = serializeDataIfNeeded(manualTradeForm, localVarRequestOptions, configuration)
|
|
551
524
|
|
|
552
525
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
553
526
|
return {
|
|
@@ -585,13 +558,10 @@ export const TradingApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
585
558
|
|
|
586
559
|
// authentication PartnerClientId required
|
|
587
560
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "clientId", configuration})
|
|
588
|
-
|
|
589
561
|
// authentication PartnerSignature required
|
|
590
|
-
await setApiKeyToObject({object: localVarHeaderParameter, keyParamName: "Signature", configuration})
|
|
591
|
-
|
|
562
|
+
await setApiKeyToObject({ object: localVarHeaderParameter, keyParamName: "Signature", configuration })
|
|
592
563
|
// authentication PartnerTimestamp required
|
|
593
564
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "timestamp", configuration})
|
|
594
|
-
|
|
595
565
|
if (userId !== undefined) {
|
|
596
566
|
localVarQueryParameter['userId'] = userId;
|
|
597
567
|
}
|
|
@@ -606,14 +576,14 @@ export const TradingApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
606
576
|
|
|
607
577
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
608
578
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
609
|
-
localVarRequestOptions.data = serializeDataIfNeeded(tradingPlaceOCOOrderRequest, localVarRequestOptions, configuration)
|
|
610
|
-
|
|
611
579
|
requestBeforeHook({
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
580
|
+
requestBody: tradingPlaceOCOOrderRequest,
|
|
581
|
+
queryParameters: localVarQueryParameter,
|
|
582
|
+
requestConfig: localVarRequestOptions,
|
|
583
|
+
path: localVarPath,
|
|
584
|
+
configuration
|
|
616
585
|
});
|
|
586
|
+
localVarRequestOptions.data = serializeDataIfNeeded(tradingPlaceOCOOrderRequest, localVarRequestOptions, configuration)
|
|
617
587
|
|
|
618
588
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
619
589
|
return {
|
|
@@ -652,13 +622,10 @@ export const TradingApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
652
622
|
|
|
653
623
|
// authentication PartnerClientId required
|
|
654
624
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "clientId", configuration})
|
|
655
|
-
|
|
656
625
|
// authentication PartnerSignature required
|
|
657
|
-
await setApiKeyToObject({object: localVarHeaderParameter, keyParamName: "Signature", configuration})
|
|
658
|
-
|
|
626
|
+
await setApiKeyToObject({ object: localVarHeaderParameter, keyParamName: "Signature", configuration })
|
|
659
627
|
// authentication PartnerTimestamp required
|
|
660
628
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "timestamp", configuration})
|
|
661
|
-
|
|
662
629
|
if (userId !== undefined) {
|
|
663
630
|
localVarQueryParameter['userId'] = userId;
|
|
664
631
|
}
|
|
@@ -671,12 +638,11 @@ export const TradingApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
671
638
|
|
|
672
639
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
673
640
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
674
|
-
|
|
675
641
|
requestBeforeHook({
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
642
|
+
queryParameters: localVarQueryParameter,
|
|
643
|
+
requestConfig: localVarRequestOptions,
|
|
644
|
+
path: localVarPath,
|
|
645
|
+
configuration
|
|
680
646
|
});
|
|
681
647
|
|
|
682
648
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
@@ -1203,7 +1169,7 @@ export type TradingApiPlaceOrderRequest = {
|
|
|
1203
1169
|
* @class TradingApi
|
|
1204
1170
|
* @extends {BaseAPI}
|
|
1205
1171
|
*/
|
|
1206
|
-
export class TradingApi extends
|
|
1172
|
+
export class TradingApi extends TradingApiCustom {
|
|
1207
1173
|
/**
|
|
1208
1174
|
*
|
|
1209
1175
|
* @summary Cancel open order in account
|
|
@@ -25,6 +25,7 @@ import { PerformanceCustom } from '../models';
|
|
|
25
25
|
import { UniversalActivity } from '../models';
|
|
26
26
|
import { paginate } from "../pagination/paginate";
|
|
27
27
|
import { requestBeforeHook } from '../requestBeforeHook';
|
|
28
|
+
import { TransactionsAndReportingApiCustom } from "./transactions-and-reporting-api-custom";
|
|
28
29
|
/**
|
|
29
30
|
* TransactionsAndReportingApi - axios parameter creator
|
|
30
31
|
* @export
|
|
@@ -39,10 +40,11 @@ export const TransactionsAndReportingApiAxiosParamCreator = function (configurat
|
|
|
39
40
|
* @param {string} [startDate]
|
|
40
41
|
* @param {string} [endDate]
|
|
41
42
|
* @param {string} [accounts] Optional comma seperated list of account IDs used to filter the request on specific accounts
|
|
43
|
+
* @param {string} [brokerageAuthorizations] Optional comma seperated list of brokerage authorization IDs used to filter the request on only accounts that belong to those authorizations
|
|
42
44
|
* @param {*} [options] Override http request option.
|
|
43
45
|
* @throws {RequiredError}
|
|
44
46
|
*/
|
|
45
|
-
getActivities: async (userId: string, userSecret: string, startDate?: string, endDate?: string, accounts?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
47
|
+
getActivities: async (userId: string, userSecret: string, startDate?: string, endDate?: string, accounts?: string, brokerageAuthorizations?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
46
48
|
// verify required parameter 'userId' is not null or undefined
|
|
47
49
|
assertParamExists('getActivities', 'userId', userId)
|
|
48
50
|
// verify required parameter 'userSecret' is not null or undefined
|
|
@@ -61,13 +63,10 @@ export const TransactionsAndReportingApiAxiosParamCreator = function (configurat
|
|
|
61
63
|
|
|
62
64
|
// authentication PartnerClientId required
|
|
63
65
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "clientId", configuration})
|
|
64
|
-
|
|
65
66
|
// authentication PartnerSignature required
|
|
66
|
-
await setApiKeyToObject({object: localVarHeaderParameter, keyParamName: "Signature", configuration})
|
|
67
|
-
|
|
67
|
+
await setApiKeyToObject({ object: localVarHeaderParameter, keyParamName: "Signature", configuration })
|
|
68
68
|
// authentication PartnerTimestamp required
|
|
69
69
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "timestamp", configuration})
|
|
70
|
-
|
|
71
70
|
if (startDate !== undefined) {
|
|
72
71
|
localVarQueryParameter['startDate'] = startDate;
|
|
73
72
|
}
|
|
@@ -80,6 +79,10 @@ export const TransactionsAndReportingApiAxiosParamCreator = function (configurat
|
|
|
80
79
|
localVarQueryParameter['accounts'] = accounts;
|
|
81
80
|
}
|
|
82
81
|
|
|
82
|
+
if (brokerageAuthorizations !== undefined) {
|
|
83
|
+
localVarQueryParameter['brokerageAuthorizations'] = brokerageAuthorizations;
|
|
84
|
+
}
|
|
85
|
+
|
|
83
86
|
if (userId !== undefined) {
|
|
84
87
|
localVarQueryParameter['userId'] = userId;
|
|
85
88
|
}
|
|
@@ -92,12 +95,11 @@ export const TransactionsAndReportingApiAxiosParamCreator = function (configurat
|
|
|
92
95
|
|
|
93
96
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
94
97
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
95
|
-
|
|
96
98
|
requestBeforeHook({
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
queryParameters: localVarQueryParameter,
|
|
100
|
+
requestConfig: localVarRequestOptions,
|
|
101
|
+
path: localVarPath,
|
|
102
|
+
configuration
|
|
101
103
|
});
|
|
102
104
|
|
|
103
105
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
@@ -142,13 +144,10 @@ export const TransactionsAndReportingApiAxiosParamCreator = function (configurat
|
|
|
142
144
|
|
|
143
145
|
// authentication PartnerClientId required
|
|
144
146
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "clientId", configuration})
|
|
145
|
-
|
|
146
147
|
// authentication PartnerSignature required
|
|
147
|
-
await setApiKeyToObject({object: localVarHeaderParameter, keyParamName: "Signature", configuration})
|
|
148
|
-
|
|
148
|
+
await setApiKeyToObject({ object: localVarHeaderParameter, keyParamName: "Signature", configuration })
|
|
149
149
|
// authentication PartnerTimestamp required
|
|
150
150
|
await setApiKeyToObject({object: localVarQueryParameter, keyParamName: "timestamp", configuration})
|
|
151
|
-
|
|
152
151
|
if (startDate !== undefined) {
|
|
153
152
|
localVarQueryParameter['startDate'] = startDate;
|
|
154
153
|
}
|
|
@@ -181,12 +180,11 @@ export const TransactionsAndReportingApiAxiosParamCreator = function (configurat
|
|
|
181
180
|
|
|
182
181
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
183
182
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
184
|
-
|
|
185
183
|
requestBeforeHook({
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
184
|
+
queryParameters: localVarQueryParameter,
|
|
185
|
+
requestConfig: localVarRequestOptions,
|
|
186
|
+
path: localVarPath,
|
|
187
|
+
configuration
|
|
190
188
|
});
|
|
191
189
|
|
|
192
190
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
@@ -213,7 +211,7 @@ export const TransactionsAndReportingApiFp = function(configuration?: Configurat
|
|
|
213
211
|
* @throws {RequiredError}
|
|
214
212
|
*/
|
|
215
213
|
async getActivities(requestParameters: TransactionsAndReportingApiGetActivitiesRequest, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<UniversalActivity>>> {
|
|
216
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.getActivities(requestParameters.userId, requestParameters.userSecret, requestParameters.startDate, requestParameters.endDate, requestParameters.accounts, options);
|
|
214
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getActivities(requestParameters.userId, requestParameters.userSecret, requestParameters.startDate, requestParameters.endDate, requestParameters.accounts, requestParameters.brokerageAuthorizations, options);
|
|
217
215
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
218
216
|
},
|
|
219
217
|
/**
|
|
@@ -302,6 +300,13 @@ export type TransactionsAndReportingApiGetActivitiesRequest = {
|
|
|
302
300
|
*/
|
|
303
301
|
readonly accounts?: string
|
|
304
302
|
|
|
303
|
+
/**
|
|
304
|
+
* Optional comma seperated list of brokerage authorization IDs used to filter the request on only accounts that belong to those authorizations
|
|
305
|
+
* @type {string}
|
|
306
|
+
* @memberof TransactionsAndReportingApiGetActivities
|
|
307
|
+
*/
|
|
308
|
+
readonly brokerageAuthorizations?: string
|
|
309
|
+
|
|
305
310
|
}
|
|
306
311
|
|
|
307
312
|
/**
|
|
@@ -368,7 +373,7 @@ export type TransactionsAndReportingApiGetReportingCustomRangeRequest = {
|
|
|
368
373
|
* @class TransactionsAndReportingApi
|
|
369
374
|
* @extends {BaseAPI}
|
|
370
375
|
*/
|
|
371
|
-
export class TransactionsAndReportingApi extends
|
|
376
|
+
export class TransactionsAndReportingApi extends TransactionsAndReportingApiCustom {
|
|
372
377
|
/**
|
|
373
378
|
* Returns activities (transactions) for a user. Specifing start and end date is highly recommended for automatic calls for better performance
|
|
374
379
|
* @summary Get transaction history for a user
|
package/client-custom.ts
ADDED
package/client.ts
CHANGED
|
@@ -25,8 +25,9 @@ import {
|
|
|
25
25
|
TransactionsAndReportingApi,
|
|
26
26
|
} from "./api";
|
|
27
27
|
import { Configuration, ConfigurationParameters } from "./configuration";
|
|
28
|
+
import { SnaptradeCustom } from "./client-custom";
|
|
28
29
|
|
|
29
|
-
export class Snaptrade {
|
|
30
|
+
export class Snaptrade extends SnaptradeCustom {
|
|
30
31
|
readonly accountInformation: AccountInformationApi;
|
|
31
32
|
readonly apiDisclaimer: ApiDisclaimerApi;
|
|
32
33
|
readonly apiStatus: ApiStatusApi;
|
|
@@ -40,6 +41,7 @@ export class Snaptrade {
|
|
|
40
41
|
readonly transactionsAndReporting: TransactionsAndReportingApi;
|
|
41
42
|
|
|
42
43
|
constructor(configurationParameters: ConfigurationParameters) {
|
|
44
|
+
super(configurationParameters);
|
|
43
45
|
const configuration = new Configuration(configurationParameters);
|
|
44
46
|
this.accountInformation = new AccountInformationApi(configuration);
|
|
45
47
|
this.apiDisclaimer = new ApiDisclaimerApi(configuration);
|
package/common.ts
CHANGED
|
@@ -44,27 +44,32 @@ export const setApiKeyToObject = async function ({
|
|
|
44
44
|
type,
|
|
45
45
|
keyParamName,
|
|
46
46
|
configuration,
|
|
47
|
+
prefix
|
|
47
48
|
}: {
|
|
48
49
|
object: any
|
|
49
50
|
key?: string
|
|
50
|
-
type?: "Cookie"
|
|
51
|
+
type?: "Cookie"
|
|
51
52
|
keyParamName: string
|
|
52
53
|
configuration?: Configuration
|
|
54
|
+
prefix?: string
|
|
53
55
|
}) {
|
|
54
56
|
key = key ? key : keyParamName
|
|
57
|
+
let apiKey: string | null | undefined = null
|
|
55
58
|
if (configuration && configuration.apiKey) {
|
|
56
59
|
if (typeof configuration.apiKey === 'function')
|
|
57
|
-
|
|
60
|
+
apiKey = await configuration.apiKey(keyParamName)
|
|
58
61
|
else if (typeof configuration.apiKey === 'string')
|
|
59
|
-
|
|
62
|
+
apiKey = configuration.apiKey
|
|
60
63
|
else if (typeof configuration.apiKey === 'object') {
|
|
61
64
|
if (keyParamName in configuration.apiKey)
|
|
62
|
-
|
|
65
|
+
apiKey = configuration.apiKey[keyParamName]
|
|
63
66
|
} else
|
|
64
67
|
throw Error(
|
|
65
68
|
`Unexpected type ${typeof configuration.apiKey} for Configuration.apiKey`
|
|
66
69
|
)
|
|
67
70
|
}
|
|
71
|
+
if (!apiKey) return
|
|
72
|
+
object[key] = prefix !== undefined ? `${prefix}${apiKey}` : apiKey
|
|
68
73
|
if (type === "Cookie")
|
|
69
74
|
object[key] = `${keyParamName}=${object[key]}`
|
|
70
75
|
}
|
package/configuration.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
+
|
|
15
16
|
type ApiKey =
|
|
16
17
|
| string
|
|
17
18
|
| ((keyParamName: string) => string)
|
|
@@ -108,8 +109,8 @@ export class Configuration {
|
|
|
108
109
|
this.password = param.password;
|
|
109
110
|
this.accessToken = param.accessToken;
|
|
110
111
|
this.basePath = param.basePath;
|
|
111
|
-
this.baseOptions = param.baseOptions;
|
|
112
|
-
this.userAgent = param.userAgent === undefined ? "Konfig/6.
|
|
112
|
+
this.baseOptions = param.baseOptions ?? {};
|
|
113
|
+
this.userAgent = param.userAgent === undefined ? "Konfig/6.4.0/typescript" : param.userAgent;
|
|
113
114
|
this.formDataCtor = param.formDataCtor;
|
|
114
115
|
}
|
|
115
116
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AccountInformationApiCustom = void 0;
|
|
19
|
+
var base_1 = require("../base");
|
|
20
|
+
var AccountInformationApiCustom = /** @class */ (function (_super) {
|
|
21
|
+
__extends(AccountInformationApiCustom, _super);
|
|
22
|
+
function AccountInformationApiCustom() {
|
|
23
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
}
|
|
25
|
+
return AccountInformationApiCustom;
|
|
26
|
+
}(base_1.BaseAPI));
|
|
27
|
+
exports.AccountInformationApiCustom = AccountInformationApiCustom;
|
|
@@ -11,12 +11,13 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
13
13
|
import { Configuration } from '../configuration';
|
|
14
|
-
import { RequestArgs
|
|
14
|
+
import { RequestArgs } from '../base';
|
|
15
15
|
import { Account } from '../models';
|
|
16
16
|
import { AccountHoldings } from '../models';
|
|
17
17
|
import { AccountOrderRecord } from '../models';
|
|
18
18
|
import { Balance } from '../models';
|
|
19
19
|
import { Position } from '../models';
|
|
20
|
+
import { AccountInformationApiCustom } from "./account-information-api-custom";
|
|
20
21
|
/**
|
|
21
22
|
* AccountInformationApi - axios parameter creator
|
|
22
23
|
* @export
|
|
@@ -449,7 +450,7 @@ export type AccountInformationApiUpdateUserAccountRequest = {
|
|
|
449
450
|
* @class AccountInformationApi
|
|
450
451
|
* @extends {BaseAPI}
|
|
451
452
|
*/
|
|
452
|
-
export declare class AccountInformationApi extends
|
|
453
|
+
export declare class AccountInformationApi extends AccountInformationApiCustom {
|
|
453
454
|
/**
|
|
454
455
|
*
|
|
455
456
|
* @summary List all accounts for the user, plus balances and positions for each account.
|
|
@@ -83,6 +83,7 @@ var common_1 = require("../common");
|
|
|
83
83
|
// @ts-ignore
|
|
84
84
|
var base_1 = require("../base");
|
|
85
85
|
var requestBeforeHook_1 = require("../requestBeforeHook");
|
|
86
|
+
var account_information_api_custom_1 = require("./account-information-api-custom");
|
|
86
87
|
/**
|
|
87
88
|
* AccountInformationApi - axios parameter creator
|
|
88
89
|
* @export
|
|
@@ -1045,5 +1046,5 @@ var AccountInformationApi = /** @class */ (function (_super) {
|
|
|
1045
1046
|
return (0, exports.AccountInformationApiFp)(this.configuration).updateUserAccount(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1046
1047
|
};
|
|
1047
1048
|
return AccountInformationApi;
|
|
1048
|
-
}(
|
|
1049
|
+
}(account_information_api_custom_1.AccountInformationApiCustom));
|
|
1049
1050
|
exports.AccountInformationApi = AccountInformationApi;
|