简体   繁体   English

获取 web3 元掩码中的注册资产

[英]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?在 web3 中,我们调用web3.eth.getAccounts()window.ethereum.request({ method: "eth_requestAccounts" })来列出 metamask 中的帐户,我们可以调用任何特定方法来获取 metamask 中的注册令牌/资产?

在此处输入图像描述

There is no method to get registered assets in MetaMask. 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获取地址后即可获取地址信息,请查看https://github.com/EverexIO/Ethplorer/wiki/Ethplorer-API#get-address-info中的端点

you can get ETH and other tokens info from this endpoint您可以从此端点获取 ETH 和其他令牌信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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