Reputation: 1225
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
Upvotes: 0
Views: 683
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