Allow multiple providers to use signTypedData with geth
Annoyingly I get a not implemented error when using dydx's client saying that eth_signTypedData is not implemented. After some searching I found that geth doesn't support that method, but it's sibling project Clef support it (called account_signTypedData) https://geth.ethereum.org/docs/clef/apis#account_signtypeddata, but not other APIs. Web3.py only supports one provider per instance, so it would be helpful to be able to create web3 clients as appropriate for the different services.
I personally ran into this error when trying to use client.onboarding.derive_stark_key() as seen in the onboarding here. However, I noticed that when I pass my ethereum private key, this error vanishes. The following worked for me.
dydx_client = Client(
network_id=network_id,
host=host,
eth_private_key=eth_private_key,
web3=Web3(Web3.HTTPProvider(infura_api_endpoint)),
)
stark_private_key = dydx_client.onboarding.derive_stark_key()
dydx_client.stark_private_key = stark_private_key