-
Notifications
You must be signed in to change notification settings - Fork 3
/
example.html
44 lines (38 loc) · 1.47 KB
/
example.html
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
<!DOCTYPE html>
<html>
<head>
<title>DashSight Demo</title>
<meta charset="UTF-8" />
</head>
<body>
<h1>Open the Console!</h1>
<script src="https://unpkg.com/@root/[email protected]/urequest.js"></script>
<script src="https://unpkg.com/[email protected]/dashrequest.js"></script>
<script src="https://unpkg.com/[email protected]/dashsight.js"></script>
<script src="https://unpkg.com/[email protected]/dashsocket.js"></script>
<script src="https://unpkg.com/@dashevo/[email protected]"></script>
<script src="./dashapi.js"></script>
<script src="./crowdnode.js"></script>
<script>
(function () {
let pubAddress = "Xz1pHWWsScUicrAGBMxqqA1UBZ1DmUstxW";
let baseUrl = "https://dashnode.duckdns.org/api/cors/app.crowdnode.io";
let insightBaseUrl = "https://insight.dash.org";
async function main() {
// Initializes API info, such as hotwallets
await window.CrowdNode.init({ baseUrl, insightBaseUrl });
let hotwallet = window.CrowdNode.main.hotwallet;
let status = await window.CrowdNode.status(pubAddress, hotwallet);
console.log("Status:", status);
let balance = await window.CrowdNode.http.GetBalance(pubAddress);
console.log("Balance:", balance);
}
console.log("Trying...");
main().catch(function (err) {
console.error("Fail:");
console.error(err.stack || err);
});
})();
</script>
</body>
</html>