I am using the node.bittrex.api without a problem. I am going through a loop of records and calling getticker for each record. The getticker call returns the values async which is fine, but I wanted some other data from the record outside of the loop, by which time the loop has run through to the end and my callback only uses the values from the last record in the currencies array, which is as expected.
var currencies = [{code:'btc-eth', fee:0.2},{code:'btc-ltc', fee:0.1},{code:'btc-ada', fee:0.5}];
for (index in currencies) {
bittrex.getticker({ market: currencies[index].code }, function (data, err) {
console.log("Currency: " + currencies[index].code);
console.log("Fee: " + currencies[index].fee);
console.log("Ticker: " + data);
});
}
Can this be done WITHOUT pass-through parameters (which I can do, but didn't want to fork the package).