Hi all

I’ve been trying to get the user balance from Kucoin via a Linux shell script.

Following the API documentation, I’ve put together a test script:

#!/bin/bash APIKEY="xxx" SECRET="yyy" nonce="$(/bin/date '+%s%N' | /usr/bin/cut -b1-13)" secret=`echo -n "/v1/account/balance/$nonce" | openssl dgst -sha256 -hmac "${SECRET}" | sed 's/^.*= //'` curl -H "KC-API-KEY: ${APIKEY}" -H "KC-API-NONCE: $nonce" -H "KC-API-SIGNATURE: $secret" -X GET "https://api.kucoin.com/v1/account/balance" exit $? 

The message I always receive, however, is this one: “code”:”UNAUTH”,”msg”:”Signature verification failed”

So now I’m at the point where either I entered the wrong API and secret keys or my script somehow is wrong.

I’ve generated new API keys, so I don’t think that’s the problem.

Could somebody who has already worked with the KuCoin API please check my script to see if it works for them?

Alternatively, if you see where I’m going wrong, I’d be glad for a quick heads up as to what I need to correct.

Thanks all!

submitted by /u/bitlog
[link] [comments]