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

Installation

The core package is @megaeth-labs/wallet-sdk. Use it when you want direct access to the mega object without the React provider and hooks layer. The React SDK wraps this same package.

Published at: npmjs.com/package/@megaeth-labs/wallet-sdk.

Install

# pick your package manager
npm install @megaeth-labs/wallet-sdk
pnpm add @megaeth-labs/wallet-sdk
yarn add @megaeth-labs/wallet-sdk

Import Surface

import { mega } from '@megaeth-labs/wallet-sdk';
import type {
  Config,
  ConnectionStatus,
  TransferRequest,
  CallContractRequest,
  GrantPermissionsRequest,
} from '@megaeth-labs/wallet-sdk';

What You Get

  • mega.initialise(config) — one-time setup, see mega.initialise().

  • mega.events.onStatusChange(callback) — wallet status subscription.

  • Wallet actions: connect, disconnect, status, open, transfer, send, swap, signMessage, signData, authenticate, callContract, getFromContract, deposit, balances.

  • Smart Approvals: grantPermissions, getPermissions, revokePermissions.

  • Shared request/response types for integration-safe code.

The SDK currently ships as ESM + CJS bundles with type declarations. It uses Penpal to bridge the parent window to the hosted MOSS wallet iframe.

Last updated