@reown/appkit-solana-react-native 2.0.0-alpha.3 → 2.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/lib/commonjs/adapter.js +3 -3
  2. package/lib/commonjs/adapter.js.map +1 -1
  3. package/lib/commonjs/connectors/DeeplinkConnector.js +271 -0
  4. package/lib/commonjs/connectors/DeeplinkConnector.js.map +1 -0
  5. package/lib/commonjs/connectors/PhantomConnector.js +15 -230
  6. package/lib/commonjs/connectors/PhantomConnector.js.map +1 -1
  7. package/lib/commonjs/connectors/SolflareConnector.js +36 -0
  8. package/lib/commonjs/connectors/SolflareConnector.js.map +1 -0
  9. package/lib/commonjs/index.js +7 -0
  10. package/lib/commonjs/index.js.map +1 -1
  11. package/lib/commonjs/providers/{PhantomProvider.js → DeeplinkProvider.js} +155 -154
  12. package/lib/commonjs/providers/DeeplinkProvider.js.map +1 -0
  13. package/lib/module/adapter.js +3 -3
  14. package/lib/module/adapter.js.map +1 -1
  15. package/lib/module/connectors/DeeplinkConnector.js +265 -0
  16. package/lib/module/connectors/DeeplinkConnector.js.map +1 -0
  17. package/lib/module/connectors/PhantomConnector.js +16 -230
  18. package/lib/module/connectors/PhantomConnector.js.map +1 -1
  19. package/lib/module/connectors/SolflareConnector.js +31 -0
  20. package/lib/module/connectors/SolflareConnector.js.map +1 -0
  21. package/lib/module/index.js +1 -0
  22. package/lib/module/index.js.map +1 -1
  23. package/lib/module/providers/{PhantomProvider.js → DeeplinkProvider.js} +153 -152
  24. package/lib/module/providers/DeeplinkProvider.js.map +1 -0
  25. package/lib/typescript/connectors/DeeplinkConnector.d.ts +30 -0
  26. package/lib/typescript/connectors/DeeplinkConnector.d.ts.map +1 -0
  27. package/lib/typescript/connectors/PhantomConnector.d.ts +8 -23
  28. package/lib/typescript/connectors/PhantomConnector.d.ts.map +1 -1
  29. package/lib/typescript/connectors/SolflareConnector.d.ts +12 -0
  30. package/lib/typescript/connectors/SolflareConnector.d.ts.map +1 -0
  31. package/lib/typescript/index.d.ts +2 -1
  32. package/lib/typescript/index.d.ts.map +1 -1
  33. package/lib/typescript/providers/{PhantomProvider.d.ts → DeeplinkProvider.d.ts} +16 -8
  34. package/lib/typescript/providers/DeeplinkProvider.d.ts.map +1 -0
  35. package/lib/typescript/types.d.ts +27 -32
  36. package/lib/typescript/types.d.ts.map +1 -1
  37. package/package.json +5 -4
  38. package/src/adapter.ts +3 -3
  39. package/src/connectors/DeeplinkConnector.ts +353 -0
  40. package/src/connectors/PhantomConnector.ts +17 -313
  41. package/src/connectors/SolflareConnector.ts +33 -0
  42. package/src/index.ts +2 -1
  43. package/src/providers/{PhantomProvider.ts → DeeplinkProvider.ts} +256 -233
  44. package/src/types.ts +29 -37
  45. package/lib/commonjs/providers/PhantomProvider.js.map +0 -1
  46. package/lib/module/providers/PhantomProvider.js.map +0 -1
  47. package/lib/typescript/providers/PhantomProvider.d.ts.map +0 -1
@@ -5,8 +5,6 @@ import nacl from 'tweetnacl';
5
5
  import bs58 from 'bs58';
6
6
  import { Buffer } from 'buffer';
7
7
  import EventEmitter from 'events';
