@pooflabs/web 0.0.87 → 0.0.88

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-DofM-ue2.esm.js → index-BfsQaxom.esm.js} +2 -2
  2. package/dist/{index-DofM-ue2.esm.js.map → index-BfsQaxom.esm.js.map} +1 -1
  3. package/dist/{index-BTwX7FYW.esm.js → index-CJRFnq6O.esm.js} +63 -33
  4. package/dist/{index-BTwX7FYW.esm.js.map → index-CJRFnq6O.esm.js.map} +1 -1
  5. package/dist/{index-BKN0IwAx.js → index-CTtGbOzo.js} +2 -2
  6. package/dist/{index-BKN0IwAx.js.map → index-CTtGbOzo.js.map} +1 -1
  7. package/dist/{index-B-x9RTF7.js → index-CvNX4W0l.js} +2 -2
  8. package/dist/index-CvNX4W0l.js.map +1 -0
  9. package/dist/{index-DYBdUxnT.js → index-DBYgqO9f.js} +3 -3
  10. package/dist/{index-DYBdUxnT.js.map → index-DBYgqO9f.js.map} +1 -1
  11. package/dist/index-DpiO7Cpe.esm.js +6 -0
  12. package/dist/index-DpiO7Cpe.esm.js.map +1 -0
  13. package/dist/{index-Dj1tZr6X.js → index-Lm0k5Hwv.js} +63 -33
  14. package/dist/{index-Dj1tZr6X.js.map → index-Lm0k5Hwv.js.map} +1 -1
  15. package/dist/{index-x7a-wH2l.esm.js → index-MF_M5V0O.esm.js} +3 -3
  16. package/dist/{index-x7a-wH2l.esm.js.map → index-MF_M5V0O.esm.js.map} +1 -1
  17. package/dist/{index.browser-D7-FFk3q.js → index.browser-BCr9Sc8V.js} +2 -2
  18. package/dist/{index.browser-D7-FFk3q.js.map → index.browser-BCr9Sc8V.js.map} +1 -1
  19. package/dist/{index.browser-DlA-NKvf.js → index.browser-BxKN5pIs.js} +2 -2
  20. package/dist/{index.browser-DlA-NKvf.js.map → index.browser-BxKN5pIs.js.map} +1 -1
  21. package/dist/{index.browser-Cndx2raY.esm.js → index.browser-CGZvkfTO.esm.js} +2 -2
  22. package/dist/{index.browser-Cndx2raY.esm.js.map → index.browser-CGZvkfTO.esm.js.map} +1 -1
  23. package/dist/{index.browser-nVGFrIHK.esm.js → index.browser-CMijwVwX.esm.js} +2 -2
  24. package/dist/{index.browser-nVGFrIHK.esm.js.map → index.browser-CMijwVwX.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-D8vj3Lbr.js → index.native-FMbSnE7i.js} +4 -4
  28. package/dist/{index.native-D8vj3Lbr.js.map → index.native-FMbSnE7i.js.map} +1 -1
  29. package/dist/{index.native-19VsREMJ.esm.js → index.native-GyqT8Dn5.esm.js} +4 -4
  30. package/dist/{index.native-19VsREMJ.esm.js.map → index.native-GyqT8Dn5.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-BlZZa_3s.js → phantom-wallet-provider-4_DBhDbx.js} +4 -4
  34. package/dist/{phantom-wallet-provider-BlZZa_3s.js.map → phantom-wallet-provider-4_DBhDbx.js.map} +1 -1
  35. package/dist/{phantom-wallet-provider-Bz3qEFzX.esm.js → phantom-wallet-provider-BFSfBW0w.esm.js} +4 -4
  36. package/dist/{phantom-wallet-provider-Bz3qEFzX.esm.js.map → phantom-wallet-provider-BFSfBW0w.esm.js.map} +1 -1
  37. package/dist/{privy-wallet-provider-CqCgq7uT.js → privy-wallet-provider-DRss_Hua.js} +3 -3
  38. package/dist/{privy-wallet-provider-CqCgq7uT.js.map → privy-wallet-provider-DRss_Hua.js.map} +1 -1
  39. package/dist/{privy-wallet-provider-DgNFzioA.esm.js → privy-wallet-provider-Dl0feuCb.esm.js} +3 -3
  40. package/dist/{privy-wallet-provider-DgNFzioA.esm.js.map → privy-wallet-provider-Dl0feuCb.esm.js.map} +1 -1
  41. package/dist/{solana-mobile-wallet-provider-EeQsBTdr.esm.js → solana-mobile-wallet-provider-C5mN8Dxh.esm.js} +63 -33
  42. package/dist/solana-mobile-wallet-provider-C5mN8Dxh.esm.js.map +1 -0
  43. package/dist/{solana-mobile-wallet-provider-VqIGfdMV.js → solana-mobile-wallet-provider-CAZs-TkL.js} +63 -33
  44. package/dist/solana-mobile-wallet-provider-CAZs-TkL.js.map +1 -0
  45. package/package.json +1 -1
  46. package/dist/index-B-x9RTF7.js.map +0 -1
  47. package/dist/index-_k6pjuwx.esm.js +0 -6
  48. package/dist/index-_k6pjuwx.esm.js.map +0 -1
  49. package/dist/solana-mobile-wallet-provider-EeQsBTdr.esm.js.map +0 -1
  50. package/dist/solana-mobile-wallet-provider-VqIGfdMV.js.map +0 -1
