diff --git a/background/lib/prices.ts b/background/lib/prices.ts index 468c8ce135..42271da274 100644 --- a/background/lib/prices.ts +++ b/background/lib/prices.ts @@ -29,7 +29,11 @@ export async function getPrice( return null } - return json ? parseFloat(json[coingeckoCoinId][currencySymbol]) : null + return json + ? parseFloat( + json[coingeckoCoinId][currencySymbol] as string // FIXME Drop as when strict mode arrives and price schema type can include this. + ) + : null } function multiplyByFloat(n: bigint, f: number, precision: number) { @@ -78,7 +82,7 @@ export async function getPrices( amounts: [ multiplyByFloat( BigInt(10) ** BigInt(c.decimals), - parseFloat(simpleCoinPrices[symbol]), + parseFloat(simpleCoinPrices[symbol] as string), // FIXME Drop as when strict mode arrives and price schema type can include this. 8 ), BigInt(1), diff --git a/background/lib/validation.ts b/background/lib/validation.ts index 46e608d40f..3081085fa4 100644 --- a/background/lib/validation.ts +++ b/background/lib/validation.ts @@ -24,7 +24,7 @@ const coingeckoPriceSchema = { }, additionalProperties: true, }, -} +} as const type CoinGeckoPriceDataJtd = JTDDataType