snaptrade-typescript-sdk 13.2.3 → 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 +67 -1
- package/dist/browser.umd.js +1 -1
- package/dist/index.cjs +120 -1
- package/dist/index.d.cts +89 -5
- package/dist/index.d.mts +89 -5
- package/dist/index.d.ts +89 -5
- package/dist/index.mjs +120 -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
|
|
@@ -4829,6 +4904,29 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4829
4904
|
});
|
|
4830
4905
|
},
|
|
4831
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
|
+
/**
|
|
4832
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.
|
|
4833
4931
|
* @summary List all account orders
|
|
4834
4932
|
* @param {ExperimentalEndpointsApiGetAllAccountOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -5046,6 +5144,16 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios)
|
|
|
5046
5144
|
return localVarFp.cancelSubscription(...args).then((request) => request(axios, basePath));
|
|
5047
5145
|
},
|
|
5048
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
|
+
/**
|
|
5049
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.
|
|
5050
5158
|
* @summary List all account orders
|
|
5051
5159
|
* @param {ExperimentalEndpointsApiGetAllAccountOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -5146,6 +5254,17 @@ var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
|
|
|
5146
5254
|
return ExperimentalEndpointsApiFp(this.configuration).cancelSubscription(...args).then((request) => request(this.axios, this.basePath));
|
|
5147
5255
|
}
|
|
5148
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
|
+
/**
|
|
5149
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.
|
|
5150
5269
|
* @summary List all account orders
|
|
5151
5270
|
* @param {ExperimentalEndpointsApiGetAllAccountOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -8548,7 +8667,7 @@ var Configuration = class {
|
|
|
8548
8667
|
if (param.auth.mode === "oauth") this.accessToken = param.auth.accessToken;
|
|
8549
8668
|
this.basePath = param.basePath;
|
|
8550
8669
|
this.baseOptions = param.baseOptions ?? {};
|
|
8551
|
-
this.userAgent = param.userAgent === void 0 ? "Konfig/13.2.
|
|
8670
|
+
this.userAgent = param.userAgent === void 0 ? "Konfig/13.2.4/typescript" : param.userAgent;
|
|
8552
8671
|
this.formDataCtor = param.formDataCtor;
|
|
8553
8672
|
}
|
|
8554
8673
|
/**
|