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:
Viem
Ethers 6
Ethers 5
import { createWalletAdapter } from "thirdweb"; const wallet = createWalletAdapter({ client, adaptedAccount, chain, onDisconnect: () => { // disconnect logic }, switchChain: async (chain) => { // switch chain logic },});
function createWalletAdapter( options: AdapterWalletOptions,): Wallet<"adapter">;
The options for the adapter wallet.
let options: { adaptedAccount: Account; chain: Chain; client: ThirdwebClient; onDisconnect: () => Promise<void> | void; switchChain: (chain: Chain) => Promise<void> | void;};
let returnType: Wallet<"adapter">;
a wallet instance.