I use web3 library to interact with Ethereum Network and I want to get token info with his contract address such as tokenName
, tokenSymbol
, tokenDecimal
, tokenLogoURL
etc.
I can get almost any data except for the token logo URL.
Here is the code to get name, symbol, decimal:
export async function useGetTokenInfo(chainId: IChainId, tokenAddress: string) {
const web3: Web3 = new Web3(providers[chainId]);
const tokenInst = new web3.eth.Contract(tokenABI, tokenAddress);
const tokenDecimal = await tokenInst.methods.decimals().call();
const tokenName = await tokenInst.methods.name().call();
const tokenSymbol = await tokenInst.methods.symbol().call();
}
But I have no any idea to get token Logo as url. Is there any api to get any Ethereum token(For example ERC20, ERC 721 tokens) logo url?