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,613 +1,613 @@
|
|
|
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.TradingApiGenerated = exports.TradingApiFactory = exports.TradingApiFp = exports.TradingApiAxiosParamCreator = 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
|
-
* TradingApi - axios parameter creator
|
|
34
|
-
* @export
|
|
35
|
-
*/
|
|
36
|
-
const TradingApiAxiosParamCreator = function (configuration) {
|
|
37
|
-
return {
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* @summary Cancel open order in account
|
|
41
|
-
* @param {string} userId
|
|
42
|
-
* @param {string} userSecret
|
|
43
|
-
* @param {string} accountId The ID of the account get positions.
|
|
44
|
-
* @param {TradingCancelUserAccountOrderRequest} tradingCancelUserAccountOrderRequest The Order ID to be canceled
|
|
45
|
-
* @param {*} [options] Override http request option.
|
|
46
|
-
* @throws {RequiredError}
|
|
47
|
-
*/
|
|
48
|
-
cancelUserAccountOrder: (userId, userSecret, accountId, tradingCancelUserAccountOrderRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
// verify required parameter 'userId' is not null or undefined
|
|
50
|
-
(0, common_1.assertParamExists)('cancelUserAccountOrder', 'userId', userId);
|
|
51
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
52
|
-
(0, common_1.assertParamExists)('cancelUserAccountOrder', 'userSecret', userSecret);
|
|
53
|
-
// verify required parameter 'accountId' is not null or undefined
|
|
54
|
-
(0, common_1.assertParamExists)('cancelUserAccountOrder', 'accountId', accountId);
|
|
55
|
-
// verify required parameter 'tradingCancelUserAccountOrderRequest' is not null or undefined
|
|
56
|
-
(0, common_1.assertParamExists)('cancelUserAccountOrder', 'tradingCancelUserAccountOrderRequest', tradingCancelUserAccountOrderRequest);
|
|
57
|
-
const localVarPath = `/accounts/{accountId}/orders/cancel`
|
|
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: tradingCancelUserAccountOrderRequest,
|
|
85
|
-
queryParameters: localVarQueryParameter,
|
|
86
|
-
requestConfig: localVarRequestOptions,
|
|
87
|
-
path: localVarPath,
|
|
88
|
-
configuration
|
|
89
|
-
});
|
|
90
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(tradingCancelUserAccountOrderRequest, 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 Check impact of trades on account.
|
|
100
|
-
* @param {string} userId
|
|
101
|
-
* @param {string} userSecret
|
|
102
|
-
* @param {ManualTradeForm} manualTradeForm
|
|
103
|
-
* @param {*} [options] Override http request option.
|
|
104
|
-
* @throws {RequiredError}
|
|
105
|
-
*/
|
|
106
|
-
getOrderImpact: (userId, userSecret, manualTradeForm, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
107
|
-
// verify required parameter 'userId' is not null or undefined
|
|
108
|
-
(0, common_1.assertParamExists)('getOrderImpact', 'userId', userId);
|
|
109
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
110
|
-
(0, common_1.assertParamExists)('getOrderImpact', 'userSecret', userSecret);
|
|
111
|
-
// verify required parameter 'manualTradeForm' is not null or undefined
|
|
112
|
-
(0, common_1.assertParamExists)('getOrderImpact', 'manualTradeForm', manualTradeForm);
|
|
113
|
-
const localVarPath = `/trade/impact`;
|
|
114
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
115
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
116
|
-
let baseOptions;
|
|
117
|
-
if (configuration) {
|
|
118
|
-
baseOptions = configuration.baseOptions;
|
|
119
|
-
}
|
|
120
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
121
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
122
|
-
const localVarQueryParameter = {};
|
|
123
|
-
// authentication PartnerClientId required
|
|
124
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
125
|
-
// authentication PartnerSignature required
|
|
126
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
127
|
-
// authentication PartnerTimestamp required
|
|
128
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
129
|
-
if (userId !== undefined) {
|
|
130
|
-
localVarQueryParameter['userId'] = userId;
|
|
131
|
-
}
|
|
132
|
-
if (userSecret !== undefined) {
|
|
133
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
134
|
-
}
|
|
135
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
136
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
137
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
138
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
139
|
-
requestBody: manualTradeForm,
|
|
140
|
-
queryParameters: localVarQueryParameter,
|
|
141
|
-
requestConfig: localVarRequestOptions,
|
|
142
|
-
path: localVarPath,
|
|
143
|
-
configuration
|
|
144
|
-
});
|
|
145
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(manualTradeForm, localVarRequestOptions, configuration);
|
|
146
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
147
|
-
return {
|
|
148
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
149
|
-
options: localVarRequestOptions,
|
|
150
|
-
};
|
|
151
|
-
}),
|
|
152
|
-
/**
|
|
153
|
-
*
|
|
154
|
-
* @summary Get symbol quotes
|
|
155
|
-
* @param {string} userId
|
|
156
|
-
* @param {string} userSecret
|
|
157
|
-
* @param {string} symbols List of universal_symbol_id or tickers to get quotes for.
|
|
158
|
-
* @param {string} accountId The ID of the account to get quotes.
|
|
159
|
-
* @param {boolean} [useTicker] Should be set to True if providing tickers.
|
|
160
|
-
* @param {*} [options] Override http request option.
|
|
161
|
-
* @throws {RequiredError}
|
|
162
|
-
*/
|
|
163
|
-
getUserAccountQuotes: (userId, userSecret, symbols, accountId, useTicker, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
164
|
-
// verify required parameter 'userId' is not null or undefined
|
|
165
|
-
(0, common_1.assertParamExists)('getUserAccountQuotes', 'userId', userId);
|
|
166
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
167
|
-
(0, common_1.assertParamExists)('getUserAccountQuotes', 'userSecret', userSecret);
|
|
168
|
-
// verify required parameter 'symbols' is not null or undefined
|
|
169
|
-
(0, common_1.assertParamExists)('getUserAccountQuotes', 'symbols', symbols);
|
|
170
|
-
// verify required parameter 'accountId' is not null or undefined
|
|
171
|
-
(0, common_1.assertParamExists)('getUserAccountQuotes', 'accountId', accountId);
|
|
172
|
-
const localVarPath = `/accounts/{accountId}/quotes`
|
|
173
|
-
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
174
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
175
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
176
|
-
let baseOptions;
|
|
177
|
-
if (configuration) {
|
|
178
|
-
baseOptions = configuration.baseOptions;
|
|
179
|
-
}
|
|
180
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
181
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
182
|
-
const localVarQueryParameter = {};
|
|
183
|
-
// authentication PartnerClientId required
|
|
184
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
185
|
-
// authentication PartnerSignature required
|
|
186
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
187
|
-
// authentication PartnerTimestamp required
|
|
188
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
189
|
-
if (userId !== undefined) {
|
|
190
|
-
localVarQueryParameter['userId'] = userId;
|
|
191
|
-
}
|
|
192
|
-
if (userSecret !== undefined) {
|
|
193
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
194
|
-
}
|
|
195
|
-
if (symbols !== undefined) {
|
|
196
|
-
localVarQueryParameter['symbols'] = symbols;
|
|
197
|
-
}
|
|
198
|
-
if (useTicker !== undefined) {
|
|
199
|
-
localVarQueryParameter['use_ticker'] = useTicker;
|
|
200
|
-
}
|
|
201
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
202
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
203
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
204
|
-
queryParameters: localVarQueryParameter,
|
|
205
|
-
requestConfig: localVarRequestOptions,
|
|
206
|
-
path: localVarPath,
|
|
207
|
-
configuration
|
|
208
|
-
});
|
|
209
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
210
|
-
return {
|
|
211
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
212
|
-
options: localVarRequestOptions,
|
|
213
|
-
};
|
|
214
|
-
}),
|
|
215
|
-
/**
|
|
216
|
-
*
|
|
217
|
-
* @summary Place a trade with NO validation.
|
|
218
|
-
* @param {string} userId
|
|
219
|
-
* @param {string} userSecret
|
|
220
|
-
* @param {ManualTradeForm} manualTradeForm
|
|
221
|
-
* @param {*} [options] Override http request option.
|
|
222
|
-
* @throws {RequiredError}
|
|
223
|
-
*/
|
|
224
|
-
placeForceOrder: (userId, userSecret, manualTradeForm, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
225
|
-
// verify required parameter 'userId' is not null or undefined
|
|
226
|
-
(0, common_1.assertParamExists)('placeForceOrder', 'userId', userId);
|
|
227
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
228
|
-
(0, common_1.assertParamExists)('placeForceOrder', 'userSecret', userSecret);
|
|
229
|
-
// verify required parameter 'manualTradeForm' is not null or undefined
|
|
230
|
-
(0, common_1.assertParamExists)('placeForceOrder', 'manualTradeForm', manualTradeForm);
|
|
231
|
-
const localVarPath = `/trade/place`;
|
|
232
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
233
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
234
|
-
let baseOptions;
|
|
235
|
-
if (configuration) {
|
|
236
|
-
baseOptions = configuration.baseOptions;
|
|
237
|
-
}
|
|
238
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
239
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
240
|
-
const localVarQueryParameter = {};
|
|
241
|
-
// authentication PartnerClientId required
|
|
242
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
243
|
-
// authentication PartnerSignature required
|
|
244
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
245
|
-
// authentication PartnerTimestamp required
|
|
246
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
247
|
-
if (userId !== undefined) {
|
|
248
|
-
localVarQueryParameter['userId'] = userId;
|
|
249
|
-
}
|
|
250
|
-
if (userSecret !== undefined) {
|
|
251
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
252
|
-
}
|
|
253
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
254
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
255
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
256
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
257
|
-
requestBody: manualTradeForm,
|
|
258
|
-
queryParameters: localVarQueryParameter,
|
|
259
|
-
requestConfig: localVarRequestOptions,
|
|
260
|
-
path: localVarPath,
|
|
261
|
-
configuration
|
|
262
|
-
});
|
|
263
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(manualTradeForm, localVarRequestOptions, configuration);
|
|
264
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
265
|
-
return {
|
|
266
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
267
|
-
options: localVarRequestOptions,
|
|
268
|
-
};
|
|
269
|
-
}),
|
|
270
|
-
/**
|
|
271
|
-
*
|
|
272
|
-
* @summary Place a OCO (One Cancels Other) order
|
|
273
|
-
* @param {string} userId
|
|
274
|
-
* @param {string} userSecret
|
|
275
|
-
* @param {TradingPlaceOCOOrderRequest} tradingPlaceOCOOrderRequest
|
|
276
|
-
* @param {*} [options] Override http request option.
|
|
277
|
-
* @throws {RequiredError}
|
|
278
|
-
*/
|
|
279
|
-
placeOCOOrder: (userId, userSecret, tradingPlaceOCOOrderRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
280
|
-
// verify required parameter 'userId' is not null or undefined
|
|
281
|
-
(0, common_1.assertParamExists)('placeOCOOrder', 'userId', userId);
|
|
282
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
283
|
-
(0, common_1.assertParamExists)('placeOCOOrder', 'userSecret', userSecret);
|
|
284
|
-
// verify required parameter 'tradingPlaceOCOOrderRequest' is not null or undefined
|
|
285
|
-
(0, common_1.assertParamExists)('placeOCOOrder', 'tradingPlaceOCOOrderRequest', tradingPlaceOCOOrderRequest);
|
|
286
|
-
const localVarPath = `/trade/oco`;
|
|
287
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
288
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
289
|
-
let baseOptions;
|
|
290
|
-
if (configuration) {
|
|
291
|
-
baseOptions = configuration.baseOptions;
|
|
292
|
-
}
|
|
293
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
294
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
295
|
-
const localVarQueryParameter = {};
|
|
296
|
-
// authentication PartnerClientId required
|
|
297
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
298
|
-
// authentication PartnerSignature required
|
|
299
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
300
|
-
// authentication PartnerTimestamp required
|
|
301
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
302
|
-
if (userId !== undefined) {
|
|
303
|
-
localVarQueryParameter['userId'] = userId;
|
|
304
|
-
}
|
|
305
|
-
if (userSecret !== undefined) {
|
|
306
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
307
|
-
}
|
|
308
|
-
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
309
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
310
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
311
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
312
|
-
requestBody: tradingPlaceOCOOrderRequest,
|
|
313
|
-
queryParameters: localVarQueryParameter,
|
|
314
|
-
requestConfig: localVarRequestOptions,
|
|
315
|
-
path: localVarPath,
|
|
316
|
-
configuration
|
|
317
|
-
});
|
|
318
|
-
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(tradingPlaceOCOOrderRequest, localVarRequestOptions, configuration);
|
|
319
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
320
|
-
return {
|
|
321
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
322
|
-
options: localVarRequestOptions,
|
|
323
|
-
};
|
|
324
|
-
}),
|
|
325
|
-
/**
|
|
326
|
-
*
|
|
327
|
-
* @summary Place order
|
|
328
|
-
* @param {string} tradeId The ID of trade object obtained from trade/impact endpoint
|
|
329
|
-
* @param {string} userId
|
|
330
|
-
* @param {string} userSecret
|
|
331
|
-
* @param {*} [options] Override http request option.
|
|
332
|
-
* @throws {RequiredError}
|
|
333
|
-
*/
|
|
334
|
-
placeOrder: (tradeId, userId, userSecret, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
335
|
-
// verify required parameter 'tradeId' is not null or undefined
|
|
336
|
-
(0, common_1.assertParamExists)('placeOrder', 'tradeId', tradeId);
|
|
337
|
-
// verify required parameter 'userId' is not null or undefined
|
|
338
|
-
(0, common_1.assertParamExists)('placeOrder', 'userId', userId);
|
|
339
|
-
// verify required parameter 'userSecret' is not null or undefined
|
|
340
|
-
(0, common_1.assertParamExists)('placeOrder', 'userSecret', userSecret);
|
|
341
|
-
const localVarPath = `/trade/{tradeId}`
|
|
342
|
-
.replace(`{${"tradeId"}}`, encodeURIComponent(String(tradeId !== undefined ? tradeId : `-tradeId-`)));
|
|
343
|
-
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
344
|
-
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
345
|
-
let baseOptions;
|
|
346
|
-
if (configuration) {
|
|
347
|
-
baseOptions = configuration.baseOptions;
|
|
348
|
-
}
|
|
349
|
-
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
350
|
-
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
351
|
-
const localVarQueryParameter = {};
|
|
352
|
-
// authentication PartnerClientId required
|
|
353
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
354
|
-
// authentication PartnerSignature required
|
|
355
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
356
|
-
// authentication PartnerTimestamp required
|
|
357
|
-
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
358
|
-
if (userId !== undefined) {
|
|
359
|
-
localVarQueryParameter['userId'] = userId;
|
|
360
|
-
}
|
|
361
|
-
if (userSecret !== undefined) {
|
|
362
|
-
localVarQueryParameter['userSecret'] = userSecret;
|
|
363
|
-
}
|
|
364
|
-
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
365
|
-
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
366
|
-
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
367
|
-
queryParameters: localVarQueryParameter,
|
|
368
|
-
requestConfig: localVarRequestOptions,
|
|
369
|
-
path: localVarPath,
|
|
370
|
-
configuration
|
|
371
|
-
});
|
|
372
|
-
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
373
|
-
return {
|
|
374
|
-
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
375
|
-
options: localVarRequestOptions,
|
|
376
|
-
};
|
|
377
|
-
}),
|
|
378
|
-
};
|
|
379
|
-
};
|
|
380
|
-
exports.TradingApiAxiosParamCreator = TradingApiAxiosParamCreator;
|
|
381
|
-
/**
|
|
382
|
-
* TradingApi - functional programming interface
|
|
383
|
-
* @export
|
|
384
|
-
*/
|
|
385
|
-
const TradingApiFp = function (configuration) {
|
|
386
|
-
const localVarAxiosParamCreator = (0, exports.TradingApiAxiosParamCreator)(configuration);
|
|
387
|
-
return {
|
|
388
|
-
/**
|
|
389
|
-
*
|
|
390
|
-
* @summary Cancel open order in account
|
|
391
|
-
* @param {TradingApiCancelUserAccountOrderRequest} requestParameters Request parameters.
|
|
392
|
-
* @param {*} [options] Override http request option.
|
|
393
|
-
* @throws {RequiredError}
|
|
394
|
-
*/
|
|
395
|
-
cancelUserAccountOrder(requestParameters, options) {
|
|
396
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
397
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.cancelUserAccountOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters, options);
|
|
398
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
399
|
-
});
|
|
400
|
-
},
|
|
401
|
-
/**
|
|
402
|
-
*
|
|
403
|
-
* @summary Check impact of trades on account.
|
|
404
|
-
* @param {TradingApiGetOrderImpactRequest} requestParameters Request parameters.
|
|
405
|
-
* @param {*} [options] Override http request option.
|
|
406
|
-
* @throws {RequiredError}
|
|
407
|
-
*/
|
|
408
|
-
getOrderImpact(requestParameters, options) {
|
|
409
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
410
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrderImpact(requestParameters.userId, requestParameters.userSecret, requestParameters, options);
|
|
411
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
412
|
-
});
|
|
413
|
-
},
|
|
414
|
-
/**
|
|
415
|
-
*
|
|
416
|
-
* @summary Get symbol quotes
|
|
417
|
-
* @param {TradingApiGetUserAccountQuotesRequest} requestParameters Request parameters.
|
|
418
|
-
* @param {*} [options] Override http request option.
|
|
419
|
-
* @throws {RequiredError}
|
|
420
|
-
*/
|
|
421
|
-
getUserAccountQuotes(requestParameters, options) {
|
|
422
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
423
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.getUserAccountQuotes(requestParameters.userId, requestParameters.userSecret, requestParameters.symbols, requestParameters.accountId, requestParameters.useTicker, options);
|
|
424
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
425
|
-
});
|
|
426
|
-
},
|
|
427
|
-
/**
|
|
428
|
-
*
|
|
429
|
-
* @summary Place a trade with NO validation.
|
|
430
|
-
* @param {TradingApiPlaceForceOrderRequest} requestParameters Request parameters.
|
|
431
|
-
* @param {*} [options] Override http request option.
|
|
432
|
-
* @throws {RequiredError}
|
|
433
|
-
*/
|
|
434
|
-
placeForceOrder(requestParameters, options) {
|
|
435
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
436
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeForceOrder(requestParameters.userId, requestParameters.userSecret, requestParameters, options);
|
|
437
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
438
|
-
});
|
|
439
|
-
},
|
|
440
|
-
/**
|
|
441
|
-
*
|
|
442
|
-
* @summary Place a OCO (One Cancels Other) order
|
|
443
|
-
* @param {TradingApiPlaceOCOOrderRequest} requestParameters Request parameters.
|
|
444
|
-
* @param {*} [options] Override http request option.
|
|
445
|
-
* @throws {RequiredError}
|
|
446
|
-
*/
|
|
447
|
-
placeOCOOrder(requestParameters, options) {
|
|
448
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
449
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeOCOOrder(requestParameters.userId, requestParameters.userSecret, requestParameters, options);
|
|
450
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
451
|
-
});
|
|
452
|
-
},
|
|
453
|
-
/**
|
|
454
|
-
*
|
|
455
|
-
* @summary Place order
|
|
456
|
-
* @param {TradingApiPlaceOrderRequest} requestParameters Request parameters.
|
|
457
|
-
* @param {*} [options] Override http request option.
|
|
458
|
-
* @throws {RequiredError}
|
|
459
|
-
*/
|
|
460
|
-
placeOrder(requestParameters, options) {
|
|
461
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
462
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeOrder(requestParameters.tradeId, requestParameters.userId, requestParameters.userSecret, options);
|
|
463
|
-
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
464
|
-
});
|
|
465
|
-
},
|
|
466
|
-
};
|
|
467
|
-
};
|
|
468
|
-
exports.TradingApiFp = TradingApiFp;
|
|
469
|
-
/**
|
|
470
|
-
* TradingApi - factory interface
|
|
471
|
-
* @export
|
|
472
|
-
*/
|
|
473
|
-
const TradingApiFactory = function (configuration, basePath, axios) {
|
|
474
|
-
const localVarFp = (0, exports.TradingApiFp)(configuration);
|
|
475
|
-
return {
|
|
476
|
-
/**
|
|
477
|
-
*
|
|
478
|
-
* @summary Cancel open order in account
|
|
479
|
-
* @param {TradingApiCancelUserAccountOrderRequest} requestParameters Request parameters.
|
|
480
|
-
* @param {*} [options] Override http request option.
|
|
481
|
-
* @throws {RequiredError}
|
|
482
|
-
*/
|
|
483
|
-
cancelUserAccountOrder(requestParameters, options) {
|
|
484
|
-
return localVarFp.cancelUserAccountOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
485
|
-
},
|
|
486
|
-
/**
|
|
487
|
-
*
|
|
488
|
-
* @summary Check impact of trades on account.
|
|
489
|
-
* @param {TradingApiGetOrderImpactRequest} requestParameters Request parameters.
|
|
490
|
-
* @param {*} [options] Override http request option.
|
|
491
|
-
* @throws {RequiredError}
|
|
492
|
-
*/
|
|
493
|
-
getOrderImpact(requestParameters, options) {
|
|
494
|
-
return localVarFp.getOrderImpact(requestParameters, options).then((request) => request(axios, basePath));
|
|
495
|
-
},
|
|
496
|
-
/**
|
|
497
|
-
*
|
|
498
|
-
* @summary Get symbol quotes
|
|
499
|
-
* @param {TradingApiGetUserAccountQuotesRequest} requestParameters Request parameters.
|
|
500
|
-
* @param {*} [options] Override http request option.
|
|
501
|
-
* @throws {RequiredError}
|
|
502
|
-
*/
|
|
503
|
-
getUserAccountQuotes(requestParameters, options) {
|
|
504
|
-
return localVarFp.getUserAccountQuotes(requestParameters, options).then((request) => request(axios, basePath));
|
|
505
|
-
},
|
|
506
|
-
/**
|
|
507
|
-
*
|
|
508
|
-
* @summary Place a trade with NO validation.
|
|
509
|
-
* @param {TradingApiPlaceForceOrderRequest} requestParameters Request parameters.
|
|
510
|
-
* @param {*} [options] Override http request option.
|
|
511
|
-
* @throws {RequiredError}
|
|
512
|
-
*/
|
|
513
|
-
placeForceOrder(requestParameters, options) {
|
|
514
|
-
return localVarFp.placeForceOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
515
|
-
},
|
|
516
|
-
/**
|
|
517
|
-
*
|
|
518
|
-
* @summary Place a OCO (One Cancels Other) order
|
|
519
|
-
* @param {TradingApiPlaceOCOOrderRequest} requestParameters Request parameters.
|
|
520
|
-
* @param {*} [options] Override http request option.
|
|
521
|
-
* @throws {RequiredError}
|
|
522
|
-
*/
|
|
523
|
-
placeOCOOrder(requestParameters, options) {
|
|
524
|
-
return localVarFp.placeOCOOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
525
|
-
},
|
|
526
|
-
/**
|
|
527
|
-
*
|
|
528
|
-
* @summary Place order
|
|
529
|
-
* @param {TradingApiPlaceOrderRequest} requestParameters Request parameters.
|
|
530
|
-
* @param {*} [options] Override http request option.
|
|
531
|
-
* @throws {RequiredError}
|
|
532
|
-
*/
|
|
533
|
-
placeOrder(requestParameters, options) {
|
|
534
|
-
return localVarFp.placeOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
535
|
-
},
|
|
536
|
-
};
|
|
537
|
-
};
|
|
538
|
-
exports.TradingApiFactory = TradingApiFactory;
|
|
539
|
-
/**
|
|
540
|
-
* TradingApiGenerated - object-oriented interface
|
|
541
|
-
* @export
|
|
542
|
-
* @class TradingApiGenerated
|
|
543
|
-
* @extends {BaseAPI}
|
|
544
|
-
*/
|
|
545
|
-
class TradingApiGenerated extends base_1.BaseAPI {
|
|
546
|
-
/**
|
|
547
|
-
*
|
|
548
|
-
* @summary Cancel open order in account
|
|
549
|
-
* @param {TradingApiCancelUserAccountOrderRequest} requestParameters Request parameters.
|
|
550
|
-
* @param {*} [options] Override http request option.
|
|
551
|
-
* @throws {RequiredError}
|
|
552
|
-
* @memberof TradingApiGenerated
|
|
553
|
-
*/
|
|
554
|
-
cancelUserAccountOrder(requestParameters, options) {
|
|
555
|
-
return (0, exports.TradingApiFp)(this.configuration).cancelUserAccountOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
556
|
-
}
|
|
557
|
-
/**
|
|
558
|
-
*
|
|
559
|
-
* @summary Check impact of trades on account.
|
|
560
|
-
* @param {TradingApiGetOrderImpactRequest} requestParameters Request parameters.
|
|
561
|
-
* @param {*} [options] Override http request option.
|
|
562
|
-
* @throws {RequiredError}
|
|
563
|
-
* @memberof TradingApiGenerated
|
|
564
|
-
*/
|
|
565
|
-
getOrderImpact(requestParameters, options) {
|
|
566
|
-
return (0, exports.TradingApiFp)(this.configuration).getOrderImpact(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
567
|
-
}
|
|
568
|
-
/**
|
|
569
|
-
*
|
|
570
|
-
* @summary Get symbol quotes
|
|
571
|
-
* @param {TradingApiGetUserAccountQuotesRequest} requestParameters Request parameters.
|
|
572
|
-
* @param {*} [options] Override http request option.
|
|
573
|
-
* @throws {RequiredError}
|
|
574
|
-
* @memberof TradingApiGenerated
|
|
575
|
-
*/
|
|
576
|
-
getUserAccountQuotes(requestParameters, options) {
|
|
577
|
-
return (0, exports.TradingApiFp)(this.configuration).getUserAccountQuotes(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
578
|
-
}
|
|
579
|
-
/**
|
|
580
|
-
*
|
|
581
|
-
* @summary Place a trade with NO validation.
|
|
582
|
-
* @param {TradingApiPlaceForceOrderRequest} requestParameters Request parameters.
|
|
583
|
-
* @param {*} [options] Override http request option.
|
|
584
|
-
* @throws {RequiredError}
|
|
585
|
-
* @memberof TradingApiGenerated
|
|
586
|
-
*/
|
|
587
|
-
placeForceOrder(requestParameters, options) {
|
|
588
|
-
return (0, exports.TradingApiFp)(this.configuration).placeForceOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
589
|
-
}
|
|
590
|
-
/**
|
|
591
|
-
*
|
|
592
|
-
* @summary Place a OCO (One Cancels Other) order
|
|
593
|
-
* @param {TradingApiPlaceOCOOrderRequest} requestParameters Request parameters.
|
|
594
|
-
* @param {*} [options] Override http request option.
|
|
595
|
-
* @throws {RequiredError}
|
|
596
|
-
* @memberof TradingApiGenerated
|
|
597
|
-
*/
|
|
598
|
-
placeOCOOrder(requestParameters, options) {
|
|
599
|
-
return (0, exports.TradingApiFp)(this.configuration).placeOCOOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
600
|
-
}
|
|
601
|
-
/**
|
|
602
|
-
*
|
|
603
|
-
* @summary Place order
|
|
604
|
-
* @param {TradingApiPlaceOrderRequest} requestParameters Request parameters.
|
|
605
|
-
* @param {*} [options] Override http request option.
|
|
606
|
-
* @throws {RequiredError}
|
|
607
|
-
* @memberof TradingApiGenerated
|
|
608
|
-
*/
|
|
609
|
-
placeOrder(requestParameters, options) {
|
|
610
|
-
return (0, exports.TradingApiFp)(this.configuration).placeOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
exports.TradingApiGenerated = TradingApiGenerated;
|
|
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.TradingApiGenerated = exports.TradingApiFactory = exports.TradingApiFp = exports.TradingApiAxiosParamCreator = 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
|
+
* TradingApi - axios parameter creator
|
|
34
|
+
* @export
|
|
35
|
+
*/
|
|
36
|
+
const TradingApiAxiosParamCreator = function (configuration) {
|
|
37
|
+
return {
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @summary Cancel open order in account
|
|
41
|
+
* @param {string} userId
|
|
42
|
+
* @param {string} userSecret
|
|
43
|
+
* @param {string} accountId The ID of the account get positions.
|
|
44
|
+
* @param {TradingCancelUserAccountOrderRequest} tradingCancelUserAccountOrderRequest The Order ID to be canceled
|
|
45
|
+
* @param {*} [options] Override http request option.
|
|
46
|
+
* @throws {RequiredError}
|
|
47
|
+
*/
|
|
48
|
+
cancelUserAccountOrder: (userId, userSecret, accountId, tradingCancelUserAccountOrderRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
// verify required parameter 'userId' is not null or undefined
|
|
50
|
+
(0, common_1.assertParamExists)('cancelUserAccountOrder', 'userId', userId);
|
|
51
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
52
|
+
(0, common_1.assertParamExists)('cancelUserAccountOrder', 'userSecret', userSecret);
|
|
53
|
+
// verify required parameter 'accountId' is not null or undefined
|
|
54
|
+
(0, common_1.assertParamExists)('cancelUserAccountOrder', 'accountId', accountId);
|
|
55
|
+
// verify required parameter 'tradingCancelUserAccountOrderRequest' is not null or undefined
|
|
56
|
+
(0, common_1.assertParamExists)('cancelUserAccountOrder', 'tradingCancelUserAccountOrderRequest', tradingCancelUserAccountOrderRequest);
|
|
57
|
+
const localVarPath = `/accounts/{accountId}/orders/cancel`
|
|
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: tradingCancelUserAccountOrderRequest,
|
|
85
|
+
queryParameters: localVarQueryParameter,
|
|
86
|
+
requestConfig: localVarRequestOptions,
|
|
87
|
+
path: localVarPath,
|
|
88
|
+
configuration
|
|
89
|
+
});
|
|
90
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(tradingCancelUserAccountOrderRequest, 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 Check impact of trades on account.
|
|
100
|
+
* @param {string} userId
|
|
101
|
+
* @param {string} userSecret
|
|
102
|
+
* @param {ManualTradeForm} manualTradeForm
|
|
103
|
+
* @param {*} [options] Override http request option.
|
|
104
|
+
* @throws {RequiredError}
|
|
105
|
+
*/
|
|
106
|
+
getOrderImpact: (userId, userSecret, manualTradeForm, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
107
|
+
// verify required parameter 'userId' is not null or undefined
|
|
108
|
+
(0, common_1.assertParamExists)('getOrderImpact', 'userId', userId);
|
|
109
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
110
|
+
(0, common_1.assertParamExists)('getOrderImpact', 'userSecret', userSecret);
|
|
111
|
+
// verify required parameter 'manualTradeForm' is not null or undefined
|
|
112
|
+
(0, common_1.assertParamExists)('getOrderImpact', 'manualTradeForm', manualTradeForm);
|
|
113
|
+
const localVarPath = `/trade/impact`;
|
|
114
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
115
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
116
|
+
let baseOptions;
|
|
117
|
+
if (configuration) {
|
|
118
|
+
baseOptions = configuration.baseOptions;
|
|
119
|
+
}
|
|
120
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
121
|
+
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
122
|
+
const localVarQueryParameter = {};
|
|
123
|
+
// authentication PartnerClientId required
|
|
124
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
125
|
+
// authentication PartnerSignature required
|
|
126
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
127
|
+
// authentication PartnerTimestamp required
|
|
128
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
129
|
+
if (userId !== undefined) {
|
|
130
|
+
localVarQueryParameter['userId'] = userId;
|
|
131
|
+
}
|
|
132
|
+
if (userSecret !== undefined) {
|
|
133
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
134
|
+
}
|
|
135
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
136
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
137
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
138
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
139
|
+
requestBody: manualTradeForm,
|
|
140
|
+
queryParameters: localVarQueryParameter,
|
|
141
|
+
requestConfig: localVarRequestOptions,
|
|
142
|
+
path: localVarPath,
|
|
143
|
+
configuration
|
|
144
|
+
});
|
|
145
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(manualTradeForm, localVarRequestOptions, configuration);
|
|
146
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
147
|
+
return {
|
|
148
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
149
|
+
options: localVarRequestOptions,
|
|
150
|
+
};
|
|
151
|
+
}),
|
|
152
|
+
/**
|
|
153
|
+
*
|
|
154
|
+
* @summary Get symbol quotes
|
|
155
|
+
* @param {string} userId
|
|
156
|
+
* @param {string} userSecret
|
|
157
|
+
* @param {string} symbols List of universal_symbol_id or tickers to get quotes for.
|
|
158
|
+
* @param {string} accountId The ID of the account to get quotes.
|
|
159
|
+
* @param {boolean} [useTicker] Should be set to True if providing tickers.
|
|
160
|
+
* @param {*} [options] Override http request option.
|
|
161
|
+
* @throws {RequiredError}
|
|
162
|
+
*/
|
|
163
|
+
getUserAccountQuotes: (userId, userSecret, symbols, accountId, useTicker, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
164
|
+
// verify required parameter 'userId' is not null or undefined
|
|
165
|
+
(0, common_1.assertParamExists)('getUserAccountQuotes', 'userId', userId);
|
|
166
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
167
|
+
(0, common_1.assertParamExists)('getUserAccountQuotes', 'userSecret', userSecret);
|
|
168
|
+
// verify required parameter 'symbols' is not null or undefined
|
|
169
|
+
(0, common_1.assertParamExists)('getUserAccountQuotes', 'symbols', symbols);
|
|
170
|
+
// verify required parameter 'accountId' is not null or undefined
|
|
171
|
+
(0, common_1.assertParamExists)('getUserAccountQuotes', 'accountId', accountId);
|
|
172
|
+
const localVarPath = `/accounts/{accountId}/quotes`
|
|
173
|
+
.replace(`{${"accountId"}}`, encodeURIComponent(String(accountId !== undefined ? accountId : `-accountId-`)));
|
|
174
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
175
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
176
|
+
let baseOptions;
|
|
177
|
+
if (configuration) {
|
|
178
|
+
baseOptions = configuration.baseOptions;
|
|
179
|
+
}
|
|
180
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
181
|
+
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
182
|
+
const localVarQueryParameter = {};
|
|
183
|
+
// authentication PartnerClientId required
|
|
184
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
185
|
+
// authentication PartnerSignature required
|
|
186
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
187
|
+
// authentication PartnerTimestamp required
|
|
188
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
189
|
+
if (userId !== undefined) {
|
|
190
|
+
localVarQueryParameter['userId'] = userId;
|
|
191
|
+
}
|
|
192
|
+
if (userSecret !== undefined) {
|
|
193
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
194
|
+
}
|
|
195
|
+
if (symbols !== undefined) {
|
|
196
|
+
localVarQueryParameter['symbols'] = symbols;
|
|
197
|
+
}
|
|
198
|
+
if (useTicker !== undefined) {
|
|
199
|
+
localVarQueryParameter['use_ticker'] = useTicker;
|
|
200
|
+
}
|
|
201
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
202
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
203
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
204
|
+
queryParameters: localVarQueryParameter,
|
|
205
|
+
requestConfig: localVarRequestOptions,
|
|
206
|
+
path: localVarPath,
|
|
207
|
+
configuration
|
|
208
|
+
});
|
|
209
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
210
|
+
return {
|
|
211
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
212
|
+
options: localVarRequestOptions,
|
|
213
|
+
};
|
|
214
|
+
}),
|
|
215
|
+
/**
|
|
216
|
+
*
|
|
217
|
+
* @summary Place a trade with NO validation.
|
|
218
|
+
* @param {string} userId
|
|
219
|
+
* @param {string} userSecret
|
|
220
|
+
* @param {ManualTradeForm} manualTradeForm
|
|
221
|
+
* @param {*} [options] Override http request option.
|
|
222
|
+
* @throws {RequiredError}
|
|
223
|
+
*/
|
|
224
|
+
placeForceOrder: (userId, userSecret, manualTradeForm, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
225
|
+
// verify required parameter 'userId' is not null or undefined
|
|
226
|
+
(0, common_1.assertParamExists)('placeForceOrder', 'userId', userId);
|
|
227
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
228
|
+
(0, common_1.assertParamExists)('placeForceOrder', 'userSecret', userSecret);
|
|
229
|
+
// verify required parameter 'manualTradeForm' is not null or undefined
|
|
230
|
+
(0, common_1.assertParamExists)('placeForceOrder', 'manualTradeForm', manualTradeForm);
|
|
231
|
+
const localVarPath = `/trade/place`;
|
|
232
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
233
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
234
|
+
let baseOptions;
|
|
235
|
+
if (configuration) {
|
|
236
|
+
baseOptions = configuration.baseOptions;
|
|
237
|
+
}
|
|
238
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
239
|
+
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
240
|
+
const localVarQueryParameter = {};
|
|
241
|
+
// authentication PartnerClientId required
|
|
242
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
243
|
+
// authentication PartnerSignature required
|
|
244
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
245
|
+
// authentication PartnerTimestamp required
|
|
246
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
247
|
+
if (userId !== undefined) {
|
|
248
|
+
localVarQueryParameter['userId'] = userId;
|
|
249
|
+
}
|
|
250
|
+
if (userSecret !== undefined) {
|
|
251
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
252
|
+
}
|
|
253
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
254
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
255
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
256
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
257
|
+
requestBody: manualTradeForm,
|
|
258
|
+
queryParameters: localVarQueryParameter,
|
|
259
|
+
requestConfig: localVarRequestOptions,
|
|
260
|
+
path: localVarPath,
|
|
261
|
+
configuration
|
|
262
|
+
});
|
|
263
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(manualTradeForm, localVarRequestOptions, configuration);
|
|
264
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
265
|
+
return {
|
|
266
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
267
|
+
options: localVarRequestOptions,
|
|
268
|
+
};
|
|
269
|
+
}),
|
|
270
|
+
/**
|
|
271
|
+
*
|
|
272
|
+
* @summary Place a OCO (One Cancels Other) order
|
|
273
|
+
* @param {string} userId
|
|
274
|
+
* @param {string} userSecret
|
|
275
|
+
* @param {TradingPlaceOCOOrderRequest} tradingPlaceOCOOrderRequest
|
|
276
|
+
* @param {*} [options] Override http request option.
|
|
277
|
+
* @throws {RequiredError}
|
|
278
|
+
*/
|
|
279
|
+
placeOCOOrder: (userId, userSecret, tradingPlaceOCOOrderRequest, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
280
|
+
// verify required parameter 'userId' is not null or undefined
|
|
281
|
+
(0, common_1.assertParamExists)('placeOCOOrder', 'userId', userId);
|
|
282
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
283
|
+
(0, common_1.assertParamExists)('placeOCOOrder', 'userSecret', userSecret);
|
|
284
|
+
// verify required parameter 'tradingPlaceOCOOrderRequest' is not null or undefined
|
|
285
|
+
(0, common_1.assertParamExists)('placeOCOOrder', 'tradingPlaceOCOOrderRequest', tradingPlaceOCOOrderRequest);
|
|
286
|
+
const localVarPath = `/trade/oco`;
|
|
287
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
288
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
289
|
+
let baseOptions;
|
|
290
|
+
if (configuration) {
|
|
291
|
+
baseOptions = configuration.baseOptions;
|
|
292
|
+
}
|
|
293
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
294
|
+
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
295
|
+
const localVarQueryParameter = {};
|
|
296
|
+
// authentication PartnerClientId required
|
|
297
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
298
|
+
// authentication PartnerSignature required
|
|
299
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
300
|
+
// authentication PartnerTimestamp required
|
|
301
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
302
|
+
if (userId !== undefined) {
|
|
303
|
+
localVarQueryParameter['userId'] = userId;
|
|
304
|
+
}
|
|
305
|
+
if (userSecret !== undefined) {
|
|
306
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
307
|
+
}
|
|
308
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
309
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
310
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
311
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
312
|
+
requestBody: tradingPlaceOCOOrderRequest,
|
|
313
|
+
queryParameters: localVarQueryParameter,
|
|
314
|
+
requestConfig: localVarRequestOptions,
|
|
315
|
+
path: localVarPath,
|
|
316
|
+
configuration
|
|
317
|
+
});
|
|
318
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(tradingPlaceOCOOrderRequest, localVarRequestOptions, configuration);
|
|
319
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
320
|
+
return {
|
|
321
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
322
|
+
options: localVarRequestOptions,
|
|
323
|
+
};
|
|
324
|
+
}),
|
|
325
|
+
/**
|
|
326
|
+
*
|
|
327
|
+
* @summary Place order
|
|
328
|
+
* @param {string} tradeId The ID of trade object obtained from trade/impact endpoint
|
|
329
|
+
* @param {string} userId
|
|
330
|
+
* @param {string} userSecret
|
|
331
|
+
* @param {*} [options] Override http request option.
|
|
332
|
+
* @throws {RequiredError}
|
|
333
|
+
*/
|
|
334
|
+
placeOrder: (tradeId, userId, userSecret, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
335
|
+
// verify required parameter 'tradeId' is not null or undefined
|
|
336
|
+
(0, common_1.assertParamExists)('placeOrder', 'tradeId', tradeId);
|
|
337
|
+
// verify required parameter 'userId' is not null or undefined
|
|
338
|
+
(0, common_1.assertParamExists)('placeOrder', 'userId', userId);
|
|
339
|
+
// verify required parameter 'userSecret' is not null or undefined
|
|
340
|
+
(0, common_1.assertParamExists)('placeOrder', 'userSecret', userSecret);
|
|
341
|
+
const localVarPath = `/trade/{tradeId}`
|
|
342
|
+
.replace(`{${"tradeId"}}`, encodeURIComponent(String(tradeId !== undefined ? tradeId : `-tradeId-`)));
|
|
343
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
344
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
345
|
+
let baseOptions;
|
|
346
|
+
if (configuration) {
|
|
347
|
+
baseOptions = configuration.baseOptions;
|
|
348
|
+
}
|
|
349
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
350
|
+
const localVarHeaderParameter = configuration && !(0, common_1.isBrowser)() ? { "User-Agent": configuration.userAgent } : {};
|
|
351
|
+
const localVarQueryParameter = {};
|
|
352
|
+
// authentication PartnerClientId required
|
|
353
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "clientId", configuration });
|
|
354
|
+
// authentication PartnerSignature required
|
|
355
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarHeaderParameter, keyParamName: "Signature", configuration });
|
|
356
|
+
// authentication PartnerTimestamp required
|
|
357
|
+
yield (0, common_1.setApiKeyToObject)({ object: localVarQueryParameter, keyParamName: "timestamp", configuration });
|
|
358
|
+
if (userId !== undefined) {
|
|
359
|
+
localVarQueryParameter['userId'] = userId;
|
|
360
|
+
}
|
|
361
|
+
if (userSecret !== undefined) {
|
|
362
|
+
localVarQueryParameter['userSecret'] = userSecret;
|
|
363
|
+
}
|
|
364
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
365
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
366
|
+
(0, requestBeforeHook_1.requestBeforeHook)({
|
|
367
|
+
queryParameters: localVarQueryParameter,
|
|
368
|
+
requestConfig: localVarRequestOptions,
|
|
369
|
+
path: localVarPath,
|
|
370
|
+
configuration
|
|
371
|
+
});
|
|
372
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
373
|
+
return {
|
|
374
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
375
|
+
options: localVarRequestOptions,
|
|
376
|
+
};
|
|
377
|
+
}),
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
exports.TradingApiAxiosParamCreator = TradingApiAxiosParamCreator;
|
|
381
|
+
/**
|
|
382
|
+
* TradingApi - functional programming interface
|
|
383
|
+
* @export
|
|
384
|
+
*/
|
|
385
|
+
const TradingApiFp = function (configuration) {
|
|
386
|
+
const localVarAxiosParamCreator = (0, exports.TradingApiAxiosParamCreator)(configuration);
|
|
387
|
+
return {
|
|
388
|
+
/**
|
|
389
|
+
*
|
|
390
|
+
* @summary Cancel open order in account
|
|
391
|
+
* @param {TradingApiCancelUserAccountOrderRequest} requestParameters Request parameters.
|
|
392
|
+
* @param {*} [options] Override http request option.
|
|
393
|
+
* @throws {RequiredError}
|
|
394
|
+
*/
|
|
395
|
+
cancelUserAccountOrder(requestParameters, options) {
|
|
396
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
397
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.cancelUserAccountOrder(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters, options);
|
|
398
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
399
|
+
});
|
|
400
|
+
},
|
|
401
|
+
/**
|
|
402
|
+
*
|
|
403
|
+
* @summary Check impact of trades on account.
|
|
404
|
+
* @param {TradingApiGetOrderImpactRequest} requestParameters Request parameters.
|
|
405
|
+
* @param {*} [options] Override http request option.
|
|
406
|
+
* @throws {RequiredError}
|
|
407
|
+
*/
|
|
408
|
+
getOrderImpact(requestParameters, options) {
|
|
409
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
410
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrderImpact(requestParameters.userId, requestParameters.userSecret, requestParameters, options);
|
|
411
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
412
|
+
});
|
|
413
|
+
},
|
|
414
|
+
/**
|
|
415
|
+
*
|
|
416
|
+
* @summary Get symbol quotes
|
|
417
|
+
* @param {TradingApiGetUserAccountQuotesRequest} requestParameters Request parameters.
|
|
418
|
+
* @param {*} [options] Override http request option.
|
|
419
|
+
* @throws {RequiredError}
|
|
420
|
+
*/
|
|
421
|
+
getUserAccountQuotes(requestParameters, options) {
|
|
422
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
423
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getUserAccountQuotes(requestParameters.userId, requestParameters.userSecret, requestParameters.symbols, requestParameters.accountId, requestParameters.useTicker, options);
|
|
424
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
425
|
+
});
|
|
426
|
+
},
|
|
427
|
+
/**
|
|
428
|
+
*
|
|
429
|
+
* @summary Place a trade with NO validation.
|
|
430
|
+
* @param {TradingApiPlaceForceOrderRequest} requestParameters Request parameters.
|
|
431
|
+
* @param {*} [options] Override http request option.
|
|
432
|
+
* @throws {RequiredError}
|
|
433
|
+
*/
|
|
434
|
+
placeForceOrder(requestParameters, options) {
|
|
435
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
436
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeForceOrder(requestParameters.userId, requestParameters.userSecret, requestParameters, options);
|
|
437
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
438
|
+
});
|
|
439
|
+
},
|
|
440
|
+
/**
|
|
441
|
+
*
|
|
442
|
+
* @summary Place a OCO (One Cancels Other) order
|
|
443
|
+
* @param {TradingApiPlaceOCOOrderRequest} requestParameters Request parameters.
|
|
444
|
+
* @param {*} [options] Override http request option.
|
|
445
|
+
* @throws {RequiredError}
|
|
446
|
+
*/
|
|
447
|
+
placeOCOOrder(requestParameters, options) {
|
|
448
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
449
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeOCOOrder(requestParameters.userId, requestParameters.userSecret, requestParameters, options);
|
|
450
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
451
|
+
});
|
|
452
|
+
},
|
|
453
|
+
/**
|
|
454
|
+
*
|
|
455
|
+
* @summary Place order
|
|
456
|
+
* @param {TradingApiPlaceOrderRequest} requestParameters Request parameters.
|
|
457
|
+
* @param {*} [options] Override http request option.
|
|
458
|
+
* @throws {RequiredError}
|
|
459
|
+
*/
|
|
460
|
+
placeOrder(requestParameters, options) {
|
|
461
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
462
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.placeOrder(requestParameters.tradeId, requestParameters.userId, requestParameters.userSecret, options);
|
|
463
|
+
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
464
|
+
});
|
|
465
|
+
},
|
|
466
|
+
};
|
|
467
|
+
};
|
|
468
|
+
exports.TradingApiFp = TradingApiFp;
|
|
469
|
+
/**
|
|
470
|
+
* TradingApi - factory interface
|
|
471
|
+
* @export
|
|
472
|
+
*/
|
|
473
|
+
const TradingApiFactory = function (configuration, basePath, axios) {
|
|
474
|
+
const localVarFp = (0, exports.TradingApiFp)(configuration);
|
|
475
|
+
return {
|
|
476
|
+
/**
|
|
477
|
+
*
|
|
478
|
+
* @summary Cancel open order in account
|
|
479
|
+
* @param {TradingApiCancelUserAccountOrderRequest} requestParameters Request parameters.
|
|
480
|
+
* @param {*} [options] Override http request option.
|
|
481
|
+
* @throws {RequiredError}
|
|
482
|
+
*/
|
|
483
|
+
cancelUserAccountOrder(requestParameters, options) {
|
|
484
|
+
return localVarFp.cancelUserAccountOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
485
|
+
},
|
|
486
|
+
/**
|
|
487
|
+
*
|
|
488
|
+
* @summary Check impact of trades on account.
|
|
489
|
+
* @param {TradingApiGetOrderImpactRequest} requestParameters Request parameters.
|
|
490
|
+
* @param {*} [options] Override http request option.
|
|
491
|
+
* @throws {RequiredError}
|
|
492
|
+
*/
|
|
493
|
+
getOrderImpact(requestParameters, options) {
|
|
494
|
+
return localVarFp.getOrderImpact(requestParameters, options).then((request) => request(axios, basePath));
|
|
495
|
+
},
|
|
496
|
+
/**
|
|
497
|
+
*
|
|
498
|
+
* @summary Get symbol quotes
|
|
499
|
+
* @param {TradingApiGetUserAccountQuotesRequest} requestParameters Request parameters.
|
|
500
|
+
* @param {*} [options] Override http request option.
|
|
501
|
+
* @throws {RequiredError}
|
|
502
|
+
*/
|
|
503
|
+
getUserAccountQuotes(requestParameters, options) {
|
|
504
|
+
return localVarFp.getUserAccountQuotes(requestParameters, options).then((request) => request(axios, basePath));
|
|
505
|
+
},
|
|
506
|
+
/**
|
|
507
|
+
*
|
|
508
|
+
* @summary Place a trade with NO validation.
|
|
509
|
+
* @param {TradingApiPlaceForceOrderRequest} requestParameters Request parameters.
|
|
510
|
+
* @param {*} [options] Override http request option.
|
|
511
|
+
* @throws {RequiredError}
|
|
512
|
+
*/
|
|
513
|
+
placeForceOrder(requestParameters, options) {
|
|
514
|
+
return localVarFp.placeForceOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
515
|
+
},
|
|
516
|
+
/**
|
|
517
|
+
*
|
|
518
|
+
* @summary Place a OCO (One Cancels Other) order
|
|
519
|
+
* @param {TradingApiPlaceOCOOrderRequest} requestParameters Request parameters.
|
|
520
|
+
* @param {*} [options] Override http request option.
|
|
521
|
+
* @throws {RequiredError}
|
|
522
|
+
*/
|
|
523
|
+
placeOCOOrder(requestParameters, options) {
|
|
524
|
+
return localVarFp.placeOCOOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
525
|
+
},
|
|
526
|
+
/**
|
|
527
|
+
*
|
|
528
|
+
* @summary Place order
|
|
529
|
+
* @param {TradingApiPlaceOrderRequest} requestParameters Request parameters.
|
|
530
|
+
* @param {*} [options] Override http request option.
|
|
531
|
+
* @throws {RequiredError}
|
|
532
|
+
*/
|
|
533
|
+
placeOrder(requestParameters, options) {
|
|
534
|
+
return localVarFp.placeOrder(requestParameters, options).then((request) => request(axios, basePath));
|
|
535
|
+
},
|
|
536
|
+
};
|
|
537
|
+
};
|
|
538
|
+
exports.TradingApiFactory = TradingApiFactory;
|
|
539
|
+
/**
|
|
540
|
+
* TradingApiGenerated - object-oriented interface
|
|
541
|
+
* @export
|
|
542
|
+
* @class TradingApiGenerated
|
|
543
|
+
* @extends {BaseAPI}
|
|
544
|
+
*/
|
|
545
|
+
class TradingApiGenerated extends base_1.BaseAPI {
|
|
546
|
+
/**
|
|
547
|
+
*
|
|
548
|
+
* @summary Cancel open order in account
|
|
549
|
+
* @param {TradingApiCancelUserAccountOrderRequest} requestParameters Request parameters.
|
|
550
|
+
* @param {*} [options] Override http request option.
|
|
551
|
+
* @throws {RequiredError}
|
|
552
|
+
* @memberof TradingApiGenerated
|
|
553
|
+
*/
|
|
554
|
+
cancelUserAccountOrder(requestParameters, options) {
|
|
555
|
+
return (0, exports.TradingApiFp)(this.configuration).cancelUserAccountOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
*
|
|
559
|
+
* @summary Check impact of trades on account.
|
|
560
|
+
* @param {TradingApiGetOrderImpactRequest} requestParameters Request parameters.
|
|
561
|
+
* @param {*} [options] Override http request option.
|
|
562
|
+
* @throws {RequiredError}
|
|
563
|
+
* @memberof TradingApiGenerated
|
|
564
|
+
*/
|
|
565
|
+
getOrderImpact(requestParameters, options) {
|
|
566
|
+
return (0, exports.TradingApiFp)(this.configuration).getOrderImpact(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
*
|
|
570
|
+
* @summary Get symbol quotes
|
|
571
|
+
* @param {TradingApiGetUserAccountQuotesRequest} requestParameters Request parameters.
|
|
572
|
+
* @param {*} [options] Override http request option.
|
|
573
|
+
* @throws {RequiredError}
|
|
574
|
+
* @memberof TradingApiGenerated
|
|
575
|
+
*/
|
|
576
|
+
getUserAccountQuotes(requestParameters, options) {
|
|
577
|
+
return (0, exports.TradingApiFp)(this.configuration).getUserAccountQuotes(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
*
|
|
581
|
+
* @summary Place a trade with NO validation.
|
|
582
|
+
* @param {TradingApiPlaceForceOrderRequest} requestParameters Request parameters.
|
|
583
|
+
* @param {*} [options] Override http request option.
|
|
584
|
+
* @throws {RequiredError}
|
|
585
|
+
* @memberof TradingApiGenerated
|
|
586
|
+
*/
|
|
587
|
+
placeForceOrder(requestParameters, options) {
|
|
588
|
+
return (0, exports.TradingApiFp)(this.configuration).placeForceOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
*
|
|
592
|
+
* @summary Place a OCO (One Cancels Other) order
|
|
593
|
+
* @param {TradingApiPlaceOCOOrderRequest} requestParameters Request parameters.
|
|
594
|
+
* @param {*} [options] Override http request option.
|
|
595
|
+
* @throws {RequiredError}
|
|
596
|
+
* @memberof TradingApiGenerated
|
|
597
|
+
*/
|
|
598
|
+
placeOCOOrder(requestParameters, options) {
|
|
599
|
+
return (0, exports.TradingApiFp)(this.configuration).placeOCOOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
*
|
|
603
|
+
* @summary Place order
|
|
604
|
+
* @param {TradingApiPlaceOrderRequest} requestParameters Request parameters.
|
|
605
|
+
* @param {*} [options] Override http request option.
|
|
606
|
+
* @throws {RequiredError}
|
|
607
|
+
* @memberof TradingApiGenerated
|
|
608
|
+
*/
|
|
609
|
+
placeOrder(requestParameters, options) {
|
|
610
|
+
return (0, exports.TradingApiFp)(this.configuration).placeOrder(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
exports.TradingApiGenerated = TradingApiGenerated;
|