dydxprotocol/solo

Solo requires setDefaultAccount() before calling getAccountBalances()

Closed this issue · 1 comments

I've just tried the solo js client and tried to call getAccountBalances() according to the documentation, but I was getting a

RPC Error: invalid argument 0: json: cannot unmarshal non-string into Go value of type common.Address {code: -32602, message: "invalid argument 0: json: cannot unmarshal non-string into Go value of type common.Address"}

error from Metamask.

It took me some time debugging and looking at the units tests to figured out you have, for some reason, call solo.setDefaultAccount() just after solo initialization for it to work.

I'm not sure if there is some bug here or it is just the documentation that is missing this instruction.

This seems to manifest itself particularly when using Infura. I will add this to the documentation