From 4b0a2a284af6c45b7e4d6407aec7cf587eca88c0 Mon Sep 17 00:00:00 2001 From: Carter Bertolini Date: Tue, 17 Oct 2023 17:09:29 -0400 Subject: [PATCH] Add Alpaca Exchange impl --- src/alpaca/exchange.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/alpaca/exchange.ts diff --git a/src/alpaca/exchange.ts b/src/alpaca/exchange.ts new file mode 100644 index 0000000..56748c5 --- /dev/null +++ b/src/alpaca/exchange.ts @@ -0,0 +1,18 @@ +import Alpaca from '@alpacahq/alpaca-trade-api' +import { Exchange } from '../interface/exchange' + +export class AlpacaExchange implements Exchange { + readonly alpaca: Alpaca; + + readonly name: string; + + constructor(keyId: string, secretKey: string, paper: boolean) { + this.alpaca = new Alpaca({ + keyId: keyId, + secretKey: secretKey, + paper: paper + }); + + this.name = 'Alpaca'; + } +} \ No newline at end of file