feat(mobile): send — build, sign, submit + poll - #589
Open
kaylachi wants to merge 1 commit into
Open
Conversation
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 is attempting to deploy a commit to the miracle656's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@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! 🚀 |
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.
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):G…recipient → a Horizon native XLM payment.C…contract recipient → a native-SACtransferover Soroban RPC: simulate → assemble → sign → submit → pollgetTransactionto a terminal status (success returns the hash; failure/timeout throw).Added
lib/sendPayment.ts—sendPayment(recipient, amount, signer)plus the pure pieces it's built from:validateSend,isClassicAddress,toStroops, andpollForResult(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 (seelib/backup.ts, which refuses secret material); it must be produced live from the device passkey. React Native has no passkey/WebAuthn module wired yet, sorequireSigner()fails closed with a typedSignerUnavailableError(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