@dynamic-labs-sdk/client 1.31.0 → 1.31.1

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 (91) hide show
  1. package/dist/{apiClient-DpzKqY39.native.esm.js → apiClient-BZfdx9fH.native.esm.js} +2 -2
  2. package/dist/{apiClient-DpzKqY39.native.esm.js.map → apiClient-BZfdx9fH.native.esm.js.map} +1 -1
  3. package/dist/core.cjs +6 -5
  4. package/dist/core.cjs.map +1 -1
  5. package/dist/core.esm.js +6 -6
  6. package/dist/core.esm.js.map +1 -1
  7. package/dist/core.native.esm.js +8 -8
  8. package/dist/core.native.esm.js.map +1 -1
  9. package/dist/exports/core.d.ts +4 -0
  10. package/dist/exports/core.d.ts.map +1 -1
  11. package/dist/exports/index.d.ts +1 -0
  12. package/dist/exports/index.d.ts.map +1 -1
  13. package/dist/{getNetworkProviderFromNetworkId-BN2jUhHm.esm.js → getNetworkProviderFromNetworkId-CbMpiSub.esm.js} +24 -20
  14. package/dist/{getNetworkProviderFromNetworkId-BN2jUhHm.esm.js.map → getNetworkProviderFromNetworkId-CbMpiSub.esm.js.map} +1 -1
  15. package/dist/{getNetworkProviderFromNetworkId-BoNAPSjx.cjs → getNetworkProviderFromNetworkId-DNIuJp20.cjs} +23 -19
  16. package/dist/{getNetworkProviderFromNetworkId-BoNAPSjx.cjs.map → getNetworkProviderFromNetworkId-DNIuJp20.cjs.map} +1 -1
  17. package/dist/{getNetworkProviderFromNetworkId-DUym3Qq0.native.esm.js → getNetworkProviderFromNetworkId-DRA4M5Ab.native.esm.js} +30 -26
  18. package/dist/getNetworkProviderFromNetworkId-DRA4M5Ab.native.esm.js.map +1 -0
  19. package/dist/{getSignedSessionId-9ADIJCl1.cjs → getSignedSessionId--wpV_VKs.cjs} +3 -3
  20. package/dist/{getSignedSessionId-9ADIJCl1.cjs.map → getSignedSessionId--wpV_VKs.cjs.map} +1 -1
  21. package/dist/{getSignedSessionId-DxpqG4pv.esm.js → getSignedSessionId-DHn6yhGX.esm.js} +3 -3
  22. package/dist/{getSignedSessionId-DxpqG4pv.esm.js.map → getSignedSessionId-DHn6yhGX.esm.js.map} +1 -1
  23. package/dist/{getSignedSessionId-Dr4Ic68X.native.esm.js → getSignedSessionId-DKKSCpj9.native.esm.js} +3 -3
  24. package/dist/{getSignedSessionId-Dr4Ic68X.native.esm.js.map → getSignedSessionId-DKKSCpj9.native.esm.js.map} +1 -1
  25. package/dist/{getVerifiedCredentialForWalletAccount-C2o5idph.cjs → getVerifiedCredentialForWalletAccount-B5LUGiDP.cjs} +2 -2
  26. package/dist/{getVerifiedCredentialForWalletAccount-C2o5idph.cjs.map → getVerifiedCredentialForWalletAccount-B5LUGiDP.cjs.map} +1 -1
  27. package/dist/{getVerifiedCredentialForWalletAccount-Cjwoeej7.esm.js → getVerifiedCredentialForWalletAccount-C_GcjgC8.esm.js} +2 -2
  28. package/dist/{getVerifiedCredentialForWalletAccount-Cjwoeej7.esm.js.map → getVerifiedCredentialForWalletAccount-C_GcjgC8.esm.js.map} +1 -1
  29. package/dist/index.cjs +145 -60
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.esm.js +145 -60
  32. package/dist/index.esm.js.map +1 -1
  33. package/dist/index.native.esm.js +147 -62
  34. package/dist/index.native.esm.js.map +1 -1
  35. package/dist/{isMfaRequiredForAction-DuSU67yq.native.esm.js → isMfaRequiredForAction-CC7bjhqy.native.esm.js} +2 -2
  36. package/dist/{isMfaRequiredForAction-DuSU67yq.native.esm.js.map → isMfaRequiredForAction-CC7bjhqy.native.esm.js.map} +1 -1
  37. package/dist/{isMfaRequiredForAction-BIBmJbV9.esm.js → isMfaRequiredForAction-D1a1Nudo.esm.js} +2 -2
  38. package/dist/{isMfaRequiredForAction-BIBmJbV9.esm.js.map → isMfaRequiredForAction-D1a1Nudo.esm.js.map} +1 -1
  39. package/dist/{isMfaRequiredForAction-yM84r7l7.cjs → isMfaRequiredForAction-YjJLLFFs.cjs} +2 -2
  40. package/dist/{isMfaRequiredForAction-yM84r7l7.cjs.map → isMfaRequiredForAction-YjJLLFFs.cjs.map} +1 -1
  41. package/dist/{isUserOnboardingComplete-DCIlkCub.native.esm.js → isUserOnboardingComplete-BIjk67vX.native.esm.js} +3 -3
  42. package/dist/{isUserOnboardingComplete-DCIlkCub.native.esm.js.map → isUserOnboardingComplete-BIjk67vX.native.esm.js.map} +1 -1
  43. package/dist/{isUserOnboardingComplete-BRTOnK8V.cjs → isUserOnboardingComplete-C2ZuLDT9.cjs} +3 -3
  44. package/dist/{isUserOnboardingComplete-BRTOnK8V.cjs.map → isUserOnboardingComplete-C2ZuLDT9.cjs.map} +1 -1
  45. package/dist/{isUserOnboardingComplete-B2Ha2dkP.esm.js → isUserOnboardingComplete-C4bE5xqM.esm.js} +3 -3
  46. package/dist/{isUserOnboardingComplete-B2Ha2dkP.esm.js.map → isUserOnboardingComplete-C4bE5xqM.esm.js.map} +1 -1
  47. package/dist/{logoutWithReason-HqGlUccb.native.esm.js → logoutWithReason-BcWQGREO.native.esm.js} +2 -2
  48. package/dist/{logoutWithReason-HqGlUccb.native.esm.js.map → logoutWithReason-BcWQGREO.native.esm.js.map} +1 -1
  49. package/dist/{logoutWithReason-DV89zJmJ.esm.js → logoutWithReason-BqsgA8gI.esm.js} +2 -2
  50. package/dist/{logoutWithReason-DV89zJmJ.esm.js.map → logoutWithReason-BqsgA8gI.esm.js.map} +1 -1
  51. package/dist/{logoutWithReason-DlA15deT.cjs → logoutWithReason-D6ruPOvJ.cjs} +2 -2
  52. package/dist/{logoutWithReason-DlA15deT.cjs.map → logoutWithReason-D6ruPOvJ.cjs.map} +1 -1
  53. package/dist/{migrateFromFireblocks-DnQsGmIW.native.esm.js → migrateFromFireblocks-BxPgqhbu.native.esm.js} +2 -2
  54. package/dist/{migrateFromFireblocks-DnQsGmIW.native.esm.js.map → migrateFromFireblocks-BxPgqhbu.native.esm.js.map} +1 -1
  55. package/dist/{migrateFromFireblocks-CqIpxGRS.cjs → migrateFromFireblocks-CCNTDCmW.cjs} +2 -2
  56. package/dist/{migrateFromFireblocks-CqIpxGRS.cjs.map → migrateFromFireblocks-CCNTDCmW.cjs.map} +1 -1
  57. package/dist/{migrateFromFireblocks-CiOS4_Nq.esm.js → migrateFromFireblocks-zazAx6WV.esm.js} +2 -2
  58. package/dist/{migrateFromFireblocks-CiOS4_Nq.esm.js.map → migrateFromFireblocks-zazAx6WV.esm.js.map} +1 -1
  59. package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/buildInAppBrowserOptions.d.ts +9 -1
  60. package/dist/modules/walletOptionsCatalogue/buildInAppBrowserOptions/buildInAppBrowserOptions.d.ts.map +1 -1
  61. package/dist/modules/walletOptionsCatalogue/buildInstallationUrlsByWalletOptionKey/buildInstallationUrlsByWalletOptionKey.d.ts +7 -1
  62. package/dist/modules/walletOptionsCatalogue/buildInstallationUrlsByWalletOptionKey/buildInstallationUrlsByWalletOptionKey.d.ts.map +1 -1
  63. package/dist/modules/walletOptionsCatalogue/filterConnectionOptionsByEnabledChains/filterConnectionOptionsByEnabledChains.d.ts +30 -0
  64. package/dist/modules/walletOptionsCatalogue/filterConnectionOptionsByEnabledChains/filterConnectionOptionsByEnabledChains.d.ts.map +1 -0
  65. package/dist/modules/walletOptionsCatalogue/filterConnectionOptionsByEnabledChains/index.d.ts +2 -0
  66. package/dist/modules/walletOptionsCatalogue/filterConnectionOptionsByEnabledChains/index.d.ts.map +1 -0
  67. package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts +4 -0
  68. package/dist/modules/walletOptionsCatalogue/getWalletOptionsCatalogue/getWalletOptionsCatalogue.d.ts.map +1 -1
  69. package/dist/modules/wallets/networks/getEnabledChains/getEnabledChains.d.ts +25 -0
  70. package/dist/modules/wallets/networks/getEnabledChains/getEnabledChains.d.ts.map +1 -0
  71. package/dist/modules/wallets/networks/getEnabledChains/index.d.ts +2 -0
  72. package/dist/modules/wallets/networks/getEnabledChains/index.d.ts.map +1 -0
  73. package/dist/modules/wallets/networks/networkProviderBuilderRegistry/createNetworkProviderBuilderRegistry/createNetworkProviderBuilderRegistry.d.ts +2 -1
  74. package/dist/modules/wallets/networks/networkProviderBuilderRegistry/createNetworkProviderBuilderRegistry/createNetworkProviderBuilderRegistry.d.ts.map +1 -1
  75. package/dist/modules/wallets/networks/networkProviderBuilderRegistry/events.d.ts +16 -0
  76. package/dist/modules/wallets/networks/networkProviderBuilderRegistry/events.d.ts.map +1 -0
  77. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  78. package/dist/{waas-CUDgU2pl.esm.js → waas-C2PbR02F.esm.js} +4 -4
  79. package/dist/{waas-CUDgU2pl.esm.js.map → waas-C2PbR02F.esm.js.map} +1 -1
  80. package/dist/{waas-CkQYVo6U.native.esm.js → waas-DidjjQjB.native.esm.js} +4 -4
  81. package/dist/{waas-CkQYVo6U.native.esm.js.map → waas-DidjjQjB.native.esm.js.map} +1 -1
  82. package/dist/{waas-BOKafCeH.cjs → waas-ZWlJHeXc.cjs} +4 -4
  83. package/dist/{waas-BOKafCeH.cjs.map → waas-ZWlJHeXc.cjs.map} +1 -1
  84. package/dist/waas.cjs +4 -4
  85. package/dist/waas.esm.js +4 -4
  86. package/dist/waas.native.esm.js +4 -4
  87. package/dist/waasCore.cjs +5 -5
  88. package/dist/waasCore.esm.js +5 -5
  89. package/dist/waasCore.native.esm.js +5 -5
  90. package/package.json +2 -2
  91. package/dist/getNetworkProviderFromNetworkId-DUym3Qq0.native.esm.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
