snaptrade-typescript-sdk 12.1.3 → 12.1.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 +36 -1
- package/dist/browser.umd.js +1 -1
- package/dist/index.cjs +116 -1
- package/dist/index.d.cts +156 -1
- package/dist/index.d.mts +156 -1
- package/dist/index.d.ts +156 -1
- package/dist/index.mjs +116 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -957,6 +957,77 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
957
957
|
};
|
|
958
958
|
},
|
|
959
959
|
/**
|
|
960
|
+
* Returns where the user\'s total assets sit within the distribution of a cohort of comparable users, as a coarse bucket plus an integer percentile. The cohort is scoped to your own book: a user is only ever compared against your other users, never across SnapTrade customers. (Users on personal-use keys are the exception — they are compared against all other personal-use users, since a personal key has a single user and cannot form a distribution of its own.) The distribution is recomputed monthly, and `as_of` reports which month\'s distribution the placement came from. `data` is `null` — a 200, not an error — when SnapTrade declines to place the user. That happens when the cohort is too small to publish a distribution, or when the user\'s own holdings are incomplete or stale (for example they hold a disabled connection). A placement computed from a partial view of a user\'s assets would understate them, so none is returned.
|
|
961
|
+
* @summary Get the user\'s AUM percentile
|
|
962
|
+
* @param {string} [userId]
|
|
963
|
+
* @param {string} [userSecret]
|
|
964
|
+
* @param {*} [options] Override http request option.
|
|
965
|
+
* @throws {RequiredError}
|
|
966
|
+
*/
|
|
967
|
+
getUserAumPercentile: async (userId, userSecret, options = {}) => {
|
|
968
|
+
const localVarPath = `/aumPercentile`;
|
|
969
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
970
|
+
let baseOptions;
|
|
971
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
972
|
+
const localVarRequestOptions = {
|
|
973
|
+
method: "GET",
|
|
974
|
+
...baseOptions,
|
|
975
|
+
...options
|
|
976
|
+
};
|
|
977
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
978
|
+
const localVarQueryParameter = {};
|
|
979
|
+
if (configuration?.authMode === "commercialApiKey") {
|
|
980
|
+
await setApiKeyToObject({
|
|
981
|
+
object: localVarQueryParameter,
|
|
982
|
+
key: "clientId",
|
|
983
|
+
keyParamName: "clientId",
|
|
984
|
+
configuration
|
|
985
|
+
});
|
|
986
|
+
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
987
|
+
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
988
|
+
}
|
|
989
|
+
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
990
|
+
object: localVarQueryParameter,
|
|
991
|
+
key: "clientId",
|
|
992
|
+
keyParamName: "clientId",
|
|
993
|
+
configuration
|
|
994
|
+
});
|
|
995
|
+
const localVarOperationAuth = {
|
|
996
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
997
|
+
requestSigningByAuthMode: {
|
|
998
|
+
"commercialApiKey": {
|
|
999
|
+
secretParameter: "consumerKey",
|
|
1000
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
1001
|
+
},
|
|
1002
|
+
"personalApiKey": {
|
|
1003
|
+
secretParameter: "consumerKey",
|
|
1004
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
1005
|
+
}
|
|
1006
|
+
},
|
|
1007
|
+
selectedAuthMode: configuration?.authMode
|
|
1008
|
+
};
|
|
1009
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1010
|
+
localVarRequestOptions.headers = {
|
|
1011
|
+
...localVarHeaderParameter,
|
|
1012
|
+
...headersFromBaseOptions,
|
|
1013
|
+
...options.headers
|
|
1014
|
+
};
|
|
1015
|
+
requestBeforeHook({
|
|
1016
|
+
queryParameters: localVarQueryParameter,
|
|
1017
|
+
requestConfig: localVarRequestOptions,
|
|
1018
|
+
path: localVarPath,
|
|
1019
|
+
configuration,
|
|
1020
|
+
pathTemplate: "/aumPercentile",
|
|
1021
|
+
httpMethod: "GET",
|
|
1022
|
+
operationAuth: localVarOperationAuth
|
|
1023
|
+
});
|
|
1024
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1025
|
+
return {
|
|
1026
|
+
url: toPathString(localVarUrlObj),
|
|
1027
|
+
options: localVarRequestOptions
|
|
1028
|
+
};
|
|
1029
|
+
},
|
|
1030
|
+
/**
|
|
960
1031
|
* **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). This endpoint will return HTTP 410 Gone for all customers that sign up after May 11, 2026. Returns a list of balances, positions, and recent orders for the specified account. 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.
|
|
961
1032
|
* @summary List account holdings
|
|
962
1033
|
* @param {string} accountId
|
|
@@ -1383,6 +1454,28 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1383
1454
|
});
|
|
1384
1455
|
},
|
|
1385
1456
|
/**
|
|
1457
|
+
* Returns where the user\'s total assets sit within the distribution of a cohort of comparable users, as a coarse bucket plus an integer percentile. The cohort is scoped to your own book: a user is only ever compared against your other users, never across SnapTrade customers. (Users on personal-use keys are the exception — they are compared against all other personal-use users, since a personal key has a single user and cannot form a distribution of its own.) The distribution is recomputed monthly, and `as_of` reports which month\'s distribution the placement came from. `data` is `null` — a 200, not an error — when SnapTrade declines to place the user. That happens when the cohort is too small to publish a distribution, or when the user\'s own holdings are incomplete or stale (for example they hold a disabled connection). A placement computed from a partial view of a user\'s assets would understate them, so none is returned.
|
|
1458
|
+
* @summary Get the user\'s AUM percentile
|
|
1459
|
+
* @param {AccountInformationApiGetUserAumPercentileRequest<TAuth>} requestParameters Request parameters.
|
|
1460
|
+
* @param {*} [options] Override http request option.
|
|
1461
|
+
* @throws {RequiredError}
|
|
1462
|
+
*/
|
|
1463
|
+
async getUserAumPercentile(requestParameters = {}, options) {
|
|
1464
|
+
return createRequestFunction(await localVarAxiosParamCreator.getUserAumPercentile(requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
|
|
1465
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
1466
|
+
requestSigningByAuthMode: {
|
|
1467
|
+
"commercialApiKey": {
|
|
1468
|
+
secretParameter: "consumerKey",
|
|
1469
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
1470
|
+
},
|
|
1471
|
+
"personalApiKey": {
|
|
1472
|
+
secretParameter: "consumerKey",
|
|
1473
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
});
|
|
1477
|
+
},
|
|
1478
|
+
/**
|
|
1386
1479
|
* **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). This endpoint will return HTTP 410 Gone for all customers that sign up after May 11, 2026. Returns a list of balances, positions, and recent orders for the specified account. 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.
|
|
1387
1480
|
* @summary List account holdings
|
|
1388
1481
|
* @param {AccountInformationApiGetUserHoldingsRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -1549,6 +1642,16 @@ const AccountInformationApiFactory = function(configuration, basePath, axios) {
|
|
|
1549
1642
|
return localVarFp.getUserAccountReturnRates(requestParameters, options).then((request) => request(axios, basePath));
|
|
1550
1643
|
},
|
|
1551
1644
|
/**
|
|
1645
|
+
* Returns where the user\'s total assets sit within the distribution of a cohort of comparable users, as a coarse bucket plus an integer percentile. The cohort is scoped to your own book: a user is only ever compared against your other users, never across SnapTrade customers. (Users on personal-use keys are the exception — they are compared against all other personal-use users, since a personal key has a single user and cannot form a distribution of its own.) The distribution is recomputed monthly, and `as_of` reports which month\'s distribution the placement came from. `data` is `null` — a 200, not an error — when SnapTrade declines to place the user. That happens when the cohort is too small to publish a distribution, or when the user\'s own holdings are incomplete or stale (for example they hold a disabled connection). A placement computed from a partial view of a user\'s assets would understate them, so none is returned.
|
|
1646
|
+
* @summary Get the user\'s AUM percentile
|
|
1647
|
+
* @param {AccountInformationApiGetUserAumPercentileRequest<TAuth>} requestParameters Request parameters.
|
|
1648
|
+
* @param {*} [options] Override http request option.
|
|
1649
|
+
* @throws {RequiredError}
|
|
1650
|
+
*/
|
|
1651
|
+
getUserAumPercentile(requestParameters = {}, options) {
|
|
1652
|
+
return localVarFp.getUserAumPercentile(requestParameters, options).then((request) => request(axios, basePath));
|
|
1653
|
+
},
|
|
1654
|
+
/**
|
|
1552
1655
|
* **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). This endpoint will return HTTP 410 Gone for all customers that sign up after May 11, 2026. Returns a list of balances, positions, and recent orders for the specified account. 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.
|
|
1553
1656
|
* @summary List account holdings
|
|
1554
1657
|
* @param {AccountInformationApiGetUserHoldingsRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -1688,6 +1791,17 @@ var AccountInformationApiGenerated = class extends BaseAPI {
|
|
|
1688
1791
|
return AccountInformationApiFp(this.configuration).getUserAccountReturnRates(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1689
1792
|
}
|
|
1690
1793
|
/**
|
|
1794
|
+
* Returns where the user\'s total assets sit within the distribution of a cohort of comparable users, as a coarse bucket plus an integer percentile. The cohort is scoped to your own book: a user is only ever compared against your other users, never across SnapTrade customers. (Users on personal-use keys are the exception — they are compared against all other personal-use users, since a personal key has a single user and cannot form a distribution of its own.) The distribution is recomputed monthly, and `as_of` reports which month\'s distribution the placement came from. `data` is `null` — a 200, not an error — when SnapTrade declines to place the user. That happens when the cohort is too small to publish a distribution, or when the user\'s own holdings are incomplete or stale (for example they hold a disabled connection). A placement computed from a partial view of a user\'s assets would understate them, so none is returned.
|
|
1795
|
+
* @summary Get the user\'s AUM percentile
|
|
1796
|
+
* @param {AccountInformationApiGetUserAumPercentileRequest<TAuth>} requestParameters Request parameters.
|
|
1797
|
+
* @param {*} [options] Override http request option.
|
|
1798
|
+
* @throws {RequiredError}
|
|
1799
|
+
* @memberof AccountInformationApiGenerated
|
|
1800
|
+
*/
|
|
1801
|
+
getUserAumPercentile(requestParameters = {}, options) {
|
|
1802
|
+
return AccountInformationApiFp(this.configuration).getUserAumPercentile(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1803
|
+
}
|
|
1804
|
+
/**
|
|
1691
1805
|
* **Deprecated.** Use the finer-grained account data endpoints instead: [balances](/reference/Account%20Information/AccountInformation_getUserAccountBalance), [positions](/reference/Account%20Information/AccountInformation_getAllAccountPositions), and [orders](/reference/Account%20Information/AccountInformation_getUserAccountOrders). This endpoint will return HTTP 410 Gone for all customers that sign up after May 11, 2026. Returns a list of balances, positions, and recent orders for the specified account. 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.
|
|
1692
1806
|
* @summary List account holdings
|
|
1693
1807
|
* @param {AccountInformationApiGetUserHoldingsRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -2198,6 +2312,7 @@ const AuthenticationApiFp = function(configuration) {
|
|
|
2198
2312
|
connectionType: requestParameters.connectionType,
|
|
2199
2313
|
showCloseButton: requestParameters.showCloseButton,
|
|
2200
2314
|
darkMode: requestParameters.darkMode,
|
|
2315
|
+
locale: requestParameters.locale,
|
|
2201
2316
|
connectionPortalVersion: requestParameters.connectionPortalVersion
|
|
2202
2317
|
};
|
|
2203
2318
|
return createRequestFunction(await localVarAxiosParamCreator.loginSnapTradeUser(snapTradeLoginUserRequestBody, requestParameters.userId, requestParameters.userSecret, options), globalAxios, BASE_PATH, configuration, {
|
|
@@ -6972,7 +7087,7 @@ var Configuration = class {
|
|
|
6972
7087
|
}
|
|
6973
7088
|
this.basePath = param.basePath;
|
|
6974
7089
|
this.baseOptions = param.baseOptions ?? {};
|
|
6975
|
-
this.userAgent = param.userAgent === void 0 ? "Konfig/12.1.
|
|
7090
|
+
this.userAgent = param.userAgent === void 0 ? "Konfig/12.1.4/typescript" : param.userAgent;
|
|
6976
7091
|
this.formDataCtor = param.formDataCtor;
|
|
6977
7092
|
}
|
|
6978
7093
|
/**
|