rentorm / 3commas-api-node

NodeJS wrapper for Official 3commas API
GNU General Public License v3.0
42 stars 28 forks source link

Path params and hitting URL length limit (Unexpected end of JSON input) #30

Open TylerSanford opened 1 year ago

TylerSanford commented 1 year ago

Good Evening,

I have been seeing errors in my logs for the last week or so that cropped up from no code change. I use kucoin as my exchange and I update the bot settings when new pairs are added. Over the last few weeks I have seen the coins go from 790 to over 830 and sometime from 820ish I started seeing the exception FetchError: invalid json response body at https://api.3commas.io/public/api/ver1/bots/** reason: Unexpected end of JSON input

I was still able to use the same endpoint with a smaller list, but I am unable to update the list with all current kucoin USDT pairs.

I propose for POST/PUT calls we use the body instead of a query string within async makeRequest(method, path, params) { on line 24 in threeCommasAPI class.

From 3Commas documentation: