@satoshai/kit 1.0.2 → 1.0.3

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/index.cjs CHANGED
@@ -710,15 +710,7 @@ var StacksWalletProvider = ({
710
710
  onAddressChange: handleAddressChange,
711
711
  onDisconnect: handleWcDisconnect
712
712
  });
713
- const [installed, setInstalled] = react.useState(
714
- () => getStacksWallets().installed
715
- );
716
- react.useEffect(() => {
717
- const fresh = getStacksWallets().installed;
718
- setInstalled(
719
- (prev) => fresh.join(",") === prev.join(",") ? prev : fresh
720
- );
721
- }, []);
713
+ const { installed } = getStacksWallets();
722
714
  const configured = wallets ?? [...SUPPORTED_STACKS_WALLETS];
723
715
  const walletInfos = configured.map((w) => ({
724
716
  id: w,
@@ -1483,7 +1475,20 @@ var useBnsName = (address) => {
1483
1475
  };
1484
1476
  var useWallets = () => {
1485
1477
  const { wallets } = useStacksWalletContext();
1486
- return react.useMemo(() => ({ wallets }), [wallets]);
1478
+ const { installed } = getStacksWallets();
1479
+ const installedKey = installed.join(",");
1480
+ return react.useMemo(
1481
+ () => ({
1482
+ wallets: wallets.map((w) => ({
1483
+ ...w,
1484
+ // wallet-connect availability is controlled by projectId in
1485
+ // the provider — don't override with getStacksWallets() which
1486
+ // unconditionally returns true for it.
1487
+ available: w.id === "wallet-connect" ? w.available : w.available || installed.includes(w.id)
1488
+ }))
1489
+ }),
1490
+ [wallets, installedKey]
1491
+ );
1487
1492
  };
1488
1493
 
1489
1494
  // src/utils/create-contract-config.ts