soy nuevo en javascript. Estoy tratando de usar gate io api v4. No creo que haya un problema con mis códigos, pero no estoy seguro de que pueda serlo.
Mi código
function main() { const key = ""; const secret = ""; const host = "https://api.gateio.ws"; const prefix = "/api/v4"; const method = "POST"; const url = "/spot/orders"; const query_param=""; const boyd_param = '{"text":"t-123456","currency_pair":"BTC_USDT","type":"limit","account":"spot","side":"buy","iceberg":"0","amount":"10","price":"0.30","time_in_force":"gtc","auto_borrow":false}'; const t = (Date.now() / 1000).toString(); const body_hash = CryptoJS.SHA512(boyd_param).toString(); const sign_string=method+"\n"+prefix+url+"\n"+query_param+"\n"+body_hash+"\n"+t; const sign=CryptoJS.HmacSHA512(sign_string, secret).toString(); const headers = { "Access-Control-Allow-Headers":"Origin, X-Requested-With, Content-Type,Accept, x-client-key, x-client-token, x-client-secret, Authorization","Access-Control-Allow-Methods": "GET,HEAD,OPTIONS,POST,PUT" ,"Access-Control-Allow-Origin" : "*" , "Accept": "application/json", "Content-Type": "application/json", "muteHttpExceptions": true, "KEY": key, "Timestamp": t, "SIGN": sign }; fetch(host + prefix + url, { method, headers }); }Por favor, ayúdame ;(