Commit a0e2cf82 by ken

试试看

parent 8312b1cd
......@@ -163,6 +163,22 @@ function depthByRest(symbol,callback) {
});
}
function getBalanceByRest() {
const params = {
accesskey: APIKEY,
method: "getAccountInfo"
};
const sign = JSON.parse(signParams2Str(params)).sign;
const url = `https://trade.zb.com/api/getAccountInfo?accesskey=${APIKEY}&method=getAccountInfo&sign=${sign}&reqTime=${Date.now()}`
_request("GET", url, (err, data) => {
if (err) {
console.error(url + "出错");
} else {
console.debug(data);
}
});
}
function run() {
subscribe();
setInterval(() => {
......@@ -170,6 +186,9 @@ function run() {
depthByRest(symbol);
}
}, 500);
setInterval(() => {
getBalanceByRest();
}, 6000);
}
run();
......
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