oijafoijf asnjksdjn
oijafoijf asnjksdjn

Reputation: 1225

solana - how to get nft transfer history by wallet address?

I want to get the history of someone sending NFTs to my wallet and from my wallet to another wallet. Is there any API ?

I tried using getSignaturesForAddress from @solana/web3.js, but the NFT Transfer does not remain.

like solana explorer's token history

https://explorer.solana.com/address/Hhnij5YTq9oSE9EmXd8zM6L5CZboLpmmowRaeGtmm9b7/tokens?cluster=devnet

Upvotes: 0

Views: 683

Answers (1)

Ferhat Mousavi
Ferhat Mousavi

Reputation: 194

I am using python for getting NFTs

First call signatures = http_client.get_signatures_for_address(account) then call response = http_client.get_transaction(signature) for each signature from previous call. You will find below data in response:

metadata_id = response["result"]["transaction"]["message"]["instructions"][2]["accounts"][0]
metadata_address = response["result"]["transaction"]["message"]["accountKeys"][metadata_id]

last you can call response= http_client.get_account_info(metadata_address ) for getting metadata from response look at raw_metadata = response["result"]["value"]["data"][0] you need to base58 encode for getting your metadata from this value.

Upvotes: 0

Related Questions