How to set timeout
on Web3Provider?
#2349
-
Hi @ricmoo! How does one set the const provider = new ethers.providers.Web3Provider(window.ethereum, 'any')
provider.connection.timeout = 1000 Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You cannot set a timeout on a Web3Provider, because there is not necessarily an underlying network connection. For example, MetaMask is not something that can timeout, since it is an injected object. If you want a timeout, you will need to set it on any underlying EIP-1193 or Web3-based provider using its API. Does that make sense? |
Beta Was this translation helpful? Give feedback.
You cannot set a timeout on a Web3Provider, because there is not necessarily an underlying network connection. For example, MetaMask is not something that can timeout, since it is an injected object.
If you want a timeout, you will need to set it on any underlying EIP-1193 or Web3-based provider using its API.
Does that make sense?