রিসোর্স লোড হচ্ছে... লোডিং...

বিয়ান্টন টিন্টন নমুনা কোড

লেখক:উদ্ভাবকগণ - ক্যোটিফিকেশন - ছোট্ট স্বপ্ন, তারিখঃ ২০১৯-০৫-১৬ ০৯ঃ২৯ঃ৩৭
ট্যাগঃসরঞ্জামবিন্যান্স


String.prototype.format= function(){
    var args = Array.prototype.slice.call(arguments);
    var count=0;
    return this.replace(/%s/g,function(s,i){
        return args[count++];
    });
}

function WithdrawForBinance (accessKey, currency, address, addressTag, amount) {
    /* Withdraw API desc on Binance API doc
        query string :
            asset=ETH&address=0x6915f16f8791d0a1cc2bf47c13a6b2a92000504b&amount=1&recvWindow=5000&name=test&timestamp=1510903211000
        HMAC SHA256 signature:
            [linux]$ echo -n "asset=ETH&address=0x6915f16f8791d0a1cc2bf47c13a6b2a92000504b&amount=1&recvWindow=5000&timestamp=1510903211000" | 
            openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"
            (stdin)= 157fb937ec848b5f802daa4d9f62bea08becbf4f311203bda2bd34cd9853e320
        curl command:
            (HMAC SHA256)
            [linux]$ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" -X 
            POST 'https://www.binance.com/wapi/v3/withdraw.html?
            asset=ETH&address=0x6915f16f8791d0a1cc2bf47c13a6b2a92000504b&amount=1&recvWindow=5000&name=addressName&timestamp=1510903211000&
            signature=157fb937ec848b5f802daa4d9f62bea08becbf4f311203bda2bd34cd9853e320'
    */
    
    var timeStamp = new Date().getTime()
    var queryString = "asset=%s&address=%s&amount=%s&name=%s&timestamp=%s"
    queryString = queryString.format(currency, address, amount, addressTag, timeStamp)
    
    // sign
    var signature = exchange.HMAC("sha256", "hex", queryString, "{{secretkey}}")
    var uri = "https://www.binance.com/wapi/v3/withdraw.html?" + queryString + "&signature=" + signature
    
    // request
    var ret = HttpQuery(uri, "", "", "X-MBX-APIKEY: " + accessKey, true)
    
    Log(ret)
}




function main() {
    WithdrawForBinance("your accessKey", "ETH", "the address that you want to send", "test", "0.01")
}

সম্পর্কিত

আরো