使用钱包与Web3modal连接时无法连接TrustWallet
我正在使用Web3 -Modal进行钱包连接。我曾尝试将钱包连接作为提供商选项,它正在使用MetAmask Android App和Wirex Wallet,但以某种方式信任钱包无法正常工作。当我使用信任钱包Android应用程序扫描QR码时,它说连接它可能需要几秒钟
,然后什么也没有发生。
这是我的实施:
import WalletConnectProvider from '@walletconnect/web3-provider';
import Web3Modal from 'web3modal';
const options = new WalletConnectProvider({
rpc: {
137: 'https://matic-mainnet.chainstacklabs.com',
},
infuraId: INFURA_ID,
});
const providerOptions = {
walletconnect: {
package: WalletConnectProvider, // required
options: options,
},
};
const web3Modal = new Web3Modal({
network: 'mainnet',
cacheProvider: true,
providerOptions,
});
}
const provider = await web3Modal.connect();
I am using web3modal for wallet connection. I have tried implementing wallet connect as a provider option, it is working with metamask android app and wirex wallet, but somehow trust wallet is not working. When I scan QR code using trust wallet android app it says connecting it may take a few seconds
and then nothing happens.
Here is my implementation:
import WalletConnectProvider from '@walletconnect/web3-provider';
import Web3Modal from 'web3modal';
const options = new WalletConnectProvider({
rpc: {
137: 'https://matic-mainnet.chainstacklabs.com',
},
infuraId: INFURA_ID,
});
const providerOptions = {
walletconnect: {
package: WalletConnectProvider, // required
options: options,
},
};
const web3Modal = new Web3Modal({
network: 'mainnet',
cacheProvider: true,
providerOptions,
});
}
const provider = await web3Modal.connect();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
就我而言,Trustwallet不起作用的原因是我的Dapp没有元标题。一旦我补充说:
我能够连接信任钱包。
In my case the reason trustwallet wasn't working was becuase my dapp didn't have a meta title. As soon as I added:
I was able to connect trust wallet.
您可以尝试使用开源Angular库有助于用户与Web3应用程序之间的连接,从而使他们更容易无缝进行交易。该库增强了用户体验,并简化了与Web3应用程序进行交互的过程。
https://web3-connect.b-ee.io.io/
You can try use open-source Angular library facilitates the connection between users and web3 applications, making it easier for them to engage in transactions seamlessly. This library enhances the user experience and simplifies the process of interacting with web3 applications.
https://web3-connect.b-ee.io/
对我来说,钱包的连接是信任钱包移动应用程序中的损失。
for me the wallet connection is loss in trust wallet mobile app.It is working on desktop browser extension.In meta mask it is okey in both extension and mobile app.I am using web3 modal for connection.