openzeppelin-network.js icon indicating copy to clipboard operation
openzeppelin-network.js copied to clipboard

Add a context factory with GSN fallback for onboarding

Open spalladino opened this issue 6 years ago • 0 comments

Add a factory and corresponding hook that creates a reasonable provider according to the following:

  • If there is no injected provider (ie metamask), create a new key pair (or load one from local storage if found), and set up a GSN provider with it backed by a fallback provider (such as infura).
  • If there is an injected provider, but without funds on the current network, create a new GSN provider that relies on the injected provider for signing (ie do not set a specific key, and let the RelayClient use eth_sign)
  • If there is an injected provider with funds, use it.

spalladino avatar Jul 25 '19 18:07 spalladino