From 88b4a105806cd286079a67ab30a0f4434cd97d0c Mon Sep 17 00:00:00 2001 From: Josep lluis Yuste Castell Date: Mon, 28 Oct 2024 16:57:01 +0100 Subject: [PATCH] fix: adding chains to unizen adapter --- aggregators/unizen/index.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/aggregators/unizen/index.ts b/aggregators/unizen/index.ts index 12c5d7887f..b2510cd926 100644 --- a/aggregators/unizen/index.ts +++ b/aggregators/unizen/index.ts @@ -15,6 +15,11 @@ const CHAINS: TChain = { [CHAIN.ARBITRUM]: 42161, [CHAIN.OPTIMISM]: 10, [CHAIN.BASE]: 8453, + [CHAIN.BITCOIN]: 0, + [CHAIN.BITCOIN_CASH]: 0, + [CHAIN.LITECOIN]: 0, + [CHAIN.DOGECHAIN]: 0, + [CHAIN.COSMOS]: 0, }; interface VolumeReport { @@ -34,8 +39,14 @@ function isVolumeReport(data: any): data is VolumeReport { const fetch = (chain: string) => async (_: number): Promise => { - const chainCode = CHAINS[chain]; const unixTimestamp = getUniqStartOfTodayTimestamp(); + const chainCode = CHAINS[chain]; + if (!chainCode) { + return { + dailyVolume: 0, + timestamp: unixTimestamp, + }; + } const url = `https://api.zcx.com/private/integrators/report/volumeAndCount/24h`; const data = (await httpGet(url, { headers: { 'User-Agent': 'Mozilla/5.0+(compatible; unizen; exchange)',