Files
nebula/models/dashboard.go

164 lines
6.1 KiB
Go

package models
// Token represents a cryptocurrency token in the wallet
type Token struct {
Symbol string
Name string
Balance string
Value string
Change string
Positive bool
Color string
Initials string
Network string
}
// Transaction represents a wallet transaction
type Transaction struct {
Type string
Asset string
Amount string
USD string
Date string
Time string
Hash string
Positive bool
Address string
}
// NFT represents a non-fungible token in the wallet
type NFT struct {
Name string
Collection string
Image string
Floor string
Value string
Badge string
Verified bool
}
type AreaSeriesData struct {
Date string `json:"date"`
Industry string `json:"industry"`
Value float64 `json:"value"`
}
type BubbleData struct {
Name string `json:"name"`
Sector string `json:"sector"`
Value float64 `json:"value"`
}
// DashboardData holds all data for the dashboard view
type DashboardData struct {
TotalBalance string
Change24h string
Tokens []Token
Transactions []Transaction
NFTs []NFT
PortfolioChart []AreaSeriesData
MarketCapBubble []BubbleData
}
// DefaultTokens returns sample token data
func DefaultTokens() []Token {
return []Token{
{Symbol: "SNR", Name: "Sonr", Balance: "8,432.50", Value: "$4,216.25", Change: "+5.67%", Positive: true, Color: "linear-gradient(135deg, #17c2ff, #0090ff)", Initials: "S", Network: "Sonr Mainnet"},
{Symbol: "ETH", Name: "Ethereum", Balance: "2.847", Value: "$6,682.04", Change: "+3.24%", Positive: true, Color: "#627eea", Initials: "E", Network: "Ethereum"},
{Symbol: "USDC", Name: "USD Coin", Balance: "1,250.00", Value: "$1,250.00", Change: "0.00%", Positive: true, Color: "#2775ca", Initials: "U", Network: "Ethereum"},
{Symbol: "AVAX", Name: "Avalanche", Balance: "24.83", Value: "$699.03", Change: "-2.18%", Positive: false, Color: "#e84142", Initials: "A", Network: "Avalanche"},
}
}
// DefaultTransactions returns sample transaction data
func DefaultTransactions() []Transaction {
return []Transaction{
{Type: "receive", Asset: "ETH", Amount: "+0.25 ETH", USD: "$586.25", Date: "Today", Time: "2:34 PM", Hash: "0x8f4a2b1c...", Positive: true, Address: "0x742d...35Cb"},
{Type: "send", Asset: "SNR", Amount: "-500 SNR", USD: "$250.00", Date: "Yesterday", Time: "11:22 AM", Hash: "0x7d3e2a1b...", Positive: false, Address: "sonr1k4m...9p3q"},
{Type: "swap", Asset: "ETH -> USDC", Amount: "0.5 ETH", USD: "-> 1,172.50 USDC", Date: "Jan 1", Time: "9:15 AM", Hash: "0x1a2b3c4d...", Positive: true, Address: "Uniswap V3"},
}
}
// DefaultNFTs returns sample NFT data
func DefaultNFTs() []NFT {
return []NFT{
{Name: "Bored Ape #4521", Collection: "Bored Ape Yacht Club", Image: "https://images.unsplash.com/photo-1620641788421-7a1c342ea42e?w=400&h=400&fit=crop", Floor: "28.5 ETH", Value: "32.0 ETH", Badge: "Listed", Verified: true},
{Name: "Sonr Genesis #001", Collection: "Sonr Genesis", Image: "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=400&h=400&fit=crop", Floor: "0.8 ETH", Value: "2.5 ETH", Badge: "Rare", Verified: true},
}
}
// DefaultPortfolioChartData returns sample stacked area data for portfolio performance
func DefaultPortfolioChartData() []AreaSeriesData {
return []AreaSeriesData{
// Day 1
{Date: "2024-12-25", Industry: "ETH", Value: 3200},
{Date: "2024-12-25", Industry: "SNR", Value: 2100},
{Date: "2024-12-25", Industry: "USDC", Value: 1200},
{Date: "2024-12-25", Industry: "AVAX", Value: 500},
// Day 2
{Date: "2024-12-26", Industry: "ETH", Value: 3350},
{Date: "2024-12-26", Industry: "SNR", Value: 2200},
{Date: "2024-12-26", Industry: "USDC", Value: 1200},
{Date: "2024-12-26", Industry: "AVAX", Value: 520},
// Day 3
{Date: "2024-12-27", Industry: "ETH", Value: 3500},
{Date: "2024-12-27", Industry: "SNR", Value: 2350},
{Date: "2024-12-27", Industry: "USDC", Value: 1200},
{Date: "2024-12-27", Industry: "AVAX", Value: 480},
// Day 4
{Date: "2024-12-28", Industry: "ETH", Value: 3280},
{Date: "2024-12-28", Industry: "SNR", Value: 2400},
{Date: "2024-12-28", Industry: "USDC", Value: 1200},
{Date: "2024-12-28", Industry: "AVAX", Value: 510},
// Day 5
{Date: "2024-12-29", Industry: "ETH", Value: 3450},
{Date: "2024-12-29", Industry: "SNR", Value: 2550},
{Date: "2024-12-29", Industry: "USDC", Value: 1250},
{Date: "2024-12-29", Industry: "AVAX", Value: 530},
// Day 6
{Date: "2024-12-30", Industry: "ETH", Value: 3600},
{Date: "2024-12-30", Industry: "SNR", Value: 2680},
{Date: "2024-12-30", Industry: "USDC", Value: 1250},
{Date: "2024-12-30", Industry: "AVAX", Value: 550},
// Day 7
{Date: "2024-12-31", Industry: "ETH", Value: 3750},
{Date: "2024-12-31", Industry: "SNR", Value: 2800},
{Date: "2024-12-31", Industry: "USDC", Value: 1250},
{Date: "2024-12-31", Industry: "AVAX", Value: 580},
// Day 8
{Date: "2025-01-01", Industry: "ETH", Value: 3680},
{Date: "2025-01-01", Industry: "SNR", Value: 2900},
{Date: "2025-01-01", Industry: "USDC", Value: 1250},
{Date: "2025-01-01", Industry: "AVAX", Value: 600},
}
}
// DefaultMarketCapBubbleData returns sample bubble chart data for market cap dominance
func DefaultMarketCapBubbleData() []BubbleData {
return []BubbleData{
{Name: "BTC", Sector: "Layer 1", Value: 45000},
{Name: "ETH", Sector: "Layer 1", Value: 28000},
{Name: "SNR", Sector: "Layer 1", Value: 8500},
{Name: "SOL", Sector: "Layer 1", Value: 12000},
{Name: "AVAX", Sector: "Layer 1", Value: 6000},
{Name: "USDC", Sector: "Stablecoin", Value: 15000},
{Name: "USDT", Sector: "Stablecoin", Value: 18000},
{Name: "UNI", Sector: "DeFi", Value: 4500},
{Name: "AAVE", Sector: "DeFi", Value: 3200},
{Name: "LINK", Sector: "Oracle", Value: 5800},
}
}
// DefaultDashboardData returns a complete dashboard data set with sample data
func DefaultDashboardData() DashboardData {
return DashboardData{
TotalBalance: "12847.32",
Change24h: "+$302.18",
Tokens: DefaultTokens(),
Transactions: DefaultTransactions(),
NFTs: DefaultNFTs(),
PortfolioChart: DefaultPortfolioChartData(),
MarketCapBubble: DefaultMarketCapBubbleData(),
}
}