Last active
August 30, 2015 19:18
-
-
Save Anderson-Juhasc/7c2fb341112de82cdb34 to your computer and use it in GitHub Desktop.
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
Bot.prototype.userInfo = function() { | |
var that = this | |
, deferred = Q.defer() | |
, channel = this.coin === 'usd' ? 'ok_spotusd_userinfo' : 'ok_spotcny_userinfo'; | |
that.send(channel); | |
that.ws.on('message', function(data) { | |
var messages = JSON.parse(data.data) | |
, channel = messages[0].channel; | |
if (channel === 'ok_spotusd_userinfo' || channel === 'ok_spotcny_userinfo') { | |
that.wallet = data; | |
deferred.resolve(); | |
} | |
}); | |
return deferred.promise; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
that.ws.on('message', function(data) {
var messages = JSON.parse(data.data)
, channel = messages[0].channel;
}