@@ -15680,7 +15680,7 @@ async function loadDependencies() {
15680
15680
  const [reactModule, reactDomModule, phantomModule] = await Promise.all([
15681
15681
  import('react'),
15682
15682
  import('react-dom/client'),
15683
- import('./index-DofM-ue2.esm.js')
15683
+ import('./index-BfsQaxom.esm.js')
15684
15684
  ]);
15685
15685
  // Extract default export from ESM module namespace
15686
15686
  // Dynamic import() returns { default: Module, ...exports }, not the module directly
@@ -21381,13 +21381,13 @@ async function withMwaAssociationRetry(fn) {
21381
21381
  * next tap is a new activation (a real retry). A timer-based retry would
21382
21382
  * just hit the same Chrome block. Cap at 3 attempts before giving up.
21383
21383
  */
21384
- async function awaitSignInGestureAndSign(theme, signFn) {
21384
+ async function awaitSignInGestureAndSign(theme, signFn, noResultError = 'MWA returned no signature') {
21385
21385
  if (typeof document === 'undefined' || typeof window === 'undefined') {
21386
21386
  // SSR / non-browser: skip the gesture, just call (the activation
21387
21387
  // model doesn't apply outside the browser).
21388
21388
  const results = await signFn();
21389
21389
  if (!results || results.length === 0)
21390
- throw new Error('MWA returned no signature');
21390
+ throw new Error(noResultError);
21391
21391
  return results[0];
21392
21392
  }
21393
21393
  return new Promise((resolve, reject) => {
@@ -21579,7 +21579,7 @@ async function awaitSignInGestureAndSign(theme, signFn) {
21579
21579
  // launchAssociation(). Do not `await` before calling.
21580
21580
  signFn().then((results) => {
21581
21581
  if (!results || results.length === 0) {
21582
- finishReject(new Error('MWA returned no signature'));
21582
+ finishReject(new Error(noResultError));
21583
21583
  return;
21584
21584
  }
21585
21585
  finishResolve(results[0]);
@@ -21607,6 +21607,31 @@ async function awaitSignInGestureAndSign(theme, signFn) {
21607
21607
  });
21608
21608
  });
21609
21609
  }
21610
+ /**
21611
+ * Sign through the gesture modal ONLY when transient user activation has
21612
+ * already decayed. Fast transactions still hold the activation from the
21613
+ * user's tap, so the `solana-wallet:` navigation succeeds directly with no
21614
+ * modal (preserves prior UX — no extra tap). Slow transactions — e.g. a swap
21615
+ * whose server-side build exceeds Chrome's ~5s activation window — have lost
21616
+ * it, so we fall back to awaitSignInGestureAndSign to mint a fresh activation
21617
+ * via a "Sign in" tap. Returns the first result (same shape as the bare
21618
+ * wallet-standard feature call and as awaitSignInGestureAndSign).
21619
+ */
21620
+ async function signWithFreshActivation(theme, signFn, noResultError = 'MWA returned no signature') {
21621
+ var _a;
21622
+ const activationLive = typeof navigator !== 'undefined' &&
21623
+ ((_a = navigator.userActivation) === null || _a === void 0 ? void 0 : _a.isActive) === true;
21624
+ if (activationLive) {
21625
+ // Live gesture: invoke synchronously (no await before signFn) so the
21626
+ // activation propagates to the protocol's location.assign navigation.
21627
+ const results = await signFn();
21628
+ if (!results || results.length === 0)
21629
+ throw new Error(noResultError);
21630
+ return results[0];
21631
+ }
21632
+ // Activation gone: surface the modal so the user's tap mints a fresh one.
21633
+ return awaitSignInGestureAndSign(theme, signFn, noResultError);
21634
+ }
21610
21635
  /**
21611
21636
  * Normalize a chain string to a wallet-standard Solana chain identifier.
21612
21637
  *
@@ -21748,7 +21773,7 @@ async function registerMobileWalletAdapter(config) {
21748
21773
  if (typeof window === 'undefined')
21749
21774
  return;
21750
21775
  try {
21751
- const walletStandardMobile = await import('./index.browser-nVGFrIHK.esm.js');
21776
+ const walletStandardMobile = await import('./index.browser-CMijwVwX.esm.js');
21752
21777
  const registerMwa = walletStandardMobile.registerMwa || ((_a = walletStandardMobile.default) === null || _a === void 0 ? void 0 : _a.registerMwa);
21753
21778
  if (!registerMwa) {
21754
21779
  console.warn('[SolanaMobileWallet] registerMwa not found in @solana-mobile/wallet-standard-mobile');
@@ -21887,7 +21912,7 @@ class SolanaMobileWalletProvider {
21887
21912
  async ensureWallet() {
21888
21913
  if (this.wallet)
21889
21914
  return this.wallet;
21890
- const mod = await import('./index.browser-nVGFrIHK.esm.js');
21915
+ const mod = await import('./index.browser-CMijwVwX.esm.js');
21891
21916
  const chain = mapChainToWalletStandard(this.cluster);
21892
21917
  this.wallet = new mod.LocalSolanaMobileWalletAdapterWallet({
21893
21918
  appIdentity: this.appIdentity,
@@ -22365,11 +22390,10 @@ class SolanaMobileWalletProvider {
22365
22390
  try {
22366
22391
  const signTxFeat = getSignTransactionFeature(wallet);
22367
22392
  const wireBytes = txToWireBytes(transaction);
22368
- const results = await signTxFeat.signTransaction({ account, transaction: wireBytes, chain });
22369
- if (!results || results.length === 0) {
22370
- throw new Error('MWA returned no signed transaction');
22371
- }
22372
- const { signedTransaction: signedBytes } = results[0];
22393
+ // signTransaction navigates to `solana-wallet:`; only show the
22394
+ // gesture modal if the tap activation has decayed (see runTransaction).
22395
+ const signResult = await signWithFreshActivation(this.config.theme, () => signTxFeat.signTransaction({ account, transaction: wireBytes, chain }), 'MWA returned no signed transaction');
22396
+ const { signedTransaction: signedBytes } = signResult;
22373
22397
  return txFromWireBytes(new Uint8Array(signedBytes));
22374
22398
  }
22375
22399
  catch (error) {
@@ -22475,11 +22499,9 @@ class SolanaMobileWalletProvider {
22475
22499
  // because the wallet would submit to its own RPC.
22476
22500
  const signTxFeat = getSignTransactionFeature(wallet);
22477
22501
  const wireBytes = txToWireBytes(transaction);
22478
- const results = await signTxFeat.signTransaction({ account, transaction: wireBytes, chain });
22479
- if (!results || results.length === 0) {
22480
- throw new Error('MWA returned no signed transaction');
22481
- }
22482
- const { signedTransaction: signedBytes } = results[0];
22502
+ // Gesture modal only if activation decayed (see runTransaction).
22503
+ const signResult = await signWithFreshActivation(this.config.theme, () => signTxFeat.signTransaction({ account, transaction: wireBytes, chain }), 'MWA returned no signed transaction');
22504
+ const { signedTransaction: signedBytes } = signResult;
22483
22505
  const signedTx = txFromWireBytes(new Uint8Array(signedBytes));
22484
22506
  const signature = await connection.sendRawTransaction(signedTx.serialize(), {
22485
22507
  preflightCommitment: 'confirmed',
@@ -22495,18 +22517,16 @@ class SolanaMobileWalletProvider {
22495
22517
  return signature;
22496
22518
  }
22497
22519
  // Non-Surfnet: wallet signs and submits to its own RPC.
22520
+ // Gesture modal only if activation decayed (see runTransaction).
22498
22521
  const signSendFeat = getSignAndSendTransactionFeature(wallet);
22499
22522
  const wireBytes = txToWireBytes(transaction);
22500
- const results = await signSendFeat.signAndSendTransaction({
22523
+ const sendResult = await signWithFreshActivation(this.config.theme, () => signSendFeat.signAndSendTransaction({
22501
22524
  account,
22502
22525
  transaction: wireBytes,
22503
22526
  chain,
22504
22527
  options: { commitment: 'confirmed' },
22505
- });
22506
- if (!results || results.length === 0) {
22507
- throw new Error('MWA returned no signature');
22508
- }
22509
- const { signature: sigBytes } = results[0];
22528
+ }));
22529
+ const { signature: sigBytes } = sendResult;
22510
22530
  const signature = base58.encode(sigBytes);
22511
22531
  await confirmAndCheckTransaction(connection, signature);
22512
22532
  return signature;
@@ -22586,11 +22606,13 @@ class SolanaMobileWalletProvider {
22586
22606
  if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
22587
22607
  const signTxFeat = getSignTransactionFeature(wallet);
22588
22608
  const wireBytes = txToWireBytes(tx);
22589
- const results = await signTxFeat.signTransaction({ account, transaction: wireBytes, chain });
22590
- if (!results || results.length === 0) {
22609
+ // signTransaction also navigates to `solana-wallet:`; only
22610
+ // surface the gesture modal if the tap activation has decayed.
22611
+ const signOnlyResult = await signWithFreshActivation(this.config.theme, () => signTxFeat.signTransaction({ account, transaction: wireBytes, chain }), 'MWA returned no signed transaction');
22612
+ if (!signOnlyResult) {
22591
22613
  throw new Error('MWA returned no signed transaction');
22592
22614
  }
22593
- const { signedTransaction: signedBytes } = results[0];
22615
+ const { signedTransaction: signedBytes } = signOnlyResult;
22594
22616
  const signedTx = txFromWireBytes(new Uint8Array(signedBytes));
22595
22617
  return {
22596
22618
  signedTransaction: signedTx,
@@ -22603,11 +22625,13 @@ class SolanaMobileWalletProvider {
22603
22625
  // Surfnet: sign locally via wallet-standard, submit manually.
22604
22626
  const signTxFeat = getSignTransactionFeature(wallet);
22605
22627
  const wireBytes = txToWireBytes(tx);
22606
- const results = await signTxFeat.signTransaction({ account, transaction: wireBytes, chain });
22607
- if (!results || results.length === 0) {
22628
+ // signTransaction also navigates to `solana-wallet:`; only
22629
+ // surface the gesture modal if the tap activation has decayed.
22630
+ const surfnetResult = await signWithFreshActivation(this.config.theme, () => signTxFeat.signTransaction({ account, transaction: wireBytes, chain }), 'MWA returned no signed transaction');
22631
+ if (!surfnetResult) {
22608
22632
  throw new Error('MWA returned no signed transaction');
22609
22633
  }
22610
- const { signedTransaction: signedBytes } = results[0];
22634
+ const { signedTransaction: signedBytes } = surfnetResult;
22611
22635
  const signedTx = txFromWireBytes(new Uint8Array(signedBytes));
22612
22636
  const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash('confirmed');
22613
22637
  const signature = await connection.sendRawTransaction(signedTx.serialize(), {
@@ -22633,18 +22657,24 @@ class SolanaMobileWalletProvider {
22633
22657
  };
22634
22658
  }
22635
22659
  // Non-Surfnet: wallet signs and submits to its own RPC.
22660
+ // signAndSendTransaction dispatches a `solana-wallet:` navigation
22661
+ // that Chrome blocks without transient user activation. Fast txs
22662
+ // still hold the tap activation and navigate directly; slow ones
22663
+ // (e.g. a swap whose server build exceeds Chrome's ~5s window)
22664
+ // have lost it, so signWithFreshActivation shows the "Sign in"
22665
+ // modal to mint a fresh activation — no modal when not needed.
22636
22666
  const signSendFeat = getSignAndSendTransactionFeature(wallet);
22637
22667
  const wireBytes = txToWireBytes(tx);
22638
- const results = await signSendFeat.signAndSendTransaction({
22668
+ const sendResult = await signWithFreshActivation(this.config.theme, () => signSendFeat.signAndSendTransaction({
22639
22669
  account,
22640
22670
  transaction: wireBytes,
22641
22671
  chain,
22642
22672
  options: { commitment: 'confirmed' },
22643
- });
22644
- if (!results || results.length === 0) {
22673
+ }));
22674
+ if (!sendResult) {
22645
22675
  throw new Error('MWA returned no signature');
22646
22676
  }
22647
- const { signature: sigBytes } = results[0];
22677
+ const { signature: sigBytes } = sendResult;
22648
22678
  const signature = base58.encode(sigBytes);
22649
22679
  const txInfo = await confirmAndCheckTransaction(connection, signature);
22650
22680
  return {
@@ -23072,4 +23102,4 @@ class PrivyExpoProvider {
23072
23102
  }
23073
23103
 
23074
23104
  export { genAuthNonce as $, count as A, aggregate as B, subscribe as C, useAuth as D, deserializeTransaction as E, getIdToken as F, setPlatform as G, getPlatform as H, PrivyWalletProvider as I, DEFAULT_TEST_ADDRESS as J, isMobileWalletAvailable as K, registerMobileWalletAdapter as L, MockAuthProvider as M, PrivyExpoProvider as N, OffchainAuthProvider as O, PhantomWalletProvider as P, InsufficientBalanceError as Q, ReactNativeSessionManager as R, SolanaMobileWalletProvider as S, ServerSessionManager as T, buildSetDocumentsTransaction as U, clearCache as V, WebSessionManager as W, closeAllSubscriptions as X, convertRemainingAccounts as Y, createSessionWithPrivy as Z, createSessionWithSignature as _, base58 as a, genSolanaMessage as a0, getCachedData as a1, getMany as a2, reconnectWithNewAuth as a3, refreshSession as a4, signSessionCreateMessage as a5, bufferExports as b, commonjsRequire as c, getCurrentUser as d, onAuthLoadingChanged as e, getAuthLoading as f, getDefaultExportFromCjs$1 as g, logout as h, init as i, getConfig as j, getAuthProvider as k, login as l, get as m, setMany as n, onAuthStateChanged as o, setFile as p, getFiles as q, require$$0 as r, set as s, runQuery as t, runQueryMany as u, runExpression as v, runExpressionMany as w, signMessage as x, signTransaction as y, signAndSubmitTransaction as z };
23075
- //# sourceMappingURL=index-BTwX7FYW.esm.js.map
23105
+ //# sourceMappingURL=index-CJRFnq6O.esm.js.map