> ## Documentation Index
> Fetch the complete documentation index at: https://www.helius.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch Pump.fun Token Mints with Parsed Events

> Page through an address's history with Parsed Events and extract Pump.fun's create and create_v2 instructions, logging every token mint with its creator, name, symbol, and URI.

This guide fetches **every token a wallet has deployed on Pump.fun**. It pages through the wallet's parsed history and picks out the two instructions Pump.fun uses to launch a token, until the history is exhausted.

It is the historical counterpart to the Parsed Streams guide [Track Pump.fun Mints](/docs/parsed-streams/guides/track-pumpfun-mints): the same program, the same instruction names, and the same decoded fields — fetched on demand instead of pushed in real time.

<Steps>
  <Step title="Look Up the Program">
    Pump.fun launches tokens through two instructions depending on version: `create` and `create_v2`. Parsed Events decodes instructions through the same IDL catalog Parsed Streams uses, so confirm the exact decoded names and account roles with its [`describeProgram`](/docs/parsed-streams/quickstart#discovery) method before matching on them:

    ```json Request theme={"system"}
    { "jsonrpc": "2.0", "id": 1, "method": "describeProgram", "params": [{ "program": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" }] }
    ```

    Check the response's `instructions` list for `create` and `create_v2`, and its `roles` list for the account you want — typically the new **mint** address, and either a `creator` account role or a `creator` field in `args`. The two instruction versions don't necessarily share a shape, which is why the code below checks both an arg and a couple of role names rather than assuming one.
  </Step>

  <Step title="Build the Request">
    Fetch the creator wallet's history page by page:

    ```json theme={"system"}
    {
      "address": "<CREATOR_WALLET>",
      "limit": 100,
      "sortOrder": "desc",
      "commitment": "confirmed"
    }
    ```

    Three differences from the streaming filter are worth knowing up front:

    * `address` is always required — program-wide scans are not supported, so you fetch one wallet's deploys, not every deploy on Pump.fun. For the firehose, use [Parsed Streams](/docs/parsed-streams/guides/track-pumpfun-mints).
    * The request has no server-side instruction filter. History returns everything the address touched, and you pick out the Pump.fun instructions client-side in the next step.
    * There is no `includeFailed` switch. History returns successful and failed transactions alike, so check `parsed.transactionStatus` client-side — a failed deploy never produces a live mint.
  </Step>

  <Step title="Page Through History">
    Each result carries **every** instruction of the transaction. Scan `parsed.instructions` for the `create`/`create_v2` hits, and keep passing `paginationToken` back until it disappears:

    ```javascript pumpfun-mint-history.js theme={"system"}
    const API_KEY = process.env.HELIUS_API_KEY;

    if (!API_KEY) {
      console.error("Missing HELIUS_API_KEY.");
      process.exit(1);
    }

    const URL = `https://<ENDPOINT>/transaction-history?api-key=${API_KEY}`;
    const PUMP_PROGRAM = "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P";
    const CREATE_INSTRUCTIONS = ["create", "create_v2"];
    const CREATOR = process.argv[2];

    if (!CREATOR) {
      console.error("Usage: node pumpfun-mint-history.js <CREATOR_WALLET>");
      process.exit(1);
    }

    async function fetchPage(paginationToken) {
      const body = {
        address: CREATOR,
        limit: 100,
        sortOrder: "desc",
        commitment: "confirmed",
      };
      if (paginationToken) body.paginationToken = paginationToken;

      const response = await fetch(URL, {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify(body),
      });
      if (!response.ok) {
        throw new Error(`HTTP ${response.status}: ${await response.text()}`);
      }
      return response.json();
    }

    async function main() {
      let paginationToken;
      let deployCount = 0;

      do {
        const page = await fetchPage(paginationToken);

        for (const result of page.data) {
          if (result.parserStatus !== "OK") continue;
          // Failed deploys never produce a live mint.
          if (result.parsed.transactionStatus !== "OK") continue;

          for (const ix of result.parsed.instructions) {
            if (ix.programId !== PUMP_PROGRAM) continue;
            if (!CREATE_INSTRUCTIONS.includes(ix.instructionName)) continue;
            deployCount += 1;
            handleDeploy(result, ix, deployCount);
          }
        }

        paginationToken = page.paginationToken;
      } while (paginationToken);

      console.log(`${deployCount} pump deploys found for ${CREATOR}`);
    }

    main();
    ```
  </Step>

  <Step title="Extract Each Deploy">
    Pull the mint, creator, and metadata out of the decoded instruction, exactly as the streaming listener does:

    ```javascript theme={"system"}
    // Pull an account pubkey out of a decoded instruction by its role name.
    function accountByRole(decoded, role) {
      return decoded?.accounts?.find((a) => a.name === role)?.pubkey ?? null;
    }

    function handleDeploy(result, ix, deployCount) {
      const args = ix.decoded?.args ?? {};
      const mint = accountByRole(ix.decoded, "mint");
      const creator =
        args.creator ??
        accountByRole(ix.decoded, "creator") ??
        accountByRole(ix.decoded, "user");

      console.log(`pump deploy #${deployCount} (${ix.instructionName})`);
      console.log(`    mint:    ${mint}`);
      console.log(`    creator: ${creator}`);
      console.log(`    name:    ${args.name ?? "?"}`);
      console.log(`    symbol:  ${args.symbol ?? "?"}`);
      console.log(`    uri:     ${args.uri ?? "?"}`);
      console.log(`    slot=${result.parsed.slot} sig=${result.signature}`);
    }
    ```

    Check `ix.decoded` is present before trusting `args` and `accounts` — an unrecognized build of the Pump.fun program would otherwise show up as `mint: null`, with only `rawData` and `rawAccounts` to work from.
  </Step>
</Steps>

## Next Steps

<CardGroup cols={2}>
  <Card title="Track Pump.fun Mints" icon="rocket" href="/docs/parsed-streams/guides/track-pumpfun-mints">
    The real-time version: a reconnect-safe listener that logs every new deploy as it lands.
  </Card>
</CardGroup>
