The sudo policy grants unlimited permissions for specified contract addresses and function selectors. This is the most permissive policy and should be used with caution. It can be used when you need to grant complete access to specific contract functions, similar to admin privileges.
Security Consideration: This provides the highest level of access and should only be used when necessary and there is a good deal of trust in the session key grantee.
Copy
Ask AI
import { usersNexusClient } from "./client.ts";const createSessionsResponse = await usersNexusClient.grantPermission({ sessionRequestedInfo: [ { sessionPublicKey, // sessionValidUntil: number // sessionValidAfter: number // chainIds: bigint[] actionPoliciesInfo: [ { abi: CounterAbi, // Providing the full contract ABI will parse it to individual function selectors under the hood contractAddress: "0x...", sudo: true } ] } ]})