snaptrade-typescript-sdk 12.2.16 → 12.2.18
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 +260 -1
- package/dist/browser.umd.js +1 -1
- package/dist/index.cjs +371 -5
- package/dist/index.d.cts +857 -521
- package/dist/index.d.mts +857 -521
- package/dist/index.d.ts +857 -521
- package/dist/index.mjs +371 -5
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -394,7 +394,7 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
394
394
|
};
|
|
395
395
|
},
|
|
396
396
|
/**
|
|
397
|
-
* An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons)
|
|
397
|
+
* An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons) The data may contain gaps and is best used for charting account value trends. It should not be relied on as a complete or exact record of historical account values.
|
|
398
398
|
* @summary List historical account total value
|
|
399
399
|
* @param {string} accountId
|
|
400
400
|
* @param {string} [userId]
|
|
@@ -1241,7 +1241,7 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1241
1241
|
});
|
|
1242
1242
|
},
|
|
1243
1243
|
/**
|
|
1244
|
-
* An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons)
|
|
1244
|
+
* An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons) The data may contain gaps and is best used for charting account value trends. It should not be relied on as a complete or exact record of historical account values.
|
|
1245
1245
|
* @summary List historical account total value
|
|
1246
1246
|
* @param {AccountInformationApiGetAccountBalanceHistoryRequest<TAuth>} requestParameters Request parameters.
|
|
1247
1247
|
* @param {*} [options] Override http request option.
|
|
@@ -1515,7 +1515,7 @@ const AccountInformationApiFactory = function(configuration, basePath, axios) {
|
|
|
1515
1515
|
return localVarFp.getAccountActivities(...args).then((request) => request(axios, basePath));
|
|
1516
1516
|
},
|
|
1517
1517
|
/**
|
|
1518
|
-
* An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons)
|
|
1518
|
+
* An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons) The data may contain gaps and is best used for charting account value trends. It should not be relied on as a complete or exact record of historical account values.
|
|
1519
1519
|
* @summary List historical account total value
|
|
1520
1520
|
* @param {AccountInformationApiGetAccountBalanceHistoryRequest<TAuth>} requestParameters Request parameters.
|
|
1521
1521
|
* @param {*} [options] Override http request option.
|
|
@@ -1646,7 +1646,7 @@ var AccountInformationApiGenerated = class extends BaseAPI {
|
|
|
1646
1646
|
return AccountInformationApiFp(this.configuration).getAccountActivities(...args).then((request) => request(this.axios, this.basePath));
|
|
1647
1647
|
}
|
|
1648
1648
|
/**
|
|
1649
|
-
* An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons)
|
|
1649
|
+
* An experimental endpoint that returns estimated historical total account value for the specified account. Total account value is the sum of the market value of all positions and cash in the account at a given time. This endpoint is experimental, disabled by default, and has a maximum lookback of 1 year. Because the data is dynamically generated, we recommend replacing your dataset with each request as opposed to combining data from multiple requests. Enable this feature for free in the [Add-on page of the Customer Dashboard](https://dashboard.snaptrade.com/add-ons) The data may contain gaps and is best used for charting account value trends. It should not be relied on as a complete or exact record of historical account values.
|
|
1650
1650
|
* @summary List historical account total value
|
|
1651
1651
|
* @param {AccountInformationApiGetAccountBalanceHistoryRequest<TAuth>} requestParameters Request parameters.
|
|
1652
1652
|
* @param {*} [options] Override http request option.
|
|
@@ -3674,6 +3674,79 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
|
3674
3674
|
};
|
|
3675
3675
|
},
|
|
3676
3676
|
/**
|
|
3677
|
+
* Experimental and subject to change without notice. Returns the specified account for the authenticated user, using the `kind`-discriminated account shape. Use the `kind` discriminator to determine the shape of the account, which can be an investment, deposit, or line of credit account. On Pay as you Go / Real-time, this endpoint refreshes the account\'s opening date and total net value (`net_value`) live from the institution on each call, along with funding date for `investment` accounts. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data. If the connection has become disabled, it can no longer access the latest data from the institution, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
3678
|
+
* @summary Get account details
|
|
3679
|
+
* @param {string} accountId
|
|
3680
|
+
* @param {string} [userId]
|
|
3681
|
+
* @param {string} [userSecret]
|
|
3682
|
+
* @param {*} [options] Override http request option.
|
|
3683
|
+
* @throws {RequiredError}
|
|
3684
|
+
*/
|
|
3685
|
+
getAccountDetails: async (accountId, userId, userSecret, options = {}) => {
|
|
3686
|
+
assertParamExists("getAccountDetails", "accountId", accountId);
|
|
3687
|
+
const localVarPath = `/accounts/{accountId}/details`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
|
|
3688
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3689
|
+
let baseOptions;
|
|
3690
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
3691
|
+
const localVarRequestOptions = {
|
|
3692
|
+
method: "GET",
|
|
3693
|
+
...baseOptions,
|
|
3694
|
+
...options
|
|
3695
|
+
};
|
|
3696
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
3697
|
+
const localVarQueryParameter = {};
|
|
3698
|
+
if (configuration?.authMode === "commercialApiKey") {
|
|
3699
|
+
await setApiKeyToObject({
|
|
3700
|
+
object: localVarQueryParameter,
|
|
3701
|
+
key: "clientId",
|
|
3702
|
+
keyParamName: "clientId",
|
|
3703
|
+
configuration
|
|
3704
|
+
});
|
|
3705
|
+
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
3706
|
+
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
3707
|
+
}
|
|
3708
|
+
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
3709
|
+
object: localVarQueryParameter,
|
|
3710
|
+
key: "clientId",
|
|
3711
|
+
keyParamName: "clientId",
|
|
3712
|
+
configuration
|
|
3713
|
+
});
|
|
3714
|
+
const localVarOperationAuth = {
|
|
3715
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
3716
|
+
requestSigningByAuthMode: {
|
|
3717
|
+
"commercialApiKey": {
|
|
3718
|
+
secretParameter: "consumerKey",
|
|
3719
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
3720
|
+
},
|
|
3721
|
+
"personalApiKey": {
|
|
3722
|
+
secretParameter: "consumerKey",
|
|
3723
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
3724
|
+
}
|
|
3725
|
+
},
|
|
3726
|
+
selectedAuthMode: configuration?.authMode
|
|
3727
|
+
};
|
|
3728
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3729
|
+
localVarRequestOptions.headers = {
|
|
3730
|
+
...localVarHeaderParameter,
|
|
3731
|
+
...headersFromBaseOptions,
|
|
3732
|
+
...options.headers
|
|
3733
|
+
};
|
|
3734
|
+
requestBeforeHook({
|
|
3735
|
+
queryParameters: localVarQueryParameter,
|
|
3736
|
+
requestConfig: localVarRequestOptions,
|
|
3737
|
+
path: localVarPath,
|
|
3738
|
+
configuration,
|
|
3739
|
+
pathTemplate: "/accounts/{accountId}/details",
|
|
3740
|
+
httpMethod: "GET",
|
|
3741
|
+
operationAuth: localVarOperationAuth
|
|
3742
|
+
});
|
|
3743
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
3744
|
+
return {
|
|
3745
|
+
url: toPathString(localVarUrlObj),
|
|
3746
|
+
options: localVarRequestOptions
|
|
3747
|
+
};
|
|
3748
|
+
},
|
|
3749
|
+
/**
|
|
3677
3750
|
* Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
3678
3751
|
* @summary Get account order detail (V2)
|
|
3679
3752
|
* @param {string} accountId
|
|
@@ -3901,6 +3974,77 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
|
3901
3974
|
};
|
|
3902
3975
|
},
|
|
3903
3976
|
/**
|
|
3977
|
+
* Experimental and subject to change without notice. Returns all accounts across all connections known to SnapTrade for the authenticated user. The `results` list can contain multiple account kinds in the same response, including investment, deposit, and line of credit accounts. Use the `kind` discriminator to determine the shape for each account. This endpoint returns Daily data regardless of the customer\'s plan. Daily data is cached and refreshed once a day, which makes this endpoint fast and well-suited to listing accounts across all of a user\'s connections in a single call. Exact refresh timing may vary by institution. To get real-time data on Pay as you Go / Real-time, use the [list accounts for a connection endpoint](/reference/Connections/Connections_listConnectionAccounts). Customers on Pay as you Go / Daily can force a refresh with the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
3978
|
+
* @summary List all user accounts
|
|
3979
|
+
* @param {string} [userId]
|
|
3980
|
+
* @param {string} [userSecret]
|
|
3981
|
+
* @param {*} [options] Override http request option.
|
|
3982
|
+
* @throws {RequiredError}
|
|
3983
|
+
*/
|
|
3984
|
+
listAllUserAccounts: async (userId, userSecret, options = {}) => {
|
|
3985
|
+
const localVarPath = `/accounts/all`;
|
|
3986
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3987
|
+
let baseOptions;
|
|
3988
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
3989
|
+
const localVarRequestOptions = {
|
|
3990
|
+
method: "GET",
|
|
3991
|
+
...baseOptions,
|
|
3992
|
+
...options
|
|
3993
|
+
};
|
|
3994
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
3995
|
+
const localVarQueryParameter = {};
|
|
3996
|
+
if (configuration?.authMode === "commercialApiKey") {
|
|
3997
|
+
await setApiKeyToObject({
|
|
3998
|
+
object: localVarQueryParameter,
|
|
3999
|
+
key: "clientId",
|
|
4000
|
+
keyParamName: "clientId",
|
|
4001
|
+
configuration
|
|
4002
|
+
});
|
|
4003
|
+
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
4004
|
+
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
4005
|
+
}
|
|
4006
|
+
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
4007
|
+
object: localVarQueryParameter,
|
|
4008
|
+
key: "clientId",
|
|
4009
|
+
keyParamName: "clientId",
|
|
4010
|
+
configuration
|
|
4011
|
+
});
|
|
4012
|
+
const localVarOperationAuth = {
|
|
4013
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4014
|
+
requestSigningByAuthMode: {
|
|
4015
|
+
"commercialApiKey": {
|
|
4016
|
+
secretParameter: "consumerKey",
|
|
4017
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4018
|
+
},
|
|
4019
|
+
"personalApiKey": {
|
|
4020
|
+
secretParameter: "consumerKey",
|
|
4021
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4022
|
+
}
|
|
4023
|
+
},
|
|
4024
|
+
selectedAuthMode: configuration?.authMode
|
|
4025
|
+
};
|
|
4026
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4027
|
+
localVarRequestOptions.headers = {
|
|
4028
|
+
...localVarHeaderParameter,
|
|
4029
|
+
...headersFromBaseOptions,
|
|
4030
|
+
...options.headers
|
|
4031
|
+
};
|
|
4032
|
+
requestBeforeHook({
|
|
4033
|
+
queryParameters: localVarQueryParameter,
|
|
4034
|
+
requestConfig: localVarRequestOptions,
|
|
4035
|
+
path: localVarPath,
|
|
4036
|
+
configuration,
|
|
4037
|
+
pathTemplate: "/accounts/all",
|
|
4038
|
+
httpMethod: "GET",
|
|
4039
|
+
operationAuth: localVarOperationAuth
|
|
4040
|
+
});
|
|
4041
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
4042
|
+
return {
|
|
4043
|
+
url: toPathString(localVarUrlObj),
|
|
4044
|
+
options: localVarRequestOptions
|
|
4045
|
+
};
|
|
4046
|
+
},
|
|
4047
|
+
/**
|
|
3904
4048
|
* Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|
|
3905
4049
|
* @summary List active Trade Detection subscriptions
|
|
3906
4050
|
* @param {*} [options] Override http request option.
|
|
@@ -3964,6 +4108,84 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
|
3964
4108
|
url: toPathString(localVarUrlObj),
|
|
3965
4109
|
options: localVarRequestOptions
|
|
3966
4110
|
};
|
|
4111
|
+
},
|
|
4112
|
+
/**
|
|
4113
|
+
* **Beta.** Places a single-leg or multi-leg order using a common request format for equities, equity options, futures, and future options. This endpoint is experimental; breaking changes are possible during the experimental phase. Equity and equity-option orders use the existing brokerage trading capabilities. Futures and future options are currently supported only on tastytrade. Order types, time in force, optional fields, and strategy combinations remain subject to brokerage support. See the [brokerage trading support page](https://support.snaptrade.com/brokerages). An order may contain equity/option legs or future/future_option legs, but cannot mix those two families. Equity/option strategies must share the same underlying symbol. Each strategy is submitted as one brokerage order; unsupported strategies are never split into independent orders. Tastytrade supports single-leg outright futures and up to four future-option legs, and does not support multi-leg market orders. All string choices use lower snake_case and are case-sensitive. Symbols retain their native format: equity tickers, OCC equity-option symbols, or the exact tastytrade BrokerageInstrument ticker for futures and future options, including any spaces. A successful response contains only the brokerage order ID. Use the existing order endpoints to retrieve order details.
|
|
4114
|
+
* @summary Place a simple order (beta)
|
|
4115
|
+
* @param {string} accountId The ID of the account to execute the trade on.
|
|
4116
|
+
* @param {SimpleTradeForm} simpleTradeForm
|
|
4117
|
+
* @param {string} [userId]
|
|
4118
|
+
* @param {string} [userSecret]
|
|
4119
|
+
* @param {*} [options] Override http request option.
|
|
4120
|
+
* @throws {RequiredError}
|
|
4121
|
+
*/
|
|
4122
|
+
placeSimpleOrder: async (accountId, simpleTradeForm, userId, userSecret, options = {}) => {
|
|
4123
|
+
assertParamExists("placeSimpleOrder", "accountId", accountId);
|
|
4124
|
+
assertParamExists("placeSimpleOrder", "simpleTradeForm", simpleTradeForm);
|
|
4125
|
+
const localVarPath = `/accounts/{accountId}/trading/simple`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
|
|
4126
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
4127
|
+
let baseOptions;
|
|
4128
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
4129
|
+
const localVarRequestOptions = {
|
|
4130
|
+
method: "POST",
|
|
4131
|
+
...baseOptions,
|
|
4132
|
+
...options
|
|
4133
|
+
};
|
|
4134
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4135
|
+
const localVarQueryParameter = {};
|
|
4136
|
+
if (configuration?.authMode === "commercialApiKey") {
|
|
4137
|
+
await setApiKeyToObject({
|
|
4138
|
+
object: localVarQueryParameter,
|
|
4139
|
+
key: "clientId",
|
|
4140
|
+
keyParamName: "clientId",
|
|
4141
|
+
configuration
|
|
4142
|
+
});
|
|
4143
|
+
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
4144
|
+
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
4145
|
+
}
|
|
4146
|
+
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
4147
|
+
object: localVarQueryParameter,
|
|
4148
|
+
key: "clientId",
|
|
4149
|
+
keyParamName: "clientId",
|
|
4150
|
+
configuration
|
|
4151
|
+
});
|
|
4152
|
+
const localVarOperationAuth = {
|
|
4153
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4154
|
+
requestSigningByAuthMode: {
|
|
4155
|
+
"commercialApiKey": {
|
|
4156
|
+
secretParameter: "consumerKey",
|
|
4157
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4158
|
+
},
|
|
4159
|
+
"personalApiKey": {
|
|
4160
|
+
secretParameter: "consumerKey",
|
|
4161
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4162
|
+
}
|
|
4163
|
+
},
|
|
4164
|
+
selectedAuthMode: configuration?.authMode
|
|
4165
|
+
};
|
|
4166
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
4167
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4168
|
+
localVarRequestOptions.headers = {
|
|
4169
|
+
...localVarHeaderParameter,
|
|
4170
|
+
...headersFromBaseOptions,
|
|
4171
|
+
...options.headers
|
|
4172
|
+
};
|
|
4173
|
+
requestBeforeHook({
|
|
4174
|
+
requestBody: simpleTradeForm,
|
|
4175
|
+
queryParameters: localVarQueryParameter,
|
|
4176
|
+
requestConfig: localVarRequestOptions,
|
|
4177
|
+
path: localVarPath,
|
|
4178
|
+
configuration,
|
|
4179
|
+
pathTemplate: "/accounts/{accountId}/trading/simple",
|
|
4180
|
+
httpMethod: "POST",
|
|
4181
|
+
operationAuth: localVarOperationAuth
|
|
4182
|
+
});
|
|
4183
|
+
localVarRequestOptions.data = serializeDataIfNeeded(simpleTradeForm, localVarRequestOptions, configuration);
|
|
4184
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
4185
|
+
return {
|
|
4186
|
+
url: toPathString(localVarUrlObj),
|
|
4187
|
+
options: localVarRequestOptions
|
|
4188
|
+
};
|
|
3967
4189
|
}
|
|
3968
4190
|
};
|
|
3969
4191
|
};
|
|
@@ -4026,6 +4248,29 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4026
4248
|
});
|
|
4027
4249
|
},
|
|
4028
4250
|
/**
|
|
4251
|
+
* Experimental and subject to change without notice. Returns the specified account for the authenticated user, using the `kind`-discriminated account shape. Use the `kind` discriminator to determine the shape of the account, which can be an investment, deposit, or line of credit account. On Pay as you Go / Real-time, this endpoint refreshes the account\'s opening date and total net value (`net_value`) live from the institution on each call, along with funding date for `investment` accounts. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data. If the connection has become disabled, it can no longer access the latest data from the institution, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
4252
|
+
* @summary Get account details
|
|
4253
|
+
* @param {ExperimentalEndpointsApiGetAccountDetailsRequest<TAuth>} requestParameters Request parameters.
|
|
4254
|
+
* @param {*} [options] Override http request option.
|
|
4255
|
+
* @throws {RequiredError}
|
|
4256
|
+
*/
|
|
4257
|
+
async getAccountDetails(...args) {
|
|
4258
|
+
const [requestParameters = {}, options] = args;
|
|
4259
|
+
return createRequestFunction(await localVarAxiosParamCreator.getAccountDetails(requestParameters.accountId, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
|
|
4260
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4261
|
+
requestSigningByAuthMode: {
|
|
4262
|
+
"commercialApiKey": {
|
|
4263
|
+
secretParameter: "consumerKey",
|
|
4264
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4265
|
+
},
|
|
4266
|
+
"personalApiKey": {
|
|
4267
|
+
secretParameter: "consumerKey",
|
|
4268
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4269
|
+
}
|
|
4270
|
+
}
|
|
4271
|
+
});
|
|
4272
|
+
},
|
|
4273
|
+
/**
|
|
4029
4274
|
* Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
4030
4275
|
* @summary Get account order detail (V2)
|
|
4031
4276
|
* @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request<TAuth>} requestParameters Request parameters.
|
|
@@ -4095,6 +4340,29 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4095
4340
|
});
|
|
4096
4341
|
},
|
|
4097
4342
|
/**
|
|
4343
|
+
* Experimental and subject to change without notice. Returns all accounts across all connections known to SnapTrade for the authenticated user. The `results` list can contain multiple account kinds in the same response, including investment, deposit, and line of credit accounts. Use the `kind` discriminator to determine the shape for each account. This endpoint returns Daily data regardless of the customer\'s plan. Daily data is cached and refreshed once a day, which makes this endpoint fast and well-suited to listing accounts across all of a user\'s connections in a single call. Exact refresh timing may vary by institution. To get real-time data on Pay as you Go / Real-time, use the [list accounts for a connection endpoint](/reference/Connections/Connections_listConnectionAccounts). Customers on Pay as you Go / Daily can force a refresh with the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
4344
|
+
* @summary List all user accounts
|
|
4345
|
+
* @param {ExperimentalEndpointsApiListAllUserAccountsRequest<TAuth>} requestParameters Request parameters.
|
|
4346
|
+
* @param {*} [options] Override http request option.
|
|
4347
|
+
* @throws {RequiredError}
|
|
4348
|
+
*/
|
|
4349
|
+
async listAllUserAccounts(...args) {
|
|
4350
|
+
const [requestParameters = {}, options] = args;
|
|
4351
|
+
return createRequestFunction(await localVarAxiosParamCreator.listAllUserAccounts(requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
|
|
4352
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4353
|
+
requestSigningByAuthMode: {
|
|
4354
|
+
"commercialApiKey": {
|
|
4355
|
+
secretParameter: "consumerKey",
|
|
4356
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4357
|
+
},
|
|
4358
|
+
"personalApiKey": {
|
|
4359
|
+
secretParameter: "consumerKey",
|
|
4360
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4361
|
+
}
|
|
4362
|
+
}
|
|
4363
|
+
});
|
|
4364
|
+
},
|
|
4365
|
+
/**
|
|
4098
4366
|
* Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|
|
4099
4367
|
* @summary List active Trade Detection subscriptions
|
|
4100
4368
|
* @param {*} [options] Override http request option.
|
|
@@ -4115,6 +4383,41 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4115
4383
|
}
|
|
4116
4384
|
}
|
|
4117
4385
|
});
|
|
4386
|
+
},
|
|
4387
|
+
/**
|
|
4388
|
+
* **Beta.** Places a single-leg or multi-leg order using a common request format for equities, equity options, futures, and future options. This endpoint is experimental; breaking changes are possible during the experimental phase. Equity and equity-option orders use the existing brokerage trading capabilities. Futures and future options are currently supported only on tastytrade. Order types, time in force, optional fields, and strategy combinations remain subject to brokerage support. See the [brokerage trading support page](https://support.snaptrade.com/brokerages). An order may contain equity/option legs or future/future_option legs, but cannot mix those two families. Equity/option strategies must share the same underlying symbol. Each strategy is submitted as one brokerage order; unsupported strategies are never split into independent orders. Tastytrade supports single-leg outright futures and up to four future-option legs, and does not support multi-leg market orders. All string choices use lower snake_case and are case-sensitive. Symbols retain their native format: equity tickers, OCC equity-option symbols, or the exact tastytrade BrokerageInstrument ticker for futures and future options, including any spaces. A successful response contains only the brokerage order ID. Use the existing order endpoints to retrieve order details.
|
|
4389
|
+
* @summary Place a simple order (beta)
|
|
4390
|
+
* @param {ExperimentalEndpointsApiPlaceSimpleOrderRequest<TAuth>} requestParameters Request parameters.
|
|
4391
|
+
* @param {*} [options] Override http request option.
|
|
4392
|
+
* @throws {RequiredError}
|
|
4393
|
+
*/
|
|
4394
|
+
async placeSimpleOrder(...args) {
|
|
4395
|
+
const [requestParameters = {}, options] = args;
|
|
4396
|
+
const simpleTradeForm = {
|
|
4397
|
+
order_type: requestParameters.order_type,
|
|
4398
|
+
time_in_force: requestParameters.time_in_force,
|
|
4399
|
+
legs: requestParameters.legs,
|
|
4400
|
+
limit_price: requestParameters.limit_price,
|
|
4401
|
+
stop_price: requestParameters.stop_price,
|
|
4402
|
+
price_effect: requestParameters.price_effect,
|
|
4403
|
+
client_order_id: requestParameters.client_order_id,
|
|
4404
|
+
expiry_date: requestParameters.expiry_date,
|
|
4405
|
+
notional_value: requestParameters.notional_value,
|
|
4406
|
+
trading_session: requestParameters.trading_session
|
|
4407
|
+
};
|
|
4408
|
+
return createRequestFunction(await localVarAxiosParamCreator.placeSimpleOrder(requestParameters.accountId, simpleTradeForm, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
|
|
4409
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4410
|
+
requestSigningByAuthMode: {
|
|
4411
|
+
"commercialApiKey": {
|
|
4412
|
+
secretParameter: "consumerKey",
|
|
4413
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4414
|
+
},
|
|
4415
|
+
"personalApiKey": {
|
|
4416
|
+
secretParameter: "consumerKey",
|
|
4417
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4418
|
+
}
|
|
4419
|
+
}
|
|
4420
|
+
});
|
|
4118
4421
|
}
|
|
4119
4422
|
};
|
|
4120
4423
|
};
|
|
@@ -4146,6 +4449,16 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios)
|
|
|
4146
4449
|
return localVarFp.cancelSubscription(...args).then((request) => request(axios, basePath));
|
|
4147
4450
|
},
|
|
4148
4451
|
/**
|
|
4452
|
+
* Experimental and subject to change without notice. Returns the specified account for the authenticated user, using the `kind`-discriminated account shape. Use the `kind` discriminator to determine the shape of the account, which can be an investment, deposit, or line of credit account. On Pay as you Go / Real-time, this endpoint refreshes the account\'s opening date and total net value (`net_value`) live from the institution on each call, along with funding date for `investment` accounts. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data. If the connection has become disabled, it can no longer access the latest data from the institution, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
4453
|
+
* @summary Get account details
|
|
4454
|
+
* @param {ExperimentalEndpointsApiGetAccountDetailsRequest<TAuth>} requestParameters Request parameters.
|
|
4455
|
+
* @param {*} [options] Override http request option.
|
|
4456
|
+
* @throws {RequiredError}
|
|
4457
|
+
*/
|
|
4458
|
+
getAccountDetails(...args) {
|
|
4459
|
+
return localVarFp.getAccountDetails(...args).then((request) => request(axios, basePath));
|
|
4460
|
+
},
|
|
4461
|
+
/**
|
|
4149
4462
|
* Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
4150
4463
|
* @summary Get account order detail (V2)
|
|
4151
4464
|
* @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request<TAuth>} requestParameters Request parameters.
|
|
@@ -4176,6 +4489,16 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios)
|
|
|
4176
4489
|
return localVarFp.getUserAccountRecentOrdersV2(...args).then((request) => request(axios, basePath));
|
|
4177
4490
|
},
|
|
4178
4491
|
/**
|
|
4492
|
+
* Experimental and subject to change without notice. Returns all accounts across all connections known to SnapTrade for the authenticated user. The `results` list can contain multiple account kinds in the same response, including investment, deposit, and line of credit accounts. Use the `kind` discriminator to determine the shape for each account. This endpoint returns Daily data regardless of the customer\'s plan. Daily data is cached and refreshed once a day, which makes this endpoint fast and well-suited to listing accounts across all of a user\'s connections in a single call. Exact refresh timing may vary by institution. To get real-time data on Pay as you Go / Real-time, use the [list accounts for a connection endpoint](/reference/Connections/Connections_listConnectionAccounts). Customers on Pay as you Go / Daily can force a refresh with the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
4493
|
+
* @summary List all user accounts
|
|
4494
|
+
* @param {ExperimentalEndpointsApiListAllUserAccountsRequest<TAuth>} requestParameters Request parameters.
|
|
4495
|
+
* @param {*} [options] Override http request option.
|
|
4496
|
+
* @throws {RequiredError}
|
|
4497
|
+
*/
|
|
4498
|
+
listAllUserAccounts(...args) {
|
|
4499
|
+
return localVarFp.listAllUserAccounts(...args).then((request) => request(axios, basePath));
|
|
4500
|
+
},
|
|
4501
|
+
/**
|
|
4179
4502
|
* Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|
|
4180
4503
|
* @summary List active Trade Detection subscriptions
|
|
4181
4504
|
* @param {*} [options] Override http request option.
|
|
@@ -4183,6 +4506,16 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios)
|
|
|
4183
4506
|
*/
|
|
4184
4507
|
listSubscriptions(...args) {
|
|
4185
4508
|
return localVarFp.listSubscriptions(...args).then((request) => request(axios, basePath));
|
|
4509
|
+
},
|
|
4510
|
+
/**
|
|
4511
|
+
* **Beta.** Places a single-leg or multi-leg order using a common request format for equities, equity options, futures, and future options. This endpoint is experimental; breaking changes are possible during the experimental phase. Equity and equity-option orders use the existing brokerage trading capabilities. Futures and future options are currently supported only on tastytrade. Order types, time in force, optional fields, and strategy combinations remain subject to brokerage support. See the [brokerage trading support page](https://support.snaptrade.com/brokerages). An order may contain equity/option legs or future/future_option legs, but cannot mix those two families. Equity/option strategies must share the same underlying symbol. Each strategy is submitted as one brokerage order; unsupported strategies are never split into independent orders. Tastytrade supports single-leg outright futures and up to four future-option legs, and does not support multi-leg market orders. All string choices use lower snake_case and are case-sensitive. Symbols retain their native format: equity tickers, OCC equity-option symbols, or the exact tastytrade BrokerageInstrument ticker for futures and future options, including any spaces. A successful response contains only the brokerage order ID. Use the existing order endpoints to retrieve order details.
|
|
4512
|
+
* @summary Place a simple order (beta)
|
|
4513
|
+
* @param {ExperimentalEndpointsApiPlaceSimpleOrderRequest<TAuth>} requestParameters Request parameters.
|
|
4514
|
+
* @param {*} [options] Override http request option.
|
|
4515
|
+
* @throws {RequiredError}
|
|
4516
|
+
*/
|
|
4517
|
+
placeSimpleOrder(...args) {
|
|
4518
|
+
return localVarFp.placeSimpleOrder(...args).then((request) => request(axios, basePath));
|
|
4186
4519
|
}
|
|
4187
4520
|
};
|
|
4188
4521
|
};
|
|
@@ -4216,6 +4549,17 @@ var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
|
|
|
4216
4549
|
return ExperimentalEndpointsApiFp(this.configuration).cancelSubscription(...args).then((request) => request(this.axios, this.basePath));
|
|
4217
4550
|
}
|
|
4218
4551
|
/**
|
|
4552
|
+
* Experimental and subject to change without notice. Returns the specified account for the authenticated user, using the `kind`-discriminated account shape. Use the `kind` discriminator to determine the shape of the account, which can be an investment, deposit, or line of credit account. On Pay as you Go / Real-time, this endpoint refreshes the account\'s opening date and total net value (`net_value`) live from the institution on each call, along with funding date for `investment` accounts. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by institution. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data. If the connection has become disabled, it can no longer access the latest data from the institution, but will continue to return the last available cached state. Please see [this guide](/docs/fix-broken-connections) on how to fix a disabled connection.
|
|
4553
|
+
* @summary Get account details
|
|
4554
|
+
* @param {ExperimentalEndpointsApiGetAccountDetailsRequest<TAuth>} requestParameters Request parameters.
|
|
4555
|
+
* @param {*} [options] Override http request option.
|
|
4556
|
+
* @throws {RequiredError}
|
|
4557
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
4558
|
+
*/
|
|
4559
|
+
getAccountDetails(...args) {
|
|
4560
|
+
return ExperimentalEndpointsApiFp(this.configuration).getAccountDetails(...args).then((request) => request(this.axios, this.basePath));
|
|
4561
|
+
}
|
|
4562
|
+
/**
|
|
4219
4563
|
* Returns the detail of a single order using the brokerage order ID provided as a path parameter. The V2 order response format includes all legs of the order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. This endpoint is always realtime and does not rely on cached data. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
4220
4564
|
* @summary Get account order detail (V2)
|
|
4221
4565
|
* @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request<TAuth>} requestParameters Request parameters.
|
|
@@ -4249,6 +4593,17 @@ var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
|
|
|
4249
4593
|
return ExperimentalEndpointsApiFp(this.configuration).getUserAccountRecentOrdersV2(...args).then((request) => request(this.axios, this.basePath));
|
|
4250
4594
|
}
|
|
4251
4595
|
/**
|
|
4596
|
+
* Experimental and subject to change without notice. Returns all accounts across all connections known to SnapTrade for the authenticated user. The `results` list can contain multiple account kinds in the same response, including investment, deposit, and line of credit accounts. Use the `kind` discriminator to determine the shape for each account. This endpoint returns Daily data regardless of the customer\'s plan. Daily data is cached and refreshed once a day, which makes this endpoint fast and well-suited to listing accounts across all of a user\'s connections in a single call. Exact refresh timing may vary by institution. To get real-time data on Pay as you Go / Real-time, use the [list accounts for a connection endpoint](/reference/Connections/Connections_listConnectionAccounts). Customers on Pay as you Go / Daily can force a refresh with the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
4597
|
+
* @summary List all user accounts
|
|
4598
|
+
* @param {ExperimentalEndpointsApiListAllUserAccountsRequest<TAuth>} requestParameters Request parameters.
|
|
4599
|
+
* @param {*} [options] Override http request option.
|
|
4600
|
+
* @throws {RequiredError}
|
|
4601
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
4602
|
+
*/
|
|
4603
|
+
listAllUserAccounts(...args) {
|
|
4604
|
+
return ExperimentalEndpointsApiFp(this.configuration).listAllUserAccounts(...args).then((request) => request(this.axios, this.basePath));
|
|
4605
|
+
}
|
|
4606
|
+
/**
|
|
4252
4607
|
* Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|
|
4253
4608
|
* @summary List active Trade Detection subscriptions
|
|
4254
4609
|
* @param {*} [options] Override http request option.
|
|
@@ -4258,6 +4613,17 @@ var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
|
|
|
4258
4613
|
listSubscriptions(...args) {
|
|
4259
4614
|
return ExperimentalEndpointsApiFp(this.configuration).listSubscriptions(...args).then((request) => request(this.axios, this.basePath));
|
|
4260
4615
|
}
|
|
4616
|
+
/**
|
|
4617
|
+
* **Beta.** Places a single-leg or multi-leg order using a common request format for equities, equity options, futures, and future options. This endpoint is experimental; breaking changes are possible during the experimental phase. Equity and equity-option orders use the existing brokerage trading capabilities. Futures and future options are currently supported only on tastytrade. Order types, time in force, optional fields, and strategy combinations remain subject to brokerage support. See the [brokerage trading support page](https://support.snaptrade.com/brokerages). An order may contain equity/option legs or future/future_option legs, but cannot mix those two families. Equity/option strategies must share the same underlying symbol. Each strategy is submitted as one brokerage order; unsupported strategies are never split into independent orders. Tastytrade supports single-leg outright futures and up to four future-option legs, and does not support multi-leg market orders. All string choices use lower snake_case and are case-sensitive. Symbols retain their native format: equity tickers, OCC equity-option symbols, or the exact tastytrade BrokerageInstrument ticker for futures and future options, including any spaces. A successful response contains only the brokerage order ID. Use the existing order endpoints to retrieve order details.
|
|
4618
|
+
* @summary Place a simple order (beta)
|
|
4619
|
+
* @param {ExperimentalEndpointsApiPlaceSimpleOrderRequest<TAuth>} requestParameters Request parameters.
|
|
4620
|
+
* @param {*} [options] Override http request option.
|
|
4621
|
+
* @throws {RequiredError}
|
|
4622
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
4623
|
+
*/
|
|
4624
|
+
placeSimpleOrder(...args) {
|
|
4625
|
+
return ExperimentalEndpointsApiFp(this.configuration).placeSimpleOrder(...args).then((request) => request(this.axios, this.basePath));
|
|
4626
|
+
}
|
|
4261
4627
|
};
|
|
4262
4628
|
//#endregion
|
|
4263
4629
|
//#region api/experimental-endpoints-api.ts
|
|
@@ -7127,7 +7493,7 @@ var Configuration = class {
|
|
|
7127
7493
|
}
|
|
7128
7494
|
this.basePath = param.basePath;
|
|
7129
7495
|
this.baseOptions = param.baseOptions ?? {};
|
|
7130
|
-
this.userAgent = param.userAgent === void 0 ? "Konfig/12.2.
|
|
7496
|
+
this.userAgent = param.userAgent === void 0 ? "Konfig/12.2.18/typescript" : param.userAgent;
|
|
7131
7497
|
this.formDataCtor = param.formDataCtor;
|
|
7132
7498
|
}
|
|
7133
7499
|
/**
|