Account Managers
This guide explains how to delegate social activities to an Account Manager.
An Account Manager is an EVM address authorized to sign social operations on behalf of an Account.
This allows the Account owner to maintain control while delegating the execution of social operations to one or more Account Managers.
Security Considerations
An Account Manager can sign most Account operations, except for those that, for security reasons, require the Account owner's signature.
The Tiered Transaction Model described in the Transaction Lifecycle guide specifies that Social Operations will fall back to a signed execution mode if the operation specifics require it.
For example, free collects can be signless, while paid collects will require a user signature.
Updating Account Managers is considered a sensitive operation and thus always requires the Account owner's signature. For this reason, all mutations involving Account Managers are Restricted Operations.
Add Account Managers
You MUST be authenticated as Account Owner to make this request.
- TypeScript
- GraphQL
- React
Use the addAccountManager action to add an Account Manager to the logged-in Account.
- TypeScript
- GraphQL
- React
Then, handle the result using the adapter for the library of your choice:
See the Transaction Lifecycle guide for more information on how to determine the status of the transaction.
Remove Account managers
You MUST be authenticated as Account Owner to make this request.
- TypeScript
- GraphQL
- React
Use the removeAccountManager action to remove an Account Manager from the logged-in Account.
Remove Account Manager
import { evmAddress } from "@lens-protocol/client";import { removeAccountManager } from "@lens-protocol/client/actions";
const result = await removeAccountManager(sessionClient, { manager: evmAddress("0x1234…"),});
- TypeScript
- GraphQL
- React
Then, handle the result using the adapter for the library of your choice:
See the Transaction Lifecycle guide for more information on how to determine the status of the transaction.
Update Account Manager Permissions
You MUST be authenticated as Account Owner to make this request.
- TypeScript
- GraphQL
- React
Use the updateAccountManager action to update an Account Manager's permissions.
Example
import { evmAddress } from "@lens-protocol/client";import { updateAccountManager } from "@lens-protocol/client/actions";
const result = await updateAccountManager(sessionClient, { manager: evmAddress("0x1234…"), permissions: { canExecuteTransactions: true, canTransferTokens: false, canTransferNative: false, canSetMetadataUri: true, },});
- TypeScript
- GraphQL
- React
Then, handle the result using the adapter for the library of your choice:
See the Transaction Lifecycle guide for more information on how to determine the status of the transaction.
Signless Experience
By leveraging the Account Manager feature, you can enable a signless experience for social interactions through the Lens API.
You MUST be authenticated as Account Owner to make this request.
- TypeScript
- GraphQL
- React
Use the enableSignless action to set up the Lens API as Account Manager for the logged-in Account.
import { enableSignless } from "@lens-protocol/client/actions";
const result = await enableSignless(sessionClient);
if (result.isErr()) { return console.error(result.error);}
const session = result.value;
Then, submit and monitor the transaction as explained in the Transaction Lifecycle guide.
Use the removeSignless action to remove the Lens API as Account Manager for the logged-in Account.
import { removeSignless } from "@lens-protocol/client/actions";
const result = await removeSignless(sessionClient);
if (result.isErr()) { return console.error(result.error);}
const session = result.value;
And submit and monitor the transaction as explained in the Transaction Lifecycle guide.
Account Managers Visibility
List Account Managers
- TypeScript
- GraphQL
- React
Use the paginated fetchAccountManagers action to list the Account Managers for the logged-in Account.
You MUST be authenticated as Account Owner or Account Manager to make this request.
See the Pagination guide for more information on how to handle paginated results.
Hide/Unhide an Account Managed
When a wallet manages multiple Accounts, users can hide some of them from the Available Accounts list to simplify the login experience on Lens Apps.
You MUST be authenticated as Account Manager or Account Owner to perform this operation.
- TypeScript
- GraphQL
- React
Use the hideManagedAccount action to hide an Account managed by your account. To undo this action, use the unhideManagedAccount action.
That's it—the Account Managed is now hidden from your list of Accounts Managed.