-
Bende Kodu yazmıştım
const crypto = require('crypto');
const https = require('https');
const accessKey = 'accessKeyBuraya';
const secretKey = 'secretKeyBuraya';
var timestamp = Math.floor(Date.now() / 1000);
var message= accessKey+timestamp;
const httpMethod = 'GET';
const host = '
www.btcturk.com';
const standardizedQuerystring='/api/balance'
function hmacBase64(key, msg) {
var hmac = crypto.createHmac('sha256', Buffer.from(key, 'base64'));
hmac.update(msg, 'utf8');
return hmac.digest('base64');
}
var authHeaders = {
'X-PCK': accessKey,
'X-Stamp': timestamp,
'X-Signature': hmacBase64(secretKey,message)
}
var options = {
host: host,
path: standardizedQuerystring,
port: 443,
method: httpMethod,
headers: authHeaders
}
var request = https.request(options, function (response) {
console.log(response.statusCode);
response.on('data', function (chunk) {
console.log(chunk.toString());
});
});
request.end();