Started setting up basic exchange interface
This commit is contained in:
parent
cd7cc4cd5f
commit
76cfbc8090
9
src/exchange.ts
Normal file
9
src/exchange.ts
Normal 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
3
src/interface/account.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export interface Account {
|
||||
fetchPortfolio: () => Portfolio;
|
||||
}
|
17
src/interface/portfolio.ts
Normal file
17
src/interface/portfolio.ts
Normal 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
3
src/interface/quote.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export class Quote {
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user