Retrieving all printed editions from a Solana master NFT programmatically

I need help getting all printed editions that were created from a master NFT on Solana. The documentation mentions there’s a Program Derived Address that connects each edition back to its master, but I can’t figure out how to find this connection using the Solana/Metaplex SDK.

Right now I’m using a workaround where I fetch all transactions from the master NFT and look for edition creation events:

import {Metadata, Metaplex} from "@metaplex-foundation/js";
import {Connection, PublicKey} from "@solana/web3.js";

const RPC_ENDPOINT = 'https://...';
const PARENT_NFT_ADDRESS = '';

(async () => {
    const conn = new Connection(RPC_ENDPOINT);
    const mplex = new Metaplex(conn);

    // Get all transaction signatures
    const txSignatures = [];
    let lastSignature = undefined;
    
    while (true) {
        const results = await mplex.connection.getSignaturesForAddress(
            new PublicKey(PARENT_NFT_ADDRESS),
            { before: lastSignature },
            'confirmed'
        );
        
        if (!results.length) break;
        txSignatures.push(...results);
        lastSignature = results[results.length - 1].signature;
    }

    // Check each transaction for edition creation
    const editionMints = [];
    for (let idx = 0; idx < txSignatures.length; idx++) {
        const parsedTx = await mplex.connection.getParsedTransaction(txSignatures[idx].signature);
        
        if (parsedTx && JSON.stringify(parsedTx).includes('Mint New Edition from Master Edition')) {
            editionMints.push(parsedTx.transaction.message.accountKeys[1].pubkey.toString());
        }
    }
    
    console.log('Total editions found:', editionMints.length);
})();

This approach gets really slow when there are lots of transactions to process. Is there a better way to do this?

Note: I can’t use the first creator or update authority to filter since they’re shared across multiple collections.

Hmm, interesting - have you checked the edition marker accounts? Each master edition has marker accounts that track which edition numbers got minted.

You can derive the edition marker PDA from the master edition address and edition number. How many editions might exist for your master NFT? If it’s not too many, you could iterate through edition numbers and check if the accounts exist.

What RPC provider are you using? Some have better indexing for Metaplex accounts, which makes getProgramAccounts way faster. Worth trying a different provider to see if performance improves.

One more thing - are these limited or unlimited master editions? The account structure’s slightly different and might affect your queries.

The Metaplex SDK’s findAllByOwner method might work better here. I had success using getProgramAccounts with the token metadata program ID and filtering by master edition field. Way fewer RPC calls than parsing transactions, and it doesn’t timeout constantly.

You’re right - parsing transaction history is a pain for getting printed editions. Here’s a better approach: use the Metaplex metadata program’s account structure directly. Each edition NFT’s metadata account links straight to the master edition through a specific field. Try using getProgramAccounts with filters, targeting accounts where the collection field matches your master NFT. Even better, if your RPC provider has it, go with the Digital Asset Standard (DAS) API. You can use getAssetsByGroup with your master NFT’s mint address to grab all editions at once - way faster than parsing transactions and you get all the metadata you need.