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

@tonyboyle/solana-wallet-universal-links-generator

v2.0.1

Published

A minimal, stateless TypeScript SDK for generating deep links to mobile Solana wallets

Readme

@tonyboyle/solana-wallet-universal-links-generator

A stateless deep link generator and response decoder for mobile Solana wallets. This SDK provides utilities to generate universal links and deep links for wallet interactions and parse callback responses - you provide the storage and state management.

What This SDK Does

  • Link Generation: Creates universal links and deep links for wallet operations (connect, sign, etc.)
  • Response Parsing: Decodes and validates wallet callback responses
  • End-to-End Encryption: Built-in encryption for sensitive data using x25519 key exchange
  • Multi-Wallet Support: Works with Phantom, Solflare, and Backpack wallets

What You Need to Provide

  • Session Storage: Store connection sessions, encryption keys, and user state
  • State Management: Handle connection state, loading states, and user authentication
  • Routing/Linking: Handle deep link callbacks in your app (React Native Linking, etc.)
  • Persistence: Save wallet sessions across app restarts (AsyncStorage, SecureStore, etc.)

This SDK is intentionally stateless - it focuses on generating secure wallet links and parsing responses. You maintain control over how sessions and state are managed in your application.

Features

  • Stateless: No session management or state storage - you control the data flow
  • Type-safe: Full TypeScript support with typed parameters using generics
  • Dual link format: Generate universal links or deep links via a single linkType argument
  • Multi-wallet: Supports Phantom, Solflare, and Backpack
  • Encrypted: Built-in encryption support using x25519 key exchange (TweetNaCl.js)
  • Auto-encryption: Payloads are automatically encrypted when encryption parameters are provided
  • Response Parsing: Type-safe response parsers for all wallet methods with automatic error handling

Installation

npm install @tonyboyle/solana-wallet-universal-links-generator

Quick Start

Using Individual Command Functions

import { connect, parseConnectResponse } from '@tonyboyle/solana-wallet-universal-links-generator';

// Connect to Phantom (keys are generated automatically)
const { url, dappPublicKey, dappPrivateKey } = connect('phantom', {
  app_url: 'https://myapp.com',
  redirect_link: 'myapp://wallet/callback',
  cluster: 'mainnet-beta'
});

// Open url in the wallet app, then parse the callback it returns
const result = parseConnectResponse(callbackUrl, dappPrivateKey);

if ('errorCode' in result) {
  console.error('Connection failed:', result.errorMessage);
} else {
  console.log('Connected!', result.publicKey);
  console.log('Session token:', result.session);
  // Store this — needed for all subsequent signing operations
  console.log('Wallet encryption key:', result.walletEncryptionPublicKey);
}

Using the Class-based API

import { UniversalWalletAdapter } from '@tonyboyle/solana-wallet-universal-links-generator';

const adapter = new UniversalWalletAdapter();

const { url, dappPublicKey, dappPrivateKey } = adapter.connect('phantom', {
  app_url: 'https://myapp.com',
  redirect_link: 'myapp://wallet/callback',
  cluster: 'mainnet-beta'
});

Supported Wallets

| Wallet | Universal Link Base | Deep Link Base | |--------|-------------------|----------------| | Phantom | https://phantom.app/ul/v1 | phantom://v1 | | Solflare | https://solflare.com/ul/v1 | solflare://ul/v1 | | Backpack | https://backpack.app/ul/v1 | backpack://ul/v1 |

By default all methods generate universal links. Pass 'deeplink' as the third argument to generate deep links instead:

// Universal link (default)
const { url } = connect('phantom', params);
// → https://phantom.app/ul/v1/connect?...

// Deep link
const { url } = connect('phantom', params, 'deeplink');
// → phantom://v1/connect?...

Documentation

Core Documentation

Examples and Guides

Supported Methods

  • Connect: Establish wallet connection and get session token
  • Disconnect: Terminate wallet session
  • Sign Transaction: Sign a single transaction (wallet doesn't submit)
  • Sign All Transactions: Sign multiple transactions (wallet doesn't submit)
  • Sign and Send Transaction: Sign and submit transaction (deprecated in Phantom)
  • Sign Message: Sign an arbitrary message

Security Notes

  • This SDK is stateless - you control session storage and key management
  • Store private keys securely - use SecureStore, not AsyncStorage
  • Validate all responses - always check for errors and validate data
  • Generate new keys per session - never reuse encryption keys
  • Auto-encryption by default - payloads are encrypted when keys are provided

Dependencies

  • tweetnacl: For x25519 key exchange and symmetric encryption
  • tweetnacl-util: For base64 encoding/decoding utilities
  • bs58: For base58 encoding/decoding

License

MIT