3

I use solana network. I sent compressed nft to other wallet. How to get new owner and old owner of compressed nft from transaction? And how to detect that is burn or transfer transaction

Sent transaction: https://solscan.io/tx/5z4RQU5LQpAU2eoVjyqtGhEmqFgLHowzT4SxXgBjLcTZ1xp5V94rrwMr4RgBF1GMbxAy6ssdwwDHp3TcHwnp3E6y

Receive transaction https://solscan.io/tx/2qVNc9F7i9fDECYoU9JikFoGf7KEtx9qcB2SHW32PgxfoDYDZXg9iaBxDBAvPeAJF3Q8Jh3hi8tbgYxqANFoRadS

Burn transaction https://solscan.io/tx/55pNGwDim2E6BPyhDNcgaa8ecQD7R1kaDvfMU9hLaJiUQ2sNj5cFaG65ZPtQkL5hqBE2ox85PprByoxHwkejiS88

Buy cNFT https://solscan.io/tx/4Ub2U5qnVmWP15HFU8ByFVQWVfs9WRqBfc2yP2z7GDzXifpbb1yGSTXPgGVxuEayz5yfQpT1BG3wRunYHoR55dCN

2
  • 1
    Could you share the tx link? Commented Jul 10, 2023 at 17:15
  • Links shared in question
    – Oksana
    Commented Jul 11, 2023 at 14:24

1 Answer 1

3

Compression uses the bubblegum program. Bubblegum uses anchor. You’ll need to decode the transaction using the bubblegum IDL, then pick the accounts matching the old leaf owner and new leaf owner.

If you view on explorer.Solana.com you can see these accounts.

3
  • Can u share some codes? I tried to deserialize data using Bubblegum instruction using burnStruct.deserialize(...) and transferStruct.deserialize(..) but all returns result for transfer instruction without any errors and I cannot detect that was transfer or burn instruction for example.
    – Oksana
    Commented Jul 14, 2023 at 8:23
  • 1
    Metaplex tends to generate idls with this thing called Solita. I don't like it. What I'd do is just use Anchor's Program.fetchIdl(program_id). Get the json. Find the instruction in the json. Find the index of the accounts you're looking for in that json, and then map it to the index of the accounts in the ix. Some similar logic here github.com/helium/helium-program-library/blob/ef2294b/packages/…
    – Noah
    Commented Jul 14, 2023 at 20:04
  • But how to detect that is burn instruction or transfer before?
    – Oksana
    Commented Jul 17, 2023 at 7:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.