mirror of
https://github.com/luxfi/wallet.git
synced 2026-07-27 03:37:41 +00:00
8bb13437573c1034099da4cd37b93b1ca30ff6e9
SCREENS.md §3. Wires /swap and /swap/confirm to the canonical token-swap
form: from/to TokenSelector × 2, decimal amount, slippage popover (10/50/
100bps presets + custom), QuoteRoute panel with route kind badge.
Swap.tsx : main form, flip button, slippage popover, submit gate
TokenSelector.tsx : modal w/ search + popular pinned + inline balances
QuoteRoute.tsx : route kind ("AMM v2/v3" | "DEX v4") + path + impact
useSwapQuote.ts : gateway /v1/quote (preferred) + on-chain QuoterV2
fallback via useReadContract; 300ms debounce, 5s
timeout, AbortController on input change
useSwapExecute.ts : approve (max-uint, ERC-20 only) + swap via wagmi
writeContract; amountOutMin = amountOut * (1 - bps)
contracts.ts : minimal QuoterV2 / SwapRouter02 / Teleport ABIs +
per-chain address table (gateway is source of truth
at runtime; addresses are fallback-only)
Threat model:
- Slippage enforced on-chain (router reverts on amountOutMin); UI gate is
defense-in-depth, not the canonical control.
- Quote staleness rejected client-side (>30s) to prevent stale-price
execution after the user steps away.
- All RPC URLs come from getBootnodeRpcUrl(chainId); no empty-string URLs
(Solana Connection ctor crash mitigation per v0.3.39 lesson).
- Token names/symbols rendered as React text (default-escaped) — no
dangerouslySetInnerHTML anywhere in the slice.
Description
Open Source Lux DeFi Wallet.
187 MiB
Languages
TypeScript
88%
Swift
4.2%
Kotlin
4.1%
JavaScript
1.2%
Go
0.8%
Other
1.6%