Commit 7013d89c by ken

balance

parent 6af2955d
......@@ -29,6 +29,7 @@ const _handleSocketOpen = function(opened_callback) {
let accountReq = `{'accesskey':'${APIKEY}','channel':'${accountInfoChannel}','event':'addChannel'`;
const sign = crypto.createHmac('sha1', APISECRET).update(accountReq).digest().toString('base64');
accountReq += `,'sign':${sign}`;
console.log(accountReq);
this.send(accountReq);
};
......@@ -59,9 +60,8 @@ const _subscribe = function(callback, opened_callback = false) {
function subscribe() {
_subscribe((data) => {
console.log(data);
if (data.channel === accountInfoChannel) {
console.log(data);
const coins = data.data.coins;
const balances = {};
for (const coin of coins) {
......
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