I’m trying to obtain the transaction history of NFTs for a specific wallet address on Solana. I want to see both NFTs sent to my wallet and those transferred from my wallet to others.
I attempted to use the getSignaturesForAddress method from the @solana/web3.js library, but it does not seem to include NFT transfers. Here’s the code I used:
const connection = new Connection('https://api.devnet.solana.com');
const walletPublicKey = new PublicKey('your-wallet-address');
const transactionSignatures = await connection.getSignaturesForAddress(walletPublicKey);
Unfortunately, this doesn’t provide the comprehensive NFT transaction history I’m looking for, similar to what’s available in Solana explorers. Is there any specific API or alternative method to fetch this NFT transfer data?
yeah getParsedTransaction works but it’s slow with lots of transactions. i’d use Helius API instead - they’ve got an nft transfer endpoint that beats parsing everything manually. just filter by token program and check the transfer instructions in their parsed data.
Interesting question! I’ve been dealing with similar stuff lately and it’s pretty tricky.
You’re getting signatures but not the actual NFT transfer details, right? That makes sense - getSignaturesForAddress only returns transaction signatures, not what actually happened in those transactions.
Have you tried parsing the transaction data from those signatures? Take each signature and call getTransaction or getParsedTransaction on it. That should show you what tokens actually moved.
Are you looking specifically for SPL token transfers (since NFTs on Solana are SPL tokens) or other NFT operations too? The approach changes depending on what you want to track.
You might want to check out indexing services like Helius or QuickNode. They have better APIs for historical data parsing and could save you a lot of work.
What timeframe are you looking at? Recent transactions or historical data? That’ll affect which approach works best.
Your getSignaturesForAddress approach is solid for the first step, but you’ll need to combine it with transaction parsing to grab NFT-specific data. I’ve found the Metaplex API works great alongside what you’re already doing - it’s built for NFT metadata and transfer tracking. Once you’ve got your transaction signatures, use Metaplex’s Digital Asset Standard API to query NFT transfers for your wallet. The DAS API has endpoints that filter out regular token transfers and focus just on NFTs. You could also try RPC providers like Alchemy or Ankr - they’ve got enhanced Solana APIs with built-in NFT transaction filtering. Their getNFTsForOwner and getAssetTransfers methods do the heavy lifting of parsing transaction data for NFT operations. I’ve had good luck with this hybrid approach - keep your existing signature fetching code but add specialized NFT APIs for the actual transfer details.