snaptrade-typescript-sdk 9.0.101 → 9.0.103
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/README.md +2 -2
- package/dist/api/trading-api-generated.d.ts +11 -11
- package/dist/api/trading-api-generated.js +24 -24
- package/dist/browser.js +1 -1
- package/dist/configuration.js +1 -1
- package/dist/models/index.d.ts +2 -2
- package/dist/models/index.js +2 -2
- package/dist/models/manual-trade-form-with-options.d.ts +1 -1
- package/dist/models/{trading-place-mleg-order-request.d.ts → mleg-trade-form.d.ts} +8 -8
- package/dist/models/mleg-trading-instrument.d.ts +1 -1
- package/dist/models/{trading-place-simple-order-request.d.ts → simple-order-form.d.ts} +15 -15
- package/package.json +1 -1
- /package/dist/models/{trading-place-mleg-order-request.js → mleg-trade-form.js} +0 -0
- /package/dist/models/{trading-place-simple-order-request.js → simple-order-form.js} +0 -0
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Connect brokerage accounts to your app for live positions and trading
|
|
8
8
|
|
|
9
|
-
[](https://www.npmjs.com/package/snaptrade-typescript-sdk/v/9.0.103)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -2069,7 +2069,7 @@ The universal symbol ID of the security to trade. Must be \\\'null\\\' if `symbo
|
|
|
2069
2069
|
|
|
2070
2070
|
##### symbol: `string`<a id="symbol-string"></a>
|
|
2071
2071
|
|
|
2072
|
-
The security\\\'s trading ticker symbol. This currently supports stock symbols and Options symbols in the 21 character OCC format. For example
|
|
2072
|
+
The security\\\'s trading ticker symbol. This currently supports stock symbols and Options symbols in the 21 character OCC format. For example `AAPL 131124C00240000` represents a call option on AAPL expiring on 2024-11-13 with a strike price of $240. For more information on the OCC format, see [here](https://en.wikipedia.org/wiki/Option_symbol#OCC_format). If \\\'symbol\\\' is provided, then \\\'universal_symbol_id\\\' must be \\\'null\\\'.
|
|
2073
2073
|
|
|
2074
2074
|
##### price: `number`<a id="price-number"></a>
|
|
2075
2075
|
|
|
@@ -9,12 +9,12 @@ import { ManualTradeFormBracket } from '../models';
|
|
|
9
9
|
import { ManualTradeFormWithOptions } from '../models';
|
|
10
10
|
import { ManualTradeReplaceForm } from '../models';
|
|
11
11
|
import { MlegOrderResponse } from '../models';
|
|
12
|
+
import { MlegTradeForm } from '../models';
|
|
12
13
|
import { OrderUpdatedResponse } from '../models';
|
|
14
|
+
import { SimpleOrderForm } from '../models';
|
|
13
15
|
import { SimpleOrderPreview } from '../models';
|
|
14
16
|
import { SymbolsQuotesInner } from '../models';
|
|
15
17
|
import { TradingCancelUserAccountOrderRequest } from '../models';
|
|
16
|
-
import { TradingPlaceMlegOrderRequest } from '../models';
|
|
17
|
-
import { TradingPlaceSimpleOrderRequest } from '../models';
|
|
18
18
|
import { TradingSearchCryptocurrencyPairInstruments200Response } from '../models';
|
|
19
19
|
import { ValidatedTradeBody } from '../models';
|
|
20
20
|
/**
|
|
@@ -104,11 +104,11 @@ export declare const TradingApiAxiosParamCreator: (configuration?: Configuration
|
|
|
104
104
|
* @param {string} userId
|
|
105
105
|
* @param {string} userSecret
|
|
106
106
|
* @param {string} accountId
|
|
107
|
-
* @param {
|
|
107
|
+
* @param {MlegTradeForm} mlegTradeForm
|
|
108
108
|
* @param {*} [options] Override http request option.
|
|
109
109
|
* @throws {RequiredError}
|
|
110
110
|
*/
|
|
111
|
-
placeMlegOrder: (userId: string, userSecret: string, accountId: string,
|
|
111
|
+
placeMlegOrder: (userId: string, userSecret: string, accountId: string, mlegTradeForm: MlegTradeForm, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
112
112
|
/**
|
|
113
113
|
* Places the previously checked order with the brokerage. The `tradeId` is obtained from the [check order impact endpoint](/reference/Trading/Trading_getOrderImpact). If you prefer to place the order without checking for impact first, you can use the [place order endpoint](/reference/Trading/Trading_placeForceOrder). It\'s recommended to trigger a manual refresh of the account after placing an order to ensure the account is up to date. You can use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint for this.
|
|
114
114
|
* @summary Place checked order
|
|
@@ -126,22 +126,22 @@ export declare const TradingApiAxiosParamCreator: (configuration?: Configuration
|
|
|
126
126
|
* @param {string} userId
|
|
127
127
|
* @param {string} userSecret
|
|
128
128
|
* @param {string} accountId
|
|
129
|
-
* @param {
|
|
129
|
+
* @param {SimpleOrderForm} simpleOrderForm
|
|
130
130
|
* @param {*} [options] Override http request option.
|
|
131
131
|
* @throws {RequiredError}
|
|
132
132
|
*/
|
|
133
|
-
placeSimpleOrder: (userId: string, userSecret: string, accountId: string,
|
|
133
|
+
placeSimpleOrder: (userId: string, userSecret: string, accountId: string, simpleOrderForm: SimpleOrderForm, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
134
134
|
/**
|
|
135
135
|
* Previews an order using the specified account.
|
|
136
136
|
* @summary Preview order
|
|
137
137
|
* @param {string} userId
|
|
138
138
|
* @param {string} userSecret
|
|
139
139
|
* @param {string} accountId
|
|
140
|
-
* @param {
|
|
140
|
+
* @param {SimpleOrderForm} simpleOrderForm
|
|
141
141
|
* @param {*} [options] Override http request option.
|
|
142
142
|
* @throws {RequiredError}
|
|
143
143
|
*/
|
|
144
|
-
previewSimpleOrder: (userId: string, userSecret: string, accountId: string,
|
|
144
|
+
previewSimpleOrder: (userId: string, userSecret: string, accountId: string, simpleOrderForm: SimpleOrderForm, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
145
145
|
/**
|
|
146
146
|
* Replaces an existing pending order with a new one. The way this works is brokerage dependent, but usually involves cancelling the existing order and placing a new one. The order\'s brokerage_order_id may or may not change, be sure to use the one returned in the response going forward. Only supported on some brokerages
|
|
147
147
|
* @summary Replaces an order with a new one
|
|
@@ -598,7 +598,7 @@ export type TradingApiPlaceMlegOrderRequest = {
|
|
|
598
598
|
* @memberof TradingApiPlaceMlegOrder
|
|
599
599
|
*/
|
|
600
600
|
readonly accountId: string;
|
|
601
|
-
} &
|
|
601
|
+
} & MlegTradeForm;
|
|
602
602
|
/**
|
|
603
603
|
* Request parameters for placeOrder operation in TradingApi.
|
|
604
604
|
* @export
|
|
@@ -648,7 +648,7 @@ export type TradingApiPlaceSimpleOrderRequest = {
|
|
|
648
648
|
* @memberof TradingApiPlaceSimpleOrder
|
|
649
649
|
*/
|
|
650
650
|
readonly accountId: string;
|
|
651
|
-
} &
|
|
651
|
+
} & SimpleOrderForm;
|
|
652
652
|
/**
|
|
653
653
|
* Request parameters for previewSimpleOrder operation in TradingApi.
|
|
654
654
|
* @export
|
|
@@ -673,7 +673,7 @@ export type TradingApiPreviewSimpleOrderRequest = {
|
|
|
673
673
|
* @memberof TradingApiPreviewSimpleOrder
|
|
674
674
|
*/
|
|
675
675
|
readonly accountId: string;
|
|
676
|
-
} &
|
|
676
|
+
} & SimpleOrderForm;
|
|
677
677
|
/**
|
|
678
678
|
* Request parameters for replaceOrder operation in TradingApi.
|
|
679
679
|
* @export
|
|
@@ -460,19 +460,19 @@ const TradingApiAxiosParamCreator = function (configuration) {
|
|
|
460
460
|
* @param {string} userId
|
|
461
461
|
* @param {string} userSecret
|
|
462
462
|
* @param {string} accountId
|
|
463
|
-
* @param {
|
|
463
|
+
* @param {MlegTradeForm} mlegTradeForm
|
|
464
464
|
* @param {*} [options] Override http request option.
|
|
465
465
|
* @throws {RequiredError}
|
|
466
466
|
*/
|
|
467
|
-
placeMlegOrder: (userId, userSecret, accountId,
|
|
467
|
+
placeMlegOrder: (userId, userSecret, accountId, mlegTradeForm, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
468
468
|
// verify required parameter 'userId' is not null or undefined
|
|
469
469
|
(0, common_1.assertParamExists)('placeMlegOrder', 'userId', userId);
|
|
470
470
|
// verify required parameter 'userSecret' is not null or undefined
|
|
471
471
|
(0, common_1.assertParamExists)('placeMlegOrder', 'userSecret', userSecret);
|
|
472
472
|
// verify required parameter 'accountId' is not null or undefined
|
|
473
473
|
(0, common_1.assertParamExists)('placeMlegOrder', 'accountId', accountId);
|
|
474
|
-
// verify required parameter '
|
|
475
|
-
(0, common_1.assertParamExists)('placeMlegOrder', '
|
|
474
|
+
// verify required parameter 'mlegTradeForm' is not null or undefined
|
|
475
|
+
(0, common_1.assertParamExists)('placeMlegOrder', 'mlegTradeForm', mlegTradeForm);
|
|
476
476
|
const localVarPath = `/accounts/{accountId}/trading/options`
|
|
477
477
|
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
478
478
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
@@ -500,7 +500,7 @@ const TradingApiAxiosParamCreator = function (configuration) {
|
|
|
500
500
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
501
501
|
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
502
502
|
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
503
|
-
requestBody:
|
|
503
|
+
requestBody: mlegTradeForm,
|
|
504
504
|
queryParameters: localVarQueryParameter,
|
|
505
505
|
requestConfig: localVarRequestOptions,
|
|
506
506
|
path: localVarPath,
|
|
@@ -508,7 +508,7 @@ const TradingApiAxiosParamCreator = function (configuration) {
|
|
|
508
508
|
pathTemplate: '/accounts/{accountId}/trading/options',
|
|
509
509
|
httpMethod: 'POST'
|
|
510
510
|
});
|
|
511
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(
|
|
511
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(mlegTradeForm, localVarRequestOptions, configuration);
|
|
512
512
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
513
513
|
return {
|
|
514
514
|
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
@@ -580,19 +580,19 @@ const TradingApiAxiosParamCreator = function (configuration) {
|
|
|
580
580
|
* @param {string} userId
|
|
581
581
|
* @param {string} userSecret
|
|
582
582
|
* @param {string} accountId
|
|
583
|
-
* @param {
|
|
583
|
+
* @param {SimpleOrderForm} simpleOrderForm
|
|
584
584
|
* @param {*} [options] Override http request option.
|
|
585
585
|
* @throws {RequiredError}
|
|
586
586
|
*/
|
|
587
|
-
placeSimpleOrder: (userId, userSecret, accountId,
|
|
587
|
+
placeSimpleOrder: (userId, userSecret, accountId, simpleOrderForm, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
588
588
|
// verify required parameter 'userId' is not null or undefined
|
|
589
589
|
(0, common_1.assertParamExists)('placeSimpleOrder', 'userId', userId);
|
|
590
590
|
// verify required parameter 'userSecret' is not null or undefined
|
|
591
591
|
(0, common_1.assertParamExists)('placeSimpleOrder', 'userSecret', userSecret);
|
|
592
592
|
// verify required parameter 'accountId' is not null or undefined
|
|
593
593
|
(0, common_1.assertParamExists)('placeSimpleOrder', 'accountId', accountId);
|
|
594
|
-
// verify required parameter '
|
|
595
|
-
(0, common_1.assertParamExists)('placeSimpleOrder', '
|
|
594
|
+
// verify required parameter 'simpleOrderForm' is not null or undefined
|
|
595
|
+
(0, common_1.assertParamExists)('placeSimpleOrder', 'simpleOrderForm', simpleOrderForm);
|
|
596
596
|
const localVarPath = `/accounts/{accountId}/trading/simple`
|
|
597
597
|
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
598
598
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
@@ -620,7 +620,7 @@ const TradingApiAxiosParamCreator = function (configuration) {
|
|
|
620
620
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
621
621
|
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
622
622
|
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
623
|
-
requestBody:
|
|
623
|
+
requestBody: simpleOrderForm,
|
|
624
624
|
queryParameters: localVarQueryParameter,
|
|
625
625
|
requestConfig: localVarRequestOptions,
|
|
626
626
|
path: localVarPath,
|
|
@@ -628,7 +628,7 @@ const TradingApiAxiosParamCreator = function (configuration) {
|
|
|
628
628
|
pathTemplate: '/accounts/{accountId}/trading/simple',
|
|
629
629
|
httpMethod: 'POST'
|
|
630
630
|
});
|
|
631
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(
|
|
631
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(simpleOrderForm, localVarRequestOptions, configuration);
|
|
632
632
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
633
633
|
return {
|
|
634
634
|
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
@@ -641,19 +641,19 @@ const TradingApiAxiosParamCreator = function (configuration) {
|
|
|
641
641
|
* @param {string} userId
|
|
642
642
|
* @param {string} userSecret
|
|
643
643
|
* @param {string} accountId
|
|
644
|
-
* @param {
|
|
644
|
+
* @param {SimpleOrderForm} simpleOrderForm
|
|
645
645
|
* @param {*} [options] Override http request option.
|
|
646
646
|
* @throws {RequiredError}
|
|
647
647
|
*/
|
|
648
|
-
previewSimpleOrder: (userId, userSecret, accountId,
|
|
648
|
+
previewSimpleOrder: (userId, userSecret, accountId, simpleOrderForm, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
649
649
|
// verify required parameter 'userId' is not null or undefined
|
|
650
650
|
(0, common_1.assertParamExists)('previewSimpleOrder', 'userId', userId);
|
|
651
651
|
// verify required parameter 'userSecret' is not null or undefined
|
|
652
652
|
(0, common_1.assertParamExists)('previewSimpleOrder', 'userSecret', userSecret);
|
|
653
653
|
// verify required parameter 'accountId' is not null or undefined
|
|
654
654
|
(0, common_1.assertParamExists)('previewSimpleOrder', 'accountId', accountId);
|
|
655
|
-
// verify required parameter '
|
|
656
|
-
(0, common_1.assertParamExists)('previewSimpleOrder', '
|
|
655
|
+
// verify required parameter 'simpleOrderForm' is not null or undefined
|
|
656
|
+
(0, common_1.assertParamExists)('previewSimpleOrder', 'simpleOrderForm', simpleOrderForm);
|
|
657
657
|
const localVarPath = `/accounts/{accountId}/trading/simple/preview`
|
|
658
658
|
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
659
659
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
@@ -681,7 +681,7 @@ const TradingApiAxiosParamCreator = function (configuration) {
|
|
|
681
681
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
682
682
|
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
683
683
|
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
684
|
-
requestBody:
|
|
684
|
+
requestBody: simpleOrderForm,
|
|
685
685
|
queryParameters: localVarQueryParameter,
|
|
686
686
|
requestConfig: localVarRequestOptions,
|
|
687
687
|
path: localVarPath,
|
|
@@ -689,7 +689,7 @@ const TradingApiAxiosParamCreator = function (configuration) {
|
|
|
689
689
|
pathTemplate: '/accounts/{accountId}/trading/simple/preview',
|
|
690
690
|
httpMethod: 'POST'
|
|
691
691
|
});
|
|
692
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(
|
|
692
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(simpleOrderForm, localVarRequestOptions, configuration);
|
|
693
693
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
694
694
|
return {
|
|
695
695
|
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
@@ -972,14 +972,14 @@ const TradingApiFp = function (configuration) {
|
|
|
972
972
|
*/
|
|
973
973
|
placeMlegOrder(requestParameters, options) {
|
|
974
974
|
return __awaiter(this, void 0, void 0, function* () {
|
|
975
|
-
const
|
|
975
|
+
const mlegTradeForm = {
|
|
976
976
|
order_type: requestParameters.order_type,
|
|
977
977
|
time_in_force: requestParameters.time_in_force,
|
|
978
978
|
limit_price: requestParameters.limit_price,
|
|
979
979
|
stop_price: requestParameters.stop_price,
|
|
980
980
|
legs: requestParameters.legs
|
|
981
981
|
};
|
|
982
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeMlegOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId,
|
|
982
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeMlegOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, mlegTradeForm, options);
|
|
983
983
|
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
984
984
|
});
|
|
985
985
|
},
|
|
@@ -1008,7 +1008,7 @@ const TradingApiFp = function (configuration) {
|
|
|
1008
1008
|
*/
|
|
1009
1009
|
placeSimpleOrder(requestParameters, options) {
|
|
1010
1010
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1011
|
-
const
|
|
1011
|
+
const simpleOrderForm = {
|
|
1012
1012
|
instrument: requestParameters.instrument,
|
|
1013
1013
|
side: requestParameters.side,
|
|
1014
1014
|
type: requestParameters.type,
|
|
@@ -1019,7 +1019,7 @@ const TradingApiFp = function (configuration) {
|
|
|
1019
1019
|
post_only: requestParameters.post_only,
|
|
1020
1020
|
expiration_date: requestParameters.expiration_date
|
|
1021
1021
|
};
|
|
1022
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeSimpleOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId,
|
|
1022
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeSimpleOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, simpleOrderForm, options);
|
|
1023
1023
|
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1024
1024
|
});
|
|
1025
1025
|
},
|
|
@@ -1032,7 +1032,7 @@ const TradingApiFp = function (configuration) {
|
|
|
1032
1032
|
*/
|
|
1033
1033
|
previewSimpleOrder(requestParameters, options) {
|
|
1034
1034
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1035
|
-
const
|
|
1035
|
+
const simpleOrderForm = {
|
|
1036
1036
|
instrument: requestParameters.instrument,
|
|
1037
1037
|
side: requestParameters.side,
|
|
1038
1038
|
type: requestParameters.type,
|
|
@@ -1043,7 +1043,7 @@ const TradingApiFp = function (configuration) {
|
|
|
1043
1043
|
post_only: requestParameters.post_only,
|
|
1044
1044
|
expiration_date: requestParameters.expiration_date
|
|
1045
1045
|
};
|
|
1046
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.previewSimpleOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId,
|
|
1046
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.previewSimpleOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, simpleOrderForm, options);
|
|
1047
1047
|
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
1048
1048
|
});
|
|
1049
1049
|
},
|