dApp Kit
Wallet Hooks
useAutoConnectionStatus

useAutoConnectionStatus

The useAutoConnectionStatus hook retrieves the status for the initial wallet auto-connection process.

import { ConnectButton, useAutoConnectionStatus } from '@mysten/dapp-kit';
 
function MyComponent() {
	const autoConnectionStatus = useAutoConnectionStatus();
 
	return (
		<div>
			<ConnectButton />
			<div>Auto-connection status: {autoConnectionStatus}</div>
		</div>
	);
}

Example

Auto-connection status properties

  • disabled - When the auto-connection functionality is disabled
  • idle - When the initial auto-connection attempt hasn't been made yet
  • settled - When an auto-connection attempt has been made