mvs-86 / spotware_connect

A python client for the publicly available protobuf-based API developed by Spotware
GNU General Public License v3.0
9 stars 6 forks source link

Can't create 'SubscribeSpotsReq' #6

Closed tomazdragar closed 2 years ago

tomazdragar commented 3 years ago

Describe the bug Can't create 'SubscribeSpotsReq'

To Reproduce Steps to reproduce the behavior:

c.emit("SubscribeSpotsReq",
           payloadType=PROTO_OA_SUBSCRIBE_SPOTS_REQ,
           ctidTraderAccountId=<account_id>,
           symbolId=1)

@c.message(msgtype="SubscribeSpotsRes")
def on_subscribe_spots_res(**kargs):
    print('SubscribeSpotsRes')

Console error

  File "<project_path>/protobuf_client/test_client.py", line 65, in on_account_auth_ok
    c.emit("SubscribeSpotsReq",
  File "<project_path>/venv/lib/python3.8/site-packages/spotware_connect/client.py", line 85, in emit
    message = Protobuf.get(message, **params)
  File "<project_path>/venv/lib/python3.8/site-packages/spotware_connect/protobuf.py", line 36, in get
    return cls._protos[payload](**params)
builtins.TypeError: Value must be iterable

Desktop (please complete the following information):

tomazdragar commented 3 years ago

Sorry for the noise...

c.emit("SubscribeSpotsReq",
           payloadType=PROTO_OA_SUBSCRIBE_SPOTS_REQ,
           ctidTraderAccountId=<account_id>,
           symbolId=[1])

symbolId should be list