Notes on Web3 Providers Engines and Implementing a Web3 Wallet
Boon aka Hwee-Boon Yar
January 20, 2021
This is about Web3 providers in Ethereum wallets.
WEB3 PROVIDER
Web3ProviderEngine has send() and sendAsync.
- send() throws an error
- sendAsync() walks through providers by calling handleRequest() 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().
Discussion in the ATmosphere