Type of the modular smart account, extending ModularSmartAccount or undefined.
The client used to interact with the blockchain.
Parameters including the smart account, required session specific policies info, and optional gas settings.
A promise that resolves to an object containing the user operation hash and an array of permission IDs.
If the account is not found.
If there's an error getting the enable sessions action.
import { grantPermission } from '@biconomy/abstractjs'
const result = await grantPermission(nexusClient, {
sessionRequestedInfo: [
{
sessionKeyData: '0x...',
actionPoliciesInfo: [
{
contractAddress: '0x...',
functionSelector: '0x...',
rules: [...],
valueLimit: 1000000000000000000n
}
],
sessionValidUntil: 1234567890
}
]
});
console.log(result.userOpHash); // '0x...'
console.log(result.permissionIds); // ['0x...', '0x...']
sessionRequestedInfo
array.actionPoliciesInfo
provided.
Adds multiple sessions to the SmartSessionValidator module of a given smart account.
This function prepares and sends a user operation to create multiple sessions for the specified modular smart account. Each session can have its own policies and permissions.