Skip to main content

Welcome to MagenX404

MagenX404 is a powerful TypeScript package that provides modular authentication features for Solana wallets. Built with full type safety and an automatic wallet selection modal, it makes implementing token-gated access and wallet verification simple and secure.

Quick Start

Get up and running in minutes with our quick start guide.

Key Features

Installation

Install the package using your preferred package manager:
npm install magenx404

Quick Example

Here’s a simple example of using the TimeLock feature:
import { X404TimeLock } from "magenx404";
import { detectWallets, getGeolocationData } from "magenx404/utils";

const wallets = detectWallets(); // string[]
const location = await getGeolocationData(); // Promise<GeolocationData>

const result = await X404TimeLock({
  wallet: wallets[0], // Optional - modal will show if not provided
  required_mint: "TOKEN_CA",
  mint_amount: "1000000",
  min_hold_duration_days: 30,
  geo_code: "true", // or "false"
  geo_code_locs: "US,UK", // Country codes
  coords: {
    latitude: location.latitude,
    longitude: location.longitude,
  },
});

if (result.success) {
  console.log(result.token);
  // Token is automatically stored in localStorage as "sjwt404_timelock"
} else {
  console.error("Error:", result.error);
}

Features Overview

MagenX404 provides 7 different authentication features:
  1. Timelock - Time-based token holding verification
  2. Blacklist - Exclusion-based authentication (verify user does NOT hold banned tokens)
  3. MultiToken - Multi-token portfolio verification
  4. Activity - Transaction history verification
  5. Tier - Tiered access levels (Bronze/Silver/Gold)
  6. NoDebt - Negative balance verification
  7. Age - Wallet age verification

Explore Features

Learn about each feature in detail

What’s Next?

1

Install the package

Follow our installation guide to get started
2

Set up Next.js

If using Next.js, configure transpilation
3

Choose a feature

Pick a feature from our features list and implement it
4

Explore examples

Check out our React examples for implementation patterns

Need Help?

View API Reference

Complete API documentation with all endpoints and types