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

Examples

Implementation starting points covering the most common MOSS flows. They assume production-minded defaults: explicit user intent, restrictive permission scopes, and backend-controlled trust decisions. Adapt to your own app state, analytics, and error handling before shipping.

Vanilla TS Bootstrap

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

await mega.initialise({ network: 'mainnet', logging: 'error' });

const status = await mega.status();
if (status.status !== 'connected') {
  await mega.connect();
}
await mega.initialise({
  network: 'mainnet',
  logging: 'error',
  sponsorUrl: 'https://api.example.com/paymaster/approve',
  sponsorMode: 'app-only',
  sponsorToken: 'native',
});

React Bootstrap

Connect and Sign

Transfer with Permissions-Aware UX

Contract Interaction

Server-Side Verification

Last updated