-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(starknet): enhance token provider implementation and type safety #3132
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
Hello, We are changing our plugin development strategy to be more scalable. We have moved the plugins out into their own repos and we're looking for people to either maintain those or own them on their own Github. Please make your code changes to this repo: https://github.com/elizaos-plugins/plugin-starknet If you'd like to be a maintainer, file an issue in the plugin repo and join our Discord https://discord.gg/elizaos to coordinate. If you'd like to control the plugin on your own Github, please add an issue to the plugin repo pointing to your repo, and add a modification to the registry. Submit a PR to edit the registry here: https://github.com/elizaos-plugins/registry Closing this PR for now. Let us know if you have any questions. |
Pull Request Title: feat(starknet): enhance token provider implementation and type safety
Relates to
This PR relates to improving the Starknet plugin's token provider implementation and type safety.
Risks
Low - The changes are mostly improvements to existing code and type definitions, with no breaking changes to the API.
Background
What does this PR do?
fetchWithRetry
methodgetTokensInWallet
with proper Starknet support and cachingWhat kind of change is this?
Documentation changes needed?
My changes do not require a change to the project documentation as they are internal improvements to the codebase.
Testing
Where should a reviewer start?
packages/plugin-starknet/src/providers/token.ts
packages/plugin-starknet/src/types/declarations.d.ts
Detailed testing steps
Test token balance retrieval:
const walletProvider = new WalletProvider(runtime);
const provider = new TokenProvider(tokenAddress, walletProvider);
const balances = await provider.getTokensInWallet();
Verify caching behavior:
typescript
// First call should fetch from network
const firstCall = await provider.getTokensInWallet();
// Second call should return cached data
const secondCall = await provider.getTokensInWallet();
Test error handling:
typescript
// Should handle errors gracefully
try {
await provider.getTokensInWallet();
} catch (error) {
// Should provide meaningful error message
console.error(error);
}
Changes Summary
The PR focuses on improving code quality and maintainability while ensuring type safety throughout the Starknet plugin implementation.