-
Notifications
You must be signed in to change notification settings - Fork 29
/
ark.js
44 lines (42 loc) · 1.28 KB
/
ark.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
36
37
38
39
40
41
42
43
44
/**
* @title Ark
* @symbol ARK
* @implementation Dynamic
* @cmcId ark
*/
module.exports = (callback, request) => {
Promise.all([
request({
uri: 'https://explorer.ark.io:8443/api/blocks/getSupply',
rejectUnauthorized: false,
json: true,
promise: true
}),
request({
uri: 'https://explorer.ark.io:8443/api/accounts/top?orderBy=balance:desc&limit=25&offset=0',
rejectUnauthorized: false,
json: true,
promise: true
})
])
.then(results => {
let arkTeam = 0,
arkWallets = [
'AUDud8tvyVZa67p3QY7XPRUTjRGnWQQ9Xv', // ARK Team
'ALgvTAoz5Vi9easHqBK6aEMKatHb4beCXm', // ARK Shield
'AYCTHSZionfGoQsRnv5gECEuFWcZXS38gs' // ARK Bounty
];
results[1].accounts.forEach(item => {
if (arkWallets.indexOf(item.address) !== -1) {
arkTeam += Number(item.balance) * Math.pow(10, -8);
}
});
callback({
t: Number(results[0].supply) * Math.pow(10, -8),
c: Number(results[0].supply) * Math.pow(10, -8) - arkTeam
})
})
.catch(error => {
callback(new Error('Request error ' + error.message));
});
};