0

I am currently working on a Shop based which accepts Solana as the form of currency, I want to know the details of last n transactions on my wallet. How can I do that?

2 Answers 2

1

Here are a few APIs that might help you

https://api.magiceden.dev/#ae26fcd6-cff6-496b-8fae-d93f6287711f (Magic Eden Only)

https://public-api.solscan.io/docs/#/Account/get_account_transactions

https://docs.solana.fm/v3-api-reference/account

1

To fetch last 'n' tx signatures and info about them:

from solana.rpc.api import Client, Pubkey
solana_client = Client("...")

res = solana_client.get_signatures_for_address(
    Pubkey.from_string('WALLET ADDRESS'),
    limit = 100 # Specify how much last transactions to fetch
)

The max limit is 1000, however you can fetch more signatures by passing the first transaction's signature as before argument.

To then get the parsed transaction:

solana_client.get_transaction(
    res.value[1].signature, 
    'jsonParsed', 
    max_supported_transaction_version=0
)

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.