Skip to content

encodeTransferOwnership

encodeTransferOwnership is a static class method on the LightSmartContractAccount which generates the call data necessary to send a UserOperation calling transferOwnership on the connected smart contract account.

Usage

example.ts
import { smartAccountClient } from "./smartAccountClient";

// encode transfer ownership
const newOwner = LocalAccountSigner.mnemonicToAccountSigner(NEW_OWNER_MNEMONIC);
const encodedTransferOwnershipData =
  smartAccountClient.account.encodeTransferOwnership({ newOwner });

Returns

Promise<Hex>

A Promise containing the encoded Hex of thetransferOwnership function call with the given parameter

Parameters

newOwner: <Address> -- the new owner to transfer ownership to for the smart account