- const require_logoutWithReason = require('./logoutWithReason-DlA15deT.cjs');
2
- const require_migrateFromFireblocks = require('./migrateFromFireblocks-CqIpxGRS.cjs');
3
- const require_waas = require('./waas-BOKafCeH.cjs');
4
- const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-BoNAPSjx.cjs');
5
- const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-C2o5idph.cjs');
6
- const require_isUserOnboardingComplete = require('./isUserOnboardingComplete-BRTOnK8V.cjs');
7
- const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-yM84r7l7.cjs');
1
+ const require_logoutWithReason = require('./logoutWithReason-D6ruPOvJ.cjs');
2
+ const require_migrateFromFireblocks = require('./migrateFromFireblocks-CCNTDCmW.cjs');
3
+ const require_waas = require('./waas-ZWlJHeXc.cjs');
4
+ const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-DNIuJp20.cjs');
5
+ const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-B5LUGiDP.cjs');
6
+ const require_isUserOnboardingComplete = require('./isUserOnboardingComplete-C2ZuLDT9.cjs');
7
+ const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-YjJLLFFs.cjs');
8
8
  let _dynamic_labs_sdk_assert_package_version = require("@dynamic-labs-sdk/assert-package-version");
9
9
  let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
10
10
  let zod_mini = require("zod/mini");
