-
Notifications
You must be signed in to change notification settings - Fork 19
/
index.js
31 lines (29 loc) · 795 Bytes
/
index.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
const parser = require('./lib/parser');
module.exports = {
getBalance: async (username, password) => {
try {
const IP = await parser.getIP();
await parser.login(username, password, IP);
await parser.openSettlementMenu();
const balance = await parser.balance();
await parser.logout();
return balance;
} catch (err) {
await parser.logout();
throw err;
}
},
getSettlement: async (username, password) => {
try {
const IP = await parser.getIP();
await parser.login(username, password, IP);
await parser.openSettlementMenu();
const settlement = await parser.settlement();
await parser.logout();
return settlement;
} catch (err) {
await parser.logout();
throw err;
}
}
};