Esc

Connect

Trigger the connection flow from an action in your app.

import { mega } from '@megaeth-labs/wallet-sdk';

const { status, address } = await mega.connect();

if (status === 'connected') {
    console.log('Connected:', address);
}
Runs on testnet with your wallet
ts
// Optional. With an address, the wallet shows "Continue as <address>" and asks
// for that account's passkey only.
interface ConnectRequest {
    address?: `0x${string}`;
}

interface ConnectionStatus {
    status: 'connected' | 'disconnected' | 'cancelled';
    address?: `0x${string}`;
    network: 'mainnet' | 'testnet';
}