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

@a3e9-microservices/wallet-auth

v1.0.2

Published

Reusable Solana wallet authentication and SBT NFT integration package

Downloads

304

Readme

@a3e9-microservices/wallet-auth

Reusable Solana wallet authentication and SBT NFT integration package for A3E9 microservices.

Features

  • 🔐 Wallet connection (Phantom, Solflare)
  • ✅ Signature verification
  • 🎫 SBT NFT lookup and validation
  • 💾 Session management
  • 📦 TypeScript support
  • 🔄 Reusable across frontend and backend

Installation

npm install @a3e9-microservices/wallet-auth

Usage

Client-Side (Frontend)

import { connectWallet, disconnectWallet } from '@a3e9-microservices/wallet-auth/client';

// Connect to Phantom wallet
const connection = await connectWallet('phantom');
console.log('Connected:', connection.publicKey);

// Disconnect
await disconnectWallet('phantom');

Server-Side (Backend)

import { verifySignature, getTokenCustomization } from '@a3e9-microservices/wallet-auth/server';

// Verify wallet signature
const isValid = await verifySignature(publicKey, message, signature);

// Get token customization from SBT NFT
const customization = await getTokenCustomization(walletAddress);

API Reference

Client API

connectWallet(walletType: 'phantom' | 'solflare'): Promise<WalletConnection>

Connect to a Solana wallet.

disconnectWallet(walletType: 'phantom' | 'solflare'): Promise<void>

Disconnect from wallet.

signMessage(walletType: 'phantom' | 'solflare', message: string): Promise<Uint8Array>

Sign a message with the connected wallet.

isWalletInstalled(walletType: 'phantom' | 'solflare'): boolean

Check if a wallet is installed.

saveWalletConnection(publicKey: string, walletType: 'phantom' | 'solflare'): void

Save wallet connection to localStorage.

getSavedWalletConnection(): { publicKey: string; walletType: WalletType } | null

Get saved wallet connection from localStorage.

Server API

verifySignature(publicKey: string, message: string, signature: Uint8Array | string): Promise<boolean>

Verify a wallet signature.

createAuthChallenge(publicKey: string): string

Create an authentication challenge message.

authenticateWallet(publicKey: string, walletType: 'phantom' | 'solflare', message: string, signature: string): Promise<AuthResult>

Authenticate a wallet with signature verification.

findSBTForWallet(walletAddress: string, rpcUrl?: string): Promise<SBTLookupResult>

Find SBT NFT for a wallet address.

getTokenCustomization(walletAddress: string, rpcUrl?: string): Promise<TokenCustomization | null>

Get token customization from SBT NFT.

hasActiveSubscription(walletAddress: string, rpcUrl?: string): Promise<boolean>

Check if wallet has an active subscription.

Types

export type WalletType = 'phantom' | 'solflare';

export interface WalletConnection {
  publicKey: string;
  walletType: WalletType;
  connected: boolean;
}

export interface TokenCustomization {
  tokenAddress: string;
  theme: 'Default' | 'Galaxy' | 'Ocean' | 'Sunset';
  tokenInfo: {
    name: string;
    symbol: string;
    logo: string;
    description: string;
  };
  socialLinks: {
    twitter?: string;
    telegram?: string;
    discord?: string;
    website?: string;
  };
  subscription: {
    tier: 'growth' | 'established' | 'enterprise';
    active: boolean;
    expiresAt?: string;
  };
  createdAt: string;
  updatedAt: string;
}

Integration Examples

React Frontend

import { useState } from 'react';
import { connectWallet, saveWalletConnection } from '@a3e9-microservices/wallet-auth/client';

function WalletButton() {
  const [connected, setConnected] = useState(false);

  const handleConnect = async () => {
    try {
      const connection = await connectWallet('phantom');
      saveWalletConnection(connection.publicKey, connection.walletType);
      setConnected(true);
    } catch (error) {
      console.error('Connection failed:', error);
    }
  };

  return (
    <button onClick={handleConnect}>
      {connected ? 'Connected' : 'Connect Wallet'}
    </button>
  );
}

Express Backend

import express from 'express';
import { authenticateWallet, getTokenCustomization } from '@a3e9-microservices/wallet-auth/server';

const app = express();

app.post('/api/auth/login', async (req, res) => {
  const { publicKey, walletType, message, signature } = req.body;

  const authResult = await authenticateWallet(publicKey, walletType, message, signature);

  if (authResult.success) {
    // Check for existing customization
    const customization = await getTokenCustomization(publicKey);

    res.json({
      success: true,
      session: authResult.session,
      customization,
      isFirstTime: !customization,
    });
  } else {
    res.status(401).json({ error: authResult.error });
  }
});

Environment Variables

SOLANA_RPC_URL=https://api.mainnet-beta.solana.com

License

MIT

Author

A3E9