This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
327 lines (302 loc) · 13.8 KB
/
index.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
<title>Iridium (IRD) Network Statistics and Blockchain Explorer</title>
<meta name="Description" content="Explore the Blockchain universe of the most advanced, private and fair cryptocurrency, your Iridium (IRD) coin.">
<link rel="canonical" href="https://explorer.ird.cash">
<meta property="og:locale" content="en_US">
<meta property="og:type" content="website">
<meta property="og:title" content="Iridium (IRD) Network Statistics and Blockchain Explorer">
<meta property="og:description" content="Explore the Blockchain universe of the most advanced, private and fair cryptocurrency, your Iridium (IRD) coin.">
<meta property="og:url" content="https://explorer.ird.cash">
<meta property="og:site_name" content="Iridium (IRD) Network Statistics and Blockchain Explorer">
<meta property="article:publisher" content="https://www.facebook.com/IridiumCoin">
<meta property="article:modified_time" content="2021-05-30T15:23:27+00:00">
<meta property="og:image" content="https://explorer.ird.cash/explorer.jpg">
<meta property="og:image:width" content="876">
<meta property="og:image:height" content="440">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Iridium (IRD) Network Statistics and Blockchain Explorer">
<meta name="twitter:description" content="Explore the Blockchain universe of the most advanced, private and fair cryptocurrency, your Iridium (IRD) coin.">
<meta name="twitter:image" content="https://explorer.ird.cash/explorer.jpg">
<meta name="twitter:site" content="@iridiumCash">
<meta name="twitter:label1" content="Est. reading time">
<meta name="twitter:data1" content="1 minute">
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-timeago/1.6.3/jquery.timeago.min.js" integrity="sha256-3S5uFNXUTbSzidUyam/9OVgDhJ2Yx1rmb6F+Ju3/6WE=" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
<script defer src="https://use.fontawesome.com/releases/v5.0.9/js/all.js" integrity="sha384-8iPTk2s/jMVj81dnzb/iFR2sdA7u06vHJyyLlAd4snFpCl/SnyUjRrbdJsw1pGIl" crossorigin="anonymous"></script>
<link href="css/styles.css" rel="stylesheet">
<link rel="icon" href="https://explorer.ird.cash/cropped-iridiumlogo_512x512-32x32.png" sizes="32x32">
<link rel="icon" href="https://explorer.ird.cash/cropped-iridiumlogo_512x512-192x192.png" sizes="192x192">
<link rel="apple-touch-icon" href="https://explorer.ird.cash/cropped-iridiumlogo_512x512-180x180.png">
<meta name="msapplication-TileImage" content="https://explorer.ird.cash/cropped-iridiumlogo_512x512-270x270.png">
<script src="config.js"></script>
</head>
<body>
<header class="navbar navbar-expand-md navbar-dark fixed-top">
<a id="home" class="navbar-brand" href="#" data-page="home.html">
<img class="logo-small img-fluid" src="images/64x64.png" alt="Iridium logo">
<span class="irdfontup">Iridium (IRD)</span> Blockchain Explorer
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggler"
aria-controls="navbarToggler" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarToggler">
<ul class="navbar-nav mr-auto mt-2 mt-lg-0">
<li class="nav-item">
<a id="home1" class="nav-link hot_link" href="#" data-page="home.html"><i class="fa fa-home"></i>
Home<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a id="block" class="nav-link hot_link" href="#blockchain" data-page="blockchain.html"><i
class="fa fa-cubes"></i> Blockchain</a>
</li>
<!--<li class="nav-item">-->
<!--<a class="nav-link hot_link" href="#market" data-page="market.html"><i class="fas fa-th-list"></i>-->
<!--Market</a>-->
<!--</li>-->
<!-- <li class="nav-item">-->
<!-- <a id="pools" class="nav-link hot_link" href="#pools" data-page="pools.html"><i class="fas fa-tasks"></i> Pools</a>-->
<!-- </li>-->
<!--<li class="nav-item">-->
<!--<a class="nav-link hot_link" href="#stats" data-page="stats.html"><i class="fas fa-chart-area"></i>-->
<!--Statistics</a>-->
<!--</li>-->
<li style="display:none;">
<a class="hot_link" href="#block" data-page="block.html">block
</a>
</li>
<li style="display:none;">
<a class="hot_link" href="#transaction" data-page="transaction.html" >transaction
</a>
</li>
</ul>
<div id="stats_updated"><i class="fas fa-sync fa-spin"></i></div>
</div>
</header>
<div class="container-fluid">
<div id="page"></div>
<div class="wrapper">
<p id="loading"><i class="fas fa-sync fa-spin"></i></p>
</div>
</div>
<footer class="footer">
Block explorer for Iridium : <a target="_blank" href="https://github.com/iridiumdev/ird-explorer"><i
class="fab fa-github-square"></i> Iridium explorer</a>
open sourced under the <a href="http://www.gnu.org/licenses/gpl-2.0.html">GPL</a>
</footer>
<div id="alert_placeholder"></div>
<script>
$(function () {
getLastMinedBlockHeader();
});
// 1 Get last mined block header
var xhrGetLastMinedBlockHeader;
function getLastMinedBlockHeader() {
if (xhrGetLastMinedBlockHeader) xhrGetLastMinedBlockHeader.abort();
xhrGetLastMinedBlockHeader = $.ajax({
timeout: 20000,
url: api + '/json_rpc',
method: "POST",
data: JSON.stringify({
jsonrpc: "2.0",
id: "1",
method: "getlastblockheader"
}),
dataType: 'json',
cache: 'false'
})
.done(function (data) {
if (data.hasOwnProperty('result')) {
lastMinedBlockHeader = data.result;
routePage(fetchLiveLastMinedBlockHeader);
} else {
showalert('alert-danger', 'Core error : ', data.error.message);
$('#loading').hide();
}
})
.fail(function (xhrGetLastMinedBlockHeader, textStatus) {
if (textStatus != "abort") {
showalert('alert-danger', 'Can\'t connect to api : ', textStatus);
$('#loading').hide();
routePage();
}
});
}
// Route callback
var xhrFetchLastMinedBlockHeader;
function fetchLiveLastMinedBlockHeader() {
if (xhrFetchLastMinedBlockHeader) xhrFetchLastMinedBlockHeader.abort();
pulseLiveUpdate();
xhrFetchLastMinedBlockHeader = $.ajax({
timeout: 20000,
url: api + '/json_rpc',
method: "POST",
data: JSON.stringify({
jsonrpc: "2.0",
id: "1",
method: "getlastblockheader"
}),
dataType: 'json',
cache: 'false'
})
.done(function (data) {
if (data.hasOwnProperty('result')) {
lastMinedBlockHeader = data.result;
currentPage.update();
} else {
showalert('alert-danger', 'Core error : ', data.error.message);
$('#loading').hide();
}
})
.always(function () {
refreshAll = setTimeout(function () {
console.log('global polling tick');
fetchLiveLastMinedBlockHeader();
}, 60000);
})
.fail(function (xhrFetchLastMinedBlockHeader, textStatus) {
if (textStatus != "abort") {
showalert('alert-danger', 'Can\'t connect to api : ', textStatus);
$('#loading').hide();
}
});
}
var xhrPageLoading;
var currentPage;
// page router
function routePage(loadedCallback) {
if (currentPage) currentPage.destroy();
$('#page').html('');
$('#loading').show();
if (xhrPageLoading) xhrPageLoading.abort();
$('.hot_link').parent().removeClass('active');
$link = $('a.hot_link[href="' + (window.location.hash || '#') + '"]');
$link.parent().addClass('active');
page = $link.data('page');
xhrPageLoading = $.ajax({
url: page,
cache: false
})
.done(function (data) {
$('#page').show().html(data);
currentPage.init();
if (loadedCallback) loadedCallback();
})
.fail(function (xhrPageLoading, textStatus) {
if (textStatus != "abort") {
showalert('alert-danger', 'Can\'t find page : ', page);
$('#loading').hide();
}
});
}
// show working icon
function pulseLiveUpdate() {
const stats_update = document.getElementById('stats_updated');
stats_update.style.transition = 'opacity 100ms ease-out';
stats_update.style.opacity = 1;
setTimeout(function () {
stats_update.style.transition = 'opacity 10000ms linear';
stats_update.style.opacity = 0;
}, 100);
}
// update text by id
function updateText(e, t) {
// console.log("e: " + e + " t: " + t); //debug updatetext
let el = document.getElementById(e);
if(el != null){
if (el.textContent !== t) {
el.textContent = t;
}
}
}
function updateTextLinkable(e, t){
let el = document.getElementById(e);
if(el != null) {
if (el.innerHTML !== t) {
el.innerHTML = t;
}
}
}
// handle url hash click
window.onhashchange = function () {
routePage();
};
// transform raw amount by readble (+ symbol)
function getReadableCoins(coins, digits, withoutSymbol) {
var amount = (parseInt(coins || 0) / coinUnits).toFixed(digits || coinUnits.toString().length - 1);
return amount + (withoutSymbol ? '' : (' (' + symbol+')'));
}
// do I have to explain ?
function getReadableHashRateString(h) {
let i = 0;
let byteUnits = [' H/s', ' kH/s', ' Mh/s', ' Gh/s', ' TH/s', ' PH/s'];
while (h > 1000) {
h = h / 1000;
i++;
}
return h.toFixed(2) + byteUnits[i];
}
// idem for numbers (+symbol)
function shortenLargeNumber(num, digits, withoutSymbol) {
var units = ['k', 'M'], decimal;
for (let i = units.length - 1; i >= 0; i--) {
decimal = Math.pow(1000, i + 1);
if (num <= -decimal || num >= decimal) {
return +(num / decimal).toFixed(digits) + units[i] + (withoutSymbol ? '' : (' ' + symbol));
}
}
return num + (withoutSymbol ? '' : (' ' + symbol));
}
function formatDate(time) {
if (!time) return '';
return new Date(parseInt(time) * 1000).toLocaleString();
}
function getBlockchainUrl(id) {
return blockchainExplorer.replace('{id}', id);
}
function formatBlockLink(hash) {
return '<a href="' + getBlockchainUrl(hash) + '" rel="nofollow">' + hash + '</a>';
}
function getTransactionUrl(id) {
return transactionExplorer.replace('{id}', id);
}
function formatPaymentLink(hash){
return '<a href="' + getTransactionUrl(hash) + '" rel="nofollow">' + hash + '</a>';
}
urlParam = function(name){
let results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
if (results==null){
return null;
} else {
return results[1] || 0;
}
};
// trigger alert
function showalert(alerttype, title, message) {
$('#alert_placeholder').append('<div class="alert ' + alerttype + ' alert-dismissible fade show center-block" role="alert">' +
'<h2>' + title + '</h2><br>' + message +
'<span class="close" data-dismiss="alert" aria-label="Close""><i class="fas fa-times-circle"></i></span>' +
'</div>').show();
// $('#alert_placeholder').show();
setTimeout(function () {
$(".alert").fadeOut("slow");
}, 4000);
setTimeout(function () {
$(".alert").remove();
$('#alert_placeholder').hide();
}, 5000);
}
//close menu on mobile
$('.navbar-nav>li>a').on('click', function(){
$('.navbar-collapse').collapse('hide');
});
</script>
</body>
</html>