snaptrade-typescript-sdk 12.1.3 → 12.1.5
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 +38 -3
- package/dist/browser.umd.js +1 -1
- package/dist/index.cjs +120 -5
- package/dist/index.d.cts +262 -6
- package/dist/index.d.mts +262 -6
- package/dist/index.d.ts +262 -6
- package/dist/index.mjs +120 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -981,6 +981,77 @@ const AccountInformationApiAxiosParamCreator = function(configuration) {
|
|
|
981
981
|
};
|
|
982
982
|
},
|
|
983
983
|
/**
|
|
984
|
+
* 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.
|
|
985
|
+
* @summary Get the user\'s AUM percentile
|
|
986
|
+
* @param {string} [userId]
|
|
987
|
+
* @param {string} [userSecret]
|
|
988
|
+
* @param {*} [options] Override http request option.
|
|
989
|
+
* @throws {RequiredError}
|
|
990
|
+
*/
|
|
991
|
+
getUserAumPercentile: async (userId, userSecret, options = {}) => {
|
|
992
|
+
const localVarPath = `/aumPercentile`;
|
|
993
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
994
|
+
let baseOptions;
|
|
995
|
+
if (configuration) baseOptions = configuration.baseOptions;
|
|
996
|
+
const localVarRequestOptions = {
|
|
997
|
+
method: "GET",
|
|
998
|
+
...baseOptions,
|
|
999
|
+
...options
|
|
1000
|
+
};
|
|
1001
|
+
const localVarHeaderParameter = configuration && !isBrowser() ? { "User-Agent": configuration.userAgent } : {};
|
|
1002
|
+
const localVarQueryParameter = {};
|
|
1003
|
+
if (configuration?.authMode === "commercialApiKey") {
|
|
1004
|
+
await setApiKeyToObject({
|
|
1005
|
+
object: localVarQueryParameter,
|
|
1006
|
+
key: "clientId",
|
|
1007
|
+
keyParamName: "clientId",
|
|
1008
|
+
configuration
|
|
1009
|
+
});
|
|
1010
|
+
if (userId !== void 0) localVarQueryParameter["userId"] = userId;
|
|
1011
|
+
if (userSecret !== void 0) localVarQueryParameter["userSecret"] = userSecret;
|
|
1012
|
+
}
|
|
1013
|
+
if (configuration?.authMode === "personalApiKey") await setApiKeyToObject({
|
|
1014
|
+
object: localVarQueryParameter,
|
|
1015
|
+
key: "clientId",
|
|
1016
|
+
keyParamName: "clientId",
|
|
1017
|
+
configuration
|
|
1018
|
+
});
|
|
1019
|
+
const localVarOperationAuth = {
|
|
1020
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
1021
|
+
requestSigningByAuthMode: {
|
|
1022
|
+
"commercialApiKey": {
|
|
1023
|
+
secretParameter: "consumerKey",
|
|
1024
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
1025
|
+
},
|
|
1026
|
+
"personalApiKey": {
|
|
1027
|
+
secretParameter: "consumerKey",
|
|
1028
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
1029
|
+
}
|
|
1030
|
+
},
|
|
1031
|
+
selectedAuthMode: configuration?.authMode
|
|
1032
|
+
};
|
|
1033
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
1034
|
+
localVarRequestOptions.headers = {
|
|
1035
|
+
...localVarHeaderParameter,
|
|
1036
|
+
...headersFromBaseOptions,
|
|
1037
|
+
...options.headers
|
|
1038
|
+
};
|
|
1039
|
+
requestBeforeHook({
|
|
1040
|
+
queryParameters: localVarQueryParameter,
|
|
1041
|
+
requestConfig: localVarRequestOptions,
|
|
1042
|
+
path: localVarPath,
|
|
1043
|
+
configuration,
|
|
1044
|
+
pathTemplate: "/aumPercentile",
|
|
1045
|
+
httpMethod: "GET",
|
|
1046
|
+
operationAuth: localVarOperationAuth
|
|
1047
|
+
});
|
|
1048
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
1049
|
+
return {
|
|
1050
|
+
url: toPathString(localVarUrlObj),
|
|
1051
|
+
options: localVarRequestOptions
|
|
1052
|
+
};
|
|
1053
|
+
},
|
|
1054
|
+
/**
|
|
984
1055
|
* **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.
|
|
985
1056
|
* @summary List account holdings
|
|
986
1057
|
* @param {string} accountId
|
|
@@ -1407,6 +1478,28 @@ const AccountInformationApiFp = function(configuration) {
|
|
|
1407
1478
|
});
|
|
1408
1479
|
},
|
|
1409
1480
|
/**
|
|
1481
|
+
* 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.
|
|
1482
|
+
* @summary Get the user\'s AUM percentile
|
|
1483
|
+
* @param {AccountInformationApiGetUserAumPercentileRequest<TAuth>} requestParameters Request parameters.
|
|
1484
|
+
* @param {*} [options] Override http request option.
|
|
1485
|
+
* @throws {RequiredError}
|
|
1486
|
+
*/
|
|
1487
|
+
async getUserAumPercentile(requestParameters = {}, options) {
|
|
1488
|
+
return createRequestFunction(await localVarAxiosParamCreator.getUserAumPercentile(requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
1489
|
+
authModes: ["commercialApiKey", "personalApiKey"],
|
|
1490
|
+
requestSigningByAuthMode: {
|
|
1491
|
+
"commercialApiKey": {
|
|
1492
|
+
secretParameter: "consumerKey",
|
|
1493
|
+
signedSecuritySchemes: ["PartnerSignature", "PartnerTimestamp"]
|
|
1494
|
+
},
|
|
1495
|
+
"personalApiKey": {
|
|
1496
|
+
secretParameter: "consumerKey",
|
|
1497
|
+
signedSecuritySchemes: ["PersonalSignature", "PersonalTimestamp"]
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
});
|
|
1501
|
+
},
|
|
1502
|
+
/**
|
|
1410
1503
|
* **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.
|
|
1411
1504
|
* @summary List account holdings
|
|
1412
1505
|
* @param {AccountInformationApiGetUserHoldingsRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -1573,6 +1666,16 @@ const AccountInformationApiFactory = function(configuration, basePath, axios$7)
|
|
|
1573
1666
|
return localVarFp.getUserAccountReturnRates(requestParameters, options).then((request) => request(axios$7, basePath));
|
|
1574
1667
|
},
|
|
1575
1668
|
/**
|
|
1669
|
+
* 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.
|
|
1670
|
+
* @summary Get the user\'s AUM percentile
|
|
1671
|
+
* @param {AccountInformationApiGetUserAumPercentileRequest<TAuth>} requestParameters Request parameters.
|
|
1672
|
+
* @param {*} [options] Override http request option.
|
|
1673
|
+
* @throws {RequiredError}
|
|
1674
|
+
*/
|
|
1675
|
+
getUserAumPercentile(requestParameters = {}, options) {
|
|
1676
|
+
return localVarFp.getUserAumPercentile(requestParameters, options).then((request) => request(axios$7, basePath));
|
|
1677
|
+
},
|
|
1678
|
+
/**
|
|
1576
1679
|
* **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.
|
|
1577
1680
|
* @summary List account holdings
|
|
1578
1681
|
* @param {AccountInformationApiGetUserHoldingsRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -1712,6 +1815,17 @@ var AccountInformationApiGenerated = class extends BaseAPI {
|
|
|
1712
1815
|
return AccountInformationApiFp(this.configuration).getUserAccountReturnRates(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1713
1816
|
}
|
|
1714
1817
|
/**
|
|
1818
|
+
* 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.
|
|
1819
|
+
* @summary Get the user\'s AUM percentile
|
|
1820
|
+
* @param {AccountInformationApiGetUserAumPercentileRequest<TAuth>} requestParameters Request parameters.
|
|
1821
|
+
* @param {*} [options] Override http request option.
|
|
1822
|
+
* @throws {RequiredError}
|
|
1823
|
+
* @memberof AccountInformationApiGenerated
|
|
1824
|
+
*/
|
|
1825
|
+
getUserAumPercentile(requestParameters = {}, options) {
|
|
1826
|
+
return AccountInformationApiFp(this.configuration).getUserAumPercentile(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
1827
|
+
}
|
|
1828
|
+
/**
|
|
1715
1829
|
* **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.
|
|
1716
1830
|
* @summary List account holdings
|
|
1717
1831
|
* @param {AccountInformationApiGetUserHoldingsRequest<TAuth>} requestParameters Request parameters.
|
|
@@ -2222,6 +2336,7 @@ const AuthenticationApiFp = function(configuration) {
|
|
|
2222
2336
|
connectionType: requestParameters.connectionType,
|
|
2223
2337
|
showCloseButton: requestParameters.showCloseButton,
|
|
2224
2338
|
darkMode: requestParameters.darkMode,
|
|
2339
|
+
locale: requestParameters.locale,
|
|
2225
2340
|
connectionPortalVersion: requestParameters.connectionPortalVersion
|
|
2226
2341
|
};
|
|
2227
2342
|
return createRequestFunction(await localVarAxiosParamCreator.loginSnapTradeUser(snapTradeLoginUserRequestBody, requestParameters.userId, requestParameters.userSecret, options), axios.default, BASE_PATH, configuration, {
|
|
@@ -3749,7 +3864,7 @@ const ExperimentalEndpointsApiAxiosParamCreator = function(configuration) {
|
|
|
3749
3864
|
};
|
|
3750
3865
|
},
|
|
3751
3866
|
/**
|
|
3752
|
-
* Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently
|
|
3867
|
+
* Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently `investment` and `deposit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema. On Pay as you Go / Real-time, this endpoint refreshes each account\'s opening date and total balance (`market_value` for `investment`, `balance` for `deposit`) live from the brokerage on each call, along with funding date for `investment` accounts. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
|
|
3753
3868
|
* @summary List accounts for a connection (discriminated union)
|
|
3754
3869
|
* @param {string} authorizationId
|
|
3755
3870
|
* @param {string} [userId]
|
|
@@ -4011,7 +4126,7 @@ const ExperimentalEndpointsApiFp = function(configuration) {
|
|
|
4011
4126
|
});
|
|
4012
4127
|
},
|
|
4013
4128
|
/**
|
|
4014
|
-
* Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently
|
|
4129
|
+
* Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently `investment` and `deposit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema. On Pay as you Go / Real-time, this endpoint refreshes each account\'s opening date and total balance (`market_value` for `investment`, `balance` for `deposit`) live from the brokerage on each call, along with funding date for `investment` accounts. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
|
|
4015
4130
|
* @summary List accounts for a connection (discriminated union)
|
|
4016
4131
|
* @param {ExperimentalEndpointsApiListConnectionAccountsRequest<TAuth>} requestParameters Request parameters.
|
|
4017
4132
|
* @param {*} [options] Override http request option.
|
|
@@ -4114,7 +4229,7 @@ const ExperimentalEndpointsApiFactory = function(configuration, basePath, axios$
|
|
|
4114
4229
|
return localVarFp.getUserAccountRecentOrdersV2(requestParameters, options).then((request) => request(axios$3, basePath));
|
|
4115
4230
|
},
|
|
4116
4231
|
/**
|
|
4117
|
-
* Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently
|
|
4232
|
+
* Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently `investment` and `deposit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema. On Pay as you Go / Real-time, this endpoint refreshes each account\'s opening date and total balance (`market_value` for `investment`, `balance` for `deposit`) live from the brokerage on each call, along with funding date for `investment` accounts. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
|
|
4118
4233
|
* @summary List accounts for a connection (discriminated union)
|
|
4119
4234
|
* @param {ExperimentalEndpointsApiListConnectionAccountsRequest<TAuth>} requestParameters Request parameters.
|
|
4120
4235
|
* @param {*} [options] Override http request option.
|
|
@@ -4197,7 +4312,7 @@ var ExperimentalEndpointsApiGenerated = class extends BaseAPI {
|
|
|
4197
4312
|
return ExperimentalEndpointsApiFp(this.configuration).getUserAccountRecentOrdersV2(requestParameters, options).then((request) => request(this.axios, this.basePath));
|
|
4198
4313
|
}
|
|
4199
4314
|
/**
|
|
4200
|
-
* Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently
|
|
4315
|
+
* Experimental and subject to change without notice. Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape. Each item in the response carries a `kind` field (currently `investment` and `deposit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema. On Pay as you Go / Real-time, this endpoint refreshes each account\'s opening date and total balance (`market_value` for `investment`, `balance` for `deposit`) live from the brokerage on each call, along with funding date for `investment` accounts. On Pay as you Go / Daily, this endpoint returns Daily data. Daily data is cached and refreshed once a day. Exact refresh timing may vary by brokerage. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization). Check your API key on the [Customer Dashboard billing page](https://dashboard.snaptrade.com/settings/billing) to see whether your plan includes real-time data.
|
|
4201
4316
|
* @summary List accounts for a connection (discriminated union)
|
|
4202
4317
|
* @param {ExperimentalEndpointsApiListConnectionAccountsRequest<TAuth>} requestParameters Request parameters.
|
|
4203
4318
|
* @param {*} [options] Override http request option.
|
|
@@ -6996,7 +7111,7 @@ var Configuration = class {
|
|
|
6996
7111
|
}
|
|
6997
7112
|
this.basePath = param.basePath;
|
|
6998
7113
|
this.baseOptions = param.baseOptions ?? {};
|
|
6999
|
-
this.userAgent = param.userAgent === void 0 ? "Konfig/12.1.
|
|
7114
|
+
this.userAgent = param.userAgent === void 0 ? "Konfig/12.1.5/typescript" : param.userAgent;
|
|
7000
7115
|
this.formDataCtor = param.formDataCtor;
|
|
7001
7116
|
}
|
|
7002
7117
|
/**
|