Query owned NFTs. Create and manage NFT galleries.

This module is not stable and may be removed in a future release

Methods

  • Experimental

    Fetch NFTs for authenticated profile or for provided request params.

    If you are using development enviroment you can only query chainIds 5 and 80002. If you are using production enviroment you can only query chainIds 1 and 137.

    Parameters

    Returns Promise<PaginatedResult<NftFragment>>

    NFTs wrapped in PaginatedResult This function is not stable and may be removed in a future release

    Example

    When authenticated

    const result = await client.nfts.fetch();
    

    Without authentication

    const result = await client.nfts.fetch({
    where {
    profileId: '0x01',
    }
    });
  • Experimental

    Update a NFT gallery items.

    ⚠️ Requires authenticated LensClient.

    If you are using development enviroment you can only query chainIds 5 and 80002. If you are using production enviroment you can only query chainIds 1 and 137.

    Parameters

    Returns PromiseResult<void, NotAuthenticatedError | CredentialsExpiredError>

    PromiseResult with void This function is not stable and may be removed in a future release

    Example

    const result = await client.nfts.updateGalleryItems({
    galleryId: '9aeb66b2-0d8f-4c33-951c-feedbb171148',
    toAdd: [
    {
    contract: {
    address: '0x1234123412341234123412341234123412341234', // an NFT that wallet owns
    chainId: 5,
    },
    tokenId: '1',
    },
    ],
    toRemove: [
    {
    contract: {
    address: '0x1234123412341234123412341234123412341234', // an NFT that wallet owns
    chainId: 5,
    },
    tokenId: '2',
    },
    ],
    });