From cffe7a6eb90f7c0e3e1715e6d33157217db9e3c2 Mon Sep 17 00:00:00 2001 From: Gadi Cohen Date: Sat, 26 Feb 2022 12:04:52 +0200 Subject: [PATCH] fix(quote/cryptocurrency): more optionals; ZRC-USD test (fixes #403) The follow fields are now optional in response: * coinImageUrl * volume24Hr * volumeAllCurrencies * startDate --- schema.json | 6 +----- src/modules/quote.spec.ts | 1 + src/modules/quote.ts | 8 ++++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/schema.json b/schema.json index 3f21361b..f6c2345b 100644 --- a/schema.json +++ b/schema.json @@ -1865,7 +1865,6 @@ }, "required": [ "circulatingSupply", - "coinImageUrl", "customPriceAlertConfidence", "esgPopulated", "exchange", @@ -1883,13 +1882,10 @@ "quoteType", "region", "sourceInterval", - "startDate", "symbol", "toCurrency", "tradeable", - "triggerable", - "volume24Hr", - "volumeAllCurrencies" + "triggerable" ], "additionalProperties": false }, diff --git a/src/modules/quote.spec.ts b/src/modules/quote.spec.ts index 58ed3d0b..08104651 100644 --- a/src/modules/quote.spec.ts +++ b/src/modules/quote.spec.ts @@ -7,6 +7,7 @@ const testSymbols = [ "AZT.OL", // Far less properties than other symbols (#42) "AAPL220121C00025000", // Option "LDO.MI", // additionalProperty: underlyingSymbol (#363) + "ZRC-USD", // Low cap crypto (#403) ]; const marketStates = [ diff --git a/src/modules/quote.ts b/src/modules/quote.ts index a45ee6b7..53fbdf6c 100644 --- a/src/modules/quote.ts +++ b/src/modules/quote.ts @@ -125,10 +125,10 @@ export interface QuoteCryptoCurrency extends QuoteBase { fromCurrency: string; // 'BTC' toCurrency: string; // 'USD=X' lastMarket: string; // 'CoinMarketCap' - coinImageUrl: string; // 'https://s.yimg.com/uc/fin/img/reports-thumbnails/1.png' - volume24Hr: number; // 62631043072 - volumeAllCurrencies: number; // 62631043072 - startDate: Date; // new Date(1367103600 * 1000) + coinImageUrl?: string; // 'https://s.yimg.com/uc/fin/img/reports-thumbnails/1.png' + volume24Hr?: number; // 62631043072 + volumeAllCurrencies?: number; // 62631043072 + startDate?: Date; // new Date(1367103600 * 1000) } export interface QuoteCurrency extends QuoteBase {