· 6 years ago · Sep 18, 2019, 01:56 AM
1/*
2* Auditoria ANUBIS
3* Bruno da Silva
4*/
5const api = require('binance');
6const binanceRest = new api.BinanceRest({
7 key: 'BvrJWAYFrR7UCsNHWyW7hmnUB8vfgIeW07H75xiMeCoBOdFu2k955kRTqrHfzBsX',
8 secret: 'oYnqXHkj6fNEk9ARTab3QFXmI96eW9jW3Ozd7LRJowOKeUVzbECCfKhWHnP4izZA',
9 timeout: 15000,
10 recvWindow: 10000,
11 disableBeautification: false,
12 handleDrift: false
13});
14
15
16
17const binanceWS = new api.BinanceWS(true);
18
19binanceRest.account(function(error, data) {
20
21 for(var i in data.balances) {
22
23 if(data.balances[i].locked > 0 || data.balances[i].free > 0) {
24 console.log(data.balances[i]);
25 }
26 }
27});
28
29binanceRest.depositHistory({asset:'BTC'}, function(error, data) {
30 var total = 0.0;
31 for(var i in data.depositList) {
32 total += data.depositList[i].amount;
33 }
34 console.log('Total depositos BTC ' , total);
35});
36
37binanceRest.withdrawHistory({asset:'BTC'}, function(error, data) {
38 var total = 0.0;
39 for(var i in data.withdrawList) {
40 total += data.withdrawList[i].amount;
41 }
42 console.log('Total retiradas BTC ' , total);
43});