Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

233
Views
API de Binance Futures: la firma no es válida

Actualmente estoy desarrollando un bot comercial por diversión, pero cuando quiero enviar una solicitud POST con axios, recibo el siguiente error como respuesta: {code: -1022, msg: 'Signature for this request is not valid.'}

Utilizo el paquete criptográfico node.js para crear un hash hmac sha256 como el mencionado en los documentos de la API de binance y en todos los demás tutoriales que he visto.

¡También ya creé una nueva API, por lo que mi clave y secreto son correctos!

Aquí está el código:

 let querystring = `symbol=LTCUSDT&side=BUY&type=LIMIT&timeInForce=GTC&quantity=0.05&price=${price}&recvWindow=5000&timestamp=${new Date().getTime()}`; let signature = crypto .createHmac('sha256', credentials.secret) .update(querystring) .digest('hex'); axios .post( `https://fapi.binance.com/fapi/v1/order?${querystring}&signature=${signature}`, {}, { headers: { 'X-MBX-APIKEY': credentials.key, 'content-type': 'application/x-www-form-urlencoded', }, } ) .then((response) => { console.log(response.data); resolve(response); }) .catch(function (error) { if (error.response) { // Request made and server responded console.log(error.response.data); console.log(error.response.status); console.log(error.response.headers); } else if (error.request) { // The request was made but no response was received console.log(error.request); } else { // Something happened in setting up the request that triggered an Error console.log('Error', error.message); } });
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!