livepeer / livepeer/video-nft

Implement Lens publication helpers

Open
#8 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
14
Forks
9
PR merge metrics
No merged PRs in 30d

Description

https://www.notion.so/livepeer/Lens-Integration-e756c036e6c741de97d8e9ef1c351e84#55aa2bb006f543559aaeb5f50dd64612

- Can be implemented as a separate module in the SDK if it makes sense, like `lens`. It will need to interact closely with the other existing `minter` module anyway, since that’s the (highest level) one with the current logic to upload an asset, process it, export to IPFS etc
- Expand for a suggestion for the minimum set of functions to be provided by the SDK:
* `videonft.lens.newPublicationMetadata(...?)`: Minimal function that receives input based on all the fields [described above](https://www.notion.so/Lens-Integration-e756c036e6c741de97d8e9ef1c351e84), and an existing asset.
- Returns the full publication metadata that should be sent on the `[exportToIpfs` function](https://livepeer.github.io/video-nft/classes/minter.Api.html#exportToIPFS) of the SDK. This means all fields but the fields that depend on the CID of the asset on IPFS, which can only be known during the export task (and should be filled by task-runner itself, given the templating task 4 above)
* `videonft.lens.publish(...?)`: Helper function similar to `[createNft](https://livepeer.github.io/video-nft/classes/minter.FullMinter.html#createNft)`, which receives a raw file and performs the E2E flow for creating an NFT in the Lens publication format (calls the function above as well).
- This can be used to get started quickly, but likely won’t be the one used in a final application since it can take a long time to do the whole process. A final application might prefer to call the functions individually instead and show some feedback to the user about the process.
- An alternative is for this to have a callback to report progress and then it can be used on final applications also showing some feedback to the user.
* `videonft.lens.playbackUrl(publication)`: Takes an existing publication and returns the playback URL for the corresponding asset. This could have an order of preference like: playback URL from a `playbackId` if present, otherwise the video URL from the `content` or `attributes`, otherwise just use the `animation_url` or even the `external_url`.
* `videonft.lens.playerUrl(publication)`: Takes an existing publication and returns the URL for the embeddable player. Can have a similar fallback mechanism like the `playbackUrl` above, and return a [lvpr.tv](http://lvpr.tv) URL for the up-to-date and optimized experience. SDK consumers can use this to easily create an `iframe` with a player for a given publication.

## Definitions of Done

1. Can build a Lens-based application with a single function call to do the full e2e creation of a lens publication (without thumbnails)
2. Can provide a thumbnail (`image`) if you want, but need to handle exporting it to IPFS yourself and only send an `ipfs://` URL and MIME type to the SDK.
3. Can call lower-level functions to control the flow of creating the publication, providing some feedback to the user in the process.
4. Can easily take a Lens publication and determine if it is a video from Livepeer
5. Can easily take a Lens video publication and display a video player for the contents on it
6. Can query for the created publications using the Lens API
7. SDK interacts well with Lens SDK

## Dependencies
- livepeer/task-runner#33
- livepeer/player#2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing `minter` module, especially `exportToIPFS` and `createNft`, and read the linked Lens Integration specification for the publication fields and fallback behavior. Check the task-runner#33 and player#2 dependencies; done means the documented publication, playback, player, query, and Lens SDK flows are supported, including both high- and low-level APIs.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.