Closed mandelmonkey closed 5 years ago
MetaMask adds a wrapper around this library, and one of the things in that wrapper is an implementation of the synchronous send
method.
Well-written dapps will not use this method (not least, because they'll fail unit tests using Ganache), but unfortunately not all dapps are well-written. If you want a "MetaMask-compatible" provider, you'll need to provide a send
method - the version in MetaMask is a good starting point.
ok thanks for the reply, I guess it also needs a wrapper for a sync getaccounts method?
Yes and no: send
is the name of a Javascript method, that's used to make JSONRPC calls synchronously. MetaMask's send
methods includes implementations of eth_accounts
, eth_coinbase
, eth_uninstallFilter
and net_version
(I think because these are ones it's difficult to prevent Web3 calling synchronously). Your send
implementation will likely need to implement the same methods for MetaMask compatibility.
hi @mandelmonkey, i really enjoyed playing with Takara and left a little something in mikura-jima
@jamespic's feedback is correct
Apologies this is not really an issue but I developed a dapp browser using this repo however when loading some notable dapps (that work with the metamask chrome extension) in my dapp browser I get the error
Web3ProviderEngine does not support synchronous requests
I see the dapp is calling synchronous methods and seems like they should be calling async however the dapps works in the metamask chrome extension.
So my question is, is this in issue with the dapp? i.e. they should upgrade to asynchronous request or is it good practice to support both in a dapp browser? Why does metamask chrome extension work with sync but not this repo?
thanks!