Hello guys,
I need the content of note field in json from a txn. Using this code as example:
algodClient.pendingTransactionInformation(txnContent)
.do()
.then(transaction => {
if (transaction) {
console.log('transaction found.');
console.log('detail txn:', transaction);
// read "note" inside txn
const note = algosdk.decodeObj(transaction.txn.tx.note);
console.log('note data:', note);
// On web page
const resultDiv = document.getElementById('result');
resultDiv.innerHTML = `
<p>Txn is present on blockchain.</p>
<p>detail txn:</p>
<pre>${JSON.stringify(transaction, null, 2)}</pre>
<p>Value of "note": ${note}</p>
but I receive this error :
Cannot read properties of undefined (reading ‘note’).
the note data is in JSON.
Thank’s in advance
Marco.
p.s. sorry, js isn’t my preferred language