fix: withdrawal end-to-end flow and UI improvements

- requestWithdraw() calls process-withdraw edge function for full flow
  (lock balance + blockchain TX + complete) instead of just DB lock
- Remove pending request block from withdrawal validation — backend
  already enforces available_balance with FOR UPDATE row lock
- Pending requests shown as info alert instead of blocking error
- Balance card: numbers right-aligned, 2 decimal places
This commit is contained in:
2026-02-23 22:32:58 +03:00
parent b839a1834d
commit 2150ab4997
+3 -9
View File
@@ -154,12 +154,6 @@ export function WithdrawModal({ isOpen, onClose, onSuccess }: WithdrawModalProps
return t('p2pWithdraw.invalidAddress');
}
// Check for pending requests
const hasPendingForToken = pendingRequests.some(r => r.token === token);
if (hasPendingForToken) {
return t('p2pWithdraw.pendingForToken', { token });
}
return null;
};
@@ -291,10 +285,10 @@ export function WithdrawModal({ isOpen, onClose, onSuccess }: WithdrawModalProps
</Alert>
)}
{/* Pending Requests Warning */}
{/* Pending Requests Info */}
{pendingRequests.length > 0 && (
<Alert variant="destructive">
<AlertTriangle className="h-4 w-4" />
<Alert>
<Info className="h-4 w-4" />
<AlertDescription>
{t('p2pWithdraw.pendingWarning', { count: pendingRequests.length })}
</AlertDescription>