Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Feature/dapp initiate web3 connection #57

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

jklepatch
Copy link
Contributor

No description provided.

@jklepatch
Copy link
Contributor Author

#20

@jklepatch
Copy link
Contributor Author

jklepatch commented Nov 11, 2019

I stumbled upon 2 problems:

  1. When we create web3 contract instances, we don't have any address available yet for the from field. Can Web3 send calls with no from field? Otherwise we could use a dummy address.

  2. When we call connectWallet(), we need to wait for the saga of the web3 initialization to resolve. We could have a re-try loop for that:

let attempts = 0;
while(true) {
  if(attempts > 4) throw new Error('connect wallet failed');
  if(typeof web3 !== 'undefined') {
    yield delay(10);
     attempts++; 
     next;
   }
  // rest of connect wallet saga
  break;
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant