Skip to content

Feature Request: Expose connection state snapshot API for synchronous wallet state checks #1838

@kayak01legit

Description

@kayak01legit

Is your feature request related to a problem? Please describe.

Common scenarios include:

  • Rendering UI conditionally based on whether a wallet is already connected
  • Avoiding flashes of incorrect UI during initial load
  • Checking connection state before registering listeners
    Without a synchronous state snapshot, developers either duplicate internal logic or introduce race conditions.

Describe the solution you'd like

Proposed Solution

  • Add a synchronous getConnectionState() method to the Coinbase Wallet SDK provider.
  • Expose a minimal, read-only snapshot including:
    • connection status (connected / connecting / disconnected)
    • current accounts
    • current chainId
  • Ensure the snapshot is updated before any related provider events are emitted.
  • Guarantee that calling the method has no side effects and performs no network requests.

Acceptance Criteria

  • Developers can synchronously read the current wallet connection state.
  • Snapshot data is always consistent with emitted provider events.
  • Calling the snapshot API does not trigger network calls or state changes.
  • Existing integrations continue to work without modification.
  • Basic tests verify snapshot accuracy during connect, disconnect, and chain/account changes.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions