Handle missing price (show 0)

This commit is contained in:
nymkappa
2023-03-04 10:51:13 +09:00
parent b6532d8cf4
commit adf9c12eb5
8 changed files with 141 additions and 80 deletions

View File

@@ -8,9 +8,6 @@ class BitfinexApi implements PriceFeed {
public url: string = 'https://api.bitfinex.com/v1/pubticker/BTC';
public urlHist: string = 'https://api-pub.bitfinex.com/v2/candles/trade:{GRANULARITY}:tBTC{CURRENCY}/hist';
constructor() {
}
public async $fetchPrice(currency): Promise<number> {
const response = await query(this.url + currency);
if (response && response['last_price']) {