Tag: mtgox

从Mt.获取date/时间 Gox的“现在”价值使用socket.io?

我使用socket.io( https://socketio.mtgox.com/socket.io/socket.io.js )连接到https://socketio.mtgox.com/mtgox ,并返回一个如下所示的对象: { exchange: 'mtgox', buy: 106.54693, sell: 106.99653, last: 106.54693, vol: 57734.68992687, now: 1371584138359638, _id: 51c0b68ab3067d631c000002 } 我正在寻找事件的时间和date。 now: ,看起来是时间戳,但new Date(1371584138359638); 返回Wed Oct 09 45433 05:59:19 GMT-0400 (EDT) 45,433年表明我错了。 我查看了https://en.bitcoin.it/wiki/MtGox/API/Streaming#Depth , now:出现在对象中,但在下面的描述中没有描述。 任何想法/build议?

通过MtGox的Streaming API进行身份validation的命令

我正在使用nodejs和socket.io-client连接到这里描述的MtGox Streaming API: https ://en.bitcoin.it/wiki/MtGox/API/Streaming#Authenticated_commands 这些例子是用PHP编写的,我尽我所能将它们转换成JS,但我一直得到服务器的响应“无效的调用” var sec_key_buffer = Buffer(secret_key, 'base64'); var hmac = crypto.createHmac('sha512', sec_key_buffer); var nonce = Date.now() + ""; var id = crypto.createHash('md5').update(nonce).digest('hex'); var query = { "call": 'private/info', "id": id, "nonce": nonce }; var body = JSON.stringify(query); var sign = hmac.update(body).digest('binary'); // The 'api_key' field has already stripped of the '-' […]