Bitcoin Forum
July 21, 2018, 11:54:57 AM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Websocket API: Unknown mtgox message type: op  (Read 749 times)
slmt
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
April 21, 2013, 08:43:26 AM
 #1

Here's a bit of node.js code:

Code:
var WebSocket = require('ws');
var ws = new WebSocket('ws://websocket.mtgox.com:80/mtgox?Currency=USD');
ws.on('open', function() {
        console.log('Connection opened');
        ws.send(JSON.stringify({ "op": "mtgox.subscribe", "type": "depth.BTCUSD" }));
});
ws.on('message', function(message) { console.log(message); });

When this client sends
Code:
{"op": "mtgox.subscribe", "type": "depth.BTCUSD" }

The API returns
Code:
{"message":"Unknown mtgox message type","op":"remark","success":false}

What am I doing wrong?
1532174097
Hero Member
*
Offline Offline

Posts: 1532174097

View Profile Personal Message (Offline)

Ignore
1532174097
Reply with quote  #2

1532174097
Report to moderator
1532174097
Hero Member
*
Offline Offline

Posts: 1532174097

View Profile Personal Message (Offline)

Ignore
1532174097
Reply with quote  #2

1532174097
Report to moderator
1532174097
Hero Member
*
Offline Offline

Posts: 1532174097

View Profile Personal Message (Offline)

Ignore
1532174097
Reply with quote  #2

1532174097
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, but full nodes are more resource-heavy, and they must do a lengthy initial syncing process. As a result, lightweight clients with somewhat less security are commonly used.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1532174097
Hero Member
*
Offline Offline

Posts: 1532174097

View Profile Personal Message (Offline)

Ignore
1532174097
Reply with quote  #2

1532174097
Report to moderator
1532174097
Hero Member
*
Offline Offline

Posts: 1532174097

View Profile Personal Message (Offline)

Ignore
1532174097
Reply with quote  #2

1532174097
Report to moderator
1532174097
Hero Member
*
Offline Offline

Posts: 1532174097

View Profile Personal Message (Offline)

Ignore
1532174097
Reply with quote  #2

1532174097
Report to moderator
pescador
Newbie
*
Offline Offline

Activity: 14
Merit: 0



View Profile
April 25, 2013, 04:12:32 PM
 #2

Try subscribing to "depth" ( or "ticker" or "trades" ). See https://en.bitcoin.it/wiki/MtGox/API/Streaming#mtgox.subscribe. I also find it difficult to understand why you have to subscribe and unsubscribe with different names.

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!