@pooflabs/web 0.0.85-rc2 → 0.0.86

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 (50) hide show
  1. package/dist/{index-B1_Q49qQ.js → index-BHkED2YI.js} +2 -2
  2. package/dist/{index-B1_Q49qQ.js.map → index-BHkED2YI.js.map} +1 -1
  3. package/dist/{index-QukWgaIi.esm.js → index-BQUfNEiY.esm.js} +282 -36
  4. package/dist/{index-QukWgaIi.esm.js.map → index-BQUfNEiY.esm.js.map} +1 -1
  5. package/dist/{index-B7tJ8TAn.esm.js → index-Cfp30Jm_.esm.js} +2 -2
  6. package/dist/{index-B7tJ8TAn.esm.js.map → index-Cfp30Jm_.esm.js.map} +1 -1
  7. package/dist/{index-DyRIXw-l.js → index-D-Wbwevj.js} +2 -2
  8. package/dist/index-D-Wbwevj.js.map +1 -0
  9. package/dist/{index-agGmWBn4.esm.js → index-DK28JaJm.esm.js} +3 -3
  10. package/dist/{index-agGmWBn4.esm.js.map → index-DK28JaJm.esm.js.map} +1 -1
  11. package/dist/index-DKyWaxCB.esm.js +6 -0
  12. package/dist/index-DKyWaxCB.esm.js.map +1 -0
  13. package/dist/{index-DflG_JAB.js → index-DUn32Hkh.js} +3 -3
  14. package/dist/{index-DflG_JAB.js.map → index-DUn32Hkh.js.map} +1 -1
  15. package/dist/{index-BeFR3-cf.js → index-hEc5_KoM.js} +282 -36
  16. package/dist/{index-BeFR3-cf.js.map → index-hEc5_KoM.js.map} +1 -1
  17. package/dist/{index.browser-lHP9glAW.esm.js → index.browser-C9gHoUen.esm.js} +2 -2
  18. package/dist/{index.browser-lHP9glAW.esm.js.map → index.browser-C9gHoUen.esm.js.map} +1 -1
  19. package/dist/{index.browser-DZtZWdul.js → index.browser-CbawPvh6.js} +2 -2
  20. package/dist/{index.browser-DZtZWdul.js.map → index.browser-CbawPvh6.js.map} +1 -1
  21. package/dist/{index.browser-BJmFjY2f.js → index.browser-DD8pg_L2.js} +2 -2
  22. package/dist/{index.browser-BJmFjY2f.js.map → index.browser-DD8pg_L2.js.map} +1 -1
  23. package/dist/{index.browser-p-pgsxxW.esm.js → index.browser-DQqKPfDA.esm.js} +2 -2
  24. package/dist/{index.browser-p-pgsxxW.esm.js.map → index.browser-DQqKPfDA.esm.js.map} +1 -1
  25. package/dist/index.esm.js +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/{index.native-ANhb4jEB.js → index.native-7hiNiSyC.js} +4 -4
  28. package/dist/{index.native-ANhb4jEB.js.map → index.native-7hiNiSyC.js.map} +1 -1
  29. package/dist/{index.native-a3mhu9HP.esm.js → index.native-BItnSD47.esm.js} +4 -4
  30. package/dist/{index.native-a3mhu9HP.esm.js.map → index.native-BItnSD47.esm.js.map} +1 -1
  31. package/dist/index.native.esm.js +1 -1
  32. package/dist/index.native.js +1 -1
  33. package/dist/{phantom-wallet-provider-BOdn0D1Q.js → phantom-wallet-provider-CjvLq_2_.js} +4 -4
  34. package/dist/{phantom-wallet-provider-BOdn0D1Q.js.map → phantom-wallet-provider-CjvLq_2_.js.map} +1 -1
  35. package/dist/{phantom-wallet-provider-Dsza6TBv.esm.js → phantom-wallet-provider-DE3vit2Z.esm.js} +4 -4
  36. package/dist/{phantom-wallet-provider-Dsza6TBv.esm.js.map → phantom-wallet-provider-DE3vit2Z.esm.js.map} +1 -1
  37. package/dist/{privy-wallet-provider-BlPh3Gn_.js → privy-wallet-provider-DFZaQPss.js} +3 -3
  38. package/dist/{privy-wallet-provider-BlPh3Gn_.js.map → privy-wallet-provider-DFZaQPss.js.map} +1 -1
  39. package/dist/{privy-wallet-provider-bwwhkFjL.esm.js → privy-wallet-provider-ip2pqo_U.esm.js} +3 -3
  40. package/dist/{privy-wallet-provider-bwwhkFjL.esm.js.map → privy-wallet-provider-ip2pqo_U.esm.js.map} +1 -1
  41. package/dist/{solana-mobile-wallet-provider-fzLIgJBf.esm.js → solana-mobile-wallet-provider-D7BbSpez.esm.js} +281 -35
  42. package/dist/solana-mobile-wallet-provider-D7BbSpez.esm.js.map +1 -0
  43. package/dist/{solana-mobile-wallet-provider-S8yWHG6i.js → solana-mobile-wallet-provider-DwER68Rz.js} +281 -35
  44. package/dist/solana-mobile-wallet-provider-DwER68Rz.js.map +1 -0
  45. package/package.json +1 -1
  46. package/dist/index-DbJCCvVN.esm.js +0 -6
  47. package/dist/index-DbJCCvVN.esm.js.map +0 -1
  48. package/dist/index-DyRIXw-l.js.map +0 -1
  49. package/dist/solana-mobile-wallet-provider-S8yWHG6i.js.map +0 -1
  50. package/dist/solana-mobile-wallet-provider-fzLIgJBf.esm.js.map +0 -1
