Tracks ownership of Solana Mobile Seeker Genesis NFTs on the Solana blockchain.
page (default 1), limit (default 20, max 100).Drop this function into your TypeScript app to check if a wallet holds a Seeker Genesis NFT.
import { type Address, assertIsAddress } from "@solana/kit";
const SEEKER_GENESIS_API = "https://seeker-genesis.colmena.dev";
interface SeekerGenesisMint {
ata: string;
blockTime: number;
epoch: number;
mint: string;
signature: string;
slot: string;
}
type SeekerGenesisResult =
| { isHolder: true; mint: SeekerGenesisMint }
| { isHolder: false; mint: null };
async function checkSeekerGenesisHolder(
address: Address | string,
): Promise<SeekerGenesisResult> {
assertIsAddress(address);
const response = await fetch(
`${SEEKER_GENESIS_API}/api/holders/${address}`,
).catch((error) => {
throw new Error(
`Failed to connect to Seeker Genesis API: ${error}`,
);
});
if (response.status === 404) {
return { isHolder: false, mint: null };
}
if (!response.ok) {
throw new Error(
`API error: ${response.status} ${response.statusText}`,
);
}
const { mints } = (await response.json()) as { mints: SeekerGenesisMint[] };
return mints[0]
? { isHolder: true, mint: mints[0] }
: { isHolder: false, mint: null };
}