Files
zeekay c4c9a0aa95 Fix all remaining issues found by CTO agent swarm
High Priority Fixes:
- ✅ Add View Details button for app navigation to detail pages
- ✅ Add footer links for Guidelines, Terms, and Privacy pages
- ✅ Rename data files to match store.json IDs (hanzo→shinkai prefix)
- ✅ Fix WalletConnect projectId - make optional to avoid console errors
- ✅ Add favicon using Hanzo logo

Medium Priority Fixes:
- ✅ Remove console statements from production code
- ✅ Remove unused Github import from page-client
- ✅ Add URL sanitization for security (XSS prevention)
- ✅ Create URL validation utility function

Code Quality Improvements:
- ✅ Add TypeScript type definitions for @hanzo/ui
- ✅ Add explicit types for event handlers
- ✅ Add .env.example for WalletConnect setup
- ✅ Add LLM.md with comprehensive documentation
- ✅ Fix implicit any types in test files

Security Enhancements:
- Sanitize all external URLs before rendering
- Validate URL protocols (http/https only)
- Prevent XSS through URL injection

Files Changed:
- app/page.tsx - navigation, footer links, URL validation
- app/apps/[id]/page-client.tsx - URL validation, remove console
- app/apps/[id]/page.tsx - remove console
- lib/wagmi.ts - make WalletConnect optional
- lib/url-utils.ts - NEW: URL validation utility
- types/hanzo-ui.d.ts - NEW: TypeScript declarations
- .env.example - NEW: environment variable template
- .github/workflows/deploy.yml - add WalletConnect env var
- public/favicon.ico - NEW: Hanzo logo favicon
- data files - rename to match IDs
2025-11-06 02:04:48 -08:00

152 lines
3.0 KiB
TypeScript

import { http, createConfig } from 'wagmi'
import { mainnet, sepolia } from 'wagmi/chains'
import { defineChain } from 'viem'
import { coinbaseWallet, injected, walletConnect } from 'wagmi/connectors'
// Define Lux chain
export const lux = defineChain({
id: 96369,
name: 'Lux',
nativeCurrency: {
decimals: 18,
name: 'Lux',
symbol: 'LUX',
},
rpcUrls: {
default: {
http: ['https://api.lux.network'],
},
},
blockExplorers: {
default: { name: 'LuxScan', url: 'https://explore.lux.network' },
},
testnet: false,
})
// Define Lux testnet
export const luxTestnet = defineChain({
id: 96368,
name: 'Lux Testnet',
nativeCurrency: {
decimals: 18,
name: 'Lux',
symbol: 'LUX',
},
rpcUrls: {
default: {
http: ['https://api.lux-test.network'],
},
},
blockExplorers: {
default: { name: 'LuxScan Testnet', url: 'https://explore.lux-test.network' },
},
testnet: true,
})
// Define Hanzo chain
export const hanzo = defineChain({
id: 369363,
name: 'Hanzo',
nativeCurrency: {
decimals: 18,
name: 'Hanzo',
symbol: 'HANZO',
},
rpcUrls: {
default: {
http: ['https://api.hanzo.ai'],
},
},
blockExplorers: {
default: { name: 'HanzoScan', url: 'https://explore.hanzo.ai' },
},
testnet: false,
})
// Define Hanzo testnet
export const hanzoTestnet = defineChain({
id: 36962,
name: 'Hanzo Testnet',
nativeCurrency: {
decimals: 18,
name: 'Hanzo',
symbol: 'HANZO',
},
rpcUrls: {
default: {
http: ['https://api.hanzo-test.ai'],
},
},
blockExplorers: {
default: { name: 'HanzoScan Testnet', url: 'https://explore.hanzo-test.ai' },
},
testnet: true,
})
// Define Zoo chain
export const zoo = defineChain({
id: 200200,
name: 'Zoo',
nativeCurrency: {
decimals: 18,
name: 'Zoo',
symbol: 'ZOO',
},
rpcUrls: {
default: {
http: ['https://api.zoo.ngo'],
},
},
blockExplorers: {
default: { name: 'ZooScan', url: 'https://explore.zoo.ngo' },
},
testnet: false,
})
// Define Zoo testnet
export const zooTestnet = defineChain({
id: 200201,
name: 'Zoo Testnet',
nativeCurrency: {
decimals: 18,
name: 'Zoo',
symbol: 'ZOO',
},
rpcUrls: {
default: {
http: ['https://api.zoo-test.ngo'],
},
},
blockExplorers: {
default: { name: 'ZooScan Testnet', url: 'https://explore.zoo-test.ngo' },
},
testnet: true,
})
const projectId = process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID || '';
export const config = createConfig({
chains: [hanzo, hanzoTestnet, zoo, zooTestnet, lux, luxTestnet, mainnet, sepolia],
connectors: [
injected(),
coinbaseWallet({ appName: 'Hanzo Store' }),
...(projectId ? [walletConnect({ projectId })] : []),
],
transports: {
[hanzo.id]: http(),
[hanzoTestnet.id]: http(),
[zoo.id]: http(),
[zooTestnet.id]: http(),
[lux.id]: http(),
[luxTestnet.id]: http(),
[mainnet.id]: http(),
[sepolia.id]: http(),
},
})
declare module 'wagmi' {
interface Register {
config: typeof config
}
}