[SOLVED] Why Does "Get All Polygon" ERC20 Tokens Not Include Matic Token?

When I call to https://deep-index.moralis.io/api/v2/{address}/erc20?chain=matic&format=decimal

I get a list of all the erc20 tokens on the polygon network for that user EXCEPT not matic…

Why is this not included?? That’s like the main one when you are on polygon network… :thinking:

Matic is the native currency that you get it separately, it is not an erc token.

1 Like

Ahhhh, I see now that I can get the matic token balance by calling the endpoint with “/balance” rather than “/erc20”.

Thanks @cryptokid :+1:

2 Likes

Okay so how I get a user’s Matic balance from their metamask using Moralis? sorry I can’t find it in documentation.

https://docs.moralis.io/moralis-server/web3-sdk/account#getnativebalance

1 Like

Thank you. So now I have another question. I have 0.9527 MATIC in my metamask but this function is returning balance: "952715967636363640".

Why is that? it doesn’t return values less than 1 with 0. in front of it? how can i fix this?

https://docs.moralis.io/moralis-server/tools/moralis-units

1 Like