@@ -7341,6 +7341,77 @@ const getInstallationLinkForCurrentPlatform = ({ installationUrls }) => {
7341
7341
  if (isChromeBrowser()) return installationUrls.chrome;
7342
7342
  };
7343
7343
 
7344
+ //#endregion
7345
+ //#region src/modules/wallets/networks/getEnabledChains/getEnabledChains.ts
7346
+ /**
7347
+ * Returns the chains this client can operate on — a chain is enabled once
7348
+ * one of its extensions has been added (`addEvmExtension`,
7349
+ * `addSolanaExtension`, …), since every chain extension registers a
7350
+ * network provider builder for its chain.
7351
+ *
7352
+ * Reading the builder registry keeps chain awareness out of the client
7353
+ * package: the set is whatever the extensions registered, so no
7354
+ * chain-specific branch is needed here.
7355
+ *
7356
+ * @param client - The Dynamic client instance.
7357
+ * @returns The set of chains the client has an extension for.
7358
+ * @example
7359
+ * ```typescript
7360
+ * // client created with addEvmExtension only
7361
+ * getEnabledChains(client); // Set { 'EVM' }
7362
+ * ```
7363
+ * @see {@link getNetworkProviderBuilderRegistry} for the registry the chains are read from.
7364
+ * @see {@link getNetworkProviders} for the other consumer of that registry.
7365
+ * @notInstrumented
7366
+ */
7367
+ const getEnabledChains = (client) => {
7368
+ const networkProviderBuilderRegistry = require_getNetworkProviderFromNetworkId.getNetworkProviderBuilderRegistry(client);
7369
+ return new Set(networkProviderBuilderRegistry.get().keys());
7370
+ };
7371
+
7372
+ //#endregion
7373
+ //#region src/modules/legacyWalletBook/getWalletConnectCatalog/getChainsFromWalletSchema/getChainsFromWalletSchema.ts
7374
+ /**
7375
+ * Returns every chain a wallet book entry advertises support for —
7376
+ * deduped, in `injectedConfig` order, then `chains` order. Used by the
7377
+ * catalogue's WalletConnect builder so a multi-chain wallet (e.g. Trust
7378
+ * supports EVM + SOL) gets one option per chain rather than one option
7379
+ * for whichever chain `getChainFromWalletSchema` happened to pick first.
7380
+ *
7381
+ * Falls back to {@link getChainFromWalletSchema}'s single-result behavior
7382
+ * (`['EVM']` default) when neither field is populated, so the helper
7383
+ * never returns an empty array — every eligible wallet emits at least
7384
+ * one option.
7385
+ *
7386
+ * @param params.wallet - The wallet schema from the wallet book.
7387
+ * @param [params.walletKey] - The wallet key identifier (used as last-resort fallback).
7388
+ * @returns Ordered, deduped array of Chains.
7389
+ * @notInstrumented
7390
+ */
7391
+ const getChainsFromWalletSchema = ({ wallet, walletKey }) => {
7392
+ const chains = /* @__PURE__ */ new Set();
7393
+ for (const entry of wallet.injectedConfig ?? []) {
7394
+ if (!entry.chain) continue;
7395
+ const chain = getChainFromWalletBookIdentifier({ identifier: entry.chain });
7396
+ if (chain) chains.add(chain);
7397
+ }
7398
+ for (const identifier of wallet.chains ?? []) {
7399
+ const prefix = extractChainPrefix({ chainIdentifier: identifier });
7400
+ try {
7401
+ const chain = require_logoutWithReason.getChainFromVerifiedCredentialChain(prefix);
7402
+ chains.add(chain);
7403
+ } catch {}
7404
+ }
7405
+ if (chains.size === 0) {
7406
+ const chain = getChainFromWalletSchema({
7407
+ wallet,
7408
+ walletKey
7409
+ });
7410
+ chains.add(chain);
7411
+ }
7412
+ return Array.from(chains);
7413
+ };
7414
+
7344
7415
  //#endregion
