Repository navigation
feat(bridge): guide funds in from an exchange (Phase 8) - #134
Closed
Vasanthdev2004 wants to merge 1 commit into
Closed
Vasanthdev2004 wants to merge 1 commit into
Vasanthdev2004 wants to merge 1 commit into
Conversation
The bridge panel gains a "Funds on an exchange?" link that swaps the form for a four-step guide: the wallet's address with a copy button, the four networks to withdraw to (Base, Ethereum, Arbitrum, Optimism), a read-only watch for the funds to land, and a button that opens the bridge on that route with the token amount filled in. A token that lands with no ETH beside it gets a gas warning. Funds that land on the destination itself are reported as ready. The watch reads ETH and Circle's USDC on those networks every 15 seconds, paused while the tab is hidden, and measures arrivals from the lowest balance seen since it began, so funds already there never count. The watch and the open guide are kept in session storage for two hours, so closing the panel or connecting a wallet resumes it without taking focus. Relay deposit addresses were evaluated for this and stay off: production addresses are Lit-derived accounts whose derivation inputs are not returned, so an address cannot be tied to its order. docs/bridge.md records the findings and the on-chain evidence.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
Collaborator
Author
|
Closed in favour of #135, which holds the whole bridge update in one PR. The commits from this PR are in it unchanged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #132. Phase 8 of the bridge update.
What it does
The bridge panel (header dialog and
/bridge) gains a "Funds on an exchange?" link under the amount. It swaps the form for a four-step guide that uses only routes the bridge already checks:The watch and the open guide are kept in this tab's session storage for two hours. Closing the panel, or connecting a wallet from the guide, resumes the guide without taking focus.
Why not Relay deposit addresses
These were evaluated first. Relay can attach a one-time deposit address to a quote, but in production these addresses are Lit-derived EOAs. They are built from derivation inputs the quote does not return plus an unpublished root key, so an address cannot be tied to its order. On Base, fresh accounts were seen sweeping into the depository at nonce 0 and 1. Tracking also needs an API key, and an Ethereum USDC route quoted about 3.3% at $25.
docs/bridge.mdrecords the findings and the tx hashes.relay.tsnever requests a deposit address, andvalidation.tsstill refuses any quote that carries one.Code
lib/bridge/exchange.ts: networks, baseline, arrivals, gas check, the route an arrival opens, and session persistence (all pure).components/bridge/useExchangeWatch.ts: the polling hook.fund.ts:readHoldingsOnnow holds the shared read code;readBridgeHoldingscalls it.BridgeDialog.tsx: theExchangeGuideview, the link, and focus handling. Opening moves focus to the guide title. Back and Bridge return focus to the link or the amount./ui-review-bridge: six guide states, and the review dialog's guide wired to a synthetic arrival./bridge"Good to know" bullet, and a docs section.Verification
exchange.test.ts(8 tests) and a UI guard inbridge-ui.test.ts. The guard checks that the guide only reads, opens the bridge through the guarded setters, calls out missing gas, and keeps deposit addresses off.tsc(app and tests) and eslint on the bridge paths are clean./ui-review-bridge;/bridgewithout a wallet;