Added documentation for Alpaca

This commit is contained in:
2023-10-20 17:28:06 -04:00
parent 7ceb69e9d5
commit ad27d7280b
3 changed files with 47 additions and 0 deletions

View File

@@ -5,7 +5,13 @@ import { Exchange } from '../interface/exchange'
import { PortfolioProvider } from '../interface/portfolio'
import { QuoteProvider } from '../interface/quote'
/**
* Exchange implementation for Alpaca.
*/
export class AlpacaExchange implements Exchange {
/**
* The Alpaca API client.
*/
readonly alpaca: Alpaca;
/**
@@ -23,6 +29,13 @@ export class AlpacaExchange implements Exchange {
*/
readonly name: string;
/**
* Creates an instance of the Alpaca exchange.
* @constructor
* @param {string} keyId - The API key ID for the Alpaca exchange.
* @param {string} secretKey - The secret key for the Alpaca exchange.
* @param {boolean} paper - Whether to use the paper trading environment or not.
*/
constructor(keyId: string, secretKey: string, paper: boolean) {
this.alpaca = new Alpaca({
keyId: keyId,