Notes on Web3 Providers Engines and Implementing a Web3 Wallet
This is about Web3 providers in Ethereum wallets.
Web3 Provider
Web3ProviderEngine
has send()
and sendAsync
.
send()
throws an errorsendAsync()
walks through providers by callinghandleRequest()
on the first provider
Providers implement handleRequest()
and processes the request if it supports it, otherwise pass it onto the next provider in the list (via one of the function args)
Web3 Wallets
An instance of Web3ProviderEngine
Implements send()
to handle a few calls like net_version
. Delegates the rest to sendAsync()
.