aeither/solana-explorer-tutorial

Transaction type?

Opened this issue · 2 comments

How transaction type can be checked ?
e.g. there are different types of transactions (Transfer , Nft sale, Nft Buy , List etc)

You can check in the instructions.

Get the details with Connection(url).getParsedConfirmedTransaction(signature)
https://github.com/solana-labs/explorer/blob/93b2b6388dff04e281fa70868b42d116d2a2b834/src/providers/transactions/parsed.tsx#L58-L60

Then switch the program to check the type. data.transaction.innerInstructions[].program
https://github.com/solana-labs/explorer/blob/93b2b6388dff04e281fa70868b42d116d2a2b834/src/components/transaction/InstructionsSection.tsx#L169-L189

Cool. Thanks for the response.

"getParsedConfirmedTransaction" is not reliable to identify the transaction types.
Example: Let's suppose I am getting trx details of a marketplace, "program" will provide us the Market program address but not the transaction type.
As there are multiple types of transactions done using single program address like Bidding, Sale, Put for sale, Cancel Sale etc.

Cheers!