snaptrade-typescript-sdk 8.24.0 → 8.26.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/README.md +147 -147
- package/dist/api/account-information-api-generated.d.ts +525 -525
- package/dist/api/account-information-api-generated.js +765 -765
- package/dist/api/account-information-api.d.ts +4 -4
- package/dist/api/account-information-api.js +22 -22
- package/dist/api/api-status-api-generated.d.ts +69 -69
- package/dist/api/api-status-api-generated.js +131 -131
- package/dist/api/api-status-api.d.ts +4 -4
- package/dist/api/api-status-api.js +22 -22
- package/dist/api/authentication-api-generated.d.ts +266 -266
- package/dist/api/authentication-api-generated.js +461 -461
- package/dist/api/authentication-api.d.ts +4 -4
- package/dist/api/authentication-api.js +22 -22
- package/dist/api/connections-api-generated.d.ts +274 -274
- package/dist/api/connections-api-generated.js +411 -411
- package/dist/api/connections-api.d.ts +4 -4
- package/dist/api/connections-api.js +22 -22
- package/dist/api/error-logs-api-generated.d.ts +93 -93
- package/dist/api/error-logs-api-generated.js +152 -152
- package/dist/api/error-logs-api.d.ts +4 -4
- package/dist/api/error-logs-api.js +22 -22
- package/dist/api/options-api-generated.d.ts +368 -368
- package/dist/api/options-api-generated.js +530 -530
- package/dist/api/options-api.d.ts +4 -4
- package/dist/api/options-api.js +22 -22
- package/dist/api/reference-data-api-generated.d.ts +467 -467
- package/dist/api/reference-data-api-generated.js +872 -872
- package/dist/api/reference-data-api.d.ts +4 -4
- package/dist/api/reference-data-api.js +22 -22
- package/dist/api/trading-api-generated.d.ts +402 -402
- package/dist/api/trading-api-generated.js +613 -613
- package/dist/api/trading-api.d.ts +4 -4
- package/dist/api/trading-api.js +22 -22
- package/dist/api/transactions-and-reporting-api-generated.d.ts +217 -217
- package/dist/api/transactions-and-reporting-api-generated.js +287 -287
- package/dist/api/transactions-and-reporting-api.d.ts +4 -4
- package/dist/api/transactions-and-reporting-api.js +22 -22
- package/dist/api.d.ts +19 -19
- package/dist/api.js +37 -37
- package/dist/base.d.ts +54 -54
- package/dist/base.js +60 -60
- package/dist/client-custom.d.ts +4 -4
- package/dist/client-custom.js +7 -7
- package/dist/client.d.ts +25 -25
- package/dist/client.js +32 -32
- package/dist/common.d.ts +67 -67
- package/dist/common.js +191 -177
- package/dist/configuration.d.ts +99 -99
- package/dist/configuration.js +53 -53
- package/dist/error.d.ts +56 -56
- package/dist/error.js +104 -104
- package/dist/index.d.ts +15 -15
- package/dist/index.js +33 -33
- package/dist/jest.config.d.ts +3 -3
- package/dist/jest.config.js +13 -13
- package/dist/models/account-holdings-account.d.ts +53 -53
- package/dist/models/account-holdings-account.js +14 -14
- package/dist/models/account-holdings.d.ts +46 -46
- package/dist/models/account-holdings.js +14 -14
- package/dist/models/account-order-record-status.d.ts +16 -16
- package/dist/models/account-order-record-status.js +14 -14
- package/dist/models/account-order-record.d.ts +132 -132
- package/dist/models/account-order-record.js +14 -14
- package/dist/models/account-simple.d.ts +43 -43
- package/dist/models/account-simple.js +14 -14
- package/dist/models/account-sync-status.d.ts +24 -24
- package/dist/models/account-sync-status.js +14 -14
- package/dist/models/account.d.ts +82 -82
- package/dist/models/account.js +14 -14
- package/dist/models/action.d.ts +16 -16
- package/dist/models/action.js +14 -14
- package/dist/models/authentication-login-snap-trade-user200-response.d.ts +17 -17
- package/dist/models/authentication-login-snap-trade-user200-response.js +14 -14
- package/dist/models/balance.d.ts +31 -31
- package/dist/models/balance.js +14 -14
- package/dist/models/brokerage-authorization-type-read-only-brokerage.d.ts +36 -36
- package/dist/models/brokerage-authorization-type-read-only-brokerage.js +14 -14
- package/dist/models/brokerage-authorization-type-read-only.d.ts +46 -46
- package/dist/models/brokerage-authorization-type-read-only.js +14 -14
- package/dist/models/brokerage-authorization-type.d.ts +26 -26
- package/dist/models/brokerage-authorization-type.js +14 -14
- package/dist/models/brokerage-authorization.d.ts +75 -75
- package/dist/models/brokerage-authorization.js +14 -14
- package/dist/models/brokerage-symbol-option-symbol.d.ts +66 -84
- package/dist/models/brokerage-symbol-option-symbol.js +14 -14
- package/dist/models/brokerage-symbol-symbol.d.ts +68 -68
- package/dist/models/brokerage-symbol-symbol.js +14 -14
- package/dist/models/brokerage-symbol.d.ts +57 -57
- package/dist/models/brokerage-symbol.js +14 -14
- package/dist/models/brokerage-type.d.ts +30 -30
- package/dist/models/brokerage-type.js +14 -14
- package/dist/models/brokerage.d.ts +127 -127
- package/dist/models/brokerage.js +14 -14
- package/dist/models/calculated-trade.d.ts +31 -31
- package/dist/models/calculated-trade.js +14 -14
- package/dist/models/cash-restriction.d.ts +50 -50
- package/dist/models/cash-restriction.js +14 -14
- package/dist/models/connections-session-events200-response-inner.d.ts +16 -16
- package/dist/models/connections-session-events200-response-inner.js +14 -14
- package/dist/models/currency.d.ts +36 -36
- package/dist/models/currency.js +14 -14
- package/dist/models/delete-user-response.d.ts +30 -30
- package/dist/models/delete-user-response.js +14 -14
- package/dist/models/dividend-at-date.d.ts +36 -36
- package/dist/models/dividend-at-date.js +14 -14
- package/dist/models/encrypted-response-encrypted-message-data.d.ts +36 -36
- package/dist/models/encrypted-response-encrypted-message-data.js +14 -14
- package/dist/models/encrypted-response.d.ts +30 -30
- package/dist/models/encrypted-response.js +14 -14
- package/dist/models/exchange-rate-pairs.d.ts +37 -37
- package/dist/models/exchange-rate-pairs.js +14 -14
- package/dist/models/exchange.d.ts +66 -66
- package/dist/models/exchange.js +14 -14
- package/dist/models/excluded-asset.d.ts +25 -25
- package/dist/models/excluded-asset.js +14 -14
- package/dist/models/index.d.ts +111 -110
- package/dist/models/index.js +127 -126
- package/dist/models/jwt.d.ts +24 -24
- package/dist/models/jwt.js +14 -14
- package/dist/models/login-redirect-uri.d.ts +29 -29
- package/dist/models/login-redirect-uri.js +14 -14
- package/dist/models/manual-trade-and-impact.d.ts +38 -38
- package/dist/models/manual-trade-and-impact.js +14 -14
- package/dist/models/manual-trade-balance.d.ts +38 -38
- package/dist/models/manual-trade-balance.js +14 -14
- package/dist/models/manual-trade-form.d.ts +68 -68
- package/dist/models/manual-trade-form.js +14 -14
- package/dist/models/manual-trade-symbol.d.ts +55 -55
- package/dist/models/manual-trade-symbol.js +14 -14
- package/dist/models/manual-trade.d.ts +70 -70
- package/dist/models/manual-trade.js +14 -14
- package/dist/models/model-asset-class-details.d.ts +32 -32
- package/dist/models/model-asset-class-details.js +14 -14
- package/dist/models/model-asset-class-target.d.ts +25 -25
- package/dist/models/model-asset-class-target.js +14 -14
- package/dist/models/model-asset-class.d.ts +30 -30
- package/dist/models/model-asset-class.js +14 -14
- package/dist/models/model-portfolio-asset-class.d.ts +31 -31
- package/dist/models/model-portfolio-asset-class.js +14 -14
- package/dist/models/model-portfolio-details.d.ts +39 -39
- package/dist/models/model-portfolio-details.js +14 -14
- package/dist/models/model-portfolio-security.d.ts +31 -31
- package/dist/models/model-portfolio-security.js +14 -14
- package/dist/models/model-portfolio.d.ts +38 -38
- package/dist/models/model-portfolio.js +14 -14
- package/dist/models/model400-failed-request-response.d.ts +30 -30
- package/dist/models/model400-failed-request-response.js +14 -14
- package/dist/models/model401-failed-request-response.d.ts +30 -30
- package/dist/models/model401-failed-request-response.js +14 -14
- package/dist/models/model403-failed-request-response.d.ts +30 -30
- package/dist/models/model403-failed-request-response.js +14 -14
- package/dist/models/model404-failed-request-response.d.ts +30 -30
- package/dist/models/model404-failed-request-response.js +14 -14
- package/dist/models/monthly-dividends.d.ts +31 -31
- package/dist/models/monthly-dividends.js +14 -14
- package/dist/models/net-contributions.d.ts +36 -36
- package/dist/models/net-contributions.js +14 -14
- package/dist/models/net-dividend.d.ts +37 -37
- package/dist/models/net-dividend.js +14 -14
- package/dist/models/option-chain-inner-chain-per-root-inner-chain-per-strike-price-inner.d.ts +36 -36
- package/dist/models/option-chain-inner-chain-per-root-inner-chain-per-strike-price-inner.js +14 -14
- package/dist/models/option-chain-inner-chain-per-root-inner.d.ts +37 -37
- package/dist/models/option-chain-inner-chain-per-root-inner.js +14 -14
- package/dist/models/option-chain-inner.d.ts +49 -49
- package/dist/models/option-chain-inner.js +14 -14
- package/dist/models/option-leg.d.ts +38 -38
- package/dist/models/option-leg.js +14 -14
- package/dist/models/option-strategy-legs-inner.d.ts +41 -41
- package/dist/models/option-strategy-legs-inner.js +14 -14
- package/dist/models/option-strategy.d.ts +50 -50
- package/dist/models/option-strategy.js +14 -14
- package/dist/models/options-get-option-strategy-request.d.ts +38 -38
- package/dist/models/options-get-option-strategy-request.js +14 -14
- package/dist/models/options-holdings.d.ts +56 -56
- package/dist/models/options-holdings.js +14 -14
- package/dist/models/options-place-option-strategy-request.d.ts +38 -38
- package/dist/models/options-place-option-strategy-request.js +14 -14
- package/dist/models/options-position-currency.d.ts +35 -0
- package/dist/models/options-position-currency.js +14 -0
- package/dist/models/options-position.d.ts +68 -62
- package/dist/models/options-position.js +14 -14
- package/dist/models/options-symbol.d.ts +67 -85
- package/dist/models/options-symbol.js +14 -14
- package/dist/models/order-type.d.ts +16 -16
- package/dist/models/order-type.js +14 -14
- package/dist/models/partner-data.d.ts +91 -91
- package/dist/models/partner-data.js +14 -14
- package/dist/models/past-value.d.ts +36 -36
- package/dist/models/past-value.js +14 -14
- package/dist/models/performance-custom.d.ts +137 -137
- package/dist/models/performance-custom.js +14 -14
- package/dist/models/portfolio-group-info.d.ts +92 -92
- package/dist/models/portfolio-group-info.js +14 -14
- package/dist/models/portfolio-group-position.d.ts +37 -37
- package/dist/models/portfolio-group-position.js +14 -14
- package/dist/models/portfolio-group-settings.d.ts +49 -49
- package/dist/models/portfolio-group-settings.js +14 -14
- package/dist/models/portfolio-group.d.ts +30 -30
- package/dist/models/portfolio-group.js +14 -14
- package/dist/models/position-symbol.d.ts +55 -55
- package/dist/models/position-symbol.js +14 -14
- package/dist/models/position.d.ts +61 -55
- package/dist/models/position.js +14 -14
- package/dist/models/redirect-tokenand-pin.d.ts +30 -30
- package/dist/models/redirect-tokenand-pin.js +14 -14
- package/dist/models/security-type.d.ts +42 -42
- package/dist/models/security-type.js +14 -14
- package/dist/models/session-event.d.ts +62 -62
- package/dist/models/session-event.js +14 -14
- package/dist/models/snap-trade-apidisclaimer-accept-status.d.ts +30 -30
- package/dist/models/snap-trade-apidisclaimer-accept-status.js +14 -14
- package/dist/models/snap-trade-holdings-account-account-id.d.ts +75 -75
- package/dist/models/snap-trade-holdings-account-account-id.js +14 -14
- package/dist/models/snap-trade-holdings-account.d.ts +70 -70
- package/dist/models/snap-trade-holdings-account.js +14 -14
- package/dist/models/snap-trade-holdings-total-value.d.ts +30 -30
- package/dist/models/snap-trade-holdings-total-value.js +14 -14
- package/dist/models/snap-trade-login-user-request-body.d.ts +49 -49
- package/dist/models/snap-trade-login-user-request-body.js +14 -14
- package/dist/models/snap-trade-register-user-request-body.d.ts +29 -29
- package/dist/models/snap-trade-register-user-request-body.js +14 -14
- package/dist/models/status.d.ts +36 -36
- package/dist/models/status.js +14 -14
- package/dist/models/strategy-impact-legs-inner.d.ts +60 -60
- package/dist/models/strategy-impact-legs-inner.js +14 -14
- package/dist/models/strategy-impact.d.ts +85 -85
- package/dist/models/strategy-impact.js +14 -14
- package/dist/models/strategy-order-place-orders-inner-legs-inner.d.ts +60 -60
- package/dist/models/strategy-order-place-orders-inner-legs-inner.js +14 -14
- package/dist/models/strategy-order-place-orders-inner.d.ts +277 -277
- package/dist/models/strategy-order-place-orders-inner.js +14 -14
- package/dist/models/strategy-order-place.d.ts +31 -31
- package/dist/models/strategy-order-place.js +14 -14
- package/dist/models/strategy-order-record.d.ts +89 -89
- package/dist/models/strategy-order-record.js +14 -14
- package/dist/models/strategy-quotes-greek.d.ts +48 -48
- package/dist/models/strategy-quotes-greek.js +14 -14
- package/dist/models/strategy-quotes.d.ts +56 -56
- package/dist/models/strategy-quotes.js +14 -14
- package/dist/models/sub-period-return-rate.d.ts +36 -36
- package/dist/models/sub-period-return-rate.js +14 -14
- package/dist/models/symbol-query.d.ts +23 -23
- package/dist/models/symbol-query.js +14 -14
- package/dist/models/symbol.d.ts +63 -63
- package/dist/models/symbol.js +14 -14
- package/dist/models/symbols-quotes-inner.d.ts +54 -54
- package/dist/models/symbols-quotes-inner.js +14 -14
- package/dist/models/target-asset.d.ts +57 -57
- package/dist/models/target-asset.js +14 -14
- package/dist/models/time-in-force.d.ts +16 -16
- package/dist/models/time-in-force.js +14 -14
- package/dist/models/trade-execution-status.d.ts +80 -80
- package/dist/models/trade-execution-status.js +14 -14
- package/dist/models/trade-impact.d.ts +50 -50
- package/dist/models/trade-impact.js +14 -14
- package/dist/models/trade.d.ts +71 -71
- package/dist/models/trade.js +14 -14
- package/dist/models/trading-cancel-user-account-order-request.d.ts +23 -23
- package/dist/models/trading-cancel-user-account-order-request.js +14 -14
- package/dist/models/trading-place-ocoorder-request.d.ts +29 -29
- package/dist/models/trading-place-ocoorder-request.js +14 -14
- package/dist/models/transactions-status.d.ts +29 -29
- package/dist/models/transactions-status.js +14 -14
- package/dist/models/underlying-symbol.d.ts +63 -63
- package/dist/models/underlying-symbol.js +14 -14
- package/dist/models/universal-activity.d.ts +118 -118
- package/dist/models/universal-activity.js +14 -14
- package/dist/models/universal-symbol-ticker.d.ts +69 -69
- package/dist/models/universal-symbol-ticker.js +14 -14
- package/dist/models/universal-symbol.d.ts +69 -69
- package/dist/models/universal-symbol.js +14 -14
- package/dist/models/user-error-log.d.ts +54 -54
- package/dist/models/user-error-log.js +14 -14
- package/dist/models/user-idand-secret.d.ts +30 -30
- package/dist/models/user-idand-secret.js +14 -14
- package/dist/models/user-settings.d.ts +79 -79
- package/dist/models/user-settings.js +14 -14
- package/dist/models/usexchange.d.ts +72 -72
- package/dist/models/usexchange.js +14 -14
- package/dist/pagination/page-types.d.ts +26 -26
- package/dist/pagination/page-types.js +12 -12
- package/dist/pagination/page.d.ts +35 -35
- package/dist/pagination/page.js +32 -32
- package/dist/pagination/pageable.d.ts +57 -57
- package/dist/pagination/pageable.js +70 -70
- package/dist/pagination/paginate.d.ts +16 -16
- package/dist/pagination/paginate.js +39 -39
- package/dist/requestAfterHook.d.ts +8 -8
- package/dist/requestAfterHook.js +45 -45
- package/dist/requestBeforeHook.d.ts +9 -9
- package/dist/requestBeforeHook.js +8 -8
- package/dist/requestBeforeUrlHook.d.ts +7 -7
- package/dist/requestBeforeUrlHook.js +5 -5
- package/package.json +42 -42
|
@@ -1,530 +1,530 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
/**
|
|
5
|
-
* SnapTrade
|
|
6
|
-
* Connect brokerage accounts to your app for live positions and trading
|
|
7
|
-
*
|
|
8
|
-
* The version of the OpenAPI document: 1.0.0
|
|
9
|
-
* Contact: api@snaptrade.com
|
|
10
|
-
*
|
|
11
|
-
* NOTE: This file is auto generated by Konfig (https://konfigthis.com).
|
|
12
|
-
* Do not edit the class manually.
|
|
13
|
-
*/
|
|
14
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.OptionsApiGenerated = exports.OptionsApiFactory = exports.OptionsApiFp = exports.OptionsApiAxiosParamCreator = void 0;
|
|
25
|
-
const axios_1 = require("axios");
|
|
26
|
-
// Some imports not used depending on template conditions
|
|
27
|
-
// @ts-ignore
|
|
28
|
-
const common_1 = require("../common");
|
|
29
|
-
// @ts-ignore
|
|
30
|
-
const base_1 = require("../base");
|
|
31
|
-
const requestBeforeHook_1 = require("../requestBeforeHook");
|
|
32
|
-
/**
|
|
33
|
-
* OptionsApi - axios parameter creator
|
|
34
|
-
* @export
|
|
35
|
-
*/
|
|
36
|
-
const OptionsApiAxiosParamCreator = function (configuration) {
|
|
37
|
-
return {
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* @summary Creates an option strategy object that will be used to place an option strategy order
|
|
41
|
-
* @param {string} userId
|
|
42
|
-
* @param {string} userSecret
|
|
43
|
-
* @param {string} accountId The ID of the account get positions.
|
|
44
|
-
* @param {OptionsGetOptionStrategyRequest} optionsGetOptionStrategyRequest
|
|
45
|
-
* @param {*} [options] Override http request option.
|
|
46
|
-
* @throws {RequiredError}
|
|
47
|
-
*/
|
|
48
|
-
getOptionStrategy: (userId, userSecret, accountId, optionsGetOptionStrategyRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
// verify required parameter 'userId' is not null or undefined
|
|
50
|
-
(0, common_1.assertParamExists)('getOptionStrategy', 'userId', userId);
|
|
51
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
52
|
-
(0, common_1.assertParamExists)('getOptionStrategy', 'userSecret', userSecret);
|
|
53
|
-
// verify required parameter 'accountId' is not null or undefined
|
|
54
|
-
(0, common_1.assertParamExists)('getOptionStrategy', 'accountId', accountId);
|
|
55
|
-
// verify required parameter 'optionsGetOptionStrategyRequest' is not null or undefined
|
|
56
|
-
(0, common_1.assertParamExists)('getOptionStrategy', 'optionsGetOptionStrategyRequest', optionsGetOptionStrategyRequest);
|
|
57
|
-
const localVarPath = `/accounts/{accountId}/optionStrategy`
|
|
58
|
-
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
59
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
60
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
61
|
-
let baseOptions;
|
|
62
|
-
if (configuration) {
|
|
63
|
-
baseOptions = configuration.baseOptions;
|
|
64
|
-
}
|
|
65
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
66
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
67
|
-
const localVarQueryParameter = {};
|
|
68
|
-
// authentication PartnerClientId required
|
|
69
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
70
|
-
// authentication PartnerSignature required
|
|
71
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
72
|
-
// authentication PartnerTimestamp required
|
|
73
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
74
|
-
if (userId !== undefined) {
|
|
75
|
-
localVarQueryParameter['userId'] = userId;
|
|
76
|
-
}
|
|
77
|
-
if (userSecret !== undefined) {
|
|
78
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
79
|
-
}
|
|
80
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
81
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
82
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
83
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
84
|
-
requestBody: optionsGetOptionStrategyRequest,
|
|
85
|
-
queryParameters: localVarQueryParameter,
|
|
86
|
-
requestConfig: localVarRequestOptions,
|
|
87
|
-
path: localVarPath,
|
|
88
|
-
configuration
|
|
89
|
-
});
|
|
90
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(optionsGetOptionStrategyRequest, localVarRequestOptions, configuration);
|
|
91
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
92
|
-
return {
|
|
93
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
94
|
-
options: localVarRequestOptions,
|
|
95
|
-
};
|
|
96
|
-
}),
|
|
97
|
-
/**
|
|
98
|
-
*
|
|
99
|
-
* @summary Get the options chain
|
|
100
|
-
* @param {string} userId
|
|
101
|
-
* @param {string} userSecret
|
|
102
|
-
* @param {string} accountId The ID of the account get positions.
|
|
103
|
-
* @param {string} symbol Universal symbol ID if symbol
|
|
104
|
-
* @param {*} [options] Override http request option.
|
|
105
|
-
* @throws {RequiredError}
|
|
106
|
-
*/
|
|
107
|
-
getOptionsChain: (userId, userSecret, accountId, symbol, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
108
|
-
// verify required parameter 'userId' is not null or undefined
|
|
109
|
-
(0, common_1.assertParamExists)('getOptionsChain', 'userId', userId);
|
|
110
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
111
|
-
(0, common_1.assertParamExists)('getOptionsChain', 'userSecret', userSecret);
|
|
112
|
-
// verify required parameter 'accountId' is not null or undefined
|
|
113
|
-
(0, common_1.assertParamExists)('getOptionsChain', 'accountId', accountId);
|
|
114
|
-
// verify required parameter 'symbol' is not null or undefined
|
|
115
|
-
(0, common_1.assertParamExists)('getOptionsChain', 'symbol', symbol);
|
|
116
|
-
const localVarPath = `/accounts/{accountId}/optionsChain`
|
|
117
|
-
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
118
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
119
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
120
|
-
let baseOptions;
|
|
121
|
-
if (configuration) {
|
|
122
|
-
baseOptions = configuration.baseOptions;
|
|
123
|
-
}
|
|
124
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
125
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
126
|
-
const localVarQueryParameter = {};
|
|
127
|
-
// authentication PartnerClientId required
|
|
128
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
129
|
-
// authentication PartnerSignature required
|
|
130
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
131
|
-
// authentication PartnerTimestamp required
|
|
132
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
133
|
-
if (userId !== undefined) {
|
|
134
|
-
localVarQueryParameter['userId'] = userId;
|
|
135
|
-
}
|
|
136
|
-
if (userSecret !== undefined) {
|
|
137
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
138
|
-
}
|
|
139
|
-
if (symbol !== undefined) {
|
|
140
|
-
localVarQueryParameter['symbol'] = symbol;
|
|
141
|
-
}
|
|
142
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
143
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
144
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
145
|
-
queryParameters: localVarQueryParameter,
|
|
146
|
-
requestConfig: localVarRequestOptions,
|
|
147
|
-
path: localVarPath,
|
|
148
|
-
configuration
|
|
149
|
-
});
|
|
150
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
151
|
-
return {
|
|
152
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
153
|
-
options: localVarRequestOptions,
|
|
154
|
-
};
|
|
155
|
-
}),
|
|
156
|
-
/**
|
|
157
|
-
*
|
|
158
|
-
* @summary Get latest market data of option strategy
|
|
159
|
-
* @param {string} userId
|
|
160
|
-
* @param {string} userSecret
|
|
161
|
-
* @param {string} accountId The ID of the account get positions.
|
|
162
|
-
* @param {string} optionStrategyId Option strategy id obtained from response when creating option strategy object
|
|
163
|
-
* @param {*} [options] Override http request option.
|
|
164
|
-
* @throws {RequiredError}
|
|
165
|
-
*/
|
|
166
|
-
getOptionsStrategyQuote: (userId, userSecret, accountId, optionStrategyId, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
167
|
-
// verify required parameter 'userId' is not null or undefined
|
|
168
|
-
(0, common_1.assertParamExists)('getOptionsStrategyQuote', 'userId', userId);
|
|
169
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
170
|
-
(0, common_1.assertParamExists)('getOptionsStrategyQuote', 'userSecret', userSecret);
|
|
171
|
-
// verify required parameter 'accountId' is not null or undefined
|
|
172
|
-
(0, common_1.assertParamExists)('getOptionsStrategyQuote', 'accountId', accountId);
|
|
173
|
-
// verify required parameter 'optionStrategyId' is not null or undefined
|
|
174
|
-
(0, common_1.assertParamExists)('getOptionsStrategyQuote', 'optionStrategyId', optionStrategyId);
|
|
175
|
-
const localVarPath = `/accounts/{accountId}/optionStrategy/{optionStrategyId}`
|
|
176
|
-
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)))
|
|
177
|
-
.replace(`{${"optionStrategyId"}}`, encodeURIComponent(String(optionStrategyId !== undefined ? optionStrategyId : `-optionStrategyId-`)));
|
|
178
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
179
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
180
|
-
let baseOptions;
|
|
181
|
-
if (configuration) {
|
|
182
|
-
baseOptions = configuration.baseOptions;
|
|
183
|
-
}
|
|
184
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
185
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
186
|
-
const localVarQueryParameter = {};
|
|
187
|
-
// authentication PartnerClientId required
|
|
188
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
189
|
-
// authentication PartnerSignature required
|
|
190
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
191
|
-
// authentication PartnerTimestamp required
|
|
192
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
193
|
-
if (userId !== undefined) {
|
|
194
|
-
localVarQueryParameter['userId'] = userId;
|
|
195
|
-
}
|
|
196
|
-
if (userSecret !== undefined) {
|
|
197
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
198
|
-
}
|
|
199
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
200
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
201
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
202
|
-
queryParameters: localVarQueryParameter,
|
|
203
|
-
requestConfig: localVarRequestOptions,
|
|
204
|
-
path: localVarPath,
|
|
205
|
-
configuration
|
|
206
|
-
});
|
|
207
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
208
|
-
return {
|
|
209
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
210
|
-
options: localVarRequestOptions,
|
|
211
|
-
};
|
|
212
|
-
}),
|
|
213
|
-
/**
|
|
214
|
-
*
|
|
215
|
-
* @summary Get the options holdings in the account
|
|
216
|
-
* @param {string} userId
|
|
217
|
-
* @param {string} userSecret
|
|
218
|
-
* @param {string} accountId The ID of the account get positions.
|
|
219
|
-
* @param {*} [options] Override http request option.
|
|
220
|
-
* @throws {RequiredError}
|
|
221
|
-
*/
|
|
222
|
-
listOptionHoldings: (userId, userSecret, accountId, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
223
|
-
// verify required parameter 'userId' is not null or undefined
|
|
224
|
-
(0, common_1.assertParamExists)('listOptionHoldings', 'userId', userId);
|
|
225
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
226
|
-
(0, common_1.assertParamExists)('listOptionHoldings', 'userSecret', userSecret);
|
|
227
|
-
// verify required parameter 'accountId' is not null or undefined
|
|
228
|
-
(0, common_1.assertParamExists)('listOptionHoldings', 'accountId', accountId);
|
|
229
|
-
const localVarPath = `/accounts/{accountId}/options`
|
|
230
|
-
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
231
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
232
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
233
|
-
let baseOptions;
|
|
234
|
-
if (configuration) {
|
|
235
|
-
baseOptions = configuration.baseOptions;
|
|
236
|
-
}
|
|
237
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
238
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
239
|
-
const localVarQueryParameter = {};
|
|
240
|
-
// authentication PartnerClientId required
|
|
241
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
242
|
-
// authentication PartnerSignature required
|
|
243
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
244
|
-
// authentication PartnerTimestamp required
|
|
245
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
246
|
-
if (userId !== undefined) {
|
|
247
|
-
localVarQueryParameter['userId'] = userId;
|
|
248
|
-
}
|
|
249
|
-
if (userSecret !== undefined) {
|
|
250
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
251
|
-
}
|
|
252
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
253
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
254
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
255
|
-
queryParameters: localVarQueryParameter,
|
|
256
|
-
requestConfig: localVarRequestOptions,
|
|
257
|
-
path: localVarPath,
|
|
258
|
-
configuration
|
|
259
|
-
});
|
|
260
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
261
|
-
return {
|
|
262
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
263
|
-
options: localVarRequestOptions,
|
|
264
|
-
};
|
|
265
|
-
}),
|
|
266
|
-
/**
|
|
267
|
-
*
|
|
268
|
-
* @summary Place an option strategy order on the brokerage
|
|
269
|
-
* @param {string} userId
|
|
270
|
-
* @param {string} userSecret
|
|
271
|
-
* @param {string} accountId The ID of the account get positions.
|
|
272
|
-
* @param {string} optionStrategyId Option strategy id obtained from response when creating option strategy object
|
|
273
|
-
* @param {OptionsPlaceOptionStrategyRequest} optionsPlaceOptionStrategyRequest
|
|
274
|
-
* @param {*} [options] Override http request option.
|
|
275
|
-
* @throws {RequiredError}
|
|
276
|
-
*/
|
|
277
|
-
placeOptionStrategy: (userId, userSecret, accountId, optionStrategyId, optionsPlaceOptionStrategyRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
278
|
-
// verify required parameter 'userId' is not null or undefined
|
|
279
|
-
(0, common_1.assertParamExists)('placeOptionStrategy', 'userId', userId);
|
|
280
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
281
|
-
(0, common_1.assertParamExists)('placeOptionStrategy', 'userSecret', userSecret);
|
|
282
|
-
// verify required parameter 'accountId' is not null or undefined
|
|
283
|
-
(0, common_1.assertParamExists)('placeOptionStrategy', 'accountId', accountId);
|
|
284
|
-
// verify required parameter 'optionStrategyId' is not null or undefined
|
|
285
|
-
(0, common_1.assertParamExists)('placeOptionStrategy', 'optionStrategyId', optionStrategyId);
|
|
286
|
-
// verify required parameter 'optionsPlaceOptionStrategyRequest' is not null or undefined
|
|
287
|
-
(0, common_1.assertParamExists)('placeOptionStrategy', 'optionsPlaceOptionStrategyRequest', optionsPlaceOptionStrategyRequest);
|
|
288
|
-
const localVarPath = `/accounts/{accountId}/optionStrategy/{optionStrategyId}/execute`
|
|
289
|
-
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)))
|
|
290
|
-
.replace(`{${"optionStrategyId"}}`, encodeURIComponent(String(optionStrategyId !== undefined ? optionStrategyId : `-optionStrategyId-`)));
|
|
291
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
292
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
293
|
-
let baseOptions;
|
|
294
|
-
if (configuration) {
|
|
295
|
-
baseOptions = configuration.baseOptions;
|
|
296
|
-
}
|
|
297
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
298
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
299
|
-
const localVarQueryParameter = {};
|
|
300
|
-
// authentication PartnerClientId required
|
|
301
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
302
|
-
// authentication PartnerSignature required
|
|
303
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
304
|
-
// authentication PartnerTimestamp required
|
|
305
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
306
|
-
if (userId !== undefined) {
|
|
307
|
-
localVarQueryParameter['userId'] = userId;
|
|
308
|
-
}
|
|
309
|
-
if (userSecret !== undefined) {
|
|
310
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
311
|
-
}
|
|
312
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
313
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
314
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
315
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
316
|
-
requestBody: optionsPlaceOptionStrategyRequest,
|
|
317
|
-
queryParameters: localVarQueryParameter,
|
|
318
|
-
requestConfig: localVarRequestOptions,
|
|
319
|
-
path: localVarPath,
|
|
320
|
-
configuration
|
|
321
|
-
});
|
|
322
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(optionsPlaceOptionStrategyRequest, localVarRequestOptions, configuration);
|
|
323
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
324
|
-
return {
|
|
325
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
326
|
-
options: localVarRequestOptions,
|
|
327
|
-
};
|
|
328
|
-
}),
|
|
329
|
-
};
|
|
330
|
-
};
|
|
331
|
-
exports.OptionsApiAxiosParamCreator = OptionsApiAxiosParamCreator;
|
|
332
|
-
/**
|
|
333
|
-
* OptionsApi - functional programming interface
|
|
334
|
-
* @export
|
|
335
|
-
*/
|
|
336
|
-
const OptionsApiFp = function (configuration) {
|
|
337
|
-
const localVarAxiosParamCreator = (0, exports.OptionsApiAxiosParamCreator)(configuration);
|
|
338
|
-
return {
|
|
339
|
-
/**
|
|
340
|
-
*
|
|
341
|
-
* @summary Creates an option strategy object that will be used to place an option strategy order
|
|
342
|
-
* @param {OptionsApiGetOptionStrategyRequest} requestParameters Request parameters.
|
|
343
|
-
* @param {*} [options] Override http request option.
|
|
344
|
-
* @throws {RequiredError}
|
|
345
|
-
*/
|
|
346
|
-
getOptionStrategy(requestParameters, options) {
|
|
347
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
348
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.getOptionStrategy(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters, options);
|
|
349
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
350
|
-
});
|
|
351
|
-
},
|
|
352
|
-
/**
|
|
353
|
-
*
|
|
354
|
-
* @summary Get the options chain
|
|
355
|
-
* @param {OptionsApiGetOptionsChainRequest} requestParameters Request parameters.
|
|
356
|
-
* @param {*} [options] Override http request option.
|
|
357
|
-
* @throws {RequiredError}
|
|
358
|
-
*/
|
|
359
|
-
getOptionsChain(requestParameters, options) {
|
|
360
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
361
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.getOptionsChain(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.symbol, options);
|
|
362
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
363
|
-
});
|
|
364
|
-
},
|
|
365
|
-
/**
|
|
366
|
-
*
|
|
367
|
-
* @summary Get latest market data of option strategy
|
|
368
|
-
* @param {OptionsApiGetOptionsStrategyQuoteRequest} requestParameters Request parameters.
|
|
369
|
-
* @param {*} [options] Override http request option.
|
|
370
|
-
* @throws {RequiredError}
|
|
371
|
-
*/
|
|
372
|
-
getOptionsStrategyQuote(requestParameters, options) {
|
|
373
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
374
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.getOptionsStrategyQuote(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.optionStrategyId, options);
|
|
375
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
376
|
-
});
|
|
377
|
-
},
|
|
378
|
-
/**
|
|
379
|
-
*
|
|
380
|
-
* @summary Get the options holdings in the account
|
|
381
|
-
* @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
|
|
382
|
-
* @param {*} [options] Override http request option.
|
|
383
|
-
* @throws {RequiredError}
|
|
384
|
-
*/
|
|
385
|
-
listOptionHoldings(requestParameters, options) {
|
|
386
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
387
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.listOptionHoldings(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, options);
|
|
388
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
389
|
-
});
|
|
390
|
-
},
|
|
391
|
-
/**
|
|
392
|
-
*
|
|
393
|
-
* @summary Place an option strategy order on the brokerage
|
|
394
|
-
* @param {OptionsApiPlaceOptionStrategyRequest} requestParameters Request parameters.
|
|
395
|
-
* @param {*} [options] Override http request option.
|
|
396
|
-
* @throws {RequiredError}
|
|
397
|
-
*/
|
|
398
|
-
placeOptionStrategy(requestParameters, options) {
|
|
399
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
400
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeOptionStrategy(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.optionStrategyId, requestParameters, options);
|
|
401
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
402
|
-
});
|
|
403
|
-
},
|
|
404
|
-
};
|
|
405
|
-
};
|
|
406
|
-
exports.OptionsApiFp = OptionsApiFp;
|
|
407
|
-
/**
|
|
408
|
-
* OptionsApi - factory interface
|
|
409
|
-
* @export
|
|
410
|
-
*/
|
|
411
|
-
const OptionsApiFactory = function (configuration, basePath, axios) {
|
|
412
|
-
const localVarFp = (0, exports.OptionsApiFp)(configuration);
|
|
413
|
-
return {
|
|
414
|
-
/**
|
|
415
|
-
*
|
|
416
|
-
* @summary Creates an option strategy object that will be used to place an option strategy order
|
|
417
|
-
* @param {OptionsApiGetOptionStrategyRequest} requestParameters Request parameters.
|
|
418
|
-
* @param {*} [options] Override http request option.
|
|
419
|
-
* @throws {RequiredError}
|
|
420
|
-
*/
|
|
421
|
-
getOptionStrategy(requestParameters, options) {
|
|
422
|
-
return localVarFp.getOptionStrategy(requestParameters, options).then((request) => request(axios, basePath));
|
|
423
|
-
},
|
|
424
|
-
/**
|
|
425
|
-
*
|
|
426
|
-
* @summary Get the options chain
|
|
427
|
-
* @param {OptionsApiGetOptionsChainRequest} requestParameters Request parameters.
|
|
428
|
-
* @param {*} [options] Override http request option.
|
|
429
|
-
* @throws {RequiredError}
|
|
430
|
-
*/
|
|
431
|
-
getOptionsChain(requestParameters, options) {
|
|
432
|
-
return localVarFp.getOptionsChain(requestParameters, options).then((request) => request(axios, basePath));
|
|
433
|
-
},
|
|
434
|
-
/**
|
|
435
|
-
*
|
|
436
|
-
* @summary Get latest market data of option strategy
|
|
437
|
-
* @param {OptionsApiGetOptionsStrategyQuoteRequest} requestParameters Request parameters.
|
|
438
|
-
* @param {*} [options] Override http request option.
|
|
439
|
-
* @throws {RequiredError}
|
|
440
|
-
*/
|
|
441
|
-
getOptionsStrategyQuote(requestParameters, options) {
|
|
442
|
-
return localVarFp.getOptionsStrategyQuote(requestParameters, options).then((request) => request(axios, basePath));
|
|
443
|
-
},
|
|
444
|
-
/**
|
|
445
|
-
*
|
|
446
|
-
* @summary Get the options holdings in the account
|
|
447
|
-
* @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
|
|
448
|
-
* @param {*} [options] Override http request option.
|
|
449
|
-
* @throws {RequiredError}
|
|
450
|
-
*/
|
|
451
|
-
listOptionHoldings(requestParameters, options) {
|
|
452
|
-
return localVarFp.listOptionHoldings(requestParameters, options).then((request) => request(axios, basePath));
|
|
453
|
-
},
|
|
454
|
-
/**
|
|
455
|
-
*
|
|
456
|
-
* @summary Place an option strategy order on the brokerage
|
|
457
|
-
* @param {OptionsApiPlaceOptionStrategyRequest} requestParameters Request parameters.
|
|
458
|
-
* @param {*} [options] Override http request option.
|
|
459
|
-
* @throws {RequiredError}
|
|
460
|
-
*/
|
|
461
|
-
placeOptionStrategy(requestParameters, options) {
|
|
462
|
-
return localVarFp.placeOptionStrategy(requestParameters, options).then((request) => request(axios, basePath));
|
|
463
|
-
},
|
|
464
|
-
};
|
|
465
|
-
};
|
|
466
|
-
exports.OptionsApiFactory = OptionsApiFactory;
|
|
467
|
-
/**
|
|
468
|
-
* OptionsApiGenerated - object-oriented interface
|
|
469
|
-
* @export
|
|
470
|
-
* @class OptionsApiGenerated
|
|
471
|
-
* @extends {BaseAPI}
|
|
472
|
-
*/
|
|
473
|
-
class OptionsApiGenerated extends base_1.BaseAPI {
|
|
474
|
-
/**
|
|
475
|
-
*
|
|
476
|
-
* @summary Creates an option strategy object that will be used to place an option strategy order
|
|
477
|
-
* @param {OptionsApiGetOptionStrategyRequest} requestParameters Request parameters.
|
|
478
|
-
* @param {*} [options] Override http request option.
|
|
479
|
-
* @throws {RequiredError}
|
|
480
|
-
* @memberof OptionsApiGenerated
|
|
481
|
-
*/
|
|
482
|
-
getOptionStrategy(requestParameters, options) {
|
|
483
|
-
return (0, exports.OptionsApiFp)(this.configuration).getOptionStrategy(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
484
|
-
}
|
|
485
|
-
/**
|
|
486
|
-
*
|
|
487
|
-
* @summary Get the options chain
|
|
488
|
-
* @param {OptionsApiGetOptionsChainRequest} requestParameters Request parameters.
|
|
489
|
-
* @param {*} [options] Override http request option.
|
|
490
|
-
* @throws {RequiredError}
|
|
491
|
-
* @memberof OptionsApiGenerated
|
|
492
|
-
*/
|
|
493
|
-
getOptionsChain(requestParameters, options) {
|
|
494
|
-
return (0, exports.OptionsApiFp)(this.configuration).getOptionsChain(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
495
|
-
}
|
|
496
|
-
/**
|
|
497
|
-
*
|
|
498
|
-
* @summary Get latest market data of option strategy
|
|
499
|
-
* @param {OptionsApiGetOptionsStrategyQuoteRequest} requestParameters Request parameters.
|
|
500
|
-
* @param {*} [options] Override http request option.
|
|
501
|
-
* @throws {RequiredError}
|
|
502
|
-
* @memberof OptionsApiGenerated
|
|
503
|
-
*/
|
|
504
|
-
getOptionsStrategyQuote(requestParameters, options) {
|
|
505
|
-
return (0, exports.OptionsApiFp)(this.configuration).getOptionsStrategyQuote(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
506
|
-
}
|
|
507
|
-
/**
|
|
508
|
-
*
|
|
509
|
-
* @summary Get the options holdings in the account
|
|
510
|
-
* @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
|
|
511
|
-
* @param {*} [options] Override http request option.
|
|
512
|
-
* @throws {RequiredError}
|
|
513
|
-
* @memberof OptionsApiGenerated
|
|
514
|
-
*/
|
|
515
|
-
listOptionHoldings(requestParameters, options) {
|
|
516
|
-
return (0, exports.OptionsApiFp)(this.configuration).listOptionHoldings(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
517
|
-
}
|
|
518
|
-
/**
|
|
519
|
-
*
|
|
520
|
-
* @summary Place an option strategy order on the brokerage
|
|
521
|
-
* @param {OptionsApiPlaceOptionStrategyRequest} requestParameters Request parameters.
|
|
522
|
-
* @param {*} [options] Override http request option.
|
|
523
|
-
* @throws {RequiredError}
|
|
524
|
-
* @memberof OptionsApiGenerated
|
|
525
|
-
*/
|
|
526
|
-
placeOptionStrategy(requestParameters, options) {
|
|
527
|
-
return (0, exports.OptionsApiFp)(this.configuration).placeOptionStrategy(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
exports.OptionsApiGenerated = OptionsApiGenerated;
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* SnapTrade
|
|
6
|
+
* Connect brokerage accounts to your app for live positions and trading
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
* Contact: api@snaptrade.com
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This file is auto generated by Konfig (https://konfigthis.com).
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
16
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
18
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
19
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.OptionsApiGenerated = exports.OptionsApiFactory = exports.OptionsApiFp = exports.OptionsApiAxiosParamCreator = void 0;
|
|
25
|
+
const axios_1 = require("axios");
|
|
26
|
+
// Some imports not used depending on template conditions
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
const common_1 = require("../common");
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
const base_1 = require("../base");
|
|
31
|
+
const requestBeforeHook_1 = require("../requestBeforeHook");
|
|
32
|
+
/**
|
|
33
|
+
* OptionsApi - axios parameter creator
|
|
34
|
+
* @export
|
|
35
|
+
*/
|
|
36
|
+
const OptionsApiAxiosParamCreator = function (configuration) {
|
|
37
|
+
return {
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @summary Creates an option strategy object that will be used to place an option strategy order
|
|
41
|
+
* @param {string} userId
|
|
42
|
+
* @param {string} userSecret
|
|
43
|
+
* @param {string} accountId The ID of the account get positions.
|
|
44
|
+
* @param {OptionsGetOptionStrategyRequest} optionsGetOptionStrategyRequest
|
|
45
|
+
* @param {*} [options] Override http request option.
|
|
46
|
+
* @throws {RequiredError}
|
|
47
|
+
*/
|
|
48
|
+
getOptionStrategy: (userId, userSecret, accountId, optionsGetOptionStrategyRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
// verify required parameter 'userId' is not null or undefined
|
|
50
|
+
(0, common_1.assertParamExists)('getOptionStrategy', 'userId', userId);
|
|
51
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
52
|
+
(0, common_1.assertParamExists)('getOptionStrategy', 'userSecret', userSecret);
|
|
53
|
+
// verify required parameter 'accountId' is not null or undefined
|
|
54
|
+
(0, common_1.assertParamExists)('getOptionStrategy', 'accountId', accountId);
|
|
55
|
+
// verify required parameter 'optionsGetOptionStrategyRequest' is not null or undefined
|
|
56
|
+
(0, common_1.assertParamExists)('getOptionStrategy', 'optionsGetOptionStrategyRequest', optionsGetOptionStrategyRequest);
|
|
57
|
+
const localVarPath = `/accounts/{accountId}/optionStrategy`
|
|
58
|
+
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
59
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
60
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
61
|
+
let baseOptions;
|
|
62
|
+
if (configuration) {
|
|
63
|
+
baseOptions = configuration.baseOptions;
|
|
64
|
+
}
|
|
65
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
66
|
+
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
67
|
+
const localVarQueryParameter = {};
|
|
68
|
+
// authentication PartnerClientId required
|
|
69
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
70
|
+
// authentication PartnerSignature required
|
|
71
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
72
|
+
// authentication PartnerTimestamp required
|
|
73
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
74
|
+
if (userId !== undefined) {
|
|
75
|
+
localVarQueryParameter['userId'] = userId;
|
|
76
|
+
}
|
|
77
|
+
if (userSecret !== undefined) {
|
|
78
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
79
|
+
}
|
|
80
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
81
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
82
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
83
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
84
|
+
requestBody: optionsGetOptionStrategyRequest,
|
|
85
|
+
queryParameters: localVarQueryParameter,
|
|
86
|
+
requestConfig: localVarRequestOptions,
|
|
87
|
+
path: localVarPath,
|
|
88
|
+
configuration
|
|
89
|
+
});
|
|
90
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(optionsGetOptionStrategyRequest, localVarRequestOptions, configuration);
|
|
91
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
92
|
+
return {
|
|
93
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
94
|
+
options: localVarRequestOptions,
|
|
95
|
+
};
|
|
96
|
+
}),
|
|
97
|
+
/**
|
|
98
|
+
*
|
|
99
|
+
* @summary Get the options chain
|
|
100
|
+
* @param {string} userId
|
|
101
|
+
* @param {string} userSecret
|
|
102
|
+
* @param {string} accountId The ID of the account get positions.
|
|
103
|
+
* @param {string} symbol Universal symbol ID if symbol
|
|
104
|
+
* @param {*} [options] Override http request option.
|
|
105
|
+
* @throws {RequiredError}
|
|
106
|
+
*/
|
|
107
|
+
getOptionsChain: (userId, userSecret, accountId, symbol, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
// verify required parameter 'userId' is not null or undefined
|
|
109
|
+
(0, common_1.assertParamExists)('getOptionsChain', 'userId', userId);
|
|
110
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
111
|
+
(0, common_1.assertParamExists)('getOptionsChain', 'userSecret', userSecret);
|
|
112
|
+
// verify required parameter 'accountId' is not null or undefined
|
|
113
|
+
(0, common_1.assertParamExists)('getOptionsChain', 'accountId', accountId);
|
|
114
|
+
// verify required parameter 'symbol' is not null or undefined
|
|
115
|
+
(0, common_1.assertParamExists)('getOptionsChain', 'symbol', symbol);
|
|
116
|
+
const localVarPath = `/accounts/{accountId}/optionsChain`
|
|
117
|
+
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
118
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
119
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
120
|
+
let baseOptions;
|
|
121
|
+
if (configuration) {
|
|
122
|
+
baseOptions = configuration.baseOptions;
|
|
123
|
+
}
|
|
124
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
125
|
+
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
126
|
+
const localVarQueryParameter = {};
|
|
127
|
+
// authentication PartnerClientId required
|
|
128
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
129
|
+
// authentication PartnerSignature required
|
|
130
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
131
|
+
// authentication PartnerTimestamp required
|
|
132
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
133
|
+
if (userId !== undefined) {
|
|
134
|
+
localVarQueryParameter['userId'] = userId;
|
|
135
|
+
}
|
|
136
|
+
if (userSecret !== undefined) {
|
|
137
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
138
|
+
}
|
|
139
|
+
if (symbol !== undefined) {
|
|
140
|
+
localVarQueryParameter['symbol'] = symbol;
|
|
141
|
+
}
|
|
142
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
143
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
144
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
145
|
+
queryParameters: localVarQueryParameter,
|
|
146
|
+
requestConfig: localVarRequestOptions,
|
|
147
|
+
path: localVarPath,
|
|
148
|
+
configuration
|
|
149
|
+
});
|
|
150
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
151
|
+
return {
|
|
152
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
153
|
+
options: localVarRequestOptions,
|
|
154
|
+
};
|
|
155
|
+
}),
|
|
156
|
+
/**
|
|
157
|
+
*
|
|
158
|
+
* @summary Get latest market data of option strategy
|
|
159
|
+
* @param {string} userId
|
|
160
|
+
* @param {string} userSecret
|
|
161
|
+
* @param {string} accountId The ID of the account get positions.
|
|
162
|
+
* @param {string} optionStrategyId Option strategy id obtained from response when creating option strategy object
|
|
163
|
+
* @param {*} [options] Override http request option.
|
|
164
|
+
* @throws {RequiredError}
|
|
165
|
+
*/
|
|
166
|
+
getOptionsStrategyQuote: (userId, userSecret, accountId, optionStrategyId, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
// verify required parameter 'userId' is not null or undefined
|
|
168
|
+
(0, common_1.assertParamExists)('getOptionsStrategyQuote', 'userId', userId);
|
|
169
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
170
|
+
(0, common_1.assertParamExists)('getOptionsStrategyQuote', 'userSecret', userSecret);
|
|
171
|
+
// verify required parameter 'accountId' is not null or undefined
|
|
172
|
+
(0, common_1.assertParamExists)('getOptionsStrategyQuote', 'accountId', accountId);
|
|
173
|
+
// verify required parameter 'optionStrategyId' is not null or undefined
|
|
174
|
+
(0, common_1.assertParamExists)('getOptionsStrategyQuote', 'optionStrategyId', optionStrategyId);
|
|
175
|
+
const localVarPath = `/accounts/{accountId}/optionStrategy/{optionStrategyId}`
|
|
176
|
+
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)))
|
|
177
|
+
.replace(`{${"optionStrategyId"}}`, encodeURIComponent(String(optionStrategyId !== undefined ? optionStrategyId : `-optionStrategyId-`)));
|
|
178
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
179
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
180
|
+
let baseOptions;
|
|
181
|
+
if (configuration) {
|
|
182
|
+
baseOptions = configuration.baseOptions;
|
|
183
|
+
}
|
|
184
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
185
|
+
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
186
|
+
const localVarQueryParameter = {};
|
|
187
|
+
// authentication PartnerClientId required
|
|
188
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
189
|
+
// authentication PartnerSignature required
|
|
190
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
191
|
+
// authentication PartnerTimestamp required
|
|
192
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
193
|
+
if (userId !== undefined) {
|
|
194
|
+
localVarQueryParameter['userId'] = userId;
|
|
195
|
+
}
|
|
196
|
+
if (userSecret !== undefined) {
|
|
197
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
198
|
+
}
|
|
199
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
200
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
201
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
202
|
+
queryParameters: localVarQueryParameter,
|
|
203
|
+
requestConfig: localVarRequestOptions,
|
|
204
|
+
path: localVarPath,
|
|
205
|
+
configuration
|
|
206
|
+
});
|
|
207
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
208
|
+
return {
|
|
209
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
210
|
+
options: localVarRequestOptions,
|
|
211
|
+
};
|
|
212
|
+
}),
|
|
213
|
+
/**
|
|
214
|
+
*
|
|
215
|
+
* @summary Get the options holdings in the account
|
|
216
|
+
* @param {string} userId
|
|
217
|
+
* @param {string} userSecret
|
|
218
|
+
* @param {string} accountId The ID of the account get positions.
|
|
219
|
+
* @param {*} [options] Override http request option.
|
|
220
|
+
* @throws {RequiredError}
|
|
221
|
+
*/
|
|
222
|
+
listOptionHoldings: (userId, userSecret, accountId, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
223
|
+
// verify required parameter 'userId' is not null or undefined
|
|
224
|
+
(0, common_1.assertParamExists)('listOptionHoldings', 'userId', userId);
|
|
225
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
226
|
+
(0, common_1.assertParamExists)('listOptionHoldings', 'userSecret', userSecret);
|
|
227
|
+
// verify required parameter 'accountId' is not null or undefined
|
|
228
|
+
(0, common_1.assertParamExists)('listOptionHoldings', 'accountId', accountId);
|
|
229
|
+
const localVarPath = `/accounts/{accountId}/options`
|
|
230
|
+
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
231
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
232
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
233
|
+
let baseOptions;
|
|
234
|
+
if (configuration) {
|
|
235
|
+
baseOptions = configuration.baseOptions;
|
|
236
|
+
}
|
|
237
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
238
|
+
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
239
|
+
const localVarQueryParameter = {};
|
|
240
|
+
// authentication PartnerClientId required
|
|
241
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
242
|
+
// authentication PartnerSignature required
|
|
243
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
244
|
+
// authentication PartnerTimestamp required
|
|
245
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
246
|
+
if (userId !== undefined) {
|
|
247
|
+
localVarQueryParameter['userId'] = userId;
|
|
248
|
+
}
|
|
249
|
+
if (userSecret !== undefined) {
|
|
250
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
251
|
+
}
|
|
252
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
253
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
254
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
255
|
+
queryParameters: localVarQueryParameter,
|
|
256
|
+
requestConfig: localVarRequestOptions,
|
|
257
|
+
path: localVarPath,
|
|
258
|
+
configuration
|
|
259
|
+
});
|
|
260
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
261
|
+
return {
|
|
262
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
263
|
+
options: localVarRequestOptions,
|
|
264
|
+
};
|
|
265
|
+
}),
|
|
266
|
+
/**
|
|
267
|
+
*
|
|
268
|
+
* @summary Place an option strategy order on the brokerage
|
|
269
|
+
* @param {string} userId
|
|
270
|
+
* @param {string} userSecret
|
|
271
|
+
* @param {string} accountId The ID of the account get positions.
|
|
272
|
+
* @param {string} optionStrategyId Option strategy id obtained from response when creating option strategy object
|
|
273
|
+
* @param {OptionsPlaceOptionStrategyRequest} optionsPlaceOptionStrategyRequest
|
|
274
|
+
* @param {*} [options] Override http request option.
|
|
275
|
+
* @throws {RequiredError}
|
|
276
|
+
*/
|
|
277
|
+
placeOptionStrategy: (userId, userSecret, accountId, optionStrategyId, optionsPlaceOptionStrategyRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
278
|
+
// verify required parameter 'userId' is not null or undefined
|
|
279
|
+
(0, common_1.assertParamExists)('placeOptionStrategy', 'userId', userId);
|
|
280
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
281
|
+
(0, common_1.assertParamExists)('placeOptionStrategy', 'userSecret', userSecret);
|
|
282
|
+
// verify required parameter 'accountId' is not null or undefined
|
|
283
|
+
(0, common_1.assertParamExists)('placeOptionStrategy', 'accountId', accountId);
|
|
284
|
+
// verify required parameter 'optionStrategyId' is not null or undefined
|
|
285
|
+
(0, common_1.assertParamExists)('placeOptionStrategy', 'optionStrategyId', optionStrategyId);
|
|
286
|
+
// verify required parameter 'optionsPlaceOptionStrategyRequest' is not null or undefined
|
|
287
|
+
(0, common_1.assertParamExists)('placeOptionStrategy', 'optionsPlaceOptionStrategyRequest', optionsPlaceOptionStrategyRequest);
|
|
288
|
+
const localVarPath = `/accounts/{accountId}/optionStrategy/{optionStrategyId}/execute`
|
|
289
|
+
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)))
|
|
290
|
+
.replace(`{${"optionStrategyId"}}`, encodeURIComponent(String(optionStrategyId !== undefined ? optionStrategyId : `-optionStrategyId-`)));
|
|
291
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
292
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
293
|
+
let baseOptions;
|
|
294
|
+
if (configuration) {
|
|
295
|
+
baseOptions = configuration.baseOptions;
|
|
296
|
+
}
|
|
297
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
298
|
+
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
299
|
+
const localVarQueryParameter = {};
|
|
300
|
+
// authentication PartnerClientId required
|
|
301
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
302
|
+
// authentication PartnerSignature required
|
|
303
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
304
|
+
// authentication PartnerTimestamp required
|
|
305
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
306
|
+
if (userId !== undefined) {
|
|
307
|
+
localVarQueryParameter['userId'] = userId;
|
|
308
|
+
}
|
|
309
|
+
if (userSecret !== undefined) {
|
|
310
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
311
|
+
}
|
|
312
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
313
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
314
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
315
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
316
|
+
requestBody: optionsPlaceOptionStrategyRequest,
|
|
317
|
+
queryParameters: localVarQueryParameter,
|
|
318
|
+
requestConfig: localVarRequestOptions,
|
|
319
|
+
path: localVarPath,
|
|
320
|
+
configuration
|
|
321
|
+
});
|
|
322
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(optionsPlaceOptionStrategyRequest, localVarRequestOptions, configuration);
|
|
323
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
324
|
+
return {
|
|
325
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
326
|
+
options: localVarRequestOptions,
|
|
327
|
+
};
|
|
328
|
+
}),
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
exports.OptionsApiAxiosParamCreator = OptionsApiAxiosParamCreator;
|
|
332
|
+
/**
|
|
333
|
+
* OptionsApi - functional programming interface
|
|
334
|
+
* @export
|
|
335
|
+
*/
|
|
336
|
+
const OptionsApiFp = function (configuration) {
|
|
337
|
+
const localVarAxiosParamCreator = (0, exports.OptionsApiAxiosParamCreator)(configuration);
|
|
338
|
+
return {
|
|
339
|
+
/**
|
|
340
|
+
*
|
|
341
|
+
* @summary Creates an option strategy object that will be used to place an option strategy order
|
|
342
|
+
* @param {OptionsApiGetOptionStrategyRequest} requestParameters Request parameters.
|
|
343
|
+
* @param {*} [options] Override http request option.
|
|
344
|
+
* @throws {RequiredError}
|
|
345
|
+
*/
|
|
346
|
+
getOptionStrategy(requestParameters, options) {
|
|
347
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
348
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getOptionStrategy(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters, options);
|
|
349
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
350
|
+
});
|
|
351
|
+
},
|
|
352
|
+
/**
|
|
353
|
+
*
|
|
354
|
+
* @summary Get the options chain
|
|
355
|
+
* @param {OptionsApiGetOptionsChainRequest} requestParameters Request parameters.
|
|
356
|
+
* @param {*} [options] Override http request option.
|
|
357
|
+
* @throws {RequiredError}
|
|
358
|
+
*/
|
|
359
|
+
getOptionsChain(requestParameters, options) {
|
|
360
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
361
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getOptionsChain(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.symbol, options);
|
|
362
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
363
|
+
});
|
|
364
|
+
},
|
|
365
|
+
/**
|
|
366
|
+
*
|
|
367
|
+
* @summary Get latest market data of option strategy
|
|
368
|
+
* @param {OptionsApiGetOptionsStrategyQuoteRequest} requestParameters Request parameters.
|
|
369
|
+
* @param {*} [options] Override http request option.
|
|
370
|
+
* @throws {RequiredError}
|
|
371
|
+
*/
|
|
372
|
+
getOptionsStrategyQuote(requestParameters, options) {
|
|
373
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
374
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getOptionsStrategyQuote(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.optionStrategyId, options);
|
|
375
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
376
|
+
});
|
|
377
|
+
},
|
|
378
|
+
/**
|
|
379
|
+
*
|
|
380
|
+
* @summary Get the options holdings in the account
|
|
381
|
+
* @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
|
|
382
|
+
* @param {*} [options] Override http request option.
|
|
383
|
+
* @throws {RequiredError}
|
|
384
|
+
*/
|
|
385
|
+
listOptionHoldings(requestParameters, options) {
|
|
386
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
387
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.listOptionHoldings(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, options);
|
|
388
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
389
|
+
});
|
|
390
|
+
},
|
|
391
|
+
/**
|
|
392
|
+
*
|
|
393
|
+
* @summary Place an option strategy order on the brokerage
|
|
394
|
+
* @param {OptionsApiPlaceOptionStrategyRequest} requestParameters Request parameters.
|
|
395
|
+
* @param {*} [options] Override http request option.
|
|
396
|
+
* @throws {RequiredError}
|
|
397
|
+
*/
|
|
398
|
+
placeOptionStrategy(requestParameters, options) {
|
|
399
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
400
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeOptionStrategy(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.optionStrategyId, requestParameters, options);
|
|
401
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
402
|
+
});
|
|
403
|
+
},
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
exports.OptionsApiFp = OptionsApiFp;
|
|
407
|
+
/**
|
|
408
|
+
* OptionsApi - factory interface
|
|
409
|
+
* @export
|
|
410
|
+
*/
|
|
411
|
+
const OptionsApiFactory = function (configuration, basePath, axios) {
|
|
412
|
+
const localVarFp = (0, exports.OptionsApiFp)(configuration);
|
|
413
|
+
return {
|
|
414
|
+
/**
|
|
415
|
+
*
|
|
416
|
+
* @summary Creates an option strategy object that will be used to place an option strategy order
|
|
417
|
+
* @param {OptionsApiGetOptionStrategyRequest} requestParameters Request parameters.
|
|
418
|
+
* @param {*} [options] Override http request option.
|
|
419
|
+
* @throws {RequiredError}
|
|
420
|
+
*/
|
|
421
|
+
getOptionStrategy(requestParameters, options) {
|
|
422
|
+
return localVarFp.getOptionStrategy(requestParameters, options).then((request) => request(axios, basePath));
|
|
423
|
+
},
|
|
424
|
+
/**
|
|
425
|
+
*
|
|
426
|
+
* @summary Get the options chain
|
|
427
|
+
* @param {OptionsApiGetOptionsChainRequest} requestParameters Request parameters.
|
|
428
|
+
* @param {*} [options] Override http request option.
|
|
429
|
+
* @throws {RequiredError}
|
|
430
|
+
*/
|
|
431
|
+
getOptionsChain(requestParameters, options) {
|
|
432
|
+
return localVarFp.getOptionsChain(requestParameters, options).then((request) => request(axios, basePath));
|
|
433
|
+
},
|
|
434
|
+
/**
|
|
435
|
+
*
|
|
436
|
+
* @summary Get latest market data of option strategy
|
|
437
|
+
* @param {OptionsApiGetOptionsStrategyQuoteRequest} requestParameters Request parameters.
|
|
438
|
+
* @param {*} [options] Override http request option.
|
|
439
|
+
* @throws {RequiredError}
|
|
440
|
+
*/
|
|
441
|
+
getOptionsStrategyQuote(requestParameters, options) {
|
|
442
|
+
return localVarFp.getOptionsStrategyQuote(requestParameters, options).then((request) => request(axios, basePath));
|
|
443
|
+
},
|
|
444
|
+
/**
|
|
445
|
+
*
|
|
446
|
+
* @summary Get the options holdings in the account
|
|
447
|
+
* @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
|
|
448
|
+
* @param {*} [options] Override http request option.
|
|
449
|
+
* @throws {RequiredError}
|
|
450
|
+
*/
|
|
451
|
+
listOptionHoldings(requestParameters, options) {
|
|
452
|
+
return localVarFp.listOptionHoldings(requestParameters, options).then((request) => request(axios, basePath));
|
|
453
|
+
},
|
|
454
|
+
/**
|
|
455
|
+
*
|
|
456
|
+
* @summary Place an option strategy order on the brokerage
|
|
457
|
+
* @param {OptionsApiPlaceOptionStrategyRequest} requestParameters Request parameters.
|
|
458
|
+
* @param {*} [options] Override http request option.
|
|
459
|
+
* @throws {RequiredError}
|
|
460
|
+
*/
|
|
461
|
+
placeOptionStrategy(requestParameters, options) {
|
|
462
|
+
return localVarFp.placeOptionStrategy(requestParameters, options).then((request) => request(axios, basePath));
|
|
463
|
+
},
|
|
464
|
+
};
|
|
465
|
+
};
|
|
466
|
+
exports.OptionsApiFactory = OptionsApiFactory;
|
|
467
|
+
/**
|
|
468
|
+
* OptionsApiGenerated - object-oriented interface
|
|
469
|
+
* @export
|
|
470
|
+
* @class OptionsApiGenerated
|
|
471
|
+
* @extends {BaseAPI}
|
|
472
|
+
*/
|
|
473
|
+
class OptionsApiGenerated extends base_1.BaseAPI {
|
|
474
|
+
/**
|
|
475
|
+
*
|
|
476
|
+
* @summary Creates an option strategy object that will be used to place an option strategy order
|
|
477
|
+
* @param {OptionsApiGetOptionStrategyRequest} requestParameters Request parameters.
|
|
478
|
+
* @param {*} [options] Override http request option.
|
|
479
|
+
* @throws {RequiredError}
|
|
480
|
+
* @memberof OptionsApiGenerated
|
|
481
|
+
*/
|
|
482
|
+
getOptionStrategy(requestParameters, options) {
|
|
483
|
+
return (0, exports.OptionsApiFp)(this.configuration).getOptionStrategy(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
*
|
|
487
|
+
* @summary Get the options chain
|
|
488
|
+
* @param {OptionsApiGetOptionsChainRequest} requestParameters Request parameters.
|
|
489
|
+
* @param {*} [options] Override http request option.
|
|
490
|
+
* @throws {RequiredError}
|
|
491
|
+
* @memberof OptionsApiGenerated
|
|
492
|
+
*/
|
|
493
|
+
getOptionsChain(requestParameters, options) {
|
|
494
|
+
return (0, exports.OptionsApiFp)(this.configuration).getOptionsChain(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
*
|
|
498
|
+
* @summary Get latest market data of option strategy
|
|
499
|
+
* @param {OptionsApiGetOptionsStrategyQuoteRequest} requestParameters Request parameters.
|
|
500
|
+
* @param {*} [options] Override http request option.
|
|
501
|
+
* @throws {RequiredError}
|
|
502
|
+
* @memberof OptionsApiGenerated
|
|
503
|
+
*/
|
|
504
|
+
getOptionsStrategyQuote(requestParameters, options) {
|
|
505
|
+
return (0, exports.OptionsApiFp)(this.configuration).getOptionsStrategyQuote(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
*
|
|
509
|
+
* @summary Get the options holdings in the account
|
|
510
|
+
* @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
|
|
511
|
+
* @param {*} [options] Override http request option.
|
|
512
|
+
* @throws {RequiredError}
|
|
513
|
+
* @memberof OptionsApiGenerated
|
|
514
|
+
*/
|
|
515
|
+
listOptionHoldings(requestParameters, options) {
|
|
516
|
+
return (0, exports.OptionsApiFp)(this.configuration).listOptionHoldings(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
*
|
|
520
|
+
* @summary Place an option strategy order on the brokerage
|
|
521
|
+
* @param {OptionsApiPlaceOptionStrategyRequest} requestParameters Request parameters.
|
|
522
|
+
* @param {*} [options] Override http request option.
|
|
523
|
+
* @throws {RequiredError}
|
|
524
|
+
* @memberof OptionsApiGenerated
|
|
525
|
+
*/
|
|
526
|
+
placeOptionStrategy(requestParameters, options) {
|
|
527
|
+
return (0, exports.OptionsApiFp)(this.configuration).placeOptionStrategy(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
exports.OptionsApiGenerated = OptionsApiGenerated;
|