Author

Topic: silinebilir (Read 104 times)

newbie
Activity: 17
Merit: 36
April 10, 2019, 03:51:49 PM
#2
-

Bende Kodu yazmıştım Cheesy

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();
legendary
Activity: 1877
Merit: 1396
The Last Cryptocoin Burner
April 09, 2019, 10:54:27 AM
#1
-
Jump to: