Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // web3 has to be injected/present
- if(web3js)
- {
- if(web3js.eth.accounts.length)
- {
- // if not locked, get account
- const account = web3js.eth.accounts[0];
- // updates UI, state, pull data
- }
- else {
- // locked. update UI. Ask user to unlock.
- }
- }
Add Comment
Please, Sign In to add comment