diff --git a/frontend/app/betting/page.tsx b/frontend/app/betting/page.tsx deleted file mode 100644 index df66604..0000000 --- a/frontend/app/betting/page.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import BettingInterface from "@/components/betting-interface"; - -export default function Home() { - return ( -
-
- -
-
- ); -} diff --git a/frontend/app/layout.tsx b/frontend/app/layout.tsx index 6ce4e25..f7fa87e 100644 --- a/frontend/app/layout.tsx +++ b/frontend/app/layout.tsx @@ -1,7 +1,6 @@ import type { Metadata } from "next"; import { Geist, Geist_Mono } from "next/font/google"; import "./globals.css"; -import { Providers } from "./providers"; const geistSans = Geist({ variable: "--font-geist-sans", @@ -28,7 +27,7 @@ export default function RootLayout({ - {children} + {children} ); diff --git a/frontend/app/providers.tsx b/frontend/app/providers.tsx deleted file mode 100644 index e78f6db..0000000 --- a/frontend/app/providers.tsx +++ /dev/null @@ -1,16 +0,0 @@ -"use client"; - -import type { ReactNode } from "react"; -import { StarknetConfig } from "@starknet-react/core"; -import { useStarknetConfig } from "@/hooks/use-starknet-connect"; - -interface ProvidersProps { - children: ReactNode; -} - -export function Providers({ children }: ProvidersProps) { - // Get the complete Starknet configuration from our hook - const starknetConfig = useStarknetConfig(); - - return {children}; -} diff --git a/frontend/components/betting-interface.tsx b/frontend/components/betting-interface.tsx deleted file mode 100644 index 21bb64e..0000000 --- a/frontend/components/betting-interface.tsx +++ /dev/null @@ -1,259 +0,0 @@ -"use client"; - -import { useState, useEffect } from "react"; -import { useAccount } from "@starknet-react/core"; -import { WalletConnectButton } from "@/components/wallet-connect-button"; -import { Loader2, CheckCircle, XCircle } from "lucide-react"; -import type { Agent } from "@/types/betting"; -import { useBetting } from "@/hooks/use-betting"; -import { getAgents } from "@/lib/starknet"; -import Image from "next/image"; - -export default function BettingInterface() { - const { address, isConnected } = useAccount(); - const [agents, setAgents] = useState([]); - const [selectedAgent, setSelectedAgent] = useState(null); - const [betAmount, setBetAmount] = useState("0.01"); - const { placeBet, transactions, isLoading } = useBetting(); - - useEffect(() => { - const loadAgents = async () => { - try { - const agentData = await getAgents(); - setAgents(agentData); - } catch (error) { - console.error("Failed to load agents:", error); - } - }; - - if (isConnected) { - loadAgents(); - } - }, [isConnected]); - - const handleBetSubmit = async () => { - if (!selectedAgent) { - alert("Please select an agent to place your bet."); - return; - } - - if (!betAmount || Number.parseFloat(betAmount) <= 0) { - alert("Please enter a valid bet amount."); - return; - } - - try { - await placeBet(selectedAgent.id, betAmount); - setBetAmount("0.01"); - } catch (error) { - console.error("Failed to place bet:", error); - } - }; - - return ( -
-
-

- PVPVAI ARENA -

- -
- - {!isConnected ? ( -
-

- Connect Your Wallet -

-

- Connect your StarkNet wallet to start placing bets on AI agents. -

- -
- ) : ( -
-
-
-

- Place Your Bets -

-
- {agents.map((agent) => ( -
setSelectedAgent(agent)} - > -
-
- {agent.name} -
-

- {agent.name} -

-
-
66 - ? "bg-green-400" - : agent.performance > 33 - ? "bg-yellow-400" - : "bg-red-400" - } rounded-full`} - style={{ width: `${agent.performance}%` }} - /> -
-
-
- ))} -
- - {selectedAgent && ( -
-

- Betting on: {selectedAgent.name} -

- -
- -
- setBetAmount(e.target.value)} - min="0.001" - step="0.001" - className={` - bg-gray-700 border-2 border-gray-500 - font-pixel text-white px-3 py-2 rounded - focus:border-green-400 focus:ring-1 focus:ring-green-400 - focus:outline-none - hover:border-gray-400 - shadow-[0_2px_4px_rgba(0,0,0,0.25)] - transition-all - w-full - `} - /> - -
-
-
- )} -
-
- -
-
-

- Transaction History -

-
- {transactions.length > 0 ? ( - transactions.map((tx) => ( -
-
- {tx.status === "confirmed" ? ( - - ) : tx.status === "failed" ? ( - - ) : ( - - )} - -
-

- {tx.message} -

-
-

- {tx.status === "pending" - ? "Processing..." - : tx.status === "confirmed" - ? "Confirmed" - : "Failed"} -

-

- {new Date(tx.timestamp).toLocaleTimeString()} -

-
- {tx.status === "confirmed" && ( -

- Tx: {tx.hash.substring(0, 10)}... - {tx.hash.substring(tx.hash.length - 6)} -

- )} -
-
-
- )) - ) : ( -

- No transactions yet. Place a bet to get started! -

- )} -
-
- -
-

- Wallet Info -

-
-

- Address:{" "} - {address} -

-

- Network: StarkNet -

-
-
-
-
- )} -
- ); -} diff --git a/frontend/components/wallet-connect-button.tsx b/frontend/components/wallet-connect-button.tsx deleted file mode 100644 index 3afffbf..0000000 --- a/frontend/components/wallet-connect-button.tsx +++ /dev/null @@ -1,144 +0,0 @@ -"use client"; - -import { useState, useEffect, useRef } from "react"; -import { - useAccount, - useConnect, - useDisconnect, - type Connector, -} from "@starknet-react/core"; -import { WalletConnectModal } from "./wallet-connect-modal"; -import { Wallet } from "lucide-react"; -// import { Button } from "@/components/ui/button"; -import { WalletDropdown } from "./wallet-dropdown"; -import { truncateAddress } from "@/utils/wallet"; - -export function WalletConnectButton() { - const [isModalOpen, setIsModalOpen] = useState(false); - const [isDropdownOpen, setIsDropdownOpen] = useState(false); - const [isConnecting, setIsConnecting] = useState(false); - const [connectionError, setConnectionError] = useState(null); - const dropdownTimeoutRef = useRef(null); - - const { address, isConnected } = useAccount(); - const { connect, connectors } = useConnect(); - const { disconnect } = useDisconnect(); - - const handleConnect = () => { - if (isConnected) { - setIsDropdownOpen(!isDropdownOpen); - } else { - setIsModalOpen(true); - setConnectionError(null); - } - }; - - const handleDisconnect = () => { - disconnect(); - setIsDropdownOpen(false); - localStorage.removeItem("lastUsedConnector"); - }; - - const handleConnectorSelect = async (connector: Connector) => { - if (!connector) return; - - setIsConnecting(true); - setConnectionError(null); - - try { - await connect({ connector }); - - if (connector.id) { - localStorage.setItem("lastUsedConnector", connector.id); - } - - // Only close modal after successful connection - setIsModalOpen(false); - } catch (error) { - const errorMessage = - error instanceof Error ? error.message : "Failed to connect wallet"; - console.error("Wallet connection error:", errorMessage); - setConnectionError(errorMessage); - } finally { - setIsConnecting(false); - } - }; - - // Handle dropdown hover behavior - const handleMouseEnter = () => { - if (isConnected) { - if (dropdownTimeoutRef.current) { - clearTimeout(dropdownTimeoutRef.current); - dropdownTimeoutRef.current = null; - } - setIsDropdownOpen(true); - } - }; - - const handleMouseLeave = () => { - if (dropdownTimeoutRef.current) { - clearTimeout(dropdownTimeoutRef.current); - } - - dropdownTimeoutRef.current = setTimeout(() => { - setIsDropdownOpen(false); - }, 300); - }; - - // Listen for wallet_disconnected events - useEffect(() => { - const handleWalletDisconnected = () => { - setIsDropdownOpen(false); - }; - - window.addEventListener("wallet_disconnected", handleWalletDisconnected); - - return () => { - window.removeEventListener( - "wallet_disconnected", - handleWalletDisconnected - ); - - if (dropdownTimeoutRef.current) { - clearTimeout(dropdownTimeoutRef.current); - } - }; - }, []); - - return ( -
- {/* Connect Button */} - - - {/* Wallet Connect Modal */} - !isConnecting && setIsModalOpen(false)} - connectors={connectors || []} - onSelect={handleConnectorSelect} - isConnecting={isConnecting} - connectionError={connectionError} - /> - - {/* Wallet Dropdown */} - {isConnected && address && ( - setIsDropdownOpen(false)} - address={address} - onDisconnect={handleDisconnect} - /> - )} -
- ); -} diff --git a/frontend/components/wallet-connect-modal.tsx b/frontend/components/wallet-connect-modal.tsx deleted file mode 100644 index 51a18dd..0000000 --- a/frontend/components/wallet-connect-modal.tsx +++ /dev/null @@ -1,296 +0,0 @@ -"use client"; - -import { useEffect, useRef } from "react"; -import { X, Loader2, Download, ExternalLink } from "lucide-react"; -import Image from "next/image"; -import type { Connector } from "@starknet-react/core"; -import Link from "next/link"; - -interface WalletConnectModalProps { - isOpen: boolean; - onClose: () => void; - connectors: Connector[]; - onSelect: (connector: Connector) => void; - isConnecting: boolean; - connectionError: string | null; -} - -export function WalletConnectModal({ - isOpen, - onClose, - connectors, - onSelect, - isConnecting, - connectionError, -}: WalletConnectModalProps) { - const modalRef = useRef(null); - - // Close modal when clicking outside - useEffect(() => { - const handleClickOutside = (event: MouseEvent) => { - if ( - modalRef.current && - !modalRef.current.contains(event.target as Node) - ) { - onClose(); - } - }; - - if (isOpen && !isConnecting) { - document.addEventListener("mousedown", handleClickOutside); - // Prevent scrolling when modal is open - document.body.style.overflow = "hidden"; - } - - return () => { - document.removeEventListener("mousedown", handleClickOutside); - document.body.style.overflow = "auto"; - }; - }, [isOpen, onClose, isConnecting]); - - // Handle ESC key press - useEffect(() => { - const handleEscKey = (event: KeyboardEvent) => { - if (event.key === "Escape" && !isConnecting) { - onClose(); - } - }; - - if (isOpen) { - document.addEventListener("keydown", handleEscKey); - } - - return () => { - document.removeEventListener("keydown", handleEscKey); - }; - }, [isOpen, onClose, isConnecting]); - - // Get wallet icons based on connector id - const getWalletIcon = (id: string) => { - switch (id.toLowerCase()) { - case "argentx": - return "/argent-x-logo.webp"; - case "braavos": - return "/braavos-logo.webp"; - } - }; - - // List of recommended wallets to download if none are available - const recommendedWallets = [ - { - name: "ArgentX", - description: "The most popular Starknet wallet", - icon: "/argent-x-logo.webp", - url: "https://www.argent.xyz/argent-x/", - chromeUrl: - "https://chrome.google.com/webstore/detail/argent-x/dlcobpjiigpikoobohmabehhmhfoodbb", - firefoxUrl: "https://addons.mozilla.org/en-US/firefox/addon/argent-x/", - }, - { - name: "Braavos", - description: "A secure and user-friendly Starknet wallet", - icon: "/braavos-logo.webp", - url: "https://braavos.app/", - chromeUrl: - "https://chrome.google.com/webstore/detail/braavos-wallet/jnlgamecbpmbajjfhmmmlhejkemejdma", - }, - ]; - - // Check if there are any available wallets - const hasAvailableWallets = - connectors && - connectors.length > 0 && - connectors.some((c) => c.available()); - - if (!isOpen) return null; - - return ( -
-
-
-
-

Connect Wallet

- {!isConnecting && ( - - )} -
- - {/* Connection error message */} - {connectionError && ( -
- {connectionError} -
- )} - - {/* Loading state */} - {isConnecting && ( -
- -

Connecting to wallet...

-

- Please confirm the connection in your wallet -

-
- )} - - {/* Wallet list */} - {!isConnecting && hasAvailableWallets ? ( -
-

- Select a wallet to connect to this application: -

-
- {connectors.map( - (connector) => - connector.available() && ( - - ) - )} -
-
- ) : !isConnecting ? ( -
-
-
-
- -
-

- No Starknet Wallets Detected -

-

- To use this application, you‘ll need to install a - Starknet wallet. -

-

- Choose one of the recommended wallets below: -

-
- -
- {recommendedWallets.map((wallet) => ( -
-
-
- {wallet.name} -
-
-

- {wallet.name} -

-

- {wallet.description} -

-
-
-
- {wallet.chromeUrl && ( - - - - - - Chrome - - )} - {wallet.firefoxUrl && ( - - - - - - Firefox - - )} - - - Website - -
-
- ))} -
- -
-

- After installing: -

-
    -
  1. Refresh this page
  2. -
  3. Click the "Connect Wallet" button again
  4. -
  5. - Follow the wallet‘s instructions to create or import - an account -
  6. -
-
-
-
- ) : null} -
-
-
- ); -} diff --git a/frontend/components/wallet-dropdown.tsx b/frontend/components/wallet-dropdown.tsx deleted file mode 100644 index 84bff46..0000000 --- a/frontend/components/wallet-dropdown.tsx +++ /dev/null @@ -1,101 +0,0 @@ -"use client"; - -import { useRef, useEffect } from "react"; -import { LogOut, ExternalLink, Copy, CheckCircle2 } from "lucide-react"; -import { useState } from "react"; -import Link from "next/link"; -import { truncateAddress } from "@/utils/wallet"; - -interface WalletDropdownProps { - isOpen: boolean; - onClose: () => void; - address: string; - onDisconnect: () => void; -} - -export function WalletDropdown({ - isOpen, - onClose, - address, - onDisconnect, -}: WalletDropdownProps) { - const dropdownRef = useRef(null); - const [copied, setCopied] = useState(false); - - // Close dropdown when clicking outside - useEffect(() => { - const handleClickOutside = (event: MouseEvent) => { - if ( - dropdownRef.current && - !dropdownRef.current.contains(event.target as Node) - ) { - onClose(); - } - }; - - if (isOpen) { - document.addEventListener("mousedown", handleClickOutside); - } - - return () => { - document.removeEventListener("mousedown", handleClickOutside); - }; - }, [isOpen, onClose]); - - const copyToClipboard = () => { - navigator.clipboard.writeText(address); - setCopied(true); - setTimeout(() => setCopied(false), 2000); - }; - - if (!isOpen) return null; - - const explorerUrl = `https://voyager.online/contract/${address}`; - - return ( -
-
-
- Connected Wallet -
-
- - {truncateAddress(address)} - - -
-
-
- - - View on Explorer - - -
-
- ); -} diff --git a/frontend/hooks/use-betting.tsx b/frontend/hooks/use-betting.tsx deleted file mode 100644 index 8d485ca..0000000 --- a/frontend/hooks/use-betting.tsx +++ /dev/null @@ -1,82 +0,0 @@ -"use client"; - -import { useState, useCallback } from "react"; -import { useAccount } from "@starknet-react/core"; -import type { Transaction } from "@/types/betting"; -import { placeBet as placeBetOnChain } from "@/lib/starknet"; - -export function useBetting() { - const { address } = useAccount(); - const [transactions, setTransactions] = useState([]); - const [isLoading, setIsLoading] = useState(false); - - const placeBet = useCallback( - async (agentId: number, amount: string) => { - if (!address) { - throw new Error("Wallet not connected"); - } - - setIsLoading(true); - - try { - // Create a pending transaction record - const pendingTx: Transaction = { - hash: "pending-" + Date.now(), - status: "pending", - message: `Placing bet of ${amount} ETH on agent #${agentId}...`, - timestamp: Date.now(), - }; - - setTransactions((prev) => [pendingTx, ...prev]); - - // Call the StarkNet contract - const result = await placeBetOnChain(agentId, amount); - - // Update the transaction status - setTransactions((prev) => - prev.map((tx) => - tx.hash === pendingTx.hash - ? { - hash: result.transactionHash, - status: "confirmed", - message: `Successfully placed bet of ${amount} ETH on agent #${agentId}`, - timestamp: Date.now(), - } - : tx - ) - ); - - return result; - } catch (error) { - console.error("Transaction failed:", error); - - // Update the transaction status to failed - setTransactions((prev) => - prev.map((tx) => - tx.hash === "pending-" + Date.now().toString().slice(0, -3) - ? { - hash: "failed-" + Date.now(), - status: "failed", - message: `Failed to place bet: ${ - error instanceof Error ? error.message : "Unknown error" - }`, - timestamp: Date.now(), - } - : tx - ) - ); - - throw error; - } finally { - setIsLoading(false); - } - }, - [address] - ); - - return { - transactions, - isLoading, - placeBet, - }; -} diff --git a/frontend/hooks/use-starknet-connect.tsx b/frontend/hooks/use-starknet-connect.tsx deleted file mode 100644 index 81c7bd3..0000000 --- a/frontend/hooks/use-starknet-connect.tsx +++ /dev/null @@ -1,51 +0,0 @@ -"use client"; - -import { useCallback, useMemo } from "react"; -import { - argent, - braavos, - useInjectedConnectors, - voyager, - publicProvider, -} from "@starknet-react/core"; -import { mainnet, sepolia } from "@starknet-react/chains"; - -/** - * Hook to get Starknet connectors - */ -export function useStarknetConnectors() { - return useInjectedConnectors({ - recommended: [argent(), braavos()], - includeRecommended: "onlyIfNoConnectors", - order: "random", - }); -} - -/** - * Hook to get the complete Starknet configuration - * Includes error handling for disconnection events - */ -export function useStarknetConfig() { - const { connectors } = useStarknetConnectors(); - - // Handle wallet disconnection errors - const handleDisconnectError = useCallback((error: Error) => { - console.warn("Starknet disconnect error:", error); - // Dispatch a custom event that our components can listen for - window.dispatchEvent(new CustomEvent("wallet_disconnected")); - // Return true to indicate the error was handled - return true; - }, []); - - return useMemo( - () => ({ - chains: [mainnet, sepolia], - provider: publicProvider(), - connectors, - explorer: voyager, - autoConnect: true, - onDisconnectError: handleDisconnectError, - }), - [connectors, handleDisconnectError] - ); -} diff --git a/frontend/hooks/use-wallet-connection.tsx b/frontend/hooks/use-wallet-connection.tsx deleted file mode 100644 index b609cb3..0000000 --- a/frontend/hooks/use-wallet-connection.tsx +++ /dev/null @@ -1,109 +0,0 @@ -"use client"; - -import { useState, useCallback, useEffect } from "react"; -import { - useAccount, - useConnect, - useDisconnect, - type Connector, -} from "@starknet-react/core"; - -/** - * Custom hook for managing wallet connection state and operations - */ -export function useWalletConnection() { - const [isConnecting, setIsConnecting] = useState(false); - const [connectionError, setConnectionError] = useState(null); - const { address, isConnected, isConnecting: isReconnecting } = useAccount(); - const { connect, connectors } = useConnect(); - const { disconnect } = useDisconnect(); - - // Connect to wallet with error handling - const connectWallet = useCallback( - async (connector: Connector) => { - if (!connector) return Promise.reject(new Error("No connector provided")); - - setIsConnecting(true); - setConnectionError(null); - - try { - await connect({ connector }); - - // Save the last used connector for auto-connect - if (connector.id) { - localStorage.setItem("lastUsedConnector", connector.id); - } - return Promise.resolve(); - } catch (error) { - const errorMessage = - error instanceof Error ? error.message : "Failed to connect wallet"; - console.error("Wallet connection error:", errorMessage); - setConnectionError(errorMessage); - return Promise.reject(error); - } finally { - setIsConnecting(false); - } - }, - [connect] - ); - - // Disconnect wallet - const disconnectWallet = useCallback(() => { - disconnect(); - localStorage.removeItem("lastUsedConnector"); - }, [disconnect]); - - // Auto-connect on component mount - const autoConnect = useCallback(() => { - if ( - !isConnected && - !isReconnecting && - connectors && - connectors.length > 0 - ) { - const lastConnector = localStorage.getItem("lastUsedConnector"); - - if (lastConnector) { - const connector = connectors.find((c) => c.id === lastConnector); - if (connector) { - connectWallet(connector).catch(() => { - // Silent fail for auto-connect - }); - } - } - } - }, [connectWallet, connectors, isConnected, isReconnecting]); - - // Listen for wallet_disconnected events - useEffect(() => { - const handleWalletDisconnected = () => { - // Clear any connection state - localStorage.removeItem("lastUsedConnector"); - }; - - window.addEventListener("wallet_disconnected", handleWalletDisconnected); - - return () => { - window.removeEventListener( - "wallet_disconnected", - handleWalletDisconnected - ); - }; - }, []); - - // Run auto-connect on component mount - useEffect(() => { - autoConnect(); - }, [autoConnect]); - - return { - address, - isConnected, - isConnecting, - connectionError, - connectors, - connectWallet, - disconnectWallet, - autoConnect, - }; -} diff --git a/frontend/lib/starknet.ts b/frontend/lib/starknet.ts deleted file mode 100644 index 7ab326d..0000000 --- a/frontend/lib/starknet.ts +++ /dev/null @@ -1,82 +0,0 @@ -import type { Agent } from "@/types/betting"; - -// Mock agents data -const mockAgents: Agent[] = [ - { - id: 1, - name: "Mark Cuban", - image: "/bet-image1.jpg", - performance: 75, - }, - { - id: 2, - name: "Batman", - image: "/bet-image3.jpg", - performance: 45, - }, - { - id: 3, - name: "Literally a fish", - image: "/bet-image2.jpg", - performance: 90, - }, -]; - -// Get list of available agents -export async function getAgents(): Promise { - // In a real implementation, this would fetch agents from a backend or smart contract - return new Promise((resolve) => { - setTimeout(() => { - resolve(mockAgents); - }, 800); - }); -} - -// Place a bet on an agent -export async function placeBet( - agentId: number, - amount: string -): Promise<{ transactionHash: string }> { - // In a real implementation, this would call the StarkNet contract - - // This is where you would implement the actual StarkNet contract call - // Example implementation (commented out as it requires actual contract): - /* - const contractAddress = "0x123..."; // Your contract address - const contract = new Contract(abi, contractAddress, provider); - - // Convert amount to uint256 - const amountUint256 = uint256.bnToUint256(ethers.utils.parseEther(amount)); - - // Prepare calldata - const calldata = CallData.compile({ - agentId: agentId, - amount: amountUint256 - }); - - // Execute transaction - const tx = await contract.invoke("placeBet", calldata); - - return { - transactionHash: tx.transaction_hash - }; - */ - - // For now, we'll simulate a transaction with a delay - return new Promise((resolve, reject) => { - // Simulate transaction delay - setTimeout(() => { - // 90% chance of success - if (Math.random() > 0.1) { - resolve({ - transactionHash: - "0x" + - Math.random().toString(16).substring(2) + - Math.random().toString(16).substring(2), - }); - } else { - reject(new Error("Transaction rejected by the network")); - } - }, 2000); - }); -} diff --git a/frontend/package.json b/frontend/package.json index f6f79b0..8360260 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -9,9 +9,6 @@ "lint": "next lint" }, "dependencies": { - "@starknet-react/chains": "^3.1.3", - "@starknet-react/core": "^3.7.4", - "lucide-react": "^0.507.0", "react": "^19.0.0", "react-dom": "^19.0.0", "next": "15.3.0" diff --git a/frontend/public/argent-x-logo.webp b/frontend/public/argent-x-logo.webp deleted file mode 100644 index f30de59..0000000 Binary files a/frontend/public/argent-x-logo.webp and /dev/null differ diff --git a/frontend/public/bet-image1.jpg b/frontend/public/bet-image1.jpg deleted file mode 100644 index 14ade21..0000000 Binary files a/frontend/public/bet-image1.jpg and /dev/null differ diff --git a/frontend/public/bet-image2.jpg b/frontend/public/bet-image2.jpg deleted file mode 100644 index 5ed07ae..0000000 Binary files a/frontend/public/bet-image2.jpg and /dev/null differ diff --git a/frontend/public/bet-image3.jpg b/frontend/public/bet-image3.jpg deleted file mode 100644 index f8e07e3..0000000 Binary files a/frontend/public/bet-image3.jpg and /dev/null differ diff --git a/frontend/public/braavos-logo.webp b/frontend/public/braavos-logo.webp deleted file mode 100644 index cba0ec0..0000000 Binary files a/frontend/public/braavos-logo.webp and /dev/null differ diff --git a/frontend/types/betting.ts b/frontend/types/betting.ts deleted file mode 100644 index ceef481..0000000 --- a/frontend/types/betting.ts +++ /dev/null @@ -1,13 +0,0 @@ -export type Agent = { - id: number; - name: string; - image: string; - performance: number; // 0-100 scale for the colored bar -}; - -export type Transaction = { - hash: string; - status: "pending" | "confirmed" | "failed"; - message: string; - timestamp: number; -}; diff --git a/frontend/utils/wallet.ts b/frontend/utils/wallet.ts deleted file mode 100644 index bbbdf7d..0000000 --- a/frontend/utils/wallet.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Truncates an address for display purposes - * @param address The full address to truncate - * @returns The truncated address (e.g. 0x1234...5678) - */ -export function truncateAddress(address: string): string { - if (!address) return ""; - if (address.length <= 10) return address; - - return `${address.substring(0, 6)}...${address.substring( - address.length - 4 - )}`; -}