snaptrade-typescript-sdk 13.2.2 → 13.2.4
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 +136 -1
- package/dist/browser.umd.js +3 -3
- package/dist/index.cjs +239 -1
- package/dist/index.d.cts +159 -6
- package/dist/index.d.mts +159 -6
- package/dist/index.d.ts +159 -6
- package/dist/index.mjs +239 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4227,6 +4227,81 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
|
4227
4227
|
};
|
|
4228
4228
|
},
|
|
4229
4229
|
/**
|
|
4230
|
+
* Returns the detail of a single order, identified by the brokerage order ID in the path, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. The order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. Multi-leg orders are a single order with multiple legs. This endpoint is always realtime and does not rely on cached data, except that an order in a terminal state (executed, canceled, rejected, failed, expired, replaced) may be served from a short-lived cache since it can no longer change. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint. **Experimental:** this endpoint may change without notice.
|
|
4231
|
+
* @summary Get account order detail
|
|
4232
|
+
* @param {string} accountId
|
|
4233
|
+
* @param {string} brokerageOrderId
|
|
4234
|
+
* @param {string} [userId]
|
|
4235
|
+
* @param {string} [userSecret]
|
|
4236
|
+
* @param {*} [options] Override http request option.
|
|
4237
|
+
* @throws {RequiredError}
|
|
4238
|
+
*/
|
|
4239
|
+
getAccountOrder: async (accountId, brokerageOrderId, userId, userSecret, options = {}) => {
|
|
4240
|
+
assertParamExists("getAccountOrder", "accountId", accountId);
|
|
4241
|
+
assertParamExists("getAccountOrder", "brokerageOrderId", brokerageOrderId);
|
|
4242
|
+
const localVarPath = `/accounts/{accountId}/orders/{brokerageOrderId}`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`))).replace(`{brokerageOrderId}`, encodeURIComponent(String(brokerageOrderId !== void 0 ? brokerageOrderId : `-brokerageOrderId-`)));
|
|
4243
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
4244
|
+
let baseOptions;
|
|
4245
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
4246
|
+
const localVarRequestOptions = {
|
|
4247
|
+
method: "GET",
|
|
4248
|
+
...baseOptions,
|
|
4249
|
+
...options
|
|
4250
|
+
};
|
|
4251
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4252
|
+
const localVarQueryParameter = {};
|
|
4253
|
+
if (configuration?.authMode === "commercialApiKey") {
|
|
4254
|
+
await setApiKeyToObject({
|
|
4255
|
+
object: localVarQueryParameter,
|
|
4256
|
+
key: "clientId",
|
|
4257
|
+
keyParamName: "clientId",
|
|
4258
|
+
configuration
|
|
4259
|
+
});
|
|
4260
|
+
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
4261
|
+
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
4262
|
+
}
|
|
4263
|
+
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
4264
|
+
object: localVarQueryParameter,
|
|
4265
|
+
key: "clientId",
|
|
4266
|
+
keyParamName: "clientId",
|
|
4267
|
+
configuration
|
|
4268
|
+
});
|
|
4269
|
+
const localVarOperationAuth = {
|
|
4270
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4271
|
+
requestSigningByAuthMode: {
|
|
4272
|
+
"commercialApiKey": {
|
|
4273
|
+
secretParameter: "consumerKey",
|
|
4274
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4275
|
+
},
|
|
4276
|
+
"personalApiKey": {
|
|
4277
|
+
secretParameter: "consumerKey",
|
|
4278
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4279
|
+
}
|
|
4280
|
+
},
|
|
4281
|
+
selectedAuthMode: configuration?.authMode
|
|
4282
|
+
};
|
|
4283
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4284
|
+
localVarRequestOptions.headers = {
|
|
4285
|
+
...localVarHeaderParameter,
|
|
4286
|
+
...headersFromBaseOptions,
|
|
4287
|
+
...options.headers
|
|
4288
|
+
};
|
|
4289
|
+
requestBeforeHook({
|
|
4290
|
+
queryParameters: localVarQueryParameter,
|
|
4291
|
+
requestConfig: localVarRequestOptions,
|
|
4292
|
+
path: localVarPath,
|
|
4293
|
+
configuration,
|
|
4294
|
+
pathTemplate: "/accounts/{accountId}/orders/{brokerageOrderId}",
|
|
4295
|
+
httpMethod: "GET",
|
|
4296
|
+
operationAuth: localVarOperationAuth
|
|
4297
|
+
});
|
|
4298
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
4299
|
+
return {
|
|
4300
|
+
url: toPathString(localVarUrlObj),
|
|
4301
|
+
options: localVarRequestOptions
|
|
4302
|
+
};
|
|
4303
|
+
},
|
|
4304
|
+
/**
|
|
4230
4305
|
* Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Experimental:** this endpoint may change without notice. If the connection has become disabled, it can no longer access the latest data from the brokerage, 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.
|
|
4231
4306
|
* @summary List all account orders
|
|
4232
4307
|
* @param {string} accountId
|
|
@@ -4304,6 +4379,81 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
|
4304
4379
|
};
|
|
4305
4380
|
},
|
|
4306
4381
|
/**
|
|
4382
|
+
* A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from `/accounts/{accountId}/orders/all` in that it is always realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. Every order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. `data_freshness.as_of` is the time of this live request. **Experimental:** this endpoint may change without notice. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
|
|
4383
|
+
* @summary List all account recent orders (last 24 hours only)
|
|
4384
|
+
* @param {string} accountId
|
|
4385
|
+
* @param {boolean} [onlyExecuted] Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well
|
|
4386
|
+
* @param {string} [userId]
|
|
4387
|
+
* @param {string} [userSecret]
|
|
4388
|
+
* @param {*} [options] Override http request option.
|
|
4389
|
+
* @throws {RequiredError}
|
|
4390
|
+
*/
|
|
4391
|
+
getAllAccountRecentOrders: async (accountId, onlyExecuted, userId, userSecret, options = {}) => {
|
|
4392
|
+
assertParamExists("getAllAccountRecentOrders", "accountId", accountId);
|
|
4393
|
+
const localVarPath = `/accounts/{accountId}/orders/recent`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
|
|
4394
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
4395
|
+
let baseOptions;
|
|
4396
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
4397
|
+
const localVarRequestOptions = {
|
|
4398
|
+
method: "GET",
|
|
4399
|
+
...baseOptions,
|
|
4400
|
+
...options
|
|
4401
|
+
};
|
|
4402
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4403
|
+
const localVarQueryParameter = {};
|
|
4404
|
+
if (configuration?.authMode === "commercialApiKey") {
|
|
4405
|
+
await setApiKeyToObject({
|
|
4406
|
+
object: localVarQueryParameter,
|
|
4407
|
+
key: "clientId",
|
|
4408
|
+
keyParamName: "clientId",
|
|
4409
|
+
configuration
|
|
4410
|
+
});
|
|
4411
|
+
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
4412
|
+
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
4413
|
+
}
|
|
4414
|
+
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
4415
|
+
object: localVarQueryParameter,
|
|
4416
|
+
key: "clientId",
|
|
4417
|
+
keyParamName: "clientId",
|
|
4418
|
+
configuration
|
|
4419
|
+
});
|
|
4420
|
+
if (onlyExecuted !== void 0) localVarQueryParameter["only_executed"] = onlyExecuted;
|
|
4421
|
+
const localVarOperationAuth = {
|
|
4422
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4423
|
+
requestSigningByAuthMode: {
|
|
4424
|
+
"commercialApiKey": {
|
|
4425
|
+
secretParameter: "consumerKey",
|
|
4426
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4427
|
+
},
|
|
4428
|
+
"personalApiKey": {
|
|
4429
|
+
secretParameter: "consumerKey",
|
|
4430
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4431
|
+
}
|
|
4432
|
+
},
|
|
4433
|
+
selectedAuthMode: configuration?.authMode
|
|
4434
|
+
};
|
|
4435
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4436
|
+
localVarRequestOptions.headers = {
|
|
4437
|
+
...localVarHeaderParameter,
|
|
4438
|
+
...headersFromBaseOptions,
|
|
4439
|
+
...options.headers
|
|
4440
|
+
};
|
|
4441
|
+
requestBeforeHook({
|
|
4442
|
+
queryParameters: localVarQueryParameter,
|
|
4443
|
+
requestConfig: localVarRequestOptions,
|
|
4444
|
+
path: localVarPath,
|
|
4445
|
+
configuration,
|
|
4446
|
+
pathTemplate: "/accounts/{accountId}/orders/recent",
|
|
4447
|
+
httpMethod: "GET",
|
|
4448
|
+
operationAuth: localVarOperationAuth
|
|
4449
|
+
});
|
|
4450
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
4451
|
+
return {
|
|
4452
|
+
url: toPathString(localVarUrlObj),
|
|
4453
|
+
options: localVarRequestOptions
|
|
4454
|
+
};
|
|
4455
|
+
},
|
|
4456
|
+
/**
|
|
4307
4457
|
* 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.
|
|
4308
4458
|
* @summary Get account order detail (V2)
|
|
4309
4459
|
* @param {string} accountId
|
|
@@ -4754,6 +4904,29 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4754
4904
|
});
|
|
4755
4905
|
},
|
|
4756
4906
|
/**
|
|
4907
|
+
* Returns the detail of a single order, identified by the brokerage order ID in the path, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. The order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. Multi-leg orders are a single order with multiple legs. This endpoint is always realtime and does not rely on cached data, except that an order in a terminal state (executed, canceled, rejected, failed, expired, replaced) may be served from a short-lived cache since it can no longer change. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint. **Experimental:** this endpoint may change without notice.
|
|
4908
|
+
* @summary Get account order detail
|
|
4909
|
+
* @param {ExperimentalEndpointsApiGetAccountOrderRequest<TAuth>} requestParameters Request parameters.
|
|
4910
|
+
* @param {*} [options] Override http request option.
|
|
4911
|
+
* @throws {RequiredError}
|
|
4912
|
+
*/
|
|
4913
|
+
async getAccountOrder(...args) {
|
|
4914
|
+
const [requestParameters = {}, options] = args;
|
|
4915
|
+
return createRequestFunction(await localVarAxiosParamCreator.getAccountOrder(requestParameters.accountId, requestParameters.brokerageOrderId, requestParameters.userId, requestParameters.userSecret, options), axios, BASE_PATH, configuration, {
|
|
4916
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4917
|
+
requestSigningByAuthMode: {
|
|
4918
|
+
"commercialApiKey": {
|
|
4919
|
+
secretParameter: "consumerKey",
|
|
4920
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4921
|
+
},
|
|
4922
|
+
"personalApiKey": {
|
|
4923
|
+
secretParameter: "consumerKey",
|
|
4924
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4925
|
+
}
|
|
4926
|
+
}
|
|
4927
|
+
});
|
|
4928
|
+
},
|
|
4929
|
+
/**
|
|
4757
4930
|
* Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Experimental:** this endpoint may change without notice. If the connection has become disabled, it can no longer access the latest data from the brokerage, 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.
|
|
4758
4931
|
* @summary List all account orders
|
|
4759
4932
|
* @param {ExperimentalEndpointsApiGetAllAccountOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -4777,6 +4950,29 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4777
4950
|
});
|
|
4778
4951
|
},
|
|
4779
4952
|
/**
|
|
4953
|
+
* A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from `/accounts/{accountId}/orders/all` in that it is always realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. Every order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. `data_freshness.as_of` is the time of this live request. **Experimental:** this endpoint may change without notice. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
|
|
4954
|
+
* @summary List all account recent orders (last 24 hours only)
|
|
4955
|
+
* @param {ExperimentalEndpointsApiGetAllAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
4956
|
+
* @param {*} [options] Override http request option.
|
|
4957
|
+
* @throws {RequiredError}
|
|
4958
|
+
*/
|
|
4959
|
+
async getAllAccountRecentOrders(...args) {
|
|
4960
|
+
const [requestParameters = {}, options] = args;
|
|
4961
|
+
return createRequestFunction(await localVarAxiosParamCreator.getAllAccountRecentOrders(requestParameters.accountId, requestParameters.onlyExecuted, requestParameters.userId, requestParameters.userSecret, options), axios, BASE_PATH, configuration, {
|
|
4962
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4963
|
+
requestSigningByAuthMode: {
|
|
4964
|
+
"commercialApiKey": {
|
|
4965
|
+
secretParameter: "consumerKey",
|
|
4966
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4967
|
+
},
|
|
4968
|
+
"personalApiKey": {
|
|
4969
|
+
secretParameter: "consumerKey",
|
|
4970
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4971
|
+
}
|
|
4972
|
+
}
|
|
4973
|
+
});
|
|
4974
|
+
},
|
|
4975
|
+
/**
|
|
4780
4976
|
* 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.
|
|
4781
4977
|
* @summary Get account order detail (V2)
|
|
4782
4978
|
* @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request<TAuth>} requestParameters Request parameters.
|
|
@@ -4948,6 +5144,16 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios)
|
|
|
4948
5144
|
return localVarFp.cancelSubscription(...args).then((request) => request(axios, basePath));
|
|
4949
5145
|
},
|
|
4950
5146
|
/**
|
|
5147
|
+
* Returns the detail of a single order, identified by the brokerage order ID in the path, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. The order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. Multi-leg orders are a single order with multiple legs. This endpoint is always realtime and does not rely on cached data, except that an order in a terminal state (executed, canceled, rejected, failed, expired, replaced) may be served from a short-lived cache since it can no longer change. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint. **Experimental:** this endpoint may change without notice.
|
|
5148
|
+
* @summary Get account order detail
|
|
5149
|
+
* @param {ExperimentalEndpointsApiGetAccountOrderRequest<TAuth>} requestParameters Request parameters.
|
|
5150
|
+
* @param {*} [options] Override http request option.
|
|
5151
|
+
* @throws {RequiredError}
|
|
5152
|
+
*/
|
|
5153
|
+
getAccountOrder(...args) {
|
|
5154
|
+
return localVarFp.getAccountOrder(...args).then((request) => request(axios, basePath));
|
|
5155
|
+
},
|
|
5156
|
+
/**
|
|
4951
5157
|
* Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Experimental:** this endpoint may change without notice. If the connection has become disabled, it can no longer access the latest data from the brokerage, 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.
|
|
4952
5158
|
* @summary List all account orders
|
|
4953
5159
|
* @param {ExperimentalEndpointsApiGetAllAccountOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -4958,6 +5164,16 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios)
|
|
|
4958
5164
|
return localVarFp.getAllAccountOrders(...args).then((request) => request(axios, basePath));
|
|
4959
5165
|
},
|
|
4960
5166
|
/**
|
|
5167
|
+
* A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from `/accounts/{accountId}/orders/all` in that it is always realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. Every order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. `data_freshness.as_of` is the time of this live request. **Experimental:** this endpoint may change without notice. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
|
|
5168
|
+
* @summary List all account recent orders (last 24 hours only)
|
|
5169
|
+
* @param {ExperimentalEndpointsApiGetAllAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
5170
|
+
* @param {*} [options] Override http request option.
|
|
5171
|
+
* @throws {RequiredError}
|
|
5172
|
+
*/
|
|
5173
|
+
getAllAccountRecentOrders(...args) {
|
|
5174
|
+
return localVarFp.getAllAccountRecentOrders(...args).then((request) => request(axios, basePath));
|
|
5175
|
+
},
|
|
5176
|
+
/**
|
|
4961
5177
|
* 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.
|
|
4962
5178
|
* @summary Get account order detail (V2)
|
|
4963
5179
|
* @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request<TAuth>} requestParameters Request parameters.
|
|
@@ -5038,6 +5254,17 @@ var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
|
|
|
5038
5254
|
return ExperimentalEndpointsApiFp(this.configuration).cancelSubscription(...args).then((request) => request(this.axios, this.basePath));
|
|
5039
5255
|
}
|
|
5040
5256
|
/**
|
|
5257
|
+
* Returns the detail of a single order, identified by the brokerage order ID in the path, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. The order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. Multi-leg orders are a single order with multiple legs. This endpoint is always realtime and does not rely on cached data, except that an order in a terminal state (executed, canceled, rejected, failed, expired, replaced) may be served from a short-lived cache since it can no longer change. This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint. **Experimental:** this endpoint may change without notice.
|
|
5258
|
+
* @summary Get account order detail
|
|
5259
|
+
* @param {ExperimentalEndpointsApiGetAccountOrderRequest<TAuth>} requestParameters Request parameters.
|
|
5260
|
+
* @param {*} [options] Override http request option.
|
|
5261
|
+
* @throws {RequiredError}
|
|
5262
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
5263
|
+
*/
|
|
5264
|
+
getAccountOrder(...args) {
|
|
5265
|
+
return ExperimentalEndpointsApiFp(this.configuration).getAccountOrder(...args).then((request) => request(this.axios, this.basePath));
|
|
5266
|
+
}
|
|
5267
|
+
/**
|
|
5041
5268
|
* Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`. Every order carries a `legs` list with at least one leg. Each leg\'s `instrument` uses the same `Instrument` union as positions; switch on `instrument.kind` to know which fields are present. Multi-leg orders (spreads, strangles, covered calls) are a single order with multiple legs. Orders that belong to a complex order group (OCO, OTO, OTOCO) share a `group.id`. `order_type` is an object discriminated by `kind`. Each kind declares the price fields it requires (`limit_price` on `limit`, `stop_price` on `stop`, both on `stop_limit`, `trail` on `trailing_stop`), so a consumer never has to null-check a price that cannot exist for that kind. When the brokerage reports an order type we cannot normalize, `kind` is `other` and the brokerage\'s own label is in `raw_type`. **Experimental:** this endpoint may change without notice. If the connection has become disabled, it can no longer access the latest data from the brokerage, 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.
|
|
5042
5269
|
* @summary List all account orders
|
|
5043
5270
|
* @param {ExperimentalEndpointsApiGetAllAccountOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -5049,6 +5276,17 @@ var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
|
|
|
5049
5276
|
return ExperimentalEndpointsApiFp(this.configuration).getAllAccountOrders(...args).then((request) => request(this.axios, this.basePath));
|
|
5050
5277
|
}
|
|
5051
5278
|
/**
|
|
5279
|
+
* A lightweight endpoint that returns the latest page of orders placed in the last 24 hours in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`. For most brokerages, the default page size is 100 meaning the endpoint will return a max of 100 orders. This endpoint is realtime and can be used to quickly check if account state has recently changed due to an execution, or check status of recently placed orders. Differs from `/accounts/{accountId}/orders/all` in that it is always realtime, and only checks the last 24 hours as opposed to the last 30 days. By default only returns executed orders, but that can be changed by setting *only_executed* to false. Every order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. `data_freshness.as_of` is the time of this live request. **Experimental:** this endpoint may change without notice. **Because of the cost of realtime requests, each call to this endpoint incurs an additional charge. You can find the exact cost for your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing)**
|
|
5280
|
+
* @summary List all account recent orders (last 24 hours only)
|
|
5281
|
+
* @param {ExperimentalEndpointsApiGetAllAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
5282
|
+
* @param {*} [options] Override http request option.
|
|
5283
|
+
* @throws {RequiredError}
|
|
5284
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
5285
|
+
*/
|
|
5286
|
+
getAllAccountRecentOrders(...args) {
|
|
5287
|
+
return ExperimentalEndpointsApiFp(this.configuration).getAllAccountRecentOrders(...args).then((request) => request(this.axios, this.basePath));
|
|
5288
|
+
}
|
|
5289
|
+
/**
|
|
5052
5290
|
* 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.
|
|
5053
5291
|
* @summary Get account order detail (V2)
|
|
5054
5292
|
* @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request<TAuth>} requestParameters Request parameters.
|
|
@@ -8429,7 +8667,7 @@ var Configuration = class {
|
|
|
8429
8667
|
if (param.auth.mode === "oauth") this.accessToken = param.auth.accessToken;
|
|
8430
8668
|
this.basePath = param.basePath;
|
|
8431
8669
|
this.baseOptions = param.baseOptions ?? {};
|
|
8432
|
-
this.userAgent = param.userAgent === void 0 ? "Konfig/13.2.
|
|
8670
|
+
this.userAgent = param.userAgent === void 0 ? "Konfig/13.2.4/typescript" : param.userAgent;
|
|
8433
8671
|
this.formDataCtor = param.formDataCtor;
|
|
8434
8672
|
}
|
|
8435
8673
|
/**
|