Skip to content

feat(mobile): send — build, sign, submit + poll - #589

Open
kaylachi wants to merge 1 commit into
Miracle656:mainfrom
kaylachi:feat/mobile-send-passkey-submit
Open

feat(mobile): send — build, sign, submit + poll#589
kaylachi wants to merge 1 commit into
Miracle656:mainfrom
kaylachi:feat/mobile-send-passkey-submit

Conversation

@kaylachi

Copy link
Copy Markdown

Summary

Implements the send flow (backlog #37 / #465): build the transfer, authorize it, submit, and poll for the result. Two destinations, mirroring the web send path (frontend/wallet/app/send/page.tsx, lib/sorobanTx.ts):

  • Classic G… recipient → a Horizon native XLM payment.
  • C… contract recipient → a native-SAC transfer over Soroban RPC: simulate → assemble → sign → submit → poll getTransaction to a terminal status (success returns the hash; failure/timeout throw).

Added

  • lib/sendPayment.tssendPayment(recipient, amount, signer) plus the pure pieces it's built from: validateSend, isClassicAddress, toStroops, and pollForResult (injectable clock).
  • app/send.tsx — recipient + amount inputs with authorizing → submitting → done (tx hash) / error states.
  • lib/signer.ts — the signer seam.

The passkey signer

The signer that authorizes and pays is injected as WalletSigner, keeping the flow testable and free of native code. Its one native dependency is the passkey-derived key — and on this wallet the signer secret is never persisted (see lib/backup.ts, which refuses secret material); it must be produced live from the device passkey. React Native has no passkey/WebAuthn module wired yet, so requireSigner() fails closed with a typed SignerUnavailableError (consistent with the existing mobile-port stubs, e.g. bulk-payout). The rest of the flow is complete — returning a real signer from that one function is all that's needed to confirm payments on testnet.

Testing

  • tsc --noEmit
  • jest lib/__tests__/sendPayment.test.ts ✅ (10/10 — validation, address classification, stroop conversion, and the poll's success / failure / timeout terminal handling)

Closes #465

Add the send screen and its transaction flow. `lib/sendPayment.ts` ports
the web send path: a classic G… recipient goes through a Horizon native
payment; a C… contract goes through the native-SAC transfer over Soroban
RPC — simulate, assemble, sign, submit, then poll getTransaction to a
terminal status (success returns the hash, failure/timeout throw).
`app/send.tsx` drives it with recipient/amount inputs and authorizing →
submitting → done (tx hash) / error states.

The signer that authorizes and pays is injected as WalletSigner, so the
flow stays testable and free of native code. Its one native dependency —
the passkey-derived key, whose secret is never persisted (see backup.ts)
— is isolated behind requireSigner in `lib/signer.ts`, which fails closed
with a typed SignerUnavailableError until the mobile passkey module is
wired. Swapping in a real signer there is the only change needed to
confirm payments on testnet.

Closes Miracle656#465
@kaylachi
kaylachi requested a review from Miracle656 as a code owner July 29, 2026 18:10
@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@kaylachi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

37. Send — passkey sign + submit

1 participant