Skip to content

Commit

Permalink
fix(quoteSummary): add cryptocurrency types
Browse files Browse the repository at this point in the history
  • Loading branch information
gadicc committed Feb 26, 2021
1 parent 53044d3 commit 0523d6d
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 13 deletions.
66 changes: 58 additions & 8 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
"country": {
"type": "string"
},
"description": {
"type": "string"
},
"fax": {
"type": "string"
},
Expand All @@ -76,6 +79,9 @@
"maxAge": {
"yahooFinanceType": "number"
},
"name": {
"type": "string"
},
"overallRisk": {
"yahooFinanceType": "number"
},
Expand All @@ -88,6 +94,9 @@
"shareHolderRightsRisk": {
"yahooFinanceType": "number"
},
"startDate": {
"yahooFinanceType": "date"
},
"state": {
"type": "string"
},
Expand All @@ -100,7 +109,6 @@
},
"required": [
"maxAge",
"longBusinessSummary",
"companyOfficers"
],
"type": "object"
Expand Down Expand Up @@ -2320,6 +2328,9 @@
"averageDailyVolume3Month": {
"yahooFinanceType": "number"
},
"circulatingSupply": {
"yahooFinanceType": "number"
},
"currency": {
"type": "string"
},
Expand All @@ -2342,7 +2353,10 @@
]
},
"lastMarket": {
"type": "null"
"type": [
"null",
"string"
]
},
"longName": {
"type": [
Expand Down Expand Up @@ -2442,6 +2456,12 @@
},
"underlyingSymbol": {
"type": "null"
},
"volume24Hr": {
"yahooFinanceType": "number"
},
"volumeAllCurrencies": {
"yahooFinanceType": "number"
}
},
"required": [
Expand Down Expand Up @@ -5040,6 +5060,9 @@
"bidSize": {
"yahooFinanceType": "number"
},
"circulatingSupply": {
"yahooFinanceType": "number"
},
"currency": {
"type": "string"
},
Expand Down Expand Up @@ -5074,10 +5097,16 @@
"yahooFinanceType": "number"
},
"fromCurrency": {
"type": "null"
"type": [
"string",
"null"
]
},
"lastMarket": {
"type": "null"
"type": [
"string",
"null"
]
},
"marketCap": {
"yahooFinanceType": "number"
Expand Down Expand Up @@ -5118,8 +5147,14 @@
"regularMarketVolume": {
"yahooFinanceType": "number"
},
"startDate": {
"yahooFinanceType": "date"
},
"toCurrency": {
"type": "null"
"type": [
"string",
"null"
]
},
"totalAssets": {
"yahooFinanceType": "number"
Expand All @@ -5142,6 +5177,12 @@
"volume": {
"yahooFinanceType": "number"
},
"volume24Hr": {
"yahooFinanceType": "number"
},
"volumeAllCurrencies": {
"yahooFinanceType": "number"
},
"yield": {
"yahooFinanceType": "number"
},
Expand All @@ -5155,11 +5196,11 @@
"previousClose",
"regularMarketPreviousClose",
"currency",
"algorithm",
"tradeable",
"fromCurrency",
"toCurrency",
"lastMarket",
"algorithm",
"tradeable"
"lastMarket"
],
"type": "object"
},
Expand All @@ -5185,6 +5226,9 @@
"country": {
"type": "string"
},
"description": {
"type": "string"
},
"fax": {
"type": "string"
},
Expand All @@ -5200,12 +5244,18 @@
"maxAge": {
"yahooFinanceType": "number"
},
"name": {
"type": "string"
},
"phone": {
"type": "string"
},
"sector": {
"type": "string"
},
"startDate": {
"yahooFinanceType": "date"
},
"state": {
"type": "string"
},
Expand Down
30 changes: 25 additions & 5 deletions src/modules/quoteSummary-iface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export interface AssetProfile {
website?: string;
industry?: string;
sector?: string;
longBusinessSummary: string;
longBusinessSummary?: string;
fullTimeEmployees?: number;
companyOfficers: CompanyOfficer[];
auditRisk?: number;
Expand All @@ -71,6 +71,9 @@ export interface AssetProfile {
overallRisk?: number;
governanceEpochDate?: Date;
compensationAsOfEpochDate?: Date;
name?: string; // 'Bitcoin';
startDate?: Date; // new Date('2013-04-28')
description?: string; // 'Bitcoin (BTC) is a cryptocurrency...'
}

export interface CompanyOfficer {
Expand Down Expand Up @@ -668,14 +671,18 @@ export interface Price {
shortName: string;
longName: null | string;

lastMarket: null;
lastMarket: null | string;
marketState: string;
marketCap?: number;

// Crypto only? Is Price actually Quote? TODO after
currency?: string;
currencySymbol?: string;
fromCurrency: string | null;
toCurrency: string | null;
volume24Hr?: number;
volumeAllCurrencies?: number;
circulatingSupply?: number;
}

export interface QuoteType {
Expand Down Expand Up @@ -767,15 +774,22 @@ export interface SummaryDetail {
trailingAnnualDividendRate?: number;
trailingAnnualDividendYield?: number;
currency: string;
fromCurrency: null;
toCurrency: null;
lastMarket: null;
algorithm: null;
tradeable: boolean;
yield?: number;
totalAssets?: number;
navPrice?: number;
ytdReturn?: number;

// crypto only (optional, or null in other types)
// TODO: how does Price / SummaryDetail compare? common base?
fromCurrency: string | null; // 'BTC'
toCurrency: string | null; // 'USD-X'
lastMarket: string | null; // 'CoinMarketCap'
volume24Hr?: number; // 62650314752
volumeAllCurrencies?: number; // 62650314752
circulatingSupply?: number; // 18638932
startDate?: Date; // new Date(1367107200 * 1000)
}

export interface SummaryProfile {
Expand All @@ -795,6 +809,12 @@ export interface SummaryProfile {
fullTimeEmployees?: number;
companyOfficers: any[];
maxAge: number;

// seems like for cryptocurency only
// TODO: how does this relate to Quote type. Common base?
name?: string; // 'Bitcoin'
startDate?: Date; // new Date('2013-04-28')
description?: string; // 'Bitcoin (BTC) is a cryptocurrency...'
}

export interface TopHoldings {
Expand Down

0 comments on commit 0523d6d

Please sign in to comment.