coinbase / coinbase/onchainkit

Feature Request: Add a built-in hook for detecting and handling wallet connection readiness

Open
#2,576 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1k
Forks
520
Avg merge
32m
Merged PRs (30d)
2

Description

### Describe the solution you'd like

## Overview
OnchainKit applications often need to know when a wallet is fully ready for interaction (connected, correct network, provider initialized). Currently, developers must combine multiple signals manually to determine when it is safe to enable onchain actions.

## Problem Description
Without a single readiness signal:
- UI may enable actions too early and trigger errors
- Developers duplicate logic to check connection, network, and provider state
- Handling edge cases (slow provider init, reconnects) becomes inconsistent

This increases complexity and can lead to poor user experience.

## Proposed Solution
Introduce a first-class hook (for example, `useWalletReady`) that exposes a clear readiness state derived from wallet connection, provider initialization, and network checks. The hook should provide a simple boolean and optional metadata explaining why the wallet is not yet ready.

### Acceptance Criteria
- Developers can reliably determine when wallet-dependent actions are safe to execute.
- The hook works out-of-the-box with existing OnchainKit provider configuration.
- Readiness state updates correctly on connect, disconnect, and network changes.
- The feature is additive and does not break existing APIs.

### Describe alternatives you've considered.

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

No files, tests, or entry points are named. Start by reviewing the existing OnchainKit provider configuration and the signals for wallet connection, provider initialization, and network changes; define what readiness and optional failure metadata should mean, then verify updates across connect, disconnect, and network changes without breaking existing APIs.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
blockchain, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.