diff --git a/src/app/api/pnl/route.ts b/src/app/api/pnl/route.ts index d2a84d9..6290926 100644 --- a/src/app/api/pnl/route.ts +++ b/src/app/api/pnl/route.ts @@ -47,4 +47,7 @@ export async function GET() { return NextResponse.json(data); } +<<<<<<< HEAD +======= // Maintenance: minor update +>>>>>>> upstream/main diff --git a/src/app/api/upload/route.ts b/src/app/api/upload/route.ts index e32a022..4fee8bd 100644 --- a/src/app/api/upload/route.ts +++ b/src/app/api/upload/route.ts @@ -28,4 +28,7 @@ export async function POST(request: NextRequest) { ); } +<<<<<<< HEAD +======= // Maintenance: minor update +>>>>>>> upstream/main diff --git a/src/app/page.tsx b/src/app/page.tsx index db906f5..d44e798 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -40,10 +40,19 @@ import Icon from "../components/ui/Icon"; * Manages high-level state for wallet connection, active tabs, and invoice data. */ export default function Page() { +<<<<<<< HEAD + // --- Component State --- + /** The public Stellar address of the connected user */ + const [address, setAddress] = useState(""); + /** List of invoices fetched from the backend pipeline */ + const [invoices, setInvoices] = useState([]); + /** Loading state for initial data fetch */ +======= const router = useRouter(); const searchParams = useSearchParams(); const { isConnected, walletAddress, isConnecting } = useWalletConnection(); const [invoices, setInvoices] = useState([]); +>>>>>>> upstream/main const [loading, setLoading] = useState(false); /** Controls visibility of the Invoice Minting modal */ const [showMintForm, setShowMintForm] = useState(false); @@ -56,6 +65,16 @@ export default function Page() { const { toggleWatchlist, isInWatchlist } = useWatchlist(); const riskSocketRef = useRef(null); +<<<<<<< HEAD + // --- Handlers --- + + /** + * Triggers the Stellar wallet connection flow. + * Supports multiple providers via the stellar-wallets-kit. + * + * @param {WalletType} walletType - The ID of the wallet provider (e.g., Freighter). + */ +======= // Initialize filters from URL params const [filters, setFilters] = useState(() => ({ minApy: parseFloat(searchParams.get('minApy') || '0'), @@ -77,11 +96,38 @@ export default function Page() { // 1. Connect Stellar Wallet (supports Freighter, Albedo, xBull) +>>>>>>> upstream/main const handleConnectWallet = async (walletType: WalletType) => { try { const userInfo = await connectWallet(walletType); if (userInfo && userInfo.publicKey) { setAddress(userInfo.publicKey); +<<<<<<< HEAD + console.log("[Dashboard] Wallet connected:", userInfo.publicKey, "Provider:", userInfo.walletType); + } + } catch (e: any) { + console.error("[Dashboard] Connection failed:", e.message); + // In production, this would be a user-friendly toast notification + alert(e.message || "Failed to connect to wallet."); + } + }; + + /** + * Fetches the latest verified assets from the RWA pipeline. + * Currently points to a local mock API for development. + */ + const fetchInvoices = async () => { + setLoading(true); + try { + // TODO: Replace with environment-aware API base URL + const res = await fetch("http://localhost:3000/invoices"); + const data = await res.json(); + setInvoices(data); + } catch (e) { + console.warn("[Dashboard] Asset pipeline API not reachable. Check if local server is running."); + } finally { + setLoading(false); +======= console.log("Wallet connected:", userInfo.publicKey, "Type:", userInfo.walletType); showSuccess("Wallet connected"); } @@ -89,6 +135,7 @@ export default function Page() { const error = e as Error; console.error("Connection failed:", error.message); showError(error.message || "Failed to connect to wallet."); +>>>>>>> upstream/main } }; @@ -118,6 +165,24 @@ export default function Page() { }; }, []); +<<<<<<< HEAD + /** + * Debugging utility for testing transaction status notifications. + */ + const handleTestToast = () => { + const toast = useTransactionToast(); + toast.loading(); + setTimeout(() => toast.success(), 2000); + }; + + /** + * Callback triggered when a new invoice is successfully submitted for minting. + * + * @param {any} data - The validated invoice metadata. + */ + const handleInvoiceMint = (data: any) => { + console.log("[Dashboard] Mint request received:", data); +======= useEffect(() => { if (!walletAddress) { riskSocketRef.current?.disconnect(); @@ -163,6 +228,7 @@ export default function Page() { const handleInvoiceMint = (data: Record) => { console.log("Invoice data received:", data); +>>>>>>> upstream/main setShowMintForm(false); // TODO: Initiate Soroban contract call for minting the NFT }; @@ -172,7 +238,11 @@ export default function Page() { /** Tab definitions for the main navigation */ const tabs = [ { id: "dashboard", label: "Dashboard" }, +<<<<<<< HEAD + { id: "watchlist", label: "Watchlist", icon: