Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else {
- return this.getAccounts().pipe(
- tap((accounts: string[]) => {
- if (accounts.length === 0) { throw new Error(‘No accounts available’); }
- }),
- map((accounts: string[]) => accounts[0]),
- tap((account: string) => this.web3.eth.defaultAccount = account),
- catchError((err: Error) => of(err))
- );
- }
Add Comment
Please, Sign In to add comment