@bounded-sh/client 0.0.112 → 0.0.114

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 (52) hide show
  1. package/dist/auth/providers/injected-wallet-provider.d.ts +7 -0
  2. package/dist/auth/providers/injected-wallet-types.d.ts +2 -0
  3. package/dist/auth/providers/solana-mobile-registration.d.ts +18 -0
  4. package/dist/{email-auth-provider-D0_iXVYk.mjs → email-auth-provider-Bk5GSpYT.mjs} +2 -2
  5. package/dist/{email-auth-provider-D0_iXVYk.mjs.map → email-auth-provider-Bk5GSpYT.mjs.map} +1 -1
  6. package/dist/{email-auth-provider-OVzQ63dn.js → email-auth-provider-Cr66GaKw.js} +2 -2
  7. package/dist/{email-auth-provider-OVzQ63dn.js.map → email-auth-provider-Cr66GaKw.js.map} +1 -1
  8. package/dist/{email-auth-provider-CyFsnSzx.js → email-auth-provider-DeORQbTK.js} +2 -2
  9. package/dist/{email-auth-provider-CyFsnSzx.js.map → email-auth-provider-DeORQbTK.js.map} +1 -1
  10. package/dist/{email-auth-provider-BV1Iea4A.mjs → email-auth-provider-nDZjRDpj.mjs} +2 -2
  11. package/dist/{email-auth-provider-BV1Iea4A.mjs.map → email-auth-provider-nDZjRDpj.mjs.map} +1 -1
  12. package/dist/{guest-auth-provider-B4WIWOjV.js → guest-auth-provider-5bX-xt6K.js} +2 -2
  13. package/dist/{guest-auth-provider-B4WIWOjV.js.map → guest-auth-provider-5bX-xt6K.js.map} +1 -1
  14. package/dist/{guest-auth-provider-0WlOutqU.js → guest-auth-provider-CUNkZVFK.js} +2 -2
  15. package/dist/{guest-auth-provider-0WlOutqU.js.map → guest-auth-provider-CUNkZVFK.js.map} +1 -1
  16. package/dist/{guest-auth-provider-AP80a700.mjs → guest-auth-provider-DDudqqxY.mjs} +2 -2
  17. package/dist/{guest-auth-provider-Cqx1zH23.mjs.map → guest-auth-provider-DDudqqxY.mjs.map} +1 -1
  18. package/dist/{guest-auth-provider-Cqx1zH23.mjs → guest-auth-provider-ejUTbjCC.mjs} +2 -2
  19. package/dist/{guest-auth-provider-AP80a700.mjs.map → guest-auth-provider-ejUTbjCC.mjs.map} +1 -1
  20. package/dist/{index-D76-cZcD.mjs → index-BAiLpNEQ.mjs} +71 -17
  21. package/dist/index-BAiLpNEQ.mjs.map +1 -0
  22. package/dist/{index-BmNNZlTl.js → index-BZ0X1Z9X.js} +71 -17
  23. package/dist/index-BZ0X1Z9X.js.map +1 -0
  24. package/dist/index.js +1 -1
  25. package/dist/index.mjs +1 -1
  26. package/dist/{index.native-C5glqiTU.js → index.native-DJSOqyKQ.js} +49 -7
  27. package/dist/index.native-DJSOqyKQ.js.map +1 -0
  28. package/dist/{index.native-DyR93n8K.mjs → index.native-DcW2klyn.mjs} +48 -8
  29. package/dist/index.native-DcW2klyn.mjs.map +1 -0
  30. package/dist/index.native.js +1 -1
  31. package/dist/index.native.mjs +1 -1
  32. package/dist/{injected-evm-wallet-provider-4ICYUEU4.js → injected-evm-wallet-provider-BDYWjIOQ.js} +2 -2
  33. package/dist/{injected-evm-wallet-provider-4ICYUEU4.js.map → injected-evm-wallet-provider-BDYWjIOQ.js.map} +1 -1
  34. package/dist/{injected-evm-wallet-provider-CS4R8c51.mjs → injected-evm-wallet-provider-BQ_kG1vI.mjs} +2 -2
  35. package/dist/{injected-evm-wallet-provider-CS4R8c51.mjs.map → injected-evm-wallet-provider-BQ_kG1vI.mjs.map} +1 -1
  36. package/dist/{injected-evm-wallet-provider-WxUbyMZL.mjs → injected-evm-wallet-provider-C4aKa2v1.mjs} +2 -2
  37. package/dist/{injected-evm-wallet-provider-WxUbyMZL.mjs.map → injected-evm-wallet-provider-C4aKa2v1.mjs.map} +1 -1
  38. package/dist/{injected-evm-wallet-provider-C8YItSiB.js → injected-evm-wallet-provider-D06arDQD.js} +2 -2
  39. package/dist/{injected-evm-wallet-provider-C8YItSiB.js.map → injected-evm-wallet-provider-D06arDQD.js.map} +1 -1
  40. package/dist/{injected-wallet-provider-D8vIsUHf.js → injected-wallet-provider-B9jvzDM5.js} +51 -22
  41. package/dist/{injected-wallet-provider-D8vIsUHf.js.map → injected-wallet-provider-B9jvzDM5.js.map} +1 -1
  42. package/dist/{injected-wallet-provider-UuGrzdNW.mjs → injected-wallet-provider-Dj-F69gb.mjs} +51 -22
  43. package/dist/{injected-wallet-provider-UuGrzdNW.mjs.map → injected-wallet-provider-Dj-F69gb.mjs.map} +1 -1
  44. package/dist/{injected-wallet-provider-nwd3ialR.js → injected-wallet-provider-Dqmk-m4V.js} +67 -26
  45. package/dist/{injected-wallet-provider-nwd3ialR.js.map → injected-wallet-provider-Dqmk-m4V.js.map} +1 -1
  46. package/dist/{injected-wallet-provider-D1ygndjX.mjs → injected-wallet-provider-DxPcYxP-.mjs} +67 -26
  47. package/dist/{injected-wallet-provider-D1ygndjX.mjs.map → injected-wallet-provider-DxPcYxP-.mjs.map} +1 -1
  48. package/package.json +2 -2
  49. package/dist/index-BmNNZlTl.js.map +0 -1
  50. package/dist/index-D76-cZcD.mjs.map +0 -1
  51. package/dist/index.native-C5glqiTU.js.map +0 -1
  52. package/dist/index.native-DyR93n8K.mjs.map +0 -1
