@master-chief/alpaca
Advanced tools
Comparing version 2.8.2 to 2.9.2
export { AlpacaClient } from './src/client.js' | ||
export { AlpacaStream } from './src/stream.js' | ||
import { AlpacaClient } from './src/client.js' | ||
import { AlpacaStream } from './src/stream.js' | ||
export default { | ||
AlpacaClient: AlpacaClient, | ||
AlpacaStream: AlpacaStream, | ||
} | ||
export { | ||
@@ -5,0 +13,0 @@ Account, |
{ | ||
"name": "@master-chief/alpaca", | ||
"version": "2.8.2", | ||
"version": "2.9.2", | ||
"description": "a TypeScript Node.js library for the https://alpaca.markets REST API and WebSocket streams", | ||
@@ -43,2 +43,5 @@ "author": "master-chief", | ||
"testEnvironment": "node", | ||
"roots": [ | ||
"<rootDir>/tests" | ||
], | ||
"testMatch": [ | ||
@@ -45,0 +48,0 @@ "**/*.test.ts" |
@@ -38,2 +38,19 @@ # alpaca | ||
## Import | ||
Import with CommonJS: | ||
```javascript | ||
let alpaca = require('@master-chief/alpaca') | ||
``` | ||
Import with ESM: | ||
```typescript | ||
import alpaca from '@master-chief/alpaca' | ||
``` | ||
Due to the way we build and compile this library, you can switch between | ||
CommonJS and/or ESM with ease. | ||
## Client | ||
@@ -47,5 +64,3 @@ | ||
```typescript | ||
import { AlpacaClient } from '@master-chief/alpaca' | ||
const client = new AlpacaClient({ | ||
const client = new alpaca.AlpacaClient({ | ||
credentials: { | ||
@@ -129,5 +144,3 @@ key: '***', | ||
```typescript | ||
await client.getOrder({ | ||
order_id: '6187635d-04e5-485b-8a94-7ce398b2b81c', | ||
}) | ||
await client.getOrder({ order_id: '6187635d-04e5-485b-8a94-7ce398b2b81c' }) | ||
``` | ||
@@ -138,6 +151,3 @@ | ||
```typescript | ||
await client.getOrders({ | ||
limit: 25, | ||
status: 'all', | ||
}) | ||
await client.getOrders({ limit: 25, status: 'all' }) | ||
``` | ||
@@ -169,5 +179,3 @@ | ||
```typescript | ||
await client.cancelOrder({ | ||
order_id: '69a3db8b-cc63-44da-a26a-e3cca9490308', | ||
}) | ||
await client.cancelOrder({ order_id: '69a3db8b-cc63-44da-a26a-e3cca9490308' }) | ||
``` | ||
@@ -269,5 +277,3 @@ | ||
```typescript | ||
await client.deleteWatchlist({ | ||
uuid: '2000e463-6f87-41c0-a8ba-3e40cbf67128', | ||
}) | ||
await client.deleteWatchlist({ uuid: '2000e463-6f87-41c0-a8ba-3e40cbf67128' }) | ||
``` | ||
@@ -305,5 +311,3 @@ | ||
```typescript | ||
await client.getAccountActivities({ | ||
activity_type: 'FILL', | ||
}) | ||
await client.getAccountActivities({ activity_type: 'FILL' }) | ||
``` | ||
@@ -314,6 +318,3 @@ | ||
```typescript | ||
await client.getPortfolioHistory({ | ||
period: '1D', | ||
timeframe: '1Min', | ||
}) | ||
await client.getPortfolioHistory({ period: '1D', timeframe: '1Min' }) | ||
``` | ||
@@ -324,6 +325,3 @@ | ||
```typescript | ||
await client.getBars({ | ||
symbols: ['SPY', 'DIA', 'XLF'], | ||
timeframe: '1Min', | ||
}) | ||
await client.getBars({ symbols: ['SPY', 'DIA', 'XLF'], timeframe: '1Min' }) | ||
``` | ||
@@ -334,5 +332,3 @@ | ||
```typescript | ||
await client.getLastTrade({ | ||
symbol: 'SPY', | ||
}) | ||
await client.getLastTrade({ symbol: 'SPY' }) | ||
``` | ||
@@ -343,5 +339,3 @@ | ||
```typescript | ||
await client.getLastQuote({ | ||
symbol: 'SPY', | ||
}) | ||
await client.getLastQuote({ symbol: 'SPY' }) | ||
``` | ||
@@ -357,5 +351,3 @@ | ||
```typescript | ||
import { AlpacaStream } from '@master-chief/alpaca' | ||
const stream = new AlpacaStream({ | ||
const stream = new alpaca.AlpacaStream({ | ||
credentials: { | ||
@@ -408,6 +400,6 @@ key: '***', | ||
Don't know where to start? Check out our community-made examples | ||
[here](https://github.com/117/alpaca/tree/master/examples). | ||
[here](https://github.com/117/alpaca/tree/main/examples). | ||
## Contributing | ||
Pull requests are encouraged 😍! | ||
Pull requests are encouraged. 🥳 |
export { AlpacaClient } from './src/client.js'; | ||
export { AlpacaStream } from './src/stream.js'; | ||
import { AlpacaClient } from './src/client.js'; | ||
import { AlpacaStream } from './src/stream.js'; | ||
declare const _default: { | ||
AlpacaClient: typeof AlpacaClient; | ||
AlpacaStream: typeof AlpacaStream; | ||
}; | ||
export default _default; | ||
export { Account, Order, Position, Asset, Watchlist, Calendar, Clock, AccountConfigurations, NonTradeActivity, TradeActivity, PortfolioHistory, Bar, LastQuote, LastTrade, } from './src/entities.js'; | ||
export { GetOrder, GetOrders, PlaceOrder, ReplaceOrder, CancelOrder, GetPosition, ClosePosition, GetAsset, GetAssets, GetWatchList, CreateWatchList, UpdateWatchList, AddToWatchList, RemoveFromWatchList, DeleteWatchList, GetCalendar, UpdateAccountConfigurations, GetAccountActivities, GetPortfolioHistory, GetBars, GetLastTrade, GetLastQuote, } from './src/params.js'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4962
168882
39
393