snaptrade-typescript-sdk 10.0.1 → 10.0.2
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 +252 -3
- package/dist/index.cjs +669 -49
- package/dist/index.d.mts +394 -10
- package/dist/index.mjs +627 -12
- package/package.json +10 -9
- package/dist/index.cjs.map +0 -1
- package/dist/index.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -801,12 +801,13 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
801
801
|
};
|
|
802
802
|
},
|
|
803
803
|
/**
|
|
804
|
-
* Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
804
|
+
* Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). This endpoint is deprecated. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
805
805
|
* @summary List account positions
|
|
806
806
|
* @param {string} userId
|
|
807
807
|
* @param {string} userSecret
|
|
808
808
|
* @param {string} accountId
|
|
809
809
|
* @param {*} [options] Override http request option.
|
|
810
|
+
* @deprecated
|
|
810
811
|
* @throws {RequiredError}
|
|
811
812
|
*/
|
|
812
813
|
getUserAccountPositions: async (userId, userSecret, accountId, options = {}) => {
|
|
@@ -1280,10 +1281,11 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1280
1281
|
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountOrders(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.state, requestParameters.days, options), globalAxios, BASE_PATH, configuration);
|
|
1281
1282
|
},
|
|
1282
1283
|
/**
|
|
1283
|
-
* Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
1284
|
+
* Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). This endpoint is deprecated. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
1284
1285
|
* @summary List account positions
|
|
1285
1286
|
* @param {AccountInformationApiGetUserAccountPositionsRequest} requestParameters Request parameters.
|
|
1286
1287
|
* @param {*} [options] Override http request option.
|
|
1288
|
+
* @deprecated
|
|
1287
1289
|
* @throws {RequiredError}
|
|
1288
1290
|
*/
|
|
1289
1291
|
async getUserAccountPositions(requestParameters, options) {
|
|
@@ -1432,10 +1434,11 @@ const AccountInformationApiFactory = function(configuration, basePath, axios) {
|
|
|
1432
1434
|
return localVarFp.getUserAccountOrders(requestParameters, options).then((request) => request(axios, basePath));
|
|
1433
1435
|
},
|
|
1434
1436
|
/**
|
|
1435
|
-
* Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
1437
|
+
* Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). This endpoint is deprecated. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
1436
1438
|
* @summary List account positions
|
|
1437
1439
|
* @param {AccountInformationApiGetUserAccountPositionsRequest} requestParameters Request parameters.
|
|
1438
1440
|
* @param {*} [options] Override http request option.
|
|
1441
|
+
* @deprecated
|
|
1439
1442
|
* @throws {RequiredError}
|
|
1440
1443
|
*/
|
|
1441
1444
|
getUserAccountPositions(requestParameters, options) {
|
|
@@ -1592,10 +1595,11 @@ var AccountInformationApiGenerated = class extends BaseAPI {
|
|
|
1592
1595
|
return AccountInformationApiFp(this.configuration).getUserAccountOrders(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1593
1596
|
}
|
|
1594
1597
|
/**
|
|
1595
|
-
* Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
1598
|
+
* Returns a list of stock/ETF/crypto/mutual fund positions in the specified account. For option positions, please use the [options endpoint](/reference/Options/Options_listOptionHoldings). This endpoint is deprecated. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint. 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.
|
|
1596
1599
|
* @summary List account positions
|
|
1597
1600
|
* @param {AccountInformationApiGetUserAccountPositionsRequest} requestParameters Request parameters.
|
|
1598
1601
|
* @param {*} [options] Override http request option.
|
|
1602
|
+
* @deprecated
|
|
1599
1603
|
* @throws {RequiredError}
|
|
1600
1604
|
* @memberof AccountInformationApiGenerated
|
|
1601
1605
|
*/
|
|
@@ -3263,6 +3267,614 @@ var ConnectionsApiGenerated = class extends BaseAPI {
|
|
|
3263
3267
|
//#region api/connections-api.ts
|
|
3264
3268
|
var ConnectionsApi = class extends ConnectionsApiGenerated {};
|
|
3265
3269
|
//#endregion
|
|
3270
|
+
//#region api/experimental-endpoints-api-generated.ts
|
|
3271
|
+
/**
|
|
3272
|
+
* ExperimentalEndpointsApi - axios parameter creator
|
|
3273
|
+
* @export
|
|
3274
|
+
*/
|
|
3275
|
+
const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
3276
|
+
return {
|
|
3277
|
+
/**
|
|
3278
|
+
* Adds or restores a Trade Detection subscription for a connected brokerage account. This endpoint requires `userId` and `userSecret` in addition to the partner signature.
|
|
3279
|
+
* @summary Add a Trade Detection subscription
|
|
3280
|
+
* @param {string} userId
|
|
3281
|
+
* @param {string} userSecret
|
|
3282
|
+
* @param {TradeDetectionAddSubscriptionRequest} tradeDetectionAddSubscriptionRequest
|
|
3283
|
+
* @param {*} [options] Override http request option.
|
|
3284
|
+
* @throws {RequiredError}
|
|
3285
|
+
*/
|
|
3286
|
+
addSubscription: async (userId, userSecret, tradeDetectionAddSubscriptionRequest, options = {}) => {
|
|
3287
|
+
assertParamExists("addSubscription", "userId", userId);
|
|
3288
|
+
assertParamExists("addSubscription", "userSecret", userSecret);
|
|
3289
|
+
assertParamExists("addSubscription", "tradeDetectionAddSubscriptionRequest", tradeDetectionAddSubscriptionRequest);
|
|
3290
|
+
const localVarPath = `/snapTrade/tradeDetection/subscriptions`;
|
|
3291
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3292
|
+
let baseOptions;
|
|
3293
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
3294
|
+
const localVarRequestOptions = {
|
|
3295
|
+
method: "POST",
|
|
3296
|
+
...baseOptions,
|
|
3297
|
+
...options
|
|
3298
|
+
};
|
|
3299
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
3300
|
+
const localVarQueryParameter = {};
|
|
3301
|
+
await setApiKeyToObject({
|
|
3302
|
+
object: localVarQueryParameter,
|
|
3303
|
+
key: "clientId",
|
|
3304
|
+
keyParamName: "clientId",
|
|
3305
|
+
configuration
|
|
3306
|
+
});
|
|
3307
|
+
await setApiKeyToObject({
|
|
3308
|
+
object: localVarHeaderParameter,
|
|
3309
|
+
key: "Signature",
|
|
3310
|
+
keyParamName: "signature",
|
|
3311
|
+
configuration
|
|
3312
|
+
});
|
|
3313
|
+
await setApiKeyToObject({
|
|
3314
|
+
object: localVarQueryParameter,
|
|
3315
|
+
key: "timestamp",
|
|
3316
|
+
keyParamName: "timestamp",
|
|
3317
|
+
configuration
|
|
3318
|
+
});
|
|
3319
|
+
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
3320
|
+
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
3321
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
3322
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3323
|
+
localVarRequestOptions.headers = {
|
|
3324
|
+
...localVarHeaderParameter,
|
|
3325
|
+
...headersFromBaseOptions,
|
|
3326
|
+
...options.headers
|
|
3327
|
+
};
|
|
3328
|
+
requestBeforeHook({
|
|
3329
|
+
requestBody: tradeDetectionAddSubscriptionRequest,
|
|
3330
|
+
queryParameters: localVarQueryParameter,
|
|
3331
|
+
requestConfig: localVarRequestOptions,
|
|
3332
|
+
path: localVarPath,
|
|
3333
|
+
configuration,
|
|
3334
|
+
pathTemplate: "/snapTrade/tradeDetection/subscriptions",
|
|
3335
|
+
httpMethod: "POST"
|
|
3336
|
+
});
|
|
3337
|
+
localVarRequestOptions.data = serializeDataIfNeeded(tradeDetectionAddSubscriptionRequest, localVarRequestOptions, configuration);
|
|
3338
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
3339
|
+
return {
|
|
3340
|
+
url: toPathString(localVarUrlObj),
|
|
3341
|
+
options: localVarRequestOptions
|
|
3342
|
+
};
|
|
3343
|
+
},
|
|
3344
|
+
/**
|
|
3345
|
+
* Cancels a Trade Detection subscription for a connected brokerage account. This endpoint requires partner signature authentication only and does not require `userId` or `userSecret`.
|
|
3346
|
+
* @summary Cancel a Trade Detection subscription
|
|
3347
|
+
* @param {TradeDetectionAddSubscriptionRequest} tradeDetectionAddSubscriptionRequest
|
|
3348
|
+
* @param {*} [options] Override http request option.
|
|
3349
|
+
* @throws {RequiredError}
|
|
3350
|
+
*/
|
|
3351
|
+
cancelSubscription: async (tradeDetectionAddSubscriptionRequest, options = {}) => {
|
|
3352
|
+
assertParamExists("cancelSubscription", "tradeDetectionAddSubscriptionRequest", tradeDetectionAddSubscriptionRequest);
|
|
3353
|
+
const localVarPath = `/snapTrade/tradeDetection/subscriptions/cancel`;
|
|
3354
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3355
|
+
let baseOptions;
|
|
3356
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
3357
|
+
const localVarRequestOptions = {
|
|
3358
|
+
method: "POST",
|
|
3359
|
+
...baseOptions,
|
|
3360
|
+
...options
|
|
3361
|
+
};
|
|
3362
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
3363
|
+
const localVarQueryParameter = {};
|
|
3364
|
+
await setApiKeyToObject({
|
|
3365
|
+
object: localVarQueryParameter,
|
|
3366
|
+
key: "clientId",
|
|
3367
|
+
keyParamName: "clientId",
|
|
3368
|
+
configuration
|
|
3369
|
+
});
|
|
3370
|
+
await setApiKeyToObject({
|
|
3371
|
+
object: localVarHeaderParameter,
|
|
3372
|
+
key: "Signature",
|
|
3373
|
+
keyParamName: "signature",
|
|
3374
|
+
configuration
|
|
3375
|
+
});
|
|
3376
|
+
await setApiKeyToObject({
|
|
3377
|
+
object: localVarQueryParameter,
|
|
3378
|
+
key: "timestamp",
|
|
3379
|
+
keyParamName: "timestamp",
|
|
3380
|
+
configuration
|
|
3381
|
+
});
|
|
3382
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
3383
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3384
|
+
localVarRequestOptions.headers = {
|
|
3385
|
+
...localVarHeaderParameter,
|
|
3386
|
+
...headersFromBaseOptions,
|
|
3387
|
+
...options.headers
|
|
3388
|
+
};
|
|
3389
|
+
requestBeforeHook({
|
|
3390
|
+
requestBody: tradeDetectionAddSubscriptionRequest,
|
|
3391
|
+
queryParameters: localVarQueryParameter,
|
|
3392
|
+
requestConfig: localVarRequestOptions,
|
|
3393
|
+
path: localVarPath,
|
|
3394
|
+
configuration,
|
|
3395
|
+
pathTemplate: "/snapTrade/tradeDetection/subscriptions/cancel",
|
|
3396
|
+
httpMethod: "POST"
|
|
3397
|
+
});
|
|
3398
|
+
localVarRequestOptions.data = serializeDataIfNeeded(tradeDetectionAddSubscriptionRequest, localVarRequestOptions, configuration);
|
|
3399
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
3400
|
+
return {
|
|
3401
|
+
url: toPathString(localVarUrlObj),
|
|
3402
|
+
options: localVarRequestOptions
|
|
3403
|
+
};
|
|
3404
|
+
},
|
|
3405
|
+
/**
|
|
3406
|
+
* 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.
|
|
3407
|
+
* @summary Get account order detail (V2)
|
|
3408
|
+
* @param {string} accountId
|
|
3409
|
+
* @param {string} brokerageOrderId
|
|
3410
|
+
* @param {string} userId
|
|
3411
|
+
* @param {string} userSecret
|
|
3412
|
+
* @param {*} [options] Override http request option.
|
|
3413
|
+
* @throws {RequiredError}
|
|
3414
|
+
*/
|
|
3415
|
+
getUserAccountOrderDetailV2: async (accountId, brokerageOrderId, userId, userSecret, options = {}) => {
|
|
3416
|
+
assertParamExists("getUserAccountOrderDetailV2", "accountId", accountId);
|
|
3417
|
+
assertParamExists("getUserAccountOrderDetailV2", "brokerageOrderId", brokerageOrderId);
|
|
3418
|
+
assertParamExists("getUserAccountOrderDetailV2", "userId", userId);
|
|
3419
|
+
assertParamExists("getUserAccountOrderDetailV2", "userSecret", userSecret);
|
|
3420
|
+
const localVarPath = `/accounts/{accountId}/orders/details/v2/{brokerageOrderId}`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`))).replace(`{brokerageOrderId}`, encodeURIComponent(String(brokerageOrderId !== void 0 ? brokerageOrderId : `-brokerageOrderId-`)));
|
|
3421
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3422
|
+
let baseOptions;
|
|
3423
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
3424
|
+
const localVarRequestOptions = {
|
|
3425
|
+
method: "GET",
|
|
3426
|
+
...baseOptions,
|
|
3427
|
+
...options
|
|
3428
|
+
};
|
|
3429
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
3430
|
+
const localVarQueryParameter = {};
|
|
3431
|
+
await setApiKeyToObject({
|
|
3432
|
+
object: localVarQueryParameter,
|
|
3433
|
+
key: "clientId",
|
|
3434
|
+
keyParamName: "clientId",
|
|
3435
|
+
configuration
|
|
3436
|
+
});
|
|
3437
|
+
await setApiKeyToObject({
|
|
3438
|
+
object: localVarHeaderParameter,
|
|
3439
|
+
key: "Signature",
|
|
3440
|
+
keyParamName: "signature",
|
|
3441
|
+
configuration
|
|
3442
|
+
});
|
|
3443
|
+
await setApiKeyToObject({
|
|
3444
|
+
object: localVarQueryParameter,
|
|
3445
|
+
key: "timestamp",
|
|
3446
|
+
keyParamName: "timestamp",
|
|
3447
|
+
configuration
|
|
3448
|
+
});
|
|
3449
|
+
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
3450
|
+
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
3451
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3452
|
+
localVarRequestOptions.headers = {
|
|
3453
|
+
...localVarHeaderParameter,
|
|
3454
|
+
...headersFromBaseOptions,
|
|
3455
|
+
...options.headers
|
|
3456
|
+
};
|
|
3457
|
+
requestBeforeHook({
|
|
3458
|
+
queryParameters: localVarQueryParameter,
|
|
3459
|
+
requestConfig: localVarRequestOptions,
|
|
3460
|
+
path: localVarPath,
|
|
3461
|
+
configuration,
|
|
3462
|
+
pathTemplate: "/accounts/{accountId}/orders/details/v2/{brokerageOrderId}",
|
|
3463
|
+
httpMethod: "GET"
|
|
3464
|
+
});
|
|
3465
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
3466
|
+
return {
|
|
3467
|
+
url: toPathString(localVarUrlObj),
|
|
3468
|
+
options: localVarRequestOptions
|
|
3469
|
+
};
|
|
3470
|
+
},
|
|
3471
|
+
/**
|
|
3472
|
+
* Returns a list of recent orders in the specified account. The V2 order response format will include all legs of each order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. 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.
|
|
3473
|
+
* @summary List account orders v2
|
|
3474
|
+
* @param {string} userId
|
|
3475
|
+
* @param {string} userSecret
|
|
3476
|
+
* @param {string} accountId
|
|
3477
|
+
* @param {'all' | 'open' | 'executed'} [state] defaults to \"all\"
|
|
3478
|
+
* @param {number} [days] Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. Values greater than 90 will be capped at 90.
|
|
3479
|
+
* @param {*} [options] Override http request option.
|
|
3480
|
+
* @throws {RequiredError}
|
|
3481
|
+
*/
|
|
3482
|
+
getUserAccountOrdersV2: async (userId, userSecret, accountId, state, days, options = {}) => {
|
|
3483
|
+
assertParamExists("getUserAccountOrdersV2", "userId", userId);
|
|
3484
|
+
assertParamExists("getUserAccountOrdersV2", "userSecret", userSecret);
|
|
3485
|
+
assertParamExists("getUserAccountOrdersV2", "accountId", accountId);
|
|
3486
|
+
const localVarPath = `/accounts/{accountId}/orders/v2`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
|
|
3487
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3488
|
+
let baseOptions;
|
|
3489
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
3490
|
+
const localVarRequestOptions = {
|
|
3491
|
+
method: "GET",
|
|
3492
|
+
...baseOptions,
|
|
3493
|
+
...options
|
|
3494
|
+
};
|
|
3495
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
3496
|
+
const localVarQueryParameter = {};
|
|
3497
|
+
await setApiKeyToObject({
|
|
3498
|
+
object: localVarQueryParameter,
|
|
3499
|
+
key: "clientId",
|
|
3500
|
+
keyParamName: "clientId",
|
|
3501
|
+
configuration
|
|
3502
|
+
});
|
|
3503
|
+
await setApiKeyToObject({
|
|
3504
|
+
object: localVarHeaderParameter,
|
|
3505
|
+
key: "Signature",
|
|
3506
|
+
keyParamName: "signature",
|
|
3507
|
+
configuration
|
|
3508
|
+
});
|
|
3509
|
+
await setApiKeyToObject({
|
|
3510
|
+
object: localVarQueryParameter,
|
|
3511
|
+
key: "timestamp",
|
|
3512
|
+
keyParamName: "timestamp",
|
|
3513
|
+
configuration
|
|
3514
|
+
});
|
|
3515
|
+
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
3516
|
+
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
3517
|
+
if (state !== void 0) localVarQueryParameter["state"] = state;
|
|
3518
|
+
if (days !== void 0) localVarQueryParameter["days"] = days;
|
|
3519
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3520
|
+
localVarRequestOptions.headers = {
|
|
3521
|
+
...localVarHeaderParameter,
|
|
3522
|
+
...headersFromBaseOptions,
|
|
3523
|
+
...options.headers
|
|
3524
|
+
};
|
|
3525
|
+
requestBeforeHook({
|
|
3526
|
+
queryParameters: localVarQueryParameter,
|
|
3527
|
+
requestConfig: localVarRequestOptions,
|
|
3528
|
+
path: localVarPath,
|
|
3529
|
+
configuration,
|
|
3530
|
+
pathTemplate: "/accounts/{accountId}/orders/v2",
|
|
3531
|
+
httpMethod: "GET"
|
|
3532
|
+
});
|
|
3533
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
3534
|
+
return {
|
|
3535
|
+
url: toPathString(localVarUrlObj),
|
|
3536
|
+
options: localVarRequestOptions
|
|
3537
|
+
};
|
|
3538
|
+
},
|
|
3539
|
+
/**
|
|
3540
|
+
* A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account using the V2 order format. 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 /orders in that it is 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. **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)**
|
|
3541
|
+
* @summary List account recent orders (V2, last 24 hours only)
|
|
3542
|
+
* @param {string} userId
|
|
3543
|
+
* @param {string} userSecret
|
|
3544
|
+
* @param {string} accountId
|
|
3545
|
+
* @param {boolean} [onlyExecuted] Defaults to true. Indicates if request should fetch only executed orders. Set to false to retrieve non executed orders as well
|
|
3546
|
+
* @param {*} [options] Override http request option.
|
|
3547
|
+
* @throws {RequiredError}
|
|
3548
|
+
*/
|
|
3549
|
+
getUserAccountRecentOrdersV2: async (userId, userSecret, accountId, onlyExecuted, options = {}) => {
|
|
3550
|
+
assertParamExists("getUserAccountRecentOrdersV2", "userId", userId);
|
|
3551
|
+
assertParamExists("getUserAccountRecentOrdersV2", "userSecret", userSecret);
|
|
3552
|
+
assertParamExists("getUserAccountRecentOrdersV2", "accountId", accountId);
|
|
3553
|
+
const localVarPath = `/accounts/{accountId}/recentOrders/v2`.replace(`{accountId}`, encodeURIComponent(String(accountId !== void 0 ? accountId : `-accountId-`)));
|
|
3554
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3555
|
+
let baseOptions;
|
|
3556
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
3557
|
+
const localVarRequestOptions = {
|
|
3558
|
+
method: "GET",
|
|
3559
|
+
...baseOptions,
|
|
3560
|
+
...options
|
|
3561
|
+
};
|
|
3562
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
3563
|
+
const localVarQueryParameter = {};
|
|
3564
|
+
await setApiKeyToObject({
|
|
3565
|
+
object: localVarQueryParameter,
|
|
3566
|
+
key: "clientId",
|
|
3567
|
+
keyParamName: "clientId",
|
|
3568
|
+
configuration
|
|
3569
|
+
});
|
|
3570
|
+
await setApiKeyToObject({
|
|
3571
|
+
object: localVarHeaderParameter,
|
|
3572
|
+
key: "Signature",
|
|
3573
|
+
keyParamName: "signature",
|
|
3574
|
+
configuration
|
|
3575
|
+
});
|
|
3576
|
+
await setApiKeyToObject({
|
|
3577
|
+
object: localVarQueryParameter,
|
|
3578
|
+
key: "timestamp",
|
|
3579
|
+
keyParamName: "timestamp",
|
|
3580
|
+
configuration
|
|
3581
|
+
});
|
|
3582
|
+
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
3583
|
+
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
3584
|
+
if (onlyExecuted !== void 0) localVarQueryParameter["only_executed"] = onlyExecuted;
|
|
3585
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3586
|
+
localVarRequestOptions.headers = {
|
|
3587
|
+
...localVarHeaderParameter,
|
|
3588
|
+
...headersFromBaseOptions,
|
|
3589
|
+
...options.headers
|
|
3590
|
+
};
|
|
3591
|
+
requestBeforeHook({
|
|
3592
|
+
queryParameters: localVarQueryParameter,
|
|
3593
|
+
requestConfig: localVarRequestOptions,
|
|
3594
|
+
path: localVarPath,
|
|
3595
|
+
configuration,
|
|
3596
|
+
pathTemplate: "/accounts/{accountId}/recentOrders/v2",
|
|
3597
|
+
httpMethod: "GET"
|
|
3598
|
+
});
|
|
3599
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
3600
|
+
return {
|
|
3601
|
+
url: toPathString(localVarUrlObj),
|
|
3602
|
+
options: localVarRequestOptions
|
|
3603
|
+
};
|
|
3604
|
+
},
|
|
3605
|
+
/**
|
|
3606
|
+
* Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|
|
3607
|
+
* @summary List active Trade Detection subscriptions
|
|
3608
|
+
* @param {*} [options] Override http request option.
|
|
3609
|
+
* @throws {RequiredError}
|
|
3610
|
+
*/
|
|
3611
|
+
listSubscriptions: async (options = {}) => {
|
|
3612
|
+
const localVarPath = `/snapTrade/tradeDetection/subscriptions`;
|
|
3613
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3614
|
+
let baseOptions;
|
|
3615
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
3616
|
+
const localVarRequestOptions = {
|
|
3617
|
+
method: "GET",
|
|
3618
|
+
...baseOptions,
|
|
3619
|
+
...options
|
|
3620
|
+
};
|
|
3621
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
3622
|
+
const localVarQueryParameter = {};
|
|
3623
|
+
await setApiKeyToObject({
|
|
3624
|
+
object: localVarQueryParameter,
|
|
3625
|
+
key: "clientId",
|
|
3626
|
+
keyParamName: "clientId",
|
|
3627
|
+
configuration
|
|
3628
|
+
});
|
|
3629
|
+
await setApiKeyToObject({
|
|
3630
|
+
object: localVarHeaderParameter,
|
|
3631
|
+
key: "Signature",
|
|
3632
|
+
keyParamName: "signature",
|
|
3633
|
+
configuration
|
|
3634
|
+
});
|
|
3635
|
+
await setApiKeyToObject({
|
|
3636
|
+
object: localVarQueryParameter,
|
|
3637
|
+
key: "timestamp",
|
|
3638
|
+
keyParamName: "timestamp",
|
|
3639
|
+
configuration
|
|
3640
|
+
});
|
|
3641
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3642
|
+
localVarRequestOptions.headers = {
|
|
3643
|
+
...localVarHeaderParameter,
|
|
3644
|
+
...headersFromBaseOptions,
|
|
3645
|
+
...options.headers
|
|
3646
|
+
};
|
|
3647
|
+
requestBeforeHook({
|
|
3648
|
+
queryParameters: localVarQueryParameter,
|
|
3649
|
+
requestConfig: localVarRequestOptions,
|
|
3650
|
+
path: localVarPath,
|
|
3651
|
+
configuration,
|
|
3652
|
+
pathTemplate: "/snapTrade/tradeDetection/subscriptions",
|
|
3653
|
+
httpMethod: "GET"
|
|
3654
|
+
});
|
|
3655
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
3656
|
+
return {
|
|
3657
|
+
url: toPathString(localVarUrlObj),
|
|
3658
|
+
options: localVarRequestOptions
|
|
3659
|
+
};
|
|
3660
|
+
}
|
|
3661
|
+
};
|
|
3662
|
+
};
|
|
3663
|
+
/**
|
|
3664
|
+
* ExperimentalEndpointsApi - functional programming interface
|
|
3665
|
+
* @export
|
|
3666
|
+
*/
|
|
3667
|
+
const ExperimentalEndpointsApiFp = function(configuration) {
|
|
3668
|
+
const localVarAxiosParamCreator = ExperimentalEndpointsApiAxiosParamCreator(configuration);
|
|
3669
|
+
return {
|
|
3670
|
+
/**
|
|
3671
|
+
* Adds or restores a Trade Detection subscription for a connected brokerage account. This endpoint requires `userId` and `userSecret` in addition to the partner signature.
|
|
3672
|
+
* @summary Add a Trade Detection subscription
|
|
3673
|
+
* @param {ExperimentalEndpointsApiAddSubscriptionRequest} requestParameters Request parameters.
|
|
3674
|
+
* @param {*} [options] Override http request option.
|
|
3675
|
+
* @throws {RequiredError}
|
|
3676
|
+
*/
|
|
3677
|
+
async addSubscription(requestParameters, options) {
|
|
3678
|
+
const tradeDetectionAddSubscriptionRequest = { account_id: requestParameters.account_id };
|
|
3679
|
+
return createRequestFunction(await localVarAxiosParamCreator.addSubscription(requestParameters.userId, requestParameters.userSecret, tradeDetectionAddSubscriptionRequest, options), globalAxios, BASE_PATH, configuration);
|
|
3680
|
+
},
|
|
3681
|
+
/**
|
|
3682
|
+
* Cancels a Trade Detection subscription for a connected brokerage account. This endpoint requires partner signature authentication only and does not require `userId` or `userSecret`.
|
|
3683
|
+
* @summary Cancel a Trade Detection subscription
|
|
3684
|
+
* @param {ExperimentalEndpointsApiCancelSubscriptionRequest} requestParameters Request parameters.
|
|
3685
|
+
* @param {*} [options] Override http request option.
|
|
3686
|
+
* @throws {RequiredError}
|
|
3687
|
+
*/
|
|
3688
|
+
async cancelSubscription(requestParameters, options) {
|
|
3689
|
+
const tradeDetectionAddSubscriptionRequest = { account_id: requestParameters.account_id };
|
|
3690
|
+
return createRequestFunction(await localVarAxiosParamCreator.cancelSubscription(tradeDetectionAddSubscriptionRequest, options), globalAxios, BASE_PATH, configuration);
|
|
3691
|
+
},
|
|
3692
|
+
/**
|
|
3693
|
+
* 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.
|
|
3694
|
+
* @summary Get account order detail (V2)
|
|
3695
|
+
* @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request} requestParameters Request parameters.
|
|
3696
|
+
* @param {*} [options] Override http request option.
|
|
3697
|
+
* @throws {RequiredError}
|
|
3698
|
+
*/
|
|
3699
|
+
async getUserAccountOrderDetailV2(requestParameters, options) {
|
|
3700
|
+
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountOrderDetailV2(requestParameters.accountId, requestParameters.brokerageOrderId, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration);
|
|
3701
|
+
},
|
|
3702
|
+
/**
|
|
3703
|
+
* Returns a list of recent orders in the specified account. The V2 order response format will include all legs of each order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. 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.
|
|
3704
|
+
* @summary List account orders v2
|
|
3705
|
+
* @param {ExperimentalEndpointsApiGetUserAccountOrdersV2Request} requestParameters Request parameters.
|
|
3706
|
+
* @param {*} [options] Override http request option.
|
|
3707
|
+
* @throws {RequiredError}
|
|
3708
|
+
*/
|
|
3709
|
+
async getUserAccountOrdersV2(requestParameters, options) {
|
|
3710
|
+
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountOrdersV2(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.state, requestParameters.days, options), globalAxios, BASE_PATH, configuration);
|
|
3711
|
+
},
|
|
3712
|
+
/**
|
|
3713
|
+
* A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account using the V2 order format. 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 /orders in that it is 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. **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)**
|
|
3714
|
+
* @summary List account recent orders (V2, last 24 hours only)
|
|
3715
|
+
* @param {ExperimentalEndpointsApiGetUserAccountRecentOrdersV2Request} requestParameters Request parameters.
|
|
3716
|
+
* @param {*} [options] Override http request option.
|
|
3717
|
+
* @throws {RequiredError}
|
|
3718
|
+
*/
|
|
3719
|
+
async getUserAccountRecentOrdersV2(requestParameters, options) {
|
|
3720
|
+
return createRequestFunction(await localVarAxiosParamCreator.getUserAccountRecentOrdersV2(requestParameters.userId, requestParameters.userSecret, requestParameters.accountId, requestParameters.onlyExecuted, options), globalAxios, BASE_PATH, configuration);
|
|
3721
|
+
},
|
|
3722
|
+
/**
|
|
3723
|
+
* Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|
|
3724
|
+
* @summary List active Trade Detection subscriptions
|
|
3725
|
+
* @param {*} [options] Override http request option.
|
|
3726
|
+
* @throws {RequiredError}
|
|
3727
|
+
*/
|
|
3728
|
+
async listSubscriptions(options) {
|
|
3729
|
+
return createRequestFunction(await localVarAxiosParamCreator.listSubscriptions(options), globalAxios, BASE_PATH, configuration);
|
|
3730
|
+
}
|
|
3731
|
+
};
|
|
3732
|
+
};
|
|
3733
|
+
/**
|
|
3734
|
+
* ExperimentalEndpointsApi - factory interface
|
|
3735
|
+
* @export
|
|
3736
|
+
*/
|
|
3737
|
+
const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios) {
|
|
3738
|
+
const localVarFp = ExperimentalEndpointsApiFp(configuration);
|
|
3739
|
+
return {
|
|
3740
|
+
/**
|
|
3741
|
+
* Adds or restores a Trade Detection subscription for a connected brokerage account. This endpoint requires `userId` and `userSecret` in addition to the partner signature.
|
|
3742
|
+
* @summary Add a Trade Detection subscription
|
|
3743
|
+
* @param {ExperimentalEndpointsApiAddSubscriptionRequest} requestParameters Request parameters.
|
|
3744
|
+
* @param {*} [options] Override http request option.
|
|
3745
|
+
* @throws {RequiredError}
|
|
3746
|
+
*/
|
|
3747
|
+
addSubscription(requestParameters, options) {
|
|
3748
|
+
return localVarFp.addSubscription(requestParameters, options).then((request) => request(axios, basePath));
|
|
3749
|
+
},
|
|
3750
|
+
/**
|
|
3751
|
+
* Cancels a Trade Detection subscription for a connected brokerage account. This endpoint requires partner signature authentication only and does not require `userId` or `userSecret`.
|
|
3752
|
+
* @summary Cancel a Trade Detection subscription
|
|
3753
|
+
* @param {ExperimentalEndpointsApiCancelSubscriptionRequest} requestParameters Request parameters.
|
|
3754
|
+
* @param {*} [options] Override http request option.
|
|
3755
|
+
* @throws {RequiredError}
|
|
3756
|
+
*/
|
|
3757
|
+
cancelSubscription(requestParameters, options) {
|
|
3758
|
+
return localVarFp.cancelSubscription(requestParameters, options).then((request) => request(axios, basePath));
|
|
3759
|
+
},
|
|
3760
|
+
/**
|
|
3761
|
+
* 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.
|
|
3762
|
+
* @summary Get account order detail (V2)
|
|
3763
|
+
* @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request} requestParameters Request parameters.
|
|
3764
|
+
* @param {*} [options] Override http request option.
|
|
3765
|
+
* @throws {RequiredError}
|
|
3766
|
+
*/
|
|
3767
|
+
getUserAccountOrderDetailV2(requestParameters, options) {
|
|
3768
|
+
return localVarFp.getUserAccountOrderDetailV2(requestParameters, options).then((request) => request(axios, basePath));
|
|
3769
|
+
},
|
|
3770
|
+
/**
|
|
3771
|
+
* Returns a list of recent orders in the specified account. The V2 order response format will include all legs of each order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. 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.
|
|
3772
|
+
* @summary List account orders v2
|
|
3773
|
+
* @param {ExperimentalEndpointsApiGetUserAccountOrdersV2Request} requestParameters Request parameters.
|
|
3774
|
+
* @param {*} [options] Override http request option.
|
|
3775
|
+
* @throws {RequiredError}
|
|
3776
|
+
*/
|
|
3777
|
+
getUserAccountOrdersV2(requestParameters, options) {
|
|
3778
|
+
return localVarFp.getUserAccountOrdersV2(requestParameters, options).then((request) => request(axios, basePath));
|
|
3779
|
+
},
|
|
3780
|
+
/**
|
|
3781
|
+
* A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account using the V2 order format. 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 /orders in that it is 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. **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)**
|
|
3782
|
+
* @summary List account recent orders (V2, last 24 hours only)
|
|
3783
|
+
* @param {ExperimentalEndpointsApiGetUserAccountRecentOrdersV2Request} requestParameters Request parameters.
|
|
3784
|
+
* @param {*} [options] Override http request option.
|
|
3785
|
+
* @throws {RequiredError}
|
|
3786
|
+
*/
|
|
3787
|
+
getUserAccountRecentOrdersV2(requestParameters, options) {
|
|
3788
|
+
return localVarFp.getUserAccountRecentOrdersV2(requestParameters, options).then((request) => request(axios, basePath));
|
|
3789
|
+
},
|
|
3790
|
+
/**
|
|
3791
|
+
* Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|
|
3792
|
+
* @summary List active Trade Detection subscriptions
|
|
3793
|
+
* @param {*} [options] Override http request option.
|
|
3794
|
+
* @throws {RequiredError}
|
|
3795
|
+
*/
|
|
3796
|
+
listSubscriptions(options) {
|
|
3797
|
+
return localVarFp.listSubscriptions(options).then((request) => request(axios, basePath));
|
|
3798
|
+
}
|
|
3799
|
+
};
|
|
3800
|
+
};
|
|
3801
|
+
/**
|
|
3802
|
+
* ExperimentalEndpointsApiGenerated - object-oriented interface
|
|
3803
|
+
* @export
|
|
3804
|
+
* @class ExperimentalEndpointsApiGenerated
|
|
3805
|
+
* @extends {BaseAPI}
|
|
3806
|
+
*/
|
|
3807
|
+
var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
|
|
3808
|
+
/**
|
|
3809
|
+
* Adds or restores a Trade Detection subscription for a connected brokerage account. This endpoint requires `userId` and `userSecret` in addition to the partner signature.
|
|
3810
|
+
* @summary Add a Trade Detection subscription
|
|
3811
|
+
* @param {ExperimentalEndpointsApiAddSubscriptionRequest} requestParameters Request parameters.
|
|
3812
|
+
* @param {*} [options] Override http request option.
|
|
3813
|
+
* @throws {RequiredError}
|
|
3814
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
3815
|
+
*/
|
|
3816
|
+
addSubscription(requestParameters, options) {
|
|
3817
|
+
return ExperimentalEndpointsApiFp(this.configuration).addSubscription(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
3818
|
+
}
|
|
3819
|
+
/**
|
|
3820
|
+
* Cancels a Trade Detection subscription for a connected brokerage account. This endpoint requires partner signature authentication only and does not require `userId` or `userSecret`.
|
|
3821
|
+
* @summary Cancel a Trade Detection subscription
|
|
3822
|
+
* @param {ExperimentalEndpointsApiCancelSubscriptionRequest} requestParameters Request parameters.
|
|
3823
|
+
* @param {*} [options] Override http request option.
|
|
3824
|
+
* @throws {RequiredError}
|
|
3825
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
3826
|
+
*/
|
|
3827
|
+
cancelSubscription(requestParameters, options) {
|
|
3828
|
+
return ExperimentalEndpointsApiFp(this.configuration).cancelSubscription(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
3829
|
+
}
|
|
3830
|
+
/**
|
|
3831
|
+
* 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.
|
|
3832
|
+
* @summary Get account order detail (V2)
|
|
3833
|
+
* @param {ExperimentalEndpointsApiGetUserAccountOrderDetailV2Request} requestParameters Request parameters.
|
|
3834
|
+
* @param {*} [options] Override http request option.
|
|
3835
|
+
* @throws {RequiredError}
|
|
3836
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
3837
|
+
*/
|
|
3838
|
+
getUserAccountOrderDetailV2(requestParameters, options) {
|
|
3839
|
+
return ExperimentalEndpointsApiFp(this.configuration).getUserAccountOrderDetailV2(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
3840
|
+
}
|
|
3841
|
+
/**
|
|
3842
|
+
* Returns a list of recent orders in the specified account. The V2 order response format will include all legs of each order in the `legs` list field. If the order is single legged, `legs` will be a list of one leg. 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.
|
|
3843
|
+
* @summary List account orders v2
|
|
3844
|
+
* @param {ExperimentalEndpointsApiGetUserAccountOrdersV2Request} requestParameters Request parameters.
|
|
3845
|
+
* @param {*} [options] Override http request option.
|
|
3846
|
+
* @throws {RequiredError}
|
|
3847
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
3848
|
+
*/
|
|
3849
|
+
getUserAccountOrdersV2(requestParameters, options) {
|
|
3850
|
+
return ExperimentalEndpointsApiFp(this.configuration).getUserAccountOrdersV2(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
3851
|
+
}
|
|
3852
|
+
/**
|
|
3853
|
+
* A lightweight endpoint that returns a list of orders executed in the last 24 hours in the specified account using the V2 order format. 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 /orders in that it is 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. **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)**
|
|
3854
|
+
* @summary List account recent orders (V2, last 24 hours only)
|
|
3855
|
+
* @param {ExperimentalEndpointsApiGetUserAccountRecentOrdersV2Request} requestParameters Request parameters.
|
|
3856
|
+
* @param {*} [options] Override http request option.
|
|
3857
|
+
* @throws {RequiredError}
|
|
3858
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
3859
|
+
*/
|
|
3860
|
+
getUserAccountRecentOrdersV2(requestParameters, options) {
|
|
3861
|
+
return ExperimentalEndpointsApiFp(this.configuration).getUserAccountRecentOrdersV2(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
3862
|
+
}
|
|
3863
|
+
/**
|
|
3864
|
+
* Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|
|
3865
|
+
* @summary List active Trade Detection subscriptions
|
|
3866
|
+
* @param {*} [options] Override http request option.
|
|
3867
|
+
* @throws {RequiredError}
|
|
3868
|
+
* @memberof ExperimentalEndpointsApiGenerated
|
|
3869
|
+
*/
|
|
3870
|
+
listSubscriptions(options) {
|
|
3871
|
+
return ExperimentalEndpointsApiFp(this.configuration).listSubscriptions(options).then((request) => request(this.axios, this.basePath));
|
|
3872
|
+
}
|
|
3873
|
+
};
|
|
3874
|
+
//#endregion
|
|
3875
|
+
//#region api/experimental-endpoints-api.ts
|
|
3876
|
+
var ExperimentalEndpointsApi = class extends ExperimentalEndpointsApiGenerated {};
|
|
3877
|
+
//#endregion
|
|
3266
3878
|
//#region api/options-api-generated.ts
|
|
3267
3879
|
/**
|
|
3268
3880
|
* OptionsApi - axios parameter creator
|
|
@@ -3271,12 +3883,13 @@ var ConnectionsApi = class extends ConnectionsApiGenerated {};
|
|
|
3271
3883
|
const OptionsApiAxiosParamCreator = function(configuration) {
|
|
3272
3884
|
return {
|
|
3273
3885
|
/**
|
|
3274
|
-
* Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
3886
|
+
* Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). This endpoint is deprecatd. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
3275
3887
|
* @summary List account option positions
|
|
3276
3888
|
* @param {string} userId
|
|
3277
3889
|
* @param {string} userSecret
|
|
3278
3890
|
* @param {string} accountId
|
|
3279
3891
|
* @param {*} [options] Override http request option.
|
|
3892
|
+
* @deprecated
|
|
3280
3893
|
* @throws {RequiredError}
|
|
3281
3894
|
*/
|
|
3282
3895
|
listOptionHoldings: async (userId, userSecret, accountId, options = {}) => {
|
|
@@ -3343,10 +3956,11 @@ const OptionsApiFp = function(configuration) {
|
|
|
3343
3956
|
const localVarAxiosParamCreator = OptionsApiAxiosParamCreator(configuration);
|
|
3344
3957
|
return {
|
|
3345
3958
|
/**
|
|
3346
|
-
* Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
3959
|
+
* Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). This endpoint is deprecatd. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
3347
3960
|
* @summary List account option positions
|
|
3348
3961
|
* @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
|
|
3349
3962
|
* @param {*} [options] Override http request option.
|
|
3963
|
+
* @deprecated
|
|
3350
3964
|
* @throws {RequiredError}
|
|
3351
3965
|
*/
|
|
3352
3966
|
async listOptionHoldings(requestParameters, options) {
|
|
@@ -3361,10 +3975,11 @@ const OptionsApiFactory = function(configuration, basePath, axios) {
|
|
|
3361
3975
|
const localVarFp = OptionsApiFp(configuration);
|
|
3362
3976
|
return {
|
|
3363
3977
|
/**
|
|
3364
|
-
* Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
3978
|
+
* Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). This endpoint is deprecatd. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
3365
3979
|
* @summary List account option positions
|
|
3366
3980
|
* @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
|
|
3367
3981
|
* @param {*} [options] Override http request option.
|
|
3982
|
+
* @deprecated
|
|
3368
3983
|
* @throws {RequiredError}
|
|
3369
3984
|
*/
|
|
3370
3985
|
listOptionHoldings(requestParameters, options) {
|
|
@@ -3379,10 +3994,11 @@ listOptionHoldings(requestParameters, options) {
|
|
|
3379
3994
|
*/
|
|
3380
3995
|
var OptionsApiGenerated = class extends BaseAPI {
|
|
3381
3996
|
/**
|
|
3382
|
-
* Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
3997
|
+
* Returns a list of option positions in the specified account. For stock/ETF/crypto/mutual fund positions, please use the [positions endpoint](/reference/Account%20Information/AccountInformation_getUserAccountPositions). This endpoint is deprecatd. Consider using the newer [unified positions endpoint](/reference/Account%20Information/AccountInformation_getAllAccountPositions). This will allow you to get both equity and option positions in a single call, as well as additional asset classes such as futures. Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see if you have real-time data access: - If you do, this endpoint returns real-time data. - If you don\'t, Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. If you need real-time, use the [manual refresh](/reference/Connections/Connections_refreshBrokerageAuthorization) endpoint.
|
|
3383
3998
|
* @summary List account option positions
|
|
3384
3999
|
* @param {OptionsApiListOptionHoldingsRequest} requestParameters Request parameters.
|
|
3385
4000
|
* @param {*} [options] Override http request option.
|
|
4001
|
+
* @deprecated
|
|
3386
4002
|
* @throws {RequiredError}
|
|
3387
4003
|
* @memberof OptionsApiGenerated
|
|
3388
4004
|
*/
|
|
@@ -6483,7 +7099,7 @@ var Configuration = class {
|
|
|
6483
7099
|
this.accessToken = param.accessToken;
|
|
6484
7100
|
this.basePath = param.basePath;
|
|
6485
7101
|
this.baseOptions = param.baseOptions ?? {};
|
|
6486
|
-
this.userAgent = param.userAgent === void 0 ? "Konfig/10.0.
|
|
7102
|
+
this.userAgent = param.userAgent === void 0 ? "Konfig/10.0.2/typescript" : param.userAgent;
|
|
6487
7103
|
this.formDataCtor = param.formDataCtor;
|
|
6488
7104
|
}
|
|
6489
7105
|
/**
|
|
@@ -6515,6 +7131,7 @@ var Snaptrade = class extends SnaptradeCustom {
|
|
|
6515
7131
|
this.apiStatus = new ApiStatusApi(configuration);
|
|
6516
7132
|
this.authentication = new AuthenticationApi(configuration);
|
|
6517
7133
|
this.connections = new ConnectionsApi(configuration);
|
|
7134
|
+
this.experimentalEndpoints = new ExperimentalEndpointsApi(configuration);
|
|
6518
7135
|
this.options = new OptionsApi(configuration);
|
|
6519
7136
|
this.referenceData = new ReferenceDataApi(configuration);
|
|
6520
7137
|
this.trading = new TradingApi(configuration);
|
|
@@ -6522,6 +7139,4 @@ var Snaptrade = class extends SnaptradeCustom {
|
|
|
6522
7139
|
}
|
|
6523
7140
|
};
|
|
6524
7141
|
//#endregion
|
|
6525
|
-
export { AccountInformationApi, AccountInformationApiAxiosParamCreator, AccountInformationApiFactory, AccountInformationApiFp, AccountInformationApiGenerated, ApiStatusApi, ApiStatusApiAxiosParamCreator, ApiStatusApiFactory, ApiStatusApiFp, ApiStatusApiGenerated, AuthenticationApi, AuthenticationApiAxiosParamCreator, AuthenticationApiFactory, AuthenticationApiFp, AuthenticationApiGenerated, Configuration, ConnectionsApi, ConnectionsApiAxiosParamCreator, ConnectionsApiFactory, ConnectionsApiFp, ConnectionsApiGenerated, OptionsApi, OptionsApiAxiosParamCreator, OptionsApiFactory, OptionsApiFp, OptionsApiGenerated, ReferenceDataApi, ReferenceDataApiAxiosParamCreator, ReferenceDataApiFactory, ReferenceDataApiFp, ReferenceDataApiGenerated, Snaptrade, SnaptradeError, TradingApi, TradingApiAxiosParamCreator, TradingApiFactory, TradingApiFp, TradingApiGenerated, TransactionsAndReportingApi, TransactionsAndReportingApiAxiosParamCreator, TransactionsAndReportingApiFactory, TransactionsAndReportingApiFp, TransactionsAndReportingApiGenerated, parseIfJson, readableStreamToString };
|
|
6526
|
-
|
|
6527
|
-
//# sourceMappingURL=index.mjs.map
|
|
7142
|
+
export { AccountInformationApi, AccountInformationApiAxiosParamCreator, AccountInformationApiFactory, AccountInformationApiFp, AccountInformationApiGenerated, ApiStatusApi, ApiStatusApiAxiosParamCreator, ApiStatusApiFactory, ApiStatusApiFp, ApiStatusApiGenerated, AuthenticationApi, AuthenticationApiAxiosParamCreator, AuthenticationApiFactory, AuthenticationApiFp, AuthenticationApiGenerated, Configuration, ConnectionsApi, ConnectionsApiAxiosParamCreator, ConnectionsApiFactory, ConnectionsApiFp, ConnectionsApiGenerated, ExperimentalEndpointsApi, ExperimentalEndpointsApiAxiosParamCreator, ExperimentalEndpointsApiFactory, ExperimentalEndpointsApiFp, ExperimentalEndpointsApiGenerated, OptionsApi, OptionsApiAxiosParamCreator, OptionsApiFactory, OptionsApiFp, OptionsApiGenerated, ReferenceDataApi, ReferenceDataApiAxiosParamCreator, ReferenceDataApiFactory, ReferenceDataApiFp, ReferenceDataApiGenerated, Snaptrade, SnaptradeError, TradingApi, TradingApiAxiosParamCreator, TradingApiFactory, TradingApiFp, TradingApiGenerated, TransactionsAndReportingApi, TransactionsAndReportingApiAxiosParamCreator, TransactionsAndReportingApiFactory, TransactionsAndReportingApiFp, TransactionsAndReportingApiGenerated, parseIfJson, readableStreamToString };
|