Handle wallet owners
You can easily add, remove or get all your wallet owners.
Add an owner
import { ComethWallet, ConnectAdaptor, SupportedNetworks, ComethProvider }
from "@cometh/connect-sdk";
const walletAdaptor = new ConnectAdaptor({
chainId: YOUR_CHAIN_ID,
apiKey,
passKeyName:YOUR_PASSKEY_NAME
});
const wallet = new ComethWallet({
authAdapter: walletAdaptor,
apiKey,
rpcUrl: RPC_URL
});
await wallet.connect(WALLET_ADDRESS)
const provider = new ComethProvider(instance);
const tx = await wallet.addOwner(NEW_OWNER_ADDRESS)
const txPending = await provider.getTransaction(tx.safeTxHash);
const txReceipt = await txPending.wait();
Remove an owner
const tx = await wallet.removeOwner(ADDRESS_TO_REMOVE)
const txPending = await provider.getTransaction(tx.safeTxHash);
const txReceipt = await txPending.wait();
Get Owners
const owners = await wallet.getOwners()
// owners = ["0xda677C8877E49Dfc31dC7e92fA7615F4Fb4047D7", ...]
Get Enriched Owners
const enrichedOwners = await wallet.getEnrichedOwners()
// owners = [{ address: "0xda677C8877E49Dfc31dC7e92fA7615F4Fb4047D7, deviceData: {browser:"Safari", os:"ios" }, ...]
Last updated