Skip to content

feat: integrate Unifold Perps deposits#12495

Draft
Kahnchan wants to merge 1 commit into
OneKeyHQ:xfrom
Kahnchan:feat/perps-unifold-demo
Draft

feat: integrate Unifold Perps deposits#12495
Kahnchan wants to merge 1 commit into
OneKeyHQ:xfrom
Kahnchan:feat/perps-unifold-demo

Conversation

@Kahnchan

Copy link
Copy Markdown
Contributor

Summary

  • Add a Web-only Unifold deposit menu for Perps with crypto and cash funding methods.
  • Route Perps deposit entry points through the shared deposit flow while preserving the existing native wallet deposit experience.
  • Add a Deposit Tracker entry to the account history toolbar and adapt the Unifold child modal for mobile Web sizing.

Intent & Context

Perps users need more ways to fund their Hyperliquid trading account than the existing connected-wallet flow. This demo integrates Unifold into the current deposit entry points, keeps the OneKey wallet option available, and exposes transfer, card, exchange, Cash App, and tracking experiences without changing native behavior.

Design Decisions

  • Keep the integration Web-only; native continues to open the existing OneKey deposit flow.
  • Use the active Perps account as the HyperCore recipient and configure the destination as HyperCore USDC (Perp).
  • Load supported network, payment, and exchange logos from Unifold project configuration instead of maintaining a hardcoded list.
  • Read the Unifold publishable key from UNIFOLD_PUBLISHABLE_KEY; when it is unavailable, the main deposit entry falls back to the existing OneKey flow.
  • Keep Deposit Tracker as a dedicated action instead of merging Unifold records into Hyperliquid account history.

Changes Detail

  • Add Unifold SDK dependencies and client environment configuration.
  • Add the themed Deposit method selector and SDK child flows for Web.
  • Unify Perps deposit buttons across the trading and account panels.
  • Add responsive mobile Web sizing for non-main Unifold dialogs.

Risk Assessment

  • Risk Level: Medium
  • Affected Platforms: Web and Desktop Web renderer; native behavior is preserved
  • Risk Areas: Unifold project configuration, HyperCore destination mapping, and vendor modal styling

Test plan

  • Run worktree JS/TS lint checks.
  • Verify the Web development build compiles successfully.
  • Configure UNIFOLD_PUBLISHABLE_KEY and verify each Deposit menu action.
  • Verify connected-wallet deposits still open the existing OneKey flow.
  • Verify the Unifold child modal is content-sized on mobile Web and unchanged on desktop.
  • Verify Deposit Tracker opens from both the Deposit menu and account history toolbar.

Known baseline issue

yarn agent:check --profile commit reaches the staged TypeScript check but is blocked by existing errors in DesktopLeftSideBar.tsx and FavoritesBar.web.tsx, which are outside this PR.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​unifold/​core@​0.1.67691009497100
Added@​unifold/​ui-react@​0.1.678010010097100
Added@​tanstack/​react-query@​5.101.2991008897100

View full report

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.

1 participant