Odak modu

Build on Chiliz

Implementing Frontend IV - Getting Token Metadata

In the videos we are showing the conventional way yet in case you face problems with EvmApi, it is due to incompleteness of CHZ integration in Moralis.

You can check this link for metadata.

For fetching token_metadatas you can use the following code instead:

const baseUrl = `https://deep-index.moralis.io/api/v2.2/erc20/metadata?chain=${current_chain}`;

let fullUrl = baseUrl;
token_address_list.forEach((address, index) => {
 const addressParam = `&addresses%5B${index}%5D=${address}`;
 fullUrl += addressParam;
});

const response = await fetch(fullUrl, {
 method: 'GET',
 headers: {
  Accept: 'application/json',
  'X-API-Key': apiKey,
 },
});
const data = await response.json();
setTokens(data);
left-disk

Yazılım Kariyerinde İlerlemeni Hızlandıracak Programlar

Patika+ programlarımız ile 4-8 aylık yoğun yazılım kamplarına katıl, temel bilgilerden başlayarak kapsamlı bilgiler edin, yazılım kariyerine başla!

right-cube

Yorumlar

Yorum yapabilmek için derse kayıt olmalısın!