I am using Truffle Development (or Ganache at times) and the problem is web3.eth.accounts
is only one account and not the list of all 10 accounts
I want to get hold of at least first two so that I can do token transfer (ERC721) using safeTransferFrom
For now I have just hardcoded the second parameter (to account) and that works, but every time I switch Development to Ganche I have to recode the second account, which is not nice.
I have tried all kinds of ways for getAccounts
(callback or promise) but no use.
For example:
web3.eth.getAccounts((error, accounts) => {
this.setState( {accounts : accounts} );
}