From f9340fe353c8f4a4d78191cbbd1a8b9c6cd478c1 Mon Sep 17 00:00:00 2001 From: vrtnd Date: Fri, 31 May 2024 18:09:31 +0300 Subject: [PATCH] handle long cosmos addresses --- src/helpers/mapofzones/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/helpers/mapofzones/index.ts b/src/helpers/mapofzones/index.ts index 8941e253..16002a54 100644 --- a/src/helpers/mapofzones/index.ts +++ b/src/helpers/mapofzones/index.ts @@ -157,6 +157,13 @@ export const getIbcVolumeByZoneId = (chainId: string) => { from = tx.destination_address; to = tx.source_address; } + // handle long addresses + if (to?.length > 42) { + to = to.slice(0, 42) + '...'; + } + if (from?.length > 42) { + from = from.slice(0, 42) + '...'; + } const date = new Date(tx.timestamp.replace(' ', 'T') + 'Z'); const unixTimestamp = Math.floor(date.getTime());