addSessionKey
Adds session key permissions for a specified address.
import { addSessionKey } from "thirdweb/extensions/erc4337";import { sendTransaction } from "thirdweb"; const transaction = addSessionKey({ contract, account, sessionKeyAddress, permissions: { approvedTargets: ["0x..."], nativeTokenLimitPerTransaction: 0.1, // in ETH permissionStartTimestamp: new Date(), permissionEndTimestamp: new Date( Date.now() + 1000 * 60 * 60 * 24 * 365, ), // 1 year from now },}); await sendTransaction({ transaction, account });
function addSessionKey(
The options for the removeSessionKey function.
any, AbiFunction,>;
The transaction object to be sent.