-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
67 lines (65 loc) · 2.31 KB
/
script.js
File metadata and controls
67 lines (65 loc) · 2.31 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
const urls = [
{
name: "Wallet Premium",
url: "https://api.chihuahua.wtf/cosmos/staking/v1beta1/delegations/chihuahua1avfdl66z7ce3v6drr49s84qfdw8jwq0s6jky9v",
selector: ".premium-text-api-block",
denom: " $HUAHUA",
},
{
name: "Wallet Zombies",
url: "https://rest-teritori.ecostake.com/cosmos/staking/v1beta1/delegations/tori1u0vepvps5h56l9hejccyg9x5aux3m557dl7g77",
selector: ".zombies-text-api-block",
denom: " $TORI",
},
{
name: "Wallet Punk Games Wallet",
url: "https://rest-teritori.ecostake.com/cosmos/staking/v1beta1/delegations/tori1g2nuu04v4ckhvknuadudcwz7dpefftzuud9839",
selector: ".punk-games-text-api-block",
denom: " $TORI",
},
{
name: "Wallet Early Punk Games Wallet",
url: "https://rest-teritori.ecostake.com/cosmos/staking/v1beta1/delegations/tori1m7lst3e4e3nrgc4ftulryntstt4qx2zztvvmxh",
selector: ".early-punk-games-text-api-block",
denom: " $TORI",
},
{
name: "Wallet Lottery MetaHuahua",
url: "https://rest.cosmos.directory/cosmoshub/cosmos/staking/v1beta1/delegations/cosmos1kgmlvpn4dja9zmknms0kpsv5pw3wkvfqcx0fqf",
selector:".lottery-text-api-block",
denom: " $ATOM",
},
{
name: "Wallet Metaverse Improvement",
url: "https://rest.cosmos.directory/cosmoshub/cosmos/staking/v1beta1/delegations/cosmos1j3jmy29n4svhrnmqqel4x89p44u55mtzn0nfhs",
selector:".metaverse-text-api-block",
denom: " $ATOM",
},
{
name: "Wallet Marketing & Communication",
url: "https://rest.cosmos.directory/cosmoshub/cosmos/staking/v1beta1/delegations/cosmos1adxapj0y5gwlctlfh4f03weuy233l582ljlg26",
selector:".communication-text-api-block",
denom: " $ATOM",
},
{
name: "Wallet PASG Airdrop",
url: "https://rest.cosmos.directory/cosmoshub/cosmos/staking/v1beta1/delegations/cosmos1u2fslkjzcrxn3cpu8dnkd2ugy7zalja7erj9ay",
selector:".pasg-text-api-block",
denom: " $ATOM",
},
];
urls.forEach((urlObj) => {
fetch(urlObj.url)
.then((response) => response.json())
.then((data) => {
const amount = Math.floor(
parseFloat(data.delegation_responses[0].balance.amount) / 1000000
);
const container = document.querySelector(urlObj.selector);
container.textContent = amount + urlObj.denom;
})
.catch((error) => console.error(error));
});
(function() {
urls();
})();