Lens
Last updated
The Lens Protocol is a decentralized social graph built on the Polygon blockchain that is modular and composable. The modularity of the protocol is central to its design, making it one of the most competitive social graph protocols in the web3 ecosystem. Developers can obtain information about other modules and relationships bound to Lens protocol modules by querying the protocol, and reverse resolution is also supported.
In order to retrieve data related to Lens, such as assets and relationship data, via an EOA address, it is necessary to first locate the associated profileId by retrieving basic information about Lens using the address. The profileId serves as the key to query Lens-related data. Here is a sample code to illustrate this process.
The Lens follow relationship is established through the EOA address and profileId of the users involved. This relationship represents the connection between a follower and the user they are following. For instance, if user A is following user B, the actual EOA address of user A will be bound to user B's profileId. To determine which Lens users are being followed by user A, it is necessary to query their EOA addresses. Here is a sample code that demonstrates this query process.
To retrieve information about followers on a Lens account, it is necessary to conduct a query based on the Lens profileId or handle. This query will ultimately yield the EOA addresses of the followers associated with the account. Below is a sample code demonstrating the query process.
The Lens pub of a given Lens account houses all of the NFT data associated with that account. To query the Lens pub, it is necessary to use either the Lens profileId or handle as a basis for the query. Below is a sample code demonstrating how to conduct this query.
To quickly access specific information about a pub, it is possible to conduct a query using both the Lens profileId and pubId. This query will ultimately provide a complete export of all information associated with the Lens pub. Below is a sample code demonstrating how to conduct this query.