0
# Browser & Mobile Wallets
1
2
Browser extension and mobile wallet adapters that support full transaction signing, message signing, and modern Solana features like versioned transactions.
3
4
## Capabilities
5
6
### Phantom Wallet
7
8
Popular browser extension and mobile wallet with iOS deep linking support.
9
10
```typescript { .api }
11
/**
12
* Phantom wallet adapter with support for versioned transactions and iOS deep linking
13
*/
14
class PhantomWalletAdapter extends BaseMessageSignerWalletAdapter {
15
name: WalletName<'Phantom'>;
16
url: string;
17
icon: string;
18
supportedTransactionVersions: ReadonlySet<TransactionVersion>;
19
20
constructor(config?: PhantomWalletAdapterConfig);
21
22
/** Connect to Phantom wallet, with iOS universal link support */
23
connect(): Promise<void>;
24
25
/** Disconnect from wallet */
26
disconnect(): Promise<void>;
27
28
/** Auto-connect if already connected, with iOS handling */
29
autoConnect(): Promise<void>;
30
31
/** Send transaction with wallet signing and broadcasting */
32
sendTransaction<T extends Transaction | VersionedTransaction>(
33
transaction: T,
34
connection: Connection,
35
options?: SendTransactionOptions
36
): Promise<TransactionSignature>;
37
38
/** Sign transaction without broadcasting */
39
signTransaction<T extends Transaction | VersionedTransaction>(transaction: T): Promise<T>;
40
41
/** Sign multiple transactions in batch */
42
signAllTransactions<T extends Transaction | VersionedTransaction>(transactions: T[]): Promise<T[]>;
43
44
/** Sign arbitrary message */
45
signMessage(message: Uint8Array): Promise<Uint8Array>;
46
}
47
48
const PhantomWalletName: WalletName<'Phantom'>;
49
50
interface PhantomWalletAdapterConfig {}
51
```
52
53
**Usage Example:**
54
55
```typescript
56
import { PhantomWalletAdapter, PhantomWalletName } from "@solana/wallet-adapter-wallets";
57
58
const adapter = new PhantomWalletAdapter();
59
60
// Check if wallet is available
61
if (adapter.readyState === WalletReadyState.Installed) {
62
await adapter.connect();
63
64
// Sign a message
65
const message = new TextEncoder().encode("Hello Solana!");
66
const signature = await adapter.signMessage(message);
67
}
68
```
69
70
### Solflare Wallet
71
72
Multi-platform wallet with network configuration and MetaMask integration.
73
74
```typescript { .api }
75
/**
76
* Solflare wallet adapter with network configuration support
77
*/
78
class SolflareWalletAdapter extends BaseMessageSignerWalletAdapter {
79
name: WalletName<'Solflare'>;
80
url: string;
81
icon: string;
82
supportedTransactionVersions: ReadonlySet<TransactionVersion>;
83
84
constructor(config?: SolflareWalletAdapterConfig);
85
86
connect(): Promise<void>;
87
disconnect(): Promise<void>;
88
autoConnect(): Promise<void>;
89
sendTransaction<T extends Transaction | VersionedTransaction>(
90
transaction: T,
91
connection: Connection,
92
options?: SendTransactionOptions
93
): Promise<TransactionSignature>;
94
signTransaction<T extends Transaction | VersionedTransaction>(transaction: T): Promise<T>;
95
signAllTransactions<T extends Transaction | VersionedTransaction>(transactions: T[]): Promise<T[]>;
96
signMessage(message: Uint8Array): Promise<Uint8Array>;
97
}
98
99
const SolflareWalletName: WalletName<'Solflare'>;
100
101
interface SolflareWalletAdapterConfig {
102
/** Network to connect to (mainnet-beta, devnet, testnet) */
103
network?: WalletAdapterNetwork;
104
}
105
```
106
107
### Coinbase Wallet
108
109
Enterprise-grade wallet with full transaction support.
110
111
```typescript { .api }
112
/**
113
* Coinbase wallet adapter for browser extension integration
114
*/
115
class CoinbaseWalletAdapter extends BaseMessageSignerWalletAdapter {
116
name: WalletName<'Coinbase Wallet'>;
117
url: string;
118
icon: string;
119
supportedTransactionVersions: ReadonlySet<TransactionVersion>;
120
121
constructor(config?: CoinbaseWalletAdapterConfig);
122
123
connect(): Promise<void>;
124
disconnect(): Promise<void>;
125
sendTransaction<T extends Transaction | VersionedTransaction>(
126
transaction: T,
127
connection: Connection,
128
options?: SendTransactionOptions
129
): Promise<TransactionSignature>;
130
signTransaction<T extends Transaction | VersionedTransaction>(transaction: T): Promise<T>;
131
signAllTransactions<T extends Transaction | VersionedTransaction>(transactions: T[]): Promise<T[]>;
132
signMessage(message: Uint8Array): Promise<Uint8Array>;
133
}
134
135
const CoinbaseWalletName: WalletName<'Coinbase Wallet'>;
136
137
interface CoinbaseWalletAdapterConfig {}
138
```
139
140
### Additional Browser/Mobile Wallets
141
142
All following wallets use the same `BaseMessageSignerWalletAdapter` interface with empty configuration:
143
144
```typescript { .api }
145
// Alpha Wallet
146
class AlphaWalletAdapter extends BaseMessageSignerWalletAdapter {
147
name: WalletName<'Alpha'>;
148
supportedTransactionVersions: ReadonlySet<'legacy'>;
149
}
150
const AlphaWalletName: WalletName<'Alpha'>;
151
interface AlphaWalletAdapterConfig {}
152
153
// Avana Wallet
154
class AvanaWalletAdapter extends BaseMessageSignerWalletAdapter {
155
name: WalletName<'Avana'>;
156
}
157
const AvanaWalletName: WalletName<'Avana'>;
158
interface AvanaWalletAdapterConfig {}
159
160
// Bitget Wallet (also exports BitKeepWalletAdapter alias)
161
class BitgetWalletAdapter extends BaseMessageSignerWalletAdapter {
162
name: WalletName<'Bitget'>;
163
}
164
const BitgetWalletName: WalletName<'Bitget'>;
165
const BitKeepWalletName: WalletName<'Bitget'>; // Alias
166
interface BitgetWalletAdapterConfig {}
167
168
169
// Clover Wallet
170
class CloverWalletAdapter extends BaseMessageSignerWalletAdapter {
171
name: WalletName<'Clover'>;
172
}
173
const CloverWalletName: WalletName<'Clover'>;
174
interface CloverWalletAdapterConfig {}
175
176
// Coin98 Wallet - Legacy transactions only
177
class Coin98WalletAdapter extends BaseMessageSignerWalletAdapter {
178
name: WalletName<'Coin98'>;
179
supportedTransactionVersions: ReadonlySet<'legacy'>;
180
}
181
const Coin98WalletName: WalletName<'Coin98'>;
182
interface Coin98WalletAdapterConfig {}
183
184
185
// Fractal Wallet
186
class FractalWalletAdapter extends BaseMessageSignerWalletAdapter {
187
name: WalletName<'Fractal'>;
188
}
189
const FractalWalletName: WalletName<'Fractal'>;
190
interface FractalWalletAdapterConfig {}
191
192
// Huobi Wallet
193
class HuobiWalletAdapter extends BaseMessageSignerWalletAdapter {
194
name: WalletName<'HuobiWallet'>;
195
}
196
const HuobiWalletName: WalletName<'HuobiWallet'>;
197
interface HuobiWalletAdapterConfig {}
198
199
// HyperPay Wallet
200
class HyperPayWalletAdapter extends BaseMessageSignerWalletAdapter {
201
name: WalletName<'HyperPay'>;
202
}
203
const HyperPayWalletName: WalletName<'HyperPay'>;
204
interface HyperPayWalletAdapterConfig {}
205
206
// Krystal Wallet
207
class KrystalWalletAdapter extends BaseMessageSignerWalletAdapter {
208
name: WalletName<'Krystal'>;
209
}
210
const KrystalWalletName: WalletName<'Krystal'>;
211
interface KrystalWalletAdapterConfig {}
212
213
214
// Neko Wallet
215
class NekoWalletAdapter extends BaseMessageSignerWalletAdapter {
216
name: WalletName<'Neko'>;
217
}
218
const NekoWalletName: WalletName<'Neko'>;
219
interface NekoWalletAdapterConfig {}
220
221
// Nightly Wallet
222
class NightlyWalletAdapter extends BaseMessageSignerWalletAdapter {
223
name: WalletName<'Nightly'>;
224
}
225
const NightlyWalletName: WalletName<'Nightly'>;
226
interface NightlyWalletAdapterConfig {}
227
228
// Nufi Wallet
229
class NufiWalletAdapter extends BaseMessageSignerWalletAdapter {
230
name: WalletName<'NuFi'>;
231
}
232
const NufiWalletName: WalletName<'NuFi'>;
233
interface NufiWalletAdapterConfig {}
234
235
// Onto Wallet
236
class OntoWalletAdapter extends BaseMessageSignerWalletAdapter {
237
name: WalletName<'ONTO'>;
238
}
239
const OntoWalletName: WalletName<'ONTO'>;
240
interface OntoWalletAdapterConfig {}
241
242
243
// Saifu Wallet
244
class SaifuWalletAdapter extends BaseMessageSignerWalletAdapter {
245
name: WalletName<'Saifu'>;
246
}
247
const SaifuWalletName: WalletName<'Saifu'>;
248
interface SaifuWalletAdapterConfig {}
249
250
// Salmon Wallet
251
class SalmonWalletAdapter extends BaseMessageSignerWalletAdapter {
252
name: WalletName<'Salmon'>;
253
}
254
const SalmonWalletName: WalletName<'Salmon'>;
255
interface SalmonWalletAdapterConfig {}
256
257
// Sky Wallet
258
class SkyWalletAdapter extends BaseMessageSignerWalletAdapter {
259
name: WalletName<'SKY Wallet'>;
260
}
261
const SkyWalletName: WalletName<'SKY Wallet'>;
262
interface SkyWalletAdapterConfig {}
263
264
265
// Spot Wallet
266
class SpotWalletAdapter extends BaseMessageSignerWalletAdapter {
267
name: WalletName<'Spot'>;
268
}
269
const SpotWalletName: WalletName<'Spot'>;
270
interface SpotWalletAdapterConfig {}
271
272
// Tokenary Wallet
273
class TokenaryWalletAdapter extends BaseMessageSignerWalletAdapter {
274
name: WalletName<'Tokenary'>;
275
}
276
const TokenaryWalletName: WalletName<'Tokenary'>;
277
interface TokenaryWalletAdapterConfig {}
278
279
// TokenPocket Wallet
280
class TokenPocketWalletAdapter extends BaseMessageSignerWalletAdapter {
281
name: WalletName<'TokenPocket'>;
282
}
283
const TokenPocketWalletName: WalletName<'TokenPocket'>;
284
interface TokenPocketWalletAdapterConfig {}
285
286
// Torus Wallet
287
class TorusWalletAdapter extends BaseMessageSignerWalletAdapter {
288
name: WalletName<'Torus'>;
289
}
290
const TorusWalletName: WalletName<'Torus'>;
291
interface TorusWalletAdapterConfig {}
292
293
// Trust Wallet
294
class TrustWalletAdapter extends BaseMessageSignerWalletAdapter {
295
name: WalletName<'Trust'>;
296
}
297
const TrustWalletName: WalletName<'Trust'>;
298
interface TrustWalletAdapterConfig {}
299
300
// XDEFI Wallet
301
class XDEFIWalletAdapter extends BaseMessageSignerWalletAdapter {
302
name: WalletName<'XDEFI'>;
303
}
304
const XDEFIWalletName: WalletName<'XDEFI'>;
305
interface XDEFIWalletAdapterConfig {}
306
```
307
308
## Usage Patterns
309
310
### Multi-Wallet Setup
311
312
```typescript
313
import {
314
PhantomWalletAdapter,
315
SolflareWalletAdapter,
316
CoinbaseWalletAdapter,
317
} from "@solana/wallet-adapter-wallets";
318
319
const wallets = [
320
new PhantomWalletAdapter(),
321
new SolflareWalletAdapter({ network: WalletAdapterNetwork.Mainnet }),
322
new CoinbaseWalletAdapter(),
323
];
324
325
// Use with wallet selection UI
326
const selectedWallet = wallets.find(w => w.name === 'Phantom');
327
await selectedWallet?.connect();
328
```
329
330
### Transaction Signing
331
332
```typescript
333
import { PhantomWalletAdapter } from "@solana/wallet-adapter-wallets";
334
import { Transaction, SystemProgram, PublicKey } from "@solana/web3.js";
335
336
const adapter = new PhantomWalletAdapter();
337
await adapter.connect();
338
339
// Create transaction
340
const transaction = new Transaction().add(
341
SystemProgram.transfer({
342
fromPubkey: adapter.publicKey!,
343
toPubkey: new PublicKey("..."),
344
lamports: 1000000,
345
})
346
);
347
348
// Sign and send
349
const signature = await adapter.sendTransaction(transaction, connection);
350
```
351
352
### Message Signing
353
354
```typescript
355
const message = new TextEncoder().encode("Verify wallet ownership");
356
const signedMessage = await adapter.signMessage(message);
357
358
// Verify signature
359
import { nacl } from "tweetnacl";
360
const isValid = nacl.sign.detached.verify(
361
message,
362
signedMessage,
363
adapter.publicKey!.toBytes()
364
);
365
```