Description
Pool creation and donation both follow the same XDR round-trip pattern:
- Call API to get unsigned XDR
- Ask Freighter to sign it
- Submit signed XDR back to the API
- Show pending → success / error state
Without a shared hook this state logic will be copy-pasted into both pools/new/page.tsx and DonateModal.tsx, making it hard to fix consistently.
Deliverables
Notes
Depends on: #721 (XDR signing step for pool creation), #726 (donate function in API client)
Description
Pool creation and donation both follow the same XDR round-trip pattern:
Without a shared hook this state logic will be copy-pasted into both
pools/new/page.tsxandDonateModal.tsx, making it hard to fix consistently.Deliverables
nevo_frontend/hooks/useXdrTransaction.tsthat exposes:submit(getXdr: () => Promise<string>, submitXdr: (signed: string) => Promise<string>)handles the full flowsignTransactioninternally (fromlib/stellar.ts)txHashon success,errorstring on failurenpm run buildpasses with the hook in place (even if not yet wired to forms)Notes
Depends on: #721 (XDR signing step for pool creation), #726 (donate function in API client)