Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

298
Visualizações
trying to send money with coinbase api (invalid signature)

i am trying to send money with the coinbase api using node js, the node js coinbase library is broken, so i am querying the api directly, it works fine for all endpoints with the GET method, when i try to use the POST method to send money i get an invalid signature error, i am almost sure it is because of the way i am sending the body, i have tried several ways and still nothing works, if someone could help me to figure out what i am doing wrong, it would be of great help, thank you in advance.

        let params = {
            'type': 'send',
            'to': address,
            'amount': '0.00001',
            'currency': 'BTC',
            'idem': Math.floor(Date.now() / 1000)
        }

        var timestamp = Math.floor(Date.now() / 1000);
        var message = timestamp + 'POST' + '/v2/' + `accounts/${account_id}/transactions` + JSON.stringify(params);
        var signature = crypto.createHmac('sha256', api_secret).update(message).digest('hex');

        var config = {
            method: 'POST',
            url: `https://api.coinbase.com/v2/accounts/${account_id}/transactions`, 
            params: JSON.stringify(params),
            headers: { 
              'Content-Type': 'application/json',
              'CB-ACCESS-KEY': api_key,
              'CB-ACCESS-SIGN': signature,
              'CB-ACCESS-TIMESTAMP':  Math.floor(Date.now() / 1000),
              'CB-VERSION': '2016-02-18'
            }
        };

        const response = await axios(config);
        console.log(response)
    ```
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda