verata-veritatis / pybit

Python3 API connector for Bybit's HTTP and Websockets APIs.
MIT License
117 stars 193 forks source link

Place conditional order: encoding without a string argument #86

Closed BCusack closed 2 years ago

BCusack commented 2 years ago

Just came over from the Binance API and I'm just trying to place an order. Exeption reads as : TypeError: "encoding without a string argument" def placeTrade(self, params) -> dict: """place trade""" try: res = self._client.place_conditional_order( symbol=params["symbol"], order_type=params["order_type"], side=params["side"], qty=params["qty"], price=params["price"], base_price = params["base_price"], stop_px=params["price"], time_in_force='GoodTillCancel', close_on_trigger=True, reduce_only = False, take_profit=params["take_profit"], stop_loss=params["stop_loss"], trigger_by='last_price') except Exception as e: print(e) return {} else: return res

BCusack commented 2 years ago

Sorry - passed an dict HTTP({"api_key": config.API, "api_secret": config.SECRET}) to the HTTP instanciation without errors? resolved with - HTTP(api_key= config.API, api_secret= config.SECRET)