Why this matters now
Token sending is a shipped feature powering real ECO / XLM payments. There is no confirmation dialog before signAndSubmitPayment or openLobstrForPayment is called. A single accidental tap, a mis-pasted address, or a wrong amount results in an irreversible on-chain transaction with no recourse. This is a UX-level security issue — the severity is higher than it first appears because in-app wallet users have no hardware confirmation step (unlike Ledger), and Lobstr's own confirmation dialog may be dismissed without reading.
Problem / What
src/screens/SendTokensScreen.tsx — handleSend:
const handleSend = useCallback(async () => {
// validates inputs...
setIsSending(true);
try {
// ... directly calls signAndSubmitPayment or openLobstrForPayment
// No Alert.confirm or confirmation screen shown first
}
}, [...]);
The fix is to show a confirmation Alert (React Native's Alert.alert with "Cancel" and "Confirm" buttons) after validation passes, displaying the destination, amount, and asset, before setIsSending(true) is called. For in-app wallets, the confirmation must appear before signPaymentXDR is called (signing is also irreversible in the sense that signed XDRs should not be left floating).
Key Challenges
Acceptance Criteria
Relevant files / functions
src/screens/SendTokensScreen.tsx — handleSend
src/services/stellar.ts — signAndSubmitPayment
src/services/lobstr.ts — openLobstrForPayment
Out of scope
- Implementing a dedicated "Review Transaction" screen (the
Alert is sufficient for v0.3).
- Fee estimation display.
Why this matters now
Token sending is a shipped feature powering real ECO / XLM payments. There is no confirmation dialog before
signAndSubmitPaymentoropenLobstrForPaymentis called. A single accidental tap, a mis-pasted address, or a wrong amount results in an irreversible on-chain transaction with no recourse. This is a UX-level security issue — the severity is higher than it first appears because in-app wallet users have no hardware confirmation step (unlike Ledger), and Lobstr's own confirmation dialog may be dismissed without reading.Problem / What
src/screens/SendTokensScreen.tsx—handleSend:The fix is to show a confirmation
Alert(React Native'sAlert.alertwith "Cancel" and "Confirm" buttons) after validation passes, displaying the destination, amount, and asset, beforesetIsSending(true)is called. For in-app wallets, the confirmation must appear beforesignPaymentXDRis called (signing is also irreversible in the sense that signed XDRs should not be left floating).Key Challenges
Alert.alertis async (callback-based) — the existinguseCallbackpattern must be preserved;handleSendshould become a two-stage function or use a localconfirmedstate.SendTokensScreentest coverage is zero (issue [Testing] Zero test coverage forSendTokensScreen— payment signing and Lobstr delegation #82 is open) — add the confirmation tests as part of this issue or coordinate with [Testing] Zero test coverage forSendTokensScreen— payment signing and Lobstr delegation #82.openLobstrForPaymentis called.Acceptance Criteria
Alertappears after input validation with: truncated destination, full amount, asset name.isSendingtofalse.SendTokensScreen— payment signing and Lobstr delegation #82 test file once that issue is worked): confirm dialog is shown, cancel aborts the send, confirm proceeds.Relevant files / functions
src/screens/SendTokensScreen.tsx—handleSendsrc/services/stellar.ts—signAndSubmitPaymentsrc/services/lobstr.ts—openLobstrForPaymentOut of scope
Alertis sufficient for v0.3).