Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const request = require('request');
- const fetchEthexData = (ticker, callback) => {
- request({
- url:'https://api.ethex.market:5055/ticker24',
- json: true
- }, (error, response, body) => {
- if(error) {
- callback('Unable to connect to ethex');
- } else {
- console.log(body.ETH_BAT.last);
- //tutaj chciałbym aby dostawałem dane w zależności od tego co podam do funkcji jako "ticker", czyli jeśli po 'BAT' to wyświetla //mi się body.ETH_BAT.last, jeśli podam 'DAI' to wyświetla mi się body.ETH_DAI.last itp.
- //Da się tak w ogóle?
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment