Skip to content

feat: wallet configuration, availability detection, and @stacks/connect 8.2.5#2

Merged
satoshai-dev merged 13 commits intomainfrom
feat/update-stacks-connect-8.2.5
Feb 25, 2026
Merged

feat: wallet configuration, availability detection, and @stacks/connect 8.2.5#2
satoshai-dev merged 13 commits intomainfrom
feat/update-stacks-connect-8.2.5

Conversation

@satoshai-dev
Copy link
Copy Markdown
Owner

@satoshai-dev satoshai-dev commented Feb 25, 2026

Summary

  • Pin @stacks/connect from ^8.2.2 to 8.2.5
  • Leverage WalletConnect.initializeProvider() for faster WC connections and session restores
  • Add wallets prop to StacksWalletProvider to configure which wallets are supported
  • Add useWallets hook — returns configured wallets with { id, available } shape
  • Add reset to useConnect — clears stuck connecting state when wallet modals are dismissed
  • Runtime guard: throws if wallet-connect is in wallets without walletConnect.projectId
  • Remove connectors from useConnect (replaced by useWallets)
  • Fix runtime guard crash under React Strict Mode (moved from render body to useEffect)
  • Fix reset() not cancelling in-flight connect() promises (generation counter prevents stale state)
  • Fix WalletConnect double initializeProvider race between session restore and connect

Changes since @stacks/connect 8.2.2

8.2.5 (2026-02-20)

8.2.4 (2025-12-17)

8.2.3 (2025-11-25)

New public API

wallets prop

<StacksWalletProvider wallets={['xverse', 'leather', 'wallet-connect']} walletConnect={{ projectId: '...' }}>

useWallets

const { wallets } = useWallets();
// [{ id: 'xverse', available: true }, { id: 'leather', available: false }, ...]

{wallets.map(({ id, available }) => (
    <button disabled={!available} onClick={() => connect(id)}>{id}</button>
))}

reset (via useConnect)

const { connect, reset, isPending } = useConnect();
// reset() clears stuck "Connecting..." state when wallet modals hang

Known issues

Test plan

  • Typecheck passes
  • All 40 unit tests pass
  • Build succeeds
  • Manual: connect with Xverse/Leather — works as before
  • Manual: WalletConnect connection with project ID
  • Manual: close WC modal → reset clears pending state
  • Manual: close OKX popup → reset clears pending state
  • Manual: unavailable wallets show as disabled

Closes #1

🤖 Generated with Claude Code

satoshai-dev and others added 10 commits February 25, 2026 08:56
…ializeProvider

Pin @stacks/connect to 8.2.5 (from ^8.2.2) picking up bundle size
improvements, provider regression fixes, and the new initializeProvider API.
Pre-initialize WalletConnect only when the user connects with it or when
restoring a wallet-connect session from localStorage.

Closes #1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Depend on walletConnect?.projectId instead of the walletConnect object
to prevent the effect from re-running on every parent render when the
prop is passed inline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Disable wallet buttons when the extension is not installed, and disable
wallet-connect when no WalletConnect config is provided.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Expose available wallets from the provider context, accounting for both
extension installation and WalletConnect configuration. Consumers no
longer need to manually check wallet availability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Allow consumers to configure which wallets they want to support via a
wallets prop. When omitted, all supported wallets are available.
availableWallets is now the intersection of configured wallets and
installed wallets, with wallet-connect requiring a projectId.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Throw on mount if wallet-connect is in the wallets array but no
walletConnect.projectId was provided. Also wire up the example app
to read WalletConnect project ID from VITE_WALLETCONNECT_PROJECT_ID.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a wallet modal is dismissed without completing (e.g. WalletConnect),
the request promise may never settle, leaving the UI stuck on
"Connecting...". Expose reset via useConnect so consumers can reset the
connection state, matching wagmi's convention.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Return all configured wallets with an `available` flag instead of only
available ones. Consumers can now show all wallets and disable
unavailable ones. Also removes `connectors` from useConnect in favor
of useWallets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update Quick Start and API docs to reflect useWallets, wallets prop,
reset, and removal of connectors from useConnect.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@satoshai-dev satoshai-dev changed the title Update @stacks/connect to 8.2.5 (pinned) feat: wallet configuration, availability detection, and @stacks/connect 8.2.5 Feb 25, 2026
satoshai-dev and others added 2 commits February 25, 2026 14:20
…guard

- Move runtime guard from render body to useEffect (React Strict Mode safe)
- Add generation counter ref so reset() invalidates in-flight connect() promises
- Guard concurrent WalletConnect.initializeProvider calls with wcInitRef

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@satoshai-dev satoshai-dev merged commit 08e83c6 into main Feb 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update @stacks/connect from ^8.2.2 to 8.2.5 (pinned)

1 participant