Created
September 12, 2018 17:59
-
-
Save atomize/31c37d540841d5efb2c8eb32f1986a8b to your computer and use it in GitHub Desktop.
CCC Study
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tradeStreamer(fsym) { | |
var dataUrl = "https://min-api.cryptocompare.com/data/subs?fsym=" + fsym; | |
return fetch(dataUrl, { | |
"credentials": "omit", | |
"headers": {}, | |
"referrer": "https://cryptoqween.github.io/streamer/trade/", | |
"referrerPolicy": "no-referrer-when-downgrade", | |
"body": null, | |
"method": "GET", | |
"mode": "cors" | |
}).then(res=>res.json()) | |
} | |
tradeStreamer("ADA").then(res=>{ | |
console.log(Object.entries(res)) | |
var myMap = new Map(Object.entries(res)); | |
console.log(myMap.get('LTC').TRADES) | |
} | |
) | |
// Needs error handling which will also tell if subscription is available for selected exchange |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment