Skip to content

Documentation / wagmi / useSetActiveWallet

Function: useSetActiveWallet()

useSetActiveWallet(): Object

Set the active connection in wagmi to a Privy ConnectedWallet

Returns

Object

setActiveWallet

setActiveWallet: (wallet) => Promise<void>

Parameters

wallet: ConnectedWallet

Returns

Promise<void>

Example

ts
const {setActiveWallet} = useSetActiveWallet()
const {wallets} = useWallets();

<section>
  {wallets.map(wallet => (
    <button onClick={() => setActiveWallet(wallet)>{wallet.address}</button>
  ))}
</section>