-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathblockchain-blocks-info.html
More file actions
25 lines (24 loc) · 957 Bytes
/
blockchain-blocks-info.html
File metadata and controls
25 lines (24 loc) · 957 Bytes
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
<!doctype html>
<html lang="en">
<head>
<title>Blockchain Blocks Info - Examples - Bitcoin Utility Belt</title>
</head>
<body>
<!-- Importing Bitcoin Utility Belt script -->
<script src="../../dist/bitcoin-utility-belt.min.js"></script>
<script>
// *************************************************************************
// API: https://www.smartbit.com.au/api
// get block info
let number = 0;
let noTx = true; // remove transactions from block result
belt.blockchain.block(number, noTx).then((res) => console.log(res));
// get blocks info
let limit = 10; // limit the result blocks
let sort = "height"; // sort by "height","hash","size","transaction_count","input_amount","output_amount","fees","input_count","output_count"
let dir = "desc";
let next = ""; // next page hash (get from the result)
belt.blockchain.blocks(limit, sort, dir, next).then((res) => console.log(res));
</script>
</body>
</html>