snaptrade-typescript-sdk 2.4.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.konfig/generate-id.txt +1 -1
- package/.konfigignore +3 -1
- package/README.md +107 -23
- package/api/account-information-api.ts +1075 -0
- package/api/api-disclaimer-api.ts +190 -0
- package/api/api-status-api.ts +128 -0
- package/api/authentication-api.ts +591 -0
- package/api/connections-api.ts +425 -0
- package/api/error-logs-api.ts +175 -0
- package/api/options-api.ts +758 -0
- package/api/portfolio-management-api.ts +3402 -0
- package/api/reference-data-api.ts +1076 -0
- package/api/trading-api.ts +1339 -0
- package/api/transactions-and-reporting-api.ts +391 -0
- package/api.ts +12 -11530
- package/base.ts +1 -2
- package/client.ts +55 -0
- package/common.ts +16 -54
- package/configuration.ts +33 -10
- package/dist/api/account-information-api.d.ts +525 -0
- package/dist/api/account-information-api.js +1049 -0
- package/dist/api/api-disclaimer-api.d.ts +102 -0
- package/dist/api/api-disclaimer-api.js +245 -0
- package/dist/api/api-status-api.d.ts +70 -0
- package/dist/api/api-status-api.js +203 -0
- package/dist/api/authentication-api.d.ts +280 -0
- package/dist/api/authentication-api.js +659 -0
- package/dist/api/connections-api.d.ts +214 -0
- package/dist/api/connections-api.js +470 -0
- package/dist/api/error-logs-api.d.ts +94 -0
- package/dist/api/error-logs-api.js +240 -0
- package/dist/api/options-api.d.ts +381 -0
- package/dist/api/options-api.js +728 -0
- package/dist/api/portfolio-management-api.d.ts +1624 -0
- package/dist/api/portfolio-management-api.js +3574 -0
- package/dist/api/reference-data-api.d.ts +481 -0
- package/dist/api/reference-data-api.js +1244 -0
- package/dist/api/trading-api.d.ts +662 -0
- package/dist/api/trading-api.js +1276 -0
- package/dist/api/transactions-and-reporting-api.d.ts +204 -0
- package/dist/api/transactions-and-reporting-api.js +387 -0
- package/dist/api.d.ts +12 -7363
- package/dist/api.js +24 -9175
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -2
- package/dist/client.d.ts +27 -0
- package/dist/client.js +34 -0
- package/dist/common.d.ts +1 -6
- package/dist/common.js +26 -81
- package/dist/configuration.d.ts +21 -6
- package/dist/configuration.js +13 -8
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -2
- package/dist/index.test.js +84 -14
- package/dist/jest.config.js +0 -1
- package/dist/models/account-holdings.d.ts +47 -0
- package/dist/models/account-holdings.js +15 -0
- package/dist/models/account-order-record-status.d.ts +39 -0
- package/dist/models/account-order-record-status.js +43 -0
- package/dist/models/account-order-record.d.ts +126 -0
- package/dist/models/account-order-record.js +15 -0
- package/dist/models/account-simple.d.ts +37 -0
- package/dist/models/account-simple.js +15 -0
- package/dist/models/account.d.ts +76 -0
- package/dist/models/account.js +15 -0
- package/dist/models/action.d.ts +21 -0
- package/dist/models/action.js +25 -0
- package/dist/models/apidisclaimer-accept-request.d.ts +24 -0
- package/dist/models/apidisclaimer-accept-request.js +15 -0
- package/dist/models/authentication-login-snap-trade-user200-response.d.ts +18 -0
- package/dist/models/authentication-login-snap-trade-user200-response.js +15 -0
- package/dist/models/balance.d.ts +32 -0
- package/dist/models/balance.js +15 -0
- package/dist/models/brokerage-authorization-type-read-only-brokerage.d.ts +37 -0
- package/dist/models/brokerage-authorization-type-read-only-brokerage.js +15 -0
- package/dist/models/brokerage-authorization-type-read-only.d.ts +56 -0
- package/dist/models/brokerage-authorization-type-read-only.js +26 -0
- package/dist/models/brokerage-authorization-type.d.ts +30 -0
- package/dist/models/brokerage-authorization-type.js +20 -0
- package/dist/models/brokerage-authorization.d.ts +76 -0
- package/dist/models/brokerage-authorization.js +15 -0
- package/dist/models/brokerage-symbol.d.ts +51 -0
- package/dist/models/brokerage-symbol.js +15 -0
- package/dist/models/brokerage-type.d.ts +31 -0
- package/dist/models/brokerage-type.js +15 -0
- package/dist/models/brokerage.d.ts +128 -0
- package/dist/models/brokerage.js +15 -0
- package/dist/models/calculated-trade.d.ts +32 -0
- package/dist/models/calculated-trade.js +15 -0
- package/dist/models/cash-restriction.d.ts +54 -0
- package/dist/models/cash-restriction.js +20 -0
- package/dist/models/currency.d.ts +37 -0
- package/dist/models/currency.js +15 -0
- package/dist/models/delete-user-response.d.ts +31 -0
- package/dist/models/delete-user-response.js +15 -0
- package/dist/models/dividend-at-date.d.ts +37 -0
- package/dist/models/dividend-at-date.js +15 -0
- package/dist/models/encrypted-response-encrypted-message-data.d.ts +37 -0
- package/dist/models/encrypted-response-encrypted-message-data.js +15 -0
- package/dist/models/encrypted-response.d.ts +31 -0
- package/dist/models/encrypted-response.js +15 -0
- package/dist/models/exchange-rate-pairs.d.ts +38 -0
- package/dist/models/exchange-rate-pairs.js +15 -0
- package/dist/models/exchange.d.ts +67 -0
- package/dist/models/exchange.js +15 -0
- package/dist/models/excluded-asset.d.ts +26 -0
- package/dist/models/excluded-asset.js +15 -0
- package/dist/models/index.d.ts +102 -0
- package/dist/models/index.js +118 -0
- package/dist/models/jwt.d.ts +25 -0
- package/dist/models/jwt.js +15 -0
- package/dist/models/login-redirect-uri.d.ts +30 -0
- package/dist/models/login-redirect-uri.js +15 -0
- package/dist/models/manual-trade-and-impact.d.ts +39 -0
- package/dist/models/manual-trade-and-impact.js +15 -0
- package/dist/models/manual-trade-balance.d.ts +39 -0
- package/dist/models/manual-trade-balance.js +15 -0
- package/dist/models/manual-trade-form.d.ts +69 -0
- package/dist/models/manual-trade-form.js +15 -0
- package/dist/models/manual-trade-symbol.d.ts +56 -0
- package/dist/models/manual-trade-symbol.js +15 -0
- package/dist/models/manual-trade.d.ts +72 -0
- package/dist/models/manual-trade.js +15 -0
- package/dist/models/model-asset-class-details.d.ts +32 -0
- package/dist/models/model-asset-class-details.js +15 -0
- package/dist/models/model-asset-class-target.d.ts +26 -0
- package/dist/models/model-asset-class-target.js +15 -0
- package/dist/models/model-asset-class.d.ts +31 -0
- package/dist/models/model-asset-class.js +15 -0
- package/dist/models/model-portfolio-asset-class.d.ts +32 -0
- package/dist/models/model-portfolio-asset-class.js +15 -0
- package/dist/models/model-portfolio-details.d.ts +39 -0
- package/dist/models/model-portfolio-details.js +15 -0
- package/dist/models/model-portfolio-security.d.ts +32 -0
- package/dist/models/model-portfolio-security.js +15 -0
- package/dist/models/model-portfolio.d.ts +43 -0
- package/dist/models/model-portfolio.js +21 -0
- package/dist/models/model400-failed-request-response.d.ts +31 -0
- package/dist/models/model400-failed-request-response.js +15 -0
- package/dist/models/model401-failed-request-response.d.ts +31 -0
- package/dist/models/model401-failed-request-response.js +15 -0
- package/dist/models/model403-failed-request-response.d.ts +31 -0
- package/dist/models/model403-failed-request-response.js +15 -0
- package/dist/models/model404-failed-request-response.d.ts +31 -0
- package/dist/models/model404-failed-request-response.js +15 -0
- package/dist/models/monthly-dividends.d.ts +32 -0
- package/dist/models/monthly-dividends.js +15 -0
- package/dist/models/net-contributions.d.ts +37 -0
- package/dist/models/net-contributions.js +15 -0
- package/dist/models/net-dividend.d.ts +38 -0
- package/dist/models/net-dividend.js +15 -0
- package/dist/models/option-chain-inner-chain-per-root-inner-chain-per-strike-price-inner.d.ts +37 -0
- package/dist/models/option-chain-inner-chain-per-root-inner-chain-per-strike-price-inner.js +15 -0
- package/dist/models/option-chain-inner-chain-per-root-inner.d.ts +38 -0
- package/dist/models/option-chain-inner-chain-per-root-inner.js +15 -0
- package/dist/models/option-chain-inner.d.ts +50 -0
- package/dist/models/option-chain-inner.js +15 -0
- package/dist/models/option-leg.d.ts +44 -0
- package/dist/models/option-leg.js +22 -0
- package/dist/models/option-strategy-legs-inner.d.ts +42 -0
- package/dist/models/option-strategy-legs-inner.js +15 -0
- package/dist/models/option-strategy.d.ts +51 -0
- package/dist/models/option-strategy.js +15 -0
- package/dist/models/options-get-option-strategy-request.d.ts +41 -0
- package/dist/models/options-get-option-strategy-request.js +19 -0
- package/dist/models/options-holdings.d.ts +57 -0
- package/dist/models/options-holdings.js +15 -0
- package/dist/models/options-place-option-strategy-request.d.ts +48 -0
- package/dist/models/options-place-option-strategy-request.js +26 -0
- package/dist/models/options-position.d.ts +63 -0
- package/dist/models/options-position.js +15 -0
- package/dist/models/options-symbol.d.ts +86 -0
- package/dist/models/options-symbol.js +15 -0
- package/dist/models/order-type.d.ts +23 -0
- package/dist/models/order-type.js +27 -0
- package/dist/models/partner-data.d.ts +92 -0
- package/dist/models/partner-data.js +15 -0
- package/dist/models/past-value.d.ts +37 -0
- package/dist/models/past-value.js +15 -0
- package/dist/models/performance-custom.d.ts +138 -0
- package/dist/models/performance-custom.js +15 -0
- package/dist/models/portfolio-group-info.d.ts +93 -0
- package/dist/models/portfolio-group-info.js +15 -0
- package/dist/models/portfolio-group-position.d.ts +38 -0
- package/dist/models/portfolio-group-position.js +15 -0
- package/dist/models/portfolio-group-settings.d.ts +50 -0
- package/dist/models/portfolio-group-settings.js +15 -0
- package/dist/models/portfolio-group.d.ts +31 -0
- package/dist/models/portfolio-group.js +15 -0
- package/dist/models/position-symbol.d.ts +56 -0
- package/dist/models/position-symbol.js +15 -0
- package/dist/models/position.d.ts +56 -0
- package/dist/models/position.js +15 -0
- package/dist/models/redirect-tokenand-pin.d.ts +31 -0
- package/dist/models/redirect-tokenand-pin.js +15 -0
- package/dist/models/security-type.d.ts +43 -0
- package/dist/models/security-type.js +15 -0
- package/dist/models/snap-trade-apidisclaimer-accept-status.d.ts +31 -0
- package/dist/models/snap-trade-apidisclaimer-accept-status.js +15 -0
- package/dist/models/snap-trade-holdings-account.d.ts +64 -0
- package/dist/models/snap-trade-holdings-account.js +15 -0
- package/dist/models/snap-trade-holdings-total-value.d.ts +31 -0
- package/dist/models/snap-trade-holdings-total-value.js +15 -0
- package/dist/models/snap-trade-login-user-request-body.d.ts +53 -0
- package/dist/models/snap-trade-login-user-request-body.js +20 -0
- package/dist/models/snap-trade-register-user-request-body.d.ts +30 -0
- package/dist/models/snap-trade-register-user-request-body.js +15 -0
- package/dist/models/status.d.ts +37 -0
- package/dist/models/status.js +15 -0
- package/dist/models/strategy-impact-legs-inner.d.ts +61 -0
- package/dist/models/strategy-impact-legs-inner.js +15 -0
- package/dist/models/strategy-impact.d.ts +86 -0
- package/dist/models/strategy-impact.js +15 -0
- package/dist/models/strategy-order-place-orders-inner-legs-inner.d.ts +61 -0
- package/dist/models/strategy-order-place-orders-inner-legs-inner.js +15 -0
- package/dist/models/strategy-order-place-orders-inner.d.ts +278 -0
- package/dist/models/strategy-order-place-orders-inner.js +15 -0
- package/dist/models/strategy-order-place.d.ts +32 -0
- package/dist/models/strategy-order-place.js +15 -0
- package/dist/models/strategy-order-record.d.ts +120 -0
- package/dist/models/strategy-order-record.js +47 -0
- package/dist/models/strategy-quotes-greek.d.ts +49 -0
- package/dist/models/strategy-quotes-greek.js +15 -0
- package/dist/models/strategy-quotes.d.ts +57 -0
- package/dist/models/strategy-quotes.js +15 -0
- package/dist/models/sub-period-return-rate.d.ts +37 -0
- package/dist/models/sub-period-return-rate.js +15 -0
- package/dist/models/symbol-query.d.ts +24 -0
- package/dist/models/symbol-query.js +15 -0
- package/dist/models/symbol.d.ts +51 -0
- package/dist/models/symbol.js +15 -0
- package/dist/models/symbols-quotes.d.ts +56 -0
- package/dist/models/symbols-quotes.js +15 -0
- package/dist/models/target-asset.d.ts +55 -0
- package/dist/models/target-asset.js +15 -0
- package/dist/models/time-in-force.d.ts +22 -0
- package/dist/models/time-in-force.js +26 -0
- package/dist/models/trade-execution-status.d.ts +91 -0
- package/dist/models/trade-execution-status.js +27 -0
- package/dist/models/trade-impact.d.ts +51 -0
- package/dist/models/trade-impact.js +15 -0
- package/dist/models/trade.d.ts +74 -0
- package/dist/models/trade.js +20 -0
- package/dist/models/trading-place-ocoorder-request.d.ts +30 -0
- package/dist/models/trading-place-ocoorder-request.js +15 -0
- package/dist/models/underlying-symbol.d.ts +64 -0
- package/dist/models/underlying-symbol.js +15 -0
- package/dist/models/universal-activity.d.ts +134 -0
- package/dist/models/universal-activity.js +36 -0
- package/dist/models/universal-symbol-ticker.d.ts +70 -0
- package/dist/models/universal-symbol-ticker.js +15 -0
- package/dist/models/universal-symbol.d.ts +69 -0
- package/dist/models/universal-symbol.js +15 -0
- package/dist/models/user-error-log.d.ts +55 -0
- package/dist/models/user-error-log.js +15 -0
- package/dist/models/user-idand-secret.d.ts +31 -0
- package/dist/models/user-idand-secret.js +15 -0
- package/dist/models/user-settings.d.ts +80 -0
- package/dist/models/user-settings.js +15 -0
- package/dist/models/usexchange.d.ts +73 -0
- package/dist/models/usexchange.js +15 -0
- package/dist/pagination/page.d.ts +31 -0
- package/dist/pagination/page.js +58 -0
- package/dist/pagination/pageable.d.ts +53 -0
- package/dist/pagination/pageable.js +128 -0
- package/dist/pagination/paginate.d.ts +17 -0
- package/dist/pagination/paginate.js +78 -0
- package/dist/requestAfterHook.d.ts +8 -0
- package/dist/requestAfterHook.js +45 -0
- package/dist/requestBeforeHook.d.ts +8 -0
- package/dist/requestBeforeHook.js +8 -0
- package/docs/AccountInformationApi.md +485 -0
- package/docs/ApiDisclaimerApi.md +69 -0
- package/docs/ApiStatusApi.md +60 -0
- package/docs/AuthenticationApi.md +307 -0
- package/docs/ConnectionsApi.md +186 -0
- package/docs/ErrorLogsApi.md +65 -0
- package/docs/OptionsApi.md +321 -0
- package/docs/PortfolioManagementApi.md +1866 -0
- package/docs/ReferenceDataApi.md +597 -0
- package/docs/TradingApi.md +629 -0
- package/docs/TransactionsAndReportingApi.md +141 -0
- package/index.test.ts +62 -13
- package/index.ts +3 -3
- package/models/account-holdings.ts +61 -0
- package/models/account-order-record-status.ts +48 -0
- package/models/account-order-record.ts +142 -0
- package/models/account-simple.ts +43 -0
- package/models/account.ts +82 -0
- package/models/action.ts +30 -0
- package/models/apidisclaimer-accept-request.ts +29 -0
- package/models/authentication-login-snap-trade-user200-response.ts +31 -0
- package/models/balance.ts +40 -0
- package/models/brokerage-authorization-type-read-only-brokerage.ts +43 -0
- package/models/brokerage-authorization-type-read-only.ts +68 -0
- package/models/brokerage-authorization-type.ts +39 -0
- package/models/brokerage-authorization.ts +82 -0
- package/models/brokerage-symbol.ts +61 -0
- package/models/brokerage-type.ts +37 -0
- package/models/brokerage.ts +136 -0
- package/models/calculated-trade.ts +40 -0
- package/models/cash-restriction.ts +63 -0
- package/models/currency.ts +43 -0
- package/models/delete-user-response.ts +37 -0
- package/models/dividend-at-date.ts +43 -0
- package/models/encrypted-response-encrypted-message-data.ts +43 -0
- package/models/encrypted-response.ts +38 -0
- package/models/exchange-rate-pairs.ts +46 -0
- package/models/exchange.ts +73 -0
- package/models/excluded-asset.ts +34 -0
- package/models/index.ts +102 -0
- package/models/jwt.ts +31 -0
- package/models/login-redirect-uri.ts +35 -0
- package/models/manual-trade-and-impact.ts +49 -0
- package/models/manual-trade-balance.ts +49 -0
- package/models/manual-trade-form.ts +80 -0
- package/models/manual-trade-symbol.ts +64 -0
- package/models/manual-trade.ts +88 -0
- package/models/model-asset-class-details.ts +41 -0
- package/models/model-asset-class-target.ts +34 -0
- package/models/model-asset-class.ts +37 -0
- package/models/model-portfolio-asset-class.ts +40 -0
- package/models/model-portfolio-details.ts +50 -0
- package/models/model-portfolio-security.ts +40 -0
- package/models/model-portfolio.ts +52 -0
- package/models/model400-failed-request-response.ts +37 -0
- package/models/model401-failed-request-response.ts +37 -0
- package/models/model403-failed-request-response.ts +37 -0
- package/models/model404-failed-request-response.ts +37 -0
- package/models/monthly-dividends.ts +40 -0
- package/models/net-contributions.ts +43 -0
- package/models/net-dividend.ts +46 -0
- package/models/option-chain-inner-chain-per-root-inner-chain-per-strike-price-inner.ts +43 -0
- package/models/option-chain-inner-chain-per-root-inner.ts +46 -0
- package/models/option-chain-inner.ts +58 -0
- package/models/option-leg.ts +53 -0
- package/models/option-strategy-legs-inner.ts +47 -0
- package/models/option-strategy.ts +61 -0
- package/models/options-get-option-strategy-request.ts +51 -0
- package/models/options-holdings.ts +67 -0
- package/models/options-place-option-strategy-request.ts +57 -0
- package/models/options-position.ts +73 -0
- package/models/options-symbol.ts +94 -0
- package/models/order-type.ts +32 -0
- package/models/partner-data.ts +100 -0
- package/models/past-value.ts +43 -0
- package/models/performance-custom.ts +154 -0
- package/models/portfolio-group-info.ts +115 -0
- package/models/portfolio-group-position.ts +46 -0
- package/models/portfolio-group-settings.ts +58 -0
- package/models/portfolio-group.ts +37 -0
- package/models/position-symbol.ts +64 -0
- package/models/position.ts +64 -0
- package/models/redirect-tokenand-pin.ts +37 -0
- package/models/security-type.ts +49 -0
- package/models/snap-trade-apidisclaimer-accept-status.ts +37 -0
- package/models/snap-trade-holdings-account.ts +70 -0
- package/models/snap-trade-holdings-total-value.ts +37 -0
- package/models/snap-trade-login-user-request-body.ts +61 -0
- package/models/snap-trade-register-user-request-body.ts +35 -0
- package/models/status.ts +43 -0
- package/models/strategy-impact-legs-inner.ts +67 -0
- package/models/strategy-impact.ts +94 -0
- package/models/strategy-order-place-orders-inner-legs-inner.ts +67 -0
- package/models/strategy-order-place-orders-inner.ts +286 -0
- package/models/strategy-order-place.ts +40 -0
- package/models/strategy-order-record.ts +133 -0
- package/models/strategy-quotes-greek.ts +55 -0
- package/models/strategy-quotes.ts +67 -0
- package/models/sub-period-return-rate.ts +43 -0
- package/models/symbol-query.ts +29 -0
- package/models/symbol.ts +61 -0
- package/models/symbols-quotes.ts +64 -0
- package/models/target-asset.ts +62 -0
- package/models/time-in-force.ts +31 -0
- package/models/trade-execution-status.ts +105 -0
- package/models/trade-impact.ts +61 -0
- package/models/trade.ts +88 -0
- package/models/trading-place-ocoorder-request.ts +35 -0
- package/models/underlying-symbol.ts +76 -0
- package/models/universal-activity.ts +151 -0
- package/models/universal-symbol-ticker.ts +82 -0
- package/models/universal-symbol.ts +80 -0
- package/models/user-error-log.ts +61 -0
- package/models/user-idand-secret.ts +37 -0
- package/models/user-settings.ts +88 -0
- package/models/usexchange.ts +79 -0
- package/package.json +1 -1
- package/pagination/page.ts +50 -0
- package/pagination/pageable.ts +107 -0
- package/pagination/paginate.ts +40 -0
- package/requestAfterHook.ts +53 -0
- package/requestBeforeHook.ts +14 -0
- package/tsconfig.json +0 -1
- package/dist/api.js.map +0 -1
- package/dist/base.js.map +0 -1
- package/dist/common.js.map +0 -1
- package/dist/configuration.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.test.js.map +0 -1
- package/dist/jest.config.js.map +0 -1
- package/git_push.sh +0 -57
|
@@ -0,0 +1,728 @@
|
|
|
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
|
+
* https://konfigthis.com
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __extends = (this && this.__extends) || (function () {
|
|
16
|
+
var extendStatics = function (d, b) {
|
|
17
|
+
extendStatics = Object.setPrototypeOf ||
|
|
18
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
19
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
20
|
+
return extendStatics(d, b);
|
|
21
|
+
};
|
|
22
|
+
return function (d, b) {
|
|
23
|
+
if (typeof b !== "function" && b !== null)
|
|
24
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
25
|
+
extendStatics(d, b);
|
|
26
|
+
function __() { this.constructor = d; }
|
|
27
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
+
};
|
|
29
|
+
})();
|
|
30
|
+
var __assign = (this && this.__assign) || function () {
|
|
31
|
+
__assign = Object.assign || function(t) {
|
|
32
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
33
|
+
s = arguments[i];
|
|
34
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
35
|
+
t[p] = s[p];
|
|
36
|
+
}
|
|
37
|
+
return t;
|
|
38
|
+
};
|
|
39
|
+
return __assign.apply(this, arguments);
|
|
40
|
+
};
|
|
41
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
42
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
43
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
44
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
45
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
46
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
47
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
51
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
52
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
53
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
54
|
+
function step(op) {
|
|
55
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
56
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
57
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
58
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
59
|
+
switch (op[0]) {
|
|
60
|
+
case 0: case 1: t = op; break;
|
|
61
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
62
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
63
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
64
|
+
default:
|
|
65
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
66
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
67
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
68
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
69
|
+
if (t[2]) _.ops.pop();
|
|
70
|
+
_.trys.pop(); continue;
|
|
71
|
+
}
|
|
72
|
+
op = body.call(thisArg, _);
|
|
73
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
74
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
78
|
+
exports.OptionsApi = exports.OptionsApiFactory = exports.OptionsApiFp = exports.OptionsApiAxiosParamCreator = void 0;
|
|
79
|
+
var axios_1 = require("axios");
|
|
80
|
+
// Some imports not used depending on template conditions
|
|
81
|
+
// @ts-ignore
|
|
82
|
+
var common_1 = require("../common");
|
|
83
|
+
// @ts-ignore
|
|
84
|
+
var base_1 = require("../base");
|
|
85
|
+
var requestBeforeHook_1 = require("../requestBeforeHook");
|
|
86
|
+
/**
|
|
87
|
+
* OptionsApi - axios parameter creator
|
|
88
|
+
* @export
|
|
89
|
+
*/
|
|
90
|
+
var OptionsApiAxiosParamCreator = function (configuration) {
|
|
91
|
+
var _this = this;
|
|
92
|
+
return {
|
|
93
|
+
/**
|
|
94
|
+
*
|
|
95
|
+
* @summary Creates an option strategy object that will be used to place an option strategy order
|
|
96
|
+
* @param {string} userId
|
|
97
|
+
* @param {string} userSecret
|
|
98
|
+
* @param {string} accountId The ID of the account get positions.
|
|
99
|
+
* @param {OptionsGetOptionStrategyRequest} optionsGetOptionStrategyRequest
|
|
100
|
+
* @param {*} [options] Override http request option.
|
|
101
|
+
* @throws {RequiredError}
|
|
102
|
+
*/
|
|
103
|
+
getOptionStrategy: function (userId, userSecret, accountId, optionsGetOptionStrategyRequest, options) {
|
|
104
|
+
if (options === void 0) { options = {}; }
|
|
105
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
106
|
+
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
107
|
+
return __generator(this, function (_a) {
|
|
108
|
+
switch (_a.label) {
|
|
109
|
+
case 0:
|
|
110
|
+
// verify required parameter 'userId' is not null or undefined
|
|
111
|
+
(0, common_1.assertParamExists)('getOptionStrategy', 'userId', userId);
|
|
112
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
113
|
+
(0, common_1.assertParamExists)('getOptionStrategy', 'userSecret', userSecret);
|
|
114
|
+
// verify required parameter 'accountId' is not null or undefined
|
|
115
|
+
(0, common_1.assertParamExists)('getOptionStrategy', 'accountId', accountId);
|
|
116
|
+
// verify required parameter 'optionsGetOptionStrategyRequest' is not null or undefined
|
|
117
|
+
(0, common_1.assertParamExists)('getOptionStrategy', 'optionsGetOptionStrategyRequest', optionsGetOptionStrategyRequest);
|
|
118
|
+
localVarPath = "/accounts/{accountId}/optionStrategy"
|
|
119
|
+
.replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)));
|
|
120
|
+
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
121
|
+
if (configuration) {
|
|
122
|
+
baseOptions = configuration.baseOptions;
|
|
123
|
+
}
|
|
124
|
+
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
|
|
125
|
+
localVarHeaderParameter = configuration ? { "User-Agent": configuration.userAgent } : {};
|
|
126
|
+
localVarQueryParameter = {};
|
|
127
|
+
// authentication PartnerClientId required
|
|
128
|
+
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarQueryParameter, "clientId", configuration)
|
|
129
|
+
// authentication PartnerSignature required
|
|
130
|
+
];
|
|
131
|
+
case 1:
|
|
132
|
+
// authentication PartnerClientId required
|
|
133
|
+
_a.sent();
|
|
134
|
+
// authentication PartnerSignature required
|
|
135
|
+
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Signature", configuration)
|
|
136
|
+
// authentication PartnerTimestamp required
|
|
137
|
+
];
|
|
138
|
+
case 2:
|
|
139
|
+
// authentication PartnerSignature required
|
|
140
|
+
_a.sent();
|
|
141
|
+
// authentication PartnerTimestamp required
|
|
142
|
+
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarQueryParameter, "timestamp", configuration)];
|
|
143
|
+
case 3:
|
|
144
|
+
// authentication PartnerTimestamp required
|
|
145
|
+
_a.sent();
|
|
146
|
+
if (userId !== undefined) {
|
|
147
|
+
localVarQueryParameter['userId'] = userId;
|
|
148
|
+
}
|
|
149
|
+
if (userSecret !== undefined) {
|
|
150
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
151
|
+
}
|
|
152
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
153
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
154
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
155
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(optionsGetOptionStrategyRequest, localVarRequestOptions, configuration);
|
|
156
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
157
|
+
queryParameters: localVarQueryParameter,
|
|
158
|
+
requestConfig: localVarRequestOptions,
|
|
159
|
+
path: localVarPath,
|
|
160
|
+
configuration: configuration
|
|
161
|
+
});
|
|
162
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
163
|
+
return [2 /*return*/, {
|
|
164
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
165
|
+
options: localVarRequestOptions,
|
|
166
|
+
}];
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
},
|
|
171
|
+
/**
|
|
172
|
+
*
|
|
173
|
+
* @summary Get the options chain
|
|
174
|
+
* @param {string} userId
|
|
175
|
+
* @param {string} userSecret
|
|
176
|
+
* @param {string} accountId The ID of the account get positions.
|
|
177
|
+
* @param {string} symbol Universal symbol ID if symbol
|
|
178
|
+
* @param {*} [options] Override http request option.
|
|
179
|
+
* @throws {RequiredError}
|
|
180
|
+
*/
|
|
181
|
+
getOptionsChain: function (userId, userSecret, accountId, symbol, options) {
|
|
182
|
+
if (options === void 0) { options = {}; }
|
|
183
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
184
|
+
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
185
|
+
return __generator(this, function (_a) {
|
|
186
|
+
switch (_a.label) {
|
|
187
|
+
case 0:
|
|
188
|
+
// verify required parameter 'userId' is not null or undefined
|
|
189
|
+
(0, common_1.assertParamExists)('getOptionsChain', 'userId', userId);
|
|
190
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
191
|
+
(0, common_1.assertParamExists)('getOptionsChain', 'userSecret', userSecret);
|
|
192
|
+
// verify required parameter 'accountId' is not null or undefined
|
|
193
|
+
(0, common_1.assertParamExists)('getOptionsChain', 'accountId', accountId);
|
|
194
|
+
// verify required parameter 'symbol' is not null or undefined
|
|
195
|
+
(0, common_1.assertParamExists)('getOptionsChain', 'symbol', symbol);
|
|
196
|
+
localVarPath = "/accounts/{accountId}/optionsChain"
|
|
197
|
+
.replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)));
|
|
198
|
+
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
199
|
+
if (configuration) {
|
|
200
|
+
baseOptions = configuration.baseOptions;
|
|
201
|
+
}
|
|
202
|
+
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
|
|
203
|
+
localVarHeaderParameter = configuration ? { "User-Agent": configuration.userAgent } : {};
|
|
204
|
+
localVarQueryParameter = {};
|
|
205
|
+
// authentication PartnerClientId required
|
|
206
|
+
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarQueryParameter, "clientId", configuration)
|
|
207
|
+
// authentication PartnerSignature required
|
|
208
|
+
];
|
|
209
|
+
case 1:
|
|
210
|
+
// authentication PartnerClientId required
|
|
211
|
+
_a.sent();
|
|
212
|
+
// authentication PartnerSignature required
|
|
213
|
+
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Signature", configuration)
|
|
214
|
+
// authentication PartnerTimestamp required
|
|
215
|
+
];
|
|
216
|
+
case 2:
|
|
217
|
+
// authentication PartnerSignature required
|
|
218
|
+
_a.sent();
|
|
219
|
+
// authentication PartnerTimestamp required
|
|
220
|
+
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarQueryParameter, "timestamp", configuration)];
|
|
221
|
+
case 3:
|
|
222
|
+
// authentication PartnerTimestamp required
|
|
223
|
+
_a.sent();
|
|
224
|
+
if (userId !== undefined) {
|
|
225
|
+
localVarQueryParameter['userId'] = userId;
|
|
226
|
+
}
|
|
227
|
+
if (userSecret !== undefined) {
|
|
228
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
229
|
+
}
|
|
230
|
+
if (symbol !== undefined) {
|
|
231
|
+
localVarQueryParameter['symbol'] = symbol;
|
|
232
|
+
}
|
|
233
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
234
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
235
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
236
|
+
queryParameters: localVarQueryParameter,
|
|
237
|
+
requestConfig: localVarRequestOptions,
|
|
238
|
+
path: localVarPath,
|
|
239
|
+
configuration: configuration
|
|
240
|
+
});
|
|
241
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
242
|
+
return [2 /*return*/, {
|
|
243
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
244
|
+
options: localVarRequestOptions,
|
|
245
|
+
}];
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
},
|
|
250
|
+
/**
|
|
251
|
+
*
|
|
252
|
+
* @summary Get latest market data of option strategy
|
|
253
|
+
* @param {string} userId
|
|
254
|
+
* @param {string} userSecret
|
|
255
|
+
* @param {string} accountId The ID of the account get positions.
|
|
256
|
+
* @param {string} optionStrategyId Option strategy id obtained from response when creating option strategy object
|
|
257
|
+
* @param {*} [options] Override http request option.
|
|
258
|
+
* @throws {RequiredError}
|
|
259
|
+
*/
|
|
260
|
+
getOptionsStrategyQuote: function (userId, userSecret, accountId, optionStrategyId, options) {
|
|
261
|
+
if (options === void 0) { options = {}; }
|
|
262
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
263
|
+
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
264
|
+
return __generator(this, function (_a) {
|
|
265
|
+
switch (_a.label) {
|
|
266
|
+
case 0:
|
|
267
|
+
// verify required parameter 'userId' is not null or undefined
|
|
268
|
+
(0, common_1.assertParamExists)('getOptionsStrategyQuote', 'userId', userId);
|
|
269
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
270
|
+
(0, common_1.assertParamExists)('getOptionsStrategyQuote', 'userSecret', userSecret);
|
|
271
|
+
// verify required parameter 'accountId' is not null or undefined
|
|
272
|
+
(0, common_1.assertParamExists)('getOptionsStrategyQuote', 'accountId', accountId);
|
|
273
|
+
// verify required parameter 'optionStrategyId' is not null or undefined
|
|
274
|
+
(0, common_1.assertParamExists)('getOptionsStrategyQuote', 'optionStrategyId', optionStrategyId);
|
|
275
|
+
localVarPath = "/accounts/{accountId}/optionStrategy/{optionStrategyId}"
|
|
276
|
+
.replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)))
|
|
277
|
+
.replace("{".concat("optionStrategyId", "}"), encodeURIComponent(String(optionStrategyId)));
|
|
278
|
+
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
279
|
+
if (configuration) {
|
|
280
|
+
baseOptions = configuration.baseOptions;
|
|
281
|
+
}
|
|
282
|
+
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
|
|
283
|
+
localVarHeaderParameter = configuration ? { "User-Agent": configuration.userAgent } : {};
|
|
284
|
+
localVarQueryParameter = {};
|
|
285
|
+
// authentication PartnerClientId required
|
|
286
|
+
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarQueryParameter, "clientId", configuration)
|
|
287
|
+
// authentication PartnerSignature required
|
|
288
|
+
];
|
|
289
|
+
case 1:
|
|
290
|
+
// authentication PartnerClientId required
|
|
291
|
+
_a.sent();
|
|
292
|
+
// authentication PartnerSignature required
|
|
293
|
+
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Signature", configuration)
|
|
294
|
+
// authentication PartnerTimestamp required
|
|
295
|
+
];
|
|
296
|
+
case 2:
|
|
297
|
+
// authentication PartnerSignature required
|
|
298
|
+
_a.sent();
|
|
299
|
+
// authentication PartnerTimestamp required
|
|
300
|
+
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarQueryParameter, "timestamp", configuration)];
|
|
301
|
+
case 3:
|
|
302
|
+
// authentication PartnerTimestamp required
|
|
303
|
+
_a.sent();
|
|
304
|
+
if (userId !== undefined) {
|
|
305
|
+
localVarQueryParameter['userId'] = userId;
|
|
306
|
+
}
|
|
307
|
+
if (userSecret !== undefined) {
|
|
308
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
309
|
+
}
|
|
310
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
311
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
312
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
313
|
+
queryParameters: localVarQueryParameter,
|
|
314
|
+
requestConfig: localVarRequestOptions,
|
|
315
|
+
path: localVarPath,
|
|
316
|
+
configuration: configuration
|
|
317
|
+
});
|
|
318
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
319
|
+
return [2 /*return*/, {
|
|
320
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
321
|
+
options: localVarRequestOptions,
|
|
322
|
+
}];
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
},
|
|
327
|
+
/**
|
|
328
|
+
*
|
|
329
|
+
* @summary Get the options holdings in the account
|
|
330
|
+
* @param {string} userId
|
|
331
|
+
* @param {string} userSecret
|
|
332
|
+
* @param {string} accountId The ID of the account get positions.
|
|
333
|
+
* @param {*} [options] Override http request option.
|
|
334
|
+
* @throws {RequiredError}
|
|
335
|
+
*/
|
|
336
|
+
listOptionHoldings: function (userId, userSecret, accountId, options) {
|
|
337
|
+
if (options === void 0) { options = {}; }
|
|
338
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
339
|
+
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
340
|
+
return __generator(this, function (_a) {
|
|
341
|
+
switch (_a.label) {
|
|
342
|
+
case 0:
|
|
343
|
+
// verify required parameter 'userId' is not null or undefined
|
|
344
|
+
(0, common_1.assertParamExists)('listOptionHoldings', 'userId', userId);
|
|
345
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
346
|
+
(0, common_1.assertParamExists)('listOptionHoldings', 'userSecret', userSecret);
|
|
347
|
+
// verify required parameter 'accountId' is not null or undefined
|
|
348
|
+
(0, common_1.assertParamExists)('listOptionHoldings', 'accountId', accountId);
|
|
349
|
+
localVarPath = "/accounts/{accountId}/options"
|
|
350
|
+
.replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)));
|
|
351
|
+
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
352
|
+
if (configuration) {
|
|
353
|
+
baseOptions = configuration.baseOptions;
|
|
354
|
+
}
|
|
355
|
+
localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
|
|
356
|
+
localVarHeaderParameter = configuration ? { "User-Agent": configuration.userAgent } : {};
|
|
357
|
+
localVarQueryParameter = {};
|
|
358
|
+
// authentication PartnerClientId required
|
|
359
|
+
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarQueryParameter, "clientId", configuration)
|
|
360
|
+
// authentication PartnerSignature required
|
|
361
|
+
];
|
|
362
|
+
case 1:
|
|
363
|
+
// authentication PartnerClientId required
|
|
364
|
+
_a.sent();
|
|
365
|
+
// authentication PartnerSignature required
|
|
366
|
+
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Signature", configuration)
|
|
367
|
+
// authentication PartnerTimestamp required
|
|
368
|
+
];
|
|
369
|
+
case 2:
|
|
370
|
+
// authentication PartnerSignature required
|
|
371
|
+
_a.sent();
|
|
372
|
+
// authentication PartnerTimestamp required
|
|
373
|
+
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarQueryParameter, "timestamp", configuration)];
|
|
374
|
+
case 3:
|
|
375
|
+
// authentication PartnerTimestamp required
|
|
376
|
+
_a.sent();
|
|
377
|
+
if (userId !== undefined) {
|
|
378
|
+
localVarQueryParameter['userId'] = userId;
|
|
379
|
+
}
|
|
380
|
+
if (userSecret !== undefined) {
|
|
381
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
382
|
+
}
|
|
383
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
384
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
385
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
386
|
+
queryParameters: localVarQueryParameter,
|
|
387
|
+
requestConfig: localVarRequestOptions,
|
|
388
|
+
path: localVarPath,
|
|
389
|
+
configuration: configuration
|
|
390
|
+
});
|
|
391
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
392
|
+
return [2 /*return*/, {
|
|
393
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
394
|
+
options: localVarRequestOptions,
|
|
395
|
+
}];
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
},
|
|
400
|
+
/**
|
|
401
|
+
*
|
|
402
|
+
* @summary Place an option strategy order on the brokerage
|
|
403
|
+
* @param {string} userId
|
|
404
|
+
* @param {string} userSecret
|
|
405
|
+
* @param {string} accountId The ID of the account get positions.
|
|
406
|
+
* @param {string} optionStrategyId Option strategy id obtained from response when creating option strategy object
|
|
407
|
+
* @param {OptionsPlaceOptionStrategyRequest} optionsPlaceOptionStrategyRequest
|
|
408
|
+
* @param {*} [options] Override http request option.
|
|
409
|
+
* @throws {RequiredError}
|
|
410
|
+
*/
|
|
411
|
+
placeOptionStrategy: function (userId, userSecret, accountId, optionStrategyId, optionsPlaceOptionStrategyRequest, options) {
|
|
412
|
+
if (options === void 0) { options = {}; }
|
|
413
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
414
|
+
var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
415
|
+
return __generator(this, function (_a) {
|
|
416
|
+
switch (_a.label) {
|
|
417
|
+
case 0:
|
|
418
|
+
// verify required parameter 'userId' is not null or undefined
|
|
419
|
+
(0, common_1.assertParamExists)('placeOptionStrategy', 'userId', userId);
|
|
420
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
421
|
+
(0, common_1.assertParamExists)('placeOptionStrategy', 'userSecret', userSecret);
|
|
422
|
+
// verify required parameter 'accountId' is not null or undefined
|
|
423
|
+
(0, common_1.assertParamExists)('placeOptionStrategy', 'accountId', accountId);
|
|
424
|
+
// verify required parameter 'optionStrategyId' is not null or undefined
|
|
425
|
+
(0, common_1.assertParamExists)('placeOptionStrategy', 'optionStrategyId', optionStrategyId);
|
|
426
|
+
// verify required parameter 'optionsPlaceOptionStrategyRequest' is not null or undefined
|
|
427
|
+
(0, common_1.assertParamExists)('placeOptionStrategy', 'optionsPlaceOptionStrategyRequest', optionsPlaceOptionStrategyRequest);
|
|
428
|
+
localVarPath = "/accounts/{accountId}/optionStrategy/{optionStrategyId}/execute"
|
|
429
|
+
.replace("{".concat("accountId", "}"), encodeURIComponent(String(accountId)))
|
|
430
|
+
.replace("{".concat("optionStrategyId", "}"), encodeURIComponent(String(optionStrategyId)));
|
|
431
|
+
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
432
|
+
if (configuration) {
|
|
433
|
+
baseOptions = configuration.baseOptions;
|
|
434
|
+
}
|
|
435
|
+
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
|
|
436
|
+
localVarHeaderParameter = configuration ? { "User-Agent": configuration.userAgent } : {};
|
|
437
|
+
localVarQueryParameter = {};
|
|
438
|
+
// authentication PartnerClientId required
|
|
439
|
+
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarQueryParameter, "clientId", configuration)
|
|
440
|
+
// authentication PartnerSignature required
|
|
441
|
+
];
|
|
442
|
+
case 1:
|
|
443
|
+
// authentication PartnerClientId required
|
|
444
|
+
_a.sent();
|
|
445
|
+
// authentication PartnerSignature required
|
|
446
|
+
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Signature", configuration)
|
|
447
|
+
// authentication PartnerTimestamp required
|
|
448
|
+
];
|
|
449
|
+
case 2:
|
|
450
|
+
// authentication PartnerSignature required
|
|
451
|
+
_a.sent();
|
|
452
|
+
// authentication PartnerTimestamp required
|
|
453
|
+
return [4 /*yield*/, (0, common_1.setApiKeyToObject)(localVarQueryParameter, "timestamp", configuration)];
|
|
454
|
+
case 3:
|
|
455
|
+
// authentication PartnerTimestamp required
|
|
456
|
+
_a.sent();
|
|
457
|
+
if (userId !== undefined) {
|
|
458
|
+
localVarQueryParameter['userId'] = userId;
|
|
459
|
+
}
|
|
460
|
+
if (userSecret !== undefined) {
|
|
461
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
462
|
+
}
|
|
463
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
464
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
465
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
466
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(optionsPlaceOptionStrategyRequest, localVarRequestOptions, configuration);
|
|
467
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
468
|
+
queryParameters: localVarQueryParameter,
|
|
469
|
+
requestConfig: localVarRequestOptions,
|
|
470
|
+
path: localVarPath,
|
|
471
|
+
configuration: configuration
|
|
472
|
+
});
|
|
473
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
474
|
+
return [2 /*return*/, {
|
|
475
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
476
|
+
options: localVarRequestOptions,
|
|
477
|
+
}];
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
});
|
|
481
|
+
},
|
|
482
|
+
};
|
|
483
|
+
};
|
|
484
|
+
exports.OptionsApiAxiosParamCreator = OptionsApiAxiosParamCreator;
|
|
485
|
+
/**
|
|
486
|
+
* OptionsApi - functional programming interface
|
|
487
|
+
* @export
|
|
488
|
+
*/
|
|
489
|
+
var OptionsApiFp = function (configuration) {
|
|
490
|
+
var localVarAxiosParamCreator = (0, exports.OptionsApiAxiosParamCreator)(configuration);
|
|
491
|
+
return {
|
|
492
|
+
/**
|
|
493
|
+
*
|
|
494
|
+
* @summary Creates an option strategy object that will be used to place an option strategy order
|
|
495
|
+
* @param {OptionsApiGetOptionStrategyRequest} requestParameters Request parameters.
|
|
496
|
+
* @param {*} [options] Override http request option.
|
|
497
|
+
* @throws {RequiredError}
|
|
498
|
+
*/
|
|
499
|
+
getOptionStrategy: function (requestParameters, options) {
|
|
500
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
501
|
+
var localVarAxiosArgs;
|
|
502
|
+
return __generator(this, function (_a) {
|
|
503
|
+
switch (_a.label) {
|
|
504
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.getOptionStrategy(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.requestBody, options)];
|
|
505
|
+
case 1:
|
|
506
|
+
localVarAxiosArgs = _a.sent();
|
|
507
|
+
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
});
|
|
511
|
+
},
|
|
512
|
+
/**
|
|
513
|
+
*
|
|
514
|
+
* @summary Get the options chain
|
|
515
|
+
* @param {OptionsApiGetOptionsChainRequest} requestParameters Request parameters.
|
|
516
|
+
* @param {*} [options] Override http request option.
|
|
517
|
+
* @throws {RequiredError}
|
|
518
|
+
*/
|
|
519
|
+
getOptionsChain: function (requestParameters, options) {
|
|
520
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
521
|
+
var localVarAxiosArgs;
|
|
522
|
+
return __generator(this, function (_a) {
|
|
523
|
+
switch (_a.label) {
|
|
524
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.getOptionsChain(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.symbol, options)];
|
|
525
|
+
case 1:
|
|
526
|
+
localVarAxiosArgs = _a.sent();
|
|
527
|
+
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
});
|
|
531
|
+
},
|
|
532
|
+
/**
|
|
533
|
+
*
|
|
534
|
+
* @summary Get latest market data of option strategy
|
|
535
|
+
* @param {OptionsApiGetOptionsStrategyQuoteRequest} requestParameters Request parameters.
|
|
536
|
+
* @param {*} [options] Override http request option.
|
|
537
|
+
* @throws {RequiredError}
|
|
538
|
+
*/
|
|
539
|
+
getOptionsStrategyQuote: function (requestParameters, options) {
|
|
540
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
541
|
+
var localVarAxiosArgs;
|
|
542
|
+
return __generator(this, function (_a) {
|
|
543
|
+
switch (_a.label) {
|
|
544
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.getOptionsStrategyQuote(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.optionStrategyId, options)];
|
|
545
|
+
case 1:
|
|
546
|
+
localVarAxiosArgs = _a.sent();
|
|
547
|
+
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
});
|
|
551
|
+
},
|
|
552
|
+
/**
|
|
553
|
+
*
|
|
554
|
+
* @summary Get the options holdings in the account
|
|
555
|
+
* @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
|
|
556
|
+
* @param {*} [options] Override http request option.
|
|
557
|
+
* @throws {RequiredError}
|
|
558
|
+
*/
|
|
559
|
+
listOptionHoldings: function (requestParameters, options) {
|
|
560
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
561
|
+
var localVarAxiosArgs;
|
|
562
|
+
return __generator(this, function (_a) {
|
|
563
|
+
switch (_a.label) {
|
|
564
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.listOptionHoldings(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, options)];
|
|
565
|
+
case 1:
|
|
566
|
+
localVarAxiosArgs = _a.sent();
|
|
567
|
+
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
568
|
+
}
|
|
569
|
+
});
|
|
570
|
+
});
|
|
571
|
+
},
|
|
572
|
+
/**
|
|
573
|
+
*
|
|
574
|
+
* @summary Place an option strategy order on the brokerage
|
|
575
|
+
* @param {OptionsApiPlaceOptionStrategyRequest} requestParameters Request parameters.
|
|
576
|
+
* @param {*} [options] Override http request option.
|
|
577
|
+
* @throws {RequiredError}
|
|
578
|
+
*/
|
|
579
|
+
placeOptionStrategy: function (requestParameters, options) {
|
|
580
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
581
|
+
var localVarAxiosArgs;
|
|
582
|
+
return __generator(this, function (_a) {
|
|
583
|
+
switch (_a.label) {
|
|
584
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.placeOptionStrategy(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.optionStrategyId, requestParameters.requestBody, options)];
|
|
585
|
+
case 1:
|
|
586
|
+
localVarAxiosArgs = _a.sent();
|
|
587
|
+
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
});
|
|
591
|
+
},
|
|
592
|
+
};
|
|
593
|
+
};
|
|
594
|
+
exports.OptionsApiFp = OptionsApiFp;
|
|
595
|
+
/**
|
|
596
|
+
* OptionsApi - factory interface
|
|
597
|
+
* @export
|
|
598
|
+
*/
|
|
599
|
+
var OptionsApiFactory = function (configuration, basePath, axios) {
|
|
600
|
+
var localVarFp = (0, exports.OptionsApiFp)(configuration);
|
|
601
|
+
return {
|
|
602
|
+
/**
|
|
603
|
+
*
|
|
604
|
+
* @summary Creates an option strategy object that will be used to place an option strategy order
|
|
605
|
+
* @param {OptionsApiGetOptionStrategyRequest} requestParameters Request parameters.
|
|
606
|
+
* @param {*} [options] Override http request option.
|
|
607
|
+
* @throws {RequiredError}
|
|
608
|
+
*/
|
|
609
|
+
getOptionStrategy: function (requestParameters, options) {
|
|
610
|
+
return localVarFp.getOptionStrategy(requestParameters, options).then(function (request) { return request(axios, basePath); });
|
|
611
|
+
},
|
|
612
|
+
/**
|
|
613
|
+
*
|
|
614
|
+
* @summary Get the options chain
|
|
615
|
+
* @param {OptionsApiGetOptionsChainRequest} requestParameters Request parameters.
|
|
616
|
+
* @param {*} [options] Override http request option.
|
|
617
|
+
* @throws {RequiredError}
|
|
618
|
+
*/
|
|
619
|
+
getOptionsChain: function (requestParameters, options) {
|
|
620
|
+
return localVarFp.getOptionsChain(requestParameters, options).then(function (request) { return request(axios, basePath); });
|
|
621
|
+
},
|
|
622
|
+
/**
|
|
623
|
+
*
|
|
624
|
+
* @summary Get latest market data of option strategy
|
|
625
|
+
* @param {OptionsApiGetOptionsStrategyQuoteRequest} requestParameters Request parameters.
|
|
626
|
+
* @param {*} [options] Override http request option.
|
|
627
|
+
* @throws {RequiredError}
|
|
628
|
+
*/
|
|
629
|
+
getOptionsStrategyQuote: function (requestParameters, options) {
|
|
630
|
+
return localVarFp.getOptionsStrategyQuote(requestParameters, options).then(function (request) { return request(axios, basePath); });
|
|
631
|
+
},
|
|
632
|
+
/**
|
|
633
|
+
*
|
|
634
|
+
* @summary Get the options holdings in the account
|
|
635
|
+
* @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
|
|
636
|
+
* @param {*} [options] Override http request option.
|
|
637
|
+
* @throws {RequiredError}
|
|
638
|
+
*/
|
|
639
|
+
listOptionHoldings: function (requestParameters, options) {
|
|
640
|
+
return localVarFp.listOptionHoldings(requestParameters, options).then(function (request) { return request(axios, basePath); });
|
|
641
|
+
},
|
|
642
|
+
/**
|
|
643
|
+
*
|
|
644
|
+
* @summary Place an option strategy order on the brokerage
|
|
645
|
+
* @param {OptionsApiPlaceOptionStrategyRequest} requestParameters Request parameters.
|
|
646
|
+
* @param {*} [options] Override http request option.
|
|
647
|
+
* @throws {RequiredError}
|
|
648
|
+
*/
|
|
649
|
+
placeOptionStrategy: function (requestParameters, options) {
|
|
650
|
+
return localVarFp.placeOptionStrategy(requestParameters, options).then(function (request) { return request(axios, basePath); });
|
|
651
|
+
},
|
|
652
|
+
};
|
|
653
|
+
};
|
|
654
|
+
exports.OptionsApiFactory = OptionsApiFactory;
|
|
655
|
+
/**
|
|
656
|
+
* OptionsApi - object-oriented interface
|
|
657
|
+
* @export
|
|
658
|
+
* @class OptionsApi
|
|
659
|
+
* @extends {BaseAPI}
|
|
660
|
+
*/
|
|
661
|
+
var OptionsApi = /** @class */ (function (_super) {
|
|
662
|
+
__extends(OptionsApi, _super);
|
|
663
|
+
function OptionsApi() {
|
|
664
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
*
|
|
668
|
+
* @summary Creates an option strategy object that will be used to place an option strategy order
|
|
669
|
+
* @param {OptionsApiGetOptionStrategyRequest} requestParameters Request parameters.
|
|
670
|
+
* @param {*} [options] Override http request option.
|
|
671
|
+
* @throws {RequiredError}
|
|
672
|
+
* @memberof OptionsApi
|
|
673
|
+
*/
|
|
674
|
+
OptionsApi.prototype.getOptionStrategy = function (requestParameters, options) {
|
|
675
|
+
var _this = this;
|
|
676
|
+
return (0, exports.OptionsApiFp)(this.configuration).getOptionStrategy(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
677
|
+
};
|
|
678
|
+
/**
|
|
679
|
+
*
|
|
680
|
+
* @summary Get the options chain
|
|
681
|
+
* @param {OptionsApiGetOptionsChainRequest} requestParameters Request parameters.
|
|
682
|
+
* @param {*} [options] Override http request option.
|
|
683
|
+
* @throws {RequiredError}
|
|
684
|
+
* @memberof OptionsApi
|
|
685
|
+
*/
|
|
686
|
+
OptionsApi.prototype.getOptionsChain = function (requestParameters, options) {
|
|
687
|
+
var _this = this;
|
|
688
|
+
return (0, exports.OptionsApiFp)(this.configuration).getOptionsChain(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
689
|
+
};
|
|
690
|
+
/**
|
|
691
|
+
*
|
|
692
|
+
* @summary Get latest market data of option strategy
|
|
693
|
+
* @param {OptionsApiGetOptionsStrategyQuoteRequest} requestParameters Request parameters.
|
|
694
|
+
* @param {*} [options] Override http request option.
|
|
695
|
+
* @throws {RequiredError}
|
|
696
|
+
* @memberof OptionsApi
|
|
697
|
+
*/
|
|
698
|
+
OptionsApi.prototype.getOptionsStrategyQuote = function (requestParameters, options) {
|
|
699
|
+
var _this = this;
|
|
700
|
+
return (0, exports.OptionsApiFp)(this.configuration).getOptionsStrategyQuote(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
701
|
+
};
|
|
702
|
+
/**
|
|
703
|
+
*
|
|
704
|
+
* @summary Get the options holdings in the account
|
|
705
|
+
* @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
|
|
706
|
+
* @param {*} [options] Override http request option.
|
|
707
|
+
* @throws {RequiredError}
|
|
708
|
+
* @memberof OptionsApi
|
|
709
|
+
*/
|
|
710
|
+
OptionsApi.prototype.listOptionHoldings = function (requestParameters, options) {
|
|
711
|
+
var _this = this;
|
|
712
|
+
return (0, exports.OptionsApiFp)(this.configuration).listOptionHoldings(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
713
|
+
};
|
|
714
|
+
/**
|
|
715
|
+
*
|
|
716
|
+
* @summary Place an option strategy order on the brokerage
|
|
717
|
+
* @param {OptionsApiPlaceOptionStrategyRequest} requestParameters Request parameters.
|
|
718
|
+
* @param {*} [options] Override http request option.
|
|
719
|
+
* @throws {RequiredError}
|
|
720
|
+
* @memberof OptionsApi
|
|
721
|
+
*/
|
|
722
|
+
OptionsApi.prototype.placeOptionStrategy = function (requestParameters, options) {
|
|
723
|
+
var _this = this;
|
|
724
|
+
return (0, exports.OptionsApiFp)(this.configuration).placeOptionStrategy(requestParameters, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
725
|
+
};
|
|
726
|
+
return OptionsApi;
|
|
727
|
+
}(base_1.BaseAPI));
|
|
728
|
+
exports.OptionsApi = OptionsApi;
|