lens-sdk: useCreatePost metadata don't have option for attributes

Is your feature request related to a problem? Please describe. Under the useCreatePost metadata don’t have option for attributes, image, imageMimeType.

Look at lens docs.

/**
   * These are the attributes for the item, which will show up on the OpenSea and others NFT trading websites on the 
  item.
   */
  attributes?: PublicationMetadataAttribute[] | undefined | null;

  /**
   * legacy to support OpenSea will store any NFT image here.
   */
  image?: Url | undefined | null;

  /**
   * This is the mime type of image. This is used if you uploading more advanced cover images
   * as sometimes IPFS does not emit the content header so this solves the pr
   */
  imageMimeType?: MimeType | undefined | null;

https://docs.lens.xyz/docs/metadata-standards#metadata-structure

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

It should be easy to add. Yeah, can you please open another issue so it’s easier for us to track?

I am going to ask you some questions about the use you make of name for non-collectable so it can inform the work we are doing with Lens v2 and Publication Metadata v3.

Hey @moesalih thank you for the full rationale. If it wasn’t clear in my previous message we are on the same page. attributes seems a nice thing to keep where apps can experiment… and we are keeping it… it’s part of Publication Metadata v3.

This is the Lens SDK change we are planning for next week: https://github.com/lens-protocol/lens-sdk/pull/460/files#diff-7fbb18c6ba1639bc64227d8762258ed6dcba53582a8108952d4325499224a90dR83-R103

@cesarenaldi these attributes are not only for collectible NFTs. These are very common and are being used for regular posts by many apps for many many different purposes, and they always get indexed and returned by the lens api, so the sdk should be on par.

Some examples of these attributes, just so you know the significance:

  • almost every music post on lens by any app has an author attribute to show the artist name, which is used everywhere in the ui.
  • lenstube requires the durationInSeconds attribute and image so those get added to every video post (lenster, orb, buttrfly, lenstube)
  • handle attribute is also common and is added to every post, it’s also required by lenstube.
  • quotedPublicationId is how quoted posts are implemented in all lens apps. it was started by me on buttrfly, but became popular enough to be a standard attribute now on all apps.
  • these are the standard ones, there are lots of non-standard attributes by different apps for non collectable purposes.

for buttrfly it’s a critical requirement to be able to post these attributes.

I’m curious, as a workaround, can we just add these attributes to the data in the upload callback of the useCreatePost hook? so that those attributes are added to the metadata before it’s uploaded?