Esc

View as Markdownllms.txt

Initialise

Before using the wallet, the initialise function must be called. This embeds the iFrame, establishes the communication channel and checks for any existing connections to your app.

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

const status = await mega.initialise({
    network: 'testnet'
});

The following options are available for the config object:

ts
interface Config {
    network: 'mainnet' | 'testnet';
    logging?: 'debug' | 'info' | 'warn' | 'error';
    sponsorUrl?: string;
    sponsorMode?: 'everything' | 'app-only' | 'explicit';
    sponsorToken?: 'native' | 'usdm';
}