I am requesting Bitstamp API in parrallel:
// Simplified version
var async = require(\'async\');
var bitstamp = require(\'bitstamp\');
async.parallel([
bit
I had exactly the same problem, so I took askmike's code and modified it slightly.
var nonce = new (function() {
this.generate = function() {
var now = Date.now();
this.counter = (now === this.last? this.counter + 1 : 0);
this.last = now;
// add padding to nonce
var padding =
this.counter < 10 ? '000' :
this.counter < 100 ? '00' :
this.counter < 1000 ? '0' : '';
return now+padding+this.counter;
};
})();
use it like this
nonce.generate();
check out my jsfiddle with example