Started setting up basic exchange interface

This commit is contained in:
Carter Bertolini 2023-10-03 17:41:19 -04:00
parent cd7cc4cd5f
commit 76cfbc8090
4 changed files with 32 additions and 0 deletions

9
src/exchange.ts Normal file
View File

@ -0,0 +1,9 @@
import { Account } from "./interface/account";
import {Quote} from "./interface/quote"
interface Exchange {
name: string;
fetchAccounts: () => Account[];
fetchQuote: (symbol: string) => Quote;
}

3
src/interface/account.ts Normal file
View File

@ -0,0 +1,3 @@
export interface Account {
fetchPortfolio: () => Portfolio;
}

View File

@ -0,0 +1,17 @@
export interface Position {
readonly symbol: string;
readonly quantity: number;
readonly dateAcquired: Date;
readonly pricePaid: number;
readonly price: number;
readonly change: number;
readonly changePct: number;
}
export interface Portfolio {
readonly positions: Position[];
}

3
src/interface/quote.ts Normal file
View File

@ -0,0 +1,3 @@
export class Quote {
}