Skip to content

apikey: invalid #587

@nima-sayadi

Description

@nima-sayadi
          const apiKey = 'APIKEYFROMBITFINXI' // const apiKey = 'paste key here'
const apiSecret = 'SECRETFROMBITFINIX' // const apiSecret = 'paste secret here'

const apiPath = 'v2/auth/w/deposit/address'// Example path

const nonce = (Date.now() * 1000).toString() // Standard nonce generator. Timestamp * 1000
const body = {
} // Field you may change depending on endpoint

let signature = `${apiPath}${nonce}${JSON.stringify(body)}` 
// Consists of the complete url, nonce, and request body

const sig = CryptoJS.HmacSHA384(signature, apiSecret).toString() 
// The authentication signature is hashed using the private key

fetch(`https://api.bitfinex.com/${apiPath}`, {
  method: 'POST',
  body: JSON.stringify( {
     method: 'LNX', wallet: 'exchange' 
  }),
  headers: {
    'Content-Type': 'application/json',
    'bfx-nonce': nonce,
    'bfx-apikey': apiKey,
    'bfx-signature': sig
  }
})
.then( async(res) => {
 const response = await res.json();
  console.log(response);
  
})//Logs the response body
.catch(err => {
    console.log(err)
 })

})

anybody know what wrong, I am doing here ?

ERROR I ALWAYS GET

[ 'error', 10100, 'apikey: invalid' ]

Originally posted by @sawrubgupta in #217 (comment)

This problem still persists to this day and strangely no one has reported it since 2022. It is impossible to work with Bitfinex REST API v2 now. Always getting the error of apikey: invalid. All headers are sent correctly and the signature is correct. I tested UTF-8 encoding for both the signature and the secret, no chance. This is a bug and it is a shame to remove this exchange from my list of exchanges for my project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions