-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js
35 lines (27 loc) · 787 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const menubar = require('menubar');
const key = '';
const secret = '';
const KrakenClient = require('kraken-api');
const kraken = new KrakenClient(key, secret);
const AutoLaunch = require('auto-launch');
function refreshBalance() {
kraken.api('TradeBalance', { 'asset': 'EUR' }, function (error, data) {
if (error) {
console.log(error);
}
else {
mb.tray.setTitle(Math.round(data.result.eb) + '€');
console.log('refreshed');
}
});
setTimeout(refreshBalance, 60000);
}
var mb = menubar();
mb.on('ready', function ready() {
mb.tray.setTitle('pending');
refreshBalance();
new AutoLaunch({
name: 'KrakenMenubar',
path: '/Applications/KrakenMenubar.app'
}).enable();
});