InjectiveLabs/sdk-python

TypeError: Parameter to MergeFrom() must be instance of same class: expected injective.exchange.v1beta1.exchange_pb2.SpotOrder got injective.exchange.v1beta1.exchange_pb2.SpotOrder.

Closed this issue · 5 comments

I tried to run this example to create a spot order but I've encountered error below:

TypeError: Parameter to MergeFrom() must be instance of same class: expected injective.exchange.v1beta1.exchange_pb2.SpotOrder got injective.exchange.v1beta1.exchange_pb2.SpotOrder. for field MsgCreateSpotLimitOrder.order

I used the "sentry0" mainnet (client = AsyncClient(Network.mainnet('sentry0'), insecure=True))

Are you using a Mac or is that on Linux?

I'm using Mac OS Monterey with an Apple silicon chip

Python 3.9.9
injective-py==0.5.6.8

Can you try:

  1. Installing python through brew and not pyenv
  2. Running brew unlink protobuf && brew link protobuf
    I encountered this issue before on my own mac and was solved through these steps.

Nope
Doesn't fix it
Still got the same exception

This was fixed through the steps provided above through a direct discussion on Telegram with @amiwrpremium