2016-10-19 11:02:42 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width">
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
2016-11-01 18:12:40 +01:00
|
|
|
<link rel="icon" href="/parity-logo-black-no-text.png" type="image/png">
|
2016-10-19 11:02:42 +02:00
|
|
|
<title>dev::Parity.js</title>
|
2016-11-06 17:42:25 +01:00
|
|
|
<style>
|
|
|
|
.box {
|
|
|
|
font-size: 1.5em;
|
|
|
|
text-align: center;
|
|
|
|
border-radius: 0.5em;
|
|
|
|
background: #eee;
|
|
|
|
padding: 1em;
|
|
|
|
margin: 1em;
|
|
|
|
}
|
|
|
|
</style>
|
2016-10-19 11:02:42 +02:00
|
|
|
</head>
|
|
|
|
<body>
|
2016-11-06 17:42:25 +01:00
|
|
|
<div class="box">
|
|
|
|
best block #<span id="blockNumber">unknown</span>
|
|
|
|
</div>
|
2017-11-13 09:31:08 +01:00
|
|
|
<script src="/parity-utils/inject.js"></script>
|
2016-11-06 17:42:25 +01:00
|
|
|
<script>
|
2017-11-13 09:31:08 +01:00
|
|
|
console.log('window.ethereum', window.ethereum);
|
|
|
|
console.log('window.ethereum.isParity', window.ethereum.isParity);
|
|
|
|
console.log('window.parity', window.parity);
|
|
|
|
|
2016-11-06 17:42:25 +01:00
|
|
|
window.parity.api.subscribe('eth_blockNumber', function (error, blockNumber) {
|
|
|
|
if (error) {
|
|
|
|
console.log('error', error);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
document.getElementById('blockNumber').innerHTML = blockNumber.toFormat(0);
|
|
|
|
});
|
|
|
|
</script>
|
2016-10-19 11:02:42 +02:00
|
|
|
</body>
|
|
|
|
</html>
|