anyone in here know of a way to get balance of an asset like DAI in Metamask from a React?

Apr 23, 2021, 2:53 PM
A beginners still you can use web3 then get into the abi from etherscan then call the get balance of function of the solidity contract
Then render it accordingly in react
Apr 23, 2021, 2:55 PM
thanks Arya. That's what I am trying to do but was hoping for something more easier and direct from Metamask.
I'm getting 'undefined' when asking for balance
I think I got the right ABI from the DAI contract address in Kovan
Apr 23, 2021, 3:03 PM
Log out the web3 provider by meta mask
To check if that is not undefined
Else I don't think you should have any problem getting the balance
And if you're in node environment get that infura token
Anyways I am still learning probably some experienced guy will help you soon
It pain in the ass seeing old stackoverflow solutions have web3 from metamask while the some update when i was working with it 2 month back I got to know that know metamask doesn't provide you web3 instance directly 😞 now
Apr 23, 2021, 3:08 PM
any help is appreciated. thanks.
Apr 23, 2021, 3:32 PM

© 2024 Draquery.com All rights reserved.