mirror of
https://github.com/luxfi/mpc.git
synced 2026-09-24 00:26:24 +00:00
Complete MPC wallet management platform rivaling Fireblocks/Utila/Fordefi: Backend (Go): - REST API with 60+ endpoints on chi router (pkg/api/) - PostgreSQL schema with 13 tables (pkg/db/) - JWT + MFA auth, bcrypt passwords, API key management - Policy engine (deny/approve/require_approval) - Transaction signing flow with approval workflow - Subscription scheduler for recurring payments - Payment requests with public pay pages - Safe + ERC-4337 smart wallet integration (pkg/smart/) - Rate limiting, webhook delivery (HMAC-SHA256), audit logging - 27 passing tests (auth, policy engine, middleware) Frontend (Next.js 14): - 27 routes with monochrome dark theme (Tailwind + Geist fonts) - Full API client with JWT auto-refresh - React Query hooks for all resources - Pages: dashboard, vaults, wallets, transactions, policies, whitelist, team, settings, API keys, webhooks, audit, subscriptions, payments, smart wallets Infrastructure: - Dockerfiles for API (Go) and dashboard (Next.js standalone) - compose.yml for local development (PostgreSQL + API + dashboard) - K8s manifests for mpc.lux.network + cloud.lux.network - GitHub Actions deploy workflow (build → push GHCR → kubectl apply) - TLS via cert-manager, Traefik IngressRoute for both domains
75 lines
2.7 KiB
TypeScript
75 lines
2.7 KiB
TypeScript
import Link from 'next/link'
|
|
|
|
export interface PaymentRequest {
|
|
id: string
|
|
merchantName: string
|
|
recipientAddress: string
|
|
chain: string
|
|
amount: string
|
|
status: 'open' | 'paid' | 'expired' | 'cancelled'
|
|
expiresAt: string
|
|
createdAt: string
|
|
}
|
|
|
|
export interface PaymentRequestTableProps {
|
|
requests: PaymentRequest[]
|
|
}
|
|
|
|
const statusColors: Record<string, string> = {
|
|
open: 'bg-blue-600/20 text-blue-400',
|
|
paid: 'bg-green-600/20 text-green-500',
|
|
expired: 'bg-zinc-600/20 text-zinc-400',
|
|
cancelled: 'bg-red-600/20 text-red-400',
|
|
}
|
|
|
|
export function PaymentRequestTable({ requests }: PaymentRequestTableProps) {
|
|
if (requests.length === 0) {
|
|
return (
|
|
<div className="rounded-lg border border-border p-8 text-center text-sm text-muted-foreground">
|
|
No payment requests found.
|
|
</div>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<div className="overflow-x-auto rounded-lg border border-border">
|
|
<table className="w-full text-sm">
|
|
<thead>
|
|
<tr className="border-b border-border bg-muted/50">
|
|
<th className="px-4 py-3 text-left font-medium text-muted-foreground">Merchant</th>
|
|
<th className="px-4 py-3 text-left font-medium text-muted-foreground">Recipient</th>
|
|
<th className="px-4 py-3 text-left font-medium text-muted-foreground">Chain</th>
|
|
<th className="px-4 py-3 text-right font-medium text-muted-foreground">Amount</th>
|
|
<th className="px-4 py-3 text-left font-medium text-muted-foreground">Status</th>
|
|
<th className="px-4 py-3 text-right font-medium text-muted-foreground">Expires</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{requests.map((req) => (
|
|
<tr key={req.id} className="border-b border-border last:border-0 hover:bg-muted/20">
|
|
<td className="px-4 py-3">
|
|
<Link href={`/payments/${req.id}`} className="font-medium hover:underline">
|
|
{req.merchantName || 'Unnamed'}
|
|
</Link>
|
|
</td>
|
|
<td className="px-4 py-3 font-mono text-xs">
|
|
<span className="truncate block max-w-[140px]">{req.recipientAddress}</span>
|
|
</td>
|
|
<td className="px-4 py-3">{req.chain}</td>
|
|
<td className="px-4 py-3 text-right font-mono">{req.amount}</td>
|
|
<td className="px-4 py-3">
|
|
<span className={`rounded-full px-2 py-0.5 text-xs font-medium ${statusColors[req.status] ?? ''}`}>
|
|
{req.status}
|
|
</span>
|
|
</td>
|
|
<td className="px-4 py-3 text-right text-muted-foreground">
|
|
{new Date(req.expiresAt).toLocaleString()}
|
|
</td>
|
|
</tr>
|
|
))}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
)
|
|
}
|