Skip to content

Feature Request: Add early validation and clear errors for missing or invalid account configuration #210

@Zanakumaunam

Description

@Zanakumaunam

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

If a developer:

  • forgets to pass a required configuration field
  • passes an invalid chainId
  • misconfigures the RPC endpoint

the SDK may fail only when an action is executed, producing low-level or indirect errors that do not clearly indicate the root cause (invalid or missing config).

Expected Behavior

  • Configuration errors should be detected as early as possible.
  • Error messages should clearly state which configuration value is missing or invalid.
  • Developers should not need to inspect stack traces or internal calls to identify setup mistakes.

Steps to Reproduce

  1. Initialize the account SDK with a missing or invalid configuration field.
  2. Call any account-related method.
  3. Observe that the error message does not clearly point to the configuration issue.

Describe the solution you'd like

Proposed Solution

  • Add a centralized validation step during account initialization.
  • Validate required configuration fields (such as chainId, rpcUrl, and account options) for presence and basic correctness.
  • Throw clear, descriptive errors before any network or account operation is executed.
  • Reuse the same validation logic across all account creation entry points to ensure consistency.

Acceptance Criteria

  • SDK initialization fails fast when required configuration values are missing or invalid.
  • Error messages explicitly identify which configuration field is incorrect.
  • No network or account actions are attempted when validation fails.
  • Unit tests cover common misconfiguration scenarios without introducing breaking changes.

Additional Information

  • Early validation significantly improves developer onboarding and DX.
  • Reduces runtime failures that are harder to debug.
  • Aligns with fail-fast patterns used in other Base and Coinbase SDKs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions