feat: support read-only address queries for balance and staking position#61
feat: support read-only address queries for balance and staking position#61
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Warning
|
| Cohort / File(s) | Summary |
|---|---|
Package Metadata packages/mcp-server/README.md, packages/mcp-server/package.json, packages/mcp-server/src/index.ts |
Simplified package name from scoped (@keep-starknet-strange/starkzap-mcp) to non-scoped (starkzap-mcp) in package definition and documentation references. |
Type Utilities src/types/address.ts, src/types/amount.ts |
Added resolveWalletAddress() function and AddressInput type for flexible wallet/address parameter handling; added assertAmountMatchesToken() function for centralized token amount validation. |
Core Refactoring src/erc20/erc20.ts, src/staking/staking.ts |
Removed private validation methods and updated multiple method signatures to accept WalletInterface | Address | BigNumberish via resolveWalletAddress(); replaced internal amount validation calls with external assertAmountMatchesToken() utility across various public methods. |
Test Coverage tests/erc20.test.ts, tests/staking-auto-stake.test.ts, tests/staking-readonly.test.ts |
Added test cases for balanceOf() accepting raw address strings and address objects; updated mock staking objects to expose token property; added comprehensive getPosition() test suite covering address string, address object, and wallet interface inputs. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~22 minutes
Poem
🐰 A scoped name becomes one true and light,
Validation extracted to shine so bright,
Addresses resolved in many a way,
Type utils dance and refactoring play,
Tests bloom anew to show it's all right! ✨
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title accurately summarizes the main change: adding support for read-only address queries (accepting raw addresses and address objects) for both balance and staking position queries. |
| Docstring Coverage | ✅ Passed | Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
codex/fix-issue-58-readonly-address
Tip
Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
Summary by CodeRabbit
Release Notes
Chores
New Features
Refactor
Tests