@@ -3817,6 +3817,46 @@ function looksLikeSolanaMobileWallet(name) {
3817
3817
  function solanaMobileWalletLeavesPage(name) {
3818
3818
  return name === LOCAL_MOBILE_WALLET_NAME;
3819
3819
  }
3820
+ /**
3821
+ * Whether this wallet answers a sign-in from its authorization cache, so the
3822
+ * cached record must be dropped before asking it to sign in.
3823
+ *
3824
+ * Both Mobile Wallet Adapter transports consult their persisted authorization
3825
+ * before EVERY authorize call, including the one that carries the Sign In With
3826
+ * Solana payload (@solana-mobile/wallet-standard-mobile 0.5.3
3827
+ * lib/esm/index.browser.js:1291). A record left by a plain connect holds no
3828
+ * sign-in result, so that sign-in fails with "no sign in result returned by
3829
+ * wallet" without the wallet app ever being asked; a record left by an earlier
3830
+ * sign-in holds that OLD proof, so a later sign-in replays a spent nonce. The
3831
+ * wallet's own `standard:disconnect` clears the record locally - it opens
3832
+ * nothing - and the sign-in that follows then authorizes afresh, with its
3833
+ * payload, in the wallet app. A name check, like leavesPage: this describes the
3834
+ * transport, and the same adapter registered by another SDK behaves the same.
3835
+ */
3836
+ function solanaMobileWalletAnswersSignInFromCache(name) {
3837
+ return mobileWalletNames.has(name);
3838
+ }
3839
+ /**
3840
+ * The Wallet Standard name of a feature a Mobile Wallet Adapter account reports.
3841
+ *
3842
+ * The adapter copies a wallet app's per-account `features` into the Wallet
3843
+ * Standard account untranslated (0.5.3 lib/esm/index.browser.js:1421), and the
3844
+ * MWA protocol names them differently from the Wallet Standard (spec feature
3845
+ * identifiers: `solana:signMessages`, `solana:signInWithSolana`,
3846
+ * `solana:signTransactions`). Filtered by the Wallet Standard names, such an
3847
+ * account looks unable to sign a message or sign in, and the page sees no
3848
+ * connected account after a successful authorization. Wallet Standard names pass
3849
+ * through unchanged, so this applies to every account.
3850
+ */
3851
+ const MWA_FEATURE_NAMES = {
3852
+ 'solana:signMessages': 'solana:signMessage',
3853
+ 'solana:signInWithSolana': 'solana:signIn',
3854
+ 'solana:signTransactions': 'solana:signTransaction',
3855
+ };
3856
+ function walletStandardFeatureName(feature) {
3857
+ var _a;
3858
+ return (_a = MWA_FEATURE_NAMES[feature]) !== null && _a !== void 0 ? _a : feature;
3859
+ }
3820
3860
  /**
3821
3861
  * Register Solana Mobile's MWA wallet with the Wallet Standard registry so
3822
3862
  * wallet discovery surfaces it. Idempotent - the first wallet-lane activation
@@ -6311,7 +6351,7 @@ async function getAuthProvider(config, fromStorage = false) {
6311
6351
  // manager as legacy email sessions. Human login should be started
6312
6352
  // with loginWithRedirect(); this provider is kept as the restore and
6313
6353
  // logout surface for those sessions.
6314
- currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-CyFsnSzx.js'); })).EmailAuthProvider();
6354
+ currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-DeORQbTK.js'); })).EmailAuthProvider();
6315
6355
  break;
6316
6356
  case "phantom": {
6317
6357
  // First-class Solana WALLET LOGIN (the poof/TaroBase-style "connect
@@ -6353,7 +6393,7 @@ async function getAuthProvider(config, fromStorage = false) {
6353
6393
  // (bounded-login-widget.ts), so registration never counts as
6354
6394
  // evidence the user has a wallet.
6355
6395
  await ensureSolanaMobileWalletRegistered(config, configuredNetwork);
6356
- const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-D8vIsUHf.js'); });
6396
+ const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-B9jvzDM5.js'); });
6357
6397
  currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
6358
6398
  break;
6359
6399
  }
@@ -6366,7 +6406,7 @@ async function getAuthProvider(config, fromStorage = false) {
6366
6406
  // Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
6367
6407
  // to point at a specific wallet or set chainId/domain.
6368
6408
  const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
6369
- const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-C8YItSiB.js'); });
6409
+ const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-D06arDQD.js'); });
6370
6410
  currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
6371
6411
  break;
6372
6412
  }
@@ -6391,7 +6431,7 @@ async function getAuthProvider(config, fromStorage = false) {
6391
6431
  break;
6392
6432
  case "guest":
6393
6433
  // Anonymous auth: a device-local ed25519 keypair signs the challenge.
6394
- currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-B4WIWOjV.js'); })).GuestAuthProvider();
6434
+ currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-5bX-xt6K.js'); })).GuestAuthProvider();
6395
6435
  break;
6396
6436
  }
6397
6437
  if (!currentAuthProvider) {
@@ -6453,7 +6493,7 @@ async function signInAnonymously() {
6453
6493
  // Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
6454
6494
  // the main bundle for data-only apps. Specifier is a static string literal
6455
6495
  // so bundle-splitting can see it.
6456
- const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-B4WIWOjV.js'); })).GuestAuthProvider();
6496
+ const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-5bX-xt6K.js'); })).GuestAuthProvider();
6457
6497
  setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
6458
6498
  // adoptSessionProvider awaits only getConfig() (already resolved here) and then
6459
6499
  // runs every write - provider/method/config/marker/user - in one synchronous
@@ -6624,7 +6664,7 @@ function ensureSharedWalletLoginReady() {
6624
6664
  if (!sharedWalletReady) {
6625
6665
  sharedWalletReady = (async () => {
6626
6666
  await core.getConfig();
6627
- await Promise.resolve().then(function () { return require('./injected-wallet-provider-D8vIsUHf.js'); });
6667
+ await Promise.resolve().then(function () { return require('./injected-wallet-provider-B9jvzDM5.js'); });
6628
6668
  })().catch((error) => {
6629
6669
  sharedWalletReady = null;
6630
6670
  throw error;
@@ -6727,7 +6767,7 @@ async function loginWithWallet(options) {
6727
6767
  await ensureSharedWalletLoginReady();
6728
6768
  else
6729
6769
  await ensureWalletLoginReady();
6730
- const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-D8vIsUHf.js'); });
6770
+ const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-B9jvzDM5.js'); });
6731
6771
  // Keep the RAW wallet provider: the offchain wrapper forwards only a fixed
6732
6772
  // set of methods, so cleanup below must speak to the provider that actually
6733
6773
  // holds the config rather than to whatever is wrapping it.
@@ -7617,7 +7657,9 @@ function standardWalletToInjectedProvider(wallet, configuredNetwork) {
7617
7657
  // mobile adapter fills DEFAULT_FEATURES in exactly that case. So an empty list
7618
7658
  // means none, and reading it as "everything" picks an account that cannot sign
7619
7659
  // and fails at the wallet instead of here.
7620
- const accountSupports = (account, feature) => account.features.includes(feature);
7660
+ // The mobile adapter hands a wallet app's own feature names through
7661
+ // untranslated, so each name is read as its Wallet Standard equivalent.
7662
+ const accountSupports = (account, feature) => account.features.some((f) => walletStandardFeatureName(f) === feature);
7621
7663
  const pickSolanaAccount = (accounts) => {
7622
7664
  // With a network configured, an account that does not support it is not a
7623
7665
  // usable account: `WalletAccount.chains` is what that account can sign for,
@@ -7692,13 +7734,23 @@ function standardWalletToInjectedProvider(wallet, configuredNetwork) {
7692
7734
  } }, (hasFeature(wallet, SolanaSignIn)
7693
7735
  ? {
7694
7736
  async signIn(input) {
7695
- const acc = requireAccount();
7696
- if (!accountSupports(acc, SolanaSignIn))
7697
- throw new Error("Wallet account does not support solana:signIn");
7737
+ var _a;
7698
7738
  const sign = feature(wallet, SolanaSignIn);
7699
7739
  if (!sign)
7700
7740
  throw new Error("Wallet does not support solana:signIn");
7741
+ const open = currentAccount();
7742
+ if (open && !accountSupports(open, SolanaSignIn))
7743
+ throw new Error("Wallet account does not support solana:signIn");
7744
+ if (solanaMobileWalletAnswersSignInFromCache(wallet.name)) {
7745
+ // Drop the cached authorization so this sign-in is performed by the
7746
+ // wallet app, with its payload, rather than answered from a record
7747
+ // that holds no sign-in result or an earlier sign-in's spent nonce.
7748
+ // Local to the page: the adapter's disconnect opens nothing.
7749
+ await ((_a = feature(wallet, StandardDisconnect)) === null || _a === void 0 ? void 0 : _a.disconnect());
7750
+ }
7701
7751
  const [out] = await sign.signIn(input);
7752
+ if (!out)
7753
+ throw new Error("Wallet returned no sign-in result");
7702
7754
  return { account: { address: out.account.address }, signedMessage: out.signedMessage, signature: out.signature };
7703
7755
  },
7704
7756
  }
@@ -8869,11 +8921,13 @@ async function prepareAndOpen(opts, pending) {
8869
8921
  card.appendChild(foot);
8870
8922
  return card;
8871
8923
  };
8872
- // Solana Mobile leaves the page to sign: connecting spends the tap that
8873
- // started login, so requesting the signature straight afterwards runs with
8874
- // no transient activation left, Chrome blocks the `solana-wallet:` intent
8875
- // navigation, and the protocol reports the wallet as missing. Collect a
8876
- // second tap on its OWN view - never by adding a listener to a button that
8924
+ // Solana Mobile leaves the page to sign in: the nonce fetch that precedes
8925
+ // the sign-in outlives the tap that started login, so requesting the
8926
+ // sign-in straight afterwards runs with no transient activation left,
8927
+ // Chrome blocks the `solana-wallet:` intent navigation, and the protocol
8928
+ // reports the wallet as missing. Collect a fresh tap on its OWN view (one
8929
+ // wallet trip: sign-in authorizes and signs in the same step, there is no
8930
+ // connect before it) - never by adding a listener to a button that
8877
8931
  // already starts a login, which would run both handlers on that tap and
8878
8932
  // kick off a duplicate login beside the one waiting for the gesture.
8879
8933
  // Injected wallets sign in-page and get no extra step.
@@ -11442,4 +11496,4 @@ exports.useAuth = useAuth;
11442
11496
  exports.useBuildRun = useBuildRun;
11443
11497
  exports.useQuery = useQuery;
11444
11498
  exports.waitForAuthReady = waitForAuthReady;
11445
- //# sourceMappingURL=index-BmNNZlTl.js.map
11499
+ //# sourceMappingURL=index-BZ0X1Z9X.js.map