Fetch profile action history.
⚠️ Requires authenticated LensClient.
Request object for the query
Profile action history item wrapped in PaginatedResult
const result = await client.profile.actionHistory();
Add interests to a profile.
⚠️ Requires authenticated LensClient.
Request object for the mutation
PromiseResult with void
import { ProfileInterestTypes } from '@lens-protocol/client';
await client.profile.addInterests({
interests: [ProfileInterestTypes.Technology],
});
Block a profile using Profile Manager. Profile has to have a Profile Manager enabled.
⚠️ Requires authenticated LensClient.
Request object for the mutation
PromiseResult with RelaySuccessFragment or LensProfileManagerRelayErrorFragment
const result = await client.profile.block({
profiles: ['0x01'],
});
Create typed data for blocking a profile.
Typed data has to be signed by the profile's wallet and broadcasted with Transaction.broadcastOnchain.
⚠️ Requires authenticated LensClient.
Request object for the mutation
Optional
options: TypedDataOptionsConfigure returned typed data
Typed data for requested transaction
const result = await client.profile.createBlockProfilesTypedData({
profiles: ['0x01'],
});
Create typed data for changing profile managers.
Typed data has to be signed by the profile's wallet and broadcasted with Transaction.broadcastOnchain.
⚠️ Requires authenticated LensClient.
Request object for the mutation
Optional
options: TypedDataOptionsConfigure returned typed data
Typed data for changing profile managers
const result = await client.profile.createChangeProfileManagersTypedData({
approveSignless: true,
});
Create typed data for following a profile.
Typed data has to be signed by the profile's wallet and broadcasted with Transaction.broadcastOnchain.
⚠️ Requires authenticated LensClient.
Request object for the mutation
Optional
options: TypedDataOptionsConfigure returned typed data
Typed data for requested transaction
const result = await client.profile.createFollowTypedData({
follow: [
{
profileId: '0x01',
},
],
});
Create typed data for linking a profile to a handle.
Typed data has to be signed by the profile's wallet and broadcasted with Transaction.broadcastOnchain.
⚠️ Requires authenticated LensClient.
Request object for the mutation
Optional
options: TypedDataOptionsConfigure returned typed data
Typed data for requested transaction
const result = await client.profile.createLinkHandleTypedData({
handle: 'my-handle',
});
Create typed data for setting a profile follow module.
Typed data has to be signed by the profile's wallet and broadcasted with Transaction.broadcastOnchain.
⚠️ Requires authenticated LensClient.
Request object for the mutation
Optional
options: TypedDataOptionsConfigure returned typed data
Typed data for setting a profile follow module
const result = await client.profile.createSetFollowModuleTypedData({
followModule: {
freeFollowModule: true,
},
});
Create typed data for setting the profile metadata.
Typed data has to be signed by the profile's wallet and broadcasted with Transaction.broadcastOnchain.
⚠️ Requires authenticated LensClient.
Request object for the mutation
Optional
options: TypedDataOptionsConfigure returned typed data
Typed data for setting the profile metadata
const result = await client.profile.createSetProfileMetadataTypedData({
metadataURI: 'ipfs://Qm...',
});
Create typed data for unblocking a profile.
Typed data has to be signed by the profile's wallet and broadcasted with Transaction.broadcastOnchain.
⚠️ Requires authenticated LensClient.
Request object for the mutation
Optional
options: TypedDataOptionsConfigure returned typed data
Typed data for requested transaction
const result = await client.profile.createUnblockProfilesTypedData({
profiles: ['0x01'],
});
Create typed data for unfollowing a profile.
Typed data has to be signed by the profile's wallet and broadcasted with Transaction.broadcastOnchain.
⚠️ Requires authenticated LensClient.
Request object for the mutation
Optional
options: TypedDataOptionsConfigure returned typed data
Typed data for requested transaction
const result = await client.profile.createUnfollowTypedData({
unfollow: ['0x01'],
});
Create typed data for unlinking a profile from a handle.
Typed data has to be signed by the profile's wallet and broadcasted with Transaction.broadcastOnchain.
⚠️ Requires authenticated LensClient.
Request object for the mutation
Optional
options: TypedDataOptionsConfigure returned typed data
Typed data for requested transaction
const result = await client.profile.createUnlinkHandleTypedData({
handle: 'my-handle',
});
Dismiss profiles from the recommended list.
⚠️ Requires authenticated LensClient.
Request object for the mutation
PromiseResult with void
const result = await client.profile.dismissRecommended({
dismiss: ['0x01', '0x02', '0x03'],
});
Fetch a single profile.
Request object for the query
Optional
options: FetchProfileOptionsAdditional options for the query
Profile or null if not found
const result = await client.profile.fetch({
forProfileId: '0x01',
});
Fetch all profiles by requested criteria.
Request object for the query
Optional
options: FetchProfileOptionsAdditional options for the query
Profiles wrapped in PaginatedResult
const result = await client.profile.fetchAll({
where: {
ownedBy: ['0xe3D871d389BF78c091E29deCe83200E9d6B2B0C2'],
},
});
Fetch the default profile for a given address. If no default is explicitly set, it returns the oldest profile owned by the address.
Request object for the query
Profile or null if not found
const result = await client.profile.fetchDefault({
for: '0x1234567890123456789012345678901234567890',
});
Follow a profile using Profile Manager. Profile has to have a Profile Manager enabled.
⚠️ Requires authenticated LensClient.
Request object for the mutation
PromiseResult with RelaySuccessFragment or LensProfileManagerRelayErrorFragment
const result = await client.profile.follow({
follow: [
{
profileId: '0x01',
},
],
});
Check follow status between multiple profiles.
Request object for the query
follow status bulk result
const result = await client.profile.followStatusBulk({
followInfos: [
{
follower: '0x06', // is 0x06 following 0x38?
profileId: '0x38',
},
{
follower: '0x38', // is 0x38 following 0x06?
profileId: '0x06',
},
],
});
Fetch profiles that follow a requested profile.
Request object for the query
Profiles wrapped in PaginatedResult
const result = await client.profile.followers({
of: '0x01',
});
Fetch profiles that are followed by a requested profile.
Request object for the query
Profiles wrapped in PaginatedResult
const result = await client.profile.following({
for: '0x01',
});
Link a profile to a handle using Profile Manager. Profile has to have a Profile Manager enabled.
⚠️ Requires authenticated LensClient.
Request object for the mutation
PromiseResult with RelaySuccessFragment or LensProfileManagerRelayErrorFragment
const result = await client.profile.linkHandle({
handle: 'my-handle',
});
Fetch addresses of profile managers.
Request object for the query
Profile managers wrapped in PaginatedResult
const result = await client.profile.managers({
for: '0x01',
});
Fetch mutual followers between two profiles.
Request object for the query
Profiles wrapped in PaginatedResult
const result = await client.profile.mutualFollowers({
observer: '0x01',
viewing: '0x02',
});
Recommend a profile.
⚠️ Requires authenticated LensClient.
Request object for the mutation
PromiseResult with void
const result = await client.profile.recommend({
profileId: '0x01',
});
Fetch recommended profiles.
Request object for the query
Array of recommended profiles wrapped in PaginatedResult
const result = await client.profile.recommendations({
for: '0x01',
});
Remove interests from a profile.
⚠️ Requires authenticated LensClient.
Request object for the mutation
PromiseResult with void
import { ProfileInterestTypes } from '@lens-protocol/client';
await client.profile.removeInterests({
interests: [ProfileInterestTypes.Technology],
});
Report a profile with a reason
⚠️ Requires authenticated LensClient.
Request object for the mutation
PromiseResult with void
import { ProfileReportingReason, ProfileReportingSpamSubreason } from '@lens-protocol/client';
await client.profile.report({
for: '0x014e',
reason: {
spamReason: {
reason: ProfileReportingReason.Spam,
subreason: ProfileReportingSpamSubreason.Repetitive,
},
},
additionalComments: 'Human readable comments, if any.',
});
Set default profile for authenticated address.
⚠️ Requires authenticated LensClient.
Request object for the mutation
PromiseResult with void
const result = await client.profile.setDefault({
profileId: '0x123',
});
Set profile follow module using Profile Manager. Profile has to have a Profile Manager enabled.
⚠️ Requires authenticated LensClient.
Request object for the mutation
PromiseResult with RelaySuccessFragment or LensProfileManagerRelayErrorFragment
const result = await client.profile.setFollowModule({
followModule: {
freeFollowModule: true,
},
});
Set profile metadata using Profile Manager. Profile has to have a Profile Manager enabled.
⚠️ Requires authenticated LensClient.
Request object for the mutation
PromiseResult with RelaySuccessFragment or LensProfileManagerRelayErrorFragment
const result = await client.profile.setProfileMetadata({
metadataURI: 'ipfs://Qm...',
});
Unblock a profile using Profile Manager. Profile has to have a Profile Manager enabled.
⚠️ Requires authenticated LensClient.
Request object for the mutation
PromiseResult with RelaySuccessFragment or LensProfileManagerRelayErrorFragment
const result = await client.profile.unblock({
profiles: ['0x01'],
});
Unfollow a profile using Profile Manager. Profile has to have a Profile Manager enabled.
⚠️ Requires authenticated LensClient.
Request object for the mutation
PromiseResult with RelaySuccessFragment or LensProfileManagerRelayErrorFragment
const result = await client.profile.unfollow({
unfollow: ['0x01'],
});
Unlink a profile from a handle using Profile Manager. Profile has to have a Profile Manager enabled.
⚠️ Requires authenticated LensClient.
Request object for the mutation
PromiseResult with RelaySuccessFragment or LensProfileManagerRelayErrorFragment
const result = await client.profile.unlinkHandle({
handle: 'my-handle',
});
Remove a recommendation from a previously recommended profile.
⚠️ Requires authenticated LensClient.
Request object for the mutation
PromiseResult with void
const result = await client.profile.unrecommend({
profileId: '0x01',
});
Fetch profiles that acted on a publication.
Request object for the query
Profiles wrapped in PaginatedResult
const result = await client.profile.whoActedOnPublication({
on: '0x0635-0x0f',
});
Fetch profiles that the authenticated profile has blocked.
⚠️ Requires authenticated LensClient.
Request object for the query
Profiles wrapped in PaginatedResult
const result = await client.profile.whoHaveBeenBlocked();
Profiles are the accounts that create publications and are owned by wallets