Disconnect Wallet
Programmatically disconnect from a Sui wallet using the dApp Kit disconnectWallet action.
The disconnectWallet action terminates the connection with the currently connected wallet.
The Connect Button Web Component provides a complete wallet connection UI.
Usage
The disconnect action clears the connection state locally and attempts to notify the wallet. Even if the wallet notification fails, the local state is always cleared to ensure a clean disconnection.
Wallets might or might not implement the disconnect feature. Calling disconnectWallet
does not necessarily mean that the wallet accounts are disconnected from the app within the
wallet itself. This is determined by each wallet's implementation.
import { createDAppKit } from '@mysten/dapp-kit-core';
const dAppKit = createDAppKit({
/* config */
});
await dAppKit.disconnectWallet();Parameters
None.
Return value
Returns a Promise that resolves to void when the disconnection is complete.
The action might throw WalletNotConnectedError if no wallet is connected. However,
wallet-specific disconnect failures are logged but don't prevent the local connection state from
being cleared.