7345
7416
  //#region src/modules/walletOptionsCatalogue/resolveWalletBookWalletOptionKey/resolveWalletBookWalletOptionKey.ts
7346
7417
  /**
@@ -7386,11 +7457,17 @@ const getInAppBrowserUrl = ({ wallet }) => wallet.mobile?.inAppBrowserV2 ?? wall
7386
7457
  * and injected-only wallets are dropped — so the catalogue's notion of
7387
7458
  * "external wallet" stays consistent across option types.
7388
7459
  *
7460
+ * A wallet's in-app browser opens a single session, so it emits one option
7461
+ * tagged with the first chain it advertises that the client has an
7462
+ * extension for — a multi-chain wallet is still reachable when only one of
7463
+ * its chains is enabled.
7464
+ *
7465
+ * @param params.enabledChains - Chains the client has an extension for.
7389
7466
  * @param params.walletBook - The fetched wallet book.
7390
7467
  * @returns Tagged `inAppBrowser` options paired with their wallet option keys.
7391
7468
  * @notInstrumented
7392
7469
  */
7393
- const buildInAppBrowserOptions = ({ walletBook }) => {
7470
+ const buildInAppBrowserOptions = ({ enabledChains, walletBook }) => {
7394
7471
  const result = [];
7395
7472
  for (const [walletKey, wallet] of Object.entries(walletBook.wallets)) {
7396
7473
  if (shouldFilterWallet({
@@ -7399,12 +7476,14 @@ const buildInAppBrowserOptions = ({ walletBook }) => {
7399
7476
  })) continue;
7400
7477
  const url = getInAppBrowserUrl({ wallet });
7401
7478
  if (!url) continue;
7479
+ const chain = getChainsFromWalletSchema({
7480
+ wallet,
7481
+ walletKey
7482
+ }).find((advertisedChain) => enabledChains.has(advertisedChain));
7483
+ if (!chain) continue;
7402
7484
  result.push({
7403
7485
  option: {
7404
- chain: getChainFromWalletSchema({
7405
- wallet,
7406
- walletKey
7407
- }),
7486
+ chain,
7408
7487
  type: "inAppBrowser",
7409
7488
  url
7410
7489
  },
@@ -7477,17 +7556,25 @@ const hasAnyInstallationUrl = ({ urls }) => Object.values(urls).some(Boolean);
7477
7556
  * Reuses the generic `shouldFilterWallet` rules so embedded wallets do
7478
7557
  * not appear here either — they're not user-installable products.
7479
7558
  *
7559
+ * Wallets that advertise no chain this client has an extension for are
7560
+ * skipped: installing them would not make them connectable.
7561
+ *
7562
+ * @param params.enabledChains - Chains the client has an extension for.
7480
7563
  * @param params.walletBook - The fetched wallet book.
7481
7564
  * @returns A map from wallet option key to its install URL bag.
7482
7565
  * @notInstrumented
7483
7566
  */
7484
- const buildInstallationUrlsByWalletOptionKey = ({ walletBook }) => {
7567
+ const buildInstallationUrlsByWalletOptionKey = ({ enabledChains, walletBook }) => {
7485
7568
  const map = /* @__PURE__ */ new Map();
7486
7569
  for (const [walletKey, wallet] of Object.entries(walletBook.wallets)) {
7487
7570
  if (shouldFilterWallet({
7488
7571
  wallet,
7489
7572
  walletKey
7490
7573
  })) continue;
7574
+ if (!getChainsFromWalletSchema({
7575
+ wallet,
7576
+ walletKey
7577
+ }).some((chain) => enabledChains.has(chain))) continue;
7491
7578
  const urls = buildInstallationUrls({ wallet });
7492
7579
  if (!hasAnyInstallationUrl({ urls })) continue;
7493
7580
  const walletOptionKey = resolveWalletBookWalletOptionKey({
@@ -7579,49 +7666,6 @@ const buildMetaMaskSdkUriOptions = ({ walletBook }) => {
7579
7666
  return [];
7580
7667
  };
7581
7668
 
7582
- //#endregion
7583
- //#region src/modules/legacyWalletBook/getWalletConnectCatalog/getChainsFromWalletSchema/getChainsFromWalletSchema.ts
7584
- /**
7585
- * Returns every chain a wallet book entry advertises support for —
7586
- * deduped, in `injectedConfig` order, then `chains` order. Used by the
7587
- * catalogue's WalletConnect builder so a multi-chain wallet (e.g. Trust
7588
- * supports EVM + SOL) gets one option per chain rather than one option
7589
- * for whichever chain `getChainFromWalletSchema` happened to pick first.
7590
- *
7591
- * Falls back to {@link getChainFromWalletSchema}'s single-result behavior
7592
- * (`['EVM']` default) when neither field is populated, so the helper
7593
- * never returns an empty array — every eligible wallet emits at least
7594
- * one option.
7595
- *
7596
- * @param params.wallet - The wallet schema from the wallet book.
7597
- * @param [params.walletKey] - The wallet key identifier (used as last-resort fallback).
7598
- * @returns Ordered, deduped array of Chains.
7599
- * @notInstrumented
7600
- */
7601
- const getChainsFromWalletSchema = ({ wallet, walletKey }) => {
7602
- const chains = /* @__PURE__ */ new Set();
7603
- for (const entry of wallet.injectedConfig ?? []) {
7604
- if (!entry.chain) continue;
7605
- const chain = getChainFromWalletBookIdentifier({ identifier: entry.chain });
7606
- if (chain) chains.add(chain);
7607
- }
7608
- for (const identifier of wallet.chains ?? []) {
7609
- const prefix = extractChainPrefix({ chainIdentifier: identifier });
7610
- try {
7611
- const chain = require_logoutWithReason.getChainFromVerifiedCredentialChain(prefix);
7612
- chains.add(chain);
7613
- } catch {}
7614
- }
7615
- if (chains.size === 0) {
7616
- const chain = getChainFromWalletSchema({
7617
- wallet,
7618
- walletKey
7619
- });
7620
- chains.add(chain);
7621
- }
7622
- return Array.from(chains);
7623
- };
7624
-
7625
7669
  //#endregion
7626
7670
  //#region src/modules/walletOptionsCatalogue/buildWalletConnectOptions/buildWalletConnectOptions.ts
7627
7671
  /**
@@ -8006,6 +8050,31 @@ const buildWithWalletProviderOptions = ({ entries, walletBook }, client) => {
8006
8050
  */
8007
8051
  const EXCLUDED_WALLET_OPTION_KEYS = new Set(["coinbase", "coinbasewallet"]);
8008
8052
 
8053
+ //#endregion
8054
+ //#region src/modules/walletOptionsCatalogue/filterConnectionOptionsByEnabledChains/filterConnectionOptionsByEnabledChains.ts
8055
+ /**
8056
+ * Drops options whose chain has no extension on this client. The wallet
8057
+ * book advertises every chain a wallet supports, so options derived from
8058
+ * it have to be narrowed to the chains the client can actually connect
8059
+ * on — otherwise the catalogue surfaces a connection the customer has no
8060
+ * primitive to drive.
8061
+ *
8062
+ * @param params.enabledChains - Chains the client has an extension for.
8063
+ * @param params.options - The tagged options to narrow.
8064
+ * @returns The options on enabled chains, in input order.
8065
+ * @example
8066
+ * ```typescript
8067
+ * filterConnectionOptionsByEnabledChains({
8068
+ * enabledChains: new Set(['EVM']),
8069
+ * options: [evmOption, solOption],
8070
+ * }); // [evmOption]
8071
+ * ```
8072
+ * @see {@link getEnabledChains} for how the enabled chains are derived.
8073
+ * @see {@link getWalletOptionsCatalogue} for the catalogue that applies this filter.
8074
+ * @notInstrumented
8075
+ */
8076
+ const filterConnectionOptionsByEnabledChains = ({ enabledChains, options }) => options.filter(({ option }) => enabledChains.has(option.chain));
8077
+
8009
8078
  //#endregion
8010
8079
  //#region src/modules/walletOptionsCatalogue/groupOptionsByWalletOption/groupOptionsByWalletOption.ts
8011
8080
  /**
@@ -8250,6 +8319,10 @@ const EMPTY_WALLET_BOOK = {
8250
8319
  * pass `includeMobileOptions: true` to additionally surface
8251
8320
  * WalletConnect, in-app-browser, and install links.
8252
8321
  *
8322
+ * Options sourced from the wallet book are scoped to the chains this
8323
+ * client has an extension for — a wallet is only surfaced on chains the
8324
+ * customer can actually connect on.
8325
+ *
8253
8326
  * Pass `excludedConnectionOptionTypes` to drop specific connection types
8254
8327
  * from the catalogue (e.g. `['inAppBrowser']` on desktop). Wallets whose
8255
8328
  * only connection was an excluded type fall through to the install-only
@@ -8265,6 +8338,7 @@ const getWalletOptionsCatalogue = async (params = {}, client = require_logoutWit
8265
8338
  const walletOptionOrdering = params.walletOptionOrdering ?? "relevance";
8266
8339
  const excludedConnectionOptionTypes = new Set(params.excludedConnectionOptionTypes ?? []);
8267
8340
  const walletBook = includeMobileOptions ? await fetchLegacyWalletBook(client) : EMPTY_WALLET_BOOK;
8341
+ const enabledChains = getEnabledChains(client);
8268
8342
  const allConnectionOptions = [];
8269
8343
  if (!excludedConnectionOptionTypes.has("withWalletProvider")) {
8270
8344
  const entries = require_logoutWithReason.getWalletProviderRegistry(client).listProviderEntries();
@@ -8274,11 +8348,22 @@ const getWalletOptionsCatalogue = async (params = {}, client = require_logoutWit
8274
8348
  }, client));
8275
8349
  }
8276
8350
  if (includeMobileOptions) {
8277
- if (!excludedConnectionOptionTypes.has("walletConnect")) allConnectionOptions.push(...buildWalletConnectOptions({ walletBook }));
8278
- if (!excludedConnectionOptionTypes.has("metamaskSdkUri")) allConnectionOptions.push(...buildMetaMaskSdkUriOptions({ walletBook }));
8279
- if (!excludedConnectionOptionTypes.has("inAppBrowser")) allConnectionOptions.push(...buildInAppBrowserOptions({ walletBook }));
8351
+ const walletBookOptions = [];
8352
+ if (!excludedConnectionOptionTypes.has("walletConnect")) walletBookOptions.push(...buildWalletConnectOptions({ walletBook }));
8353
+ if (!excludedConnectionOptionTypes.has("metamaskSdkUri")) walletBookOptions.push(...buildMetaMaskSdkUriOptions({ walletBook }));
8354
+ if (!excludedConnectionOptionTypes.has("inAppBrowser")) walletBookOptions.push(...buildInAppBrowserOptions({
8355
+ enabledChains,
8356
+ walletBook
8357
+ }));
8358
+ allConnectionOptions.push(...filterConnectionOptionsByEnabledChains({
8359
+ enabledChains,
8360
+ options: walletBookOptions
8361
+ }));
8280
8362
  }
8281
- const installationUrlsByKey = includeMobileOptions ? buildInstallationUrlsByWalletOptionKey({ walletBook }) : /* @__PURE__ */ new Map();
8363
+ const installationUrlsByKey = includeMobileOptions ? buildInstallationUrlsByWalletOptionKey({
8364
+ enabledChains,
8365
+ walletBook
8366
+ }) : /* @__PURE__ */ new Map();
8282
8367
  const grouped = groupOptionsByWalletOption({ options: allConnectionOptions });
8283
8368
  const allWalletOptionKeys = new Set([...grouped.keys(), ...installationUrlsByKey.keys()]);
8284
8369
  const walletOptions = [];