getTop10Tokens() is working flawlessly. However, it gives you this data structure: ['btc', 'eth', 'usdt', 'bnb', 'usdc', 'ada', 'sol', 'xrp', 'luna', 'dot']
.
The 1inch call in getTicker data gives you an array of values like this:
[{"symbol":"MATIC","name":"MATIC","decimals":18,"address":"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee","logoURI":"https://tokens.1inch.io/0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0.png"},{"symbol":"AAVE","name":"Aave","decimals":18,"address":"0xd6df932a45c0f255f85145f286ea0b292b21c90b","logoURI":"https://tokens.1inch.io/0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9.png"}]
In the return value of getTickerData, you are comparing strings to objects, which will never succeed, so you are destined to get an empty array as a result. Also note, if you used the symbol key of the latter object, it’d be in upper case, while coingecko gave you lower case results. Hint: google toUpperCase()