mirror of
https://github.com/LORDBABUINO/stealth.git
synced 2026-04-28 08:29:59 -07:00
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:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user