Skip to content

[Frontend] JSDoc on useDepositToPool/useWithdrawFromPool/useRepayLoan claims it performs the action, but the mutationFn only builds an unsigned XDR #1224

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

useDepositToPool is documented Deposits to the lending pool with optimistic UI update (useApi.ts:1564) but its mutationFn only POSTs /pool/build-deposit and returns { unsignedTxXdr, networkPassphrase } (useApi.ts:1580-1584) - no deposit happens until sign+submit via useDepositOperation. Same misleading framing on useWithdrawFromPool (1639) and the optimistic block of useRepayLoan. This doc gap directly feeds the already-known bug where optimistic balances bump on build success rather than signed submit.

Acceptance criteria

  • Document that these hooks only build a transaction and must be paired with signTransaction + submitPoolTransaction/submitLoanTransaction (see useDepositOperation)
  • Clarify when the optimistic update is intended to fire and that callers should not treat mutation success as confirmation
  • Cross-link the build/sign/submit sequence in the hooks header doc

Files to touch

  • frontend/src/app/hooks/useApi.ts

Out of scope

  • Fixing the optimistic-timing bug itself (already filed)

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programdocsDocumentationdocumentationImprovements or additions to documentationfrontendIssues related to frontend development

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions