-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
31 lines (25 loc) · 1013 Bytes
/
index.js
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
$(document).ready(() => {
$('#btn').click(() => {
$("#load").show();
const baseServer = "https://testnet-algorand.api.purestake.io/ps1";
const port = "";
const token = {
'X-API-Key': "af4Dyq6Pxb8c7I0ddWt*********************"
}
const accountAddress = "45XFY4M7WPC6BBHTJBIA2HHPPWVP2*****************************";
const algodclient = new algosdk.Algod(token, baseServer, port);
let transactionId = $('input').val();
(async () => {
let tx = (await algodclient.transactionInformation(accountAddress, transactionId));
let decodeJson = algosdk.decodeObj(tx.note);
console.log(decodeJson);
const obj = JSON.parse(decodeJson);
console.log(obj);
$('canvas[data-type="linear-gauge"]').attr('data-value', decodeJson);
$("#block").show();
$("#load").hide();
})().catch(e => {
console.log(e);
});
})
});