For the complete documentation index, see llms.txt. This page is also available as Markdown.

mega.status()

Read the current connection state without prompting the user. Useful on app load, route transitions, or when restoring state after a refresh.

Signature

mega.status(): Promise<ConnectionStatus>

Parameters

None.

Example

const state = await mega.status();

if (state.status === 'connected') {
  console.log('Connected wallet:', state.address);
} else {
  console.log('Wallet is not connected');
}

Response

Notes

status() is a read — it doesn't prompt the user. To prompt for connection, use connect(). For continuous tracking, use events.onStatusChange and avoid polling.

Last updated