Skip to main content
This API is experimental and may change in a future release.
The session must be a resolved Session (the return value of toSession(...)). Re-resolving it here would drop the explicit permissions — a Session only carries the derived actions, not the original SessionDefinition.permissions — which makes the on-chain digest computed by SmartSessionLens.getAndVerifyDigest diverge from the one signed in getSessionDetails, causing the emissary to reject the enable.

Import

import { experimental_enableSession } from '@rhinestone/sdk/actions/smart-sessions'

Usage

const transaction = await account.prepareTransaction({
  chain,
  calls: [experimental_enableSession(session, enableSessionSignature, hashesAndChainIds, sessionToEnableIndex)],
})

Parameters

session
Session
required
resolved session to enable
enableSessionSignature
`0x${string}`
required
hashesAndChainIds
{ chainId: bigint; sessionDigest: `0x${string}` }[]
required
sessionToEnableIndex
number
required

Returns

call
LazyCallInput
Calls to enable the smart session