コンテンツにスキップ

revokeSessionKey

このコンテンツはまだ日本語訳がありません。

revokeSessionKey(params): Promise<RevokeSessionKeyResult>

Defined in: src/session/revoke.ts:138

Uninstalls a session-key permission validator from the agent’s smart account. After the returned UserOp lands, the session key can no longer authorise actions.

Parameters

params

RevokeSessionKeyParams

Returns

Promise<RevokeSessionKeyResult>

Throws

If sessionKeySigner.address does not match envelope.sessionKeyAddress.

Throws

If invalidateInFlightNonces is true (M4).

Example

import { signerToEcdsaValidator } from "@zerodev/ecdsa-validator";
import { createKernelAccount, createKernelAccountClient } from "@zerodev/sdk";
import { getEntryPoint, KERNEL_V3_1 } from "@zerodev/sdk/constants";
import { revokeSessionKey } from "kawasekit";
// Build a SUDO-ONLY kernel account for the owner — see param JSDoc.
const sudoValidator = await signerToEcdsaValidator(publicClient, {
signer: owner,
entryPoint: getEntryPoint("0.7"),
kernelVersion: KERNEL_V3_1,
});
const ownerSudoAccount = await createKernelAccount(publicClient, {
plugins: { sudo: sudoValidator },
entryPoint: getEntryPoint("0.7"),
kernelVersion: KERNEL_V3_1,
});
const ownerKernelClient = createKernelAccountClient({
account: ownerSudoAccount,
chain,
client: publicClient,
bundlerTransport,
paymaster,
});
await revokeSessionKey({
ownerKernelClient,
envelope,
sessionKeySigner,
policies: createJpycDailyLimitPolicies({ ... }),
});