Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(solana): more generic transaction parsing #36

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

MartinZemanik
Copy link
Collaborator

Description

Parsing transaction token effects

Before, all Solana transaction token effects were parsed only based on Token transfer instructions - if there were no token transfer instructions directly in the tx, no token effects would be parsed.
Now, we also consider all inner instructions in the transaction. This way, we have a generic parser for token effects on all user's token accounts.

Unknown transactions

Before, if the transaction wasn't a direct token or SOL transfer, it would be interpreted as unknown.
Now, if a transaction contains some instruction in a 3rd party program, it is interpreted as contract transaction (as agreed on Slack).

Screenshots:

Swap USDC to USDT on Raydium (previously Unknown transaction with no token effects):
Screenshot 2025-01-14 at 13 01 16

Copy link
Collaborator

@gabrielKerekes gabrielKerekes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Seems to work well 🙂 @PeterBenc I don't think you need to review this too - if you want to, feel free to ofc, just let us know if we can create a PR to Trezor repo or if we should wait for your review 🙏

packages/blockchain-link-utils/src/solana.ts Outdated Show resolved Hide resolved
@MartinZemanik MartinZemanik force-pushed the solana-more-generic-transaction-parsing branch from 62e7d4b to aa3855e Compare January 23, 2025 09:50
@MartinZemanik MartinZemanik force-pushed the solana-more-generic-transaction-parsing branch from 5793531 to d5f5517 Compare January 23, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants