snaptrade-typescript-sdk 12.2.5 → 12.2.7
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 +66 -66
- package/dist/browser.umd.js +1 -1
- package/dist/index.cjs +122 -122
- package/dist/index.d.cts +147 -67
- package/dist/index.d.mts +147 -67
- package/dist/index.d.ts +147 -67
- package/dist/index.mjs +122 -122
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ backoff with jitter rather than from the headers.
|
|
|
63
63
|
See https://docs.snaptrade.com/docs/ratelimiting.
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
[](https://www.npmjs.com/package/snaptrade-typescript-sdk/v/12.2.7)
|
|
67
67
|
[](https://snaptrade.com/)
|
|
68
68
|
|
|
69
69
|
</div>
|
|
@@ -101,6 +101,7 @@ See https://docs.snaptrade.com/docs/ratelimiting.
|
|
|
101
101
|
* [`snaptrade.connections.disableBrokerageAuthorization`](#snaptradeconnectionsdisablebrokerageauthorization)
|
|
102
102
|
* [`snaptrade.connections.listBrokerageAuthorizationAccounts`](#snaptradeconnectionslistbrokerageauthorizationaccounts)
|
|
103
103
|
* [`snaptrade.connections.listBrokerageAuthorizations`](#snaptradeconnectionslistbrokerageauthorizations)
|
|
104
|
+
* [`snaptrade.connections.listConnectionAccounts`](#snaptradeconnectionslistconnectionaccounts)
|
|
104
105
|
* [`snaptrade.connections.refreshBrokerageAuthorization`](#snaptradeconnectionsrefreshbrokerageauthorization)
|
|
105
106
|
* [`snaptrade.connections.returnRates`](#snaptradeconnectionsreturnrates)
|
|
106
107
|
* [`snaptrade.connections.syncBrokerageAuthorizationTransactions`](#snaptradeconnectionssyncbrokerageauthorizationtransactions)
|
|
@@ -109,7 +110,6 @@ See https://docs.snaptrade.com/docs/ratelimiting.
|
|
|
109
110
|
* [`snaptrade.experimentalEndpoints.getUserAccountOrderDetailV2`](#snaptradeexperimentalendpointsgetuseraccountorderdetailv2)
|
|
110
111
|
* [`snaptrade.experimentalEndpoints.getUserAccountOrdersV2`](#snaptradeexperimentalendpointsgetuseraccountordersv2)
|
|
111
112
|
* [`snaptrade.experimentalEndpoints.getUserAccountRecentOrdersV2`](#snaptradeexperimentalendpointsgetuseraccountrecentordersv2)
|
|
112
|
-
* [`snaptrade.experimentalEndpoints.listConnectionAccounts`](#snaptradeexperimentalendpointslistconnectionaccounts)
|
|
113
113
|
* [`snaptrade.experimentalEndpoints.listSubscriptions`](#snaptradeexperimentalendpointslistsubscriptions)
|
|
114
114
|
* [`snaptrade.referenceData.getPartnerInfo`](#snaptradereferencedatagetpartnerinfo)
|
|
115
115
|
* [`snaptrade.referenceData.getStockExchanges`](#snaptradereferencedatagetstockexchanges)
|
|
@@ -445,7 +445,9 @@ The client identifies the user in this mode. Do not pass `userId` `userSecret` t
|
|
|
445
445
|
|
|
446
446
|
Returns a list of all positions in the specified account.
|
|
447
447
|
|
|
448
|
-
The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, and CFD positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`.
|
|
448
|
+
The `results` list can contain multiple instrument types in the same response, including stocks, ADRs, ETFs, mutual funds, closed-end funds, bonds, crypto, futures, option positions, future option positions, and CFD positions. Use the `instrument.kind` discriminator to determine the schema for each position's `instrument`.
|
|
449
|
+
|
|
450
|
+
**Beta:** future option positions (`instrument.kind: future_option`) are in beta. They are currently returned only for tastytrade and Interactive Brokers connections, and only for partners they have been enabled for — please contact the SnapTrade team to enable them. The `FutureOptionInstrument` schema may change.
|
|
449
451
|
|
|
450
452
|
Positions counted in account cash balance or buying power include `cash_equivalent: true`. `stock`, `adr`, `etf`, `mutualfund`, and `crypto` positions may include `tax_lots` when tax lot data is enabled for the account. To see which institutions support tax lot data, please see our [supported institutions doc](https://support.snaptrade.com/brokerages).
|
|
451
453
|
|
|
@@ -1576,6 +1578,67 @@ The client identifies the user in this mode. Do not pass `userId` `userSecret` t
|
|
|
1576
1578
|
---
|
|
1577
1579
|
|
|
1578
1580
|
|
|
1581
|
+
### `snaptrade.connections.listConnectionAccounts`<a id="snaptradeconnectionslistconnectionaccounts"></a>
|
|
1582
|
+
|
|
1583
|
+
Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape.
|
|
1584
|
+
|
|
1585
|
+
Each item in the response carries a `kind` field (`investment`, `deposit`, and `line_of_credit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema.
|
|
1586
|
+
|
|
1587
|
+
On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total net value (`net_value`) live from the institution on each call, along with funding date for `investment` accounts.
|
|
1588
|
+
|
|
1589
|
+
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 institution. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
1590
|
+
|
|
1591
|
+
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.
|
|
1592
|
+
|
|
1593
|
+
|
|
1594
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
1595
|
+
|
|
1596
|
+
##### Commercial API Key Auth<a id="commercial-api-key-auth"></a>
|
|
1597
|
+
|
|
1598
|
+
```typescript
|
|
1599
|
+
const listConnectionAccountsResponse =
|
|
1600
|
+
await commercialApiKeyClient.connections.listConnectionAccounts({
|
|
1601
|
+
connectionId: "87b24961-b51e-4db8-9226-f198f6518a89",
|
|
1602
|
+
userId: "snaptrade-user-123",
|
|
1603
|
+
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
1604
|
+
});
|
|
1605
|
+
```
|
|
1606
|
+
|
|
1607
|
+
Required credentials for this mode:
|
|
1608
|
+
|
|
1609
|
+
- `userId` (string, required): SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
|
|
1610
|
+
|
|
1611
|
+
- `userSecret` (string, required): SnapTrade User Secret. This is a randomly generated string and should be stored securely. If compromised, please rotate it via the [rotate user secret endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret).
|
|
1612
|
+
|
|
1613
|
+
##### Personal API Key Auth<a id="personal-api-key-auth"></a>
|
|
1614
|
+
|
|
1615
|
+
```typescript
|
|
1616
|
+
const listConnectionAccountsResponse =
|
|
1617
|
+
await personalApiKeyClient.connections.listConnectionAccounts({
|
|
1618
|
+
connectionId: "87b24961-b51e-4db8-9226-f198f6518a89",
|
|
1619
|
+
});
|
|
1620
|
+
```
|
|
1621
|
+
|
|
1622
|
+
The client identifies the user in this mode. Do not pass `userId` `userSecret` to this method.
|
|
1623
|
+
|
|
1624
|
+
|
|
1625
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
1626
|
+
|
|
1627
|
+
##### connectionId: `string`<a id="connectionid-string"></a>
|
|
1628
|
+
|
|
1629
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
1630
|
+
|
|
1631
|
+
[ConnectionAccount](./models/connection-account.ts)
|
|
1632
|
+
|
|
1633
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
1634
|
+
|
|
1635
|
+
`/connections/{connectionId}/accounts` `GET`
|
|
1636
|
+
|
|
1637
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
1638
|
+
|
|
1639
|
+
---
|
|
1640
|
+
|
|
1641
|
+
|
|
1579
1642
|
### `snaptrade.connections.refreshBrokerageAuthorization`<a id="snaptradeconnectionsrefreshbrokerageauthorization"></a>
|
|
1580
1643
|
|
|
1581
1644
|
Trigger a holdings update for all accounts under this connection. Updates will be queued asynchronously. [`ACCOUNT_HOLDINGS_UPDATED` webhook](/docs/webhooks#webhooks-account_holdings_updated) will be sent once the sync completes for each account under the connection.
|
|
@@ -2058,69 +2121,6 @@ Defaults to true. Indicates if request should fetch only executed orders. Set to
|
|
|
2058
2121
|
---
|
|
2059
2122
|
|
|
2060
2123
|
|
|
2061
|
-
### `snaptrade.experimentalEndpoints.listConnectionAccounts`<a id="snaptradeexperimentalendpointslistconnectionaccounts"></a>
|
|
2062
|
-
|
|
2063
|
-
Experimental and subject to change without notice.
|
|
2064
|
-
|
|
2065
|
-
Returns the accounts that belong to the specified connection for the authenticated user, using the `kind`-discriminated account shape.
|
|
2066
|
-
|
|
2067
|
-
Each item in the response carries a `kind` field (`investment`, `deposit`, and `line_of_credit` are implemented) that determines which additional fields are present -- see the `ConnectionAccount` schema.
|
|
2068
|
-
|
|
2069
|
-
On Pay as you Go / Real-time, this endpoint refreshes each account's opening date and total net value (`net_value`) live from the institution on each call, along with funding date for `investment` accounts.
|
|
2070
|
-
|
|
2071
|
-
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 institution. To force a refresh, use the [manual refresh endpoint](/reference/Connections/Connections_refreshBrokerageAuthorization).
|
|
2072
|
-
|
|
2073
|
-
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.
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
2077
|
-
|
|
2078
|
-
##### Commercial API Key Auth<a id="commercial-api-key-auth"></a>
|
|
2079
|
-
|
|
2080
|
-
```typescript
|
|
2081
|
-
const listConnectionAccountsResponse =
|
|
2082
|
-
await commercialApiKeyClient.experimentalEndpoints.listConnectionAccounts({
|
|
2083
|
-
connectionId: "87b24961-b51e-4db8-9226-f198f6518a89",
|
|
2084
|
-
userId: "snaptrade-user-123",
|
|
2085
|
-
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
2086
|
-
});
|
|
2087
|
-
```
|
|
2088
|
-
|
|
2089
|
-
Required credentials for this mode:
|
|
2090
|
-
|
|
2091
|
-
- `userId` (string, required): SnapTrade User ID. This is chosen by the API partner and can be any string that is a) unique to the user, and b) immutable for the user. It is recommended to NOT use email addresses for this property because they are usually not immutable.
|
|
2092
|
-
|
|
2093
|
-
- `userSecret` (string, required): SnapTrade User Secret. This is a randomly generated string and should be stored securely. If compromised, please rotate it via the [rotate user secret endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret).
|
|
2094
|
-
|
|
2095
|
-
##### Personal API Key Auth<a id="personal-api-key-auth"></a>
|
|
2096
|
-
|
|
2097
|
-
```typescript
|
|
2098
|
-
const listConnectionAccountsResponse =
|
|
2099
|
-
await personalApiKeyClient.experimentalEndpoints.listConnectionAccounts({
|
|
2100
|
-
connectionId: "87b24961-b51e-4db8-9226-f198f6518a89",
|
|
2101
|
-
});
|
|
2102
|
-
```
|
|
2103
|
-
|
|
2104
|
-
The client identifies the user in this mode. Do not pass `userId` `userSecret` to this method.
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
2108
|
-
|
|
2109
|
-
##### connectionId: `string`<a id="connectionid-string"></a>
|
|
2110
|
-
|
|
2111
|
-
#### 🔄 Return<a id="🔄-return"></a>
|
|
2112
|
-
|
|
2113
|
-
[ConnectionAccount](./models/connection-account.ts)
|
|
2114
|
-
|
|
2115
|
-
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
2116
|
-
|
|
2117
|
-
`/connections/{connectionId}/accounts` `GET`
|
|
2118
|
-
|
|
2119
|
-
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
2120
|
-
|
|
2121
|
-
---
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
2124
|
### `snaptrade.experimentalEndpoints.listSubscriptions`<a id="snaptradeexperimentalendpointslistsubscriptions"></a>
|
|
2125
2125
|
|
|
2126
2126
|
Returns active Trade Detection subscriptions for your Client ID. Cancelled subscriptions are not returned.
|