代码中下,感觉应该是没有错的,但是接口总是返回说没有传对应的参数:
function main() { exchange.IO("base", “https://api.btcgateway.pro”) //var obj = {“contract_code”:“TRX-USDT”,“volume”:10000,“direction”:“sell”,“offset”:“open”,“lever_rate”:3,“order_price_type”:“optimal_5”} var obj = {“contract_code”:“TRX-USDT”} var str = JSON.stringify(obj) Log(obj) Log(str) var hy_order_id = exchange.IO("api",“POST”, “/linear-swap-api/v1/swap_order_info”, “”, str) Log(hy_order_id) return hy_order_id }
调用后返回的包如下 {“ts”:1619326307135,“status”:“error”,“err_code”:1066,“err_msg”:“The contractCode field cannot be empty. Please re-enter.”}
说我没传contract_code,实际上我传了啊
小草 exchange.IO("api","POST", "/linear-swap-api/v1/swap_order_info", “contract_code=TRX-USDT”) 直接传入json不是每个交易所都能用