Commit 58fc26cc by ken

balance

parent c0315b7d
...@@ -59,13 +59,13 @@ const _subscribe = function(callback, opened_callback = false) { ...@@ -59,13 +59,13 @@ const _subscribe = function(callback, opened_callback = false) {
function subscribe() { function subscribe() {
_subscribe((data) => { _subscribe((data) => {
if (data.channel === accountInfoChannel) { if (data.channel === accountInfoChannel) {
console.log(accountInfoChannel);
const coins = data.data.coins; const coins = data.data.coins;
const balances = {}; const balances = {};
for (const coin of coins) { for (const coin of coins) {
balances[coin.enName] = {"onOrder": coin.freez, "available": coin.available}; balances[coin.enName] = {"onOrder": coin.freez, "available": coin.available};
} }
redisClient.hset("balance", "zb", balances); console.log(JSON.stringify(balances));
redisClient.hset("balance", "zb", JSON.stringify(balances));
} else { } else {
const depth = data; const depth = data;
const key = depth.channel.replace('_', '').toUpperCase() + '@zb'; const key = depth.channel.replace('_', '').toUpperCase() + '@zb';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment