Feature Request: Add early validation and clear errors for missing or invalid account configuration
- Dominant language
- TypeScript
- Stars
- 172
- Forks
- 207
- Avg merge
- 49m
- Merged PRs (30d)
- 1
Description
### 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.
Contributor guide
Research direction
Start by locating the account initialization and account creation entry points, then trace how configuration values such as chainId, rpcUrl, and account options are currently handled. Review the existing unit-test structure and cover missing or invalid configuration cases. Done means initialization fails before network or account actions and identifies the incorrect field clearly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, developer-experience
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100