Skip to content

Commit

Permalink
Merge pull request #211 from DefiLlama/fix/ibc
Browse files Browse the repository at this point in the history
handle long cosmos addresses
  • Loading branch information
vrtnd authored May 31, 2024
2 parents b169abe + f9340fe commit 3918c64
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/helpers/mapofzones/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 3918c64

Please sign in to comment.