简体   繁体   中英

Get registered assets in web3 metamask

In web3 we call web3.eth.getAccounts() or window.ethereum.request({ method: "eth_requestAccounts" }) to list the accounts in metamask, is there any specific method we could call to get the registered tokens/assets in metamask?

在此处输入图像描述

There is no method to get registered assets in MetaMask.

Your best bet is to have a token list for which you check balances from a blockchain after the user has connected the account.

You can get address info after get the address please see the endpoint in https://github.com/EverexIO/Ethplorer/wiki/Ethplorer-API#get-address-info

you can get ETH and other tokens info from this endpoint

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM