-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuserburns.html
More file actions
92 lines (83 loc) · 3.16 KB
/
userburns.html
File metadata and controls
92 lines (83 loc) · 3.16 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
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
<!DOCTYPE html>
<html>
<head>
<title>Stride Burn Transactions</title>
<style>
body {
background: black;
color: pink;
font-family: monospace;
padding: 20px;
}
a {
color: pink;
text-decoration: underline;
}
a:hover {
color: hotpink;
}
button {
background: pink;
color: black;
border: none;
padding: 10px 20px;
cursor: pointer;
font-family: monospace;
}
</style>
</head>
<body>
<h1>Stride Burn Transactions</h1>
<button onclick="loadBurns()">Refresh</button>
<div id="results"></div>
<script>
async function loadBurns() {
const resultsDiv = document.getElementById('results');
resultsDiv.innerHTML = '<p>Loading burn transactions...</p>';
try {
const response = await fetch('https://stride-rpc.polkachu.com', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'tx_search',
params: {
query: "message.action='/stride.strdburner.MsgBurn'",
prove: false,
page: '1',
per_page: '20',
order_by: 'desc'
}
})
});
const data = await response.json();
if (!data.result || !data.result.txs) {
resultsDiv.innerHTML = '<p>No burn transactions found.</p>';
return;
}
let html = `<p>Found ${data.result.total_count} total burn transactions</p><br>`;
data.result.txs.forEach(tx => {
const txDecoded = JSON.parse(atob(tx.tx));
const burnMsg = txDecoded.body.messages.find(m => m['@type'] === '/stride.strdburner.MsgBurn');
if (burnMsg) {
const amountInStrd = (parseInt(burnMsg.amount) / 1000000).toFixed(6);
html += `
<div style="margin-bottom: 20px;">
<div>Tx: <a href="https://www.mintscan.io/stride/tx/${tx.hash}" target="_blank">${tx.hash}</a></div>
<div>Height: ${tx.height}</div>
<div>Burner: ${burnMsg.burner}</div>
<div>Amount: ${amountInStrd} STRD</div>
</div>
`;
}
});
resultsDiv.innerHTML = html;
} catch (error) {
resultsDiv.innerHTML = `<p>Error: ${error.message}</p>`;
}
}
loadBurns();
</script>
</body>
</html>