Comprehensive collection of Solana wallet adapters for TypeScript applications with tree-shaking support
npx @tessl/cli install tessl/npm-solana--wallet-adapter-wallets@0.19.00
# Solana Wallet Adapters
1
2
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.
3
4
## Package Information
5
6
- **Package Name**: @solana/wallet-adapter-wallets
7
- **Package Type**: npm
8
- **Language**: TypeScript
9
- **Installation**: `npm install @solana/wallet-adapter-wallets`
10
- **Peer Dependencies**: `@solana/web3.js@^1.98.0`
11
12
## Core Imports
13
14
Import specific wallet adapters:
15
16
```typescript
17
import {
18
PhantomWalletAdapter,
19
PhantomWalletName,
20
SolflareWalletAdapter,
21
SolflareWalletName,
22
BitgetWalletAdapter,
23
BitgetWalletName
24
} from "@solana/wallet-adapter-wallets";
25
```
26
27
Import all adapters (supports tree-shaking):
28
29
```typescript
30
import * as wallets from "@solana/wallet-adapter-wallets";
31
```
32
33
For CommonJS environments:
34
35
```javascript
36
const {
37
PhantomWalletAdapter,
38
SolflareWalletAdapter,
39
BitgetWalletAdapter
40
} = require("@solana/wallet-adapter-wallets");
41
```
42
43
## Basic Usage
44
45
```typescript
46
import { PhantomWalletAdapter } from "@solana/wallet-adapter-wallets";
47
import { Connection, clusterApiUrl } from "@solana/web3.js";
48
49
// Initialize wallet adapter
50
const walletAdapter = new PhantomWalletAdapter();
51
52
// Connect to wallet
53
await walletAdapter.connect();
54
55
// Use wallet for transactions
56
const connection = new Connection(clusterApiUrl('mainnet-beta'));
57
const signature = await walletAdapter.sendTransaction(
58
transaction,
59
connection
60
);
61
```
62
63
## Architecture
64
65
The package serves as a comprehensive re-export hub, providing:
66
67
- **Unified Imports**: Single package containing 36 individual wallet adapters
68
- **Tree-Shaking Support**: Applications bundle only the wallet adapters they use
69
- **Consistent API**: All adapters implement standard wallet adapter interfaces
70
- **Type Safety**: Full TypeScript support with proper type definitions
71
- **Base Class Hierarchy**: Different base classes for different wallet capabilities
72
73
### Wallet Adapter Patterns
74
75
Every wallet adapter follows a consistent export pattern:
76
77
1. **Adapter Class**: Main implementation (e.g., `PhantomWalletAdapter`)
78
2. **Name Constant**: Typed identifier (e.g., `PhantomWalletName`)
79
3. **Config Interface**: Configuration options (e.g., `PhantomWalletAdapterConfig`)
80
81
### Base Adapter Types
82
83
- **BaseSignerWalletAdapter**: Transaction-only wallets including hardware wallets (Trezor, Ledger) and some browser wallets
84
- **BaseMessageSignerWalletAdapter**: Browser/mobile wallets with message signing
85
- **BaseSignInMessageSignerWalletAdapter**: Wallets with Sign-in with Solana support
86
87
## Capabilities
88
89
### Browser & Mobile Wallets
90
91
Standard browser extension and mobile wallets with full transaction and message signing capabilities.
92
93
```typescript { .api }
94
class PhantomWalletAdapter extends BaseMessageSignerWalletAdapter {
95
name: WalletName<'Phantom'>;
96
url: string;
97
icon: string;
98
supportedTransactionVersions: ReadonlySet<TransactionVersion>;
99
100
constructor(config?: PhantomWalletAdapterConfig);
101
connect(): Promise<void>;
102
disconnect(): Promise<void>;
103
autoConnect(): Promise<void>;
104
sendTransaction<T extends Transaction | VersionedTransaction>(
105
transaction: T,
106
connection: Connection,
107
options?: SendTransactionOptions
108
): Promise<TransactionSignature>;
109
signTransaction<T extends Transaction | VersionedTransaction>(transaction: T): Promise<T>;
110
signAllTransactions<T extends Transaction | VersionedTransaction>(transactions: T[]): Promise<T[]>;
111
signMessage(message: Uint8Array): Promise<Uint8Array>;
112
}
113
114
const PhantomWalletName: WalletName<'Phantom'>;
115
interface PhantomWalletAdapterConfig {}
116
```
117
118
[Browser & Mobile Wallets](./browser-mobile-wallets.md)
119
120
### Hardware Wallets
121
122
Hardware wallet integrations with custom derivation path support and specialized connection patterns.
123
124
```typescript { .api }
125
class LedgerWalletAdapter extends BaseSignerWalletAdapter {
126
name: WalletName<'Ledger'>;
127
url: string;
128
icon: string;
129
supportedTransactionVersions: ReadonlySet<TransactionVersion>;
130
131
constructor(config?: LedgerWalletAdapterConfig);
132
connect(): Promise<void>;
133
disconnect(): Promise<void>;
134
signTransaction<T extends Transaction | VersionedTransaction>(transaction: T): Promise<T>;
135
signAllTransactions<T extends Transaction | VersionedTransaction>(transactions: T[]): Promise<T[]>;
136
}
137
138
const LedgerWalletName: WalletName<'Ledger'>;
139
interface LedgerWalletAdapterConfig {
140
derivationPath?: Buffer;
141
}
142
143
function getDerivationPath(account?: number, change?: number): Buffer;
144
```
145
146
[Hardware Wallets](./hardware-wallets.md)
147
148
### Specialized Wallets
149
150
Wallets with unique features like social login, QR-code signing, or development/testing capabilities.
151
152
```typescript { .api }
153
class ParticleAdapter extends BaseMessageSignerWalletAdapter {
154
name: WalletName<'Particle'>;
155
particle: ParticleNetwork;
156
157
constructor(config?: ParticleAdapterConfig);
158
}
159
160
interface ParticleAdapterConfig {
161
config?: ConstructorParameters<typeof ParticleNetwork>[0];
162
login?: Parameters<SolanaWallet['connect']>[0];
163
}
164
165
class UnsafeBurnerWalletAdapter extends BaseSignInMessageSignerWalletAdapter {
166
name: WalletName<'Burner Wallet'>;
167
168
signIn(input?: SolanaSignInInput): Promise<SolanaSignInOutput>;
169
}
170
```
171
172
[Specialized Wallets](./specialized-wallets.md)
173
174
### Wallet Names & Constants
175
176
Type-safe constants for wallet identification and selection.
177
178
```typescript { .api }
179
type WalletName<T extends string = string> = T & { __brand: 'WalletName' };
180
181
const PhantomWalletName: WalletName<'Phantom'>;
182
const SolflareWalletName: WalletName<'Solflare'>;
183
const LedgerWalletName: WalletName<'Ledger'>;
184
const TrezorWalletName: WalletName<'Trezor'>;
185
// ... 32+ additional wallet names
186
```
187
188
[Complete Wallet List](./wallet-list.md)
189
190
## Types
191
192
### Core Types
193
194
```typescript { .api }
195
type TransactionVersion = 'legacy' | 0;
196
197
interface SendTransactionOptions {
198
signers?: Keypair[];
199
skipPreflight?: boolean;
200
preflightCommitment?: Commitment;
201
maxRetries?: number;
202
minContextSlot?: number;
203
}
204
205
interface WalletAdapterConfig {}
206
207
enum WalletAdapterNetwork {
208
Mainnet = 'mainnet-beta',
209
Testnet = 'testnet',
210
Devnet = 'devnet'
211
}
212
```
213
214
### Sign-in with Solana Types
215
216
```typescript { .api }
217
interface SolanaSignInInput {
218
domain: string;
219
address?: string;
220
statement?: string;
221
uri?: string;
222
version?: string;
223
chainId?: string;
224
nonce?: string;
225
issuedAt?: string;
226
expirationTime?: string;
227
notBefore?: string;
228
requestId?: string;
229
resources?: string[];
230
}
231
232
interface SolanaSignInOutput {
233
account: {
234
address: string;
235
publicKey: Uint8Array;
236
};
237
signedMessage: Uint8Array;
238
signature: Uint8Array;
239
}
240
```
241
242
### External SDK Types
243
244
```typescript { .api }
245
// ParticleNetwork is from @particle-network/solana package
246
// These are the key types used in configuration
247
interface ParticleNetwork {
248
auth: {
249
getUserInfo(): Promise<{
250
uuid: string;
251
email?: string;
252
name?: string;
253
avatar?: string;
254
}>;
255
};
256
}
257
258
interface SolanaWallet {
259
connect(options?: {
260
loginType?: string;
261
account?: string;
262
}): Promise<void>;
263
}
264
265
// Base wallet adapter types from @solana/web3.js
266
type Transaction = import('@solana/web3.js').Transaction;
267
type VersionedTransaction = import('@solana/web3.js').VersionedTransaction;
268
type Connection = import('@solana/web3.js').Connection;
269
type TransactionSignature = import('@solana/web3.js').TransactionSignature;
270
type Keypair = import('@solana/web3.js').Keypair;
271
type Commitment = import('@solana/web3.js').Commitment;
272
```