Guest User

Untitled

a guest
Oct 15th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. // web3 has to be injected/present
  2. if(web3js)
  3. {
  4. if(web3js.eth.accounts.length)
  5. {
  6. // if not locked, get account
  7. const account = web3js.eth.accounts[0];
  8. // updates UI, state, pull data
  9. }
  10. else {
  11. // locked. update UI. Ask user to unlock.
  12. }
  13. }
Add Comment
Please, Sign In to add comment