Skip to content

feat: add Aave E-Mode integration#12492

Draft
labrinyang wants to merge 2 commits into
OneKeyHQ:xfrom
labrinyang:feat/aave-emode-integration
Draft

feat: add Aave E-Mode integration#12492
labrinyang wants to merge 2 commits into
OneKeyHQ:xfrom
labrinyang:feat/aave-emode-integration

Conversation

@labrinyang

Copy link
Copy Markdown
Contributor

Summary

  • Add Aave E-Mode status, category switching, collateral controls, and need-action flows to Borrow.
  • Extend staking service APIs, approval and delegation handling, native-asset repay and withdraw behavior, routes, and shared types.
  • Add focused unit tests and generated localization entries for the integration.

Intent & Context

Aave E-Mode implementation is ready for integration testing. This PR rebases the final feature state onto the latest x branch as one squash commit while preserving the completed E-Mode behavior.

Design Decisions

  • Keep UI orchestration in Borrow and Staking hooks while routing protocol requests through ServiceStaking in the background runtime.
  • Preserve upstream stale-request guards, provider metadata, repay-all handling, and existing native gateway behavior during conflict resolution.
  • Reuse existing approval, delegation, transaction confirmation, and localization patterns instead of adding parallel abstractions.

Changes Detail

  • Add E-Mode switch and need-action pages with category, balance, presentation, and step helpers.
  • Add collateral switch controls and approval or delegation handling across supply, borrow, repay, and withdraw flows.
  • Extend ServiceStaking and shared route and staking types for E-Mode and updated Aave transaction parameters.
  • Improve pending staking transaction completion ownership and refresh behavior.
  • Add unit coverage for E-Mode, collateral, approvals, repay-all, and pending transaction behavior.

Risk Assessment

  • Risk Level: Medium
  • Affected Platforms: Extension / Mobile / Desktop / Web
  • Risk Areas: Aave approval and delegation transactions, collateral state transitions, E-Mode category changes, native asset paths, and main-to-background RPC boundaries.

Test plan

  • Run commit profile checks including lint and TypeScript checks.
  • Run the full test suite: 639 suites and 6922 tests passed.
  • Verify E-Mode category switching and disabling against supported Aave markets.
  • Verify need-action resolution for incompatible collateral and debt positions.
  • Verify supply, borrow, repay, and withdraw flows, including native assets and approval or delegation paths.

@labrinyang labrinyang closed this Jul 14, 2026
@labrinyang labrinyang reopened this Jul 14, 2026
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.

2 participants