forked from selimerunkut/binance_brokarage_api_client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
executable file
·31 lines (22 loc) · 839 Bytes
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<html>
<script type="text/javascript" src="crypto-js.js"></script>
<script>
var burl = 'https://api.binance.com';
var endPoint = '/sapi/v1/broker/subAccount';
var dataQueryString = "recvWindow=20000×tamp=" + Date.now();
var keys = {
'akey': '',
'skey': ''
}
var signature = CryptoJS.HmacSHA256(dataQueryString, keys['skey']).toString(CryptoJS.enc.Hex);
var ourRequest = new XMLHttpRequest();
var url = burl + endPoint + '?' + dataQueryString + '&signature=' + signature;
var ourRequest = new XMLHttpRequest();
ourRequest.open('POST', url, true);
ourRequest.setRequestHeader('X-MBX-APIKEY', keys['akey']);
ourRequest.onload = function () {
console.log(ourRequest.responseText);
}
ourRequest.send();
</script>
</html>