docs: Task #9 confirmation thresholds + PRD AC updates + API docs

- Update Activity Log with backend@441c8be, frontend@717d5c8
- Update PRD §3 acceptance criteria for Task #9
- Update Payment API.md with confirmation-threshold and awaiting-confirmation endpoints
This commit is contained in:
Siavash Sameni
2026-05-28 20:13:15 +04:00
parent f5e1106e77
commit fd2aa71ef4
3 changed files with 71 additions and 3 deletions

View File

@@ -464,6 +464,62 @@ Same result shape as above, but for a single destination.
Escrow state (`escrowState`): `unfunded``funded``released` | `refunded`.
## Confirmation thresholds (admin)
### `GET /api/admin/settings/confirmation-thresholds`
**Auth:** Admin only
**Response 200:**
```json
{
"success": true,
"data": [
{ "chainId": 56, "threshold": 12, "source": "default" },
{ "chainId": 1, "threshold": 3, "source": "config" }
]
}
```
### `PATCH /api/admin/settings/confirmation-thresholds/:chainId`
**Auth:** Admin only
**Body:** `{ "threshold": 3 }`
**Description:** Updates the runtime confirmation threshold for a chain. The in-memory cache is invalidated immediately so the next `TransactionSafetyProvider` evaluation uses the new value.
**Response 200:**
```json
{
"success": true,
"message": "Confirmation threshold for chain 56 updated to 3",
"data": { "chainId": 56, "threshold": 3 }
}
```
## Payments awaiting confirmation (admin)
### `GET /api/admin/payments/awaiting-confirmation`
**Auth:** Admin only
**Query:** `page`, `limit`, `chainId` (optional)
**Description:** Lists payments that have an on-chain transaction hash but have not yet reached sufficient confirmations (i.e. `metadata.transactionSafety.status === 'pending'` or `escrowState` is not funded/released/refunded).
**Response 200:**
```json
{
"success": true,
"data": [
{
"_id": "...",
"paymentId": "...",
"status": "pending",
"amount": { "amount": 12.5, "currency": "USDC" },
"blockchain": { "network": "bsc", "transactionHash": "0x...", "confirmations": 3 },
"metadata": { "transactionSafety": { "status": "pending", "checks": [...] } },
"createdAt": "2026-05-28T..."
}
],
"pagination": { "page": 1, "limit": 25, "total": 4, "totalPages": 1 }
}
```
## Request Network multichain registry (admin)
### `GET /api/admin/rn/networks`