Skip to content
Alchemy Logo

transferLightAccountOwnership

function transferLightAccountOwnership<TTransport, TChain, TSigner, TAccount>(
  client,
  args,
): Promise<`0x${string}`>;

Defined in: account-kit/smart-contracts/src/light-account/actions/transferOwnership.ts:51

Transfers the ownership of a light account to a new owner. This function ensures that the client is a compatible smart acccount client and that a Light Account is provided. If the waitForTxn parameter is true, it will wait for the transaction to be completed before returning.

import {
  transferOwnership,
  createLightAccountClient,
} from "@account-kit/smart-contracts";
 
const lightAccountClient = createLightAccountClient({
  signer,
  transport,
  chain,
});
 
const txHash = await transferOwnership(lightAccountClient, {
  newOwner: newOwnerSigner,
  waitForTxn: true, // set to false to return a uoHash instead
});

Type ParameterDefault type

TTransport extends Transport

Transport

TChain extends undefined | Chain

undefined | Chain

TSigner extends SmartAccountSigner<any>

SmartAccountSigner<any>

TAccount extends any

any

ParameterTypeDescription

client

Client<TTransport, TChain, TAccount>

The smart account client instance used to execute the transfer

args

TransferLightAccountOwnershipParams<TSigner, TAccount>

The parameters for transferring ownership

Promise<`0x${string}`>

The transaction or UO hash as a Hex string

Was this page helpful?