@pooflabs/web 0.0.81-rc5 → 0.0.81
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.
- package/dist/auth/index.d.ts +10 -1
- package/dist/auth/providers/phantom-wallet-provider.d.ts +20 -21
- package/dist/global.d.ts +3 -1
- package/dist/{index-Fjyk5jYL.js → index-B2WGCssJ.js} +346 -490
- package/dist/index-B2WGCssJ.js.map +1 -0
- package/dist/{index-DB9nDInp.esm.js → index-CjHbp7Dq.esm.js} +3697 -562
- package/dist/index-CjHbp7Dq.esm.js.map +1 -0
- package/dist/{index-D_ta2S2c.js → index-DXPkkq81.js} +3698 -563
- package/dist/index-DXPkkq81.js.map +1 -0
- package/dist/{index-Bg_ApFIo.js → index-D_DiP8XQ.js} +3698 -563
- package/dist/index-D_DiP8XQ.js.map +1 -0
- package/dist/{index-CZhJBWap.esm.js → index-dcJIjFrs.esm.js} +3697 -562
- package/dist/index-dcJIjFrs.esm.js.map +1 -0
- package/dist/{index-Bkr4BRoP.esm.js → index-nt_HQVrk.esm.js} +344 -490
- package/dist/index-nt_HQVrk.esm.js.map +1 -0
- package/dist/{index.browser-iqs5DlRU.esm.js → index.browser-BNdFfyIg.esm.js} +1571 -1368
- package/dist/index.browser-BNdFfyIg.esm.js.map +1 -0
- package/dist/{index.browser-DHi7UhqF.js → index.browser-CT6PUv9G.js} +1571 -1368
- package/dist/index.browser-CT6PUv9G.js.map +1 -0
- package/dist/index.browser-Cy21yaX0.esm.js +1096 -0
- package/dist/index.browser-Cy21yaX0.esm.js.map +1 -0
- package/dist/index.browser-OvGNsMPu.esm.js +1002 -0
- package/dist/index.browser-OvGNsMPu.esm.js.map +1 -0
- package/dist/index.browser-ZD7Tz2bn.js +1099 -0
- package/dist/index.browser-ZD7Tz2bn.js.map +1 -0
- package/dist/index.browser-d0PlOXpF.js +105 -0
- package/dist/index.browser-d0PlOXpF.js.map +1 -0
- package/dist/index.browser-pE1s68e9.esm.js +102 -0
- package/dist/index.browser-pE1s68e9.esm.js.map +1 -0
- package/dist/index.browser-vuTr40so.js +1008 -0
- package/dist/index.browser-vuTr40so.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{index.native-DYgJWWY4.esm.js → index.native-BqYr--vb.esm.js} +202 -178
- package/dist/index.native-BqYr--vb.esm.js.map +1 -0
- package/dist/{index.native-DJWuqJTZ.js → index.native-CyA-RdvW.js} +204 -178
- package/dist/index.native-CyA-RdvW.js.map +1 -0
- package/dist/index.native.esm.js +1 -1
- package/dist/index.native.js +1 -1
- package/dist/{phantom-wallet-provider-fofd8BMo.js → phantom-wallet-provider-DWCaMkyz.js} +147 -238
- package/dist/phantom-wallet-provider-DWCaMkyz.js.map +1 -0
- package/dist/{phantom-wallet-provider-DSFGWSOJ.esm.js → phantom-wallet-provider-K2V96G-G.esm.js} +147 -238
- package/dist/phantom-wallet-provider-K2V96G-G.esm.js.map +1 -0
- package/dist/{privy-wallet-provider-Csv34Kcc.js → privy-wallet-provider-BMg_S_d0.js} +4 -4
- package/dist/privy-wallet-provider-BMg_S_d0.js.map +1 -0
- package/dist/{privy-wallet-provider-TRToDe4Q.esm.js → privy-wallet-provider-DoX8q99w.esm.js} +4 -4
- package/dist/privy-wallet-provider-DoX8q99w.esm.js.map +1 -0
- package/dist/{solana-mobile-wallet-provider-L7nRuxhv.esm.js → solana-mobile-wallet-provider-Cmphb3oB.esm.js} +3 -82
- package/dist/solana-mobile-wallet-provider-Cmphb3oB.esm.js.map +1 -0
- package/dist/{solana-mobile-wallet-provider-Cp65LfNb.js → solana-mobile-wallet-provider-t22Ie8lY.js} +3 -82
- package/dist/solana-mobile-wallet-provider-t22Ie8lY.js.map +1 -0
- package/package.json +3 -3
- package/dist/index-Bg_ApFIo.js.map +0 -1
- package/dist/index-Bkr4BRoP.esm.js.map +0 -1
- package/dist/index-CZhJBWap.esm.js.map +0 -1
- package/dist/index-DB9nDInp.esm.js.map +0 -1
- package/dist/index-D_ta2S2c.js.map +0 -1
- package/dist/index-Fjyk5jYL.js.map +0 -1
- package/dist/index.browser-BTlliHCf.esm.js +0 -119
- package/dist/index.browser-BTlliHCf.esm.js.map +0 -1
- package/dist/index.browser-C-_FEr5M.esm.js +0 -1134
- package/dist/index.browser-C-_FEr5M.esm.js.map +0 -1
- package/dist/index.browser-DHi7UhqF.js.map +0 -1
- package/dist/index.browser-DRTQuf0J.js +0 -1253
- package/dist/index.browser-DRTQuf0J.js.map +0 -1
- package/dist/index.browser-Disp7Kcb.esm.js +0 -1250
- package/dist/index.browser-Disp7Kcb.esm.js.map +0 -1
- package/dist/index.browser-DjEZSiqI.js +0 -1137
- package/dist/index.browser-DjEZSiqI.js.map +0 -1
- package/dist/index.browser-DvTeEO2r.js +0 -122
- package/dist/index.browser-DvTeEO2r.js.map +0 -1
- package/dist/index.browser-iqs5DlRU.esm.js.map +0 -1
- package/dist/index.native-DJWuqJTZ.js.map +0 -1
- package/dist/index.native-DYgJWWY4.esm.js.map +0 -1
- package/dist/phantom-wallet-provider-DSFGWSOJ.esm.js.map +0 -1
- package/dist/phantom-wallet-provider-fofd8BMo.js.map +0 -1
- package/dist/privy-wallet-provider-Csv34Kcc.js.map +0 -1
- package/dist/privy-wallet-provider-TRToDe4Q.esm.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-Cp65LfNb.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-L7nRuxhv.esm.js.map +0 -1
|
@@ -1,68 +1,11 @@
|
|
|
1
1
|
import { b as bufferExports } from './index-CrOVJFX9.esm.js';
|
|
2
|
-
import { g as getPlatform,
|
|
2
|
+
import { g as getPlatform, l as setAuthLoading, W as WebSessionManager, s as setCurrentUser, m as genAuthNonce, n as genSolanaMessage, o as createSessionWithSignature, e as confirmAndCheckTransaction, c as convertRemainingAccounts, b as buildSetDocumentsTransaction, a as SOLANA_DEVNET_RPC_URL, S as SOLANA_MAINNET_RPC_URL, h as SURFNET_RPC_URL } from './index.native-BqYr--vb.esm.js';
|
|
3
3
|
import { PublicKey, Connection, VersionedTransaction } from '@solana/web3.js';
|
|
4
4
|
import * as anchor from '@coral-xyz/anchor';
|
|
5
5
|
import 'axios';
|
|
6
6
|
import 'react';
|
|
7
7
|
|
|
8
8
|
const ED25519_SIGNATURE_LENGTH = 64;
|
|
9
|
-
/**
|
|
10
|
-
* On Android Chrome PWA (e.g. Solana Seeker in standalone mode), MWA's
|
|
11
|
-
* transact() opens a WebSocket to ws://localhost:<port>/solana-wallet to
|
|
12
|
-
* handshake with the wallet app on the device. Chrome guards localhost
|
|
13
|
-
* connections behind the Local Network Access ("Apps on Device") permission
|
|
14
|
-
* dialog. The dialog inherits the activity's window-focus state at spawn
|
|
15
|
-
* time — so if focus is in transit (e.g. just after a Phantom-modal close
|
|
16
|
-
* triggers a React commit), the dialog renders with grayed-out Allow/Block
|
|
17
|
-
* buttons and only becomes interactive after a manual background→resume
|
|
18
|
-
* (which forces an onPause→onResume cycle on the activity).
|
|
19
|
-
*
|
|
20
|
-
* Wait for window focus to settle, then yield one frame, before opening
|
|
21
|
-
* the WebSocket. This makes the system dialog spawn into a focused activity
|
|
22
|
-
* so its buttons are immediately tappable.
|
|
23
|
-
*/
|
|
24
|
-
async function awaitActivityFocus() {
|
|
25
|
-
var _a;
|
|
26
|
-
if (typeof document === 'undefined' || typeof window === 'undefined')
|
|
27
|
-
return;
|
|
28
|
-
const t0 = Date.now();
|
|
29
|
-
const initialHasFocus = document.hasFocus();
|
|
30
|
-
console.log('[MWA-DEBUG] awaitActivityFocus: enter', {
|
|
31
|
-
hasFocus: initialHasFocus,
|
|
32
|
-
visibilityState: document.visibilityState,
|
|
33
|
-
activeElement: (_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.tagName,
|
|
34
|
-
});
|
|
35
|
-
if (!initialHasFocus) {
|
|
36
|
-
let resolvedBy = 'pending';
|
|
37
|
-
await new Promise((resolve) => {
|
|
38
|
-
const onFocus = () => {
|
|
39
|
-
window.removeEventListener('focus', onFocus);
|
|
40
|
-
resolvedBy = 'focus-event';
|
|
41
|
-
resolve();
|
|
42
|
-
};
|
|
43
|
-
window.addEventListener('focus', onFocus);
|
|
44
|
-
// Fallback in case the focus event never fires (e.g. activity
|
|
45
|
-
// already focused but document.hasFocus() momentarily lies during
|
|
46
|
-
// a React commit). 600ms is a perceptual ceiling — beyond this
|
|
47
|
-
// the user notices a stall, so we'd rather take the focus race
|
|
48
|
-
// than block forever.
|
|
49
|
-
setTimeout(() => {
|
|
50
|
-
window.removeEventListener('focus', onFocus);
|
|
51
|
-
if (resolvedBy === 'pending')
|
|
52
|
-
resolvedBy = 'timeout';
|
|
53
|
-
resolve();
|
|
54
|
-
}, 600);
|
|
55
|
-
});
|
|
56
|
-
console.log('[MWA-DEBUG] awaitActivityFocus: wait resolved', { resolvedBy, waitedMs: Date.now() - t0 });
|
|
57
|
-
}
|
|
58
|
-
// Yield to next paint so any pending React commits / focus changes have
|
|
59
|
-
// flushed before the WebSocket open spawns the system dialog.
|
|
60
|
-
await new Promise((r) => requestAnimationFrame(() => r()));
|
|
61
|
-
console.log('[MWA-DEBUG] awaitActivityFocus: exit', {
|
|
62
|
-
hasFocus: document.hasFocus(),
|
|
63
|
-
totalMs: Date.now() - t0,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
9
|
// Dynamically imported MWA protocol module
|
|
67
10
|
let mwaProtocolModule = null;
|
|
68
11
|
let mwaProtocolLoadPromise = null;
|
|
@@ -75,7 +18,7 @@ async function loadMwaProtocol() {
|
|
|
75
18
|
return mwaProtocolLoadPromise;
|
|
76
19
|
mwaProtocolLoadPromise = (async () => {
|
|
77
20
|
try {
|
|
78
|
-
mwaProtocolModule = await import('./index.browser-
|
|
21
|
+
mwaProtocolModule = await import('./index.browser-Cy21yaX0.esm.js');
|
|
79
22
|
}
|
|
80
23
|
catch (e) {
|
|
81
24
|
console.warn('[SolanaMobileWallet] @solana-mobile/mobile-wallet-adapter-protocol-web3js not installed. Install it to enable Seeker wallet support.');
|
|
@@ -178,17 +121,14 @@ class SolanaMobileWalletProvider {
|
|
|
178
121
|
}
|
|
179
122
|
async login() {
|
|
180
123
|
var _a, _b, _c, _d, _e;
|
|
181
|
-
console.log('[MWA-DEBUG] SolanaMobileWalletProvider.login: enter');
|
|
182
124
|
setAuthLoading(true);
|
|
183
125
|
try {
|
|
184
126
|
await loadMwaProtocol();
|
|
185
|
-
console.log('[MWA-DEBUG] loadMwaProtocol resolved');
|
|
186
127
|
const { transact } = mwaProtocolModule;
|
|
187
128
|
// Quick check: if we already have auth state and a valid session, skip
|
|
188
129
|
if (this.authorizedPublicKey) {
|
|
189
130
|
const existingSession = await WebSessionManager.getSession();
|
|
190
131
|
if (existingSession && existingSession.address === this.authorizedPublicKey) {
|
|
191
|
-
console.log('[MWA-DEBUG] login: returning existing session, no transact');
|
|
192
132
|
const user = { provider: this, address: this.authorizedPublicKey };
|
|
193
133
|
setCurrentUser(user);
|
|
194
134
|
return user;
|
|
@@ -196,12 +136,8 @@ class SolanaMobileWalletProvider {
|
|
|
196
136
|
}
|
|
197
137
|
// Pre-fetch nonce from server while wallet is not yet connected
|
|
198
138
|
const nonce = await genAuthNonce();
|
|
199
|
-
console.log('[MWA-DEBUG] login: nonce fetched, awaiting activity focus');
|
|
200
|
-
await awaitActivityFocus();
|
|
201
|
-
console.log('[MWA-DEBUG] login: about to call transact() — WebSocket to localhost will open now');
|
|
202
139
|
// Single transact() call: authorize + signMessages — one wallet popup
|
|
203
140
|
const result = await transact(async (wallet) => {
|
|
204
|
-
console.log('[MWA-DEBUG] transact callback running — WebSocket connected, calling wallet.authorize');
|
|
205
141
|
// Step 1: Authorize — user approves the dApp
|
|
206
142
|
const authResult = await wallet.authorize({
|
|
207
143
|
identity: this.appIdentity,
|
|
@@ -231,7 +167,6 @@ class SolanaMobileWalletProvider {
|
|
|
231
167
|
walletUriBase: authResult.wallet_uri_base,
|
|
232
168
|
};
|
|
233
169
|
}, this.getAssociationConfig());
|
|
234
|
-
console.log('[MWA-DEBUG] login: transact() resolved successfully');
|
|
235
170
|
// Store MWA auth state for reauthorization in subsequent transact() calls
|
|
236
171
|
this.authToken = result.authToken;
|
|
237
172
|
this.walletUriBase = result.walletUriBase;
|
|
@@ -258,12 +193,6 @@ class SolanaMobileWalletProvider {
|
|
|
258
193
|
return user;
|
|
259
194
|
}
|
|
260
195
|
catch (error) {
|
|
261
|
-
console.log('[MWA-DEBUG] login caught error', {
|
|
262
|
-
errorName: error === null || error === void 0 ? void 0 : error.name,
|
|
263
|
-
errorMessage: error === null || error === void 0 ? void 0 : error.message,
|
|
264
|
-
errorCode: error === null || error === void 0 ? void 0 : error.code,
|
|
265
|
-
hasFocus: typeof document !== 'undefined' ? document.hasFocus() : 'n/a',
|
|
266
|
-
});
|
|
267
196
|
const isUserRejection = (error === null || error === void 0 ? void 0 : error.code) === 4001 ||
|
|
268
197
|
((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes('user rejected')) ||
|
|
269
198
|
((_b = error === null || error === void 0 ? void 0 : error.message) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes('user denied')) ||
|
|
@@ -295,7 +224,6 @@ class SolanaMobileWalletProvider {
|
|
|
295
224
|
await loadMwaProtocol();
|
|
296
225
|
const { transact } = mwaProtocolModule;
|
|
297
226
|
const authToken = this.authToken;
|
|
298
|
-
await awaitActivityFocus();
|
|
299
227
|
await transact(async (wallet) => {
|
|
300
228
|
await wallet.deauthorize({ auth_token: authToken });
|
|
301
229
|
}, this.getAssociationConfig());
|
|
@@ -321,7 +249,6 @@ class SolanaMobileWalletProvider {
|
|
|
321
249
|
const { transact } = mwaProtocolModule;
|
|
322
250
|
const base64Addr = this.base64Address;
|
|
323
251
|
try {
|
|
324
|
-
await awaitActivityFocus();
|
|
325
252
|
const signedMessages = await transact(async (wallet) => {
|
|
326
253
|
await this.reauthorizeWallet(wallet);
|
|
327
254
|
const messageBytes = getPlatform().textEncode(message);
|
|
@@ -375,7 +302,6 @@ class SolanaMobileWalletProvider {
|
|
|
375
302
|
}
|
|
376
303
|
}
|
|
377
304
|
try {
|
|
378
|
-
await awaitActivityFocus();
|
|
379
305
|
const signedTransactions = await transact(async (wallet) => {
|
|
380
306
|
await this.reauthorizeWallet(wallet);
|
|
381
307
|
return wallet.signTransactions({ transactions: [transaction] });
|
|
@@ -423,7 +349,6 @@ class SolanaMobileWalletProvider {
|
|
|
423
349
|
}
|
|
424
350
|
if (isSurfnet) {
|
|
425
351
|
// Surfnet: sign-only, then submit to our specific RPC
|
|
426
|
-
await awaitActivityFocus();
|
|
427
352
|
const signedTransactions = await transact(async (wallet) => {
|
|
428
353
|
await this.reauthorizeWallet(wallet);
|
|
429
354
|
return wallet.signTransactions({ transactions: [transaction] });
|
|
@@ -443,7 +368,6 @@ class SolanaMobileWalletProvider {
|
|
|
443
368
|
return signature;
|
|
444
369
|
}
|
|
445
370
|
// Non-surfnet: use signAndSendTransactions for wallet-optimized submission
|
|
446
|
-
await awaitActivityFocus();
|
|
447
371
|
const signatures = await transact(async (wallet) => {
|
|
448
372
|
await this.reauthorizeWallet(wallet);
|
|
449
373
|
return wallet.signAndSendTransactions({
|
|
@@ -527,7 +451,6 @@ class SolanaMobileWalletProvider {
|
|
|
527
451
|
tx = result.tx;
|
|
528
452
|
}
|
|
529
453
|
if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
|
|
530
|
-
await awaitActivityFocus();
|
|
531
454
|
const [signedTx] = await transact(async (wallet) => {
|
|
532
455
|
await this.reauthorizeWallet(wallet);
|
|
533
456
|
return wallet.signTransactions({ transactions: [tx] });
|
|
@@ -541,7 +464,6 @@ class SolanaMobileWalletProvider {
|
|
|
541
464
|
}
|
|
542
465
|
if (isSurfnet) {
|
|
543
466
|
// Surfnet: sign then submit manually to our RPC
|
|
544
|
-
await awaitActivityFocus();
|
|
545
467
|
const [signedTx] = await transact(async (wallet) => {
|
|
546
468
|
await this.reauthorizeWallet(wallet);
|
|
547
469
|
return wallet.signTransactions({ transactions: [tx] });
|
|
@@ -570,7 +492,6 @@ class SolanaMobileWalletProvider {
|
|
|
570
492
|
};
|
|
571
493
|
}
|
|
572
494
|
// Non-surfnet: use signAndSendTransactions
|
|
573
|
-
await awaitActivityFocus();
|
|
574
495
|
const signatures = await transact(async (wallet) => {
|
|
575
496
|
await this.reauthorizeWallet(wallet);
|
|
576
497
|
return wallet.signAndSendTransactions({
|
|
@@ -634,4 +555,4 @@ class SolanaMobileWalletProvider {
|
|
|
634
555
|
SolanaMobileWalletProvider.instance = null;
|
|
635
556
|
|
|
636
557
|
export { SolanaMobileWalletProvider };
|
|
637
|
-
//# sourceMappingURL=solana-mobile-wallet-provider-
|
|
558
|
+
//# sourceMappingURL=solana-mobile-wallet-provider-Cmphb3oB.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solana-mobile-wallet-provider-Cmphb3oB.esm.js","sources":["../.rollup-tmp/auth/providers/solana-mobile-wallet-provider.js"],"sourcesContent":["import { Buffer } from 'buffer';\nimport { WebSessionManager as SessionManager, createSessionWithSignature, genAuthNonce, genSolanaMessage, buildSetDocumentsTransaction, convertRemainingAccounts } from '@pooflabs/core';\nimport { setCurrentUser, setAuthLoading } from '../../global';\nimport { getPlatform, detectAndroid } from '../../platform';\nimport { Connection, PublicKey, VersionedTransaction } from '@solana/web3.js';\nimport * as anchor from '@coral-xyz/anchor';\nimport { SOLANA_DEVNET_RPC_URL, SOLANA_MAINNET_RPC_URL, SURFNET_RPC_URL } from '..';\nimport { confirmAndCheckTransaction } from './transaction-utils';\n/**\n * Detects whether the current environment is a mobile browser capable of\n * Mobile Wallet Adapter (MWA) communication.\n *\n * Returns true on Android browsers (Chrome, etc.) where MWA intents work,\n * or inside a Seeker/Saga in-app browser context.\n */\nexport function isMobileWalletAvailable() {\n if (typeof window === 'undefined' || typeof navigator === 'undefined')\n return false;\n return detectAndroid();\n}\nconst ED25519_SIGNATURE_LENGTH = 64;\n// Dynamically imported MWA protocol module\nlet mwaProtocolModule = null;\nlet mwaProtocolLoadPromise = null;\nasync function loadMwaProtocol() {\n if (mwaProtocolModule)\n return;\n if (typeof window === 'undefined')\n return;\n if (mwaProtocolLoadPromise)\n return mwaProtocolLoadPromise;\n mwaProtocolLoadPromise = (async () => {\n try {\n mwaProtocolModule = await import('@solana-mobile/mobile-wallet-adapter-protocol-web3js');\n }\n catch (e) {\n console.warn('[SolanaMobileWallet] @solana-mobile/mobile-wallet-adapter-protocol-web3js not installed. Install it to enable Seeker wallet support.');\n throw new Error('Missing @solana-mobile/mobile-wallet-adapter-protocol-web3js dependency');\n }\n })();\n return mwaProtocolLoadPromise;\n}\n/**\n * Registers Mobile Wallet Adapter as a wallet-standard wallet so it appears\n * in wallet selection UIs and can be discovered by other wallet-standard consumers.\n *\n * Call this once at app startup (in a browser-only / non-SSR context).\n *\n * @param config - App identity and optional remote host authority for desktop QR code support\n */\nexport async function registerMobileWalletAdapter(config) {\n var _a;\n if (typeof window === 'undefined')\n return;\n try {\n const walletStandardMobile = await import('@solana-mobile/wallet-standard-mobile');\n const registerMwa = walletStandardMobile.registerMwa || ((_a = walletStandardMobile.default) === null || _a === void 0 ? void 0 : _a.registerMwa);\n if (!registerMwa) {\n console.warn('[SolanaMobileWallet] registerMwa not found in @solana-mobile/wallet-standard-mobile');\n return;\n }\n const options = {};\n if (config === null || config === void 0 ? void 0 : config.appIdentity) {\n options.appIdentity = config.appIdentity;\n }\n if (config === null || config === void 0 ? void 0 : config.chains) {\n options.chains = config.chains;\n }\n if (config === null || config === void 0 ? void 0 : config.remoteHostAuthority) {\n options.remoteHostAuthority = config.remoteHostAuthority;\n }\n // Use the library's default helpers if available\n if (walletStandardMobile.createDefaultAuthorizationCache) {\n options.authorizationCache = walletStandardMobile.createDefaultAuthorizationCache();\n }\n if (walletStandardMobile.createDefaultChainSelector) {\n options.chainSelector = walletStandardMobile.createDefaultChainSelector();\n }\n if (walletStandardMobile.createDefaultWalletNotFoundHandler) {\n options.onWalletNotFound = walletStandardMobile.createDefaultWalletNotFoundHandler();\n }\n registerMwa(options);\n }\n catch (e) {\n // @solana-mobile/wallet-standard-mobile is an optional dependency\n // Silently skip if not installed — the provider still works via\n // @solana-mobile/mobile-wallet-adapter-protocol-web3js directly\n console.debug('[SolanaMobileWallet] @solana-mobile/wallet-standard-mobile not available, skipping wallet-standard registration');\n }\n}\n/**\n * SolanaMobileWalletProvider implements the AuthProvider interface using the\n * Solana Mobile Wallet Adapter (MWA) protocol's low-level `transact` API.\n *\n * This enables TaroBase dApps to work with any MWA-compliant wallet on Solana\n * mobile devices (Seeker, Saga) — including the native Seed Vault Wallet,\n * Phantom, Solflare, and any other wallet that implements the MWA protocol.\n *\n * By using `transact()` directly (instead of the wallet-adapter wrapper),\n * login combines authorize + signMessage into a single wallet session —\n * meaning one popup/approval instead of two.\n */\nexport class SolanaMobileWalletProvider {\n constructor(networkUrl = null, config = {}) {\n // MWA authorization state\n this.authToken = null;\n this.walletUriBase = null;\n this.base64Address = null;\n this.authorizedPublicKey = null;\n this.publicKeyObj = null;\n this.networkUrl = networkUrl;\n this.config = config;\n if (typeof window === 'undefined') {\n throw new Error('SolanaMobileWalletProvider can only be instantiated in a browser environment');\n }\n if (SolanaMobileWalletProvider.instance) {\n return SolanaMobileWalletProvider.instance;\n }\n this.appIdentity = config.appIdentity || {\n name: 'TaroBase App',\n uri: getPlatform().getLocationOrigin(),\n };\n this.chain = `solana:${config.cluster || 'mainnet-beta'}`;\n SolanaMobileWalletProvider.instance = this;\n }\n static getInstance(networkUrl, config) {\n if (!SolanaMobileWalletProvider.instance) {\n new SolanaMobileWalletProvider(networkUrl, config);\n }\n return SolanaMobileWalletProvider.instance;\n }\n /** Config for transact() — routes to the same wallet if we've already authorized */\n getAssociationConfig() {\n if (this.walletUriBase) {\n return { baseUri: this.walletUriBase };\n }\n return undefined;\n }\n /** Reauthorize within a transact callback using a stored auth_token */\n async reauthorizeWallet(wallet) {\n if (!this.authToken) {\n // No existing auth — do a fresh authorize\n const authResult = await wallet.authorize({\n identity: this.appIdentity,\n chain: this.chain,\n });\n this.storeAuthResult(authResult);\n return authResult;\n }\n try {\n const authResult = await wallet.reauthorize({\n auth_token: this.authToken,\n identity: this.appIdentity,\n });\n this.storeAuthResult(authResult);\n return authResult;\n }\n catch (e) {\n // Reauth failed (token expired, wallet reset, etc.) — try fresh authorize\n console.warn('[SolanaMobileWallet] Reauthorization failed, attempting fresh authorize:', e === null || e === void 0 ? void 0 : e.message);\n const authResult = await wallet.authorize({\n identity: this.appIdentity,\n chain: this.chain,\n });\n this.storeAuthResult(authResult);\n return authResult;\n }\n }\n /** Persist auth result from an authorize/reauthorize call */\n storeAuthResult(authResult) {\n var _a;\n this.authToken = authResult.auth_token;\n this.walletUriBase = authResult.wallet_uri_base;\n if (((_a = authResult.accounts) === null || _a === void 0 ? void 0 : _a.length) > 0) {\n const account = authResult.accounts[0];\n this.base64Address = account.address;\n // Decode base64 address → PublicKey → base58\n const addressBytes = Uint8Array.from(getPlatform().atob(account.address), c => c.charCodeAt(0));\n this.publicKeyObj = new PublicKey(addressBytes);\n this.authorizedPublicKey = this.publicKeyObj.toBase58();\n }\n }\n async login() {\n var _a, _b, _c, _d, _e;\n setAuthLoading(true);\n try {\n await loadMwaProtocol();\n const { transact } = mwaProtocolModule;\n // Quick check: if we already have auth state and a valid session, skip\n if (this.authorizedPublicKey) {\n const existingSession = await SessionManager.getSession();\n if (existingSession && existingSession.address === this.authorizedPublicKey) {\n const user = { provider: this, address: this.authorizedPublicKey };\n setCurrentUser(user);\n return user;\n }\n }\n // Pre-fetch nonce from server while wallet is not yet connected\n const nonce = await genAuthNonce();\n // Single transact() call: authorize + signMessages — one wallet popup\n const result = await transact(async (wallet) => {\n // Step 1: Authorize — user approves the dApp\n const authResult = await wallet.authorize({\n identity: this.appIdentity,\n chain: this.chain,\n });\n const base64Addr = authResult.accounts[0].address;\n const addressBytes = Uint8Array.from(getPlatform().atob(base64Addr), c => c.charCodeAt(0));\n const pubkey = new PublicKey(addressBytes);\n const base58Addr = pubkey.toBase58();\n // Step 2: Sign the auth message — still in the same wallet session\n const messageText = await genSolanaMessage(base58Addr, nonce);\n const messageBytes = getPlatform().textEncode(messageText);\n const signedMessages = await wallet.signMessages({\n addresses: [base64Addr],\n payloads: [messageBytes],\n });\n // The signed payload is [original message bytes][64-byte ed25519 signature]\n const signedPayload = signedMessages[0];\n const signatureBytes = signedPayload.slice(-ED25519_SIGNATURE_LENGTH);\n return {\n base58Address: base58Addr,\n base64Address: base64Addr,\n publicKey: pubkey,\n signature: Buffer.from(signatureBytes).toString('base64'),\n messageText,\n authToken: authResult.auth_token,\n walletUriBase: authResult.wallet_uri_base,\n };\n }, this.getAssociationConfig());\n // Store MWA auth state for reauthorization in subsequent transact() calls\n this.authToken = result.authToken;\n this.walletUriBase = result.walletUriBase;\n this.base64Address = result.base64Address;\n this.authorizedPublicKey = result.base58Address;\n this.publicKeyObj = result.publicKey;\n // Check if we already have a valid session for this address\n const existingSession = await SessionManager.getSession();\n if (existingSession && existingSession.address === result.base58Address) {\n const user = { provider: this, address: result.base58Address };\n setCurrentUser(user);\n return user;\n }\n // Create new session on the server\n const createSessionResult = await createSessionWithSignature(result.base58Address, result.messageText, result.signature);\n await SessionManager.storeSession(result.base58Address, createSessionResult.accessToken, createSessionResult.idToken, createSessionResult.refreshToken);\n // Mark auth method\n try {\n getPlatform().storage.setItem('tarobase_last_auth_method', 'mobile-wallet-adapter');\n }\n catch (_f) { }\n const user = { provider: this, address: result.base58Address };\n setCurrentUser(user);\n return user;\n }\n catch (error) {\n const isUserRejection = (error === null || error === void 0 ? void 0 : error.code) === 4001 ||\n ((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes('user rejected')) ||\n ((_b = error === null || error === void 0 ? void 0 : error.message) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes('user denied')) ||\n ((_c = error === null || error === void 0 ? void 0 : error.message) === null || _c === void 0 ? void 0 : _c.toLowerCase().includes('user cancelled')) ||\n ((_d = error === null || error === void 0 ? void 0 : error.message) === null || _d === void 0 ? void 0 : _d.toLowerCase().includes('user canceled')) ||\n ((_e = error === null || error === void 0 ? void 0 : error.message) === null || _e === void 0 ? void 0 : _e.toLowerCase().includes('user declined'));\n if (!isUserRejection) {\n console.error('[SolanaMobileWallet] Login failed:', error);\n }\n throw error;\n }\n finally {\n setAuthLoading(false);\n }\n }\n async restoreSession() {\n const session = await SessionManager.getSession();\n if (session) {\n this.authorizedPublicKey = session.address;\n this.publicKeyObj = new PublicKey(session.address);\n return { provider: this, address: session.address };\n }\n return null;\n }\n async logout() {\n // Deauthorize with the wallet if we have an auth_token\n if (this.authToken) {\n try {\n await loadMwaProtocol();\n const { transact } = mwaProtocolModule;\n const authToken = this.authToken;\n await transact(async (wallet) => {\n await wallet.deauthorize({ auth_token: authToken });\n }, this.getAssociationConfig());\n }\n catch (error) {\n console.error('[SolanaMobileWallet] Deauthorize error:', error);\n }\n }\n this.authToken = null;\n this.walletUriBase = null;\n this.base64Address = null;\n this.authorizedPublicKey = null;\n this.publicKeyObj = null;\n SessionManager.clearSession();\n setCurrentUser(null);\n }\n async signMessage(message) {\n var _a, _b;\n if (!this.authorizedPublicKey || !this.base64Address) {\n throw new Error('Not connected. Call login() first.');\n }\n await loadMwaProtocol();\n const { transact } = mwaProtocolModule;\n const base64Addr = this.base64Address;\n try {\n const signedMessages = await transact(async (wallet) => {\n await this.reauthorizeWallet(wallet);\n const messageBytes = getPlatform().textEncode(message);\n return wallet.signMessages({\n addresses: [base64Addr],\n payloads: [messageBytes],\n });\n }, this.getAssociationConfig());\n const signedPayload = signedMessages[0];\n const signatureBytes = signedPayload.slice(-ED25519_SIGNATURE_LENGTH);\n return Buffer.from(signatureBytes).toString('base64');\n }\n catch (error) {\n if (((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.includes('not connected')) || ((_b = error === null || error === void 0 ? void 0 : error.message) === null || _b === void 0 ? void 0 : _b.includes('not authorized')) ||\n (error === null || error === void 0 ? void 0 : error.code) === 'ERROR_AUTHORIZATION_FAILED') {\n await this.logout();\n throw new Error('Wallet connection lost. Please reconnect.');\n }\n throw new Error(`Failed to sign message: ${error.message}`);\n }\n }\n async signTransaction(transaction) {\n var _a, _b;\n if (!this.publicKeyObj) {\n throw new Error('Not connected. Call login() first.');\n }\n await loadMwaProtocol();\n const { transact } = mwaProtocolModule;\n // Ensure blockhash and fee payer are set before signing\n const isLegacyTransaction = 'recentBlockhash' in transaction && !('message' in transaction && 'staticAccountKeys' in transaction.message);\n if (isLegacyTransaction) {\n const legacyTx = transaction;\n if (!legacyTx.recentBlockhash) {\n const rpcUrl = this.getRpcUrl();\n const connection = new Connection(rpcUrl, 'confirmed');\n const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash('confirmed');\n legacyTx.recentBlockhash = blockhash;\n legacyTx.lastValidBlockHeight = lastValidBlockHeight;\n }\n if (!legacyTx.feePayer && this.publicKeyObj) {\n legacyTx.feePayer = this.publicKeyObj;\n }\n }\n else {\n const versionedTx = transaction;\n if (!versionedTx.message.recentBlockhash) {\n const rpcUrl = this.getRpcUrl();\n const connection = new Connection(rpcUrl, 'confirmed');\n const { blockhash } = await connection.getLatestBlockhash('confirmed');\n versionedTx.message.recentBlockhash = blockhash;\n }\n }\n try {\n const signedTransactions = await transact(async (wallet) => {\n await this.reauthorizeWallet(wallet);\n return wallet.signTransactions({ transactions: [transaction] });\n }, this.getAssociationConfig());\n return signedTransactions[0];\n }\n catch (error) {\n if (((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.includes('not connected')) || ((_b = error === null || error === void 0 ? void 0 : error.message) === null || _b === void 0 ? void 0 : _b.includes('not authorized')) ||\n (error === null || error === void 0 ? void 0 : error.code) === 'ERROR_AUTHORIZATION_FAILED') {\n await this.logout();\n throw new Error('Wallet connection lost. Please reconnect.');\n }\n throw new Error(`Failed to sign transaction: ${error.message}`);\n }\n }\n async signAndSubmitTransaction(transaction, feePayer) {\n var _a, _b, _c, _d, _e, _f;\n if (!this.publicKeyObj) {\n throw new Error('Not connected. Call login() first.');\n }\n await loadMwaProtocol();\n const { transact } = mwaProtocolModule;\n const rpcUrl = this.getRpcUrl();\n const connection = new Connection(rpcUrl, 'confirmed');\n const isSurfnet = rpcUrl === SURFNET_RPC_URL;\n try {\n const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash('confirmed');\n const isLegacyTransaction = 'recentBlockhash' in transaction && !('message' in transaction && 'staticAccountKeys' in transaction.message);\n if (isLegacyTransaction) {\n const legacyTx = transaction;\n legacyTx.recentBlockhash = blockhash;\n legacyTx.lastValidBlockHeight = lastValidBlockHeight;\n if (!legacyTx.feePayer) {\n if (feePayer) {\n legacyTx.feePayer = feePayer;\n }\n else if (this.publicKeyObj) {\n legacyTx.feePayer = this.publicKeyObj;\n }\n }\n }\n else {\n const versionedTx = transaction;\n versionedTx.message.recentBlockhash = blockhash;\n }\n if (isSurfnet) {\n // Surfnet: sign-only, then submit to our specific RPC\n const signedTransactions = await transact(async (wallet) => {\n await this.reauthorizeWallet(wallet);\n return wallet.signTransactions({ transactions: [transaction] });\n }, this.getAssociationConfig());\n const signedTx = signedTransactions[0];\n const signature = await connection.sendRawTransaction(signedTx.serialize(), {\n preflightCommitment: 'confirmed'\n });\n const confirmation = await connection.confirmTransaction({\n signature,\n blockhash,\n lastValidBlockHeight,\n }, 'confirmed');\n if (confirmation.value.err) {\n throw new Error(`Transaction failed: ${confirmation.value.err.toString()}`);\n }\n return signature;\n }\n // Non-surfnet: use signAndSendTransactions for wallet-optimized submission\n const signatures = await transact(async (wallet) => {\n await this.reauthorizeWallet(wallet);\n return wallet.signAndSendTransactions({\n transactions: [transaction],\n commitment: 'confirmed',\n });\n }, this.getAssociationConfig());\n const signature = signatures[0];\n await confirmAndCheckTransaction(connection, signature);\n return signature;\n }\n catch (error) {\n if (((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.includes('not connected')) || ((_b = error === null || error === void 0 ? void 0 : error.message) === null || _b === void 0 ? void 0 : _b.includes('not authorized')) ||\n (error === null || error === void 0 ? void 0 : error.code) === 'ERROR_AUTHORIZATION_FAILED') {\n await this.logout();\n throw new Error('Wallet connection lost. Please reconnect.');\n }\n const isUserRejection = (error === null || error === void 0 ? void 0 : error.code) === 4001 ||\n ((_c = error === null || error === void 0 ? void 0 : error.message) === null || _c === void 0 ? void 0 : _c.toLowerCase().includes('user rejected')) ||\n ((_d = error === null || error === void 0 ? void 0 : error.message) === null || _d === void 0 ? void 0 : _d.toLowerCase().includes('user denied')) ||\n ((_e = error === null || error === void 0 ? void 0 : error.message) === null || _e === void 0 ? void 0 : _e.toLowerCase().includes('user cancelled')) ||\n ((_f = error === null || error === void 0 ? void 0 : error.message) === null || _f === void 0 ? void 0 : _f.toLowerCase().includes('user canceled'));\n if (!isUserRejection) {\n console.error('[SolanaMobileWallet] Transaction failed:', error);\n }\n throw new Error(`Failed to execute transaction: ${error.message}`);\n }\n }\n async runTransaction(_evmTransactionData, solTransactionData, options) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n if (!solTransactionData) {\n throw new Error('Solana transaction data is required for mobile wallet');\n }\n if (!this.publicKeyObj || !this.authorizedPublicKey) {\n await this.login();\n }\n await loadMwaProtocol();\n const { transact } = mwaProtocolModule;\n const rpcUrl = this.getRpcUrl(solTransactionData.network);\n const connection = new Connection(rpcUrl, 'confirmed');\n const isSurfnet = rpcUrl === SURFNET_RPC_URL;\n try {\n const publicKey = this.publicKeyObj;\n const remainingAccounts = convertRemainingAccounts(solTransactionData.txArgs[0].remainingAccounts);\n let app_id = solTransactionData.appId;\n if (typeof window !== 'undefined' && window.CUSTOM_TAROBASE_APP_ID_HEADER) {\n app_id = window.CUSTOM_TAROBASE_APP_ID_HEADER;\n }\n if (!app_id) {\n throw new Error('App ID is required');\n }\n // Create a mock wallet adapter for Anchor (only publicKey is needed for building TX)\n const mockWalletAdapter = {\n publicKey,\n signTransaction: async (tx) => tx,\n signAllTransactions: async (txs) => txs,\n };\n const anchorProvider = new anchor.AnchorProvider(connection, mockWalletAdapter, anchor.AnchorProvider.defaultOptions());\n const finalDeduped = [];\n for (const acc of remainingAccounts) {\n const existing = finalDeduped.find((d) => d.pubkey.equals(acc.pubkey));\n if (existing) {\n existing.isSigner = existing.isSigner || acc.isSigner;\n existing.isWritable = existing.isWritable || acc.isWritable;\n }\n else {\n finalDeduped.push(acc);\n }\n }\n let tx;\n if (solTransactionData.signedTransaction) {\n tx = VersionedTransaction.deserialize(Buffer.from(solTransactionData.signedTransaction, 'base64'));\n }\n else {\n const result = await buildSetDocumentsTransaction(connection, solTransactionData.txArgs[0].idl, anchorProvider, publicKey, {\n app_id,\n documents: solTransactionData.txArgs[0].setDocumentData,\n delete_paths: solTransactionData.txArgs[0].deletePaths,\n txData: solTransactionData.txArgs[0].txData\n }, finalDeduped, solTransactionData.lutKey, solTransactionData.preInstructions, false, solTransactionData.additionalLutAddresses);\n tx = result.tx;\n }\n if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {\n const [signedTx] = await transact(async (wallet) => {\n await this.reauthorizeWallet(wallet);\n return wallet.signTransactions({ transactions: [tx] });\n }, this.getAssociationConfig());\n return {\n signedTransaction: signedTx,\n blockNumber: 0,\n gasUsed: '0',\n data: ''\n };\n }\n if (isSurfnet) {\n // Surfnet: sign then submit manually to our RPC\n const [signedTx] = await transact(async (wallet) => {\n await this.reauthorizeWallet(wallet);\n return wallet.signTransactions({ transactions: [tx] });\n }, this.getAssociationConfig());\n const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash('confirmed');\n const signature = await connection.sendRawTransaction(signedTx.serialize(), {\n preflightCommitment: 'confirmed'\n });\n const confirmation = await connection.confirmTransaction({\n signature,\n blockhash,\n lastValidBlockHeight,\n }, 'confirmed');\n if (confirmation.value.err) {\n throw new Error(`Transaction failed: ${confirmation.value.err.toString()}`);\n }\n const txInfo = await connection.getParsedTransaction(signature, {\n maxSupportedTransactionVersion: 0,\n commitment: 'confirmed'\n });\n return {\n transactionSignature: signature,\n blockNumber: (txInfo === null || txInfo === void 0 ? void 0 : txInfo.slot) || 0,\n gasUsed: ((_a = txInfo === null || txInfo === void 0 ? void 0 : txInfo.meta) === null || _a === void 0 ? void 0 : _a.fee.toString()) || '0',\n data: txInfo === null || txInfo === void 0 ? void 0 : txInfo.meta,\n };\n }\n // Non-surfnet: use signAndSendTransactions\n const signatures = await transact(async (wallet) => {\n await this.reauthorizeWallet(wallet);\n return wallet.signAndSendTransactions({\n transactions: [tx],\n commitment: 'confirmed',\n });\n }, this.getAssociationConfig());\n const signature = signatures[0];\n const txInfo = await confirmAndCheckTransaction(connection, signature);\n return {\n transactionSignature: signature,\n blockNumber: (txInfo === null || txInfo === void 0 ? void 0 : txInfo.slot) || 0,\n gasUsed: ((_b = txInfo === null || txInfo === void 0 ? void 0 : txInfo.meta) === null || _b === void 0 ? void 0 : _b.fee.toString()) || '0',\n data: txInfo === null || txInfo === void 0 ? void 0 : txInfo.meta,\n };\n }\n catch (error) {\n if (((_c = error === null || error === void 0 ? void 0 : error.message) === null || _c === void 0 ? void 0 : _c.includes('not connected')) || ((_d = error === null || error === void 0 ? void 0 : error.message) === null || _d === void 0 ? void 0 : _d.includes('not authorized')) ||\n (error === null || error === void 0 ? void 0 : error.code) === 'ERROR_AUTHORIZATION_FAILED') {\n await this.logout();\n throw new Error('Wallet connection lost. Please reconnect.');\n }\n const isUserRejection = (error === null || error === void 0 ? void 0 : error.code) === 4001 ||\n ((_e = error === null || error === void 0 ? void 0 : error.message) === null || _e === void 0 ? void 0 : _e.toLowerCase().includes('user rejected')) ||\n ((_f = error === null || error === void 0 ? void 0 : error.message) === null || _f === void 0 ? void 0 : _f.toLowerCase().includes('user denied')) ||\n ((_g = error === null || error === void 0 ? void 0 : error.message) === null || _g === void 0 ? void 0 : _g.toLowerCase().includes('user cancelled')) ||\n ((_h = error === null || error === void 0 ? void 0 : error.message) === null || _h === void 0 ? void 0 : _h.toLowerCase().includes('user canceled'));\n if (!isUserRejection) {\n console.error('[SolanaMobileWallet] Transaction failed:', error);\n }\n throw new Error(`Failed to execute transaction: ${error.message}`);\n }\n }\n async getNativeMethods() {\n return {\n authToken: this.authToken,\n walletUriBase: this.walletUriBase,\n publicKey: this.publicKeyObj,\n base64Address: this.base64Address,\n };\n }\n /* ----------------------------------------------------------- *\n * Private Helpers\n * ----------------------------------------------------------- */\n getRpcUrl(network) {\n if (this.networkUrl) {\n return this.networkUrl;\n }\n if (network === 'solana_devnet') {\n return SOLANA_DEVNET_RPC_URL;\n }\n else if (network === 'solana_mainnet') {\n return SOLANA_MAINNET_RPC_URL;\n }\n else if (network === 'surfnet') {\n return SURFNET_RPC_URL;\n }\n return SOLANA_MAINNET_RPC_URL;\n }\n}\nSolanaMobileWalletProvider.instance = null;\n"],"names":["SessionManager","Buffer"],"mappings":";;;;;;;AAoBA,MAAM,wBAAwB,GAAG,EAAE;AACnC;AACA,IAAI,iBAAiB,GAAG,IAAI;AAC5B,IAAI,sBAAsB,GAAG,IAAI;AACjC,eAAe,eAAe,GAAG;AACjC,IAAI,IAAI,iBAAiB;AACzB,QAAQ;AACR,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW;AACrC,QAAQ;AACR,IAAI,IAAI,sBAAsB;AAC9B,QAAQ,OAAO,sBAAsB;AACrC,IAAI,sBAAsB,GAAG,CAAC,YAAY;AAC1C,QAAQ,IAAI;AACZ,YAAY,iBAAiB,GAAG,MAAM,OAAO,iCAAsD,CAAC;AACpG,QAAQ;AACR,QAAQ,OAAO,CAAC,EAAE;AAClB,YAAY,OAAO,CAAC,IAAI,CAAC,sIAAsI,CAAC;AAChK,YAAY,MAAM,IAAI,KAAK,CAAC,yEAAyE,CAAC;AACtG,QAAQ;AACR,IAAI,CAAC,GAAG;AACR,IAAI,OAAO,sBAAsB;AACjC;AAiDA;AACA;AACA;AACA;AAC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AQ,IAAI,OAAO,KAAK,eAAe,EAAE;AACzC,YAAY,OAAO,qBAAqB;AACxC,QAAQ;AACR,aAAa,IAAI,OAAO,KAAK,gBAAgB,EAAE;AAC/C,YAAY,OAAO,sBAAsB;AACzC,QAAQ;AACR,aAAa,IAAI,OAAO,KAAK,SAAS,EAAE;AACxC,YAAY,OAAO,eAAe;AAClC,QAAQ;AACR,QAAQ,OAAO,sBAAsB;AACrC,IAAI;AACJ;AACA,0BAA0B,CAAC,QAAQ,GAAG,IAAI;;;;"}
|
package/dist/{solana-mobile-wallet-provider-Cp65LfNb.js → solana-mobile-wallet-provider-t22Ie8lY.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-Bdcc5821.js');
|
|
4
|
-
var index_native = require('./index.native-
|
|
4
|
+
var index_native = require('./index.native-CyA-RdvW.js');
|
|
5
5
|
var web3_js = require('@solana/web3.js');
|
|
6
6
|
var anchor = require('@coral-xyz/anchor');
|
|
7
7
|
require('axios');
|
|
@@ -27,63 +27,6 @@ function _interopNamespaceDefault(e) {
|
|
|
27
27
|
var anchor__namespace = /*#__PURE__*/_interopNamespaceDefault(anchor);
|
|
28
28
|
|
|
29
29
|
const ED25519_SIGNATURE_LENGTH = 64;
|
|
30
|
-
/**
|
|
31
|
-
* On Android Chrome PWA (e.g. Solana Seeker in standalone mode), MWA's
|
|
32
|
-
* transact() opens a WebSocket to ws://localhost:<port>/solana-wallet to
|
|
33
|
-
* handshake with the wallet app on the device. Chrome guards localhost
|
|
34
|
-
* connections behind the Local Network Access ("Apps on Device") permission
|
|
35
|
-
* dialog. The dialog inherits the activity's window-focus state at spawn
|
|
36
|
-
* time — so if focus is in transit (e.g. just after a Phantom-modal close
|
|
37
|
-
* triggers a React commit), the dialog renders with grayed-out Allow/Block
|
|
38
|
-
* buttons and only becomes interactive after a manual background→resume
|
|
39
|
-
* (which forces an onPause→onResume cycle on the activity).
|
|
40
|
-
*
|
|
41
|
-
* Wait for window focus to settle, then yield one frame, before opening
|
|
42
|
-
* the WebSocket. This makes the system dialog spawn into a focused activity
|
|
43
|
-
* so its buttons are immediately tappable.
|
|
44
|
-
*/
|
|
45
|
-
async function awaitActivityFocus() {
|
|
46
|
-
var _a;
|
|
47
|
-
if (typeof document === 'undefined' || typeof window === 'undefined')
|
|
48
|
-
return;
|
|
49
|
-
const t0 = Date.now();
|
|
50
|
-
const initialHasFocus = document.hasFocus();
|
|
51
|
-
console.log('[MWA-DEBUG] awaitActivityFocus: enter', {
|
|
52
|
-
hasFocus: initialHasFocus,
|
|
53
|
-
visibilityState: document.visibilityState,
|
|
54
|
-
activeElement: (_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.tagName,
|
|
55
|
-
});
|
|
56
|
-
if (!initialHasFocus) {
|
|
57
|
-
let resolvedBy = 'pending';
|
|
58
|
-
await new Promise((resolve) => {
|
|
59
|
-
const onFocus = () => {
|
|
60
|
-
window.removeEventListener('focus', onFocus);
|
|
61
|
-
resolvedBy = 'focus-event';
|
|
62
|
-
resolve();
|
|
63
|
-
};
|
|
64
|
-
window.addEventListener('focus', onFocus);
|
|
65
|
-
// Fallback in case the focus event never fires (e.g. activity
|
|
66
|
-
// already focused but document.hasFocus() momentarily lies during
|
|
67
|
-
// a React commit). 600ms is a perceptual ceiling — beyond this
|
|
68
|
-
// the user notices a stall, so we'd rather take the focus race
|
|
69
|
-
// than block forever.
|
|
70
|
-
setTimeout(() => {
|
|
71
|
-
window.removeEventListener('focus', onFocus);
|
|
72
|
-
if (resolvedBy === 'pending')
|
|
73
|
-
resolvedBy = 'timeout';
|
|
74
|
-
resolve();
|
|
75
|
-
}, 600);
|
|
76
|
-
});
|
|
77
|
-
console.log('[MWA-DEBUG] awaitActivityFocus: wait resolved', { resolvedBy, waitedMs: Date.now() - t0 });
|
|
78
|
-
}
|
|
79
|
-
// Yield to next paint so any pending React commits / focus changes have
|
|
80
|
-
// flushed before the WebSocket open spawns the system dialog.
|
|
81
|
-
await new Promise((r) => requestAnimationFrame(() => r()));
|
|
82
|
-
console.log('[MWA-DEBUG] awaitActivityFocus: exit', {
|
|
83
|
-
hasFocus: document.hasFocus(),
|
|
84
|
-
totalMs: Date.now() - t0,
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
30
|
// Dynamically imported MWA protocol module
|
|
88
31
|
let mwaProtocolModule = null;
|
|
89
32
|
let mwaProtocolLoadPromise = null;
|
|
@@ -96,7 +39,7 @@ async function loadMwaProtocol() {
|
|
|
96
39
|
return mwaProtocolLoadPromise;
|
|
97
40
|
mwaProtocolLoadPromise = (async () => {
|
|
98
41
|
try {
|
|
99
|
-
mwaProtocolModule = await Promise.resolve().then(function () { return require('./index.browser-
|
|
42
|
+
mwaProtocolModule = await Promise.resolve().then(function () { return require('./index.browser-ZD7Tz2bn.js'); });
|
|
100
43
|
}
|
|
101
44
|
catch (e) {
|
|
102
45
|
console.warn('[SolanaMobileWallet] @solana-mobile/mobile-wallet-adapter-protocol-web3js not installed. Install it to enable Seeker wallet support.');
|
|
@@ -199,17 +142,14 @@ class SolanaMobileWalletProvider {
|
|
|
199
142
|
}
|
|
200
143
|
async login() {
|
|
201
144
|
var _a, _b, _c, _d, _e;
|
|
202
|
-
console.log('[MWA-DEBUG] SolanaMobileWalletProvider.login: enter');
|
|
203
145
|
index_native.setAuthLoading(true);
|
|
204
146
|
try {
|
|
205
147
|
await loadMwaProtocol();
|
|
206
|
-
console.log('[MWA-DEBUG] loadMwaProtocol resolved');
|
|
207
148
|
const { transact } = mwaProtocolModule;
|
|
208
149
|
// Quick check: if we already have auth state and a valid session, skip
|
|
209
150
|
if (this.authorizedPublicKey) {
|
|
210
151
|
const existingSession = await index_native.WebSessionManager.getSession();
|
|
211
152
|
if (existingSession && existingSession.address === this.authorizedPublicKey) {
|
|
212
|
-
console.log('[MWA-DEBUG] login: returning existing session, no transact');
|
|
213
153
|
const user = { provider: this, address: this.authorizedPublicKey };
|
|
214
154
|
index_native.setCurrentUser(user);
|
|
215
155
|
return user;
|
|
@@ -217,12 +157,8 @@ class SolanaMobileWalletProvider {
|
|
|
217
157
|
}
|
|
218
158
|
// Pre-fetch nonce from server while wallet is not yet connected
|
|
219
159
|
const nonce = await index_native.genAuthNonce();
|
|
220
|
-
console.log('[MWA-DEBUG] login: nonce fetched, awaiting activity focus');
|
|
221
|
-
await awaitActivityFocus();
|
|
222
|
-
console.log('[MWA-DEBUG] login: about to call transact() — WebSocket to localhost will open now');
|
|
223
160
|
// Single transact() call: authorize + signMessages — one wallet popup
|
|
224
161
|
const result = await transact(async (wallet) => {
|
|
225
|
-
console.log('[MWA-DEBUG] transact callback running — WebSocket connected, calling wallet.authorize');
|
|
226
162
|
// Step 1: Authorize — user approves the dApp
|
|
227
163
|
const authResult = await wallet.authorize({
|
|
228
164
|
identity: this.appIdentity,
|
|
@@ -252,7 +188,6 @@ class SolanaMobileWalletProvider {
|
|
|
252
188
|
walletUriBase: authResult.wallet_uri_base,
|
|
253
189
|
};
|
|
254
190
|
}, this.getAssociationConfig());
|
|
255
|
-
console.log('[MWA-DEBUG] login: transact() resolved successfully');
|
|
256
191
|
// Store MWA auth state for reauthorization in subsequent transact() calls
|
|
257
192
|
this.authToken = result.authToken;
|
|
258
193
|
this.walletUriBase = result.walletUriBase;
|
|
@@ -279,12 +214,6 @@ class SolanaMobileWalletProvider {
|
|
|
279
214
|
return user;
|
|
280
215
|
}
|
|
281
216
|
catch (error) {
|
|
282
|
-
console.log('[MWA-DEBUG] login caught error', {
|
|
283
|
-
errorName: error === null || error === void 0 ? void 0 : error.name,
|
|
284
|
-
errorMessage: error === null || error === void 0 ? void 0 : error.message,
|
|
285
|
-
errorCode: error === null || error === void 0 ? void 0 : error.code,
|
|
286
|
-
hasFocus: typeof document !== 'undefined' ? document.hasFocus() : 'n/a',
|
|
287
|
-
});
|
|
288
217
|
const isUserRejection = (error === null || error === void 0 ? void 0 : error.code) === 4001 ||
|
|
289
218
|
((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes('user rejected')) ||
|
|
290
219
|
((_b = error === null || error === void 0 ? void 0 : error.message) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes('user denied')) ||
|
|
@@ -316,7 +245,6 @@ class SolanaMobileWalletProvider {
|
|
|
316
245
|
await loadMwaProtocol();
|
|
317
246
|
const { transact } = mwaProtocolModule;
|
|
318
247
|
const authToken = this.authToken;
|
|
319
|
-
await awaitActivityFocus();
|
|
320
248
|
await transact(async (wallet) => {
|
|
321
249
|
await wallet.deauthorize({ auth_token: authToken });
|
|
322
250
|
}, this.getAssociationConfig());
|
|
@@ -342,7 +270,6 @@ class SolanaMobileWalletProvider {
|
|
|
342
270
|
const { transact } = mwaProtocolModule;
|
|
343
271
|
const base64Addr = this.base64Address;
|
|
344
272
|
try {
|
|
345
|
-
await awaitActivityFocus();
|
|
346
273
|
const signedMessages = await transact(async (wallet) => {
|
|
347
274
|
await this.reauthorizeWallet(wallet);
|
|
348
275
|
const messageBytes = index_native.getPlatform().textEncode(message);
|
|
@@ -396,7 +323,6 @@ class SolanaMobileWalletProvider {
|
|
|
396
323
|
}
|
|
397
324
|
}
|
|
398
325
|
try {
|
|
399
|
-
await awaitActivityFocus();
|
|
400
326
|
const signedTransactions = await transact(async (wallet) => {
|
|
401
327
|
await this.reauthorizeWallet(wallet);
|
|
402
328
|
return wallet.signTransactions({ transactions: [transaction] });
|
|
@@ -444,7 +370,6 @@ class SolanaMobileWalletProvider {
|
|
|
444
370
|
}
|
|
445
371
|
if (isSurfnet) {
|
|
446
372
|
// Surfnet: sign-only, then submit to our specific RPC
|
|
447
|
-
await awaitActivityFocus();
|
|
448
373
|
const signedTransactions = await transact(async (wallet) => {
|
|
449
374
|
await this.reauthorizeWallet(wallet);
|
|
450
375
|
return wallet.signTransactions({ transactions: [transaction] });
|
|
@@ -464,7 +389,6 @@ class SolanaMobileWalletProvider {
|
|
|
464
389
|
return signature;
|
|
465
390
|
}
|
|
466
391
|
// Non-surfnet: use signAndSendTransactions for wallet-optimized submission
|
|
467
|
-
await awaitActivityFocus();
|
|
468
392
|
const signatures = await transact(async (wallet) => {
|
|
469
393
|
await this.reauthorizeWallet(wallet);
|
|
470
394
|
return wallet.signAndSendTransactions({
|
|
@@ -548,7 +472,6 @@ class SolanaMobileWalletProvider {
|
|
|
548
472
|
tx = result.tx;
|
|
549
473
|
}
|
|
550
474
|
if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
|
|
551
|
-
await awaitActivityFocus();
|
|
552
475
|
const [signedTx] = await transact(async (wallet) => {
|
|
553
476
|
await this.reauthorizeWallet(wallet);
|
|
554
477
|
return wallet.signTransactions({ transactions: [tx] });
|
|
@@ -562,7 +485,6 @@ class SolanaMobileWalletProvider {
|
|
|
562
485
|
}
|
|
563
486
|
if (isSurfnet) {
|
|
564
487
|
// Surfnet: sign then submit manually to our RPC
|
|
565
|
-
await awaitActivityFocus();
|
|
566
488
|
const [signedTx] = await transact(async (wallet) => {
|
|
567
489
|
await this.reauthorizeWallet(wallet);
|
|
568
490
|
return wallet.signTransactions({ transactions: [tx] });
|
|
@@ -591,7 +513,6 @@ class SolanaMobileWalletProvider {
|
|
|
591
513
|
};
|
|
592
514
|
}
|
|
593
515
|
// Non-surfnet: use signAndSendTransactions
|
|
594
|
-
await awaitActivityFocus();
|
|
595
516
|
const signatures = await transact(async (wallet) => {
|
|
596
517
|
await this.reauthorizeWallet(wallet);
|
|
597
518
|
return wallet.signAndSendTransactions({
|
|
@@ -655,4 +576,4 @@ class SolanaMobileWalletProvider {
|
|
|
655
576
|
SolanaMobileWalletProvider.instance = null;
|
|
656
577
|
|
|
657
578
|
exports.SolanaMobileWalletProvider = SolanaMobileWalletProvider;
|
|
658
|
-
//# sourceMappingURL=solana-mobile-wallet-provider-
|
|
579
|
+
//# sourceMappingURL=solana-mobile-wallet-provider-t22Ie8lY.js.map
|