createWalletAdapter

Creates a wallet from the given account.

You can use this to:

  • convert a third party library wallet (wagmi, viem, ethers) into a thirdweb wallet.

  • connect with a private key (for automated tests)

Available wallet adatpers:

Example

import { createWalletAdapter } from "thirdweb";
const wallet = createWalletAdapter({
client,
adaptedAccount,
chain,
onDisconnect: () => {
// disconnect logic
},
switchChain: async (chain) => {
// switch chain logic
},
});

Parameters

Returns

a wallet instance.