-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstocks-provider.js
34 lines (32 loc) · 975 Bytes
/
stocks-provider.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class StocksProvider {
/*
Get a list of all aviable stocks
@allStocksCallback - Recevices an array of stocks. Each element must contain is in the form:
{
Symbol: Stock symbol (ticker),
Name: Free text
}
*/
getAllStocks(allStocksCallback) {
throw "Call 'getAllStocks' on abstract DB class";
}
/*
Get historic chart data for specific stocks.
@stocksSymbols - The stocks to fetch
@stocksDataCallback - Recieve a hash mapping each symbol to it's historic data. The historic data is an array sorted by ascending time. In the form:
{
<symbol> : {
quote: {
companyName: <name>
}
chart: [{
close: <closing stock value>
date: <date>
}]
}
}
*/
loadSelectedStocksData(stocksSymbols, stocksDataCallback) {
throw "Call 'loadSelectedStocksData' on abstract DB class";
}
}