You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Transaction flows (loan wizard final signature, lend deposit and withdraw, repay, send remittance) each handle build, sign, submit, and confirmation slightly differently, and error handling is scattered. A single, well tested transaction state machine with a shared error taxonomy reduces dropped or double-submitted transactions and makes every money flow feel consistent.
Acceptance criteria
Introduce a shared transaction lifecycle (idle, building, awaiting-signature, submitting, confirming, success, error) used by all flows
Centralize error mapping in transactionErrors.ts (user rejected, insufficient fee, timeout, sequence, contract error) and show actionable messages
Guarantee idempotency so a double click or retry cannot submit twice
Reflect confirmation via the existing confirmation hook and invalidate the right queries on success
Unit tests for the state machine and error mapping
Why this matters
Transaction flows (loan wizard final signature, lend deposit and withdraw, repay, send remittance) each handle build, sign, submit, and confirmation slightly differently, and error handling is scattered. A single, well tested transaction state machine with a shared error taxonomy reduces dropped or double-submitted transactions and makes every money flow feel consistent.
Acceptance criteria
transactionErrors.ts(user rejected, insufficient fee, timeout, sequence, contract error) and show actionable messagesFiles to touch
src/app/hooks/useContractMutation.ts,src/app/hooks/useConfirmedMutation.ts,src/app/hooks/useTransactionPreview.tssrc/app/utils/transactionErrors.ts,src/app/utils/transactionFormatter.tssrc/app/components/loan-wizard/StepFinalSignature.tsxsrc/app/[locale]/lend/LendPageClient.tsx,src/app/[locale]/repay/[loanId]/page.tsx,src/app/[locale]/send-remittance/Out of scope