snaptrade-typescript-sdk 13.2.3 → 13.2.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 +67 -1
- package/dist/browser.umd.js +1 -1
- package/dist/index.cjs +120 -1
- package/dist/index.d.cts +89 -5
- package/dist/index.d.mts +89 -5
- package/dist/index.d.ts +89 -5
- package/dist/index.mjs +120 -1
- 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/13.2.4)
|
|
67
67
|
[](https://snaptrade.com/)
|
|
68
68
|
|
|
69
69
|
</div>
|
|
@@ -111,6 +111,7 @@ See https://docs.snaptrade.com/docs/ratelimiting.
|
|
|
111
111
|
* [`snaptrade.connections.syncBrokerageAuthorizationTransactions`](#snaptradeconnectionssyncbrokerageauthorizationtransactions)
|
|
112
112
|
* [`snaptrade.experimentalEndpoints.addSubscription`](#snaptradeexperimentalendpointsaddsubscription)
|
|
113
113
|
* [`snaptrade.experimentalEndpoints.cancelSubscription`](#snaptradeexperimentalendpointscancelsubscription)
|
|
114
|
+
* [`snaptrade.experimentalEndpoints.getAccountOrder`](#snaptradeexperimentalendpointsgetaccountorder)
|
|
114
115
|
* [`snaptrade.experimentalEndpoints.getAllAccountOrders`](#snaptradeexperimentalendpointsgetallaccountorders)
|
|
115
116
|
* [`snaptrade.experimentalEndpoints.getAllAccountRecentOrders`](#snaptradeexperimentalendpointsgetallaccountrecentorders)
|
|
116
117
|
* [`snaptrade.experimentalEndpoints.getUserAccountOrderDetailV2`](#snaptradeexperimentalendpointsgetuseraccountorderdetailv2)
|
|
@@ -2369,6 +2370,71 @@ Unique identifier for the connected brokerage account. This is the UUID used to
|
|
|
2369
2370
|
---
|
|
2370
2371
|
|
|
2371
2372
|
|
|
2373
|
+
### `snaptrade.experimentalEndpoints.getAccountOrder`<a id="snaptradeexperimentalendpointsgetaccountorder"></a>
|
|
2374
|
+
|
|
2375
|
+
Returns the detail of a single order, identified by the brokerage order ID in the path, in the same `kind`-discriminated format as `/accounts/{accountId}/orders/all`.
|
|
2376
|
+
|
|
2377
|
+
The order carries a `legs` list with at least one leg; switch on `legs[].instrument.kind` and `order_type.kind` to know which fields are present. Multi-leg orders are a single order with multiple legs.
|
|
2378
|
+
|
|
2379
|
+
This endpoint is always realtime and does not rely on cached data, except that an order in a terminal state (executed, canceled, rejected, failed, expired, replaced) may be served from a short-lived cache since it can no longer change.
|
|
2380
|
+
|
|
2381
|
+
This endpoint only returns orders placed through SnapTrade. In other words, orders placed outside of the SnapTrade network are not returned by this endpoint.
|
|
2382
|
+
|
|
2383
|
+
**Experimental:** this endpoint may change without notice.
|
|
2384
|
+
|
|
2385
|
+
|
|
2386
|
+
#### 🛠️ Usage<a id="🛠️-usage"></a>
|
|
2387
|
+
|
|
2388
|
+
##### Commercial API Key Auth<a id="commercial-api-key-auth"></a>
|
|
2389
|
+
|
|
2390
|
+
```typescript
|
|
2391
|
+
const getAccountOrderResponse =
|
|
2392
|
+
await commercialApiKeyClient.experimentalEndpoints.getAccountOrder({
|
|
2393
|
+
accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
2394
|
+
brokerageOrderId: "66a033fa-da74-4fcf-b527-feefdec9257e",
|
|
2395
|
+
userId: "snaptrade-user-123",
|
|
2396
|
+
userSecret: "adf2aa34-8219-40f7-a6b3-60156985cc61",
|
|
2397
|
+
});
|
|
2398
|
+
```
|
|
2399
|
+
|
|
2400
|
+
Required credentials for this mode:
|
|
2401
|
+
|
|
2402
|
+
- `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.
|
|
2403
|
+
|
|
2404
|
+
- `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).
|
|
2405
|
+
|
|
2406
|
+
##### Personal API Key Auth<a id="personal-api-key-auth"></a>
|
|
2407
|
+
|
|
2408
|
+
```typescript
|
|
2409
|
+
const getAccountOrderResponse =
|
|
2410
|
+
await personalApiKeyClient.experimentalEndpoints.getAccountOrder({
|
|
2411
|
+
accountId: "917c8734-8470-4a3e-a18f-57c3f2ee6631",
|
|
2412
|
+
brokerageOrderId: "66a033fa-da74-4fcf-b527-feefdec9257e",
|
|
2413
|
+
});
|
|
2414
|
+
```
|
|
2415
|
+
|
|
2416
|
+
The client identifies the user in this mode. Do not pass `userId` `userSecret` to this method.
|
|
2417
|
+
|
|
2418
|
+
|
|
2419
|
+
#### ⚙️ Parameters<a id="⚙️-parameters"></a>
|
|
2420
|
+
|
|
2421
|
+
##### accountId: `string`<a id="accountid-string"></a>
|
|
2422
|
+
|
|
2423
|
+
##### brokerageOrderId: `string`<a id="brokerageorderid-string"></a>
|
|
2424
|
+
|
|
2425
|
+
#### 🔄 Return<a id="🔄-return"></a>
|
|
2426
|
+
|
|
2427
|
+
[AccountOrder](./models/account-order.ts)
|
|
2428
|
+
|
|
2429
|
+
#### 🌐 Endpoint<a id="🌐-endpoint"></a>
|
|
2430
|
+
|
|
2431
|
+
`/accounts/{accountId}/orders/{brokerageOrderId}` `GET`
|
|
2432
|
+
|
|
2433
|
+
[🔙 **Back to Table of Contents**](#table-of-contents)
|
|
2434
|
+
|
|
2435
|
+
---
|
|
2436
|
+
|
|
2437
|
+
|
|
2372
2438
|
### `snaptrade.experimentalEndpoints.getAllAccountOrders`<a id="snaptradeexperimentalendpointsgetallaccountorders"></a>
|
|
2373
2439
|
|
|
2374
2440
|
Returns a list of recent orders in the specified account, in the same `kind`-discriminated format as `/accounts/{accountId}/positions/all`.
|