Guest User

Untitled

a guest
Mar 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. else {
  2. return this.getAccounts().pipe(
  3. tap((accounts: string[]) => {
  4. if (accounts.length === 0) { throw new Error(‘No accounts available’); }
  5. }),
  6. map((accounts: string[]) => accounts[0]),
  7. tap((account: string) => this.web3.eth.defaultAccount = account),
  8. catchError((err: Error) => of(err))
  9. );
  10. }
Add Comment
Please, Sign In to add comment