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
77 lines
2.7 KiB
TypeScript
77 lines
2.7 KiB
TypeScript
'use client'
|
|
|
|
export interface ReshareWizardProps {
|
|
step: 'configuring' | 'confirming' | 'resharing' | 'complete' | 'error'
|
|
threshold: number
|
|
participants: string[]
|
|
error?: string
|
|
}
|
|
|
|
export function ReshareWizard({ step, threshold, participants, error }: ReshareWizardProps) {
|
|
const steps = ['Configure', 'Confirm', 'Reshare', 'Complete']
|
|
const stepIndex = { configuring: 0, confirming: 1, resharing: 2, complete: 3, error: 2 }
|
|
|
|
const current = stepIndex[step]
|
|
|
|
return (
|
|
<div className="space-y-6">
|
|
{/* Step indicators */}
|
|
<div className="flex items-center justify-between">
|
|
{steps.map((label, i) => (
|
|
<div key={label} className="flex items-center gap-2">
|
|
<div
|
|
className={`flex h-7 w-7 items-center justify-center rounded-full text-xs font-medium ${
|
|
i < current
|
|
? 'bg-primary text-primary-foreground'
|
|
: i === current
|
|
? 'border-2 border-primary text-primary'
|
|
: 'border border-border text-muted-foreground'
|
|
}`}
|
|
>
|
|
{i < current ? '\u2713' : i + 1}
|
|
</div>
|
|
<span
|
|
className={`hidden text-xs sm:inline ${
|
|
i <= current ? 'text-foreground' : 'text-muted-foreground'
|
|
}`}
|
|
>
|
|
{label}
|
|
</span>
|
|
{i < steps.length - 1 && (
|
|
<div
|
|
className={`mx-2 hidden h-px w-8 sm:block ${
|
|
i < current ? 'bg-primary' : 'bg-border'
|
|
}`}
|
|
/>
|
|
)}
|
|
</div>
|
|
))}
|
|
</div>
|
|
|
|
{/* Reshare progress */}
|
|
{step === 'resharing' && (
|
|
<div className="rounded-lg border border-border bg-card p-6 text-center space-y-4">
|
|
<div className="mx-auto h-5 w-5 animate-spin rounded-full border-2 border-primary border-t-transparent" />
|
|
<p className="text-sm font-medium">Resharing Key Shares</p>
|
|
<p className="text-xs text-muted-foreground">
|
|
Rotating to {threshold}-of-{participants.length} configuration.
|
|
All participants must remain online.
|
|
</p>
|
|
<div className="space-y-1 text-xs text-muted-foreground">
|
|
{participants.map((p) => (
|
|
<p key={p} className="font-mono">{p}</p>
|
|
))}
|
|
</div>
|
|
</div>
|
|
)}
|
|
|
|
{step === 'error' && (
|
|
<div className="rounded-lg border border-destructive/30 bg-destructive/10 p-6 text-center">
|
|
<p className="text-sm font-medium text-destructive">Reshare Failed</p>
|
|
{error && <p className="mt-1 text-xs text-destructive/80">{error}</p>}
|
|
</div>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|