# @solana-mobile/mobile-wallet-adapter-protocol

> An implementation of the Solana Mobile Mobile Wallet Adapter protocol. Use this to open a session with a mobile wallet app, and to issue API calls to it.

Latest version **2.3.0** (published 2026-08-17) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @solana-mobile/mobile-wallet-adapter-protocol
pnpm add @solana-mobile/mobile-wallet-adapter-protocol
yarn add @solana-mobile/mobile-wallet-adapter-protocol
bun add @solana-mobile/mobile-wallet-adapter-protocol
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.3.0 |
| Published | 2026-08-17 |
| First published | 2022-06-23 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 836.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 329 |
| Author | Steven Luscher |
| Maintainers | michaelsulistio, funkatronics_sol, stevenlaver, ankur2136, olivier.goutay, beeman |

## Links

- npm: https://www.npmjs.com/package/@solana-mobile/mobile-wallet-adapter-protocol
- Repository: https://github.com/solana-mobile/mobile-wallet-adapter
- Homepage: https://github.com/solana-mobile/mobile-wallet-adapter#readme
- Issues: https://github.com/solana-mobile/mobile-wallet-adapter/issues
- npm.io page: https://npm.io/package/@solana-mobile/mobile-wallet-adapter-protocol

## Dependencies (6)

- [@solana/kit](https://npm.io/package/@solana/kit.md) ^7.0.0
- [@noble/curves](https://npm.io/package/@noble/curves.md) ^2.2.0
- [@noble/hashes](https://npm.io/package/@noble/hashes.md) ^2.2.0
- [@wallet-standard/core](https://npm.io/package/@wallet-standard/core.md) ^1.1.1
- [@solana/wallet-standard-util](https://npm.io/package/@solana/wallet-standard-util.md) ^1.1.2
- [@solana/wallet-standard-features](https://npm.io/package/@solana/wallet-standard-features.md) ^1.3.0

## Recent versions

- 2.3.0 (latest) — 2026-08-17
- 2.4.0-canary-20260915212927 (canary) — 2026-09-15
- 2.2.2-hotfix.0 (hotfix) — 2025-07-31
- 2.1.0-alpha1 (alpha) — 2024-01-18
- 2.4.0-canary-20260915210437 — 2026-09-15
- 0.0.0-canary-20260910202749 — 2026-09-10
- 0.0.0-canary-20260909002706 — 2026-09-09
- 0.0.0-canary-20260903162154 — 2026-09-03
- 0.0.0-canary-20260903155326 — 2026-09-03
- 0.0.0-canary-20260902170211 — 2026-09-02
- 0.0.0-canary-20260828231154 — 2026-08-28
- 0.0.0-canary-20260817210220 — 2026-08-17
- 0.0.0-canary-20260816181440 — 2026-08-16
- 0.0.0-canary-20260816174519 — 2026-08-16
- 0.0.0-canary-20260816005128 — 2026-08-16
- … 122 more at https://npm.io/package/@solana-mobile/mobile-wallet-adapter-protocol/versions

## README

# `@solana-mobile/mobile-wallet-adapter-protocol`

This is a reference implementation of the [Mobile Wallet Adapter specification](https://github.com/solana-mobile/mobile-wallet-adapter/blob/main/spec/spec.md) in JavaScript. Use this to start a session with a mobile wallet in which you can issue API calls to it (eg. `sign_messages`) as per the spec.

If you are simply looking to integrate a JavaScript application with mobile wallets, see [`@solana-mobile/wallet-adapter-mobile`](https://www.npmjs.com/package/@solana-mobile/wallet-adapter-mobile) instead.

## Learn how to use this API on our [documentation website](https://docs.solanamobile.com/):

- React Native
    - [Quickstart Setup](https://docs.solanamobile.com/react-native/quickstart)
    - [dApp Integration Guide](https://docs.solanamobile.com/react-native/mwa_integration_rn)
    - [Hello World Tutorial](https://docs.solanamobile.com/getting-started/hello_world_tutorial)
- [Sample App Reference](https://docs.solanamobile.com/sample-apps/sample_app_overview)

## Quick start

Use this API to start a session:

```typescript
import { transact } from '@solana-mobile/mobile-wallet-adapter-protocol';

await transact(async (wallet) => {
    /* ... */
});
```

The callback you provide will be called once a session has been established with a wallet. It will recieve the `MobileWallet` API as an argument. You can call protocol-specified methods using this function. Whatever you return from this callback will be returned by `transact`.

```typescript
const signedPayloads = await transact(async (wallet) => {
    const { signed_payloads } = await wallet.signMessages({
        auth_token,
        payloads: [
            /* ... */
        ],
    });
    return signed_payloads;
});
```

The wallet session will stay active until your callback returns. Typically, wallets will redirect back to your app once the session ends.

## Exception handling

You can catch exceptions at any level. See `errors.ts` for a list of exceptions that might be thrown.

```typescript
try {
    await transact(async (wallet) => {
        try {
            await wallet.signTransactions(/* ... */);
        } catch (e) {
            if (
                e instanceof SolanaMobileWalletAdapterProtocolError &&
                e.code === SolanaMobileWalletAdapterProtocolErrorCode.ERROR_REAUTHORIZE
            ) {
                console.error('The auth token has gone stale');
                await wallet.reauthorize({ auth_token, identity });
                // Retry...
            }
            throw e;
        }
    });
} catch (e) {
    if (
        e instanceof SolanaMobileWalletAdapterError &&
        e.code === SolanaMobileWalletAdapterErrorCode.ERROR_WALLET_NOT_FOUND
    ) {
        /* ... */
    }
    throw e;
}
```

---
_Source: https://npm.io/package/@solana-mobile/mobile-wallet-adapter-protocol · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
