【发布时间】:2021-09-23 09:33:42
【问题描述】:
现在我使用以下代码: https://github.com/Web3Modal/web3modal-vanilla-js-example
但它只连接来自信任钱包的 eth 地址
我尝试将提供程序选项更改为:
const providerOptions = {
walletconnect: {
package: WalletConnectProvider,
options: {
rpc: {
56: "https://bsc-dataseed.binance.org/"}
}
},
但是没用
在我的信任钱包中,我有 btc 地址、eth 地址、bnb 地址,我想知道所有这些地址和余额。但是现在我只能获取eth地址
我尝试过这样做:
const chainId = 56//await web3.eth.getChainId();
// Get list of accounts of the connected wallet
const accounts = await web3.eth.getAccounts();
但这只给了我 eth 帐户。 那我该怎么办?
【问题讨论】:
标签: ethereum web3 web3js binance-smart-chain wallet-connect