Off the top of my head but should be close enough:
for (const inner of tx.meta.innerInstructions) { for (const i of inner.instructions) { if (i.parsed.type === "transfer") { const amount = i.parsed.info.amount const source = i.parsed.info.source const destination = i.parsed.info.destination const authority = i.parsed.info.authority } } }
for (const inner of tx.meta.innerInstructions) {
for (const i of inner.instructions) {
if (i.parsed.type === "transfer") {
const amount = i.parsed.info.amount
const source = i.parsed.info.source
const destination = i.parsed.info.destination
const authority = i.parsed.info.authority
}
}
}
you'll also have to handle "transferChecked" in addition to transfer (it has slightly different structure for the amount, it adds an object with the decimals and amount}