Advertisement
Guest User

Untitled

a guest
Jun 12th, 2019
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. const api = require('binance');
  2. const binanceRest = new api.BinanceRest({
  3. key: '', // Get this from your account on binance.com
  4. secret: '', // Same for this
  5. timeout: 15000, // Optional, defaults to 15000, is the request time out in milliseconds
  6. recvWindow: 10000, // Optional, defaults to 5000, increase if you're getting timestamp errors
  7. disableBeautification: false,
  8. /*
  9. * Optional, default is false. Binance's API returns objects with lots of one letter keys. By
  10. * default those keys will be replaced with more descriptive, longer ones.
  11. */
  12. handleDrift: true
  13. /* Optional, default is false. If turned on, the library will attempt to handle any drift of
  14. * your clock on it's own. If a request fails due to drift, it'll attempt a fix by requesting
  15. * binance's server time, calculating the difference with your own clock, and then reattempting
  16. * the request.
  17. */
  18. });
  19.  
  20. //min
  21.  
  22. async function getData(){
  23. var obtdata = await binanceRest.bookTicker({symbol: 'BTCUSDT'})
  24. var symbol = obtdata.symbol
  25. var bidPrice =obtdata.bidPrice
  26. var bidQty =obtdata.bidQty
  27. var askPrice =obtdata.askPrice
  28. var askQty =obtdata.askQty
  29.  
  30. console.log(askPrice);
  31. }
  32. //orders
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement