transferLightAccountOwnership

1const transferLightAccountOwnership: <TTransport, TChain, TSigner, TAccount>(
2 client,
3 args,
4) => Promise<Hex>;

Defined in: account-kit/smart-contracts/dist/types/src/light-account/actions/transferOwnership.d.ts:33

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 Chain | undefined

Chain | undefined

TSigner extends SmartAccountSigner

SmartAccountSigner

TAccount extends LightAccount<TSigner> | undefined

LightAccount<TSigner> | undefined

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<Hex>

The transaction or UO hash as a Hex string