✨ app: add support for multi-chain asset recovery#970
✨ app: add support for multi-chain asset recovery#970dieguezguille wants to merge 17 commits intotransportfrom
Conversation
🦋 Changeset detectedLatest commit: 6412718 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds cross-chain asset discovery and execution, portfolio restructuring, new UI sheets for external/collateral/unsupported networks, cross-chain account client routing, multiple query helpers for deployed/wallet balances, i18n updates, and assorted UI/layout tweaks. Includes many small changesets for patch releases. Changes
Sequence DiagramsequenceDiagram
participant User
participant Bridge as Bridge Component
participant Portfolio as Portfolio Screen
participant QueryClient as Query Client
participant LiFi as LiFi API
participant Deployed as Deployed Check
User->>Portfolio: Open portfolio
Portfolio->>QueryClient: fetch markets, same-chain & wallet balances
QueryClient->>LiFi: request tokenBalances & walletBalances
LiFi-->>QueryClient: return balances per chain
QueryClient->>Deployed: check contract bytecode per chain
Deployed-->>Portfolio: deployed status
Portfolio->>User: render collateral + external assets grouped by chain
User->>Bridge: select external asset -> navigate with sender, sourceChain, sourceToken
Bridge->>Bridge: classify mode (isTransfer/isSwap/isRecovery)
alt isTransfer (same-chain)
Bridge->>Wallet: send native transaction
Wallet->>Network: broadcast tx
else cross-chain / recovery
Bridge->>AccountClient: request cross-chain client for targetChain
AccountClient->>CrossChainClient: build/sign UserOperation
CrossChainClient->>Network: submit UserOperation
Network-->>CrossChainClient: execution/result
CrossChainClient-->>Bridge: return composite id/result
end
Bridge->>User: show success/failure
sequenceDiagram
participant User
participant ExternalAssets as ExternalAssets Component
participant QueryClient as Query Client
participant Deployed as Deployed Check
participant Unsupported as UnsupportedNetworksSheet
User->>ExternalAssets: Tap non-collateral asset
ExternalAssets->>QueryClient: ensure deployedOptions(account, chainId) queries
QueryClient->>Deployed: return deployed/not-deployed
alt not supported or not deployed
ExternalAssets->>Unsupported: open UnsupportedNetworksSheet with formatted recovery message
Unsupported->>User: show contact support flow (Intercom)
else supported & deployed
ExternalAssets->>Bridge: navigate to Bridge with asset params
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## transport #970 +/- ##
=============================================
+ Coverage 71.74% 71.79% +0.04%
=============================================
Files 229 236 +7
Lines 8406 9238 +832
Branches 2708 3038 +330
=============================================
+ Hits 6031 6632 +601
- Misses 2143 2345 +202
- Partials 232 261 +29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4868ef9 to
eb6d3a6
Compare
4bcfa86 to
c19bd5d
Compare
c19bd5d to
e79dd5b
Compare
e79dd5b to
aae3144
Compare
aae3144 to
5c6c745
Compare
5c6c745 to
b50b099
Compare
| defaultValues: { receiver: typeof receiver === "string" ? receiver : "" }, | ||
| onSubmit: ({ value }) => { | ||
| router.push({ pathname: "/send-funds/asset", params: { receiver: String(value.receiver) } }); | ||
| router.push({ pathname: "/send-funds/asset", params: { receiver: value.receiver } }); | ||
| }, |
There was a problem hiding this comment.
🚩 Receiver form defaultValues change affects pre-filled address UX
In src/components/send-funds/Receiver.tsx:41-44, the old code used safeParse + form.setFieldValue + form.validateAllFields in the render body to pre-fill and validate addresses from URL params (e.g., QR scan). The new code uses defaultValues: { receiver: typeof receiver === "string" ? receiver : "" }. This fixes the anti-pattern of setting state during render, but the submit button checks !isValid || !isTouched (line 353), so a pre-filled address from URL params won't enable the button until the user interacts with the input. This is a deliberate stabilization per the changeset, though it may require a user tap on the input before proceeding.
Was this helpful? React with 👍 or 👎 to provide feedback.
b50b099 to
de51847
Compare
closes #854 , closes #649
Summary by CodeRabbit
New Features
Bug Fixes
Refactors
Localization