@@ -15730,7 +15730,7 @@ async function loadDependencies() {
15730
15730
  const [reactModule, reactDomModule, phantomModule] = await Promise.all([
15731
15731
  import('react'),
15732
15732
  import('react-dom/client'),
15733
- Promise.resolve().then(function () { return require('./index-B1_Q49qQ.js'); })
15733
+ Promise.resolve().then(function () { return require('./index-BHkED2YI.js'); })
15734
15734
  ]);
15735
15735
  // Extract default export from ESM module namespace
15736
15736
  // Dynamic import() returns { default: Module, ...exports }, not the module directly
@@ -21357,20 +21357,11 @@ function isMwaAssociationRetryable(e) {
21357
21357
  * so a second attempt skips the consent sheet, jumps straight to
21358
21358
  * Verify/Approve, and completes inside the timeout.
21359
21359
  */
21360
- async function withMwaAssociationRetry(label, fn) {
21361
- const t0 = Date.now();
21362
- console.log(`[MWA-DEBUG] ${label} attempt=1 start`);
21360
+ async function withMwaAssociationRetry(fn) {
21363
21361
  try {
21364
- const result = await fn();
21365
- console.log(`[MWA-DEBUG] ${label} attempt=1 ok (${Date.now() - t0}ms)`);
21366
- return result;
21362
+ return await fn();
21367
21363
  }
21368
21364
  catch (e) {
21369
- const info = findMwaError(e);
21370
- console.log(`[MWA-DEBUG] ${label} attempt=1 err (${Date.now() - t0}ms)`, {
21371
- outer: { name: e === null || e === void 0 ? void 0 : e.name, message: e === null || e === void 0 ? void 0 : e.message },
21372
- mwa: info,
21373
- });
21374
21365
  const retryable = isMwaAssociationRetryable(e);
21375
21366
  if (!retryable)
21376
21367
  throw e;
@@ -21379,21 +21370,11 @@ async function withMwaAssociationRetry(label, fn) {
21379
21370
  // so visibility-based waits fire too early. Use a fixed delay long
21380
21371
  // enough for Seeker to dismiss its sheet and the OS to release intent
21381
21372
  // state. 2.5s is empirically safe; tune from device traces if needed.
21382
- console.log(`[MWA-DEBUG] ${label} retryable (${retryable.code}); waiting 2500ms before retry`);
21383
21373
  await new Promise(r => setTimeout(r, 2500));
21384
- const t1 = Date.now();
21385
- console.log(`[MWA-DEBUG] ${label} attempt=2 start`);
21386
21374
  try {
21387
- const result = await fn();
21388
- console.log(`[MWA-DEBUG] ${label} attempt=2 ok (${Date.now() - t1}ms)`);
21389
- return result;
21375
+ return await fn();
21390
21376
  }
21391
21377
  catch (e2) {
21392
- const info2 = findMwaError(e2);
21393
- console.log(`[MWA-DEBUG] ${label} attempt=2 err (${Date.now() - t1}ms)`, {
21394
- outer: { name: e2 === null || e2 === void 0 ? void 0 : e2.name, message: e2 === null || e2 === void 0 ? void 0 : e2.message },
21395
- mwa: info2,
21396
- });
21397
21378
  // Only mask the error with the clean Seeker message when the
21398
21379
  // second failure is also an association-flavored error. If it's
21399
21380
  // a user cancel, wallet rejection, or unknown error, rethrow
@@ -21405,6 +21386,259 @@ async function withMwaAssociationRetry(label, fn) {
21405
21386
  }
21406
21387
  }
21407
21388
  }
21389
+ /**
21390
+ * User-gesture-mediated wallet-standard sign helper.
21391
+ *
21392
+ * Why this exists: login flows that go through wallet-standard call two
21393
+ * separate transacts (standard:connect, then solana:signMessage). Each
21394
+ * transact dispatches its own `solana-wallet:` Android intent navigation
21395
+ * via `window.location.assign(associationUrl)` (see
21396
+ * @solana-mobile/mobile-wallet-adapter-protocol/lib/cjs/index.browser.js
21397
+ * `launchAssociation()` at line 459). Chrome requires **transient user
21398
+ * activation** for each custom-scheme navigation. The first transact
21399
+ * consumes the activation from the user's "Continue to Allow" tap on the
21400
+ * LNA modal; by the time the second transact (signMessage) runs as a JS
21401
+ * continuation, the activation has decayed, Chrome blocks the navigation,
21402
+ * no `blur` event fires, the protocol's `getDetectionPromise` (3000ms
21403
+ * timeout, line 433) rejects, and we get `ERROR_WALLET_NOT_FOUND`.
21404
+ *
21405
+ * Fix: show a Tarobase-controlled modal between the two transacts. When the
21406
+ * user taps the modal's "Sign in" button, that tap IS a fresh user
21407
+ * activation. We invoke the sign function directly inside the click handler
21408
+ * — no `await` between the tap and the call — so the activation propagates
21409
+ * to the protocol's `location.assign`.
21410
+ *
21411
+ * Failure recovery is also user-gesture driven: if the sign function fails
21412
+ * with a retryable association error, we re-enable the button so the user's
21413
+ * next tap is a new activation (a real retry). A timer-based retry would
21414
+ * just hit the same Chrome block. Cap at 3 attempts before giving up.
21415
+ */
21416
+ async function awaitSignInGestureAndSign(theme, signFn) {
21417
+ if (typeof document === 'undefined' || typeof window === 'undefined') {
21418
+ // SSR / non-browser: skip the gesture, just call (the activation
21419
+ // model doesn't apply outside the browser).
21420
+ const results = await signFn();
21421
+ if (!results || results.length === 0)
21422
+ throw new Error('MWA returned no signature');
21423
+ return results[0];
21424
+ }
21425
+ return new Promise((resolve, reject) => {
21426
+ const isDark = theme === 'dark'
21427
+ || (theme == null
21428
+ && typeof window.matchMedia === 'function'
21429
+ && window.matchMedia('(prefers-color-scheme: dark)').matches);
21430
+ // Palette
21431
+ const overlayBg = 'rgba(0, 0, 0, 0.62)';
21432
+ const cardBg = isDark ? '#1a1a1f' : '#ffffff';
21433
+ const titleColor = isDark ? '#ffffff' : '#0a0a0a';
21434
+ const subtitleColor = isDark ? '#a1a1aa' : '#52525b';
21435
+ const btnBg = isDark ? '#ffffff' : '#0a0a0a';
21436
+ const btnText = isDark ? '#0a0a0a' : '#ffffff';
21437
+ const btnDisabledBg = isDark ? '#3f3f46' : '#d4d4d8';
21438
+ const btnDisabledText = isDark ? '#71717a' : '#71717a';
21439
+ const errorColor = isDark ? '#fca5a5' : '#dc2626';
21440
+ const closeColor = isDark ? '#71717a' : '#a1a1aa';
21441
+ const fontStack = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';
21442
+ const overlay = document.createElement('div');
21443
+ overlay.setAttribute('data-tarobase-mwa-gesture', 'true');
21444
+ overlay.style.cssText = [
21445
+ 'position: fixed',
21446
+ 'inset: 0',
21447
+ 'z-index: 2147483646',
21448
+ `background: ${overlayBg}`,
21449
+ 'display: flex',
21450
+ 'align-items: center',
21451
+ 'justify-content: center',
21452
+ 'padding: 20px',
21453
+ 'box-sizing: border-box',
21454
+ `font-family: ${fontStack}`,
21455
+ ].join('; ');
21456
+ const card = document.createElement('div');
21457
+ card.style.cssText = [
21458
+ `background: ${cardBg}`,
21459
+ 'border-radius: 20px',
21460
+ 'padding: 28px 24px 24px',
21461
+ 'max-width: 340px',
21462
+ 'width: 100%',
21463
+ 'box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28)',
21464
+ 'position: relative',
21465
+ 'box-sizing: border-box',
21466
+ ].join('; ');
21467
+ const closeBtn = document.createElement('button');
21468
+ closeBtn.setAttribute('aria-label', 'Close');
21469
+ closeBtn.innerHTML = '×';
21470
+ closeBtn.style.cssText = [
21471
+ 'position: absolute',
21472
+ 'top: 12px',
21473
+ 'right: 12px',
21474
+ 'background: transparent',
21475
+ 'border: none',
21476
+ `color: ${closeColor}`,
21477
+ 'font-size: 24px',
21478
+ 'line-height: 1',
21479
+ 'cursor: pointer',
21480
+ 'padding: 6px 10px',
21481
+ 'border-radius: 8px',
21482
+ ].join('; ');
21483
+ const title = document.createElement('div');
21484
+ title.textContent = 'Almost there';
21485
+ title.style.cssText = [
21486
+ `color: ${titleColor}`,
21487
+ 'font-size: 20px',
21488
+ 'font-weight: 600',
21489
+ 'margin-bottom: 6px',
21490
+ 'text-align: center',
21491
+ ].join('; ');
21492
+ const subtitle = document.createElement('div');
21493
+ subtitle.textContent = 'Tap to sign in with your wallet';
21494
+ subtitle.style.cssText = [
21495
+ `color: ${subtitleColor}`,
21496
+ 'font-size: 14px',
21497
+ 'line-height: 1.4',
21498
+ 'margin-bottom: 22px',
21499
+ 'text-align: center',
21500
+ ].join('; ');
21501
+ const errorRow = document.createElement('div');
21502
+ errorRow.style.cssText = [
21503
+ `color: ${errorColor}`,
21504
+ 'font-size: 13px',
21505
+ 'line-height: 1.4',
21506
+ 'margin-bottom: 14px',
21507
+ 'text-align: center',
21508
+ 'min-height: 0',
21509
+ 'transition: min-height 100ms ease',
21510
+ ].join('; ');
21511
+ const button = document.createElement('button');
21512
+ button.textContent = 'Sign in';
21513
+ const setButtonEnabledStyle = () => {
21514
+ button.style.cssText = [
21515
+ `background: ${btnBg}`,
21516
+ `color: ${btnText}`,
21517
+ 'border: none',
21518
+ 'border-radius: 14px',
21519
+ 'padding: 14px 20px',
21520
+ 'font-size: 16px',
21521
+ 'font-weight: 600',
21522
+ 'width: 100%',
21523
+ 'cursor: pointer',
21524
+ '-webkit-tap-highlight-color: transparent',
21525
+ 'box-sizing: border-box',
21526
+ `font-family: ${fontStack}`,
21527
+ ].join('; ');
21528
+ };
21529
+ const setButtonDisabledStyle = () => {
21530
+ button.style.cssText = [
21531
+ `background: ${btnDisabledBg}`,
21532
+ `color: ${btnDisabledText}`,
21533
+ 'border: none',
21534
+ 'border-radius: 14px',
21535
+ 'padding: 14px 20px',
21536
+ 'font-size: 16px',
21537
+ 'font-weight: 600',
21538
+ 'width: 100%',
21539
+ 'cursor: default',
21540
+ '-webkit-tap-highlight-color: transparent',
21541
+ 'box-sizing: border-box',
21542
+ `font-family: ${fontStack}`,
21543
+ ].join('; ');
21544
+ };
21545
+ setButtonEnabledStyle();
21546
+ card.appendChild(closeBtn);
21547
+ card.appendChild(title);
21548
+ card.appendChild(subtitle);
21549
+ card.appendChild(errorRow);
21550
+ card.appendChild(button);
21551
+ overlay.appendChild(card);
21552
+ document.body.appendChild(overlay);
21553
+ let settled = false;
21554
+ let attemptCount = 0;
21555
+ const MAX_ATTEMPTS = 3;
21556
+ const cleanup = () => {
21557
+ try {
21558
+ overlay.remove();
21559
+ }
21560
+ catch ( /* ignore */_a) { /* ignore */ }
21561
+ document.removeEventListener('keydown', onKeydown);
21562
+ };
21563
+ const finishResolve = (value) => {
21564
+ if (settled)
21565
+ return;
21566
+ settled = true;
21567
+ cleanup();
21568
+ resolve(value);
21569
+ };
21570
+ const finishReject = (err) => {
21571
+ if (settled)
21572
+ return;
21573
+ settled = true;
21574
+ cleanup();
21575
+ reject(err);
21576
+ };
21577
+ const handleCancel = () => {
21578
+ // Phrasing matches login()'s isUserRejection substring check so
21579
+ // the existing catch suppresses error-log noise.
21580
+ finishReject(new Error('User cancelled wallet sign in'));
21581
+ };
21582
+ closeBtn.addEventListener('click', () => {
21583
+ handleCancel();
21584
+ });
21585
+ overlay.addEventListener('click', (e) => {
21586
+ if (e.target === overlay) {
21587
+ handleCancel();
21588
+ }
21589
+ });
21590
+ const onKeydown = (e) => {
21591
+ if (e.key === 'Escape') {
21592
+ handleCancel();
21593
+ }
21594
+ };
21595
+ document.addEventListener('keydown', onKeydown);
21596
+ button.addEventListener('click', () => {
21597
+ if (settled)
21598
+ return;
21599
+ attemptCount++;
21600
+ const attempt = attemptCount;
21601
+ // Disable to prevent double-clicks while the wallet popup is up.
21602
+ button.disabled = true;
21603
+ setButtonDisabledStyle();
21604
+ const originalText = 'Sign in';
21605
+ button.textContent = 'Signing in…';
21606
+ errorRow.textContent = '';
21607
+ errorRow.style.minHeight = '0';
21608
+ // CRITICAL: invoke signFn() synchronously inside the click handler
21609
+ // so Chrome's transient user activation propagates to the
21610
+ // protocol's window.location.assign(associationUrl) inside
21611
+ // launchAssociation(). Do not `await` before calling.
21612
+ signFn().then((results) => {
21613
+ if (!results || results.length === 0) {
21614
+ finishReject(new Error('MWA returned no signature'));
21615
+ return;
21616
+ }
21617
+ finishResolve(results[0]);
21618
+ }).catch((err) => {
21619
+ const retryable = isMwaAssociationRetryable(err);
21620
+ if (retryable && attempt < MAX_ATTEMPTS) {
21621
+ // Re-enable the button so the user's next tap provides a
21622
+ // fresh user activation. Show inline error text.
21623
+ button.disabled = false;
21624
+ setButtonEnabledStyle();
21625
+ button.textContent = originalText;
21626
+ errorRow.textContent = "Couldn't connect — tap to try again";
21627
+ errorRow.style.minHeight = '20px';
21628
+ return;
21629
+ }
21630
+ if (retryable) {
21631
+ // Hit the attempt cap with a still-retryable failure.
21632
+ finishReject(new Error("Couldn't connect to your Seeker wallet. Please try again."));
21633
+ return;
21634
+ }
21635
+ // Non-retryable error (user cancel inside Seeker, wallet
21636
+ // rejected sign, unknown error, etc.) — surface as-is.
21637
+ finishReject(err);
21638
+ });
21639
+ });
21640
+ });
21641
+ }
21408
21642
  /**
21409
21643
  * Normalize a chain string to a wallet-standard Solana chain identifier.
21410
21644
  *
@@ -21546,7 +21780,7 @@ async function registerMobileWalletAdapter(config) {
21546
21780
  if (typeof window === 'undefined')
21547
21781
  return;
21548
21782
  try {
21549
- const walletStandardMobile = await Promise.resolve().then(function () { return require('./index.browser-BJmFjY2f.js'); });
21783
+ const walletStandardMobile = await Promise.resolve().then(function () { return require('./index.browser-DD8pg_L2.js'); });
21550
21784
  const registerMwa = walletStandardMobile.registerMwa || ((_a = walletStandardMobile.default) === null || _a === void 0 ? void 0 : _a.registerMwa);
21551
21785
  if (!registerMwa) {
21552
21786
  console.warn('[SolanaMobileWallet] registerMwa not found in @solana-mobile/wallet-standard-mobile');
@@ -21573,7 +21807,7 @@ async function registerMobileWalletAdapter(config) {
21573
21807
  // SolanaMobileWalletProvider.ensureWallet() for why. Consumers that
21574
21808
  // want their own UX can pass config.onWalletNotFound.
21575
21809
  options.onWalletNotFound = (_b = config === null || config === void 0 ? void 0 : config.onWalletNotFound) !== null && _b !== void 0 ? _b : (async () => {
21576
- console.warn('[MWA-DEBUG] registerMobileWalletAdapter onWalletNotFound (suppressed)');
21810
+ // intentional no-op
21577
21811
  });
21578
21812
  registerMwa(options);
21579
21813
  }
@@ -21638,7 +21872,7 @@ class SolanaMobileWalletProvider {
21638
21872
  async ensureWallet() {
21639
21873
  if (this.wallet)
21640
21874
  return this.wallet;
21641
- const mod = await Promise.resolve().then(function () { return require('./index.browser-BJmFjY2f.js'); });
21875
+ const mod = await Promise.resolve().then(function () { return require('./index.browser-DD8pg_L2.js'); });
21642
21876
  const chain = mapChainToWalletStandard(this.cluster);
21643
21877
  this.wallet = new mod.LocalSolanaMobileWalletAdapterWallet({
21644
21878
  appIdentity: this.appIdentity,
@@ -21652,7 +21886,7 @@ class SolanaMobileWalletProvider {
21652
21886
  // login()'s withMwaAssociationRetry handles this case; on second
21653
21887
  // failure it surfaces a clean error message to the host app.
21654
21888
  onWalletNotFound: async () => {
21655
- console.warn('[MWA-DEBUG] ensureWallet onWalletNotFound (suppressed)');
21889
+ // intentional no-op
21656
21890
  },
21657
21891
  });
21658
21892
  return this.wallet;
@@ -21726,7 +21960,7 @@ class SolanaMobileWalletProvider {
21726
21960
  // consent on the second pass and completes quickly. See
21727
21961
  // withMwaAssociationRetry for details.
21728
21962
  const connectFeat = getConnectFeature(wallet);
21729
- const { accounts } = await withMwaAssociationRetry('login:connect', () => connectFeat.connect());
21963
+ const { accounts } = await withMwaAssociationRetry(() => connectFeat.connect());
21730
21964
  if (!accounts || accounts.length === 0) {
21731
21965
  throw new Error('MWA returned no accounts');
21732
21966
  }
@@ -21740,18 +21974,30 @@ class SolanaMobileWalletProvider {
21740
21974
  setCurrentUser(user);
21741
21975
  return user;
21742
21976
  }
21743
- // Wallet popup #2: sign the Tarobase nonce message. Wrap with the
21744
- // same retry for defense in depth — by now Seeker has cached the
21745
- // consent so this rarely hits the retry path, but if the
21746
- // protocol's session timer fires here too we recover transparently.
21977
+ // Wallet popup #2: sign the Tarobase nonce message.
21978
+ //
21979
+ // We cannot call signMessageFeat.signMessage() directly here:
21980
+ // it would run as a JS continuation from the connect() resolve,
21981
+ // with no fresh Chrome transient user activation. The wallet-
21982
+ // standard sign path internally dispatches a new solana-wallet:
21983
+ // Android intent via window.location.assign() (see
21984
+ // @solana-mobile/mobile-wallet-adapter-protocol launchAssociation
21985
+ // at lib/cjs/index.browser.js:459). Chrome blocks the assign
21986
+ // without activation, the blur event never fires, and the
21987
+ // protocol's 3-second getDetectionPromise rejects with
21988
+ // ERROR_WALLET_NOT_FOUND.
21989
+ //
21990
+ // Insert a Tarobase modal: the user's tap on "Sign in" provides a
21991
+ // fresh activation, and signMessage is invoked synchronously
21992
+ // inside the click handler so the activation propagates.
21747
21993
  const messageText = await genSolanaMessage(base58Addr, nonce);
21748
21994
  const messageBytes = getPlatform().textEncode(messageText);
21749
21995
  const signMessageFeat = getSignMessageFeature(wallet);
21750
- const signResults = await withMwaAssociationRetry('login:signMessage', () => signMessageFeat.signMessage({ account, message: messageBytes }));
21751
- if (!signResults || signResults.length === 0) {
21996
+ const signResult = await awaitSignInGestureAndSign(this.config.theme, () => signMessageFeat.signMessage({ account, message: messageBytes }));
21997
+ if (!signResult) {
21752
21998
  throw new Error('MWA returned no signature');
21753
21999
  }
21754
- const { signature: sigBytes } = signResults[0];
22000
+ const { signature: sigBytes } = signResult;
21755
22001
  const signatureBase64 = bufferExports.Buffer.from(sigBytes).toString('base64');
21756
22002
  // Create Tarobase session on the server.
21757
22003
  const createSessionResult = await createSessionWithSignature(base58Addr, messageText, signatureBase64);
@@ -22561,4 +22807,4 @@ exports.signSessionCreateMessage = signSessionCreateMessage;
22561
22807
  exports.signTransaction = signTransaction;
22562
22808
  exports.subscribe = subscribe;
22563
22809
  exports.useAuth = useAuth;
22564
- //# sourceMappingURL=index-BeFR3-cf.js.map
22810
+ //# sourceMappingURL=index-hEc5_KoM.js.map