You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: wallet configuration, availability detection, and @stacks/connect 8.2.5 (#2)
* feat: update @stacks/connect to 8.2.5 and leverage WalletConnect.initializeProvider
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>
* chore: add changeset for @stacks/connect update
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: use stable primitive dep for session restore effect
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>
* feat(example): disable buttons for unavailable wallets
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>
* feat: add useAvailableWallets hook
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>
* feat: add wallets prop to StacksWalletProvider
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>
* feat: runtime guard for wallet-connect without projectId
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>
* feat: add reset to clear stuck connecting state
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>
* chore: update changeset to minor with full scope
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: replace useAvailableWallets with useWallets returning WalletInfo[]
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>
* docs: update READMEs with new wallet API
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>
* fix: stale connect after reset, WC double-init race, and strict mode 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>
* docs: add note about OKX popup close not rejecting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
// Reset stuck connecting state (e.g. when a wallet modal is dismissed)
96
+
reset();
89
97
```
90
98
99
+
> **Note:** Some wallets (e.g. OKX) never reject the connection promise when the user closes the popup. Use `reset()` to clear the pending state in those cases.
100
+
101
+
### `useWallets()`
102
+
103
+
Returns all configured wallets with their availability status.
A wallet is `available` when its browser extension is installed. For `wallet-connect`, it's `available` when a `walletConnect.projectId` is provided to the provider.
0 commit comments