Skip to content

feat(mobile): wire quote and passkey execute into swap screen - #601

Open
collinsezedike wants to merge 1 commit into
Miracle656:mainfrom
collinsezedike:feat/mobile-swap-execute-v2
Open

feat(mobile): wire quote and passkey execute into swap screen#601
collinsezedike wants to merge 1 commit into
Miracle656:mainfrom
collinsezedike:feat/mobile-swap-execute-v2

Conversation

@collinsezedike

@collinsezedike collinsezedike commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Wires live Soroswap quotes into the existing swap form via lib/soroswap.getSoroswapQuote, debounced at 600 ms on amount and token changes
  • Adds form | confirm | signing | submitting | done | error step states to the screen
  • The confirm screen shows the quoted output, price impact, route and slippage before the user commits
  • On execute: lib/soroswap.buildSoroswapSwapXdr builds the unsigned XDR, then lib/walletConnect.signXdrPayload (newly exported) simulates, signs each Soroban auth entry with the device passkey via lib/passkey.registerPasskeySigner, assembles with the fee-payer keypair, and returns the signed XDR ready to submit
  • The signing state is active during the biometric prompt; submitting is active during broadcast and polling (30 x 1 s)
  • All network values come from lib/network.getNetwork; wallet address from lib/walletStore.getWalletAddress
  • Presentation uses the existing components/ui (Screen, Card, Button) and theme/ tokens throughout

What changed in lib/walletConnect.ts

signXdrPayload was private. Made it export so swap.tsx can drive signing independently from submission, splitting the two UI states.

Test plan

  • Open swap screen: token selectors, flip button and amount input render as before
  • Enter an amount: quote appears in YOU RECEIVE after 600 ms; quote card shows rate, price impact, route
  • Enter an amount with no liquidity: error message in quote card; Review swap stays disabled
  • Tap Review swap: confirm screen shows summary with correct values
  • Tap Confirm swap: biometric sheet appears (signing state)
  • Approve biometric: submitting spinner, then done screen with tx hash snippet
  • Decline biometric: error state shows "Passkey authentication was declined" with Try again button
  • Tap Try again: returns to form with existing inputs intact

Closes #474

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

@collinsezedike is attempting to deploy a commit to the miracle656's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

46. Swap execute + sign

1 participant