8
- const PHANTOM_BASE_URL = 'https://phantom.app/ul/v1';
9
- const PHANTOM_PROVIDER_STORAGE_KEY = '@appkit/phantom-provider-session';
10
8
  export const SOLANA_SIGNING_METHODS = {
11
9
  SOLANA_SIGN_TRANSACTION: 'solana_signTransaction',
12
10
  SOLANA_SIGN_MESSAGE: 'solana_signMessage',
@@ -16,11 +14,11 @@ export const SOLANA_SIGNING_METHODS = {
16
14
  function isValidSolanaSigningMethod(method) {
17
15
  return Object.values(SOLANA_SIGNING_METHODS).includes(method);
18
16
  }
19
- export class PhantomProvider extends EventEmitter {
20
- currentCluster = 'mainnet-beta';
17
+ export class DeeplinkProvider extends EventEmitter {
18
+ sharedKey = null;
21
19
  sessionToken = null;
22
20
  userPublicKey = null;
23
- phantomEncryptionPublicKeyBs58 = null;
21
+ walletEncryptionPublicKeyBs58 = null;
24
22
 
25
23
  // Single subscription management - deep links are sequential by nature
26
24
  activeSubscription = null;
@@ -28,9 +26,13 @@ export class PhantomProvider extends EventEmitter {
28
26
  constructor(config) {
29
27
  super();
30
28
  this.config = config;
29
+ this.currentCluster = config.cluster ?? 'mainnet-beta';
31
30
  this.dappEncryptionKeyPair = config.dappEncryptionKeyPair;
32
31
  this.storage = config.storage;
33
32
  }
33
+ getSessionStorageKey() {
34
+ return `@appkit/${this.config.type}-provider-session`;
35
+ }
34
36
 
35
37
  /**
36
38
  * Cleanup method to be called when the provider is destroyed
@@ -68,9 +70,47 @@ export class PhantomProvider extends EventEmitter {
68
70
  isConnected() {
69
71
  return !!this.sessionToken && !!this.userPublicKey && !!this.dappEncryptionKeyPair;
70
72
  }
73
+ getCurrentCluster() {
74
+ return this.currentCluster;
75
+ }
71
76
  buildUrl(rpcMethod, params) {
72
77
  const query = new URLSearchParams(params).toString();
73
- return `${PHANTOM_BASE_URL}/${rpcMethod}?${query}`;
78
+ return `${this.config.baseUrl}/${rpcMethod}?${query}`;
79
+ }
80
+
81
+ /**
82
+ * Open a deeplink URL and wait for a redirect back to the app. Handles subscription
83
+ * lifecycle and common error extraction from `errorCode`/`errorMessage` query params.
84
+ */
85
+ async openDeeplinkAndWait(deeplinkUrl, processParams, contextLabel) {
86
+ return new Promise((resolve, reject) => {
87
+ const handleDeepLink = async event => {
88
+ try {
89
+ this.cleanupActiveSubscription();
90
+ const fullUrl = event.url;
91
+ if (!fullUrl.startsWith(this.config.appScheme)) {
92
+ return reject(new Error(`${this.config.type} provider: ${contextLabel}: Unexpected redirect URI.`));
93
+ }
94
+ const params = new URLSearchParams(fullUrl.substring(fullUrl.indexOf('?') + 1));
95
+ const errorCode = params.get('errorCode');
96
+ const errorMessage = params.get('errorMessage');
97
+ if (errorCode) {
98
+ return reject(new Error(`${this.config.type} provider: ${contextLabel} Failed: ${errorMessage || 'Unknown error'} (Code: ${errorCode})`));
99
+ }
100
+ const result = await Promise.resolve(processParams(params));
101
+ resolve(result);
102
+ } catch (error) {
103
+ this.cleanupActiveSubscription();
104
+ reject(error);
105
+ }
106
+ };
107
+ const subscription = Linking.addEventListener('url', handleDeepLink);
108
+ this.setActiveSubscription(subscription);
109
+ Linking.openURL(deeplinkUrl).catch(err => {
110
+ this.cleanupActiveSubscription();
111
+ reject(new Error(`${this.config.type} provider: Failed to open wallet for ${contextLabel}: ${err.message}.`));
112
+ });
113
+ });
74
114
  }
75
115
  getRpcMethodName(method) {
76
116
  switch (method) {
@@ -87,73 +127,94 @@ export class PhantomProvider extends EventEmitter {
87
127
  throw new Error(`Unsupported Solana signing method: ${method}`);
88
128
  }
89
129
  }
90
- encryptPayload(payload, phantomPublicKeyBs58ToEncryptFor) {
91
- if (!phantomPublicKeyBs58ToEncryptFor) {
130
+ encryptPayload(payload, walletPublicKeyBs58) {
131
+ if (!walletPublicKeyBs58) {
92
132
  return null;
93
133
  }
94
134
  try {
95
- const phantomPublicKeyBytes = bs58.decode(phantomPublicKeyBs58ToEncryptFor);
96
135
  const nonce = nacl.randomBytes(nacl.box.nonceLength);
97
136
  const payloadBytes = Buffer.from(JSON.stringify(payload), 'utf8');
98
- const encryptedPayload = nacl.box(payloadBytes, nonce, phantomPublicKeyBytes, this.dappEncryptionKeyPair.secretKey);
137
+ let encryptedPayload;
138
+ if (this.sharedKey) {
139
+ encryptedPayload = nacl.box.after(payloadBytes, nonce, this.sharedKey);
140
+ } else {
141
+ const walletPublicKeyBytes = bs58.decode(walletPublicKeyBs58);
142
+ encryptedPayload = nacl.box(payloadBytes, nonce, walletPublicKeyBytes, this.dappEncryptionKeyPair.secretKey);
143
+ }
99
144
  return {
100
145
  nonce: bs58.encode(nonce),
101
146
  encryptedPayload: bs58.encode(encryptedPayload)
102
147
  };
103
148
  } catch (error) {
149
+ console.warn(`${this.config.type} provider: Failed to encrypt payload.`, error);
104
150
  return null;
105
151
  }
106
152
  }
107
- decryptPayload(encryptedDataBs58, nonceBs58, phantomSenderPublicKeyBs58) {
153
+ decryptPayload(encryptedDataBs58, nonceBs58, walletSenderPublicKeyBs58) {
108
154
  try {
109
- const encryptedDataBytes = bs58.decode(encryptedDataBs58);
155
+ const formattedEncryptedDataBs58 = encryptedDataBs58.replace('#', '');
156
+ const encryptedDataBytes = bs58.decode(formattedEncryptedDataBs58);
110
157
  const nonceBytes = bs58.decode(nonceBs58);
111
- const phantomSenderPublicKeyBytes = bs58.decode(phantomSenderPublicKeyBs58);
112
- const decryptedPayloadBytes = nacl.box.open(encryptedDataBytes, nonceBytes, phantomSenderPublicKeyBytes, this.dappEncryptionKeyPair.secretKey);
158
+ let decryptedPayloadBytes;
159
+ if (this.sharedKey) {
160
+ decryptedPayloadBytes = nacl.box.open.after(encryptedDataBytes, nonceBytes, this.sharedKey);
161
+ } else {
162
+ const walletSenderPublicKeyBytes = bs58.decode(walletSenderPublicKeyBs58);
163
+ decryptedPayloadBytes = nacl.box.open(encryptedDataBytes, nonceBytes, walletSenderPublicKeyBytes, this.dappEncryptionKeyPair.secretKey);
164
+ }
113
165
  if (!decryptedPayloadBytes) {
114
166
  return null;
115
167
  }
116
168
  return JSON.parse(Buffer.from(decryptedPayloadBytes).toString('utf8'));
117
169
  } catch (error) {
170
+ console.warn(`${this.config.type} provider: Failed to decrypt payload.`, error);
118
171
  return null;
119
172
  }
120
173
  }
121
174
  async restoreSession() {
122
175
  try {
123
- const session = await this.storage.getItem(PHANTOM_PROVIDER_STORAGE_KEY);
176
+ const session = await this.storage.getItem(this.getSessionStorageKey());
124
177
  if (session) {
125
178
  this.setSession(session);
179
+
180
+ // Recompute shared key on session restore
181
+ try {
182
+ const walletPublicKeyBytes = bs58.decode(session.walletEncryptionPublicKeyBs58);
183
+ this.sharedKey = nacl.box.before(walletPublicKeyBytes, this.dappEncryptionKeyPair.secretKey);
184
+ } catch (e) {
185
+ this.sharedKey = null;
186
+ }
126
187
  return true;
127
188
  }
128
189
  return false;
129
190
  } catch (error) {
130
- // console.error('PhantomProvider: Failed to restore session.', error);
191
+ // console.error(`${this.config.type} provider: Failed to restore session.`, error);
131
192
  await this.clearSessionStorage(); // Clear potentially corrupt data
132
193
 
133
194
  return false;
134
195
  }
135
196
  }
136
197
  async saveSession() {
137
- if (!this.sessionToken || !this.userPublicKey || !this.phantomEncryptionPublicKeyBs58) {
198
+ if (!this.sessionToken || !this.userPublicKey || !this.walletEncryptionPublicKeyBs58) {
138
199
  return; // Cannot save incomplete session
139
200
  }
140
201
  const session = {
141
202
  sessionToken: this.sessionToken,
142
203
  userPublicKey: this.userPublicKey,
143
- phantomEncryptionPublicKeyBs58: this.phantomEncryptionPublicKeyBs58,
204
+ walletEncryptionPublicKeyBs58: this.walletEncryptionPublicKeyBs58,
144
205
  cluster: this.currentCluster
145
206
  };
146
207
  try {
147
- await this.storage.setItem(PHANTOM_PROVIDER_STORAGE_KEY, session);
208
+ await this.storage.setItem(this.getSessionStorageKey(), session);
148
209
  } catch (error) {
149
- // console.error('PhantomProvider: Failed to save session.', error);
210
+ // console.error(`${this.config.type} provider: Failed to save session.`, error);
150
211
  }
151
212
  }
152
213
  async clearSessionStorage() {
153
214
  try {
154
- await this.storage.removeItem(PHANTOM_PROVIDER_STORAGE_KEY);
215
+ await this.storage.removeItem(this.getSessionStorageKey());
155
216
  } catch (error) {
156
- // console.error('PhantomProvider: Failed to clear session storage.', error);
217
+ // console.error(`${this.config.type} provider: Failed to clear session storage.`, error);
157
218
  }
158
219
  }
159
220
  async connect(params) {
@@ -166,60 +227,43 @@ export class PhantomProvider extends EventEmitter {
166
227
  cluster
167
228
  };
168
229
  const url = this.buildUrl('connect', connectDeeplinkParams);
169
- return new Promise((resolve, reject) => {
170
- const handleDeepLink = async event => {
171
- try {
172
- this.cleanupActiveSubscription();
173
- const fullUrl = event.url;
174
- if (fullUrl.startsWith(this.config.appScheme)) {
175
- const responseUrlParams = new URLSearchParams(fullUrl.substring(fullUrl.indexOf('?') + 1));
176
- const errorCode = responseUrlParams.get('errorCode');
177
- const errorMessage = responseUrlParams.get('errorMessage');
178
- if (errorCode) {
179
- return reject(new Error(`Phantom Connection Failed: ${errorMessage || 'Unknown error'} (Code: ${errorCode})`));
180
- }
181
- const responsePayload = {
182
- phantom_encryption_public_key: responseUrlParams.get('phantom_encryption_public_key'),
183
- nonce: responseUrlParams.get('nonce'),
184
- data: responseUrlParams.get('data')
185
- };
186
- if (!responsePayload.phantom_encryption_public_key || !responsePayload.nonce || !responsePayload.data) {
187
- return reject(new Error('Phantom Connect: Invalid response - missing parameters.'));
188
- }
189
- const decryptedData = this.decryptPayload(responsePayload.data, responsePayload.nonce, responsePayload.phantom_encryption_public_key);
190
- if (!decryptedData || !decryptedData.public_key || !decryptedData.session) {
191
- return reject(new Error('Phantom Connect: Failed to decrypt or invalid decrypted data.'));
192
- }
193
- this.userPublicKey = decryptedData.public_key;
194
- this.sessionToken = decryptedData.session;
195
- this.phantomEncryptionPublicKeyBs58 = responsePayload.phantom_encryption_public_key;
230
+ return this.openDeeplinkAndWait(url, responseUrlParams => {
231
+ const responsePayload = {
232
+ wallet_encryption_public_key: responseUrlParams.get(this.config.encryptionKeyFieldName),
233
+ nonce: responseUrlParams.get('nonce'),
234
+ data: responseUrlParams.get('data')
235
+ };
236
+ if (!responsePayload.wallet_encryption_public_key || !responsePayload.nonce || !responsePayload.data) {
237
+ throw new Error(`${this.config.type} provider: Invalid response - missing parameters.`);
238
+ }
239
+ const decryptedData = this.decryptPayload(responsePayload.data, responsePayload.nonce, responsePayload.wallet_encryption_public_key);
240
+ if (!decryptedData || !decryptedData.public_key || !decryptedData.session) {
241
+ throw new Error(`${this.config.type} provider: Failed to decrypt or invalid decrypted data.`);
242
+ }
243
+ this.userPublicKey = decryptedData.public_key;
244
+ this.sessionToken = decryptedData.session;
245
+ this.walletEncryptionPublicKeyBs58 = responsePayload.wallet_encryption_public_key;
196
246
 
197
- // Save session on successful connect
198
- this.saveSession();
199
- resolve({
200
- userPublicKey: this.userPublicKey,
201
- sessionToken: this.sessionToken,
202
- phantomEncryptionPublicKeyBs58: this.phantomEncryptionPublicKeyBs58,
203
- cluster
204
- });
205
- } else {
206
- reject(new Error('Phantom Connect: Unexpected redirect URI.'));
207
- }
208
- } catch (error) {
209
- this.cleanupActiveSubscription();
210
- reject(error);
211
- }
247
+ // Precompute shared key for subsequent communications
248
+ try {
249
+ const walletPublicKeyBytes = bs58.decode(this.walletEncryptionPublicKeyBs58);
250
+ this.sharedKey = nacl.box.before(walletPublicKeyBytes, this.dappEncryptionKeyPair.secretKey);
251
+ } catch (e) {
252
+ this.sharedKey = null;
253
+ }
254
+
255
+ // Save session on successful connect
256
+ this.saveSession();
257
+ return {
258
+ userPublicKey: this.userPublicKey,
259
+ sessionToken: this.sessionToken,
260
+ walletEncryptionPublicKeyBs58: this.walletEncryptionPublicKeyBs58,
261
+ cluster
212
262
  };
213
- const subscription = Linking.addEventListener('url', handleDeepLink);
214
- this.setActiveSubscription(subscription);
215
- Linking.openURL(url).catch(err => {
216
- this.cleanupActiveSubscription();
217
- reject(new Error(`Failed to open Phantom wallet: ${err.message}. Is it installed?`));
218
- });
219
- });
263
+ }, 'Connection');
220
264
  }
221
265
  async disconnect() {
222
- if (!this.sessionToken || !this.phantomEncryptionPublicKeyBs58) {
266
+ if (!this.sessionToken || !this.walletEncryptionPublicKeyBs58) {
223
267
  await this.clearSession();
224
268
  this.emit('disconnect');
225
269
  return Promise.resolve();
@@ -227,9 +271,9 @@ export class PhantomProvider extends EventEmitter {
227
271
  const payloadToEncrypt = {
228
272
  session: this.sessionToken
229
273
  };
230
- const encryptedDisconnectPayload = this.encryptPayload(payloadToEncrypt, this.phantomEncryptionPublicKeyBs58);
274
+ const encryptedDisconnectPayload = this.encryptPayload(payloadToEncrypt, this.walletEncryptionPublicKeyBs58);
231
275
  if (!encryptedDisconnectPayload) {
232
- // console.warn('PhantomProvider: Failed to encrypt disconnect payload. Clearing session locally.');
276
+ // console.warn(`${this.config.type} provider: Failed to encrypt disconnect payload. Clearing session locally.`);
233
277
  await this.clearSession();
234
278
  this.emit('disconnect');
235
279
  return Promise.resolve(); // Or reject, depending on desired strictness
@@ -241,53 +285,35 @@ export class PhantomProvider extends EventEmitter {
241
285
  nonce: encryptedDisconnectPayload.nonce
242
286
  };
243
287
  const url = this.buildUrl('disconnect', disconnectDeeplinkParams);
244
- return new Promise((resolve, reject) => {
245
- const handleDeepLink = event => {
246
- try {
247
- this.cleanupActiveSubscription();
248
- if (event.url.startsWith(this.config.appScheme)) {
249
- this.clearSession();
250
- resolve();
251
- } else {
252
- this.clearSession();
253
- reject(new Error('Phantom Disconnect: Unexpected redirect URI.'));
254
- }
255
- } catch (error) {
256
- this.cleanupActiveSubscription();
257
- this.clearSession();
258
- reject(error);
259
- }
260
- };
261
- const subscription = Linking.addEventListener('url', handleDeepLink);
262
- this.setActiveSubscription(subscription);
263
- Linking.openURL(url).catch(err => {
264
- this.cleanupActiveSubscription();
265
- this.clearSession();
266
- reject(new Error(`Failed to open Phantom for disconnection: ${err.message}.`));
267
- });
268
- });
288
+ return this.openDeeplinkAndWait(url, () => {
289
+ this.clearSession();
290
+ }, 'Disconnection');
269
291
  }
270
292
  async clearSession() {
271
293
  this.sessionToken = null;
272
294
  this.userPublicKey = null;
273
- this.phantomEncryptionPublicKeyBs58 = null;
295
+ this.walletEncryptionPublicKeyBs58 = null;
296
+ if (this.sharedKey) {
297
+ this.sharedKey.fill(0);
298
+ }
299
+ this.sharedKey = null;
274
300
  this.cleanupActiveSubscription();
275
301
  await this.clearSessionStorage();
276
302
  }
277
303
  setSession(session) {
278
304
  this.sessionToken = session.sessionToken;
279
305
  this.userPublicKey = session.userPublicKey;
280
- this.phantomEncryptionPublicKeyBs58 = session.phantomEncryptionPublicKeyBs58;
306
+ this.walletEncryptionPublicKeyBs58 = session.walletEncryptionPublicKeyBs58;
281
307
  this.currentCluster = session.cluster;
282
308
  }
283
309
  async request(args, _chainId) {
284
310
  if (!isValidSolanaSigningMethod(args.method)) {
285
- throw new Error(`PhantomProvider: Unsupported method: ${args.method}. Only Solana signing methods are supported.`);
311
+ throw new Error(`${this.config.type} provider: Unsupported method: ${args.method}. Only Solana signing methods are supported.`);
286
312
  }
287
313
  const signingMethod = args.method;
288
314
  const requestParams = args.params;
289
- if (!this.isConnected() || !this.sessionToken || !this.phantomEncryptionPublicKeyBs58) {
290
- throw new Error('PhantomProvider: Not connected or session details missing. Cannot process request.');
315
+ if (!this.isConnected() || !this.sessionToken || !this.walletEncryptionPublicKeyBs58) {
316
+ throw new Error(`${this.config.type} provider: Not connected or session details missing. Cannot process request.`);
291
317
  }
292
318
  const rpcMethodName = this.getRpcMethodName(signingMethod);
293
319
  let deeplinkUrl = '';
@@ -303,9 +329,9 @@ export class PhantomProvider extends EventEmitter {
303
329
  session: this.sessionToken,
304
330
  transaction: typedParams.transaction
305
331
  };
306
- const encryptedData = this.encryptPayload(dataToEncrypt, this.phantomEncryptionPublicKeyBs58);
332
+ const encryptedData = this.encryptPayload(dataToEncrypt, this.walletEncryptionPublicKeyBs58);
307
333
  if (!encryptedData) {
308
- throw new Error(`PhantomProvider: Failed to encrypt payload for ${signingMethod}.`);
334
+ throw new Error(`${this.config.type} provider: Failed to encrypt payload for ${signingMethod}.`);
309
335
  }
310
336
  const signTxDeeplinkParams = {
311
337
  dapp_encryption_public_key: bs58.encode(this.dappEncryptionKeyPair.publicKey),
@@ -321,7 +347,7 @@ export class PhantomProvider extends EventEmitter {
321
347
  {
322
348
  const typedParams = requestParams;
323
349
  if (!typedParams || typeof typedParams.message === 'undefined') {
324
- throw new Error(`Missing 'message' in params for ${signingMethod}`);
350
+ throw new Error(`${this.config.type} provider: Missing 'message' in params for ${signingMethod}`);
325
351
  }
326
352
  let messageBs58;
327
353
  if (typedParams.message instanceof Uint8Array) {
@@ -334,16 +360,16 @@ export class PhantomProvider extends EventEmitter {
334
360
  messageBs58 = bs58.encode(Buffer.from(typedParams.message));
335
361
  }
336
362
  } else {
337
- throw new Error('Invalid message format for signMessage. Expected Uint8Array or string.');
363
+ throw new Error(`${this.config.type} provider: Invalid message format for signMessage. Expected Uint8Array or string.`);
338
364
  }
339
365
  const dataToEncrypt = {
340
366
  message: messageBs58,
341
367
  session: this.sessionToken,
342
368
  display: typedParams.display || 'utf8'
343
369
  };
344
- const encryptedPayloadData = this.encryptPayload(dataToEncrypt, this.phantomEncryptionPublicKeyBs58);
370
+ const encryptedPayloadData = this.encryptPayload(dataToEncrypt, this.walletEncryptionPublicKeyBs58);
345
371
  if (!encryptedPayloadData) {
346
- throw new Error('PhantomProvider: Failed to encrypt payload for signMessage.');
372
+ throw new Error(`${this.config.type} provider: Failed to encrypt payload for signMessage.`);
347
373
  }
348
374
  const signMsgDeeplinkQueryPayload = {
349
375
  dapp_encryption_public_key: bs58.encode(this.dappEncryptionKeyPair.publicKey),
@@ -358,15 +384,15 @@ export class PhantomProvider extends EventEmitter {
358
384
  {
359
385
  const typedParams = requestParams;
360
386
  if (!typedParams || !Array.isArray(typedParams.transactions) || !typedParams.transactions.every(t => typeof t === 'string')) {
361
- throw new Error(`Missing or invalid 'transactions' (array of base58 strings) in params for ${signingMethod}`);
387
+ throw new Error(`${this.config.type} provider: Missing or invalid 'transactions' (array of base58 strings) in params for ${signingMethod}`);
362
388
  }
363
389
  const dataToEncrypt = {
364
390
  session: this.sessionToken,
365
391
  transactions: typedParams.transactions
366
392
  };
367
- const encryptedData = this.encryptPayload(dataToEncrypt, this.phantomEncryptionPublicKeyBs58);
393
+ const encryptedData = this.encryptPayload(dataToEncrypt, this.walletEncryptionPublicKeyBs58);
368
394
  if (!encryptedData) {
369
- throw new Error(`PhantomProvider: Failed to encrypt payload for ${signingMethod}.`);
395
+ throw new Error(`${this.config.type} provider: Failed to encrypt payload for ${signingMethod}.`);
370
396
  }
371
397
  const signAllTxDeeplinkParams = {
372
398
  dapp_encryption_public_key: bs58.encode(this.dappEncryptionKeyPair.publicKey),
@@ -380,46 +406,21 @@ export class PhantomProvider extends EventEmitter {
380
406
  }
381
407
  default:
382
408
  {
383
- throw new Error(`PhantomProvider: Unhandled signing method: ${signingMethod}`);
409
+ throw new Error(`${this.config.type} provider: Unhandled signing method: ${signingMethod}`);
384
410
  }
385
411
  }
386
- return new Promise((resolve, reject) => {
387
- const handleDeepLink = async event => {
388
- try {
389
- this.cleanupActiveSubscription();
390
- const fullUrl = event.url;
391
- if (fullUrl.startsWith(this.config.appScheme)) {
392
- const responseUrlParams = new URLSearchParams(fullUrl.substring(fullUrl.indexOf('?') + 1));
393
- const errorCode = responseUrlParams.get('errorCode');
394
- const errorMessage = responseUrlParams.get('errorMessage');
395
- if (errorCode) {
396
- return reject(new Error(`Phantom ${signingMethod} Failed: ${errorMessage || 'Unknown error'} (Code: ${errorCode})`));
397
- }
398
- const responseNonce = responseUrlParams.get('nonce');
399
- const responseData = responseUrlParams.get('data');
400
- if (!responseNonce || !responseData) {
401
- return reject(new Error(`Phantom ${signingMethod}: Invalid response - missing nonce or data.`));
402
- }
403
- const decryptedResult = this.decryptPayload(responseData, responseNonce, this.phantomEncryptionPublicKeyBs58);
404
- if (!decryptedResult) {
405
- return reject(new Error(`Phantom ${signingMethod}: Failed to decrypt response or invalid decrypted data.`));
406
- }
407
- resolve(decryptedResult);
408
- } else {
409
- reject(new Error(`Phantom ${signingMethod}: Unexpected redirect URI.`));
410
- }
411
- } catch (error) {
412
- this.cleanupActiveSubscription();
413
- reject(error);
414
- }
415
- };
416
- const subscription = Linking.addEventListener('url', handleDeepLink);
417
- this.setActiveSubscription(subscription);
418
- Linking.openURL(deeplinkUrl).catch(err => {
419
- this.cleanupActiveSubscription();
420
- reject(new Error(`Failed to open Phantom for ${signingMethod}: ${err.message}. Is it installed?`));
421
- });
422
- });
412
+ return this.openDeeplinkAndWait(deeplinkUrl, responseUrlParams => {
413
+ const responseNonce = responseUrlParams.get('nonce');
414
+ const responseData = responseUrlParams.get('data');
415
+ if (!responseNonce || !responseData) {
416
+ throw new Error(`${this.config.type} provider: ${signingMethod}: Invalid response - missing nonce or data.`);
417
+ }
418
+ const decryptedResult = this.decryptPayload(responseData, responseNonce, this.walletEncryptionPublicKeyBs58);
419
+ if (!decryptedResult) {
420
+ throw new Error(`${this.config.type} provider: ${signingMethod}: Failed to decrypt response or invalid decrypted data.`);
421
+ }
422
+ return decryptedResult;
423
+ }, signingMethod);
423
424
  }
424
425
  }
425
- //# sourceMappingURL=PhantomProvider.js.map
426
+ //# sourceMappingURL=DeeplinkProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Linking","nacl","bs58","Buffer","EventEmitter","SOLANA_SIGNING_METHODS","SOLANA_SIGN_TRANSACTION","SOLANA_SIGN_MESSAGE","SOLANA_SIGN_AND_SEND_TRANSACTION","SOLANA_SIGN_ALL_TRANSACTIONS","isValidSolanaSigningMethod","method","Object","values","includes","DeeplinkProvider","sharedKey","sessionToken","userPublicKey","walletEncryptionPublicKeyBs58","activeSubscription","isOperationPending","constructor","config","currentCluster","cluster","dappEncryptionKeyPair","storage","getSessionStorageKey","type","destroy","cleanupActiveSubscription","removeAllListeners","remove","setActiveSubscription","subscription","getUserPublicKey","isConnected","getCurrentCluster","buildUrl","rpcMethod","params","query","URLSearchParams","toString","baseUrl","openDeeplinkAndWait","deeplinkUrl","processParams","contextLabel","Promise","resolve","reject","handleDeepLink","event","fullUrl","url","startsWith","appScheme","Error","substring","indexOf","errorCode","get","errorMessage","result","error","addEventListener","openURL","catch","err","message","getRpcMethodName","encryptPayload","payload","walletPublicKeyBs58","nonce","randomBytes","box","nonceLength","payloadBytes","from","JSON","stringify","encryptedPayload","after","walletPublicKeyBytes","decode","secretKey","encode","console","warn","decryptPayload","encryptedDataBs58","nonceBs58","walletSenderPublicKeyBs58","formattedEncryptedDataBs58","replace","encryptedDataBytes","nonceBytes","decryptedPayloadBytes","open","walletSenderPublicKeyBytes","parse","restoreSession","session","getItem","setSession","before","e","clearSessionStorage","saveSession","setItem","removeItem","connect","connectDeeplinkParams","app_url","dappUrl","dapp_encryption_public_key","publicKey","redirect_link","responseUrlParams","responsePayload","wallet_encryption_public_key","encryptionKeyFieldName","data","decryptedData","public_key","disconnect","clearSession","emit","payloadToEncrypt","encryptedDisconnectPayload","disconnectDeeplinkParams","fill","request","args","_chainId","signingMethod","requestParams","rpcMethodName","typedParams","transaction","dataToEncrypt","encryptedData","signTxDeeplinkParams","messageBs58","Uint8Array","display","encryptedPayloadData","signMsgDeeplinkQueryPayload","Array","isArray","transactions","every","t","signAllTxDeeplinkParams","responseNonce","responseData","decryptedResult"],"sourceRoot":"../../../src","sources":["providers/DeeplinkProvider.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,cAAc;AACtC,OAAOC,IAAI,MAAM,WAAW;AAC5B,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,MAAM,QAAQ,QAAQ;AAwB/B,OAAOC,YAAY,MAAM,QAAQ;AAEjC,OAAO,MAAMC,sBAAsB,GAAG;EACpCC,uBAAuB,EAAE,wBAAwB;EACjDC,mBAAmB,EAAE,oBAAoB;EACzCC,gCAAgC,EAAE,+BAA+B;EACjEC,4BAA4B,EAAE;AAChC,CAAU;AAIV,SAASC,0BAA0BA,CAACC,MAAc,EAAiC;EACjF,OAAOC,MAAM,CAACC,MAAM,CAACR,sBAAsB,CAAC,CAACS,QAAQ,CAACH,MAA6B,CAAC;AACtF;AAEA,OAAO,MAAMI,gBAAgB,SAASX,YAAY,CAAqB;EAI7DY,SAAS,GAAsB,IAAI;EAInCC,YAAY,GAAkB,IAAI;EAClCC,aAAa,GAAkB,IAAI;EACnCC,6BAA6B,GAAkB,IAAI;;EAE3D;EACQC,kBAAkB,GAAkC,IAAI;EACxDC,kBAAkB,GAAG,KAAK;EAElCC,WAAWA,CAACC,MAA8B,EAAE;IAC1C,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,cAAc,GAAGD,MAAM,CAACE,OAAO,IAAI,cAAc;IACtD,IAAI,CAACC,qBAAqB,GAAGH,MAAM,CAACG,qBAAqB;IACzD,IAAI,CAACC,OAAO,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AAS;UACP,MAAM,IAAIjG,KAAK,CAAC,GAAG,IAAI,CAACpC,MAAM,CAACM,IAAI,wCAAwC6G,aAAa,EAAE,CAAC;QAC7F;IACF;IAEA,OAAO,IAAI,CAAC5F,mBAAmB,CAC7BC,WAAW,EACV0E,iBAAkC,IAAK;MACtC,MAAMoC,aAAa,GAAGpC,iBAAiB,CAAC1D,GAAG,CAAC,OAAO,CAAC;MACpD,MAAM+F,YAAY,GAAGrC,iBAAiB,CAAC1D,GAAG,CAAC,MAAM,CAAC;MAClD,IAAI,CAAC8F,aAAa,IAAI,CAACC,YAAY,EAAE;QACnC,MAAM,IAAInG,KAAK,CACb,GAAG,IAAI,CAACpC,MAAM,CAACM,IAAI,cAAc6G,aAAa,6CAChD,CAAC;MACH;MACA,MAAMqB,eAAe,GAAG,IAAI,CAACnE,cAAc,CACzCkE,YAAY,EACZD,aAAa,EACb,IAAI,CAAC1I,6BACP,CAAC;MACD,IAAI,CAAC4I,eAAe,EAAE;QACpB,MAAM,IAAIpG,KAAK,CACb,GAAG,IAAI,CAACpC,MAAM,CAACM,IAAI,cAAc6G,aAAa,yDAChD,CAAC;MACH;MAEA,OAAOqB,eAAe;IACxB,CAAC,EACDrB,aACF,CAAC;EACH;AACF","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ import { WalletConnector, type AppKitNetwork, type CaipNetworkId, type ChainNamespace, type ConnectOptions, type Namespaces, type ConnectorInitOptions, type ConnectionProperties } from '@reown/appkit-common-react-native';
2
+ import { DeeplinkProvider } from '../providers/DeeplinkProvider';
3
+ import type { DeeplinkConnectorConfig } from '../types';
4
+ export declare abstract class DeeplinkConnector extends WalletConnector {
5
+ private readonly config;
6
+ private currentCaipNetworkId;
7
+ private dappEncryptionKeyPair?;
8
+ private static readonly SUPPORTED_NAMESPACE;
9
+ constructor(config: DeeplinkConnectorConfig);
10
+ protected abstract getBaseUrl(): string;
11
+ protected abstract getStorageKey(): string;
12
+ protected abstract getDappKeypairStorageKey(): string;
13
+ protected abstract getEncryptionKeyFieldName(): string;
14
+ init(ops: ConnectorInitOptions): Promise<void>;
15
+ private initializeKeyPair;
16
+ connect(opts?: ConnectOptions): Promise<Namespaces | undefined>;
17
+ disconnect(): Promise<void>;
18
+ private clearSession;
19
+ getProvider(): DeeplinkProvider;
20
+ private getStorage;
21
+ getNamespaces(): Namespaces;
22
+ getChainId(namespace: ChainNamespace): CaipNetworkId | undefined;
23
+ getProperties(): ConnectionProperties | undefined;
24
+ isConnected(): boolean;
25
+ switchNetwork(network: AppKitNetwork): Promise<void>;
26
+ restoreSession(): Promise<boolean>;
27
+ private saveSession;
28
+ private clearSessionStorage;
29
+ }
30
+ //# sourceMappingURL=DeeplinkConnector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeeplinkConnector.d.ts","sourceRoot":"","sources":["../../../src/connectors/DeeplinkConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,UAAU,EAEf,KAAK,oBAAoB,EAKzB,KAAK,oBAAoB,EAC1B,MAAM,mCAAmC,CAAC;AAI3C,OAAO,EAAE,gBAAgB,EAA0B,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EAEV,uBAAuB,EAGxB,MAAM,UAAU,CAAC;AAQlB,8BAAsB,iBAAkB,SAAQ,eAAe;IAC7D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0B;IACjD,OAAO,CAAC,oBAAoB,CAA8B;IAC1D,OAAO,CAAC,qBAAqB,CAAC,CAAkB;IAEhD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAA4B;gBAE3D,MAAM,EAAE,uBAAuB;IAM3C,SAAS,CAAC,QAAQ,CAAC,UAAU,IAAI,MAAM;IACvC,SAAS,CAAC,QAAQ,CAAC,aAAa,IAAI,MAAM;IAC1C,SAAS,CAAC,QAAQ,CAAC,wBAAwB,IAAI,MAAM;IACrD,SAAS,CAAC,QAAQ,CAAC,yBAAyB,IAAI,MAAM;IAEvC,IAAI,CAAC,GAAG,EAAE,oBAAoB;YA2B/B,iBAAiB;IAqBhB,OAAO,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAuD/D,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;YAmB5B,YAAY;IAOjB,WAAW,IAAI,gBAAgB;IAQxC,OAAO,CAAC,UAAU;IAQT,aAAa,IAAI,UAAU;IAQ3B,UAAU,CAAC,SAAS,EAAE,cAAc,GAAG,aAAa,GAAG,SAAS;IAQhE,aAAa,IAAI,oBAAoB,GAAG,SAAS;IAI1D,WAAW,IAAI,OAAO;IAOP,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IA6CpD,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;YA2DnC,WAAW;YAmBX,mBAAmB;CAOlC"}
@@ -1,27 +1,12 @@
1
- import { WalletConnector, type AppKitNetwork, type CaipNetworkId, type ChainNamespace, type ConnectOptions, type Namespaces, type WalletInfo, type ConnectorInitOptions, type ConnectionProperties } from '@reown/appkit-common-react-native';
2
- import { PhantomProvider } from '../providers/PhantomProvider';
1
+ import { type WalletInfo } from '@reown/appkit-common-react-native';
2
+ import { DeeplinkConnector } from './DeeplinkConnector';
3
3
  import type { PhantomConnectorConfig } from '../types';
4
- export declare class PhantomConnector extends WalletConnector {
5
- private readonly config;
6
- private currentCaipNetworkId;
7
- private dappEncryptionKeyPair?;
8
- private static readonly SUPPORTED_NAMESPACE;
4
+ export declare class PhantomConnector extends DeeplinkConnector {
9
5
  constructor(config?: PhantomConnectorConfig);
10
- init(ops: ConnectorInitOptions): Promise<void>;
11
- private initializeKeyPair;
12
- connect(opts?: ConnectOptions): Promise<Namespaces | undefined>;
13
- disconnect(): Promise<void>;
14
- private clearSession;
15
- getProvider(): PhantomProvider;
16
- private getStorage;
17
- getNamespaces(): Namespaces;
18
- getChainId(namespace: ChainNamespace): CaipNetworkId | undefined;
19
- getProperties(): ConnectionProperties | undefined;
20
- getWalletInfo(): WalletInfo | undefined;
21
- isConnected(): boolean;
22
- switchNetwork(network: AppKitNetwork): Promise<void>;
23
- restoreSession(): Promise<boolean>;
24
- private saveSession;
25
- private clearSessionStorage;
6
+ getWalletInfo(): WalletInfo;
7
+ protected getBaseUrl(): string;
8
+ protected getStorageKey(): string;
9
+ protected getDappKeypairStorageKey(): string;
10
+ protected getEncryptionKeyFieldName(): string;
26
11
  }
27
12
  //# sourceMappingURL=PhantomConnector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PhantomConnector.d.ts","sourceRoot":"","sources":["../../../src/connectors/PhantomConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,UAAU,EAEf,KAAK,oBAAoB,EAKzB,KAAK,oBAAoB,EAE1B,MAAM,mCAAmC,CAAC;AAI3C,OAAO,EAAE,eAAe,EAA0B,MAAM,8BAA8B,CAAC;AACvF,OAAO,KAAK,EAEV,sBAAsB,EAGvB,MAAM,UAAU,CAAC;AAWlB,qBAAa,gBAAiB,SAAQ,eAAe;IACnD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyB;IAChD,OAAO,CAAC,oBAAoB,CAA8B;IAC1D,OAAO,CAAC,qBAAqB,CAAC,CAAkB;IAEhD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAA4B;gBAE3D,MAAM,CAAC,EAAE,sBAAsB;IAK5B,IAAI,CAAC,GAAG,EAAE,oBAAoB;YAuB/B,iBAAiB;IAqBhB,OAAO,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAuD/D,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;YAiB5B,YAAY;IAOjB,WAAW,IAAI,eAAe;IAQvC,OAAO,CAAC,UAAU;IAQT,aAAa,IAAI,UAAU;IAQ3B,UAAU,CAAC,SAAS,EAAE,cAAc,GAAG,aAAa,GAAG,SAAS;IAQhE,aAAa,IAAI,oBAAoB,GAAG,SAAS;IAIjD,aAAa,IAAI,UAAU,GAAG,SAAS;IAQhD,WAAW,IAAI,OAAO;IAKP,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IA0CpD,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;YAuCnC,WAAW;YAmBX,mBAAmB;CAOlC"}
1
+ {"version":3,"file":"PhantomConnector.d.ts","sourceRoot":"","sources":["../../../src/connectors/PhantomConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAMvD,qBAAa,gBAAiB,SAAQ,iBAAiB;gBACzC,MAAM,CAAC,EAAE,sBAAsB;IAIlC,aAAa,IAAI,UAAU;IAIpC,SAAS,CAAC,UAAU,IAAI,MAAM;IAI9B,SAAS,CAAC,aAAa,IAAI,MAAM;IAIjC,SAAS,CAAC,wBAAwB,IAAI,MAAM;IAI5C,SAAS,CAAC,yBAAyB,IAAI,MAAM;CAG9C"}
@@ -0,0 +1,12 @@
1
+ import { type WalletInfo } from '@reown/appkit-common-react-native';
2
+ import { DeeplinkConnector } from './DeeplinkConnector';
3
+ import type { SolflareConnectorConfig } from '../types';
4
+ export declare class SolflareConnector extends DeeplinkConnector {
5
+ constructor(config?: SolflareConnectorConfig);
6
+ getWalletInfo(): WalletInfo;
7
+ protected getBaseUrl(): string;
8
+ protected getStorageKey(): string;
9
+ protected getDappKeypairStorageKey(): string;
10
+ protected getEncryptionKeyFieldName(): string;
11
+ }
12
+ //# sourceMappingURL=SolflareConnector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SolflareConnector.d.ts","sourceRoot":"","sources":["../../../src/connectors/SolflareConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAMxD,qBAAa,iBAAkB,SAAQ,iBAAiB;gBAC1C,MAAM,CAAC,EAAE,uBAAuB;IAInC,aAAa,IAAI,UAAU;IAIpC,SAAS,CAAC,UAAU,IAAI,MAAM;IAI9B,SAAS,CAAC,aAAa,IAAI,MAAM;IAIjC,SAAS,CAAC,wBAAwB,IAAI,MAAM;IAI5C,SAAS,CAAC,yBAAyB,IAAI,MAAM;CAG9C"}
@@ -1,4 +1,5 @@
1
1
  export { SolanaAdapter } from './adapter';
2
- export type { PhantomConnectorConfig } from './types';
2
+ export type { PhantomConnectorConfig, SolflareConnectorConfig } from './types';
3
3
  export { PhantomConnector } from './connectors/PhantomConnector';
4
+ export { SolflareConnector } from './connectors/SolflareConnector';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG1C,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG1C,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAG/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC"}