transferLightAccountOwnership

1function transferLightAccountOwnership<TTransport, TChain, TSigner, TAccount>(
2 client,
3 args,
4): 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.

Example

1import {
2 transferOwnership,
3 createLightAccountClient,
4} from "@account-kit/smart-contracts";
5
6const lightAccountClient = createLightAccountClient({
7 signer,
8 transport,
9 chain,
10});
11
12const txHash = await transferOwnership(lightAccountClient, {
13 newOwner: newOwnerSigner,
14 waitForTxn: true, // set to false to return a uoHash instead
15});

Type Parameters

Type ParameterDefault type

TTransport extends Transport

Transport

TChain extends undefined | Chain

undefined | Chain

TSigner extends SmartAccountSigner<any>

SmartAccountSigner<any>

TAccount extends any

any

Parameters

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

Returns

Promise<`0x${string}`>

The transaction or UO hash as a Hex string