• Retrieves the owner of an NFT by its token mint address.

    Parameters

    • nftAddress: string

      The mint address of the NFT.

    • endpoint: string

      The Solana network endpoint to connect to.

    Returns Promise<string>

    • A promise that resolves with the owner's address.

    Throws

    • Throws an error if unable to fetch the NFT metadata or owner.

    Example

    const run = async () => {
    const nftMintAddress = 'Fg6...sdf';
    const solanaEndpoint = 'https://api.mainnet-beta.solana.com';
    try {
    const result = await getNftOwnerByTokenMint(nftMintAddress, solanaEndpoint);
    console.log('NFT Owner:', result);
    } catch (error) {
    console.error('Error:', error);
    }
    }

    run();

Generated using TypeDoc