Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

444
Vistas
Invalid signature : FTX GET wallet/balances

I am getting the error data: { success: false, error: 'Not logged in: Invalid signature' } for /wallet/balances. Interestingly, the same code runs for /wallet/coins and /markets for FTX REST API. The code is in JS PLEASE HELP!!

  const url = "https://ftx.us/api/wallet/balances" 
  const path = "/api/wallet/balances"
  const timestamp = Date.now()
  const method = "GET"
  const payload = `{timestamp}{method}{url}`
  const hash = CryptoJS.HmacSHA256(payload, process.env.FTX_API_SECRET)
  // var hmac = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, "Secret Passphrase");
  // hmac.update(JSON.stringify(timestamp));
  // hmac.update(method);
  // hmac.update(path);
  // var hash = hmac.finalize();
  const hash2 = crypto.createHmac('sha256', process.env.FTX_API_SECRET).update(payload).digest("hex")
  console.log("API KEY ", process.env.FTX_API_KEY)
  axios({
      method: "get",
      headers: {
          "FTXUS-SIGN": CryptoJS.enc.Hex.stringify(hash),
          // "FTXUS-SIGN": hash2,
          "FTXUS-KEY": process.env.FTX_API_KEY,
          "FTXUS-TS": timestamp,
      },
      url: url
  })
  .then( (response) => {
      if (response.data.success) {
          callback(null, response.data.result)
      } else {
          // error handling here for the api 
          callback(result.data.error)
      }
      
  })
  .catch ( (e) => {
      console.log("exception in request ", e)
  })
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

add these 2 lines in headers,


{
   "FTXUS-SIGN": CryptoJS.enc.Hex.stringify(hash),
   "FTXUS-KEY": process.env.FTX_API_KEY,
   "FTXUS-TS": timestamp,
   "Content-Type": "application/json",
   "Accepts": "application/json",
 }



It worked for me

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda