Skip to content

Commit

Permalink
Added position names for kovan tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbenmoha committed Dec 1, 2021
1 parent 5dc6297 commit 650523e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String>(array.map(obj => [obj.address.toLowerCase(), obj.name + '^' + obj.logoURI]));
let mapEntryPosition = result.get(address.toLowerCase());
Expand All @@ -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"));
Expand Down

0 comments on commit 650523e

Please sign in to comment.