mega.disconnect()
Last updated
Terminate the active wallet session and return the resulting disconnected state.
mega.disconnect(): Promise<ConnectionStatus>
None.
const state = await mega.disconnect();
if (state.status === 'disconnected') {
// Clear app-side wallet/session state.
}type ConnectionStatus = {
status: 'connected' | 'disconnected' | 'cancelled';
address?: `0x${string}`;
network: 'mainnet' | 'testnet';
};Use disconnect() only when the product clearly intends to terminate the session — typically as part of an explicit "Sign out" affordance. The wallet may also be disconnected externally; subscribe to events.onStatusChange to stay in sync.
Last updated