Handle owners
You can easily add, remove or get all your wallet owners.
You can easily get/add/remove all the owners of your smart wallet.
The getEnrichedOwners method allows you to get more infos regarding your passkey owners (device information, creationDate...).
Add owners
const smartAccountClient = createSmartAccountClient({
account: smartAccount,
chain: arbitrumSepolia,
bundlerTransport: http(bundlerUrl),
paymaster: paymasterClient,
userOperation: {
estimateFeesPerGas: async () => {
return await paymasterClient.getUserOperationGasPrice();
},
}
})
const txHash = await smartAccountClient.addOwner({ownerToAdd: ADDRESS_TO_ADD});
Remove owners
const smartAccountClient = createSmartAccountClient({
account: smartAccount,
chain: arbitrumSepolia,
bundlerTransport: http(bundlerUrl),
paymaster: paymasterClient,
userOperation: {
estimateFeesPerGas: async () => {
return await paymasterClient.getUserOperationGasPrice();
},
}
})
const txHash = await smartAccountClient.removeOwner({ownerToRemove: ADDRESS_TO_REMOVE});
Get owners
const smartAccountClient = createSmartAccountClient({
account: smartAccount,
chain: arbitrumSepolia,
bundlerTransport: http(bundlerUrl),
paymaster: paymasterClient,
userOperation: {
estimateFeesPerGas: async () => {
return await paymasterClient.getUserOperationGasPrice();
},
}
})
// get all owners
const owners = smartAccountClient.getOwners()
// get owners with passkey details (creation date, device data...)
const owners = smartAccountClient.getEnrichedOwners()