Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. * Auditoria ANUBIS
  3. * Bruno da Silva
  4. */
  5. const api = require('binance');
  6. const 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.  
  17. const binanceWS = new api.BinanceWS(true);
  18.  
  19. binanceRest.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.  
  29. binanceRest.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.  
  37. binanceRest.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. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement