Skip to content

Fix mainnet Earn signing and private Miden withdrawals - #16

Open
Abhimanyu121 wants to merge 2 commits into
mainfrom
fix/miden-mainnet-metamask-delegation
Open

Abhimanyu121 wants to merge 2 commits into
mainfrom
fix/miden-mainnet-metamask-delegation

Conversation

@Abhimanyu121

@Abhimanyu121 Abhimanyu121 commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Mainnet Earn rejected approved MetaMask-delegated local accounts and silently ignored Smart Withdraw clicks for private Miden recipients. Apply a version-pinned pnpm patch to epoch-intents-sdk 1.0.39 that recognizes the verified MetaMask wallet and DelegationManager on Ethereum, Optimism, Polygon, and Base. All workspace consumers use the recorded patch until an SDK release includes the source fix.

Allow opening Local signer while an injected wallet is connected, switch the active EVM connection when a valid local key is submitted, and expose Clear local signer to discard the memory-only key. Pin withdrawal quotes to the position chain, avoid quoting before a network switch, surface execution errors, and stop polling when an intent fails.

Fix the idle Smart Withdraw click for private Miden recipients: the frontend incorrectly required a public recipient, even though the backend sends public P2ID notes that can target a private account. The rejected recipient routed the CTA into connectMiden, where an already-connected wallet returned immediately, while the detail button still read Confirm Smart Withdraw. Accept either recipient storage mode, preserve the missing-recipient guard, and use the real CTA label for every non-submit action.

Validation: all 39 widget unit tests and 6 demo signer/note tests pass; library build, demo typecheck, and staged demo build pass. The native Miden SDK successfully constructs a public P2ID note for the exact private recipient. A live quote-only run through the installed SDK obtains both Aave Base withdrawal and Base-USDC-to-Miden-USDCX quotes for 0.01 USDC (bridge quote output 0.009918 USDCX); transaction execution is intercepted and wallet RPC is blocked during this check. The deployed public bundle matches the built artifact by SHA-256 and contains the corrected recipient guard and CTA labels. Mainnet delegation is recognized on Base and Optimism with no setup required. No funded withdrawal was submitted. The repository-requested graphify update could not run because graphify is not installed.

@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
epoch-widget Error Error Oct 21, 2026 6:51pm UTC

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

React Doctor found 1 new issue in 1 file · 1 warning · score 85 / 100 (Great) · 0 fixed · vs miden-mainnet-prep

1 warning

src/earn/use-earn-intent-flow.ts

  • ⚠️ L681 Missing effect dependencies exhaustive-deps

Reviewed by React Doctor for commit 6d3d60f. See inline comments for fixes.

@Abhimanyu121 Abhimanyu121 changed the title Fix mainnet local-signer delegation and Earn wallet handling Fix mainnet Earn signing and private Miden withdrawals Oct 21, 2026
Base automatically changed from miden-mainnet-prep to main November 1, 2026 19:57

This branch had an error being deployed

1 failed deployment
Preview — 6d3d60f4 Deployed Oct 21, 2026 by vercel[bot]
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