Feat: Wire frontend to backend, add wallet API endpoints

- Replace frontend mock with real fetch calls to POST /api/wallet/analyze and GET /api/wallet/{id}/utxos
- Add Vite dev proxy for /api to avoid CORS in development
- Implement WalletResource.java with the two endpoints
- Add WalletMockData.java with the 5-UTXO dataset
- Configure CORS and port in application.properties
- Add backend/requests/wallet.http with kulala tests (29 assertions, all passing)
This commit is contained in:
LORDBABUINO
2026-02-26 23:14:19 -03:00
parent e6a8e77134
commit 1f7ecf321c
5 changed files with 207 additions and 4 deletions

View File

@@ -1,6 +1,13 @@
import { mockReport } from '../mocks/mockData'
export const analyzeWallet = async (descriptor) => {
await new Promise((r) => setTimeout(r, 4000))
return mockReport
const res1 = await fetch('/api/wallet/analyze', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ descriptor }),
})
if (!res1.ok) throw new Error('Analysis request failed')
const { analysisId } = await res1.json()
const res2 = await fetch(`/api/wallet/${analysisId}/utxos`)
if (!res2.ok) throw new Error('Failed to fetch report')
return res2.json()
}