npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@alien-id/miniapps-contract

v1.3.4

Published

[![npm](https://img.shields.io/npm/v/@alien-id/miniapps-contract.svg)](https://www.npmjs.com/package/@alien-id/miniapps-contract)

Readme

@alien-id/miniapps-contract

npm

Type definitions and version utilities for miniapp-host communication.

Installation

bun add @alien-id/miniapps-contract

Exports

Types

import type {
  // Method types
  Methods,                        // Interface of all methods
  MethodName,                     // Union of method names
  MethodPayload,                  // Payload type for a method
  CreateMethodPayload,            // Helper for defining methods
  MethodNameWithVersionedPayload, // Methods with versioned payloads
  MethodVersionedPayload,         // Versioned payload for a method

  // Event types
  Events,               // Interface of all events
  EventName,            // Union of event names
  EventPayload,         // Payload type for an event
  CreateEventPayload,   // Helper for defining events

  // Launch parameters
  LaunchParams,         // Host-injected params (authToken, contractVersion, etc.)
  Platform,             // 'ios' | 'android'
  DisplayMode,          // 'standard' | 'fullscreen' | 'immersive'

  // Utilities
  Version,              // Semantic version string type
} from '@alien-id/miniapps-contract';

Constants

import { DISPLAY_MODES, PLATFORMS, releases } from '@alien-id/miniapps-contract';

PLATFORMS      // ['ios', 'android']
DISPLAY_MODES  // ['standard', 'fullscreen', 'immersive']
releases       // Record<Version, MethodName[]> - version to methods mapping

Version Utilities

import {
  isMethodSupported,
  getMethodMinVersion,
  getReleaseVersion,
} from '@alien-id/miniapps-contract';

// Check if method is supported in a version
isMethodSupported('app:ready', '0.0.9');         // true
isMethodSupported('payment:request', '0.0.9');   // false

// Get minimum version that supports a method
getMethodMinVersion('app:ready');         // '0.0.9'
getMethodMinVersion('payment:request');   // '0.1.1'

// Get version where a method was introduced
getReleaseVersion('app:ready');           // '0.0.9'

Available Methods

| Method | Since | Description | |--------|-------|-------------| | app:ready | 0.0.9 | Notify host that miniapp is ready | | payment:request | 0.1.1 | Request payment | | clipboard:write | 0.1.1 | Write text to clipboard | | clipboard:read | 0.1.1 | Read text from clipboard | | link:open | 0.1.3 | Open a URL | | haptic:impact | 0.2.4 | Trigger haptic impact feedback | | haptic:notification | 0.2.4 | Trigger haptic notification feedback | | haptic:selection | 0.2.4 | Trigger haptic selection feedback | | wallet.solana:connect | 1.0.0 | Request Solana wallet connection | | wallet.solana:disconnect | 1.0.0 | Disconnect from Solana wallet | | wallet.solana:sign.transaction | 1.0.0 | Sign a Solana transaction | | wallet.solana:sign.message | 1.0.0 | Sign a Solana message | | wallet.solana:sign.send | 1.0.0 | Sign and send a Solana transaction | | app:close | 1.0.0 | Request host to close the miniapp | | host.back.button:toggle | 1.0.0 | Show/hide back button |

Available Events

| Event | Since | Description | |-------|-------|-------------| | host.back.button:clicked | 1.0.0 | Back button was clicked | | payment:response | 0.1.1 | Payment result | | clipboard:response | 0.1.1 | Clipboard read result | | wallet.solana:connect.response | 1.0.0 | Wallet connection result | | wallet.solana:sign.transaction.response | 1.0.0 | Transaction signing result | | wallet.solana:sign.message.response | 1.0.0 | Message signing result | | wallet.solana:sign.send.response | 1.0.0 | Sign and send result |

LaunchParams

Parameters injected by the host app:

interface LaunchParams {
  authToken: string | undefined;           // JWT auth token
  contractVersion: Version | undefined;    // Host's contract version
  hostAppVersion: string | undefined;      // Host app version
  platform: Platform | undefined;          // 'ios' | 'android'
  safeAreaInsets: SafeAreaInsets | undefined; // System UI insets (CSS px)
  startParam: string | undefined;          // Custom param (referrals, etc.)
  displayMode: DisplayMode;                 // 'standard' | 'fullscreen' | 'immersive'
}

DisplayMode

Controls how the host app renders the miniapp webview.

| Mode | Header | Close / Options | WebView area | Use case | | ---- | ------ | --------------- | ------------ | -------- | | standard | Visible (title, close, options) | In header | Below header | Default for most miniapps | | fullscreen | Hidden | Floating overlay | Entire screen | Games, media, maps | | immersive | Hidden | None | Entire screen | Custom UIs that provide their own exit (must call app:close) |

In all modes the miniapp receives safeAreaInsets and should respect them for system UI (status bar, notch, home indicator).

Adding New Methods/Events

  1. Define in src/methods/definitions/methods.ts or src/events/definitions/events.ts
  2. Add version mapping in src/methods/versions/releases.ts
  3. Build: bun run build