From 650523e47a29559fbb89116dc49f24a16f069437 Mon Sep 17 00:00:00 2001 From: stevenbenmoha Date: Wed, 1 Dec 2021 14:19:41 -0500 Subject: [PATCH] Added position names for kovan tokens --- src/App.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index 00ca24b..d21e6e6 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -216,9 +216,9 @@ class App extends Component { const fullPositionList: any[] = []; - // For each address, fetch the name and logo from a hashmap created from json file of coingecko tokens for (const address of positions) { if (this.networkSelection === MAINNET) { + // For each address, fetch the name and logo from a hashmap created from json file of coingecko tokens const array = tokenList.tokens; const result = new Map(array.map(obj => [obj.address.toLowerCase(), obj.name + '^' + obj.logoURI])); let mapEntryPosition = result.get(address.toLowerCase()); @@ -230,6 +230,7 @@ class App extends Component { fullPositionList.push(new Position(name, address.toLowerCase(), logoURI)); } } else { + // Kovan tokens not in json so fetch name with erc20 library, and add generic eth logo const name = await this.setObject.erc20.getTokenNameAsync(address, walletAddress); console.log('Name: ', name); fullPositionList.push(new Position(name, address.toLowerCase(), "https://assets.coingecko.com/coins/images/279/thumb/ethereum.png?1595348880"));