CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-solana--wallet-adapter-wallets

Comprehensive collection of Solana wallet adapters for TypeScript applications with tree-shaking support

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

index.mddocs/

Solana Wallet Adapters

Solana Wallet Adapters is a comprehensive collection of all wallet adapter packages for the Solana ecosystem. It provides a unified interface for integrating multiple cryptocurrency wallets into TypeScript applications, with tree-shaking support to include only the adapters you actually use.

Package Information

  • Package Name: @solana/wallet-adapter-wallets
  • Package Type: npm
  • Language: TypeScript
  • Installation: npm install @solana/wallet-adapter-wallets
  • Peer Dependencies: @solana/web3.js@^1.98.0

Core Imports

Import specific wallet adapters:

import { 
  PhantomWalletAdapter, 
  PhantomWalletName,
  SolflareWalletAdapter,
  SolflareWalletName,
  BitgetWalletAdapter,
  BitgetWalletName
} from "@solana/wallet-adapter-wallets";

Import all adapters (supports tree-shaking):

import * as wallets from "@solana/wallet-adapter-wallets";

For CommonJS environments:

const { 
  PhantomWalletAdapter, 
  SolflareWalletAdapter,
  BitgetWalletAdapter 
} = require("@solana/wallet-adapter-wallets");

Basic Usage

import { PhantomWalletAdapter } from "@solana/wallet-adapter-wallets";
import { Connection, clusterApiUrl } from "@solana/web3.js";

// Initialize wallet adapter
const walletAdapter = new PhantomWalletAdapter();

// Connect to wallet
await walletAdapter.connect();

// Use wallet for transactions
const connection = new Connection(clusterApiUrl('mainnet-beta'));
const signature = await walletAdapter.sendTransaction(
  transaction, 
  connection
);

Architecture

The package serves as a comprehensive re-export hub, providing:

  • Unified Imports: Single package containing 36 individual wallet adapters
  • Tree-Shaking Support: Applications bundle only the wallet adapters they use
  • Consistent API: All adapters implement standard wallet adapter interfaces
  • Type Safety: Full TypeScript support with proper type definitions
  • Base Class Hierarchy: Different base classes for different wallet capabilities

Wallet Adapter Patterns

Every wallet adapter follows a consistent export pattern:

  1. Adapter Class: Main implementation (e.g., PhantomWalletAdapter)
  2. Name Constant: Typed identifier (e.g., PhantomWalletName)
  3. Config Interface: Configuration options (e.g., PhantomWalletAdapterConfig)

Base Adapter Types

  • BaseSignerWalletAdapter: Transaction-only wallets including hardware wallets (Trezor, Ledger) and some browser wallets
  • BaseMessageSignerWalletAdapter: Browser/mobile wallets with message signing
  • BaseSignInMessageSignerWalletAdapter: Wallets with Sign-in with Solana support

Capabilities

Browser & Mobile Wallets

Standard browser extension and mobile wallets with full transaction and message signing capabilities.

class PhantomWalletAdapter extends BaseMessageSignerWalletAdapter {
  name: WalletName<'Phantom'>;
  url: string;
  icon: string;
  supportedTransactionVersions: ReadonlySet<TransactionVersion>;
  
  constructor(config?: PhantomWalletAdapterConfig);
  connect(): Promise<void>;
  disconnect(): Promise<void>;
  autoConnect(): Promise<void>;
  sendTransaction<T extends Transaction | VersionedTransaction>(
    transaction: T,
    connection: Connection,
    options?: SendTransactionOptions
  ): Promise<TransactionSignature>;
  signTransaction<T extends Transaction | VersionedTransaction>(transaction: T): Promise<T>;
  signAllTransactions<T extends Transaction | VersionedTransaction>(transactions: T[]): Promise<T[]>;
  signMessage(message: Uint8Array): Promise<Uint8Array>;
}

const PhantomWalletName: WalletName<'Phantom'>;
interface PhantomWalletAdapterConfig {}

Browser & Mobile Wallets

Hardware Wallets

