0
# Specialized Wallets
1
2
Wallet adapters with unique features like social login integration, QR-code signing, Sign-in with Solana support, and development/testing capabilities.
3
4
## Capabilities
5
6
### Particle Wallet (Social Login)
7
8
Web3 wallet with social login integration and SDK access.
9
10
```typescript { .api }
11
/**
12
* Particle wallet adapter with social login integration
13
*/
14
class ParticleAdapter extends BaseMessageSignerWalletAdapter {
15
name: WalletName<'Particle'>;
16
url: string;
17
icon: string;
18
supportedTransactionVersions: ReadonlySet<'legacy'>;
19
20
constructor(config?: ParticleAdapterConfig);
21
22
/** Access to underlying ParticleNetwork SDK instance */
23
get particle(): ParticleNetwork;
24
25
connect(): Promise<void>;
26
disconnect(): Promise<void>;
27
sendTransaction<T extends Transaction | VersionedTransaction>(
28
transaction: T,
29
connection: Connection,
30
options?: SendTransactionOptions
31
): Promise<TransactionSignature>;
32
signTransaction<T extends Transaction | VersionedTransaction>(transaction: T): Promise<T>;
33
signAllTransactions<T extends Transaction | VersionedTransaction>(transactions: T[]): Promise<T[]>;
34
signMessage(message: Uint8Array): Promise<Uint8Array>;
35
}
36
37
const ParticleName: WalletName<'Particle'>;
38
39
interface ParticleAdapterConfig {
40
/** ParticleNetwork configuration options */
41
config?: ConstructorParameters<typeof ParticleNetwork>[0];
42
43
/** Login configuration for social authentication */
44
login?: Parameters<SolanaWallet['connect']>[0];
45
}
46
```
47
48
**Usage Example:**
49
50
```typescript
51
import { ParticleAdapter, ParticleName } from "@solana/wallet-adapter-wallets";
52
53
const adapter = new ParticleAdapter({
54
config: {
55
projectId: "your-project-id",
56
clientKey: "your-client-key",
57
appId: "your-app-id",
58
chainName: "solana",
59
chainId: 103, // Solana mainnet
60
},
61
login: {
62
loginType: "email", // or 'phone', 'google', 'facebook', etc.
63
}
64
});
65
66
await adapter.connect();
67
68
// Access Particle SDK directly
69
const userInfo = await adapter.particle.auth.getUserInfo();
70
console.log("User:", userInfo);
71
```
72
73
### Keystone Wallet (QR-Code)
74
75
Air-gapped wallet using QR-code based transaction signing.
76
77
```typescript { .api }
78
/**
79
* Keystone wallet adapter with QR-code based signing
80
*/
81
class KeystoneWalletAdapter extends BaseMessageSignerWalletAdapter {
82
name: WalletName<'Keystone'>;
83
url: string;
84
icon: string;
85
supportedTransactionVersions: ReadonlySet<TransactionVersion>;
86
87
constructor(config?: KeystoneWalletAdapterConfig);
88
89
connect(): Promise<void>;
90
disconnect(): Promise<void>;
91
sendTransaction<T extends Transaction | VersionedTransaction>(
92
transaction: T,
93
connection: Connection,
94
options?: SendTransactionOptions
95
): Promise<TransactionSignature>;
96
signTransaction<T extends Transaction | VersionedTransaction>(transaction: T): Promise<T>;
97
signAllTransactions<T extends Transaction | VersionedTransaction>(transactions: T[]): Promise<T[]>;
98
signMessage(message: Uint8Array): Promise<Uint8Array>;
99
}
100
101
const KeystoneWalletName: WalletName<'Keystone'>;
102
103
interface KeystoneWalletAdapterConfig {}
104
```
105
106
**Usage Example:**
107
108
```typescript
109
import { KeystoneWalletAdapter, KeystoneWalletName } from "@solana/wallet-adapter-wallets";
110
111
const adapter = new KeystoneWalletAdapter();
112
113
// Connect triggers QR code display for wallet connection
114
await adapter.connect();
115
116
// Transaction signing shows QR code for user to scan with Keystone device
117
const signedTx = await adapter.signTransaction(transaction);
118
```
119
120
### Unsafe Burner Wallet (Development)
121
122
Development and testing wallet with Sign-in with Solana support and in-memory keypair.
123
124
```typescript { .api }
125
/**
126
* Unsafe burner wallet for development and testing with SIWS support
127
* WARNING: Not for production use - private keys are stored in memory
128
*/
129
class UnsafeBurnerWalletAdapter extends BaseSignInMessageSignerWalletAdapter {
130
name: WalletName<'Burner Wallet'>;
131
url: string;
132
icon: string;
133
supportedTransactionVersions: ReadonlySet<TransactionVersion>;
134
135
/** No configuration required - generates keypair automatically */
136
constructor();
137
138
connect(): Promise<void>;
139
disconnect(): Promise<void>;
140
sendTransaction<T extends Transaction | VersionedTransaction>(
141
transaction: T,
142
connection: Connection,
143
options?: SendTransactionOptions
144
): Promise<TransactionSignature>;
145
signTransaction<T extends Transaction | VersionedTransaction>(transaction: T): Promise<T>;
146
signAllTransactions<T extends Transaction | VersionedTransaction>(transactions: T[]): Promise<T[]>;
147
signMessage(message: Uint8Array): Promise<Uint8Array>;
148
149
/** Sign-in with Solana (SIWS) support */
150
signIn(input?: SolanaSignInInput): Promise<SolanaSignInOutput>;
151
}
152
153
const UnsafeBurnerWalletName: WalletName<'Burner Wallet'>;
154
155
// No configuration interface - constructor takes no parameters
156
```
157
158
**Usage Example:**
159
160
```typescript
161
import { UnsafeBurnerWalletAdapter, UnsafeBurnerWalletName } from "@solana/wallet-adapter-wallets";
162
163
// No configuration needed - generates random keypair
164
const adapter = new UnsafeBurnerWalletAdapter();
165
166
await adapter.connect();
167
console.log("Generated address:", adapter.publicKey?.toString());
168
169
// Sign-in with Solana
170
const signInResult = await adapter.signIn({
171
domain: "example.com",
172
statement: "Sign in to My App"
173
});
174
175
console.log("Signed in:", signInResult.account.address);
176
```
177
178
### WalletConnect Integration
179
180
Proxy adapter that delegates to external WalletConnect Solana adapter.
181
182
```typescript { .api }
183
/**
184
* WalletConnect integration - re-exports from @walletconnect/solana-adapter
185
* This is a proxy package that delegates to the external WalletConnect library
186
*/
187
188
// All exports are re-exported from '@walletconnect/solana-adapter'
189
// Exact API depends on the WalletConnect Solana adapter version
190
```
191
192
**Usage Example:**
193
194
```typescript
195
import * as WalletConnect from "@solana/wallet-adapter-wallets";
196
197
// Usage depends on WalletConnect Solana adapter implementation
198
// Refer to @walletconnect/solana-adapter documentation
199
```
200
201
## Specialized Features
202
203
### Sign-in with Solana (SIWS)
204
205
```typescript
206
import { UnsafeBurnerWalletAdapter } from "@solana/wallet-adapter-wallets";
207
208
const adapter = new UnsafeBurnerWalletAdapter();
209
await adapter.connect();
210
211
// Create sign-in message
212
const signInData = await adapter.signIn({
213
domain: window.location.host,
214
address: adapter.publicKey!.toString(),
215
statement: "Welcome to My Solana App!",
216
uri: window.location.origin,
217
version: "1",
218
chainId: "mainnet",
219
nonce: generateNonce(),
220
issuedAt: new Date().toISOString(),
221
});
222
223
// Verify sign-in (server-side verification recommended)
224
const message = createSignInMessage(signInData);
225
const isValid = nacl.sign.detached.verify(
226
new TextEncoder().encode(message),
227
signInData.signature,
228
signInData.account.publicKey
229
);
230
```
231
232
### Social Login Integration
233
234
```typescript
235
import { ParticleAdapter } from "@solana/wallet-adapter-wallets";
236
237
const adapter = new ParticleAdapter({
238
config: {
239
projectId: process.env.PARTICLE_PROJECT_ID,
240
clientKey: process.env.PARTICLE_CLIENT_KEY,
241
appId: process.env.PARTICLE_APP_ID,
242
chainName: "solana",
243
chainId: 103,
244
},
245
login: {
246
loginType: "google", // Social login provider
247
account: "user@example.com" // Optional pre-fill
248
}
249
});
250
251
// Connect triggers social login flow
252
await adapter.connect();
253
254
// Access user information
255
const userInfo = await adapter.particle.auth.getUserInfo();
256
console.log("Social login user:", {
257
uuid: userInfo.uuid,
258
email: userInfo.email,
259
name: userInfo.name,
260
avatar: userInfo.avatar
261
});
262
```
263
264
### QR-Code Signing Workflow
265
266
```typescript
267
import { KeystoneWalletAdapter } from "@solana/wallet-adapter-wallets";
268
269
const adapter = new KeystoneWalletAdapter();
270
271
// Connect shows QR code for pairing
272
await adapter.connect();
273
274
// Signing shows QR code with transaction data
275
// User scans with Keystone device, signs, and shows result QR code
276
const signedTransaction = await adapter.signTransaction(transaction);
277
278
// Implementation handles QR code display/scanning automatically
279
```
280
281
### Development Testing
282
283
```typescript
284
import { UnsafeBurnerWalletAdapter } from "@solana/wallet-adapter-wallets";
285
286
// Create multiple test wallets
287
const testWallets = Array.from({ length: 3 }, () => new UnsafeBurnerWalletAdapter());
288
289
await Promise.all(testWallets.map(wallet => wallet.connect()));
290
291
console.log("Test wallet addresses:",
292
testWallets.map(wallet => wallet.publicKey?.toString())
293
);
294
295
// Use for automated testing, development, demos
296
// WARNING: Never use in production - keys are not secure
297
```
298
299
## Configuration Patterns
300
301
### Environment-Based Configuration
302
303
```typescript
304
// Production vs development wallet selection
305
const createWallet = () => {
306
if (process.env.NODE_ENV === 'development') {
307
return new UnsafeBurnerWalletAdapter();
308
}
309
310
return new PhantomWalletAdapter();
311
};
312
313
const adapter = createWallet();
314
```
315
316
### Feature Detection
317
318
```typescript
319
// Check for specialized capabilities
320
const hasSignIn = 'signIn' in adapter; // SIWS support
321
const hasParticleSDK = 'particle' in adapter; // Social login
322
const isHardware = adapter instanceof BaseSignerWalletAdapter; // Hardware wallet
323
```