Notes on Web3 Providers Engines and Implementing a Web3 Wallet

Hi, I'm Hwee-Boon Yar

I write, ship and sell software products. iOS/OS X app developer based in Singapore, working remotely. This is my blog.


Need to run a code review on your codebase? Hire me

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().

Like this post? Follow me @hboon on Twitter.