Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[api] Added trade event to bin

  • Loading branch information...
commit 1483a3305a58d90859d3b493552f3229dd6cc909 1 parent 2d523f2
@Marak Marak authored
Showing with 12 additions and 4 deletions.
  1. +9 −1 bin/mtgox
  2. +3 −3 lib/mtgox.js
View
10 bin/mtgox
@@ -15,7 +15,15 @@ hook.on('children::ready', function(){
});
hook.on('private', function(data){
- //console.log(data, 'private');
+ console.log('private'.magenta, data);
+ });
+
+ hook.on('trade', function(data){
+ console.log('trade'.magenta, data);
+ });
+
+ hook.on('depth', function(data){
+ console.log('depth'.magenta, data);
});
hook.on('ticker', function(data){
View
6 lib/mtgox.js
@@ -20,10 +20,10 @@ var MtgoxHook = exports.MtgoxHook = function(options){
// spawn ready
self.on('*::websocket::message',function(message){
- if(message.ticker) {
- self.emit('ticker', message);
+ if(message.op === 'subscribe') {
+ self.emit('subscribe', message);
} else {
- self.emit(message.op, message);
+ self.emit(message.private, message);
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.