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

442
Views
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 answers
Answer question

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 Report
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!