grantPermissions
Grants permissions to a smart account by creating a session. This allows another key to perform operations on behalf of the account.
Import
Usage
Parameters
client
InnerWalletApiClient
- The wallet API client to use for the request
signer
SmartAccountSigner
- The signer of the smart account
params
GrantPermissionsParams
- The parameters for granting permissions
params.account
Address
- The account address (required if client was not initialized with an account)
params.expirySec
number
- Unix timestamp when the permissions expire
params.key
sessionKeyData
- The session key information
params.key.publicKey
string
- The public key of the session key
params.key.type
string
- The type of the key (e.g., “secp256k1”)
params.permissions
Array
- Array of permission objects defining what the session key can do
Returns
Promise<GrantPermissionsResult>
A Promise that resolves to the result containing a context identifier