Hardware wallet integrations with custom derivation path support and specialized connection patterns.

class LedgerWalletAdapter extends BaseSignerWalletAdapter {
  name: WalletName<'Ledger'>;
  url: string;
  icon: string;
  supportedTransactionVersions: ReadonlySet<TransactionVersion>;
  
  constructor(config?: LedgerWalletAdapterConfig);
  connect(): Promise<void>;
  disconnect(): Promise<void>;
  signTransaction<T extends Transaction | VersionedTransaction>(transaction: T): Promise<T>;
  signAllTransactions<T extends Transaction | VersionedTransaction>(transactions: T[]): Promise<T[]>;
}

const LedgerWalletName: WalletName<'Ledger'>;
interface LedgerWalletAdapterConfig {
  derivationPath?: Buffer;
}

function getDerivationPath(account?: number, change?: number): Buffer;

Hardware Wallets

Specialized Wallets

Wallets with unique features like social login, QR-code signing, or development/testing capabilities.

class ParticleAdapter extends BaseMessageSignerWalletAdapter {
  name: WalletName<'Particle'>;
  particle: ParticleNetwork;
  
  constructor(config?: ParticleAdapterConfig);
}

interface ParticleAdapterConfig {
  config?: ConstructorParameters<typeof ParticleNetwork>[0];
  login?: Parameters<SolanaWallet['connect']>[0];
}

class UnsafeBurnerWalletAdapter extends BaseSignInMessageSignerWalletAdapter {
  name: WalletName<'Burner Wallet'>;
  
  signIn(input?: SolanaSignInInput): Promise<SolanaSignInOutput>;
}

Specialized Wallets

Wallet Names & Constants

Type-safe constants for wallet identification and selection.

type WalletName<T extends string = string> = T & { __brand: 'WalletName' };

const PhantomWalletName: WalletName<'Phantom'>;
const SolflareWalletName: WalletName<'Solflare'>;
const LedgerWalletName: WalletName<'Ledger'>;
const TrezorWalletName: WalletName<'Trezor'>;
// ... 32+ additional wallet names

Complete Wallet List

Types

Core Types

type TransactionVersion = 'legacy' | 0;

interface SendTransactionOptions {
  signers?: Keypair[];
  skipPreflight?: boolean;
  preflightCommitment?: Commitment;
  maxRetries?: number;
  minContextSlot?: number;
}

interface WalletAdapterConfig {}

enum WalletAdapterNetwork {
  Mainnet = 'mainnet-beta',
  Testnet = 'testnet',
  Devnet = 'devnet'
}

Sign-in with Solana Types

interface SolanaSignInInput {
  domain: string;
  address?: string;
  statement?: string;
  uri?: string;
  version?: string;
  chainId?: string;
  nonce?: string;
  issuedAt?: string;
  expirationTime?: string;
  notBefore?: string;
  requestId?: string;
  resources?: string[];
}

interface SolanaSignInOutput {
  account: {
    address: string;
    publicKey: Uint8Array;
  };
  signedMessage: Uint8Array;
  signature: Uint8Array;
}

External SDK Types

// ParticleNetwork is from @particle-network/solana package
// These are the key types used in configuration
interface ParticleNetwork {
  auth: {
    getUserInfo(): Promise<{
      uuid: string;
      email?: string;
      name?: string;
      avatar?: string;
    }>;
  };
}

interface SolanaWallet {
  connect(options?: {
    loginType?: string;
    account?: string;
  }): Promise<void>;
}

// Base wallet adapter types from @solana/web3.js
type Transaction = import('@solana/web3.js').Transaction;
type VersionedTransaction = import('@solana/web3.js').VersionedTransaction;
type Connection = import('@solana/web3.js').Connection;
type TransactionSignature = import('@solana/web3.js').TransactionSignature;
type Keypair = import('@solana/web3.js').Keypair;
type Commitment = import('@solana/web3.js').Commitment;

docs

browser-mobile-wallets.md

hardware-wallets.md

index.md

specialized-wallets.md

wallet-list.md

tile.json