Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apikey: invalid #587

Open
nima-sayadi opened this issue Feb 11, 2024 · 0 comments
Open

apikey: invalid #587

nima-sayadi opened this issue Feb 11, 2024 · 0 comments

Comments

@nima-sayadi
Copy link

          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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant