Hi can someone let me know what is wrong with this batch order? Its saying
0: {code: 400, msg: null}
1: {code: 400, msg: null}
2: {code: 400, msg: null}
3: {code: 400, msg: null}
4: {code: 400, msg: null}
I did that was the previous problem because was getting signature failure and then encoded batch and went through but said forgot to add type so I added type limit and then got this and was thinking had something to do with amount of decimals I had on quantity and price so made those smaller. I think its sending fine just something wrong with my batchOrders value but yeah.
and to encode batchOrders doing
encodeURIComponent(JSON.stringify(batchOrders))
I think its something weird with the way its encode and I need to figure out a way to use the correct replacements for encoding it in my own js function
Youre correct had to add timeinforce and then instead of using that encode function i just. made my own little js function to add the % characters in place of " and { and } and worked. Thanks!
I manually encode the jsonString using the following rules:
jsonString.replace(""", “%22”)
.replace("{","%7B")
.replace("}","%7D")
.replace(":","%3A")
.replace("[","%5B")
.replace("]","%5D")
.replace(",","%2C");
I add the encoded json to the url as batchOrders=[encoded json]
I generate the signature on the urlParams and add it to the url as signature=[signature]
I make the request
This mostly works but I do get the occasional bad gateway error which is concerning to be honest