snaptrade-typescript-sdk 13.2.2 → 13.2.3
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 +70 -1
- package/dist/browser.umd.js +3 -3
- package/dist/index.cjs +120 -1
- package/dist/index.d.cts +71 -2
- package/dist/index.d.mts +71 -2
- package/dist/index.d.ts +71 -2
- package/dist/index.mjs +120 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4304,6 +4304,81 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
|
4304
4304
|
};
|
|
4305
4305
|
},
|
|
4306
4306
|
/**
|
|
4307
|
+
* 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)**
|
|
4308
|
+
* @summary List all account recent orders (last 24 hours only)
|
|
4309
|
+
* @param {string} accountId
|
|
4310
|
+
* @param {boolean} [onlyExecuted] Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well
|
|
4311
|
+
* @param {string} [userId]
|
|
4312
|
+
* @param {string} [userSecret]
|
|
4313
|
+
* @param {*} [options] Override http request option.
|
|
4314
|
+
* @throws {RequiredError}
|
|
4315
|
+
*/
|
|
4316
|
+
getAllAccountRecentOrders: async (accountId, onlyExecuted, userId, userSecret, options = {}) => {
|
|
4317
|
+
assertParamExists("getAllAccountRecentOrders", "accountId", accountId);
|
|
4318
|
+
const localVarPath = `/accounts/{accountId}/orders/recent`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
|
|
4319
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
4320
|
+
let baseOptions;
|
|
4321
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
4322
|
+
const localVarRequestOptions = {
|
|
4323
|
+
method: "GET",
|
|
4324
|
+
...baseOptions,
|
|
4325
|
+
...options
|
|
4326
|
+
};
|
|
4327
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
4328
|
+
const localVarQueryParameter = {};
|
|
4329
|
+
if (configuration?.authMode === "commercialApiKey") {
|
|
4330
|
+
await setApiKeyToObject({
|
|
4331
|
+
object: localVarQueryParameter,
|
|
4332
|
+
key: "clientId",
|
|
4333
|
+
keyParamName: "clientId",
|
|
4334
|
+
configuration
|
|
4335
|
+
});
|
|
4336
|
+
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
4337
|
+
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
4338
|
+
}
|
|
4339
|
+
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
4340
|
+
object: localVarQueryParameter,
|
|
4341
|
+
key: "clientId",
|
|
4342
|
+
keyParamName: "clientId",
|
|
4343
|
+
configuration
|
|
4344
|
+
});
|
|
4345
|
+
if (onlyExecuted !== void 0) localVarQueryParameter["only_executed"] = onlyExecuted;
|
|
4346
|
+
const localVarOperationAuth = {
|
|
4347
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4348
|
+
requestSigningByAuthMode: {
|
|
4349
|
+
"commercialApiKey": {
|
|
4350
|
+
secretParameter: "consumerKey",
|
|
4351
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4352
|
+
},
|
|
4353
|
+
"personalApiKey": {
|
|
4354
|
+
secretParameter: "consumerKey",
|
|
4355
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4356
|
+
}
|
|
4357
|
+
},
|
|
4358
|
+
selectedAuthMode: configuration?.authMode
|
|
4359
|
+
};
|
|
4360
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4361
|
+
localVarRequestOptions.headers = {
|
|
4362
|
+
...localVarHeaderParameter,
|
|
4363
|
+
...headersFromBaseOptions,
|
|
4364
|
+
...options.headers
|
|
4365
|
+
};
|
|
4366
|
+
requestBeforeHook({
|
|
4367
|
+
queryParameters: localVarQueryParameter,
|
|
4368
|
+
requestConfig: localVarRequestOptions,
|
|
4369
|
+
path: localVarPath,
|
|
4370
|
+
configuration,
|
|
4371
|
+
pathTemplate: "/accounts/{accountId}/orders/recent",
|
|
4372
|
+
httpMethod: "GET",
|
|
4373
|
+
operationAuth: localVarOperationAuth
|
|
4374
|
+
});
|
|
4375
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
4376
|
+
return {
|
|
4377
|
+
url: toPathString(localVarUrlObj),
|
|
4378
|
+
options: localVarRequestOptions
|
|
4379
|
+
};
|
|
4380
|
+
},
|
|
4381
|
+
/**
|
|
4307
4382
|
* 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
4383
|
* @summary Get account order detail (V2)
|
|
4309
4384
|
* @param {string} accountId
|
|
@@ -4777,6 +4852,29 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4777
4852
|
});
|
|
4778
4853
|
},
|
|
4779
4854
|
/**
|
|
4855
|
+
* 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)**
|
|
4856
|
+
* @summary List all account recent orders (last 24 hours only)
|
|
4857
|
+
* @param {ExperimentalEndpointsApiGetAllAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
4858
|
+
* @param {*} [options] Override http request option.
|
|
4859
|
+
* @throws {RequiredError}
|
|
4860
|
+
*/
|
|
4861
|
+
async getAllAccountRecentOrders(...args) {
|
|
4862
|
+
const [requestParameters = {}, options] = args;
|
|
4863
|
+
return createRequestFunction(await localVarAxiosParamCreator.getAllAccountRecentOrders(requestParameters.accountId, requestParameters.onlyExecuted, requestParameters.userId, requestParameters.userSecret, options), axios, BASE_PATH, configuration, {
|
|
4864
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
4865
|
+
requestSigningByAuthMode: {
|
|
4866
|
+
"commercialApiKey": {
|
|
4867
|
+
secretParameter: "consumerKey",
|
|
4868
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
4869
|
+
},
|
|
4870
|
+
"personalApiKey": {
|
|
4871
|
+
secretParameter: "consumerKey",
|
|
4872
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
4873
|
+
}
|
|
4874
|
+
}
|
|
4875
|
+
});
|
|
4876
|
+
},
|
|
4877
|
+
/**
|
|
4780
4878
|
* 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
4879
|
* @summary Get account order detail (V2)
|
|
4782
4880
|
* @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request<TAuth>} requestParameters Request parameters.
|
|
@@ -4958,6 +5056,16 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios)
|
|
|
4958
5056
|
return localVarFp.getAllAccountOrders(...args).then((request) => request(axios, basePath));
|
|
4959
5057
|
},
|
|
4960
5058
|
/**
|
|
5059
|
+
* 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)**
|
|
5060
|
+
* @summary List all account recent orders (last 24 hours only)
|
|
5061
|
+
* @param {ExperimentalEndpointsApiGetAllAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
5062
|
+
* @param {*} [options] Override http request option.
|
|
5063
|
+
* @throws {RequiredError}
|
|
5064
|
+
*/
|
|
5065
|
+
getAllAccountRecentOrders(...args) {
|
|
5066
|
+
return localVarFp.getAllAccountRecentOrders(...args).then((request) => request(axios, basePath));
|
|
5067
|
+
},
|
|
5068
|
+
/**
|
|
4961
5069
|
* 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
5070
|
* @summary Get account order detail (V2)
|
|
4963
5071
|
* @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request<TAuth>} requestParameters Request parameters.
|
|
@@ -5049,6 +5157,17 @@ var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
|
|
|
5049
5157
|
return ExperimentalEndpointsApiFp(this.configuration).getAllAccountOrders(...args).then((request) => request(this.axios, this.basePath));
|
|
5050
5158
|
}
|
|
5051
5159
|
/**
|
|
5160
|
+
* 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)**
|
|
5161
|
+
* @summary List all account recent orders (last 24 hours only)
|
|
5162
|
+
* @param {ExperimentalEndpointsApiGetAllAccountRecentOrdersRequest<TAuth>} requestParameters Request parameters.
|
|
5163
|
+
* @param {*} [options] Override http request option.
|
|
5164
|
+
* @throws {RequiredError}
|
|
5165
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
5166
|
+
*/
|
|
5167
|
+
getAllAccountRecentOrders(...args) {
|
|
5168
|
+
return ExperimentalEndpointsApiFp(this.configuration).getAllAccountRecentOrders(...args).then((request) => request(this.axios, this.basePath));
|
|
5169
|
+
}
|
|
5170
|
+
/**
|
|
5052
5171
|
* 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
5172
|
* @summary Get account order detail (V2)
|
|
5054
5173
|
* @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request<TAuth>} requestParameters Request parameters.
|
|
@@ -8429,7 +8548,7 @@ var Configuration = class {
|
|
|
8429
8548
|
if (param.auth.mode === "oauth") this.accessToken = param.auth.accessToken;
|
|
8430
8549
|
this.basePath = param.basePath;
|
|
8431
8550
|
this.baseOptions = param.baseOptions ?? {};
|
|
8432
|
-
this.userAgent = param.userAgent === void 0 ? "Konfig/13.2.
|
|
8551
|
+
this.userAgent = param.userAgent === void 0 ? "Konfig/13.2.3/typescript" : param.userAgent;
|
|
8433
8552
|
this.formDataCtor = param.formDataCtor;
|
|
8434
8553
|
}
|
|
8435
8554
|
/**
|