Skip to content

Conversation

@CharlVS
Copy link
Collaborator

@CharlVS CharlVS commented Aug 5, 2025

Summary

This PR adds comprehensive staking functionality to Komodo Wallet, enabling users to stake Cosmos-based assets and earn rewards through delegation.

What's Added

Core Functionality

  • Staking Creation: Complete flow for creating new stakes/delegations with validator selection and amount input
  • Rewards Management: View and claim staking rewards from validators
  • Delegations Overview: Manage existing staking positions

Technical Implementation

Architecture

  • BLoC Pattern: Follows proper naming conventions with separate BLoCs for creation () and rewards ()
  • Repository Pattern: provides clean abstraction over KomodoDefiSdk staking functionality
  • State Management: Immutable states with proper error handling and loading states

UI Components

  • : Main entry point with tabbed interface
  • : Portfolio overview with key metrics and quick actions
  • : Guided form for creating new stakes
  • : Interface for viewing and claiming rewards
  • : Management of existing delegations
  • : Asset selection for staking operations

Integration

  • Navigation: Full routing integration with deep-linking support
  • Main Menu: Added to navigation menu (debug-only for now)
  • Platform Abstractions: Removed direct JS/HTML references, added proper web API abstractions

Technical Details

Files Added

    • Complete staking BLoC implementation
    • All staking UI components
    • Routing support
    • Platform abstraction layer
    • Documentation for naming standards

Key Features

  • Cosmos staking support through KomodoDefiSdk
  • Validator selection with recommendations
  • Amount validation and balance checking
  • Transaction submission with error handling
  • Real-time rewards tracking
  • Delegation management (stake/unstake)

Testing

How to Test

  1. Enable Debug Mode: Staking is currently only visible in debug builds
  2. Navigate to Staking: Use the main menu to access the staking page
  3. Select Asset: Choose a Cosmos-based asset (e.g., ATOM)
  4. Create Stake: Go through the staking creation flow
  5. View Rewards: Check the rewards tab for any existing delegations
  6. Manage Delegations: Use the delegations tab to view existing stakes

Test Scenarios

  • Asset selection and initialization
  • Validator loading and selection
  • Amount input validation
  • Transaction submission (test with small amounts)
  • Rewards viewing and claiming
  • Navigation between tabs
  • Deep-linking to staking pages

Notes

  • Debug Only: Staking functionality is currently hidden in production builds for safety
  • Cosmos Focus: Initial implementation targets Cosmos-based staking assets
  • BLoC Conventions: Follows the documented naming conventions for events and states
  • Platform Clean-up: Removed direct JS/HTML references for better architecture
  • Logging: Updated logging package for better debugging support

Breaking Changes

None - this is a purely additive feature.

Dependencies

  • Updated logging package to latest version
  • No new external dependencies required
  • Utilizes existing KomodoDefiSdk staking functionality

Statistics: 48 files changed, 4,109 insertions(+), 465 deletions(-)

Ready for: Code review, testing in debug mode

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 5, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add/staking

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@CharlVS CharlVS marked this pull request as draft August 5, 2025 21:12
@github-actions
Copy link

github-actions bot commented Aug 5, 2025

Visit the preview URL for this PR (updated for commit 87db369):

https://walletrc--pull-3052-merge-dgr9qeya.web.app

(expires Mon, 18 Aug 2025 10:34:44 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc

cursor[bot]

This comment was marked as outdated.

@CharlVS CharlVS marked this pull request as ready for review August 6, 2025 12:48
cursor[bot]

This comment was marked as outdated.

@CharlVS CharlVS marked this pull request as draft August 6, 2025 12:59
@CharlVS CharlVS closed this Aug 6, 2025
@CharlVS CharlVS reopened this Aug 6, 2025
CharlVS added 5 commits August 6, 2025 15:02
…into add/staking

# Conflicts:
#	lib/bloc/app_bloc_root.dart
Shotgun-precache images for SDK on mobile platforms
Use SDK’s robust JSON extension methods to resolve strict type casting on Flutter wasm web.
@CharlVS CharlVS changed the title feat(staking): add comprehensive staking functionality feat(staking): add comprehensive staking and Flutter wasm overhaul Aug 7, 2025
CharlVS and others added 6 commits August 7, 2025 16:22
Tested with the wasm build flag to ensure that the looser requirements are still WASM compatible
Banxa does not include the required cross-origin headers in their responses, so Wasm cross-origin isolation requirements cause the page to fail to load
…into add/staking

# Conflicts:
#	lib/views/wallet/wallet_page/common/expandable_coin_list_item.dart
#	lib/views/wallets_manager/widgets/wallet_simple_import.dart
#	packages/komodo_ui_kit/pubspec.lock
#	pubspec.lock
_currentPrecacheOperation = Completer<void>();

// Load all icons similaneously if user is not on mobile device
final shouldShotgunLoad = !Platform.isAndroid && !Platform.isIOS;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Web Build Fails Due to dart:io Usage

The dart:io import and subsequent use of Platform.isAndroid and Platform.isIOS in _precacheCoinIcons cause compilation errors on web platforms. This prevents the application from building for web, as dart:io is not supported in that environment.

Fix in Cursor Fix in Web

ColoredBox(color: Colors.green),

// _buildDelegationsTab(),
],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Staking Page Tabs Display Incorrect Content

The Rewards and Delegations tabs in StakingPage's TabBarView are showing placeholder ColoredBox widgets instead of their intended content. This prevents users from accessing the staking rewards and delegations functionality, likely due to debugging code being accidentally committed.

Fix in Cursor Fix in Web

@ca333 ca333 closed this Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants