如何让Poloniex推送API数据与Wampy

我想获得正确的数据连接到Poloniex推送API使用Wamp协议Wampy.js实现http://wamp-proto.org/implementations/

但是我只有最后两个数据types,第一个保持给我“seq”:

{ “序列”:76722908}

[ “BTC_ETH”, “0.02027380”, “0.02027377”, “0.02027355”, “0.06151162”, “29539.50716156”, “1478656.69569076”,0, “0.02097800”, “0.01865820”]

[“trollboxMessage”,8755461,“reorx2112”,“made mill alrdy”,9]

官方的例子和http://pastebin.com/dMX7mZE0他们使用autobahn node.js模块

这是我的代码如下

脚本src =“node_modules / wampy / build / wampy-all.min.js”脚本>

<pre> ws = new Wampy('wss://api.poloniex.com', {realm: "realm1"}); ws.onopen = function () { // //subscribe to currency pair //this data type is not correct //while other data looks normal // ws.subscribe('BTC_ETH',function (data) { console.log(data); document.getElementById("event").innerHTML=JSON.stringify(data); }); //only get the raw data ws.subscribe('ticker',function (data) { if(data[0]==="BTC_ETH"){ console.log(data); document.getElementById("ticker").innerHTML=SON.stringify(data); } }); //chat box ws.subscribe('trollbox',function (data) { console.log(data); document.getElementById("trollbox").innerHTML=JSON.stringify(data); }); }; ws.onopen()</pre> 

这个问题让我想起了一段时间……