web3-provider doesn't work with custom rpc
See original GitHub issue"@walletconnect/web3-provider": "^1.4.1"
Following the docs here I attempted the following:
import WalletConnectProvider from "@walletconnect/web3-provider";
...
const provider = new WalletConnectProvider({
rpc: {
56: "https://bsc-dataseed.binance.org",
},
});
await provider.enable();
The QR modal pops up and I scan using TrustWallet and I get errors:
Unhandled Promise rejection: Callback was already called. ; Zone: <root> ; Task: Promise.then ; Value: Error: Callback was already called.
at onlyOnce.js:9
at createAsyncMiddleware.js:54
at ZoneDelegate.invoke (zone-evergreen.js:372)
at Zone.run (zone-evergreen.js:134)
at zone-evergreen.js:1276
at ZoneDelegate.invokeTask (zone-evergreen.js:406)
at Zone.runTask (zone-evergreen.js:178)
at drainMicroTaskQueue (zone-evergreen.js:582) Error: Callback was already called.
at http://localhost:4200/vendor.js:165943:32
at http://localhost:4200/vendor.js:97:11
at ZoneDelegate.invoke (http://localhost:4200/polyfills.js:1146:26)
at Zone.run (http://localhost:4200/polyfills.js:908:43)
at http://localhost:4200/polyfills.js:2050:36
at ZoneDelegate.invokeTask (http://localhost:4200/polyfills.js:1180:31)
at Zone.runTask (http://localhost:4200/polyfills.js:952:47)
at drainMicroTaskQueue (http://localhost:4200/polyfills.js:1356:35)
and clear querying against infura mainnet even though a node url was provided:
What am I doing wrong?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:27
Top Results From Across the Web
WalletConnectProvider not working with custom RPC
I want to connect custom RPC with WalletConnectProvider. But I keep getting an error of Uncaught Error: PollingBlockTracker - encountered ...
Read more >how to use custom web3 provider for Dapp?
I used to use metamask for Dapp development..Everything works fine, but trust wallet(Dapp mobile browser) ...
Read more >Web3 Provider
First, instantiate your WalletConnect web3-provider using the following options: Infura or Custom RPC mapping. Infura; Custom RPC.
Read more >How to connect to Ethereum network with ethers.js
1. When someone thinks of developing a dApp the first tool that comes to their mind is web3.js which is ... 2. First,...
Read more >walletconnect-web3-provider-patched v1.0.0-beta.47
It's required to pass either the infuraId or rpc option values to make this connection remotely. If you would like to use your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi all, I think I still have an issue with it. I follow the setting and found out trust wallet is not correctly connected. does anybody come across the same issue as I do? My code is below:
I was running into the same issue and for me the following seemed to have fixed it. In my case it was for polygon mumbai testnet:
From what I seem to notice is that after ‘enable’ the chainId goes back to 1 regardless of the provided chainId and it starts polling infura. The updateRpcUrl (after enable) switches it back to the actual requested chain and it’ll stop the infura spam.
Sometimes you still get 1 or 2 polls to Infura though.