Function getNftsByWalletAddressAndCollectionMint

  • Retrieves the NFTs owned by a specific wallet address that belong to a specified collection.

    Parameters

    • endpoint: string

      The Solana network endpoint to connect to.

    • userWalletAddress: string

      The wallet address of the user.

    • collectionAddress: string

      The address of the NFT collection.

    Returns Promise<string[]>

    • A promise that resolves with an array of NFT mint addresses.

    Throws

    • Throws an error if unable to fetch NFTs for the given address and collection.

    Example

    const run = async () => {
    const solanaEndpoint = 'https://api.mainnet-beta.solana.com';
    const walletAddress = 'YourWalletAddressHere';
    const collectionMintAddress = 'CollectionMintAddressHere';

    try {
    const nftAddresses = await getNftsByWalletAddressAndCollectionMint(
    solanaEndpoint,
    walletAddress,
    collectionMintAddress
    );
    console.log('NFT Addresses in Collection:', nftAddresses);
    } catch (error) {
    console.error('Error:', error);
    }
    }

    run();

Generated using TypeDoc