example3.ts

Example 3: Query Top Holders of a Token

import { fetchTopHolders } from "../src/trade";

async function example3() {
  const tokenMint = "So11111111111111111111111111111111111111112";

  try {
    console.log("Fetching top holders...");
    const holders = await fetchTopHolders(tokenMint);
    console.log("Top holders for token:", holders);
  } catch (error) {
    console.error("Error fetching top holders:", error);
  }
}

example3();

Last updated