Nested params not working with querystring.stringify
{ "account_id": 1, "pair": "USDT_BTC", "instant": "true", "position": { "type": "buy", "units": { "value": "0.01" }, "order_type": "market" } }
querystring.stringify does not give correct params to send out in URL. I had to use qs to make it work.
Hey, same issue there, can you please post full code to make position works ? Would be very helpfull :)
@mattguetta i had changed index.js
${this._url}${path}${querystring.stringify(params)} to
${this._url}${path}${qs.stringify(params)}
@ran010 Oh yeah got it thanks :) Have you been able to add take profit ? Got the same error with steps as it needs brackets
there is pull request #26 which also replaces "querystring" library with "qs-stringify", would this resolve the issue? Can someone test this? If all good I can merge it
Same issue here with take_profit true
error_attributes: { 'take_profit[steps]': [ 'is invalid' ], 'take_profit[steps][price][type]': [ 'is missing' ], 'take_profit[steps][price][value],take_profit[steps][price][percent]': [ 'are missing, exactly one parameter must be provided' ] }
Set it to false and you got it, probably because of nested [ ]
I’ll give a try but any thoughts on how doing this are welcome ^^
https://github.com/3commas-io/3commas-official-api-docs/issues/31#issuecomment-1020202364
Well, looks like this is the way to go but can't find how to, any help would be great :) https://github.com/3commas-io/3commas-official-api-docs/issues/19#issuecomment-739640270