-
Notifications
You must be signed in to change notification settings - Fork 93
Open
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
- Initialize the account SDK with a missing or invalid configuration field.
- Call any account-related method.
- 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
Labels
No labels