tbtc.js
tbtc.js copied to clipboard
Web3 must set a defaultAccount
When trying to run through a deposit, I ran into an issue where transactions can't be sent because web3.eth.defaultAccount wasn't set.
I don't think its a common practice for devs to set this value, at least I've never used it.
Options to address this would be:
- Update the documentation, making it clear that this value should be set
- Query web3.eth.getAccounts() and use account[0]
@Shadowfiend what do you think? I'm comfortable with option 2.
I think the move here is to provide the ability to specify an account in config, fall back on defaultAccount, and throw if neither is set rather than implicitly guessing---particularly when there's already a mechanism to spare us the guess in defaultAccount.