Fix 'NaN' price for unconfirmed transaction since we have no block timestamp

This commit is contained in:
nymkappa committed 2023-02-22 20:42:32 +09:00
1 parent 55f34f9b19
commit 4ac37c18e4
1 file changed
+4
@@ -93,6 +93,10 @@ export class PriceService {
* @param blockTimestamp
*/
getPriceForTimestamp(blockTimestamp: number): Price | null {
if (!blockTimestamp) {
return undefined;
}
const priceTimestamps = Object.keys(this.historicalPrice.prices);
priceTimestamps.push(Number.MAX_SAFE_INTEGER.toString());
priceTimestamps.sort().reverse();