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/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Connect brokerage accounts to your app for live positions and trading
|
|
8
8
|
|
|
9
|
-
[](https://www.npmjs.com/package/snaptrade-typescript-sdk/v/12.1.5)
|
|
10
10
|
[](https://snaptrade.com/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
@@ -27,6 +27,7 @@ Connect brokerage accounts to your app for live positions and trading
|
|
|
27
27
|
* [`snaptrade.accountInformation.getUserAccountOrders`](#snaptradeaccountinformationgetuseraccountorders)
|
|
28
28
|
* [`snaptrade.accountInformation.getUserAccountRecentOrders`](#snaptradeaccountinformationgetuseraccountrecentorders)
|
|
29
29
|
* [`snaptrade.accountInformation.getUserAccountReturnRates`](#snaptradeaccountinformationgetuseraccountreturnrates)
|
|
30
|
+
* [`snaptrade.accountInformation.getUserAumPercentile`](#snaptradeaccountinformationgetuseraumpercentile)
|
|
30
31
|
* [`snaptrade.accountInformation.getUserHoldings`](#snaptradeaccountinformationgetuserholdings)
|
|
31
32
|
* [`snaptrade.accountInformation.listUserAccounts`](#snaptradeaccountinformationlistuseraccounts)
|
|
32
33
|
* [`snaptrade.accountInformation.updateUserAccount`](#snaptradeaccountinformationupdateuseraccount)
|
|
@@ -573,6 +574,35 @@ Optional comma separated list of rate-of-return timeframes to return. Supported
|
|
|
573
574
|
---
|
|
574
575
|
|
|
575
576
|
|
|
577
|
+
### `snaptrade.accountInformation.getUserAumPercentile`<a id="snaptradeaccountinformationgetuseraumpercentile"></a>
|
|
578
|
+
|
|
579
|
+
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.
|
|
580
|
+
|
|
581
|
+
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.
|
|
582
|
+
|
|
583
|
+
`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.
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
587
|
+
|
|
588
|
+
```typescript
|
|
589
|
+
const getUserAumPercentileResponse =
|
|
590
|
+
await snaptrade.accountInformation.getUserAumPercentile();
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
594
|
+
|
|
595
|
+
[UserAumPercentileResponse](./models/user-aum-percentile-response.ts)
|
|
596
|
+
|
|
597
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
598
|
+
|
|
599
|
+
`/aumPercentile` `GET`
|
|
600
|
+
|
|
601
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
602
|
+
|
|
603
|
+
---
|
|
604
|
+
|
|
605
|
+
|
|
576
606
|
### `snaptrade.accountInformation.getUserHoldings`<a id="snaptradeaccountinformationgetuserholdings"></a>
|
|
577
607
|

|
|
578
608
|
|
|
@@ -760,6 +790,7 @@ const loginSnapTradeUserResponse =
|
|
|
760
790
|
connectionType: "read",
|
|
761
791
|
showCloseButton: true,
|
|
762
792
|
darkMode: true,
|
|
793
|
+
locale: "pt-BR",
|
|
763
794
|
connectionPortalVersion: "v4",
|
|
764
795
|
});
|
|
765
796
|
```
|
|
@@ -794,6 +825,10 @@ Controls whether the close (X) button is displayed in the connection portal. Whe
|
|
|
794
825
|
|
|
795
826
|
Enable dark mode for the connection portal. Defaults to false.
|
|
796
827
|
|
|
828
|
+
##### locale: `string`<a id="locale-string"></a>
|
|
829
|
+
|
|
830
|
+
Language the connection portal renders in. `en` and `pt-BR` are the languages we ship; any other language is rejected with a 400. Matching is case- and separator-insensitive, so `pt-br`, `pt-BR` and `pt_BR` are equivalent, and a regional tag resolves to the language when we ship it, so `en-US` renders `en`. Deliberately not an enum: those equivalent spellings are all accepted by the API, and an enum would have generated SDKs reject them before the request is sent. Screens without translated copy fall back to English individually. Defaults to `en`.
|
|
831
|
+
|
|
797
832
|
##### connectionPortalVersion: `string`<a id="connectionportalversion-string"></a>
|
|
798
833
|
|
|
799
834
|
Sets the connection portal version to render. Currently only `v4` is supported and is the default. All other versions are deprecated and will automatically be set to v4.
|
|
@@ -1347,9 +1382,9 @@ Experimental and subject to change without notice.
|
|
|
1347
1382
|
|
|
1348
1383
|
Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape.
|
|
1349
1384
|
|
|
1350
|
-
Each item in the response carries a `kind` field (currently
|
|
1385
|
+
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.
|
|
1351
1386
|
|
|
1352
|
-
On Pay as you Go / Real-time, this endpoint refreshes each account's opening date
|
|
1387
|
+
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.
|
|
1353
1388
|
|
|
1354
1389
|
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).
|
|
1355
1390
|
|