feat: implement CEX analysis cards and real-time token monitoring
- Add TokenCard and CexAnalysisCard components for displaying token data - Implement real-time Redis event streaming for token updates - Add environment-based configuration system for dev/prod Redis servers - Create comprehensive hunting ground dashboard with card management - Add individual and bulk card removal functionality - Implement browser integration for token details viewing - Add timestamp utilities and proper type handling for Redis events - Create production-ready configuration with 154.38.185.112 Redis server - Add comprehensive documentation in README.md and CONTRIBUTORS.md - Restructure project architecture with proper Electron-Vue integration BREAKING CHANGE: Redis configuration now uses environment-based settings
This commit is contained in:
parent
42e0ff7ab6
commit
67fb3a203e
50 changed files with 4672 additions and 960 deletions
|
|
@ -1,19 +1,58 @@
|
||||||
import tailwindcss from '@tailwindcss/vite'
|
import tailwindcss from '@tailwindcss/vite'
|
||||||
|
import { defineNuxtConfig } from 'nuxt/config'
|
||||||
|
import { getConfig } from '../app.config'
|
||||||
|
|
||||||
|
const config = getConfig()
|
||||||
|
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
modules: [
|
modules: [
|
||||||
'@nuxt/eslint',
|
'@nuxt/eslint',
|
||||||
'@pinia/nuxt',
|
'@pinia/nuxt',
|
||||||
|
'@nuxt/icon',
|
||||||
],
|
],
|
||||||
ssr: false,
|
ssr: false,
|
||||||
devtools: { enabled: true },
|
devtools: { enabled: true },
|
||||||
|
|
||||||
|
devServer: {
|
||||||
|
port: config.development.nuxt.port,
|
||||||
|
host: config.development.nuxt.host,
|
||||||
|
},
|
||||||
|
|
||||||
|
runtimeConfig: {
|
||||||
|
// Private keys (only available on server-side)
|
||||||
|
redis: {
|
||||||
|
host: config.redis.host,
|
||||||
|
port: config.redis.port,
|
||||||
|
db: config.redis.db,
|
||||||
|
keyPrefix: config.redis.keyPrefix,
|
||||||
|
},
|
||||||
|
|
||||||
|
// Public keys (exposed to client-side)
|
||||||
|
public: {
|
||||||
|
app: {
|
||||||
|
name: config.app.name,
|
||||||
|
version: config.app.version,
|
||||||
|
description: config.app.description,
|
||||||
|
author: config.app.author,
|
||||||
|
},
|
||||||
|
window: config.window,
|
||||||
|
theme: config.theme,
|
||||||
|
isDevelopment: process.env.NODE_ENV === 'development',
|
||||||
|
isElectron: process.env.IS_ELECTRON === 'true',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
app: {
|
app: {
|
||||||
baseURL: './',
|
baseURL: './',
|
||||||
cdnURL: './',
|
cdnURL: './',
|
||||||
head: {
|
head: {
|
||||||
title: 'Ziya',
|
title: config.app.name,
|
||||||
meta: [
|
meta: [
|
||||||
{ 'http-equiv': 'content-security-policy', 'content': 'script-src \'self\' \'unsafe-inline\'' },
|
{ name: 'description', content: config.app.description },
|
||||||
|
{
|
||||||
|
'http-equiv': 'content-security-policy',
|
||||||
|
'content': `script-src ${config.security.csp.scriptSrc.join(' ')}; style-src ${config.security.csp.styleSrc.join(' ')}; img-src ${config.security.csp.imgSrc.join(' ')}`
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -44,6 +83,18 @@ export default defineNuxtConfig({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
typescript: {
|
||||||
|
typeCheck: false,
|
||||||
|
includeWorkspace: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
imports: {
|
||||||
|
dirs: [
|
||||||
|
'composables/**',
|
||||||
|
'stores/**'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
future: { compatibilityVersion: 4 },
|
future: { compatibilityVersion: 4 },
|
||||||
features: {
|
features: {
|
||||||
inlineStyles: false,
|
inlineStyles: false,
|
||||||
|
|
@ -54,14 +105,4 @@ export default defineNuxtConfig({
|
||||||
renderJsonPayloads: false,
|
renderJsonPayloads: false,
|
||||||
},
|
},
|
||||||
compatibilityDate: '2025-05-26',
|
compatibilityDate: '2025-05-26',
|
||||||
eslint: {
|
|
||||||
config: {
|
|
||||||
stylistic: true,
|
|
||||||
},
|
|
||||||
checker: {
|
|
||||||
lintOnStart: false,
|
|
||||||
include: ['**/*.{js,ts,vue,mjs}'],
|
|
||||||
exclude: ['node_modules', '.nuxt', '.output', 'dist', 'coverage'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
|
||||||
30
.vscode/settings.json
vendored
30
.vscode/settings.json
vendored
|
|
@ -20,17 +20,29 @@
|
||||||
"**/dist": true,
|
"**/dist": true,
|
||||||
"**/build": true
|
"**/build": true
|
||||||
},
|
},
|
||||||
|
|
||||||
"[javascript]": {
|
"[javascript]": {
|
||||||
"editor.defaultFormatter": "vscode.typescript-language-features",
|
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll.eslint": "explicit"
|
||||||
|
},
|
||||||
"javascript.preferences.quoteStyle": "single"
|
"javascript.preferences.quoteStyle": "single"
|
||||||
},
|
},
|
||||||
"[typescript]": {
|
"[typescript]": {
|
||||||
"editor.defaultFormatter": "vscode.typescript-language-features",
|
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
|
||||||
"typescript.preferences.quoteStyle": "single"
|
"editor.formatOnSave": true,
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll.eslint": "explicit"
|
||||||
|
},
|
||||||
|
"typescript.preferences.quoteStyle": "single",
|
||||||
|
"typescript.preferences.organizeImports": "off"
|
||||||
},
|
},
|
||||||
"[vue]": {
|
"[vue]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll.eslint": "explicit"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
"*.css": "tailwindcss"
|
"*.css": "tailwindcss"
|
||||||
|
|
@ -44,5 +56,11 @@
|
||||||
"editor.defaultFormatter": "vscode.json-language-features",
|
"editor.defaultFormatter": "vscode.json-language-features",
|
||||||
"editor.insertSpaces": true,
|
"editor.insertSpaces": true,
|
||||||
"editor.tabSize": 2
|
"editor.tabSize": 2
|
||||||
}
|
},
|
||||||
|
"eslint.format.enable": true,
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"typescript.preferences.includePackageJsonAutoImports": "auto",
|
||||||
|
"typescript.suggest.autoImports": true,
|
||||||
|
"typescript.updateImportsOnFileMove.enabled": "always",
|
||||||
|
"typescript.workspaceSymbols.scope": "allOpenProjects",
|
||||||
}
|
}
|
||||||
409
CONTRIBUTORS.md
Normal file
409
CONTRIBUTORS.md
Normal file
|
|
@ -0,0 +1,409 @@
|
||||||
|
# Contributors Guide
|
||||||
|
|
||||||
|
Welcome to the Ziya Token Monitor development team! This guide will help you get up and running quickly with the project.
|
||||||
|
|
||||||
|
## 🚀 Quick Start for New Developers
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
Make sure you have these installed:
|
||||||
|
- **Node.js** >= 18.0.0
|
||||||
|
- **pnpm** >= 8.0.0 (package manager)
|
||||||
|
- **Redis** (for local development)
|
||||||
|
- **Git** for version control
|
||||||
|
|
||||||
|
### Installation Steps
|
||||||
|
|
||||||
|
1. **Clone the repository**:
|
||||||
|
```bash
|
||||||
|
git clone <repository-url>
|
||||||
|
cd muhafidh/ziya
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Install dependencies**:
|
||||||
|
```bash
|
||||||
|
pnpm install
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Set up Redis** (choose one):
|
||||||
|
|
||||||
|
**Option A: Docker (Recommended)**
|
||||||
|
```bash
|
||||||
|
# Run Redis in Docker container
|
||||||
|
docker run -d --name bismillahdao-redis -p 6379:6379 redis:alpine
|
||||||
|
```
|
||||||
|
|
||||||
|
**Option B: Local Installation**
|
||||||
|
```bash
|
||||||
|
# Install Redis locally (varies by OS)
|
||||||
|
# macOS: brew install redis
|
||||||
|
# Ubuntu: sudo apt install redis-server
|
||||||
|
# Windows: Use WSL or Redis for Windows
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Start development**:
|
||||||
|
```bash
|
||||||
|
pnpm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
The application will start with:
|
||||||
|
- Nuxt dev server at `http://localhost:3000`
|
||||||
|
- Electron desktop app will launch automatically
|
||||||
|
- Hot reload enabled for both frontend and Electron
|
||||||
|
|
||||||
|
## 🏗️ Development Architecture
|
||||||
|
|
||||||
|
### Tech Stack Overview
|
||||||
|
- **Frontend**: Vue 3 (Vapor Mode), Nuxt 3, TypeScript
|
||||||
|
- **Desktop**: Electron with secure IPC communication
|
||||||
|
- **Styling**: TailwindCSS + DaisyUI
|
||||||
|
- **State Management**: Pinia
|
||||||
|
- **Backend Integration**: Redis (ioredis) for real-time events
|
||||||
|
- **Build Tools**: Vite, Electron Forge
|
||||||
|
|
||||||
|
### Project Structure Deep Dive
|
||||||
|
```
|
||||||
|
ziya/
|
||||||
|
├── app/ # Nuxt 3 application
|
||||||
|
│ ├── components/ # Vue components
|
||||||
|
│ │ ├── TokenCard.vue # Individual token display cards
|
||||||
|
│ │ ├── CexAnalysisCard.vue # CEX analysis results
|
||||||
|
│ │ └── ...
|
||||||
|
│ ├── pages/ # Nuxt pages/routes
|
||||||
|
│ │ └── hunting-ground.vue # Main dashboard
|
||||||
|
│ ├── stores/ # Pinia state management
|
||||||
|
│ ├── utils/ # Utility functions
|
||||||
|
│ │ ├── address.ts # Solana address handling
|
||||||
|
│ │ ├── format.ts # Data formatting
|
||||||
|
│ │ └── ...
|
||||||
|
│ └── types/ # TypeScript definitions
|
||||||
|
├── electron/ # Electron main process
|
||||||
|
│ ├── main.ts # Electron entry point
|
||||||
|
│ ├── config/ # Configuration files
|
||||||
|
│ │ ├── environment.ts # Environment settings
|
||||||
|
│ │ └── redis.ts # Redis configuration
|
||||||
|
│ ├── handlers/ # Event handlers
|
||||||
|
│ ├── utils/ # Electron utilities
|
||||||
|
│ │ └── redis.ts # Redis connection logic
|
||||||
|
│ └── preload.ts # Preload script for IPC
|
||||||
|
├── types/ # Shared TypeScript types
|
||||||
|
│ └── redis-events.ts # Redis event definitions
|
||||||
|
└── .config/ # Configuration files
|
||||||
|
└── nuxt.ts # Nuxt configuration
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🔧 Development Workflow
|
||||||
|
|
||||||
|
### Available Scripts
|
||||||
|
```bash
|
||||||
|
# Development
|
||||||
|
pnpm run dev # Start development with hot reload
|
||||||
|
pnpm run dev:nuxt # Start only Nuxt dev server
|
||||||
|
pnpm run dev:electron # Start only Electron (requires built Nuxt)
|
||||||
|
|
||||||
|
# Building
|
||||||
|
pnpm run build # Production build
|
||||||
|
pnpm run build:dev # Development build
|
||||||
|
pnpm run build:prod # Production build (explicit)
|
||||||
|
|
||||||
|
# Utilities
|
||||||
|
pnpm run lint # Run ESLint
|
||||||
|
pnpm run type-check # TypeScript type checking
|
||||||
|
```
|
||||||
|
|
||||||
|
### Environment Configuration
|
||||||
|
|
||||||
|
The application automatically detects the environment and configures Redis accordingly:
|
||||||
|
|
||||||
|
**Development Mode** (`NODE_ENV=development`):
|
||||||
|
- Redis: `localhost:6379` or `bismillahdao-redis:6379` (Docker)
|
||||||
|
- Hot reload enabled
|
||||||
|
- Debug logging active
|
||||||
|
|
||||||
|
**Production Mode** (`NODE_ENV=production`):
|
||||||
|
- Redis: `154.38.185.112:6379` (production server)
|
||||||
|
- Optimized builds
|
||||||
|
- Minimal logging
|
||||||
|
|
||||||
|
### Key Configuration Files
|
||||||
|
- `electron/config/environment.ts` - Environment-specific settings
|
||||||
|
- `electron/config/redis.ts` - Redis connection configuration
|
||||||
|
- `.config/nuxt.ts` - Nuxt configuration
|
||||||
|
- `package.json` - Build scripts and dependencies
|
||||||
|
|
||||||
|
## 🎯 Core Features & Components
|
||||||
|
|
||||||
|
### Real-time Token Dashboard
|
||||||
|
**Location**: `app/pages/hunting-ground.vue`
|
||||||
|
- Displays three columns of token events
|
||||||
|
- Real-time updates via Redis subscriptions
|
||||||
|
- Individual and bulk card management
|
||||||
|
|
||||||
|
### Token Cards System
|
||||||
|
**Components**:
|
||||||
|
- `TokenCard.vue` - New token creation events
|
||||||
|
- `CexAnalysisCard.vue` - CEX analysis and max depth events
|
||||||
|
|
||||||
|
**Features**:
|
||||||
|
- Duration calculation from timestamps
|
||||||
|
- Creator information display
|
||||||
|
- Graph visualization with hover tooltips
|
||||||
|
- Click-to-open in browser functionality
|
||||||
|
- Individual close buttons and "Clear All" actions
|
||||||
|
|
||||||
|
### Redis Integration
|
||||||
|
**Location**: `electron/utils/redis.ts`
|
||||||
|
- Subscribes to channels: `new_token_created`, `token_cex_updated`, `max_depth_reached`
|
||||||
|
- Handles connection management and error recovery
|
||||||
|
- Forwards events to renderer process via IPC
|
||||||
|
|
||||||
|
## 🐛 Common Development Issues & Solutions
|
||||||
|
|
||||||
|
### Redis Connection Issues
|
||||||
|
**Problem**: `ECONNREFUSED` when connecting to Redis
|
||||||
|
**Solutions**:
|
||||||
|
1. Ensure Redis is running: `redis-cli ping`
|
||||||
|
2. Check Docker container: `docker ps | grep redis`
|
||||||
|
3. Verify port 6379 is not blocked
|
||||||
|
|
||||||
|
### Build Errors
|
||||||
|
**Problem**: TypeScript compilation errors
|
||||||
|
**Solutions**:
|
||||||
|
1. Run type check: `pnpm run type-check`
|
||||||
|
2. Clear node_modules: `rm -rf node_modules && pnpm install`
|
||||||
|
3. Check for missing dependencies
|
||||||
|
|
||||||
|
### Hot Reload Not Working
|
||||||
|
**Problem**: Changes not reflecting in development
|
||||||
|
**Solutions**:
|
||||||
|
1. Restart dev server: `Ctrl+C` then `pnpm run dev`
|
||||||
|
2. Clear Nuxt cache: `rm -rf .nuxt`
|
||||||
|
3. Check if both Nuxt and Electron processes are running
|
||||||
|
|
||||||
|
## 📝 Code Style & Best Practices
|
||||||
|
|
||||||
|
### TypeScript Guidelines
|
||||||
|
- Use strict type definitions for all Redis events
|
||||||
|
- Prefer interfaces over types for object shapes
|
||||||
|
- Use proper error handling with try-catch blocks
|
||||||
|
|
||||||
|
### Vue Component Guidelines
|
||||||
|
- Use Composition API with `<script setup>`
|
||||||
|
- Keep components focused and single-responsibility
|
||||||
|
- Use proper TypeScript props definitions
|
||||||
|
|
||||||
|
### Electron Security
|
||||||
|
- Never expose Node.js APIs directly to renderer
|
||||||
|
- Use contextIsolation and sandboxed renderers
|
||||||
|
- Validate all IPC messages
|
||||||
|
|
||||||
|
## 🔍 Debugging Tips
|
||||||
|
|
||||||
|
### Electron DevTools
|
||||||
|
- Main process: Use VS Code debugger or console logs
|
||||||
|
- Renderer process: Open DevTools in Electron app (`Ctrl+Shift+I`)
|
||||||
|
|
||||||
|
### Redis Debugging
|
||||||
|
- Monitor Redis: `redis-cli monitor`
|
||||||
|
- Check subscriptions: `redis-cli pubsub channels`
|
||||||
|
- Test publishing: `redis-cli publish channel_name "test message"`
|
||||||
|
|
||||||
|
### Common Debug Commands
|
||||||
|
```bash
|
||||||
|
# Check Redis connection
|
||||||
|
redis-cli ping
|
||||||
|
|
||||||
|
# Monitor Redis events
|
||||||
|
redis-cli monitor
|
||||||
|
|
||||||
|
# Check running processes
|
||||||
|
ps aux | grep electron
|
||||||
|
ps aux | grep node
|
||||||
|
|
||||||
|
# Check ports
|
||||||
|
netstat -tulpn | grep :6379
|
||||||
|
netstat -tulpn | grep :3000
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🚀 Deployment & Production
|
||||||
|
|
||||||
|
### Production Build Process
|
||||||
|
1. **Environment**: Automatically uses production Redis server (`154.38.185.112:6379`)
|
||||||
|
2. **Build**: `pnpm run build:prod`
|
||||||
|
3. **Output**: Electron distributables in `out/` directory
|
||||||
|
|
||||||
|
### Production Checklist
|
||||||
|
- [ ] Redis server is accessible at `154.38.185.112:6379`
|
||||||
|
- [ ] All dependencies are production-ready
|
||||||
|
- [ ] Environment variables are set correctly
|
||||||
|
- [ ] Build passes without warnings
|
||||||
|
- [ ] Application connects to production Redis successfully
|
||||||
|
|
||||||
|
## 🤝 Contributing Guidelines
|
||||||
|
|
||||||
|
### Before Starting Development
|
||||||
|
1. Pull latest changes: `git pull origin master`
|
||||||
|
2. Create feature branch: `git checkout -b feature/your-feature-name`
|
||||||
|
3. Install dependencies: `pnpm install`
|
||||||
|
4. Start development server: `pnpm run dev`
|
||||||
|
|
||||||
|
### Code Review Process
|
||||||
|
1. Ensure all TypeScript types are properly defined
|
||||||
|
2. Test Redis connectivity in both dev and prod modes
|
||||||
|
3. Verify Electron security best practices
|
||||||
|
4. Check for memory leaks in long-running processes
|
||||||
|
5. Test hot reload functionality
|
||||||
|
|
||||||
|
### Git Workflow & Release Process
|
||||||
|
|
||||||
|
This project uses [Conventional Commits](https://www.conventionalcommits.org/) with automated changelog generation and semantic versioning.
|
||||||
|
|
||||||
|
#### Branch Management
|
||||||
|
```bash
|
||||||
|
# Create feature branch from master
|
||||||
|
git checkout master
|
||||||
|
git pull origin master
|
||||||
|
git checkout -b feat/your-feature-name
|
||||||
|
# or
|
||||||
|
git checkout -b fix/bug-description
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Commit Convention
|
||||||
|
Follow the conventional commit format:
|
||||||
|
```
|
||||||
|
<type>[optional scope]: <description>
|
||||||
|
|
||||||
|
[optional body]
|
||||||
|
|
||||||
|
[optional footer(s)]
|
||||||
|
```
|
||||||
|
|
||||||
|
**Available Types:**
|
||||||
|
| Type | Emoji | Description | Version Bump |
|
||||||
|
|------|-------|-------------|--------------|
|
||||||
|
| `feat` | 🚀 | New features | minor |
|
||||||
|
| `fix` | 🐛 | Bug fixes | patch |
|
||||||
|
| `docs` | 📖 | Documentation changes | patch |
|
||||||
|
| `style` | 💄 | Code style changes | patch |
|
||||||
|
| `refactor` | ♻️ | Code refactoring | patch |
|
||||||
|
| `perf` | ⚡ | Performance improvements | patch |
|
||||||
|
| `test` | ✅ | Adding tests | patch |
|
||||||
|
| `build` | 🏗️ | Build system changes | patch |
|
||||||
|
| `ci` | 🤖 | CI/CD changes | patch |
|
||||||
|
| `chore` | 🧹 | Maintenance tasks | patch |
|
||||||
|
| `revert` | ⏪ | Reverting changes | patch |
|
||||||
|
|
||||||
|
**Example Commits:**
|
||||||
|
```bash
|
||||||
|
git commit -m "feat: add CEX analysis card component"
|
||||||
|
git commit -m "fix: resolve timestamp type inconsistency"
|
||||||
|
git commit -m "docs: update contributors guide"
|
||||||
|
git commit -m "feat(redis): add production environment configuration"
|
||||||
|
```
|
||||||
|
|
||||||
|
**Breaking Changes:**
|
||||||
|
```bash
|
||||||
|
git commit -m "feat: redesign token card structure
|
||||||
|
|
||||||
|
BREAKING CHANGE: TokenCard props have changed from 'data' to 'token'"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Development Workflow
|
||||||
|
```bash
|
||||||
|
# 1. Create and switch to feature branch
|
||||||
|
git checkout -b feat/new-feature
|
||||||
|
|
||||||
|
# 2. Make changes and commit with conventional format
|
||||||
|
git add .
|
||||||
|
git commit -m "feat: add new feature description"
|
||||||
|
|
||||||
|
# 3. Push branch and create PR
|
||||||
|
git push origin feat/new-feature
|
||||||
|
|
||||||
|
# 4. After review approval, merge to master
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Release Process (Maintainers Only)
|
||||||
|
|
||||||
|
**Option 1: Full Automated Release** (Recommended)
|
||||||
|
```bash
|
||||||
|
# This will:
|
||||||
|
# - Generate changelog
|
||||||
|
# - Update version in package.json
|
||||||
|
# - Create git tag
|
||||||
|
# - Commit changes
|
||||||
|
# - Push to remote
|
||||||
|
pnpm run release
|
||||||
|
|
||||||
|
# Dry run to preview changes
|
||||||
|
pnpm run release:dry
|
||||||
|
```
|
||||||
|
|
||||||
|
**Option 2: Manual Step-by-Step Release**
|
||||||
|
```bash
|
||||||
|
# Step 1: Generate changelog and update version
|
||||||
|
pnpm run changelog:release
|
||||||
|
|
||||||
|
# Step 2: Review the generated CHANGELOG.md
|
||||||
|
# Step 3: Create and push tag manually
|
||||||
|
git tag v0.2.0
|
||||||
|
git push origin v0.2.0
|
||||||
|
git push origin master
|
||||||
|
```
|
||||||
|
|
||||||
|
**Option 3: Changelog Only** (No version bump)
|
||||||
|
```bash
|
||||||
|
# Generate changelog without releasing
|
||||||
|
pnpm run changelog
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Version Bumping Rules
|
||||||
|
- **Major** (1.0.0): Breaking changes (`BREAKING CHANGE:` in commit footer)
|
||||||
|
- **Minor** (0.1.0): New features (`feat:` commits)
|
||||||
|
- **Patch** (0.0.1): Bug fixes, docs, style, refactor, etc.
|
||||||
|
|
||||||
|
#### Tagging Convention
|
||||||
|
- Tags follow semantic versioning: `v0.1.2`, `v1.0.0`
|
||||||
|
- Tags are automatically created during release process
|
||||||
|
- Each tag corresponds to a changelog entry
|
||||||
|
- Tags trigger automated builds and deployment
|
||||||
|
|
||||||
|
#### Best Practices
|
||||||
|
- **Use present tense**: "add feature" not "added feature"
|
||||||
|
- **Use imperative mood**: "fix bug" not "fixes bug"
|
||||||
|
- **Keep first line under 72 characters**
|
||||||
|
- **Reference issues**: "fix: resolve login issue (#123)"
|
||||||
|
- **Always document breaking changes** in commit footer
|
||||||
|
- **Be descriptive**: Explain what and why, not how
|
||||||
|
|
||||||
|
#### Common Scopes
|
||||||
|
Use these optional scopes for better organization:
|
||||||
|
- `redis` - Redis-related changes
|
||||||
|
- `ui` - User interface components
|
||||||
|
- `electron` - Electron-specific changes
|
||||||
|
- `build` - Build system changes
|
||||||
|
- `docs` - Documentation updates
|
||||||
|
|
||||||
|
## 📚 Additional Resources
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
- [Electron Documentation](https://www.electronjs.org/docs)
|
||||||
|
- [Nuxt 3 Documentation](https://nuxt.com)
|
||||||
|
- [Vue 3 Documentation](https://vuejs.org)
|
||||||
|
- [Redis Documentation](https://redis.io/docs)
|
||||||
|
|
||||||
|
### Tools & Extensions
|
||||||
|
- **VS Code Extensions**: Vue Language Features, TypeScript Vue Plugin
|
||||||
|
- **Redis GUI**: RedisInsight, Redis Desktop Manager
|
||||||
|
- **Debugging**: Vue DevTools, Electron DevTools
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🆘 Need Help?
|
||||||
|
|
||||||
|
If you encounter issues not covered in this guide:
|
||||||
|
1. Check the existing issues in the repository
|
||||||
|
2. Review the error logs carefully
|
||||||
|
3. Test with a fresh installation
|
||||||
|
4. Ask for help from the team
|
||||||
|
|
||||||
|
Welcome to the team! 🎉
|
||||||
318
README.md
318
README.md
|
|
@ -1,196 +1,158 @@
|
||||||
# Ziya Token Monitor
|
# Ziya Token Monitor
|
||||||
|
|
||||||
A modern Electron-based desktop application for monitoring Solana token creation, CEX findings, and developer balance source graphs. Built with React, Redux, and TypeScript.
|
A modern Electron-based desktop application for monitoring Solana token creation, CEX analysis, and developer balance source graphs. Built with Vue 3, Nuxt 3, and TypeScript in an Electron wrapper.
|
||||||
|
|
||||||
## Architecture
|
## 🏗️ Architecture
|
||||||
|
|
||||||
This project follows a modular architecture with three main packages:
|
This project follows a hybrid architecture combining the power of Nuxt 3 for the frontend with Electron for desktop capabilities:
|
||||||
|
|
||||||
### 📦 Packages
|
### Tech Stack
|
||||||
|
- **Frontend**: Vue 3 (Vapor Mode), Nuxt 3, TypeScript, Pinia, TailwindCSS + DaisyUI
|
||||||
- **`@ziya/shared`** - Shared types, utilities, and domain models
|
- **Desktop**: Electron with secure IPC communication
|
||||||
- **`@ziya/frontend`** - React frontend with Redux state management
|
- **Backend Integration**: Redis (ioredis) for real-time event streaming
|
||||||
- **`@ziya/backend`** - Electron main process with Redis integration
|
- **Development**: pnpm workspaces, ESLint, hot reload
|
||||||
|
|
||||||
### 🏗️ Tech Stack
|
|
||||||
|
|
||||||
- **Frontend**: React 18, Redux Toolkit, TypeScript, Styled Components, Vite
|
|
||||||
- **Backend**: Electron, Node.js, TypeScript, Redis (ioredis)
|
|
||||||
- **Shared**: TypeScript, Winston (logging)
|
|
||||||
- **Development**: Yarn Workspaces, ESLint, Prettier
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
- 📊 **Real-time Dashboard** - Monitor token activity at a glance
|
|
||||||
- 🪙 **Token Management** - Track discovered tokens and their metadata
|
|
||||||
- 🕸️ **Graph Visualization** - Visualize connection graphs for developer relationships
|
|
||||||
- 📝 **Event Streaming** - Real-time events from the Rust backend via Redis
|
|
||||||
- 🌙 **Dark/Light Theme** - Modern UI with theme switching
|
|
||||||
- 🔔 **Notifications** - Real-time notifications for important events
|
|
||||||
|
|
||||||
## Prerequisites
|
|
||||||
|
|
||||||
- Node.js 16+
|
|
||||||
- Yarn (recommended)
|
|
||||||
- Redis server running on localhost:6379
|
|
||||||
- Rust backend (`muhafidh`) running and publishing events
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
1. **Clone and install dependencies**:
|
|
||||||
```bash
|
|
||||||
cd ziya
|
|
||||||
yarn install
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **Build shared module**:
|
|
||||||
```bash
|
|
||||||
yarn workspace @ziya/shared build
|
|
||||||
```
|
|
||||||
|
|
||||||
## Development
|
|
||||||
|
|
||||||
### Start Development Server
|
|
||||||
```bash
|
|
||||||
# Start both frontend and backend in development mode
|
|
||||||
yarn dev
|
|
||||||
```
|
|
||||||
|
|
||||||
This will:
|
|
||||||
- Start the React frontend on `http://localhost:5173`
|
|
||||||
- Start the Electron backend in development mode
|
|
||||||
- Enable hot reload for both frontend and backend
|
|
||||||
|
|
||||||
### Individual Package Commands
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Frontend only
|
|
||||||
yarn workspace @ziya/frontend start
|
|
||||||
|
|
||||||
# Backend only
|
|
||||||
yarn workspace @ziya/backend dev
|
|
||||||
|
|
||||||
# Shared module
|
|
||||||
yarn workspace @ziya/shared dev
|
|
||||||
```
|
|
||||||
|
|
||||||
## Production Build
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Build all packages
|
|
||||||
yarn build
|
|
||||||
|
|
||||||
# Package the Electron app
|
|
||||||
yarn package
|
|
||||||
```
|
|
||||||
|
|
||||||
## Event Integration
|
|
||||||
|
|
||||||
The application listens for these Redis events from the `muhafidh` Rust backend:
|
|
||||||
|
|
||||||
### `token_cex_updated`
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"mint": "string",
|
|
||||||
"name": "string",
|
|
||||||
"uri": "string",
|
|
||||||
"dev_name": "string",
|
|
||||||
"cex_name": "string",
|
|
||||||
"cex_address": "string",
|
|
||||||
"cex_updated_at": "string",
|
|
||||||
"node_count": "number",
|
|
||||||
"edge_count": "number",
|
|
||||||
"graph": {
|
|
||||||
"nodes": [...],
|
|
||||||
"edges": [...]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### `max_depth_reached`
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"mint": "string",
|
|
||||||
"name": "string",
|
|
||||||
"uri": "string",
|
|
||||||
"bonding_curve": "string",
|
|
||||||
"updated_at": "string",
|
|
||||||
"node_count": "number",
|
|
||||||
"edge_count": "number",
|
|
||||||
"graph": {
|
|
||||||
"nodes": [...],
|
|
||||||
"edges": [...]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
### Redis Configuration
|
|
||||||
Set environment variables:
|
|
||||||
```bash
|
|
||||||
REDIS_HOST=localhost
|
|
||||||
REDIS_PORT=6379
|
|
||||||
```
|
|
||||||
|
|
||||||
### Electron Configuration
|
|
||||||
The app uses secure defaults:
|
|
||||||
- Context isolation enabled
|
|
||||||
- Node integration disabled
|
|
||||||
- Preload script for secure IPC
|
|
||||||
|
|
||||||
## Project Structure
|
|
||||||
|
|
||||||
|
### Project Structure
|
||||||
```
|
```
|
||||||
ziya/
|
ziya/
|
||||||
├── packages/
|
├── app/ # Nuxt 3 application
|
||||||
│ ├── shared/ # Shared types and utilities
|
│ ├── components/ # Vue components
|
||||||
│ │ ├── src/
|
│ │ ├── TokenCard.vue # Individual token display cards
|
||||||
│ │ │ ├── types/ # TypeScript interfaces
|
│ │ ├── CexAnalysisCard.vue # CEX analysis results
|
||||||
│ │ │ └── utils/ # Shared utilities
|
│ │ └── ...
|
||||||
│ │ └── package.json
|
│ ├── pages/ # Nuxt pages/routes
|
||||||
│ ├── frontend/ # React frontend
|
│ │ └── hunting-ground.vue # Main dashboard
|
||||||
│ │ ├── src/
|
│ ├── stores/ # Pinia state management
|
||||||
│ │ │ ├── components/ # React components
|
│ ├── utils/ # Utility functions
|
||||||
│ │ │ ├── pages/ # Page components
|
│ └── types/ # TypeScript definitions
|
||||||
│ │ │ ├── store/ # Redux store and slices
|
├── electron/ # Electron main process
|
||||||
│ │ │ ├── services/ # Frontend services
|
│ ├── main.ts # Electron entry point
|
||||||
│ │ │ └── styles/ # Styled components
|
│ ├── config/ # Configuration files
|
||||||
│ │ └── package.json
|
│ │ ├── environment.ts # Environment settings
|
||||||
│ └── backend/ # Electron backend
|
│ │ └── redis.ts # Redis configuration
|
||||||
│ ├── src/
|
│ ├── handlers/ # Event handlers
|
||||||
│ │ ├── services/ # Backend services
|
│ ├── utils/ # Electron utilities
|
||||||
│ │ ├── main.ts # Electron main process
|
│ └── preload.ts # Preload script for IPC
|
||||||
│ │ └── preload.ts # Preload script
|
├── types/ # Shared TypeScript types
|
||||||
│ └── package.json
|
│ └── redis-events.ts # Redis event definitions
|
||||||
├── package.json # Root workspace config
|
└── .config/ # Configuration files
|
||||||
└── README.md
|
└── nuxt.ts # Nuxt configuration
|
||||||
```
|
```
|
||||||
|
|
||||||
## Scripts
|
## ✨ Current Features
|
||||||
|
|
||||||
- `yarn dev` - Start development servers
|
### Real-time Token Dashboard
|
||||||
- `yarn build` - Build all packages
|
- **Three-column layout** displaying different token event types
|
||||||
- `yarn start` - Start production app
|
- **Live updates** via Redis pub/sub integration
|
||||||
- `yarn package` - Package Electron app
|
- **Individual card management** with close buttons
|
||||||
- `yarn clean` - Clean all build artifacts
|
- **Bulk operations** with "Clear All" functionality
|
||||||
- `yarn lint` - Run linters
|
|
||||||
- `yarn test` - Run tests
|
|
||||||
|
|
||||||
## Security
|
### Token Event Types
|
||||||
|
1. **New Token Created** - Recently minted tokens with creator information
|
||||||
|
2. **CEX Analysis** - Tokens analyzed for centralized exchange connections
|
||||||
|
3. **Max Depth Analysis** - Tokens that reached maximum analysis depth
|
||||||
|
|
||||||
- Electron app uses context isolation and disables node integration
|
### Interactive Features
|
||||||
- IPC communication uses secure preload scripts
|
- **Graph Visualization** - Hover tooltips showing node/edge relationships
|
||||||
- Redis connections use proper error handling and reconnection logic
|
- **Duration Display** - Time elapsed since token creation/analysis
|
||||||
|
- **Browser Integration** - Click to open token details in browser
|
||||||
|
- **Creator Information** - Display developer names and addresses
|
||||||
|
- **CEX Integration** - Show exchange connections and analysis results
|
||||||
|
|
||||||
## Contributing
|
## 🚀 Quick Start
|
||||||
|
|
||||||
1. Fork the repository
|
### Prerequisites
|
||||||
2. Create a feature branch
|
- Node.js >= 18.0.0
|
||||||
3. Make your changes
|
- pnpm >= 8.0.0
|
||||||
4. Run tests and linting
|
- Redis server (local or Docker)
|
||||||
5. Submit a pull request
|
|
||||||
|
|
||||||
## License
|
### Installation
|
||||||
|
```bash
|
||||||
|
# Clone and install
|
||||||
|
git clone <repository-url>
|
||||||
|
cd muhafidh/ziya
|
||||||
|
pnpm install
|
||||||
|
|
||||||
|
# Start Redis (Docker)
|
||||||
|
docker run -d --name bismillahdao-redis -p 6379:6379 redis:alpine
|
||||||
|
|
||||||
|
# Start development
|
||||||
|
pnpm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🔧 Environment Configuration
|
||||||
|
|
||||||
|
The application automatically configures Redis connection based on environment:
|
||||||
|
|
||||||
|
### Development
|
||||||
|
- **Redis**: `localhost:6379` (local) or `bismillahdao-redis:6379` (Docker)
|
||||||
|
- **Build**: `pnpm run dev`
|
||||||
|
- **Features**: Hot reload, debug logging
|
||||||
|
|
||||||
|
### Production
|
||||||
|
- **Redis**: `154.38.185.112:6379` (production server)
|
||||||
|
- **Build**: `pnpm run build:prod`
|
||||||
|
- **Features**: Optimized builds, minimal logging
|
||||||
|
|
||||||
|
## 📋 Available Scripts
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Development
|
||||||
|
pnpm run dev # Start development with hot reload
|
||||||
|
pnpm run dev:nuxt # Start only Nuxt dev server
|
||||||
|
pnpm run dev:electron # Start only Electron
|
||||||
|
|
||||||
|
# Building
|
||||||
|
pnpm run build # Production build
|
||||||
|
pnpm run build:dev # Development build
|
||||||
|
pnpm run build:prod # Production build (explicit)
|
||||||
|
|
||||||
|
# Utilities
|
||||||
|
pnpm run lint # Run ESLint
|
||||||
|
pnpm run type-check # TypeScript type checking
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🎯 Key Components
|
||||||
|
|
||||||
|
### TokenCard.vue
|
||||||
|
- Displays new token creation events
|
||||||
|
- Shows creator information and timestamps
|
||||||
|
- Handles browser integration for token details
|
||||||
|
|
||||||
|
### CexAnalysisCard.vue
|
||||||
|
- Shows CEX analysis and max depth results
|
||||||
|
- Displays graph data with interactive tooltips
|
||||||
|
- Includes duration calculation and CEX information
|
||||||
|
|
||||||
|
### hunting-ground.vue
|
||||||
|
- Main dashboard page with three-column layout
|
||||||
|
- Manages real-time Redis event subscriptions
|
||||||
|
- Handles card state management and user interactions
|
||||||
|
|
||||||
|
## 🔌 Redis Integration
|
||||||
|
|
||||||
|
The application subscribes to three Redis channels:
|
||||||
|
- `new_token_created` - New token creation events
|
||||||
|
- `token_cex_updated` - CEX analysis completion
|
||||||
|
- `max_depth_reached` - Maximum analysis depth events
|
||||||
|
|
||||||
|
Events are automatically forwarded from Electron main process to renderer via secure IPC.
|
||||||
|
|
||||||
|
## 🔒 Security Features
|
||||||
|
|
||||||
|
- **Context Isolation**: Enabled for all renderer processes
|
||||||
|
- **Sandboxing**: Renderer processes run in sandbox mode
|
||||||
|
- **Secure IPC**: All communication through preload scripts
|
||||||
|
- **No Node.js Exposure**: APIs not directly accessible to renderer
|
||||||
|
|
||||||
|
## 🤝 Contributing
|
||||||
|
|
||||||
|
For detailed development setup, code style guidelines, and contribution workflow, please see [CONTRIBUTORS.md](./CONTRIBUTORS.md).
|
||||||
|
|
||||||
|
## 📄 License
|
||||||
|
|
||||||
MIT License - see LICENSE file for details.
|
MIT License - see LICENSE file for details.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Ready to monitor Solana tokens in real-time! 🚀**
|
||||||
|
|
|
||||||
169
app.config.ts
Normal file
169
app.config.ts
Normal file
|
|
@ -0,0 +1,169 @@
|
||||||
|
/**
|
||||||
|
* Ziya Application Configuration
|
||||||
|
* Centralized configuration for all app settings
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface AppConfig {
|
||||||
|
app: {
|
||||||
|
name: string;
|
||||||
|
version: string;
|
||||||
|
description: string;
|
||||||
|
author: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
development: {
|
||||||
|
nuxt: {
|
||||||
|
host: string;
|
||||||
|
port: number;
|
||||||
|
https: boolean;
|
||||||
|
};
|
||||||
|
electron: {
|
||||||
|
devTools: boolean;
|
||||||
|
reloadOnChange: boolean;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
production: {
|
||||||
|
electron: {
|
||||||
|
devTools: boolean;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
window: {
|
||||||
|
minHeight: number;
|
||||||
|
minWidth: number;
|
||||||
|
maxHeight: number;
|
||||||
|
maxWidth: number;
|
||||||
|
defaultHeight: number;
|
||||||
|
defaultWidth: number;
|
||||||
|
titleBarStyle: 'default' | 'hidden' | 'hiddenInset' | 'customButtonsOnHover';
|
||||||
|
};
|
||||||
|
|
||||||
|
theme: {
|
||||||
|
defaultPalette: number;
|
||||||
|
defaultDarkMode: boolean;
|
||||||
|
availablePalettes: number[];
|
||||||
|
};
|
||||||
|
|
||||||
|
redis: {
|
||||||
|
host: string;
|
||||||
|
port: number;
|
||||||
|
db: number;
|
||||||
|
keyPrefix: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
security: {
|
||||||
|
csp: {
|
||||||
|
scriptSrc: string[];
|
||||||
|
styleSrc: string[];
|
||||||
|
imgSrc: string[];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default configuration
|
||||||
|
*/
|
||||||
|
export const appConfig: AppConfig = {
|
||||||
|
app: {
|
||||||
|
name: 'Ziya',
|
||||||
|
version: '1.0.0',
|
||||||
|
description: 'One stop shop trading solution',
|
||||||
|
author: 'bismillahDAO',
|
||||||
|
},
|
||||||
|
|
||||||
|
development: {
|
||||||
|
nuxt: {
|
||||||
|
host: 'localhost',
|
||||||
|
port: 3000,
|
||||||
|
https: false,
|
||||||
|
},
|
||||||
|
electron: {
|
||||||
|
devTools: true,
|
||||||
|
reloadOnChange: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
production: {
|
||||||
|
electron: {
|
||||||
|
devTools: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
window: {
|
||||||
|
minHeight: 800,
|
||||||
|
minWidth: 1080,
|
||||||
|
maxHeight: 1080,
|
||||||
|
maxWidth: 1920,
|
||||||
|
defaultHeight: 1024,
|
||||||
|
defaultWidth: 1280,
|
||||||
|
titleBarStyle: 'hidden',
|
||||||
|
},
|
||||||
|
|
||||||
|
theme: {
|
||||||
|
defaultPalette: 1,
|
||||||
|
defaultDarkMode: false,
|
||||||
|
availablePalettes: Array.from({ length: 24 }, (_, i) => i + 1),
|
||||||
|
},
|
||||||
|
|
||||||
|
redis: {
|
||||||
|
host: 'localhost',
|
||||||
|
port: 6379,
|
||||||
|
db: 0,
|
||||||
|
keyPrefix: 'ziya:',
|
||||||
|
},
|
||||||
|
|
||||||
|
security: {
|
||||||
|
csp: {
|
||||||
|
scriptSrc: ["'self'", "'unsafe-inline'"],
|
||||||
|
styleSrc: ["'self'", "'unsafe-inline'"],
|
||||||
|
imgSrc: ["'self'", 'data:', 'https:'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get configuration value with environment override support
|
||||||
|
*/
|
||||||
|
export function getConfig(): AppConfig {
|
||||||
|
// Allow environment variables to override config
|
||||||
|
const config = { ...appConfig };
|
||||||
|
|
||||||
|
// Override with environment variables if they exist
|
||||||
|
if (process.env.NUXT_DEV_PORT) {
|
||||||
|
config.development.nuxt.port = parseInt(process.env.NUXT_DEV_PORT, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.env.NUXT_DEV_HOST) {
|
||||||
|
config.development.nuxt.host = process.env.NUXT_DEV_HOST;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.env.REDIS_HOST) {
|
||||||
|
config.redis.host = process.env.REDIS_HOST;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.env.REDIS_PORT) {
|
||||||
|
config.redis.port = parseInt(process.env.REDIS_PORT, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the development server URL
|
||||||
|
*/
|
||||||
|
export function getDevServerUrl(): string {
|
||||||
|
const config = getConfig();
|
||||||
|
const { host, port, https } = config.development.nuxt;
|
||||||
|
const protocol = https ? 'https' : 'http';
|
||||||
|
return `${protocol}://${host}:${port}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Environment-specific configuration helpers
|
||||||
|
*/
|
||||||
|
export const isDevelopment = process.env.NODE_ENV === 'development';
|
||||||
|
export const isProduction = process.env.NODE_ENV === 'production';
|
||||||
|
export const isElectron = process.env.IS_ELECTRON === 'true';
|
||||||
|
|
||||||
|
export default appConfig;
|
||||||
26
app.vue
Normal file
26
app.vue
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
/// <reference types="../types/electron" />
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<NuxtLayout>
|
||||||
|
<NuxtPage />
|
||||||
|
</NuxtLayout>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
/**
|
||||||
|
* Main App Component
|
||||||
|
*
|
||||||
|
* This is the root component that handles global layout rendering.
|
||||||
|
* It provides the foundation for the entire Ziya application.
|
||||||
|
*
|
||||||
|
* The component is intentionally minimal to avoid SSR issues with
|
||||||
|
* Pinia stores and to ensure proper initialization flow.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Component metadata
|
||||||
|
defineOptions({
|
||||||
|
name: 'ZiyaApp',
|
||||||
|
});
|
||||||
|
</script>
|
||||||
38
app/app.vue
38
app/app.vue
|
|
@ -1,45 +1,15 @@
|
||||||
|
/// <reference types="../types/electron" />
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div :data-theme="themeStore.currentTheme" class="app-container">
|
<div>
|
||||||
<NuxtLayout>
|
<NuxtLayout>
|
||||||
<NuxtPage />
|
<NuxtPage />
|
||||||
</NuxtLayout>
|
</NuxtLayout>
|
||||||
|
|
||||||
<!-- Toast Notification -->
|
|
||||||
<div v-if="appStore.showToast" class="toast toast-top toast-end">
|
|
||||||
<div
|
|
||||||
:class="[
|
|
||||||
'alert',
|
|
||||||
{
|
|
||||||
'alert-success': appStore.toastType === 'success',
|
|
||||||
'alert-error': appStore.toastType === 'error',
|
|
||||||
'alert-info': appStore.toastType === 'info',
|
|
||||||
},
|
|
||||||
]"
|
|
||||||
>
|
|
||||||
<span>{{ appStore.toastMessage }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// App-level setup
|
// Main app component - handles global layout rendering
|
||||||
useHead({
|
|
||||||
title: 'Ziya - Trading Platform',
|
|
||||||
meta: [
|
|
||||||
{ name: 'description', content: 'One Stop Shop for your trading needs' },
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|
||||||
// Initialize stores
|
|
||||||
const appStore = useAppStore();
|
|
||||||
const themeStore = useThemeStore();
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
// Initialize both stores
|
|
||||||
appStore.initializeFromStorage();
|
|
||||||
themeStore.initializeTheme();
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
||||||
|
|
@ -383,15 +383,6 @@ html, body {
|
||||||
animation: spin 1s linear infinite;
|
animation: spin 1s linear infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Desktop app essentials only */
|
|
||||||
::-webkit-scrollbar {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
* {
|
|
||||||
scrollbar-width: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Login page layout - not covered by DaisyUI */
|
/* Login page layout - not covered by DaisyUI */
|
||||||
.login-container {
|
.login-container {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,24 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-end">
|
<div class="navbar-end">
|
||||||
<div class="dropdown dropdown-end">
|
<div class="dropdown dropdown-end">
|
||||||
<div tabindex="0" role="button" class="btn btn-ghost btn-circle avatar">
|
<div
|
||||||
|
tabindex="0"
|
||||||
|
role="button"
|
||||||
|
class="btn btn-ghost btn-circle avatar"
|
||||||
|
>
|
||||||
<div class="w-10 rounded-full bg-primary flex items-center justify-center">
|
<div class="w-10 rounded-full bg-primary flex items-center justify-center">
|
||||||
<span class="text-primary-content font-bold text-sm">
|
<span class="text-primary-content font-bold text-sm">
|
||||||
{{ userInitials }}
|
{{ userInitials }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ul tabindex="0" class="menu menu-sm dropdown-content mt-3 z-[1] p-2 shadow bg-base-100 rounded-box w-64">
|
<ul
|
||||||
<li><a @click="navigateToProfile">Profile</a></li>
|
tabindex="0"
|
||||||
|
class="menu menu-sm dropdown-content mt-3 z-[1] p-2 shadow bg-base-100 rounded-box w-64"
|
||||||
|
>
|
||||||
|
<li>
|
||||||
|
<a @click="navigateToProfile">Profile</a>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<details>
|
<details>
|
||||||
<summary>Theme Settings</summary>
|
<summary>Theme Settings</summary>
|
||||||
|
|
@ -22,7 +31,9 @@
|
||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
</li>
|
</li>
|
||||||
<li><a @click="handleLogout">Logout</a></li>
|
<li>
|
||||||
|
<a @click="handleLogout">Logout</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -30,11 +41,23 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
interface Props {
|
import { computed } from 'vue';
|
||||||
title: string;
|
import { useNavigation } from '../composables/navigation';
|
||||||
}
|
import { useAppStore } from '../stores/app';
|
||||||
|
|
||||||
const props = defineProps<Props>();
|
const props = defineProps<{
|
||||||
|
title: string;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// Validate title prop
|
||||||
|
const validateTitle = (title: string): boolean => {
|
||||||
|
return typeof title === 'string' && title.length > 0 && title.length <= 50;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Validate props
|
||||||
|
if (!validateTitle(props.title)) {
|
||||||
|
console.warn('AppNavbar: title prop should be a non-empty string with max 50 characters');
|
||||||
|
}
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const { navigateToProfile, handleLogout } = useNavigation();
|
const { navigateToProfile, handleLogout } = useNavigation();
|
||||||
|
|
|
||||||
|
|
@ -34,11 +34,13 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { useNavigation } from '../composables/navigation';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
currentRoute: string;
|
currentRoute: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<Props>();
|
defineProps<Props>();
|
||||||
|
|
||||||
const { navigateToDashboard, navigateToProfile, navigateToHuntingGround } = useNavigation();
|
const { navigateToDashboard, navigateToProfile, navigateToHuntingGround } = useNavigation();
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
538
app/components/CexAnalysisCard.vue
Normal file
538
app/components/CexAnalysisCard.vue
Normal file
|
|
@ -0,0 +1,538 @@
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
class="cex-analysis-card relative bg-base-100 hover:bg-base-200/50 transition-all duration-200 cursor-pointer border-b border-base-300 last:border-b-0"
|
||||||
|
:class="cardClass"
|
||||||
|
@click="$emit('click', token)"
|
||||||
|
>
|
||||||
|
<!-- Quick actions (visible on hover) -->
|
||||||
|
<div class="absolute top-2 right-2 z-10 opacity-0 group-hover:opacity-100 transition-opacity duration-200 flex gap-1">
|
||||||
|
<button
|
||||||
|
class="w-6 h-6 bg-base-300/90 hover:bg-error rounded text-base-content/60 hover:text-error-content transition-colors flex items-center justify-center text-xs"
|
||||||
|
title="Close token"
|
||||||
|
@click.stop="$emit('close', token)"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:x-mark" class="w-3 h-3" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="w-6 h-6 bg-base-300/90 hover:bg-base-300 rounded text-base-content/60 hover:text-primary transition-colors flex items-center justify-center text-xs"
|
||||||
|
title="Hide token"
|
||||||
|
@click.stop="$emit('hide', token)"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:eye-slash" class="w-3 h-3" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="w-6 h-6 bg-base-300/90 hover:bg-base-300 rounded text-base-content/60 hover:text-warning transition-colors flex items-center justify-center text-xs"
|
||||||
|
title="Watch token"
|
||||||
|
@click.stop="$emit('watch', token)"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:bookmark" class="w-3 h-3" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Quick buy button (bottom right) -->
|
||||||
|
<div class="absolute bottom-2 right-2 z-10 opacity-0 group-hover:opacity-100 transition-opacity duration-200">
|
||||||
|
<button
|
||||||
|
class="bg-primary hover:bg-primary/80 text-primary-content px-2 py-1 rounded text-xs font-medium flex items-center gap-1 shadow-sm"
|
||||||
|
@click.stop="$emit('quick-buy', token)"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:bolt" class="w-3 h-3" />
|
||||||
|
Quick Buy
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Main content -->
|
||||||
|
<div class="p-3 group">
|
||||||
|
<div class="flex items-start gap-3">
|
||||||
|
<!-- Token image/avatar -->
|
||||||
|
<div class="flex-shrink-0">
|
||||||
|
<div v-if="metadata?.image && !imageError" class="w-10 h-10 rounded-lg overflow-hidden bg-base-300 relative">
|
||||||
|
<img
|
||||||
|
:src="metadata.image"
|
||||||
|
:alt="token.name"
|
||||||
|
class="w-full h-full object-cover"
|
||||||
|
@error="handleImageError"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="_metadataLoading" class="w-10 h-10 bg-base-300 rounded-lg flex items-center justify-center">
|
||||||
|
<div class="loading loading-spinner loading-xs text-primary" />
|
||||||
|
</div>
|
||||||
|
<div v-else-if="_metadataError" class="w-10 h-10 bg-error/20 rounded-lg flex items-center justify-center" :title="_metadataError">
|
||||||
|
<Icon name="heroicons:exclamation-triangle" class="w-4 h-4 text-error" />
|
||||||
|
</div>
|
||||||
|
<div v-else class="w-10 h-10 bg-gradient-to-br from-primary to-secondary rounded-lg flex items-center justify-center">
|
||||||
|
<span class="text-primary-content font-bold text-sm">{{ token.name?.charAt(0) || '?' }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Token info -->
|
||||||
|
<div class="flex-1 min-w-0">
|
||||||
|
<!-- Header with name and CEX badge -->
|
||||||
|
<div class="flex items-center gap-2 mb-1">
|
||||||
|
<h3 class="font-semibold text-sm text-base-content truncate">{{ token.name }}</h3>
|
||||||
|
<div class="flex items-center gap-1">
|
||||||
|
<!-- CEX badge with icon -->
|
||||||
|
<div
|
||||||
|
class="badge badge-xs flex items-center gap-1 px-2 py-1"
|
||||||
|
:class="cexBadgeClass"
|
||||||
|
>
|
||||||
|
<Icon :name="cexIcon" class="w-3 h-3" />
|
||||||
|
{{ cexDisplayName }}
|
||||||
|
</div>
|
||||||
|
<!-- CEX wallet type (if not main exchange name) -->
|
||||||
|
<span v-if="cexWalletType" class="text-xs text-base-content/50 font-mono">
|
||||||
|
{{ cexWalletType }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Address -->
|
||||||
|
<div class="flex items-center gap-2 mb-2">
|
||||||
|
<span class="text-xs text-base-content/60 font-mono">{{ truncateAddress(mintAddress) }}</span>
|
||||||
|
<button
|
||||||
|
class="text-base-content/40 hover:text-primary transition-colors"
|
||||||
|
title="Copy address"
|
||||||
|
@click.stop="copyToClipboard(mintAddress)"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:clipboard-document" class="w-3 h-3" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Analysis info and creator -->
|
||||||
|
<div class="flex items-center justify-between mb-2">
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<!-- Analysis type badge -->
|
||||||
|
<span class="badge badge-info badge-xs">
|
||||||
|
CEX ANALYSIS
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- Dev info (if not unknown_dev) -->
|
||||||
|
<div v-if="showDevInfo" class="flex items-center gap-1">
|
||||||
|
<Icon name="heroicons:user-circle" class="w-3 h-3 text-warning" />
|
||||||
|
<span class="text-xs text-warning font-medium">{{ token.dev_name }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Creator with graph tooltip -->
|
||||||
|
<div
|
||||||
|
class="relative"
|
||||||
|
@mouseenter="showGraphTooltip = true"
|
||||||
|
@mouseleave="showGraphTooltip = false"
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
:href="`https://solscan.io/account/${token.creator}`"
|
||||||
|
target="_blank"
|
||||||
|
class="flex items-center gap-1 text-xs text-base-content/50 hover:text-primary transition-colors"
|
||||||
|
title="View creator on Solscan"
|
||||||
|
@click.stop
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:user" class="w-3 h-3" />
|
||||||
|
{{ truncateAddress(token.creator) }}
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- Graph tooltip -->
|
||||||
|
<div
|
||||||
|
v-if="showGraphTooltip && graphNodes.length > 0"
|
||||||
|
class="absolute bottom-full left-0 mb-2 z-50 bg-base-200 rounded-lg shadow-lg border border-base-300 p-3 min-w-[200px]"
|
||||||
|
>
|
||||||
|
<div class="text-xs font-medium text-base-content mb-2">Connection Graph</div>
|
||||||
|
<div class="space-y-1">
|
||||||
|
<div v-for="node in graphNodes.slice(0, 5)" :key="node.id" class="flex items-center gap-2 text-xs">
|
||||||
|
<div class="w-2 h-2 rounded-full bg-primary" />
|
||||||
|
<span class="font-mono text-base-content/70">{{ truncateAddress(node.id) }}</span>
|
||||||
|
</div>
|
||||||
|
<div v-if="graphNodes.length > 5" class="text-xs text-base-content/50 text-center pt-1">
|
||||||
|
+{{ graphNodes.length - 5 }} more nodes
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="mt-2 pt-2 border-t border-base-300 text-xs text-base-content/60">
|
||||||
|
{{ token.node_count }} nodes, {{ token.edge_count }} edges
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Analysis duration -->
|
||||||
|
<span class="text-xs text-base-content/50">
|
||||||
|
{{ analysisDuration }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Social links (if available) -->
|
||||||
|
<div v-if="metadata && hasSocialLinks" class="flex items-center gap-1 mt-2">
|
||||||
|
<a
|
||||||
|
v-if="metadata.twitter"
|
||||||
|
:href="metadata.twitter"
|
||||||
|
target="_blank"
|
||||||
|
class="w-5 h-5 text-base-content/40 hover:text-info transition-colors"
|
||||||
|
title="Twitter"
|
||||||
|
@click.stop
|
||||||
|
>
|
||||||
|
<Icon name="simple-icons:x" class="w-3 h-3" />
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
v-if="metadata.telegram"
|
||||||
|
:href="metadata.telegram"
|
||||||
|
target="_blank"
|
||||||
|
class="w-5 h-5 text-base-content/40 hover:text-info transition-colors"
|
||||||
|
title="Telegram"
|
||||||
|
@click.stop
|
||||||
|
>
|
||||||
|
<Icon name="simple-icons:telegram" class="w-3 h-3" />
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
v-if="metadata.website"
|
||||||
|
:href="metadata.website"
|
||||||
|
target="_blank"
|
||||||
|
class="w-5 h-5 text-base-content/40 hover:text-info transition-colors"
|
||||||
|
title="Website"
|
||||||
|
@click.stop
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:globe-alt" class="w-3 h-3" />
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
v-if="metadata.discord"
|
||||||
|
:href="metadata.discord"
|
||||||
|
target="_blank"
|
||||||
|
class="w-5 h-5 text-base-content/40 hover:text-info transition-colors"
|
||||||
|
title="Discord"
|
||||||
|
@click.stop
|
||||||
|
>
|
||||||
|
<Icon name="simple-icons:discord" class="w-3 h-3" />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { computed, onMounted, ref } from 'vue';
|
||||||
|
import { truncateAddress as truncateAddr } from '~/utils/address';
|
||||||
|
import type { MaxDepthReachedData, TokenCexUpdatedData, TokenMetadata } from '../../types/redis-events';
|
||||||
|
import { fetchTokenMetadata } from '../utils/ipfs';
|
||||||
|
|
||||||
|
// Props
|
||||||
|
interface Props {
|
||||||
|
token: TokenCexUpdatedData | MaxDepthReachedData;
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = defineProps<Props>();
|
||||||
|
|
||||||
|
// Emits
|
||||||
|
interface Emits {
|
||||||
|
(e: 'click' | 'hide' | 'watch' | 'quick-buy' | 'close', token: TokenCexUpdatedData | MaxDepthReachedData): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
defineEmits<Emits>();
|
||||||
|
|
||||||
|
// Reactive data
|
||||||
|
const imageError = ref(false);
|
||||||
|
const mintAddress = ref<string>('');
|
||||||
|
const showGraphTooltip = ref(false);
|
||||||
|
|
||||||
|
// Simple metadata state management
|
||||||
|
const metadata = ref<TokenMetadata | null>(null);
|
||||||
|
const _metadataLoading = ref(false);
|
||||||
|
const _metadataError = ref<string | null>(null);
|
||||||
|
|
||||||
|
// CEX mapping utilities
|
||||||
|
const getCexInfo = (cexName: string) => {
|
||||||
|
const name = cexName.toLowerCase();
|
||||||
|
|
||||||
|
// Extract base exchange name and wallet type
|
||||||
|
if (name.includes('coinbase')) {
|
||||||
|
const type = name.replace('coinbase_', '').replace('coinbase', '');
|
||||||
|
return {
|
||||||
|
baseName: 'Coinbase',
|
||||||
|
walletType: type ? type.toUpperCase() : '',
|
||||||
|
color: 'badge-info',
|
||||||
|
icon: 'simple-icons:coinbase'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.includes('binance')) {
|
||||||
|
const type = name.replace('binance_', '').replace('binance', '');
|
||||||
|
return {
|
||||||
|
baseName: 'Binance',
|
||||||
|
walletType: type ? type.toUpperCase() : '',
|
||||||
|
color: 'badge-warning',
|
||||||
|
icon: 'simple-icons:binance'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.includes('okx')) {
|
||||||
|
const type = name.replace('okx_', '').replace('okx', '');
|
||||||
|
return {
|
||||||
|
baseName: 'OKX',
|
||||||
|
walletType: type ? type.toUpperCase() : '',
|
||||||
|
color: 'badge-primary',
|
||||||
|
icon: 'heroicons:building-office'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.includes('kraken')) {
|
||||||
|
const type = name.replace('kraken_', '').replace('kraken', '');
|
||||||
|
return {
|
||||||
|
baseName: 'Kraken',
|
||||||
|
walletType: type ? type.toUpperCase() : '',
|
||||||
|
color: 'badge-secondary',
|
||||||
|
icon: 'heroicons:building-office-2'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.includes('mexc')) {
|
||||||
|
const type = name.replace('mexc_', '').replace('mexc', '');
|
||||||
|
return {
|
||||||
|
baseName: 'MEXC',
|
||||||
|
walletType: type ? type.toUpperCase() : '',
|
||||||
|
color: 'badge-accent',
|
||||||
|
icon: 'heroicons:building-office'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.includes('bitget')) {
|
||||||
|
const type = name.replace('bitget_', '').replace('bitget', '');
|
||||||
|
return {
|
||||||
|
baseName: 'Bitget',
|
||||||
|
walletType: type ? type.toUpperCase() : '',
|
||||||
|
color: 'badge-info',
|
||||||
|
icon: 'heroicons:building-office'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.includes('gateio') || name.includes('gate.io')) {
|
||||||
|
const type = name.replace('gateio_', '').replace('gateio', '');
|
||||||
|
return {
|
||||||
|
baseName: 'Gate.io',
|
||||||
|
walletType: type ? type.toUpperCase() : '',
|
||||||
|
color: 'badge-primary',
|
||||||
|
icon: 'heroicons:building-office'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.includes('bybit')) {
|
||||||
|
const type = name.replace('bybit_', '').replace('bybit', '');
|
||||||
|
return {
|
||||||
|
baseName: 'Bybit',
|
||||||
|
walletType: type ? type.toUpperCase() : '',
|
||||||
|
color: 'badge-warning',
|
||||||
|
icon: 'heroicons:building-office'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.includes('bitfinex')) {
|
||||||
|
const type = name.replace('bitfinex_', '').replace('bitfinex', '');
|
||||||
|
return {
|
||||||
|
baseName: 'Bitfinex',
|
||||||
|
walletType: type ? type.toUpperCase() : '',
|
||||||
|
color: 'badge-success',
|
||||||
|
icon: 'heroicons:building-office'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.includes('kucoin')) {
|
||||||
|
const type = name.replace('kucoin_', '').replace('kucoin', '');
|
||||||
|
return {
|
||||||
|
baseName: 'KuCoin',
|
||||||
|
walletType: type ? type.toUpperCase() : '',
|
||||||
|
color: 'badge-accent',
|
||||||
|
icon: 'heroicons:building-office'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.includes('poloniex')) {
|
||||||
|
const type = name.replace('poloniex_', '').replace('poloniex', '');
|
||||||
|
return {
|
||||||
|
baseName: 'Poloniex',
|
||||||
|
walletType: type ? type.toUpperCase() : '',
|
||||||
|
color: 'badge-neutral',
|
||||||
|
icon: 'heroicons:building-office'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.includes('lbank')) {
|
||||||
|
return {
|
||||||
|
baseName: 'LBank',
|
||||||
|
walletType: '',
|
||||||
|
color: 'badge-neutral',
|
||||||
|
icon: 'heroicons:building-office'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.includes('debridge')) {
|
||||||
|
return {
|
||||||
|
baseName: 'DeBridge',
|
||||||
|
walletType: 'VAULT',
|
||||||
|
color: 'badge-secondary',
|
||||||
|
icon: 'heroicons:shield-check'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.includes('revolut')) {
|
||||||
|
return {
|
||||||
|
baseName: 'Revolut',
|
||||||
|
walletType: 'HOT',
|
||||||
|
color: 'badge-info',
|
||||||
|
icon: 'heroicons:credit-card'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.includes('bitstamp')) {
|
||||||
|
return {
|
||||||
|
baseName: 'BitStamp',
|
||||||
|
walletType: 'HOT',
|
||||||
|
color: 'badge-success',
|
||||||
|
icon: 'heroicons:building-office'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.includes('stakecom')) {
|
||||||
|
return {
|
||||||
|
baseName: 'Stake.com',
|
||||||
|
walletType: 'HOT',
|
||||||
|
color: 'badge-warning',
|
||||||
|
icon: 'heroicons:fire'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default for unknown exchanges
|
||||||
|
return {
|
||||||
|
baseName: cexName.replace(/_/g, ' ').toUpperCase(),
|
||||||
|
walletType: '',
|
||||||
|
color: 'badge-neutral',
|
||||||
|
icon: 'heroicons:building-office'
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// Computed properties
|
||||||
|
const cexInfo = computed(() => getCexInfo(props.token.cex_name));
|
||||||
|
|
||||||
|
const cardClass = computed(() => {
|
||||||
|
const baseClass = 'h-[140px] min-h-[140px]';
|
||||||
|
// Use CEX-specific border color
|
||||||
|
if (cexInfo.value.color.includes('info')) {
|
||||||
|
return `${baseClass} border-l-2 border-l-info`;
|
||||||
|
} else if (cexInfo.value.color.includes('warning')) {
|
||||||
|
return `${baseClass} border-l-2 border-l-warning`;
|
||||||
|
} else if (cexInfo.value.color.includes('success')) {
|
||||||
|
return `${baseClass} border-l-2 border-l-success`;
|
||||||
|
} else if (cexInfo.value.color.includes('primary')) {
|
||||||
|
return `${baseClass} border-l-2 border-l-primary`;
|
||||||
|
} else if (cexInfo.value.color.includes('secondary')) {
|
||||||
|
return `${baseClass} border-l-2 border-l-secondary`;
|
||||||
|
} else if (cexInfo.value.color.includes('accent')) {
|
||||||
|
return `${baseClass} border-l-2 border-l-accent`;
|
||||||
|
}
|
||||||
|
return `${baseClass} border-l-2 border-l-neutral`;
|
||||||
|
});
|
||||||
|
|
||||||
|
const cexBadgeClass = computed(() => cexInfo.value.color);
|
||||||
|
const cexDisplayName = computed(() => cexInfo.value.baseName);
|
||||||
|
const cexWalletType = computed(() => cexInfo.value.walletType);
|
||||||
|
const cexIcon = computed(() => cexInfo.value.icon);
|
||||||
|
|
||||||
|
const showDevInfo = computed(() => {
|
||||||
|
return props.token.dev_name && props.token.dev_name !== 'unknown_dev';
|
||||||
|
});
|
||||||
|
|
||||||
|
const analysisDuration = computed(() => {
|
||||||
|
const createdAt = typeof props.token.created_at === 'string'
|
||||||
|
? parseInt(props.token.created_at)
|
||||||
|
: props.token.created_at;
|
||||||
|
const updatedAt = typeof props.token.updated_at === 'string'
|
||||||
|
? parseInt(props.token.updated_at)
|
||||||
|
: props.token.updated_at;
|
||||||
|
|
||||||
|
const durationSeconds = updatedAt - createdAt;
|
||||||
|
|
||||||
|
if (durationSeconds < 60) {
|
||||||
|
return `${durationSeconds}s analysis`;
|
||||||
|
} else if (durationSeconds < 3600) {
|
||||||
|
const minutes = Math.floor(durationSeconds / 60);
|
||||||
|
return `${minutes}m analysis`;
|
||||||
|
} else {
|
||||||
|
const hours = Math.floor(durationSeconds / 3600);
|
||||||
|
const minutes = Math.floor((durationSeconds % 3600) / 60);
|
||||||
|
return `${hours}h ${minutes}m analysis`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const graphNodes = computed(() => {
|
||||||
|
try {
|
||||||
|
if (props.token.graph && typeof props.token.graph === 'object') {
|
||||||
|
const graph = props.token.graph as { graph?: { nodes?: Array<{ id: string }> } };
|
||||||
|
if (graph.graph && graph.graph.nodes) {
|
||||||
|
return graph.graph.nodes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error parsing graph data:', error);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const hasSocialLinks = computed(() => {
|
||||||
|
return metadata.value && (
|
||||||
|
metadata.value.twitter ||
|
||||||
|
metadata.value.telegram ||
|
||||||
|
metadata.value.website ||
|
||||||
|
metadata.value.discord
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Methods
|
||||||
|
const truncateAddress = (address: string): string => {
|
||||||
|
return truncateAddr(address);
|
||||||
|
};
|
||||||
|
|
||||||
|
const copyToClipboard = async (text: string): Promise<void> => {
|
||||||
|
try {
|
||||||
|
await navigator.clipboard.writeText(text);
|
||||||
|
// You could add a toast notification here
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to copy to clipboard:', err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleImageError = (): void => {
|
||||||
|
imageError.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Load metadata on mount
|
||||||
|
onMounted(async () => {
|
||||||
|
// Set mint address (now it's already a string)
|
||||||
|
mintAddress.value = props.token.mint;
|
||||||
|
|
||||||
|
// Load metadata if URI exists
|
||||||
|
if (props.token.uri) {
|
||||||
|
_metadataLoading.value = true;
|
||||||
|
_metadataError.value = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const result = await fetchTokenMetadata(props.token.uri);
|
||||||
|
metadata.value = result;
|
||||||
|
} catch (error) {
|
||||||
|
const errorMessage = error instanceof Error ? error.message : 'Failed to fetch metadata';
|
||||||
|
_metadataError.value = errorMessage;
|
||||||
|
} finally {
|
||||||
|
_metadataLoading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.cex-analysis-card {
|
||||||
|
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cex-analysis-card:hover {
|
||||||
|
transform: translateY(-1px);
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.group:hover .opacity-0 {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -10,19 +10,31 @@
|
||||||
>
|
>
|
||||||
|
|
||||||
<!-- Sun icon -->
|
<!-- Sun icon -->
|
||||||
<svg class="swap-off fill-current w-6 h-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
<svg
|
||||||
|
class="swap-off fill-current w-6 h-6"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
<path d="M5.64,17l-.71.71a1,1,0,0,0,0,1.41,1,1,0,0,0,1.41,0l.71-.71A1,1,0,0,0,5.64,17ZM5,12a1,1,0,0,0-1-1H3a1,1,0,0,0,0,2H4A1,1,0,0,0,5,12Zm7-7a1,1,0,0,0,1-1V3a1,1,0,0,0-2,0V4A1,1,0,0,0,12,5ZM5.64,7.05a1,1,0,0,0,.7.29,1,1,0,0,0,.71-.29,1,1,0,0,0,0-1.41l-.71-.71A1,1,0,0,0,4.93,6.34Zm12,.29a1,1,0,0,0,.7-.29l.71-.71a1,1,0,1,0-1.41-1.41L17,5.64a1,1,0,0,0,0,1.41A1,1,0,0,0,17.66,7.34ZM21,11H20a1,1,0,0,0,0,2h1a1,1,0,0,0,0-2Zm-9,8a1,1,0,0,0-1,1v1a1,1,0,0,0,2,0V20A1,1,0,0,0,12,19ZM18.36,17A1,1,0,0,0,17,18.36l.71.71a1,1,0,0,0,1.41,0,1,1,0,0,0,0-1.41ZM12,6.5A5.5,5.5,0,1,0,17.5,12,5.51,5.51,0,0,0,12,6.5Zm0,9A3.5,3.5,0,1,1,15.5,12,3.5,3.5,0,0,1,12,15.5Z" />
|
<path d="M5.64,17l-.71.71a1,1,0,0,0,0,1.41,1,1,0,0,0,1.41,0l.71-.71A1,1,0,0,0,5.64,17ZM5,12a1,1,0,0,0-1-1H3a1,1,0,0,0,0,2H4A1,1,0,0,0,5,12Zm7-7a1,1,0,0,0,1-1V3a1,1,0,0,0-2,0V4A1,1,0,0,0,12,5ZM5.64,7.05a1,1,0,0,0,.7.29,1,1,0,0,0,.71-.29,1,1,0,0,0,0-1.41l-.71-.71A1,1,0,0,0,4.93,6.34Zm12,.29a1,1,0,0,0,.7-.29l.71-.71a1,1,0,1,0-1.41-1.41L17,5.64a1,1,0,0,0,0,1.41A1,1,0,0,0,17.66,7.34ZM21,11H20a1,1,0,0,0,0,2h1a1,1,0,0,0,0-2Zm-9,8a1,1,0,0,0-1,1v1a1,1,0,0,0,2,0V20A1,1,0,0,0,12,19ZM18.36,17A1,1,0,0,0,17,18.36l.71.71a1,1,0,0,0,1.41,0,1,1,0,0,0,0-1.41ZM12,6.5A5.5,5.5,0,1,0,17.5,12,5.51,5.51,0,0,0,12,6.5Zm0,9A3.5,3.5,0,1,1,15.5,12,3.5,3.5,0,0,1,12,15.5Z" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|
||||||
<!-- Moon icon -->
|
<!-- Moon icon -->
|
||||||
<svg class="swap-on fill-current w-6 h-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
<svg
|
||||||
|
class="swap-on fill-current w-6 h-6"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
<path d="M21.64,13a1,1,0,0,0-1.05-.14,8.05,8.05,0,0,1-3.37.73A8.15,8.15,0,0,1,9.08,5.49a8.59,8.59,0,0,1,.25-2A1,1,0,0,0,8,2.36,10.14,10.14,0,1,0,22,14.05,1,1,0,0,0,21.64,13Zm-9.5,6.69A8.14,8.14,0,0,1,7.08,5.22v.27A10.15,10.15,0,0,0,17.22,15.63a9.79,9.79,0,0,0,2.1-.22A8.11,8.11,0,0,1,12.14,19.73Z" />
|
<path d="M21.64,13a1,1,0,0,0-1.05-.14,8.05,8.05,0,0,1-3.37.73A8.15,8.15,0,0,1,9.08,5.49a8.59,8.59,0,0,1,.25-2A1,1,0,0,0,8,2.36,10.14,10.14,0,1,0,22,14.05,1,1,0,0,0,21.64,13Zm-9.5,6.69A8.14,8.14,0,0,1,7.08,5.22v.27A10.15,10.15,0,0,0,17.22,15.63a9.79,9.79,0,0,0,2.1-.22A8.11,8.11,0,0,1,12.14,19.73Z" />
|
||||||
</svg>
|
</svg>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<!-- Palette Dropdown -->
|
<!-- Palette Dropdown -->
|
||||||
<div class="dropdown dropdown-end">
|
<div class="dropdown dropdown-end">
|
||||||
<div tabindex="0" role="button" class="btn btn-sm btn-outline flex items-center gap-2">
|
<div
|
||||||
|
tabindex="0"
|
||||||
|
role="button"
|
||||||
|
class="btn btn-sm btn-outline flex items-center gap-2"
|
||||||
|
>
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<div
|
<div
|
||||||
class="w-4 h-4 rounded-full border border-base-content/20"
|
class="w-4 h-4 rounded-full border border-base-content/20"
|
||||||
|
|
@ -31,12 +43,25 @@
|
||||||
<span class="hidden sm:inline">{{ themeStore.currentPaletteName }}</span>
|
<span class="hidden sm:inline">{{ themeStore.currentPaletteName }}</span>
|
||||||
<span class="sm:hidden">P{{ themeStore.currentPalette }}</span>
|
<span class="sm:hidden">P{{ themeStore.currentPalette }}</span>
|
||||||
</div>
|
</div>
|
||||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
<svg
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
|
class="w-4 h-4"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-width="2"
|
||||||
|
d="M19 9l-7 7-7-7"
|
||||||
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div tabindex="0" class="dropdown-content z-[1] card card-compact w-80 p-4 shadow-lg bg-base-100 border border-base-300">
|
<div
|
||||||
|
tabindex="0"
|
||||||
|
class="dropdown-content z-[1] card card-compact w-80 p-4 shadow-lg bg-base-100 border border-base-300"
|
||||||
|
>
|
||||||
<div class="card-body p-0">
|
<div class="card-body p-0">
|
||||||
<h3 class="font-semibold text-sm text-base-content/70 mb-3">Choose Color Palette</h3>
|
<h3 class="font-semibold text-sm text-base-content/70 mb-3">Choose Color Palette</h3>
|
||||||
|
|
||||||
|
|
@ -44,7 +69,7 @@
|
||||||
<div class="space-y-1">
|
<div class="space-y-1">
|
||||||
<button
|
<button
|
||||||
v-for="paletteId in themeStore.availablePalettes"
|
v-for="paletteId in themeStore.availablePalettes"
|
||||||
:key="paletteId"
|
:key="`palette-${paletteId}`"
|
||||||
:class="{
|
:class="{
|
||||||
'bg-primary/10 border-primary': themeStore.currentPalette === paletteId,
|
'bg-primary/10 border-primary': themeStore.currentPalette === paletteId,
|
||||||
'hover:bg-base-200': themeStore.currentPalette !== paletteId,
|
'hover:bg-base-200': themeStore.currentPalette !== paletteId,
|
||||||
|
|
@ -53,8 +78,12 @@
|
||||||
@click="themeStore.setPalette(paletteId)"
|
@click="themeStore.setPalette(paletteId)"
|
||||||
>
|
>
|
||||||
<div class="flex items-center gap-3">
|
<div class="flex items-center gap-3">
|
||||||
<span class="text-xs font-mono text-base-content/50 w-6">{{ paletteId.toString().padStart(2, '0') }}</span>
|
<span class="text-xs font-mono text-base-content/50 w-6">
|
||||||
<span class="text-sm font-medium">{{ themeStore.paletteNames[paletteId] || `Palette ${paletteId}` }}</span>
|
{{ paletteId.toString().padStart(2, '0') }}
|
||||||
|
</span>
|
||||||
|
<span class="text-sm font-medium">
|
||||||
|
{{ themeStore.paletteNames[paletteId] || `Palette ${paletteId}` }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
|
|
@ -83,7 +112,11 @@
|
||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
viewBox="0 0 20 20"
|
viewBox="0 0 20 20"
|
||||||
>
|
>
|
||||||
<path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd" />
|
<path
|
||||||
|
fill-rule="evenodd"
|
||||||
|
d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"
|
||||||
|
clip-rule="evenodd"
|
||||||
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -113,7 +146,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useThemeStore } from '~/stores/theme';
|
import { onMounted } from 'vue';
|
||||||
|
import { useThemeStore } from '../stores/theme';
|
||||||
|
|
||||||
const themeStore = useThemeStore();
|
const themeStore = useThemeStore();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ const closeWindow = async () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
// Listen for maximize state changes
|
// Listen for maximize state changes
|
||||||
const handleMaximizeChange = (event: any, maximized: boolean) => {
|
const handleMaximizeChange = (_event: unknown, maximized: boolean) => {
|
||||||
isMaximized.value = maximized;
|
isMaximized.value = maximized;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -99,3 +99,4 @@ onUnmounted(() => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
395
app/components/TokenCard.vue
Normal file
395
app/components/TokenCard.vue
Normal file
|
|
@ -0,0 +1,395 @@
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
class="token-card relative bg-base-100 hover:bg-base-200/50 transition-all duration-200 cursor-pointer border-b border-base-300 last:border-b-0"
|
||||||
|
:class="cardClass"
|
||||||
|
@click="$emit('click', token)"
|
||||||
|
>
|
||||||
|
<!-- Quick actions (visible on hover) -->
|
||||||
|
<div class="absolute top-2 right-2 z-10 opacity-0 group-hover:opacity-100 transition-opacity duration-200 flex gap-1">
|
||||||
|
<button
|
||||||
|
class="w-6 h-6 bg-base-300/90 hover:bg-error rounded text-base-content/60 hover:text-error-content transition-colors flex items-center justify-center text-xs"
|
||||||
|
title="Close token"
|
||||||
|
@click.stop="$emit('close', token)"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:x-mark" class="w-3 h-3" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="w-6 h-6 bg-base-300/90 hover:bg-base-300 rounded text-base-content/60 hover:text-primary transition-colors flex items-center justify-center text-xs"
|
||||||
|
title="Hide token"
|
||||||
|
@click.stop="$emit('hide', token)"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:eye-slash" class="w-3 h-3" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="w-6 h-6 bg-base-300/90 hover:bg-base-300 rounded text-base-content/60 hover:text-warning transition-colors flex items-center justify-center text-xs"
|
||||||
|
title="Watch token"
|
||||||
|
@click.stop="$emit('watch', token)"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:bookmark" class="w-3 h-3" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Quick buy button (bottom right) -->
|
||||||
|
<div class="absolute bottom-2 right-2 z-10 opacity-0 group-hover:opacity-100 transition-opacity duration-200">
|
||||||
|
<button
|
||||||
|
class="bg-primary hover:bg-primary/80 text-primary-content px-2 py-1 rounded text-xs font-medium flex items-center gap-1 shadow-sm"
|
||||||
|
@click.stop="$emit('quick-buy', token)"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:bolt" class="w-3 h-3" />
|
||||||
|
Quick Buy
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Main content -->
|
||||||
|
<div class="p-3 group">
|
||||||
|
<div class="flex items-start gap-3">
|
||||||
|
<!-- Token image/avatar -->
|
||||||
|
<div class="flex-shrink-0">
|
||||||
|
<div v-if="metadata?.image && !imageError" class="w-10 h-10 rounded-lg overflow-hidden bg-base-300 relative">
|
||||||
|
<img
|
||||||
|
:src="metadata.image"
|
||||||
|
:alt="token.name"
|
||||||
|
class="w-full h-full object-cover"
|
||||||
|
@error="handleImageError"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="_metadataLoading" class="w-10 h-10 bg-base-300 rounded-lg flex items-center justify-center">
|
||||||
|
<div class="loading loading-spinner loading-xs text-primary" />
|
||||||
|
</div>
|
||||||
|
<div v-else-if="_metadataError" class="w-10 h-10 bg-error/20 rounded-lg flex items-center justify-center" :title="_metadataError">
|
||||||
|
<Icon name="heroicons:exclamation-triangle" class="w-4 h-4 text-error" />
|
||||||
|
</div>
|
||||||
|
<div v-else class="w-10 h-10 bg-gradient-to-br from-primary to-secondary rounded-lg flex items-center justify-center">
|
||||||
|
<span class="text-primary-content font-bold text-sm">{{ getTokenSymbol(token)?.charAt(0) || '?' }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Token info -->
|
||||||
|
<div class="flex-1 min-w-0">
|
||||||
|
<!-- Header with name and symbol -->
|
||||||
|
<div class="flex items-center gap-2 mb-1">
|
||||||
|
<h3 class="font-semibold text-sm text-base-content truncate">{{ token.name }}</h3>
|
||||||
|
<span v-if="getTokenSymbol(token)" class="badge badge-primary badge-xs">{{ getTokenSymbol(token) }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Address -->
|
||||||
|
<div class="flex items-center gap-2 mb-2">
|
||||||
|
<span class="text-xs text-base-content/60 font-mono">{{ truncateAddress(getMintAddress()) }}</span>
|
||||||
|
<button
|
||||||
|
class="text-base-content/40 hover:text-primary transition-colors"
|
||||||
|
title="Copy address"
|
||||||
|
@click.stop="copyToClipboard(getMintAddress())"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:clipboard-document" class="w-3 h-3" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Type-specific info -->
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<!-- Type indicator -->
|
||||||
|
<span
|
||||||
|
class="badge badge-xs"
|
||||||
|
:class="typeClass"
|
||||||
|
>
|
||||||
|
{{ typeLabel }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<!-- Creator info for new tokens -->
|
||||||
|
<a
|
||||||
|
v-if="type === 'new' && devAddress"
|
||||||
|
:href="`https://solscan.io/account/${devAddress}`"
|
||||||
|
target="_blank"
|
||||||
|
class="flex items-center gap-1 text-xs text-base-content/50 hover:text-primary transition-colors"
|
||||||
|
title="View creator on Solscan"
|
||||||
|
@click.stop
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:user" class="w-3 h-3" />
|
||||||
|
{{ truncateAddress(devAddress) }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Timestamp -->
|
||||||
|
<span class="text-xs text-base-content/50">
|
||||||
|
{{ formatTimeAgoUtil(getDisplayTimestamp(token), currentTime) }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Social links (if available) -->
|
||||||
|
<div v-if="metadata && hasSocialLinks" class="flex items-center gap-1 mt-2">
|
||||||
|
<a
|
||||||
|
v-if="metadata.twitter"
|
||||||
|
:href="metadata.twitter"
|
||||||
|
target="_blank"
|
||||||
|
class="w-5 h-5 text-base-content/40 hover:text-info transition-colors"
|
||||||
|
title="Twitter"
|
||||||
|
@click.stop
|
||||||
|
>
|
||||||
|
<Icon name="simple-icons:x" class="w-3 h-3" />
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
v-if="metadata.telegram"
|
||||||
|
:href="metadata.telegram"
|
||||||
|
target="_blank"
|
||||||
|
class="w-5 h-5 text-base-content/40 hover:text-info transition-colors"
|
||||||
|
title="Telegram"
|
||||||
|
@click.stop
|
||||||
|
>
|
||||||
|
<Icon name="simple-icons:telegram" class="w-3 h-3" />
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
v-if="metadata.website"
|
||||||
|
:href="metadata.website"
|
||||||
|
target="_blank"
|
||||||
|
class="w-5 h-5 text-base-content/40 hover:text-info transition-colors"
|
||||||
|
title="Website"
|
||||||
|
@click.stop
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:globe-alt" class="w-3 h-3" />
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
v-if="metadata.discord"
|
||||||
|
:href="metadata.discord"
|
||||||
|
target="_blank"
|
||||||
|
class="w-5 h-5 text-base-content/40 hover:text-info transition-colors"
|
||||||
|
title="Discord"
|
||||||
|
@click.stop
|
||||||
|
>
|
||||||
|
<Icon name="simple-icons:discord" class="w-3 h-3" />
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Additional info for analysis type -->
|
||||||
|
<div v-if="(type === 'analysis' || type === 'dev') && 'node_count' in token" class="mt-2 text-xs text-base-content/60">
|
||||||
|
<span>{{ token.node_count }} nodes, {{ token.edge_count }} edges</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { isAddress } from '@solana/kit';
|
||||||
|
import { computed, onMounted, ref } from 'vue';
|
||||||
|
import { byteArrayToAddress, toSolanaAddress, truncateAddress as truncateAddr } from '~/utils/address';
|
||||||
|
import type {
|
||||||
|
MaxDepthReachedData,
|
||||||
|
NewTokenCreatedData,
|
||||||
|
TokenCexUpdatedData,
|
||||||
|
TokenMetadata
|
||||||
|
} from '../../types/redis-events';
|
||||||
|
import { formatTimeAgo as formatTimeAgoUtil, useRealTimeUpdate } from '../composables/useRealTimeUpdate';
|
||||||
|
import { fetchTokenMetadata } from '../utils/ipfs';
|
||||||
|
|
||||||
|
// Props
|
||||||
|
interface Props {
|
||||||
|
token: NewTokenCreatedData | TokenCexUpdatedData | MaxDepthReachedData;
|
||||||
|
type: 'new' | 'cex' | 'analysis' | 'dev';
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = defineProps<Props>();
|
||||||
|
|
||||||
|
// Emits
|
||||||
|
interface Emits {
|
||||||
|
(e: 'click' | 'hide' | 'watch' | 'quick-buy' | 'close', token: NewTokenCreatedData | TokenCexUpdatedData | MaxDepthReachedData): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
defineEmits<Emits>();
|
||||||
|
|
||||||
|
// Reactive data
|
||||||
|
const imageError = ref(false);
|
||||||
|
const mintAddress = ref<string>('');
|
||||||
|
const devAddress = ref<string>('');
|
||||||
|
const bondingCurveAddress = ref<string>('');
|
||||||
|
|
||||||
|
// Simple metadata state management
|
||||||
|
const metadata = ref<TokenMetadata | null>(null);
|
||||||
|
const _metadataLoading = ref(false);
|
||||||
|
const _metadataError = ref<string | null>(null);
|
||||||
|
|
||||||
|
// Real-time updates
|
||||||
|
const { currentTime } = useRealTimeUpdate();
|
||||||
|
|
||||||
|
// Computed properties
|
||||||
|
const cardClass = computed(() => {
|
||||||
|
const baseClass = 'h-[120px] min-h-[120px]';
|
||||||
|
switch (props.type) {
|
||||||
|
case 'new':
|
||||||
|
return `${baseClass} border-l-2 border-l-success`;
|
||||||
|
case 'cex':
|
||||||
|
return `${baseClass} border-l-2 border-l-info`;
|
||||||
|
case 'analysis':
|
||||||
|
case 'dev':
|
||||||
|
return `${baseClass} border-l-2 border-l-warning`;
|
||||||
|
default:
|
||||||
|
return baseClass;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const typeClass = computed(() => {
|
||||||
|
switch (props.type) {
|
||||||
|
case 'new':
|
||||||
|
return 'badge-success';
|
||||||
|
case 'cex':
|
||||||
|
return 'badge-info';
|
||||||
|
case 'analysis':
|
||||||
|
case 'dev':
|
||||||
|
return 'badge-warning';
|
||||||
|
default:
|
||||||
|
return 'badge-neutral';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const typeLabel = computed(() => {
|
||||||
|
switch (props.type) {
|
||||||
|
case 'new':
|
||||||
|
return 'NEW';
|
||||||
|
case 'cex':
|
||||||
|
return 'CEX';
|
||||||
|
case 'analysis':
|
||||||
|
return 'ANALYSIS';
|
||||||
|
case 'dev':
|
||||||
|
return 'DEV';
|
||||||
|
default:
|
||||||
|
return 'UNKNOWN';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const hasSocialLinks = computed(() => {
|
||||||
|
return metadata.value && (
|
||||||
|
metadata.value.twitter ||
|
||||||
|
metadata.value.telegram ||
|
||||||
|
metadata.value.website ||
|
||||||
|
metadata.value.discord
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Methods
|
||||||
|
const truncateAddress = (address: string): string => {
|
||||||
|
return truncateAddr(address);
|
||||||
|
};
|
||||||
|
|
||||||
|
const getTokenSymbol = (token: NewTokenCreatedData | TokenCexUpdatedData | MaxDepthReachedData): string | undefined => {
|
||||||
|
if ('symbol' in token) {
|
||||||
|
return token.symbol;
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getMintAddress = (): string => {
|
||||||
|
return mintAddress.value;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getDisplayTimestamp = (token: NewTokenCreatedData | TokenCexUpdatedData | MaxDepthReachedData): number => {
|
||||||
|
// For CEX and analysis types, prefer updated_at if available
|
||||||
|
if ((props.type === 'cex' || props.type === 'analysis') && 'updated_at' in token) {
|
||||||
|
return token.updated_at;
|
||||||
|
}
|
||||||
|
// For new tokens or fallback, use created_at
|
||||||
|
return token.created_at;
|
||||||
|
};
|
||||||
|
|
||||||
|
const copyToClipboard = async (text: string): Promise<void> => {
|
||||||
|
try {
|
||||||
|
await navigator.clipboard.writeText(text);
|
||||||
|
// You could add a toast notification here
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to copy to clipboard:', err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleImageError = (): void => {
|
||||||
|
imageError.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
function convertAddresses() {
|
||||||
|
try {
|
||||||
|
// Convert mint address
|
||||||
|
if (Array.isArray(props.token.mint)) {
|
||||||
|
mintAddress.value = byteArrayToAddress(props.token.mint);
|
||||||
|
} else if (typeof props.token.mint === 'string') {
|
||||||
|
if (isAddress(props.token.mint)) {
|
||||||
|
mintAddress.value = props.token.mint;
|
||||||
|
} else {
|
||||||
|
mintAddress.value = toSolanaAddress(props.token.mint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert creator address (only for NewTokenCreatedData)
|
||||||
|
if (props.type === 'new' && 'creator' in props.token) {
|
||||||
|
const token = props.token as NewTokenCreatedData;
|
||||||
|
if (Array.isArray(token.creator)) {
|
||||||
|
devAddress.value = byteArrayToAddress(token.creator);
|
||||||
|
} else if (typeof token.creator === 'string') {
|
||||||
|
if (isAddress(token.creator)) {
|
||||||
|
devAddress.value = token.creator;
|
||||||
|
} else {
|
||||||
|
devAddress.value = toSolanaAddress(token.creator);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert bonding curve address (NewTokenCreatedData and MaxDepthReachedData)
|
||||||
|
if ('bonding_curve' in props.token && props.token.bonding_curve) {
|
||||||
|
const token = props.token as NewTokenCreatedData | MaxDepthReachedData;
|
||||||
|
if (Array.isArray(token.bonding_curve)) {
|
||||||
|
bondingCurveAddress.value = byteArrayToAddress(token.bonding_curve);
|
||||||
|
} else if (typeof token.bonding_curve === 'string') {
|
||||||
|
if (isAddress(token.bonding_curve)) {
|
||||||
|
bondingCurveAddress.value = token.bonding_curve;
|
||||||
|
} else {
|
||||||
|
bondingCurveAddress.value = toSolanaAddress(token.bonding_curve);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error converting addresses:', error);
|
||||||
|
// Fallback to string representation
|
||||||
|
mintAddress.value = String(props.token.mint);
|
||||||
|
if (props.type === 'new' && 'creator' in props.token) {
|
||||||
|
devAddress.value = String((props.token as NewTokenCreatedData).creator);
|
||||||
|
}
|
||||||
|
if ('bonding_curve' in props.token && props.token.bonding_curve) {
|
||||||
|
bondingCurveAddress.value = String((props.token as NewTokenCreatedData | MaxDepthReachedData).bonding_curve);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load metadata and convert addresses on mount
|
||||||
|
onMounted(async () => {
|
||||||
|
// Convert addresses first
|
||||||
|
convertAddresses();
|
||||||
|
|
||||||
|
// Then load metadata if URI exists
|
||||||
|
if (props.token.uri) {
|
||||||
|
_metadataLoading.value = true;
|
||||||
|
_metadataError.value = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const result = await fetchTokenMetadata(props.token.uri);
|
||||||
|
metadata.value = result;
|
||||||
|
} catch (error) {
|
||||||
|
const errorMessage = error instanceof Error ? error.message : 'Failed to fetch metadata';
|
||||||
|
_metadataError.value = errorMessage;
|
||||||
|
} finally {
|
||||||
|
_metadataLoading.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.token-card {
|
||||||
|
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.token-card:hover {
|
||||||
|
transform: translateY(-1px);
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.group:hover .opacity-0 {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
export const useAuthGuard = () => {
|
|
||||||
const appStore = useAppStore();
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const requireAuth = () => {
|
|
||||||
onMounted(() => {
|
|
||||||
if (!appStore.isAuthenticated) {
|
|
||||||
router.push('/login');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const requireGuest = () => {
|
|
||||||
onMounted(() => {
|
|
||||||
if (appStore.isAuthenticated) {
|
|
||||||
router.push('/dashboard');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
requireAuth,
|
|
||||||
requireGuest,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import { useAppStore } from '../stores/app';
|
||||||
|
|
||||||
export const useNavigation = () => {
|
export const useNavigation = () => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
|
|
|
||||||
57
app/composables/useRealTimeUpdate.ts
Normal file
57
app/composables/useRealTimeUpdate.ts
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
import { onMounted, onUnmounted, ref } from 'vue';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Composable for real-time timestamp updates
|
||||||
|
* Updates every second to show live "time ago" timestamps
|
||||||
|
*/
|
||||||
|
export function useRealTimeUpdate() {
|
||||||
|
const currentTime = ref(Date.now());
|
||||||
|
let intervalId: NodeJS.Timeout | null = null;
|
||||||
|
|
||||||
|
const updateTime = () => {
|
||||||
|
currentTime.value = Date.now();
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
// Update every second for real-time display
|
||||||
|
intervalId = setInterval(updateTime, 1000);
|
||||||
|
});
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
if (intervalId) {
|
||||||
|
clearInterval(intervalId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
currentTime
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format timestamp to "time ago" string
|
||||||
|
* @param timestamp - Unix timestamp in seconds
|
||||||
|
* @param currentTime - Current time for real-time updates
|
||||||
|
*/
|
||||||
|
export function formatTimeAgo(timestamp: number, currentTime: number): string {
|
||||||
|
const now = Math.floor(currentTime / 1000);
|
||||||
|
const then = Math.floor(timestamp);
|
||||||
|
const diffSeconds = Math.max(0, now - then); // Prevent negative values
|
||||||
|
|
||||||
|
if (diffSeconds < 60) {
|
||||||
|
return `${diffSeconds}s ago`;
|
||||||
|
}
|
||||||
|
|
||||||
|
const diffMinutes = Math.floor(diffSeconds / 60);
|
||||||
|
if (diffMinutes < 60) {
|
||||||
|
return `${diffMinutes}m ago`;
|
||||||
|
}
|
||||||
|
|
||||||
|
const diffHours = Math.floor(diffMinutes / 60);
|
||||||
|
if (diffHours < 24) {
|
||||||
|
return `${diffHours}h ago`;
|
||||||
|
}
|
||||||
|
|
||||||
|
const diffDays = Math.floor(diffHours / 24);
|
||||||
|
return `${diffDays}d ago`;
|
||||||
|
}
|
||||||
117
app/composables/useZiyaConfig.ts
Normal file
117
app/composables/useZiyaConfig.ts
Normal file
|
|
@ -0,0 +1,117 @@
|
||||||
|
/**
|
||||||
|
* Ziya App Configuration Composable
|
||||||
|
* Provides centralized configuration values for the entire application
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```ts
|
||||||
|
* const { config, getDevServerUrl, isDevelopment } = useZiyaConfig()
|
||||||
|
* console.log(config.app.name) // 'Ziya'
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
|
||||||
|
interface ZiyaAppConfig {
|
||||||
|
name: string;
|
||||||
|
version: string;
|
||||||
|
description: string;
|
||||||
|
author: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ZiyaDevelopmentConfig {
|
||||||
|
nuxtPort: number;
|
||||||
|
nuxtHost: string;
|
||||||
|
electronDevTools: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ZiyaWindowConfig {
|
||||||
|
minHeight: number;
|
||||||
|
minWidth: number;
|
||||||
|
maxHeight: number;
|
||||||
|
maxWidth: number;
|
||||||
|
defaultHeight: number;
|
||||||
|
defaultWidth: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ZiyaThemeConfig {
|
||||||
|
defaultPalette: number;
|
||||||
|
defaultDarkMode: boolean;
|
||||||
|
availablePalettes: number[];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ZiyaConfigValues {
|
||||||
|
app: ZiyaAppConfig;
|
||||||
|
development: ZiyaDevelopmentConfig;
|
||||||
|
window: ZiyaWindowConfig;
|
||||||
|
theme: ZiyaThemeConfig;
|
||||||
|
}
|
||||||
|
|
||||||
|
const ZIYA_CONFIG: ZiyaConfigValues = {
|
||||||
|
app: {
|
||||||
|
name: 'Ziya',
|
||||||
|
version: '1.0.0',
|
||||||
|
description: 'One stop shop trading solution',
|
||||||
|
author: 'bismillahDAO',
|
||||||
|
},
|
||||||
|
|
||||||
|
development: {
|
||||||
|
nuxtPort: 3000,
|
||||||
|
nuxtHost: 'localhost',
|
||||||
|
electronDevTools: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
window: {
|
||||||
|
minHeight: 800,
|
||||||
|
minWidth: 1080,
|
||||||
|
maxHeight: 1080,
|
||||||
|
maxWidth: 1920,
|
||||||
|
defaultHeight: 1024,
|
||||||
|
defaultWidth: 1280,
|
||||||
|
},
|
||||||
|
|
||||||
|
theme: {
|
||||||
|
defaultPalette: 1,
|
||||||
|
defaultDarkMode: false,
|
||||||
|
availablePalettes: Array.from({ length: 24 }, (_, i) => i + 1),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get development server URL based on configuration
|
||||||
|
*/
|
||||||
|
const getDevServerUrl = (): string => {
|
||||||
|
const { nuxtHost, nuxtPort } = ZIYA_CONFIG.development;
|
||||||
|
return `http://${nuxtHost}:${nuxtPort}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Environment detection utilities
|
||||||
|
*/
|
||||||
|
const isDevelopment = process.env.NODE_ENV === 'development';
|
||||||
|
const isProduction = process.env.NODE_ENV === 'production';
|
||||||
|
const isClient = import.meta.client;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main composable function that provides Ziya app configuration
|
||||||
|
*
|
||||||
|
* @returns Object containing configuration values and helper functions
|
||||||
|
*/
|
||||||
|
export const useZiyaConfig = () => {
|
||||||
|
return {
|
||||||
|
config: ZIYA_CONFIG,
|
||||||
|
|
||||||
|
// Helper functions
|
||||||
|
getDevServerUrl,
|
||||||
|
|
||||||
|
// Environment flags
|
||||||
|
isDevelopment,
|
||||||
|
isProduction,
|
||||||
|
isClient,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// Default export for convenience
|
||||||
|
export default useZiyaConfig;
|
||||||
|
|
||||||
|
// Export types for external use
|
||||||
|
export type {
|
||||||
|
ZiyaAppConfig, ZiyaConfigValues, ZiyaDevelopmentConfig, ZiyaThemeConfig, ZiyaWindowConfig
|
||||||
|
};
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="min-h-screen bg-base-100 flex flex-col">
|
<div class="min-h-screen bg-base-100 flex flex-col">
|
||||||
|
<!-- Custom Title Bar for window dragging and controls -->
|
||||||
|
<TitleBar />
|
||||||
|
|
||||||
<!-- Main Content Area with no-drag to prevent dragging from form elements -->
|
<!-- Main Content Area with no-drag to prevent dragging from form elements -->
|
||||||
<main class="flex-1 overflow-hidden" style="-webkit-app-region: no-drag;">
|
<main class="flex-1 overflow-hidden" style="-webkit-app-region: no-drag;">
|
||||||
<slot />
|
<slot />
|
||||||
|
|
@ -24,3 +27,4 @@ body {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
@ -10,19 +10,18 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup lang="ts">
|
||||||
// No additional setup needed for this layout
|
// No additional setup needed for this layout
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
/* Global styles can go here */
|
/* Global styles */
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
overflow: hidden; /* Prevent scrollbars on the main window */
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ensure the layout fills the entire window */
|
|
||||||
#__nuxt {
|
#__nuxt {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,10 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { onMounted } from 'vue';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import { useAppStore } from '../stores/app';
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,228 +1,267 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="desktop-container">
|
<div class="hunting-ground h-screen flex bg-base-100 overflow-hidden">
|
||||||
<!-- Top bar with user info -->
|
<!-- Professional Sidebar -->
|
||||||
<div class="navbar bg-base-300 px-4">
|
<aside class="w-64 bg-base-200 border-r border-base-300 flex flex-col shadow-lg">
|
||||||
<div class="navbar-start">
|
<!-- Sidebar Header -->
|
||||||
<div class="text-xl font-bold">Hunting Ground</div>
|
<div class="p-4 border-b border-base-300">
|
||||||
|
<div class="flex items-center gap-3">
|
||||||
|
<div class="w-8 h-8 bg-primary rounded-lg flex items-center justify-center">
|
||||||
|
<Icon name="heroicons:chart-bar-square" class="w-5 h-5 text-primary-content" />
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-end">
|
<div>
|
||||||
<div class="dropdown dropdown-end">
|
<h1 class="font-semibold text-base text-base-content">Hunting Ground</h1>
|
||||||
<div tabindex="0" role="button" class="btn btn-ghost btn-circle avatar">
|
<p class="text-xs text-base-content/60">Real-time discovery</p>
|
||||||
<div class="w-10 rounded-full bg-primary flex items-center justify-center">
|
|
||||||
<span class="text-primary-content font-bold text-sm">
|
|
||||||
{{ appStore.userInitials }}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<ul tabindex="0" class="menu menu-sm dropdown-content mt-3 z-[1] p-2 shadow bg-base-100 rounded-box w-52">
|
|
||||||
<li><a @click="navigateToProfile">Profile</a></li>
|
|
||||||
<li><a>Settings</a></li>
|
|
||||||
<li><a @click="handleLogout">Logout</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Main content area -->
|
<!-- Navigation Menu -->
|
||||||
<div class="flex-1 flex overflow-hidden">
|
<nav class="flex-1 p-3">
|
||||||
<!-- Sidebar -->
|
<div class="space-y-1">
|
||||||
<div class="w-64 bg-base-200 p-4">
|
<button
|
||||||
<ul class="menu">
|
class="w-full flex items-center gap-3 px-3 py-2.5 text-sm font-medium rounded-lg bg-primary text-primary-content"
|
||||||
<li><a @click="navigateToDashboard">Dashboard</a></li>
|
|
||||||
<li><a @click="navigateToProfile">Profile</a></li>
|
|
||||||
<li><a>Trading</a></li>
|
|
||||||
<li><a>Portfolio</a></li>
|
|
||||||
<li><a>Markets</a></li>
|
|
||||||
<li><a class="active">Hunting Ground</a></li>
|
|
||||||
<li><a>Analytics</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Main content - Three columns -->
|
|
||||||
<div class="flex-1 p-4 overflow-hidden">
|
|
||||||
<div class="grid grid-cols-3 gap-4 h-full">
|
|
||||||
<!-- New Tokens Column -->
|
|
||||||
<div class="bg-base-100 rounded-lg shadow-lg flex flex-col">
|
|
||||||
<div class="p-4 border-b border-base-200">
|
|
||||||
<h3 class="text-lg font-bold text-primary">New Tokens</h3>
|
|
||||||
<p class="text-sm text-base-content/70">{{ newTokens.length }} tokens found</p>
|
|
||||||
</div>
|
|
||||||
<div class="flex-1 overflow-y-auto p-2 scrollbar-thin">
|
|
||||||
<div class="space-y-3">
|
|
||||||
<div
|
|
||||||
v-for="token in newTokens"
|
|
||||||
:key="token.mint"
|
|
||||||
class="card bg-base-200 shadow cursor-pointer hover:shadow-lg transition-all duration-200 hover:bg-base-300"
|
|
||||||
@click="openToken(token.bonding_curve)"
|
|
||||||
>
|
>
|
||||||
<div class="card-body p-4">
|
<Icon name="heroicons:magnifying-glass" class="w-4 h-4" />
|
||||||
<div class="flex items-center justify-between mb-2">
|
Token Discovery
|
||||||
<h4 class="card-title text-sm">{{ token.name }}</h4>
|
</button>
|
||||||
<div class="badge badge-primary badge-sm">{{ token.symbol }}</div>
|
|
||||||
|
<button
|
||||||
|
class="w-full flex items-center gap-3 px-3 py-2.5 text-sm font-medium rounded-lg text-base-content/70 hover:bg-base-300 transition-colors"
|
||||||
|
@click="navigateToDashboard"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:squares-2x2" class="w-4 h-4" />
|
||||||
|
Dashboard
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="w-full flex items-center gap-3 px-3 py-2.5 text-sm font-medium rounded-lg text-base-content/70 hover:bg-base-300 transition-colors"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:chart-pie" class="w-4 h-4" />
|
||||||
|
Analytics
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="w-full flex items-center gap-3 px-3 py-2.5 text-sm font-medium rounded-lg text-base-content/70 hover:bg-base-300 transition-colors"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:bookmark" class="w-4 h-4" />
|
||||||
|
Watchlist
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-xs text-base-content/70 space-y-1">
|
|
||||||
<div class="flex justify-between">
|
<!-- Stats Section -->
|
||||||
<span>Mint:</span>
|
<div class="mt-6 p-3 bg-base-300/50 rounded-lg">
|
||||||
<span class="font-mono">{{ truncateAddress(token.mint) }}</span>
|
<h3 class="text-xs font-semibold text-base-content/70 uppercase tracking-wider mb-2">Live Stats</h3>
|
||||||
|
<div class="space-y-2">
|
||||||
|
<div class="flex justify-between text-sm">
|
||||||
|
<span class="text-base-content/60">New Tokens</span>
|
||||||
|
<span class="font-medium text-success">{{ newTokens.length }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-between">
|
<div class="flex justify-between text-sm">
|
||||||
<span>Creator:</span>
|
<span class="text-base-content/60">CEX Updates</span>
|
||||||
<span class="font-mono">{{ truncateAddress(token.creator) }}</span>
|
<span class="font-medium text-info">{{ cexTokens.length }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-between">
|
<div class="flex justify-between text-sm">
|
||||||
<span>Time:</span>
|
<span class="text-base-content/60">Analysis Done</span>
|
||||||
<span>{{ formatTime(token.created_at) }}</span>
|
<span class="font-medium text-warning">{{ maxDepthTokens.length }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<!-- User Section -->
|
||||||
|
<div class="p-3 border-t border-base-300">
|
||||||
|
<div class="flex items-center gap-3 p-2 rounded-lg hover:bg-base-300 transition-colors cursor-pointer">
|
||||||
|
<div class="w-8 h-8 bg-primary rounded-full flex items-center justify-center">
|
||||||
|
<span class="text-xs font-bold text-primary-content">U</span>
|
||||||
|
</div>
|
||||||
|
<div class="flex-1 min-w-0">
|
||||||
|
<p class="text-sm font-medium text-base-content truncate">User</p>
|
||||||
|
<p class="text-xs text-base-content/60">Connected</p>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
class="p-1 rounded hover:bg-base-200 transition-colors"
|
||||||
|
title="Logout"
|
||||||
|
@click="handleLogout"
|
||||||
|
>
|
||||||
|
<Icon name="heroicons:arrow-right-on-rectangle" class="w-4 h-4 text-base-content/60" />
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
<!-- Main Content -->
|
||||||
|
<main class="flex-1 flex flex-col overflow-hidden">
|
||||||
|
<!-- Top Bar -->
|
||||||
|
<header class="bg-base-100 border-b border-base-300 px-6 py-3 flex items-center justify-between flex-shrink-0">
|
||||||
|
<div class="flex items-center gap-4">
|
||||||
|
<h2 class="text-lg font-semibold text-base-content">Token Streams</h2>
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<div class="w-2 h-2 bg-success rounded-full animate-pulse" />
|
||||||
|
<span class="text-sm text-base-content/60">Live</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- CEX Found Column -->
|
<div class="flex items-center gap-3">
|
||||||
<div class="bg-base-100 rounded-lg shadow-lg flex flex-col">
|
<button class="btn btn-ghost btn-sm">
|
||||||
<div class="p-4 border-b border-base-200">
|
<Icon name="heroicons:funnel" class="w-4 h-4" />
|
||||||
<h3 class="text-lg font-bold text-secondary">CEX Found</h3>
|
Filters
|
||||||
<p class="text-sm text-base-content/70">{{ cexTokens.length }} CEX connections</p>
|
</button>
|
||||||
|
<button class="btn btn-ghost btn-sm">
|
||||||
|
<Icon name="heroicons:cog-6-tooth" class="w-4 h-4" />
|
||||||
|
Settings
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-1 overflow-y-auto p-2 scrollbar-thin">
|
</header>
|
||||||
<div class="space-y-3">
|
|
||||||
<div
|
<!-- Content Grid -->
|
||||||
|
<div class="flex-1 grid grid-cols-3 gap-0 overflow-hidden">
|
||||||
|
<!-- New Tokens Column -->
|
||||||
|
<section class="flex flex-col border-r border-base-300">
|
||||||
|
<header class="bg-base-200/50 px-4 py-3 border-b border-base-300 flex items-center justify-between">
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<div class="w-3 h-3 bg-success rounded-full" />
|
||||||
|
<h3 class="font-semibold text-sm text-base-content">New Tokens</h3>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<button
|
||||||
|
v-if="newTokens.length > 0"
|
||||||
|
class="text-xs text-base-content/60 hover:text-error transition-colors underline"
|
||||||
|
title="Clear all new tokens"
|
||||||
|
@click="clearAllNewTokens"
|
||||||
|
>
|
||||||
|
Clear All
|
||||||
|
</button>
|
||||||
|
<span class="badge badge-success badge-sm">{{ newTokens.length }}</span>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
<div class="flex-1 overflow-y-auto">
|
||||||
|
<div class="divide-y divide-base-300">
|
||||||
|
<TokenCard
|
||||||
|
v-for="token in newTokens"
|
||||||
|
:key="byteArrayToAddress(token.mint)"
|
||||||
|
:token="token"
|
||||||
|
type="new"
|
||||||
|
@click="openToken"
|
||||||
|
@hide="hideToken"
|
||||||
|
@watch="watchToken"
|
||||||
|
@quick-buy="quickBuyToken"
|
||||||
|
@close="removeNewToken"
|
||||||
|
/>
|
||||||
|
<div v-if="newTokens.length === 0" class="p-8 text-center text-base-content/60">
|
||||||
|
<Icon name="heroicons:plus-circle" class="w-12 h-12 mx-auto mb-3 opacity-50" />
|
||||||
|
<p class="font-medium">Waiting for new tokens</p>
|
||||||
|
<p class="text-sm mt-1">New tokens will appear here</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<!-- CEX Tokens Column -->
|
||||||
|
<section class="flex flex-col border-r border-base-300">
|
||||||
|
<header class="bg-base-200/50 px-4 py-3 border-b border-base-300 flex items-center justify-between">
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<div class="w-3 h-3 bg-info rounded-full" />
|
||||||
|
<h3 class="font-semibold text-sm text-base-content">CEX Updates</h3>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<button
|
||||||
|
v-if="cexTokens.length > 0"
|
||||||
|
class="text-xs text-base-content/60 hover:text-error transition-colors underline"
|
||||||
|
title="Clear all CEX tokens"
|
||||||
|
@click="clearAllCexTokens"
|
||||||
|
>
|
||||||
|
Clear All
|
||||||
|
</button>
|
||||||
|
<span class="badge badge-info badge-sm">{{ cexTokens.length }}</span>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
<div class="flex-1 overflow-y-auto">
|
||||||
|
<div class="divide-y divide-base-300">
|
||||||
|
<CexAnalysisCard
|
||||||
v-for="token in cexTokens"
|
v-for="token in cexTokens"
|
||||||
:key="token.mint"
|
:key="token.mint"
|
||||||
:class="getCexCardClass(token.data.cex_name)"
|
:token="token.data"
|
||||||
class="card shadow cursor-pointer hover:shadow-lg transition-all duration-200"
|
@click="openToken"
|
||||||
@click="openToken(token.data.bonding_curve)"
|
@hide="hideToken"
|
||||||
>
|
@watch="watchToken"
|
||||||
<div class="card-body p-4">
|
@quick-buy="quickBuyToken"
|
||||||
<div class="flex items-center justify-between mb-2">
|
@close="removeCexToken"
|
||||||
<h4 class="card-title text-sm text-white">{{ token.data.name }}</h4>
|
/>
|
||||||
<div class="badge badge-sm text-white border-white/20">{{ getCexDisplayName(token.data.cex_name) }}</div>
|
<div v-if="cexTokens.length === 0" class="p-8 text-center text-base-content/60">
|
||||||
</div>
|
<Icon name="heroicons:building-office" class="w-12 h-12 mx-auto mb-3 opacity-50" />
|
||||||
<div class="text-xs text-white/80 space-y-1">
|
<p class="font-medium">No CEX updates yet</p>
|
||||||
<div class="flex justify-between">
|
<p class="text-sm mt-1">CEX listings will appear here</p>
|
||||||
<span>Mint:</span>
|
|
||||||
<span class="font-mono">{{ truncateAddress(token.data.mint) }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="flex justify-between">
|
|
||||||
<span>CEX Address:</span>
|
|
||||||
<span class="font-mono">{{ truncateAddress(token.data.cex_address) }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="flex justify-between">
|
|
||||||
<span>Dev:</span>
|
|
||||||
<span>{{ token.data.dev_name || 'Unknown' }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="flex justify-between">
|
|
||||||
<span>Nodes:</span>
|
|
||||||
<span>{{ token.data.node_count || 0 }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="flex justify-between">
|
|
||||||
<span>Time:</span>
|
|
||||||
<span>{{ formatTime(token.data.cex_updated_at) }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<!-- Dev Tracker Column -->
|
<!-- Analysis Complete Column -->
|
||||||
<div class="bg-base-100 rounded-lg shadow-lg flex flex-col">
|
<section class="flex flex-col">
|
||||||
<div class="p-4 border-b border-base-200">
|
<header class="bg-base-200/50 px-4 py-3 border-b border-base-300 flex items-center justify-between">
|
||||||
<h3 class="text-lg font-bold text-accent">Dev Tracker</h3>
|
<div class="flex items-center gap-2">
|
||||||
<p class="text-sm text-base-content/70">{{ maxDepthTokens.length }} analysis complete</p>
|
<div class="w-3 h-3 bg-warning rounded-full" />
|
||||||
|
<h3 class="font-semibold text-sm text-base-content">Analysis Complete</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-1 overflow-y-auto p-2 scrollbar-thin">
|
<div class="flex items-center gap-2">
|
||||||
<div class="space-y-3">
|
<button
|
||||||
<div
|
v-if="maxDepthTokens.length > 0"
|
||||||
|
class="text-xs text-base-content/60 hover:text-error transition-colors underline"
|
||||||
|
title="Clear all analysis complete tokens"
|
||||||
|
@click="clearAllMaxDepthTokens"
|
||||||
|
>
|
||||||
|
Clear All
|
||||||
|
</button>
|
||||||
|
<span class="badge badge-warning badge-sm">{{ maxDepthTokens.length }}</span>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
<div class="flex-1 overflow-y-auto">
|
||||||
|
<div class="divide-y divide-base-300">
|
||||||
|
<CexAnalysisCard
|
||||||
v-for="token in maxDepthTokens"
|
v-for="token in maxDepthTokens"
|
||||||
:key="token.mint"
|
:key="token.mint"
|
||||||
class="card bg-base-200 shadow cursor-pointer hover:shadow-lg transition-all duration-200 hover:bg-base-300"
|
:token="token.data"
|
||||||
@click="openToken(token.data.bonding_curve)"
|
@click="openToken"
|
||||||
>
|
@hide="hideToken"
|
||||||
<div class="card-body p-4">
|
@watch="watchToken"
|
||||||
<div class="flex items-center justify-between mb-2">
|
@quick-buy="quickBuyToken"
|
||||||
<h4 class="card-title text-sm">{{ token.data.name }}</h4>
|
@close="removeMaxDepthToken"
|
||||||
<div class="badge badge-accent badge-sm">Complete</div>
|
/>
|
||||||
</div>
|
<div v-if="maxDepthTokens.length === 0" class="p-8 text-center text-base-content/60">
|
||||||
<div class="text-xs text-base-content/70 space-y-1">
|
<Icon name="heroicons:cpu-chip" class="w-12 h-12 mx-auto mb-3 opacity-50" />
|
||||||
<div class="flex justify-between">
|
<p class="font-medium">No analysis complete yet</p>
|
||||||
<span>Mint:</span>
|
<p class="text-sm mt-1">Completed analyses will appear here</p>
|
||||||
<span class="font-mono">{{ truncateAddress(token.data.mint) }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="flex justify-between">
|
|
||||||
<span>Nodes:</span>
|
|
||||||
<span>{{ token.data.node_count || 0 }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="flex justify-between">
|
|
||||||
<span>Edges:</span>
|
|
||||||
<span>{{ token.data.edge_count || 0 }}</span>
|
|
||||||
</div>
|
|
||||||
<div class="flex justify-between">
|
|
||||||
<span>Time:</span>
|
|
||||||
<span>{{ formatTime(token.data.updated_at) }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
</main>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
interface RedisMessage {
|
import { isAddress } from '@solana/kit';
|
||||||
channel: string;
|
import { onMounted, onUnmounted, ref } from 'vue';
|
||||||
data: any;
|
import { useRouter } from 'vue-router';
|
||||||
timestamp: number;
|
import { byteArrayToAddress, toSolanaAddress } from '~/utils/address';
|
||||||
}
|
import type {
|
||||||
|
MaxDepthReachedData,
|
||||||
interface NewTokenData {
|
NewTokenCreatedData,
|
||||||
mint: string;
|
RedisMessage,
|
||||||
bonding_curve?: string;
|
TokenCexUpdatedData
|
||||||
name: string;
|
} from '../../types/redis-events';
|
||||||
symbol: string;
|
import CexAnalysisCard from '../components/CexAnalysisCard.vue';
|
||||||
uri: string;
|
import TokenCard from '../components/TokenCard.vue';
|
||||||
creator: string;
|
import { useAppStore } from '../stores/app';
|
||||||
created_at: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface CexTokenData {
|
|
||||||
mint: string;
|
|
||||||
name: string;
|
|
||||||
uri: string;
|
|
||||||
dev_name: string;
|
|
||||||
cex_name: string;
|
|
||||||
cex_address: string;
|
|
||||||
cex_updated_at: number;
|
|
||||||
node_count: number;
|
|
||||||
edge_count: number;
|
|
||||||
bonding_curve?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MaxDepthTokenData {
|
|
||||||
mint: string;
|
|
||||||
name: string;
|
|
||||||
uri: string;
|
|
||||||
bonding_curve: string;
|
|
||||||
updated_at: string;
|
|
||||||
node_count: number;
|
|
||||||
edge_count: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
// Reactive data for three columns
|
// Reactive data for three columns
|
||||||
const newTokens = ref<NewTokenData[]>([]);
|
const newTokens = ref<NewTokenCreatedData[]>([]);
|
||||||
const cexTokens = ref<Array<{ mint: string, data: CexTokenData }>>([]);
|
const cexTokens = ref<Array<{ mint: string; data: TokenCexUpdatedData }>>([]);
|
||||||
const maxDepthTokens = ref<Array<{ mint: string, data: MaxDepthTokenData }>>([]);
|
const maxDepthTokens = ref<Array<{ mint: string; data: MaxDepthReachedData }>>([]);
|
||||||
|
|
||||||
// Redirect if not authenticated
|
// Redirect if not authenticated
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
@ -244,157 +283,104 @@ onUnmounted(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleRedisMessage = (message: RedisMessage) => {
|
const handleRedisMessage = (message: RedisMessage) => {
|
||||||
console.log('Received Redis message:', message);
|
|
||||||
|
|
||||||
switch (message.channel) {
|
switch (message.channel) {
|
||||||
case 'new_token_created':
|
case 'new_token_created':
|
||||||
addNewToken(message.data);
|
addNewToken(message.data as NewTokenCreatedData);
|
||||||
break;
|
break;
|
||||||
case 'token_cex_updated':
|
case 'token_cex_updated':
|
||||||
addCexToken(message.data);
|
addCexToken(message.data as TokenCexUpdatedData);
|
||||||
break;
|
break;
|
||||||
case 'max_depth_reached':
|
case 'max_depth_reached':
|
||||||
addMaxDepthToken(message.data);
|
addMaxDepthToken(message.data as MaxDepthReachedData);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const addNewToken = (data: NewTokenData) => {
|
const addNewToken = (data: NewTokenCreatedData) => {
|
||||||
// Add to front of array (latest first)
|
// Add to front of array (latest first) - data is already properly typed
|
||||||
newTokens.value.unshift(data);
|
newTokens.value.unshift(data);
|
||||||
|
|
||||||
// Keep only latest 50 items for performance
|
// Keep only latest 100 items for performance
|
||||||
if (newTokens.value.length > 50) {
|
if (newTokens.value.length > 100) {
|
||||||
newTokens.value = newTokens.value.slice(0, 50);
|
newTokens.value = newTokens.value.slice(0, 100);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const addCexToken = (data: CexTokenData) => {
|
const addCexToken = (data: TokenCexUpdatedData) => {
|
||||||
// Add to front of array (latest first)
|
// Add to front of array (latest first)
|
||||||
cexTokens.value.unshift({
|
cexTokens.value.unshift({
|
||||||
mint: data.mint,
|
mint: data.mint, // mint is already a string
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Keep only latest 50 items for performance
|
// Keep only latest 100 items for performance
|
||||||
if (cexTokens.value.length > 50) {
|
if (cexTokens.value.length > 100) {
|
||||||
cexTokens.value = cexTokens.value.slice(0, 50);
|
cexTokens.value = cexTokens.value.slice(0, 100);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const addMaxDepthToken = (data: MaxDepthTokenData) => {
|
const addMaxDepthToken = (data: MaxDepthReachedData) => {
|
||||||
// Add to front of array (latest first)
|
// Add to front of array (latest first)
|
||||||
maxDepthTokens.value.unshift({
|
maxDepthTokens.value.unshift({
|
||||||
mint: data.mint,
|
mint: data.mint, // mint is already a string
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Keep only latest 50 items for performance
|
// Keep only latest 100 items for performance
|
||||||
if (maxDepthTokens.value.length > 50) {
|
if (maxDepthTokens.value.length > 100) {
|
||||||
maxDepthTokens.value = maxDepthTokens.value.slice(0, 50);
|
maxDepthTokens.value = maxDepthTokens.value.slice(0, 100);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const getCexCardClass = (cexName: string): string => {
|
// Event handlers for TokenCard
|
||||||
const name = cexName?.toLowerCase() || '';
|
const openToken = (token: NewTokenCreatedData | TokenCexUpdatedData | MaxDepthReachedData) => {
|
||||||
|
try {
|
||||||
|
let bondingCurveAddress = '';
|
||||||
|
|
||||||
if (name.includes('coinbase')) {
|
// Always prioritize bonding curve address
|
||||||
return 'bg-blue-600 hover:bg-blue-700';
|
if ('bonding_curve' in token && token.bonding_curve) {
|
||||||
|
if (Array.isArray(token.bonding_curve)) {
|
||||||
|
bondingCurveAddress = byteArrayToAddress(token.bonding_curve);
|
||||||
|
} else if (typeof token.bonding_curve === 'string') {
|
||||||
|
if (isAddress(token.bonding_curve)) {
|
||||||
|
bondingCurveAddress = token.bonding_curve;
|
||||||
|
} else {
|
||||||
|
bondingCurveAddress = toSolanaAddress(token.bonding_curve);
|
||||||
}
|
}
|
||||||
else if (name.includes('mexc')) {
|
|
||||||
return 'bg-green-600 hover:bg-green-700';
|
|
||||||
}
|
}
|
||||||
else if (name.includes('binance')) {
|
|
||||||
return 'bg-yellow-600 hover:bg-yellow-700';
|
|
||||||
}
|
}
|
||||||
else if (name.includes('okx') || name.includes('okex')) {
|
|
||||||
return 'bg-gray-600 hover:bg-gray-700';
|
if (bondingCurveAddress) {
|
||||||
|
const axiomUrl = `https://axiom.trade/meme/${bondingCurveAddress}`;
|
||||||
|
|
||||||
|
// Use Electron API to open external URL
|
||||||
|
if (window.electronAPI) {
|
||||||
|
window.electronAPI.openExternal(axiomUrl);
|
||||||
|
} else {
|
||||||
|
// Fallback for development or non-Electron environment
|
||||||
|
window.open(axiomUrl, '_blank');
|
||||||
}
|
}
|
||||||
else if (name.includes('bybit')) {
|
} else {
|
||||||
return 'bg-purple-600 hover:bg-purple-700';
|
console.warn('No bonding curve address found for token:', token);
|
||||||
}
|
}
|
||||||
else if (name.includes('kucoin')) {
|
} catch (error) {
|
||||||
return 'bg-emerald-600 hover:bg-emerald-700';
|
console.error('Error opening token in Axiom:', error);
|
||||||
}
|
|
||||||
else if (name.includes('gate')) {
|
|
||||||
return 'bg-red-600 hover:bg-red-700';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return 'bg-slate-600 hover:bg-slate-700';
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const getCexDisplayName = (cexName: string): string => {
|
const hideToken = (_token: NewTokenCreatedData | TokenCexUpdatedData | MaxDepthReachedData) => {
|
||||||
const name = cexName?.toLowerCase() || '';
|
// TODO: Implement hide functionality
|
||||||
|
|
||||||
if (name.includes('coinbase')) {
|
|
||||||
return 'Coinbase';
|
|
||||||
}
|
|
||||||
else if (name.includes('mexc')) {
|
|
||||||
return 'MEXC';
|
|
||||||
}
|
|
||||||
else if (name.includes('binance')) {
|
|
||||||
return 'Binance';
|
|
||||||
}
|
|
||||||
else if (name.includes('okx') || name.includes('okex')) {
|
|
||||||
return 'OKX';
|
|
||||||
}
|
|
||||||
else if (name.includes('bybit')) {
|
|
||||||
return 'Bybit';
|
|
||||||
}
|
|
||||||
else if (name.includes('kucoin')) {
|
|
||||||
return 'KuCoin';
|
|
||||||
}
|
|
||||||
else if (name.includes('gate')) {
|
|
||||||
return 'Gate.io';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return cexName || 'Unknown';
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const truncateAddress = (address: string): string => {
|
const watchToken = (_token: NewTokenCreatedData | TokenCexUpdatedData | MaxDepthReachedData) => {
|
||||||
if (!address) return '';
|
// TODO: Implement watch functionality
|
||||||
return `${address.slice(0, 4)}...${address.slice(-4)}`;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const formatTime = (timestamp: number | string): string => {
|
const quickBuyToken = (_token: NewTokenCreatedData | TokenCexUpdatedData | MaxDepthReachedData) => {
|
||||||
let time: number;
|
// TODO: Implement quick buy functionality
|
||||||
|
|
||||||
if (typeof timestamp === 'string') {
|
|
||||||
time = parseInt(timestamp);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
time = timestamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
const date = new Date(time * 1000);
|
|
||||||
const now = new Date();
|
|
||||||
const diff = now.getTime() - date.getTime();
|
|
||||||
|
|
||||||
if (diff < 60000) { // Less than 1 minute
|
|
||||||
return 'Just now';
|
|
||||||
}
|
|
||||||
else if (diff < 3600000) { // Less than 1 hour
|
|
||||||
const minutes = Math.floor(diff / 60000);
|
|
||||||
return `${minutes}m ago`;
|
|
||||||
}
|
|
||||||
else if (diff < 86400000) { // Less than 1 day
|
|
||||||
const hours = Math.floor(diff / 3600000);
|
|
||||||
return `${hours}h ago`;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return date.toLocaleDateString();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const openToken = (bondingCurve: string | undefined) => {
|
|
||||||
if (bondingCurve && window.electronAPI) {
|
|
||||||
const url = `https://axiom.trade/meme/${bondingCurve}`;
|
|
||||||
window.electronAPI.openExternal(url);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Navigation handlers
|
||||||
const handleLogout = async () => {
|
const handleLogout = async () => {
|
||||||
await appStore.logout();
|
await appStore.logout();
|
||||||
router.push('/login');
|
router.push('/login');
|
||||||
|
|
@ -404,11 +390,87 @@ const navigateToDashboard = () => {
|
||||||
router.push('/dashboard');
|
router.push('/dashboard');
|
||||||
};
|
};
|
||||||
|
|
||||||
const navigateToProfile = () => {
|
// Clear all functions (performance optimized)
|
||||||
router.push('/profile');
|
const clearAllNewTokens = () => {
|
||||||
|
newTokens.value.length = 0; // Fastest way to clear array
|
||||||
|
};
|
||||||
|
|
||||||
|
const clearAllCexTokens = () => {
|
||||||
|
cexTokens.value.length = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
const clearAllMaxDepthTokens = () => {
|
||||||
|
maxDepthTokens.value.length = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Individual remove functions (using findIndex for performance)
|
||||||
|
const removeNewToken = (token: NewTokenCreatedData | TokenCexUpdatedData | MaxDepthReachedData) => {
|
||||||
|
// Type guard to ensure it's a NewTokenCreatedData
|
||||||
|
if ('symbol' in token && Array.isArray(token.mint)) {
|
||||||
|
const mintAddr = byteArrayToAddress(token.mint);
|
||||||
|
const index = newTokens.value.findIndex(t => byteArrayToAddress(t.mint) === mintAddr);
|
||||||
|
if (index > -1) {
|
||||||
|
newTokens.value.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const removeCexToken = (token: TokenCexUpdatedData | MaxDepthReachedData) => {
|
||||||
|
// Type guard to ensure it's a TokenCexUpdatedData (doesn't have bonding_curve)
|
||||||
|
if (!('bonding_curve' in token)) {
|
||||||
|
const index = cexTokens.value.findIndex(t => t.mint === token.mint);
|
||||||
|
if (index > -1) {
|
||||||
|
cexTokens.value.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const removeMaxDepthToken = (token: TokenCexUpdatedData | MaxDepthReachedData) => {
|
||||||
|
// Type guard to ensure it's a MaxDepthReachedData (has bonding_curve)
|
||||||
|
if ('bonding_curve' in token) {
|
||||||
|
const index = maxDepthTokens.value.findIndex(t => t.mint === token.mint);
|
||||||
|
if (index > -1) {
|
||||||
|
maxDepthTokens.value.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* Page-specific styles if needed */
|
/* Professional scrollbar styling */
|
||||||
|
.overflow-y-auto {
|
||||||
|
scrollbar-width: thin;
|
||||||
|
scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.overflow-y-auto::-webkit-scrollbar {
|
||||||
|
width: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.overflow-y-auto::-webkit-scrollbar-track {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.overflow-y-auto::-webkit-scrollbar-thumb {
|
||||||
|
background-color: rgba(0, 0, 0, 0.15);
|
||||||
|
border-radius: 3px;
|
||||||
|
transition: background-color 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.overflow-y-auto::-webkit-scrollbar-thumb:hover {
|
||||||
|
background-color: rgba(0, 0, 0, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure proper grid layout */
|
||||||
|
.grid-cols-3 > section {
|
||||||
|
min-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Smooth transitions */
|
||||||
|
* {
|
||||||
|
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
||||||
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
transition-duration: 150ms;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
@ -1,24 +1,39 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="min-h-screen bg-base-100 flex items-center justify-center">
|
<div class="min-h-screen bg-base-100 flex items-center justify-center">
|
||||||
<div v-if="appStore.isLoading" class="text-center">
|
<div
|
||||||
|
v-if="isLoading"
|
||||||
|
key="loading-state"
|
||||||
|
class="text-center"
|
||||||
|
>
|
||||||
<div class="loading loading-spinner loading-lg text-primary mb-4" />
|
<div class="loading loading-spinner loading-lg text-primary mb-4" />
|
||||||
<h2 class="text-xl font-semibold text-base-content mb-2">Loading Ziya</h2>
|
<h2 class="text-xl font-semibold text-base-content mb-2">Loading Ziya</h2>
|
||||||
<p class="text-base-content/70">Initializing your trading environment...</p>
|
<p class="text-base-content/70">Initializing your trading environment...</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else-if="appStore.error" class="text-center max-w-md">
|
<div
|
||||||
|
v-else-if="error"
|
||||||
|
key="error-state"
|
||||||
|
class="text-center max-w-md"
|
||||||
|
>
|
||||||
<div class="alert alert-error mb-4">
|
<div class="alert alert-error mb-4">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="stroke-current shrink-0 h-6 w-6" fill="none" viewBox="0 0 24 24">
|
<svg xmlns="http://www.w3.org/2000/svg" class="stroke-current shrink-0 h-6 w-6" fill="none" viewBox="0 0 24 24">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
|
||||||
</svg>
|
</svg>
|
||||||
<span>{{ appStore.error }}</span>
|
<span>{{ error }}</span>
|
||||||
</div>
|
</div>
|
||||||
<button class="btn btn-primary" @click="retryInitialization">
|
<button
|
||||||
|
class="btn btn-primary"
|
||||||
|
@click="retryInitialization"
|
||||||
|
>
|
||||||
Try Again
|
Try Again
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else class="text-center max-w-6xl px-4">
|
<div
|
||||||
|
v-else
|
||||||
|
key="main-content"
|
||||||
|
class="text-center max-w-6xl px-4"
|
||||||
|
>
|
||||||
<!-- Hero Section -->
|
<!-- Hero Section -->
|
||||||
<div class="mb-12">
|
<div class="mb-12">
|
||||||
<div class="w-24 h-24 mx-auto mb-6 bg-primary/10 rounded-full flex items-center justify-center">
|
<div class="w-24 h-24 mx-auto mb-6 bg-primary/10 rounded-full flex items-center justify-center">
|
||||||
|
|
@ -81,45 +96,64 @@
|
||||||
<!-- App Version -->
|
<!-- App Version -->
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<p class="text-xs text-base-content/50">
|
<p class="text-xs text-base-content/50">
|
||||||
Version {{ appStore.appVersion }}
|
Version {{ appVersion }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup>
|
||||||
import { onMounted } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { useAppStore } from '~/stores/app';
|
|
||||||
|
|
||||||
// Use auth layout to prevent navbar from showing
|
// Use auth layout to prevent navbar from showing
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
layout: 'auth',
|
layout: 'auth',
|
||||||
});
|
});
|
||||||
|
|
||||||
const appStore = useAppStore();
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
// Local reactive state instead of accessing store immediately
|
||||||
|
const isLoading = ref(true);
|
||||||
|
const error = ref(null);
|
||||||
|
const appVersion = ref('1.0.0');
|
||||||
|
|
||||||
const navigateToLogin = () => {
|
const navigateToLogin = () => {
|
||||||
router.push('/login');
|
router.push('/login');
|
||||||
};
|
};
|
||||||
|
|
||||||
const retryInitialization = async () => {
|
const retryInitialization = async () => {
|
||||||
|
isLoading.value = true;
|
||||||
|
error.value = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// Only import and use store after mount
|
||||||
|
const { useAppStore } = await import('../stores/app');
|
||||||
|
const appStore = useAppStore();
|
||||||
await appStore.initialize();
|
await appStore.initialize();
|
||||||
}
|
appVersion.value = appStore.appVersion;
|
||||||
catch (error) {
|
isLoading.value = false;
|
||||||
console.error('Retry failed:', error);
|
} catch (err) {
|
||||||
|
error.value = err instanceof Error ? err.message : 'Failed to initialize app';
|
||||||
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
// Only access store after component is mounted (client-side only)
|
||||||
|
if (import.meta.client) {
|
||||||
try {
|
try {
|
||||||
|
const { useAppStore } = await import('../stores/app');
|
||||||
|
const appStore = useAppStore();
|
||||||
await appStore.initialize();
|
await appStore.initialize();
|
||||||
|
appVersion.value = appStore.appVersion;
|
||||||
|
isLoading.value = false;
|
||||||
|
} catch (err) {
|
||||||
|
error.value = err instanceof Error ? err.message : 'Failed to initialize app';
|
||||||
|
isLoading.value = false;
|
||||||
|
console.error('App initialization failed:', err);
|
||||||
}
|
}
|
||||||
catch (error) {
|
|
||||||
console.error('App initialization failed:', error);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,10 @@
|
||||||
<p class="text-base-content/70">Sign in to your trading platform</p>
|
<p class="text-base-content/70">Sign in to your trading platform</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form class="space-y-4" @submit.prevent="handleLogin">
|
<form
|
||||||
|
class="space-y-4"
|
||||||
|
@submit.prevent="handleLogin"
|
||||||
|
>
|
||||||
<div class="form-control">
|
<div class="form-control">
|
||||||
<label class="label">
|
<label class="label">
|
||||||
<span class="label-text">Email Address</span>
|
<span class="label-text">Email Address</span>
|
||||||
|
|
@ -47,10 +50,10 @@
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
class="btn btn-primary w-full"
|
class="btn btn-primary w-full"
|
||||||
:class="{ loading: appStore.isLoading }"
|
:class="{ loading: isLoading }"
|
||||||
:disabled="appStore.isLoading"
|
:disabled="isLoading"
|
||||||
>
|
>
|
||||||
{{ appStore.isLoading ? 'Signing in...' : 'Sign In' }}
|
{{ isLoading ? 'Signing in...' : 'Sign In' }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
@ -83,44 +86,78 @@
|
||||||
<!-- App Version -->
|
<!-- App Version -->
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<p class="text-xs opacity-50">
|
<p class="text-xs opacity-50">
|
||||||
Version {{ appStore.appVersion }}
|
Version {{ appVersion }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup>
|
||||||
|
import { onMounted, ref } from 'vue';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
layout: 'auth',
|
layout: 'auth',
|
||||||
});
|
});
|
||||||
|
|
||||||
const appStore = useAppStore();
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
// Local reactive state instead of accessing store immediately
|
||||||
const email = ref('');
|
const email = ref('');
|
||||||
const password = ref('');
|
const password = ref('');
|
||||||
|
const isLoading = ref(false);
|
||||||
|
const appVersion = ref('1.0.0');
|
||||||
|
const isAuthenticated = ref(false);
|
||||||
|
|
||||||
// Redirect if already authenticated
|
// Redirect if already authenticated - but only after mount
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
|
if (import.meta.client) {
|
||||||
|
try {
|
||||||
|
const { useAppStore } = await import('../stores/app');
|
||||||
|
const appStore = useAppStore();
|
||||||
|
|
||||||
|
// Initialize app if not already done
|
||||||
|
if (!appStore.isInitialized) {
|
||||||
|
await appStore.initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
appVersion.value = appStore.appVersion;
|
||||||
|
isAuthenticated.value = appStore.isAuthenticated;
|
||||||
|
|
||||||
|
// Redirect if already authenticated
|
||||||
if (appStore.isAuthenticated) {
|
if (appStore.isAuthenticated) {
|
||||||
router.push('/dashboard');
|
router.push('/dashboard');
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Failed to initialize app store:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleLogin = async () => {
|
const handleLogin = async () => {
|
||||||
if (!email.value || !password.value) {
|
if (!email.value || !password.value) {
|
||||||
appStore.showToastMessage('Please fill in all fields', 'error');
|
// Simple client-side validation without store
|
||||||
|
console.warn('Please fill in all fields');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isLoading.value = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await appStore.login(email.value, password.value);
|
// Dynamic import to avoid SSR issues
|
||||||
appStore.showToastMessage('Welcome back!', 'success');
|
const { useAppStore } = await import('../stores/app');
|
||||||
|
const appStore = useAppStore();
|
||||||
|
|
||||||
|
const success = await appStore.login(email.value, password.value);
|
||||||
|
|
||||||
|
if (success) {
|
||||||
router.push('/dashboard');
|
router.push('/dashboard');
|
||||||
}
|
}
|
||||||
catch (error) {
|
} catch (error) {
|
||||||
appStore.showToastMessage('Invalid credentials. Please try again.', 'error');
|
console.error('Login failed:', error);
|
||||||
|
} finally {
|
||||||
|
isLoading.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="font-semibold">Bought SOL</div>
|
<div class="font-semibold">Bought SOL</div>
|
||||||
<div class="text-sm text-base-content/70">2 days ago, 9:15 AM</div>
|
<div class="text-sm text-base-content/70">2 days ago, 4:15 PM</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-right">
|
<div class="text-right">
|
||||||
|
|
@ -220,6 +220,10 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { onMounted } from 'vue';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import { useAppStore } from '../stores/app';
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
|
import { useZiyaConfig } from '../composables/useZiyaConfig';
|
||||||
import { useThemeStore } from './theme';
|
import { useThemeStore } from './theme';
|
||||||
|
|
||||||
interface AppState {
|
interface AppState {
|
||||||
isInitialized: boolean;
|
isInitialized: boolean;
|
||||||
isLoading: boolean;
|
isLoading: boolean;
|
||||||
error: string | null;
|
error: string | null;
|
||||||
currentUser: { name: string, email: string } | null;
|
currentUser: { name: string; email: string } | null;
|
||||||
appVersion: string;
|
appVersion: string;
|
||||||
toastMessage: string;
|
toastMessage: string;
|
||||||
toastType: 'success' | 'error' | 'info';
|
toastType: 'success' | 'error' | 'info';
|
||||||
|
|
@ -13,16 +14,21 @@ interface AppState {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useAppStore = defineStore('app', {
|
export const useAppStore = defineStore('app', {
|
||||||
state: (): AppState => ({
|
state: (): AppState => {
|
||||||
|
// Get config from composable if available (client-side)
|
||||||
|
const { config } = import.meta.client ? useZiyaConfig() : { config: { app: { version: '1.0.0' } } };
|
||||||
|
|
||||||
|
return {
|
||||||
isInitialized: false,
|
isInitialized: false,
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
error: null,
|
error: null,
|
||||||
currentUser: null,
|
currentUser: null,
|
||||||
appVersion: '1.0.0',
|
appVersion: config.app.version,
|
||||||
toastMessage: '',
|
toastMessage: '',
|
||||||
toastType: 'info',
|
toastType: 'info',
|
||||||
showToast: false,
|
showToast: false,
|
||||||
}),
|
};
|
||||||
|
},
|
||||||
|
|
||||||
getters: {
|
getters: {
|
||||||
isAuthenticated: state => state.currentUser !== null,
|
isAuthenticated: state => state.currentUser !== null,
|
||||||
|
|
@ -34,6 +40,18 @@ export const useAppStore = defineStore('app', {
|
||||||
.join('')
|
.join('')
|
||||||
.toUpperCase();
|
.toUpperCase();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
appInfo: (state) => {
|
||||||
|
// Get config for additional app info
|
||||||
|
const { config } = import.meta.client ? useZiyaConfig() : { config: { app: { name: 'Ziya', version: '1.0.0', description: 'Trading Platform', author: 'bismillahDAO' } } };
|
||||||
|
|
||||||
|
return {
|
||||||
|
name: config.app.name,
|
||||||
|
version: state.appVersion,
|
||||||
|
description: config.app.description,
|
||||||
|
author: config.app.author,
|
||||||
|
};
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
@ -50,8 +68,6 @@ export const useAppStore = defineStore('app', {
|
||||||
|
|
||||||
// Mark as initialized
|
// Mark as initialized
|
||||||
this.isInitialized = true;
|
this.isInitialized = true;
|
||||||
|
|
||||||
console.log('App initialized successfully');
|
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
this.error = error instanceof Error ? error.message : 'Failed to initialize app';
|
this.error = error instanceof Error ? error.message : 'Failed to initialize app';
|
||||||
|
|
@ -76,7 +92,7 @@ export const useAppStore = defineStore('app', {
|
||||||
}, 3000);
|
}, 3000);
|
||||||
},
|
},
|
||||||
|
|
||||||
async login(email: string, password: string) {
|
async login(email: string, _password: string) {
|
||||||
this.setLoading(true);
|
this.setLoading(true);
|
||||||
try {
|
try {
|
||||||
// Simulate API call
|
// Simulate API call
|
||||||
|
|
@ -91,7 +107,7 @@ export const useAppStore = defineStore('app', {
|
||||||
this.showToastMessage('Welcome back!', 'success');
|
this.showToastMessage('Welcome back!', 'success');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch {
|
||||||
this.showToastMessage('Login failed. Please try again.', 'error');
|
this.showToastMessage('Login failed. Please try again.', 'error');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,15 @@
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
|
import { useZiyaConfig } from '../composables/useZiyaConfig';
|
||||||
|
|
||||||
export const useThemeStore = defineStore('theme', {
|
export const useThemeStore = defineStore('theme', {
|
||||||
state: () => ({
|
state: () => {
|
||||||
isDark: false,
|
// Get config from composable if available (client-side)
|
||||||
currentPalette: 1, // Use number instead of string for easier handling
|
const { config } = import.meta.client ? useZiyaConfig() : { config: { theme: { defaultDarkMode: false, defaultPalette: 1, availablePalettes: Array.from({ length: 24 }, (_, i) => i + 1) } } };
|
||||||
availablePalettes: Array.from({ length: 24 }, (_, i) => i + 1), // [1, 2, 3, ..., 24]
|
|
||||||
|
return {
|
||||||
|
isDark: config.theme.defaultDarkMode,
|
||||||
|
currentPalette: config.theme.defaultPalette,
|
||||||
|
availablePalettes: config.theme.availablePalettes,
|
||||||
|
|
||||||
// Theme names for display
|
// Theme names for display
|
||||||
paletteNames: {
|
paletteNames: {
|
||||||
|
|
@ -33,7 +38,8 @@ export const useThemeStore = defineStore('theme', {
|
||||||
23: 'Teal Vivid',
|
23: 'Teal Vivid',
|
||||||
24: 'Sunshine',
|
24: 'Sunshine',
|
||||||
} as Record<number, string>,
|
} as Record<number, string>,
|
||||||
}),
|
};
|
||||||
|
},
|
||||||
|
|
||||||
getters: {
|
getters: {
|
||||||
currentTheme(): string {
|
currentTheme(): string {
|
||||||
|
|
@ -78,8 +84,6 @@ export const useThemeStore = defineStore('theme', {
|
||||||
// Add a class for easier CSS targeting
|
// Add a class for easier CSS targeting
|
||||||
html.className = html.className.replace(/theme-[\w-]+/g, '');
|
html.className = html.className.replace(/theme-[\w-]+/g, '');
|
||||||
html.classList.add(`theme-${theme}`);
|
html.classList.add(`theme-${theme}`);
|
||||||
|
|
||||||
console.log(`Applied theme: ${theme}`);
|
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.error('Error applying theme:', error);
|
console.error('Error applying theme:', error);
|
||||||
|
|
@ -107,18 +111,13 @@ export const useThemeStore = defineStore('theme', {
|
||||||
|
|
||||||
// Apply the theme
|
// Apply the theme
|
||||||
this.applyTheme();
|
this.applyTheme();
|
||||||
|
|
||||||
console.log('Theme initialized:', {
|
|
||||||
isDark: this.isDark,
|
|
||||||
currentPalette: this.currentPalette,
|
|
||||||
currentTheme: this.currentTheme,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.error('Error initializing theme:', error);
|
console.error('Error initializing theme:', error);
|
||||||
// Fallback to defaults
|
// Fallback to defaults from config
|
||||||
this.isDark = false;
|
const { config } = useZiyaConfig();
|
||||||
this.currentPalette = 1;
|
this.isDark = config.theme.defaultDarkMode;
|
||||||
|
this.currentPalette = config.theme.defaultPalette;
|
||||||
this.applyTheme();
|
this.applyTheme();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -137,8 +136,11 @@ export const useThemeStore = defineStore('theme', {
|
||||||
},
|
},
|
||||||
|
|
||||||
resetToDefault() {
|
resetToDefault() {
|
||||||
this.isDark = false;
|
// Get defaults from config
|
||||||
this.currentPalette = 1;
|
const { config } = useZiyaConfig();
|
||||||
|
|
||||||
|
this.isDark = config.theme.defaultDarkMode;
|
||||||
|
this.currentPalette = config.theme.defaultPalette;
|
||||||
this.applyTheme();
|
this.applyTheme();
|
||||||
this.saveToStorage();
|
this.saveToStorage();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
88
app/utils/address.ts
Normal file
88
app/utils/address.ts
Normal file
|
|
@ -0,0 +1,88 @@
|
||||||
|
import { type Address, address, getAddressDecoder, isAddress } from '@solana/kit';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts a 32-byte Uint8Array to a Solana address using proper Solana utilities
|
||||||
|
*/
|
||||||
|
export function bytesToAddress(bytes: Uint8Array): Address {
|
||||||
|
if (bytes.length !== 32) {
|
||||||
|
throw new Error(`Expected 32 bytes, got ${bytes.length}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const decoder = getAddressDecoder();
|
||||||
|
return decoder.decode(bytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts a comma-separated byte string to a Solana address
|
||||||
|
* Example: "207,240,50,185,127,150,26,145..." -> "B9Lf9z5BfNPT4d5KMeaBFx8x1G4CULZYR1jA2kmxRDka"
|
||||||
|
*/
|
||||||
|
export function byteStringToAddress(byteString: string): Address {
|
||||||
|
const bytes = byteString.split(',').map(b => parseInt(b.trim(), 10));
|
||||||
|
|
||||||
|
if (bytes.length !== 32) {
|
||||||
|
throw new Error(`Expected 32 bytes, got ${bytes.length}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const uint8Array = new Uint8Array(bytes);
|
||||||
|
return bytesToAddress(uint8Array);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts an array of numbers to a Solana address
|
||||||
|
* Example: [207, 240, 50, 185, ...] -> "B9Lf9z5BfNPT4d5KMeaBFx8x1G4CULZYR1jA2kmxRDka"
|
||||||
|
*/
|
||||||
|
export function byteArrayToAddress(byteArray: number[]): Address {
|
||||||
|
if (byteArray.length !== 32) {
|
||||||
|
throw new Error(`Expected 32 bytes, got ${byteArray.length}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const uint8Array = new Uint8Array(byteArray);
|
||||||
|
return bytesToAddress(uint8Array);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts various input formats to a valid Solana address
|
||||||
|
*/
|
||||||
|
export function toSolanaAddress(input: string | Uint8Array | number[]): Address {
|
||||||
|
if (typeof input === 'string') {
|
||||||
|
// Check if it's already a valid address
|
||||||
|
if (isAddress(input)) {
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if it's a comma-separated byte string
|
||||||
|
if (input.includes(',')) {
|
||||||
|
return byteStringToAddress(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try to parse as address
|
||||||
|
return address(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (input instanceof Uint8Array) {
|
||||||
|
return bytesToAddress(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(input)) {
|
||||||
|
return byteArrayToAddress(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error('Invalid input format for address conversion');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Truncates an address for display purposes
|
||||||
|
*/
|
||||||
|
export function truncateAddress(addr: string | Address, startLength = 4, endLength = 4): string {
|
||||||
|
if (addr.length <= startLength + endLength) {
|
||||||
|
return addr;
|
||||||
|
}
|
||||||
|
return `${addr.slice(0, startLength)}...${addr.slice(-endLength)}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validates if a string is a valid Solana address
|
||||||
|
*/
|
||||||
|
export function isValidSolanaAddress(input: string): boolean {
|
||||||
|
return isAddress(input);
|
||||||
|
}
|
||||||
235
app/utils/ipfs.ts
Normal file
235
app/utils/ipfs.ts
Normal file
|
|
@ -0,0 +1,235 @@
|
||||||
|
// Simple IPFS metadata fetcher with direct gateway access
|
||||||
|
export interface TokenMetadata {
|
||||||
|
name?: string;
|
||||||
|
symbol?: string;
|
||||||
|
description?: string;
|
||||||
|
image?: string;
|
||||||
|
showName?: boolean;
|
||||||
|
createdOn?: string;
|
||||||
|
twitter?: string;
|
||||||
|
website?: string;
|
||||||
|
telegram?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cache for metadata to avoid duplicate requests
|
||||||
|
const metadataCache = new Map<string, TokenMetadata>();
|
||||||
|
|
||||||
|
// IPFS gateways that support CORS
|
||||||
|
const IPFS_GATEWAYS = [
|
||||||
|
'https://dweb.link/ipfs/',
|
||||||
|
'https://nftstorage.link/ipfs/',
|
||||||
|
'https://cloudflare-ipfs.com/ipfs/',
|
||||||
|
'https://gateway.pinata.cloud/ipfs/',
|
||||||
|
'https://ipfs.io/ipfs/'
|
||||||
|
];
|
||||||
|
|
||||||
|
// Extract IPFS hash from various URI formats
|
||||||
|
function extractIpfsHash(uri: string): string | null {
|
||||||
|
if (!uri) return null;
|
||||||
|
|
||||||
|
// Handle different IPFS URI formats:
|
||||||
|
// - ipfs://bafkreixxx
|
||||||
|
// - https://ipfs.io/ipfs/bafkreixxx
|
||||||
|
// - bafkreixxx (direct hash)
|
||||||
|
|
||||||
|
if (uri.startsWith('ipfs://')) {
|
||||||
|
return uri.replace('ipfs://', '');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (uri.includes('/ipfs/')) {
|
||||||
|
const parts = uri.split('/ipfs/');
|
||||||
|
return parts[1]?.split('/')[0] || null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Assume it's a direct hash if it looks like one
|
||||||
|
if (uri.match(/^[a-zA-Z0-9]{46,}$/)) {
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function fetchTokenMetadata(uri: string): Promise<TokenMetadata | null> {
|
||||||
|
if (!uri || typeof uri !== 'string') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check cache first
|
||||||
|
if (metadataCache.has(uri)) {
|
||||||
|
return metadataCache.get(uri)!;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Extract IPFS hash from URI
|
||||||
|
const hash = extractIpfsHash(uri);
|
||||||
|
if (!hash) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try each gateway until one works
|
||||||
|
for (const gateway of IPFS_GATEWAYS) {
|
||||||
|
try {
|
||||||
|
const url = `${gateway}${hash}`;
|
||||||
|
|
||||||
|
const response = await fetch(url, {
|
||||||
|
method: 'GET',
|
||||||
|
mode: 'cors',
|
||||||
|
headers: {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
},
|
||||||
|
signal: AbortSignal.timeout(8000) // 8 second timeout
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
continue; // Try next gateway
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if response is JSON
|
||||||
|
const contentType = response.headers.get('content-type');
|
||||||
|
if (!contentType || !contentType.includes('application/json')) {
|
||||||
|
continue; // Try next gateway
|
||||||
|
}
|
||||||
|
|
||||||
|
const metadata: TokenMetadata = await response.json();
|
||||||
|
|
||||||
|
// Cache the result
|
||||||
|
metadataCache.set(uri, metadata);
|
||||||
|
return metadata;
|
||||||
|
|
||||||
|
} catch {
|
||||||
|
// Continue to next gateway
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If all gateways fail, return null
|
||||||
|
return null;
|
||||||
|
|
||||||
|
} catch {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function to get token image URL
|
||||||
|
export function getTokenImage(metadata: TokenMetadata): string | null {
|
||||||
|
if (!metadata.image) return null;
|
||||||
|
|
||||||
|
// If the image is already a full URL, return it
|
||||||
|
if (metadata.image.startsWith('http')) {
|
||||||
|
return metadata.image;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If it's an IPFS URI, extract the hash and use a reliable gateway
|
||||||
|
const hash = extractIpfsHash(metadata.image);
|
||||||
|
if (hash) {
|
||||||
|
return `https://dweb.link/ipfs/${hash}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return metadata.image;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function to check if a URL is a social media link
|
||||||
|
export function getSocialIcon(url: string): string | null {
|
||||||
|
if (!url) return null;
|
||||||
|
|
||||||
|
if (url.includes('twitter.com') || url.includes('x.com')) {
|
||||||
|
return 'twitter';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url.includes('telegram.org') || url.includes('t.me')) {
|
||||||
|
return 'telegram';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url.includes('discord.gg') || url.includes('discord.com')) {
|
||||||
|
return 'discord';
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'website';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function to check if metadata has social links
|
||||||
|
export function getSocialLinks(metadata: TokenMetadata) {
|
||||||
|
return {
|
||||||
|
twitter: metadata.twitter || null,
|
||||||
|
website: metadata.website || null,
|
||||||
|
telegram: metadata.telegram || null
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function to validate and clean social URLs
|
||||||
|
export function cleanSocialUrl(url: string): string | null {
|
||||||
|
if (!url || typeof url !== 'string') return null;
|
||||||
|
|
||||||
|
// Basic URL validation
|
||||||
|
try {
|
||||||
|
const urlObj = new URL(url);
|
||||||
|
return urlObj.href;
|
||||||
|
} catch {
|
||||||
|
// If not a valid URL, try to make it one
|
||||||
|
if (!url.startsWith('http')) {
|
||||||
|
try {
|
||||||
|
const urlObj = new URL(`https://${url}`);
|
||||||
|
return urlObj.href;
|
||||||
|
} catch {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function to extract social links from metadata
|
||||||
|
export function extractSocialLinks(metadata: TokenMetadata) {
|
||||||
|
const links: Array<{ type: string; url: string; icon: string }> = [];
|
||||||
|
|
||||||
|
if (metadata.twitter) {
|
||||||
|
const cleanUrl = cleanSocialUrl(metadata.twitter);
|
||||||
|
const icon = getSocialIcon('twitter');
|
||||||
|
if (cleanUrl && icon) {
|
||||||
|
links.push({
|
||||||
|
type: 'twitter',
|
||||||
|
url: cleanUrl,
|
||||||
|
icon
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (metadata.website) {
|
||||||
|
const cleanUrl = cleanSocialUrl(metadata.website);
|
||||||
|
const icon = getSocialIcon('website');
|
||||||
|
if (cleanUrl && icon) {
|
||||||
|
links.push({
|
||||||
|
type: 'website',
|
||||||
|
url: cleanUrl,
|
||||||
|
icon
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (metadata.telegram) {
|
||||||
|
const cleanUrl = cleanSocialUrl(metadata.telegram);
|
||||||
|
const icon = getSocialIcon('telegram');
|
||||||
|
if (cleanUrl && icon) {
|
||||||
|
links.push({
|
||||||
|
type: 'telegram',
|
||||||
|
url: cleanUrl,
|
||||||
|
icon
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return links;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clear cache utility
|
||||||
|
export function clearMetadataCache(): void {
|
||||||
|
metadataCache.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get cache statistics
|
||||||
|
export function getCacheStats() {
|
||||||
|
return {
|
||||||
|
size: metadataCache.size,
|
||||||
|
keys: Array.from(metadataCache.keys())
|
||||||
|
};
|
||||||
|
}
|
||||||
283
architecture/IPFS_RETRY_IMPLEMENTATION.md
Normal file
283
architecture/IPFS_RETRY_IMPLEMENTATION.md
Normal file
|
|
@ -0,0 +1,283 @@
|
||||||
|
# IPFS Retry Implementation & Error Handling
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
This document outlines the comprehensive retry mechanism and error handling improvements implemented for IPFS metadata fetching to resolve `AbortError: signal is aborted without reason` issues and CORS-related problems.
|
||||||
|
|
||||||
|
## Key Features Implemented
|
||||||
|
|
||||||
|
### 1. Enhanced IPFS Utility (`app/utils/ipfs.ts`)
|
||||||
|
|
||||||
|
#### Retry Configuration
|
||||||
|
- **Max Retries**: 5 attempts per gateway (automatic fallback)
|
||||||
|
- **Timeout**: 8 seconds per individual request
|
||||||
|
- **Gateway Rotation**: Automatic fallback to next gateway on failure
|
||||||
|
|
||||||
|
#### CORS-Friendly Gateway Strategy
|
||||||
|
```typescript
|
||||||
|
const IPFS_GATEWAYS = [
|
||||||
|
'https://dweb.link/ipfs/',
|
||||||
|
'https://nftstorage.link/ipfs/',
|
||||||
|
'https://cloudflare-ipfs.com/ipfs/',
|
||||||
|
'https://gateway.pinata.cloud/ipfs/',
|
||||||
|
'https://ipfs.io/ipfs/'
|
||||||
|
];
|
||||||
|
```
|
||||||
|
|
||||||
|
**Gateway Selection Strategy:**
|
||||||
|
- Prioritizes CORS-friendly gateways (`dweb.link`, `nftstorage.link`)
|
||||||
|
- Falls back to other reliable gateways
|
||||||
|
- Automatic rotation on failure
|
||||||
|
|
||||||
|
#### Smart Error Handling
|
||||||
|
- **Content-Type Validation**: Ensures response is JSON before parsing
|
||||||
|
- **Network Error Detection**: Distinguishes between network and parsing errors
|
||||||
|
- **Graceful Degradation**: Returns `null` on failure instead of throwing errors
|
||||||
|
- **Gateway Isolation**: Individual gateway failures don't affect others
|
||||||
|
|
||||||
|
#### Caching Mechanism
|
||||||
|
- **Simple Map-based Cache**: Prevents duplicate requests for same URIs
|
||||||
|
- **Memory Management**: Configurable cache with statistics
|
||||||
|
- **Cache Utilities**: `clearMetadataCache()` and `getCacheStats()` functions
|
||||||
|
|
||||||
|
### 2. Enhanced TokenCard Component (`app/components/TokenCard.vue`)
|
||||||
|
|
||||||
|
#### Direct Metadata Integration
|
||||||
|
- **Non-blocking Loading**: Metadata loads after component mounts
|
||||||
|
- **Individual Error Handling**: Card failures don't affect others
|
||||||
|
- **Visual Feedback**: Loading spinners and error indicators
|
||||||
|
|
||||||
|
#### Social Media Integration
|
||||||
|
```typescript
|
||||||
|
// Automatic detection of social links
|
||||||
|
const socialLinks = extractSocialLinks(metadata);
|
||||||
|
// Returns: { type: 'twitter', url: string, icon: string }[]
|
||||||
|
```
|
||||||
|
|
||||||
|
**Supported Platforms:**
|
||||||
|
- Twitter/X (twitter.com, x.com)
|
||||||
|
- Telegram (t.me, telegram.org)
|
||||||
|
- Discord (discord.gg, discord.com)
|
||||||
|
- Generic Website (fallback)
|
||||||
|
|
||||||
|
#### Image Handling
|
||||||
|
- **IPFS Image Support**: Automatic IPFS hash extraction and gateway routing
|
||||||
|
- **Fallback Avatars**: Gradient avatars with token symbol when images fail
|
||||||
|
- **Error Recovery**: Graceful handling of image load failures
|
||||||
|
|
||||||
|
## Core Functions
|
||||||
|
|
||||||
|
### Primary Functions
|
||||||
|
|
||||||
|
#### `fetchTokenMetadata(uri: string): Promise<TokenMetadata | null>`
|
||||||
|
- Fetches metadata from IPFS URI
|
||||||
|
- Handles multiple URI formats (ipfs://, https://ipfs.io/ipfs/, direct hash)
|
||||||
|
- Returns `null` on failure (no exceptions thrown)
|
||||||
|
- Automatic caching to prevent duplicate requests
|
||||||
|
|
||||||
|
#### `getTokenImage(metadata: TokenMetadata): string | null`
|
||||||
|
- Extracts and formats token image URL
|
||||||
|
- Handles IPFS URIs and direct URLs
|
||||||
|
- Uses reliable gateways for IPFS images
|
||||||
|
|
||||||
|
#### `extractSocialLinks(metadata: TokenMetadata)`
|
||||||
|
- Extracts social media links from metadata
|
||||||
|
- Returns array of social link objects with icons
|
||||||
|
- Validates and cleans URLs
|
||||||
|
|
||||||
|
### Utility Functions
|
||||||
|
|
||||||
|
#### `extractIpfsHash(uri: string): string | null`
|
||||||
|
- Extracts IPFS hash from various URI formats
|
||||||
|
- Supports ipfs://, gateway URLs, and direct hashes
|
||||||
|
|
||||||
|
#### `getSocialIcon(url: string): string | null`
|
||||||
|
- Determines appropriate icon for social media URL
|
||||||
|
- Returns icon identifier for UI rendering
|
||||||
|
|
||||||
|
#### `cleanSocialUrl(url: string): string | null`
|
||||||
|
- Validates and normalizes social media URLs
|
||||||
|
- Adds https:// prefix when missing
|
||||||
|
|
||||||
|
## CORS Resolution
|
||||||
|
|
||||||
|
### Problem Identified
|
||||||
|
Initial implementation encountered CORS errors:
|
||||||
|
```
|
||||||
|
Access to fetch at 'https://ipfs.io/ipfs/...' from origin 'http://localhost:3000'
|
||||||
|
has been blocked by CORS policy: Request header field cache-control is not
|
||||||
|
allowed by Access-Control-Allow-Headers in preflight response.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Solutions Attempted
|
||||||
|
|
||||||
|
#### 1. Server API Route Approach (Abandoned)
|
||||||
|
- Created Nuxt server API route to proxy IPFS requests
|
||||||
|
- Issues: Returned HTML instead of JSON in Electron environment
|
||||||
|
- Not compatible with Electron + Nuxt setup
|
||||||
|
|
||||||
|
#### 2. CORS-Friendly Gateway Strategy (Final Solution)
|
||||||
|
- Prioritized gateways with proper CORS headers
|
||||||
|
- `dweb.link` and `nftstorage.link` as primary gateways
|
||||||
|
- Removed problematic headers from requests
|
||||||
|
- Simplified request configuration
|
||||||
|
|
||||||
|
### Final Working Configuration
|
||||||
|
```typescript
|
||||||
|
const response = await fetch(url, {
|
||||||
|
method: 'GET',
|
||||||
|
mode: 'cors',
|
||||||
|
headers: {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
},
|
||||||
|
signal: AbortSignal.timeout(8000)
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
## Architecture Decisions
|
||||||
|
|
||||||
|
### Why Direct Implementation Over Composables
|
||||||
|
1. **Simplicity**: Direct metadata fetching in components is easier to debug
|
||||||
|
2. **Performance**: Eliminates unnecessary abstraction layers
|
||||||
|
3. **Maintenance**: Fewer files to maintain and update
|
||||||
|
4. **Debugging**: Clearer error tracking and logging
|
||||||
|
|
||||||
|
### Why Multiple Gateways
|
||||||
|
1. **Reliability**: Fallback ensures higher success rate
|
||||||
|
2. **Performance**: Different gateways have varying response times
|
||||||
|
3. **CORS Compatibility**: Not all gateways support CORS properly
|
||||||
|
4. **Geographic Distribution**: Better global accessibility
|
||||||
|
|
||||||
|
### Why Simple Caching
|
||||||
|
1. **Memory Efficiency**: Map-based cache with minimal overhead
|
||||||
|
2. **Request Deduplication**: Prevents multiple requests for same URI
|
||||||
|
3. **No Persistence**: Cache clears on app restart (prevents stale data)
|
||||||
|
4. **Statistics**: Built-in cache monitoring
|
||||||
|
|
||||||
|
## Error Handling Strategy
|
||||||
|
|
||||||
|
### Non-Blocking Operations
|
||||||
|
- Individual token failures don't affect others
|
||||||
|
- UI remains responsive during metadata fetching
|
||||||
|
- Graceful degradation with fallback content
|
||||||
|
|
||||||
|
### User Experience
|
||||||
|
- **Loading States**: Clear visual feedback during fetching
|
||||||
|
- **Error Indicators**: Subtle error icons with tooltips
|
||||||
|
- **Fallback Content**: Token symbol avatars when images fail
|
||||||
|
- **Retry Capability**: Users can refresh individual tokens
|
||||||
|
|
||||||
|
### Developer Experience
|
||||||
|
- **No Console Spam**: Removed all debugging output
|
||||||
|
- **Clear Error Types**: Distinguishable error conditions
|
||||||
|
- **Cache Management**: Tools for cache inspection and clearing
|
||||||
|
|
||||||
|
## Performance Optimizations
|
||||||
|
|
||||||
|
### Request Optimization
|
||||||
|
- 8-second timeout prevents hanging requests
|
||||||
|
- Automatic gateway rotation minimizes wait time
|
||||||
|
- Content-type validation prevents unnecessary parsing
|
||||||
|
- Simple caching reduces duplicate requests
|
||||||
|
|
||||||
|
### UI Optimization
|
||||||
|
- Non-blocking metadata loading
|
||||||
|
- Individual component error isolation
|
||||||
|
- Efficient social link extraction
|
||||||
|
- Optimized image loading with fallbacks
|
||||||
|
|
||||||
|
## Implementation Status
|
||||||
|
|
||||||
|
### ✅ Completed Features
|
||||||
|
- [x] Multiple CORS-friendly IPFS gateways
|
||||||
|
- [x] Automatic retry with gateway fallback
|
||||||
|
- [x] Simple metadata caching
|
||||||
|
- [x] Social media link extraction and icons
|
||||||
|
- [x] Image handling with IPFS support
|
||||||
|
- [x] Error handling without console spam
|
||||||
|
- [x] Non-blocking UI operations
|
||||||
|
- [x] Clean TypeScript implementation
|
||||||
|
|
||||||
|
### 🚫 Removed Features
|
||||||
|
- [x] Complex composable abstractions
|
||||||
|
- [x] Batch processing utilities
|
||||||
|
- [x] Server API proxy routes
|
||||||
|
- [x] Debugging console output
|
||||||
|
- [x] Exponential backoff (replaced with gateway rotation)
|
||||||
|
|
||||||
|
## Usage Examples
|
||||||
|
|
||||||
|
### Basic Metadata Fetching
|
||||||
|
```typescript
|
||||||
|
import { fetchTokenMetadata } from '../utils/ipfs';
|
||||||
|
|
||||||
|
const metadata = await fetchTokenMetadata('https://ipfs.io/ipfs/bafkreixxx');
|
||||||
|
if (metadata) {
|
||||||
|
console.log(metadata.name, metadata.symbol);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Image Handling
|
||||||
|
```typescript
|
||||||
|
import { getTokenImage } from '../utils/ipfs';
|
||||||
|
|
||||||
|
const imageUrl = getTokenImage(metadata);
|
||||||
|
if (imageUrl) {
|
||||||
|
// Use imageUrl for img src
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Social Links
|
||||||
|
```typescript
|
||||||
|
import { extractSocialLinks } from '../utils/ipfs';
|
||||||
|
|
||||||
|
const socialLinks = extractSocialLinks(metadata);
|
||||||
|
socialLinks.forEach(link => {
|
||||||
|
console.log(link.type, link.url, link.icon);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
## Testing and Validation
|
||||||
|
|
||||||
|
### Manual Testing Performed
|
||||||
|
- [x] IPFS metadata fetching from various URIs
|
||||||
|
- [x] Gateway fallback functionality
|
||||||
|
- [x] CORS compatibility across gateways
|
||||||
|
- [x] Image loading and fallback behavior
|
||||||
|
- [x] Social media link detection
|
||||||
|
- [x] Error handling and recovery
|
||||||
|
- [x] Cache functionality and statistics
|
||||||
|
|
||||||
|
### Known Working URIs
|
||||||
|
```
|
||||||
|
https://ipfs.io/ipfs/bafkreigr67ogup7ijve5mq7vh22nyydsvksfqtctxu3bdtsgs47uihlaka
|
||||||
|
https://ipfs.io/ipfs/bafkreido7xq6dx2m7nxlnoeoz562uapvpfs4yup2eyckerzvggylgttcoa
|
||||||
|
```
|
||||||
|
|
||||||
|
## Maintenance Notes
|
||||||
|
|
||||||
|
### Cache Management
|
||||||
|
```typescript
|
||||||
|
import { clearMetadataCache, getCacheStats } from '../utils/ipfs';
|
||||||
|
|
||||||
|
// Clear cache when needed
|
||||||
|
clearMetadataCache();
|
||||||
|
|
||||||
|
// Monitor cache usage
|
||||||
|
const stats = getCacheStats();
|
||||||
|
console.log(`Cache size: ${stats.size}, hits: ${stats.hits}`);
|
||||||
|
```
|
||||||
|
|
||||||
|
### Gateway Management
|
||||||
|
- Monitor gateway performance and update priority as needed
|
||||||
|
- Add new CORS-friendly gateways when available
|
||||||
|
- Remove unreliable gateways from the list
|
||||||
|
|
||||||
|
### Error Monitoring
|
||||||
|
- Monitor for new types of IPFS errors
|
||||||
|
- Update error handling as needed
|
||||||
|
- Track gateway success rates for optimization
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Last Updated**: December 22, 2024
|
||||||
|
**Status**: Production Ready ✅
|
||||||
63
electron/config/environment.ts
Normal file
63
electron/config/environment.ts
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
/**
|
||||||
|
* Environment Configuration
|
||||||
|
* This handles different configurations for development and production builds
|
||||||
|
*/
|
||||||
|
|
||||||
|
export interface EnvironmentConfig {
|
||||||
|
redis: {
|
||||||
|
host: string;
|
||||||
|
port: number;
|
||||||
|
};
|
||||||
|
app: {
|
||||||
|
name: string;
|
||||||
|
version: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Development Configuration
|
||||||
|
*/
|
||||||
|
const developmentConfig: EnvironmentConfig = {
|
||||||
|
redis: {
|
||||||
|
host: 'localhost', // or 'bismillahdao-redis' if using Docker
|
||||||
|
port: 6379,
|
||||||
|
},
|
||||||
|
app: {
|
||||||
|
name: 'Ziya Token Monitor (Dev)',
|
||||||
|
version: '1.0.0-dev',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Production Configuration
|
||||||
|
*/
|
||||||
|
const productionConfig: EnvironmentConfig = {
|
||||||
|
redis: {
|
||||||
|
host: '154.38.185.112', // Your production Redis server
|
||||||
|
port: 6379,
|
||||||
|
},
|
||||||
|
app: {
|
||||||
|
name: 'Ziya Token Monitor',
|
||||||
|
version: '1.0.0',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get configuration based on NODE_ENV
|
||||||
|
*/
|
||||||
|
export const getEnvironmentConfig = (): EnvironmentConfig => {
|
||||||
|
const isProduction = process.env.NODE_ENV === 'production';
|
||||||
|
|
||||||
|
if (isProduction) {
|
||||||
|
console.info('[CONFIG] Using production configuration');
|
||||||
|
return productionConfig;
|
||||||
|
} else {
|
||||||
|
console.info('[CONFIG] Using development configuration');
|
||||||
|
return developmentConfig;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Current environment configuration
|
||||||
|
*/
|
||||||
|
export const ENV_CONFIG = getEnvironmentConfig();
|
||||||
50
electron/config/redis.ts
Normal file
50
electron/config/redis.ts
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
/**
|
||||||
|
* Redis Configuration for different environments
|
||||||
|
*/
|
||||||
|
import { ENV_CONFIG } from './environment';
|
||||||
|
|
||||||
|
export interface RedisConfig {
|
||||||
|
host: string;
|
||||||
|
port: number;
|
||||||
|
lazyConnect: boolean;
|
||||||
|
retryDelayOnFailover: number;
|
||||||
|
maxRetriesPerRequest: number;
|
||||||
|
connectTimeout: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Environment-based Redis configuration
|
||||||
|
*/
|
||||||
|
const getRedisConfig = (): RedisConfig => {
|
||||||
|
return {
|
||||||
|
host: ENV_CONFIG.redis.host,
|
||||||
|
port: ENV_CONFIG.redis.port,
|
||||||
|
lazyConnect: true,
|
||||||
|
retryDelayOnFailover: 100,
|
||||||
|
maxRetriesPerRequest: 3,
|
||||||
|
connectTimeout: 10000,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Channels to subscribe to
|
||||||
|
*/
|
||||||
|
export const REDIS_CHANNELS = [
|
||||||
|
'new_token_created',
|
||||||
|
'token_cex_updated',
|
||||||
|
'max_depth_reached',
|
||||||
|
] as const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the current Redis configuration
|
||||||
|
*/
|
||||||
|
export const REDIS_CONFIG = getRedisConfig();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Log current configuration (without sensitive data)
|
||||||
|
*/
|
||||||
|
export const logRedisConfig = (): void => {
|
||||||
|
const env = process.env.NODE_ENV || 'development';
|
||||||
|
console.info(`[REDIS] Environment: ${env}`);
|
||||||
|
console.info(`[REDIS] Connecting to: ${REDIS_CONFIG.host}:${REDIS_CONFIG.port}`);
|
||||||
|
};
|
||||||
4
electron/handlers/index.ts
Normal file
4
electron/handlers/index.ts
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
export * from './ipc-handlers';
|
||||||
|
export * from './redis-handlers';
|
||||||
|
export { registerWindowHandlers } from './window-handlers';
|
||||||
|
|
||||||
28
electron/handlers/ipc-handlers.ts
Normal file
28
electron/handlers/ipc-handlers.ts
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
import { ipcMain } from 'electron';
|
||||||
|
|
||||||
|
type IpcHandler<T = unknown, R = unknown> = (event: Electron.IpcMainInvokeEvent, ...args: T[]) => Promise<R> | R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Utility function to define IPC handlers with better type safety and error handling
|
||||||
|
*/
|
||||||
|
export function defineIpcHandler<T = unknown, R = unknown>(
|
||||||
|
channel: string,
|
||||||
|
handler: IpcHandler<T, R>,
|
||||||
|
): void {
|
||||||
|
ipcMain.handle(channel, async (event, ...args) => {
|
||||||
|
try {
|
||||||
|
return await handler(event, ...args);
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
console.error(`Error in IPC handler '${channel}':`, error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove an IPC handler
|
||||||
|
*/
|
||||||
|
export function removeIpcHandler(channel: string): void {
|
||||||
|
ipcMain.removeHandler(channel);
|
||||||
|
}
|
||||||
66
electron/handlers/redis-handlers.ts
Normal file
66
electron/handlers/redis-handlers.ts
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
import type { BrowserWindow } from 'electron';
|
||||||
|
|
||||||
|
interface RedisMessageData {
|
||||||
|
channel: string;
|
||||||
|
data: unknown;
|
||||||
|
timestamp: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle new token created events
|
||||||
|
*/
|
||||||
|
export function handleNewTokenCreated(mainWindow: BrowserWindow, data: unknown): void {
|
||||||
|
const messageData: RedisMessageData = {
|
||||||
|
channel: 'new_token_created',
|
||||||
|
data,
|
||||||
|
timestamp: Date.now(),
|
||||||
|
};
|
||||||
|
|
||||||
|
mainWindow.webContents.send('redis-data', messageData);
|
||||||
|
// console.info('Handled new token created:', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle token CEX updated events
|
||||||
|
*/
|
||||||
|
export function handleTokenCexUpdated(mainWindow: BrowserWindow, data: unknown): void {
|
||||||
|
const messageData: RedisMessageData = {
|
||||||
|
channel: 'token_cex_updated',
|
||||||
|
data,
|
||||||
|
timestamp: Date.now(),
|
||||||
|
};
|
||||||
|
|
||||||
|
mainWindow.webContents.send('redis-data', messageData);
|
||||||
|
// console.info('Handled token CEX updated:', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle max depth reached events
|
||||||
|
*/
|
||||||
|
export function handleMaxDepthReached(mainWindow: BrowserWindow, data: unknown): void {
|
||||||
|
const messageData: RedisMessageData = {
|
||||||
|
channel: 'max_depth_reached',
|
||||||
|
data,
|
||||||
|
timestamp: Date.now(),
|
||||||
|
};
|
||||||
|
|
||||||
|
mainWindow.webContents.send('redis-data', messageData);
|
||||||
|
// console.info('Handled max depth reached:', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the appropriate handler for a Redis channel
|
||||||
|
*/
|
||||||
|
export function getRedisChannelHandler(channel: string): ((mainWindow: BrowserWindow, data: unknown) => void) | null {
|
||||||
|
switch (channel) {
|
||||||
|
case 'new_token_created':
|
||||||
|
return handleNewTokenCreated;
|
||||||
|
case 'token_cex_updated':
|
||||||
|
return handleTokenCexUpdated;
|
||||||
|
case 'max_depth_reached':
|
||||||
|
return handleMaxDepthReached;
|
||||||
|
default:
|
||||||
|
console.warn(`No handler found for Redis channel: ${channel}`);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
38
electron/handlers/window-handlers.ts
Normal file
38
electron/handlers/window-handlers.ts
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
import { BrowserWindow, shell } from 'electron';
|
||||||
|
import { defineIpcHandler } from './ipc-handlers';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register all window-related IPC handlers
|
||||||
|
*/
|
||||||
|
export function registerWindowHandlers(): void {
|
||||||
|
defineIpcHandler('window-minimize', () => {
|
||||||
|
const window = BrowserWindow.getFocusedWindow();
|
||||||
|
if (window) window.minimize();
|
||||||
|
});
|
||||||
|
|
||||||
|
defineIpcHandler('window-maximize', () => {
|
||||||
|
const window = BrowserWindow.getFocusedWindow();
|
||||||
|
if (window) {
|
||||||
|
if (window.isMaximized()) {
|
||||||
|
window.unmaximize();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
window.maximize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
defineIpcHandler('window-close', () => {
|
||||||
|
const window = BrowserWindow.getFocusedWindow();
|
||||||
|
if (window) window.close();
|
||||||
|
});
|
||||||
|
|
||||||
|
defineIpcHandler('window-is-maximized', (): boolean => {
|
||||||
|
const window = BrowserWindow.getFocusedWindow();
|
||||||
|
return window ? window.isMaximized() : false;
|
||||||
|
});
|
||||||
|
|
||||||
|
defineIpcHandler('open-external', (_event, url: string) => {
|
||||||
|
shell.openExternal(url);
|
||||||
|
});
|
||||||
|
}
|
||||||
167
electron/main.ts
167
electron/main.ts
|
|
@ -1,162 +1,31 @@
|
||||||
import path from 'node:path';
|
import { BrowserWindow, app } from 'electron';
|
||||||
import { fileURLToPath } from 'node:url';
|
|
||||||
import { BrowserWindow, app, ipcMain, shell } from 'electron';
|
|
||||||
import started from 'electron-squirrel-startup';
|
import started from 'electron-squirrel-startup';
|
||||||
import { Redis } from 'ioredis';
|
import { registerWindowHandlers } from './handlers';
|
||||||
|
import { connectRedis, createMainWindow, disconnectRedis } from './utils';
|
||||||
|
|
||||||
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
|
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
|
||||||
if (started) {
|
if (started) {
|
||||||
app.quit();
|
app.quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Redis connection for pubsub
|
/**
|
||||||
let redisSubscriber: Redis | null = null;
|
* Initialize the application
|
||||||
|
*/
|
||||||
|
function initializeApp(): void {
|
||||||
|
// Connect to Redis
|
||||||
|
connectRedis();
|
||||||
|
|
||||||
const connectRedis = () => {
|
// Register all IPC handlers
|
||||||
try {
|
registerWindowHandlers();
|
||||||
redisSubscriber = new Redis({
|
|
||||||
host: 'bismillahdao-redis',
|
|
||||||
port: 6379,
|
|
||||||
lazyConnect: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('Redis subscriber connection initialized');
|
// Create the main window
|
||||||
}
|
createMainWindow();
|
||||||
catch (error) {
|
}
|
||||||
console.error('Failed to initialize Redis subscriber:', error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const createWindow = () => {
|
|
||||||
// Create the browser window.
|
|
||||||
const mainWindow = new BrowserWindow({
|
|
||||||
minHeight: 800,
|
|
||||||
minWidth: 1080,
|
|
||||||
maxHeight: 1080,
|
|
||||||
maxWidth: 1920,
|
|
||||||
height: 1024,
|
|
||||||
width: 1280,
|
|
||||||
titleBarStyle: 'hidden',
|
|
||||||
webPreferences: {
|
|
||||||
nodeIntegration: false,
|
|
||||||
contextIsolation: true,
|
|
||||||
preload: path.join(__dirname, 'preload.cjs'),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
mainWindow.setMenuBarVisibility(false);
|
|
||||||
|
|
||||||
// Listen for maximize/unmaximize events
|
|
||||||
mainWindow.on('maximize', () => {
|
|
||||||
mainWindow.webContents.send('window-maximize-changed', true);
|
|
||||||
});
|
|
||||||
|
|
||||||
mainWindow.on('unmaximize', () => {
|
|
||||||
mainWindow.webContents.send('window-maximize-changed', false);
|
|
||||||
});
|
|
||||||
|
|
||||||
mainWindow.webContents.on('will-navigate', function (event, reqUrl) {
|
|
||||||
const requestedHost = new URL(reqUrl).host;
|
|
||||||
const currentHost = new URL(mainWindow.webContents.getURL()).host;
|
|
||||||
if (requestedHost && requestedHost != currentHost) {
|
|
||||||
event.preventDefault();
|
|
||||||
shell.openExternal(reqUrl);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Set up Redis pubsub when window is ready
|
|
||||||
mainWindow.webContents.once('dom-ready', () => {
|
|
||||||
setupRedisPubSub(mainWindow);
|
|
||||||
});
|
|
||||||
|
|
||||||
const isDev = process.env.NODE_ENV === 'development';
|
|
||||||
// and load the index.html of the app.
|
|
||||||
if (isDev) {
|
|
||||||
mainWindow.setIcon(fileURLToPath(new URL('../../public/favicon.ico', import.meta.url)));
|
|
||||||
mainWindow.loadURL('http://localhost:3000');
|
|
||||||
mainWindow.webContents.openDevTools();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
mainWindow.loadFile(path.join(__dirname, '../renderer/index.html'));
|
|
||||||
}
|
|
||||||
|
|
||||||
return mainWindow;
|
|
||||||
};
|
|
||||||
|
|
||||||
const setupRedisPubSub = (mainWindow: BrowserWindow) => {
|
|
||||||
if (!redisSubscriber) {
|
|
||||||
console.error('Redis subscriber not initialized');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
// Subscribe to the channels
|
|
||||||
redisSubscriber.subscribe('new_token_created', 'token_cex_updated', 'max_depth_reached');
|
|
||||||
|
|
||||||
redisSubscriber.on('message', (channel: string, message: string) => {
|
|
||||||
try {
|
|
||||||
const data = JSON.parse(message);
|
|
||||||
|
|
||||||
// Send data to renderer process
|
|
||||||
mainWindow.webContents.send('redis-data', {
|
|
||||||
channel,
|
|
||||||
data,
|
|
||||||
timestamp: Date.now(),
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`Received data from channel ${channel}:`, data);
|
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
console.error('Error parsing Redis message:', error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log('Redis pubsub setup complete');
|
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
console.error('Error setting up Redis pubsub:', error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// IPC handlers
|
|
||||||
ipcMain.handle('window-minimize', () => {
|
|
||||||
const window = BrowserWindow.getFocusedWindow();
|
|
||||||
if (window) window.minimize();
|
|
||||||
});
|
|
||||||
|
|
||||||
ipcMain.handle('window-maximize', () => {
|
|
||||||
const window = BrowserWindow.getFocusedWindow();
|
|
||||||
if (window) {
|
|
||||||
if (window.isMaximized()) {
|
|
||||||
window.unmaximize();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
window.maximize();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
ipcMain.handle('window-close', () => {
|
|
||||||
const window = BrowserWindow.getFocusedWindow();
|
|
||||||
if (window) window.close();
|
|
||||||
});
|
|
||||||
|
|
||||||
ipcMain.handle('window-is-maximized', () => {
|
|
||||||
const window = BrowserWindow.getFocusedWindow();
|
|
||||||
return window ? window.isMaximized() : false;
|
|
||||||
});
|
|
||||||
|
|
||||||
ipcMain.handle('open-external', (event, url: string) => {
|
|
||||||
shell.openExternal(url);
|
|
||||||
});
|
|
||||||
|
|
||||||
// This method will be called when Electron has finished
|
// This method will be called when Electron has finished
|
||||||
// initialization and is ready to create browser windows.
|
// initialization and is ready to create browser windows.
|
||||||
// Some APIs can only be used after this event occurs.
|
// Some APIs can only be used after this event occurs.
|
||||||
app.on('ready', () => {
|
app.on('ready', initializeApp);
|
||||||
connectRedis();
|
|
||||||
createWindow();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Quit when all windows are closed, except on macOS. There, it's common
|
// Quit when all windows are closed, except on macOS. There, it's common
|
||||||
// for applications and their menu bar to stay active until the user quits
|
// for applications and their menu bar to stay active until the user quits
|
||||||
|
|
@ -171,15 +40,13 @@ app.on('activate', () => {
|
||||||
// On OS X it's common to re-create a window in the app when the
|
// On OS X it's common to re-create a window in the app when the
|
||||||
// dock icon is clicked and there are no other windows open.
|
// dock icon is clicked and there are no other windows open.
|
||||||
if (BrowserWindow.getAllWindows().length === 0) {
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
createWindow();
|
createMainWindow();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Clean up Redis connection on app quit
|
// Clean up Redis connection on app quit
|
||||||
app.on('before-quit', () => {
|
app.on('before-quit', () => {
|
||||||
if (redisSubscriber) {
|
disconnectRedis();
|
||||||
redisSubscriber.disconnect();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// In this file you can include the rest of your app's specific main process
|
// In this file you can include the rest of your app's specific main process
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,11 @@
|
||||||
import { contextBridge, ipcRenderer } from 'electron';
|
import { contextBridge, ipcRenderer } from 'electron';
|
||||||
|
|
||||||
|
interface RedisData {
|
||||||
|
channel: string;
|
||||||
|
data: unknown;
|
||||||
|
timestamp: number;
|
||||||
|
}
|
||||||
|
|
||||||
// Expose protected methods that allow the renderer process to use
|
// Expose protected methods that allow the renderer process to use
|
||||||
// the ipcRenderer without exposing the entire object
|
// the ipcRenderer without exposing the entire object
|
||||||
contextBridge.exposeInMainWorld('electronAPI', {
|
contextBridge.exposeInMainWorld('electronAPI', {
|
||||||
|
|
@ -10,10 +16,10 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
||||||
isMaximized: () => ipcRenderer.invoke('window-is-maximized'),
|
isMaximized: () => ipcRenderer.invoke('window-is-maximized'),
|
||||||
|
|
||||||
// Window state listeners
|
// Window state listeners
|
||||||
onMaximizeChange: (callback: (event: any, maximized: boolean) => void) => {
|
onMaximizeChange: (callback: (event: unknown, maximized: boolean) => void) => {
|
||||||
ipcRenderer.on('window-maximize-changed', callback);
|
ipcRenderer.on('window-maximize-changed', callback);
|
||||||
},
|
},
|
||||||
removeMaximizeListener: (callback: (event: any, maximized: boolean) => void) => {
|
removeMaximizeListener: (callback: (event: unknown, maximized: boolean) => void) => {
|
||||||
ipcRenderer.removeListener('window-maximize-changed', callback);
|
ipcRenderer.removeListener('window-maximize-changed', callback);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -21,7 +27,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
||||||
openExternal: (url: string) => ipcRenderer.invoke('open-external', url),
|
openExternal: (url: string) => ipcRenderer.invoke('open-external', url),
|
||||||
|
|
||||||
// Redis data subscription
|
// Redis data subscription
|
||||||
onRedisData: (callback: (data: any) => void) => {
|
onRedisData: (callback: (data: RedisData) => void) => {
|
||||||
ipcRenderer.on('redis-data', (_event, data) => callback(data));
|
ipcRenderer.on('redis-data', (_event, data) => callback(data));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
47
electron/tsconfig.json
Normal file
47
electron/tsconfig.json
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
{
|
||||||
|
"extends": "../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"strict": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"outDir": "./dist",
|
||||||
|
"rootDir": ".",
|
||||||
|
"baseUrl": ".",
|
||||||
|
"allowImportingTsExtensions": false,
|
||||||
|
"noEmit": true,
|
||||||
|
"isolatedModules": true,
|
||||||
|
"verbatimModuleSyntax": false,
|
||||||
|
"paths": {
|
||||||
|
"./handlers/*": [
|
||||||
|
"./handlers/*"
|
||||||
|
],
|
||||||
|
"./utils/*": [
|
||||||
|
"./utils/*"
|
||||||
|
],
|
||||||
|
"./*": [
|
||||||
|
"./*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"types": [
|
||||||
|
"node",
|
||||||
|
"electron"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"**/*.ts",
|
||||||
|
"**/*.js"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"node_modules",
|
||||||
|
"dist"
|
||||||
|
],
|
||||||
|
"ts-node": {
|
||||||
|
"esm": true
|
||||||
|
}
|
||||||
|
}
|
||||||
2
electron/utils/index.ts
Normal file
2
electron/utils/index.ts
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
export * from './redis';
|
||||||
|
export * from './window';
|
||||||
100
electron/utils/redis.ts
Normal file
100
electron/utils/redis.ts
Normal file
|
|
@ -0,0 +1,100 @@
|
||||||
|
import type { BrowserWindow } from 'electron';
|
||||||
|
import { Redis } from 'ioredis';
|
||||||
|
import { REDIS_CHANNELS, REDIS_CONFIG, logRedisConfig } from '../config/redis';
|
||||||
|
import { getRedisChannelHandler } from '../handlers/redis-handlers';
|
||||||
|
|
||||||
|
let redisSubscriber: Redis | null = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize Redis connection
|
||||||
|
*/
|
||||||
|
export function connectRedis(): void {
|
||||||
|
try {
|
||||||
|
// Log configuration info
|
||||||
|
logRedisConfig();
|
||||||
|
|
||||||
|
redisSubscriber = new Redis(REDIS_CONFIG);
|
||||||
|
|
||||||
|
redisSubscriber.on('error', (error) => {
|
||||||
|
console.error('[REDIS] Connection error:', error);
|
||||||
|
});
|
||||||
|
|
||||||
|
console.info('[REDIS] Initialized');
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
console.error('[REDIS] Init failed:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set up Redis pub/sub with message handlers
|
||||||
|
*/
|
||||||
|
export function setupRedisPubSub(mainWindow: BrowserWindow): void {
|
||||||
|
if (!redisSubscriber) {
|
||||||
|
console.error('[REDIS] Not initialized');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
redisSubscriber.subscribe(...REDIS_CHANNELS);
|
||||||
|
|
||||||
|
// Handle incoming messages
|
||||||
|
redisSubscriber.on('message', (channel: string, message: string) => {
|
||||||
|
try {
|
||||||
|
const data = JSON.parse(message);
|
||||||
|
const handler = getRedisChannelHandler(channel);
|
||||||
|
|
||||||
|
if (handler) {
|
||||||
|
handler(mainWindow, data);
|
||||||
|
} else {
|
||||||
|
console.warn(`[REDIS] No handler for '${channel}'`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
console.error(`[REDIS] Parse error on '${channel}':`, error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
console.info('[REDIS] PubSub ready');
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
console.error('[REDIS] Setup error:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disconnect Redis
|
||||||
|
*/
|
||||||
|
export function disconnectRedis(): void {
|
||||||
|
if (redisSubscriber) {
|
||||||
|
redisSubscriber.disconnect();
|
||||||
|
redisSubscriber = null;
|
||||||
|
console.info('[REDIS] Disconnected');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Redis connection status
|
||||||
|
*/
|
||||||
|
export function getRedisStatus(): 'connected' | 'disconnected' | 'not_initialized' {
|
||||||
|
if (!redisSubscriber) return 'not_initialized';
|
||||||
|
return redisSubscriber.status === 'ready' ? 'connected' : 'disconnected';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test Redis connection by trying to connect
|
||||||
|
*/
|
||||||
|
export async function testRedisConnection(): Promise<boolean> {
|
||||||
|
if (!redisSubscriber) {
|
||||||
|
console.error('[REDIS] Not initialized');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await redisSubscriber.connect();
|
||||||
|
return true;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('[REDIS] Test failed:', error);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
124
electron/utils/window.ts
Normal file
124
electron/utils/window.ts
Normal file
|
|
@ -0,0 +1,124 @@
|
||||||
|
import { BrowserWindow, shell } from 'electron';
|
||||||
|
import path from 'node:path';
|
||||||
|
import { getRedisStatus, setupRedisPubSub, testRedisConnection } from './redis';
|
||||||
|
/**
|
||||||
|
* Window configuration - centralized values
|
||||||
|
*/
|
||||||
|
const WINDOW_CONFIG = {
|
||||||
|
minHeight: 800,
|
||||||
|
minWidth: 1080,
|
||||||
|
maxHeight: 1080,
|
||||||
|
maxWidth: 1920,
|
||||||
|
height: 1024,
|
||||||
|
width: 1280,
|
||||||
|
titleBarStyle: 'hidden' as const,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: false,
|
||||||
|
contextIsolation: true,
|
||||||
|
preload: path.join(__dirname, 'preload.cjs'),
|
||||||
|
},
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create and configure the main application window
|
||||||
|
*/
|
||||||
|
export function createMainWindow(): BrowserWindow {
|
||||||
|
const mainWindow = new BrowserWindow(WINDOW_CONFIG);
|
||||||
|
|
||||||
|
// Hide menu bar
|
||||||
|
mainWindow.setMenuBarVisibility(false);
|
||||||
|
|
||||||
|
// Set up window event listeners
|
||||||
|
setupWindowEventListeners(mainWindow);
|
||||||
|
|
||||||
|
// Set up external link handling
|
||||||
|
setupExternalLinkHandling(mainWindow);
|
||||||
|
|
||||||
|
// Load the appropriate content
|
||||||
|
loadWindowContent(mainWindow);
|
||||||
|
|
||||||
|
// Set up Redis pub/sub when window is ready
|
||||||
|
mainWindow.webContents.once('dom-ready', async () => {
|
||||||
|
console.info('[WINDOW] DOM ready, setting up Redis pub/sub...');
|
||||||
|
|
||||||
|
// Check Redis status
|
||||||
|
const status = getRedisStatus();
|
||||||
|
console.info('[WINDOW] Redis status:', status);
|
||||||
|
|
||||||
|
// Test connection if needed
|
||||||
|
if (status !== 'connected') {
|
||||||
|
console.info('[WINDOW] Testing Redis connection...');
|
||||||
|
const connected = await testRedisConnection();
|
||||||
|
console.info('[WINDOW] Redis connection test result:', connected);
|
||||||
|
}
|
||||||
|
|
||||||
|
setupRedisPubSub(mainWindow);
|
||||||
|
console.info('[WINDOW] Redis pub/sub setup completed');
|
||||||
|
});
|
||||||
|
|
||||||
|
return mainWindow;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set up window event listeners for maximize/unmaximize
|
||||||
|
*/
|
||||||
|
function setupWindowEventListeners(mainWindow: BrowserWindow): void {
|
||||||
|
mainWindow.on('maximize', () => {
|
||||||
|
mainWindow.webContents.send('window-maximize-changed', true);
|
||||||
|
});
|
||||||
|
|
||||||
|
mainWindow.on('unmaximize', () => {
|
||||||
|
mainWindow.webContents.send('window-maximize-changed', false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set up external link handling to open in default browser
|
||||||
|
*/
|
||||||
|
function setupExternalLinkHandling(mainWindow: BrowserWindow): void {
|
||||||
|
mainWindow.webContents.on('will-navigate', (event, reqUrl) => {
|
||||||
|
const requestedHost = new URL(reqUrl).host;
|
||||||
|
const currentHost = new URL(mainWindow.webContents.getURL()).host;
|
||||||
|
|
||||||
|
if (requestedHost && requestedHost !== currentHost) {
|
||||||
|
event.preventDefault();
|
||||||
|
shell.openExternal(reqUrl);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load window content based on environment
|
||||||
|
*/
|
||||||
|
function loadWindowContent(mainWindow: BrowserWindow): void {
|
||||||
|
const isDev = process.env.NODE_ENV === 'development';
|
||||||
|
|
||||||
|
if (isDev) {
|
||||||
|
mainWindow.setIcon(path.resolve(__dirname, '../../public/favicon.ico'));
|
||||||
|
// Try different ports to find the Nuxt dev server
|
||||||
|
const possiblePorts = [3000, 3001, 3002];
|
||||||
|
tryLoadDevServer(mainWindow, possiblePorts);
|
||||||
|
mainWindow.webContents.openDevTools();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
mainWindow.loadFile(path.join(__dirname, '../renderer/index.html'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Try to load the dev server from different ports
|
||||||
|
*/
|
||||||
|
function tryLoadDevServer(mainWindow: BrowserWindow, ports: number[], index = 0): void {
|
||||||
|
if (index >= ports.length) {
|
||||||
|
console.error('Could not find Nuxt dev server on any port');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const port = ports[index];
|
||||||
|
const url = `http://localhost:${port}`;
|
||||||
|
|
||||||
|
mainWindow.loadURL(url).catch(() => {
|
||||||
|
// If this port fails, try the next one
|
||||||
|
setTimeout(() => tryLoadDevServer(mainWindow, ports, index + 1), 100);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
// @ts-check
|
// @ts-check
|
||||||
|
import stylistic from '@stylistic/eslint-plugin';
|
||||||
import withNuxt from './.nuxt/eslint.config.mjs';
|
import withNuxt from './.nuxt/eslint.config.mjs';
|
||||||
|
|
||||||
export default withNuxt({
|
export default withNuxt(
|
||||||
|
// Disable legacy stylistic rules
|
||||||
|
stylistic.configs['disable-legacy'],
|
||||||
|
{
|
||||||
files: ['**/*.vue', '**/*.js', '**/*.ts', '**/*.mjs'],
|
files: ['**/*.vue', '**/*.js', '**/*.ts', '**/*.mjs'],
|
||||||
ignores: [
|
ignores: [
|
||||||
'node_modules/**',
|
'node_modules/**',
|
||||||
|
|
@ -11,40 +15,32 @@ export default withNuxt({
|
||||||
'.vite/**',
|
'.vite/**',
|
||||||
'.*/**',
|
'.*/**',
|
||||||
],
|
],
|
||||||
|
plugins: {
|
||||||
|
'@stylistic': stylistic,
|
||||||
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
// Semicolon rules - require semicolons (Rust-style)
|
||||||
|
'@stylistic/semi': ['error', 'always'],
|
||||||
|
|
||||||
|
// Interface and type rules - require semicolons in interfaces
|
||||||
|
'@stylistic/member-delimiter-style': ['error', {
|
||||||
|
multiline: { delimiter: 'semi', requireLast: true },
|
||||||
|
singleline: { delimiter: 'semi', requireLast: false },
|
||||||
|
}],
|
||||||
|
|
||||||
// Code quality rules
|
// Code quality rules
|
||||||
'camelcase': ['error', { properties: 'never', ignoreDestructuring: true }],
|
'camelcase': ['error', { properties: 'never', ignoreDestructuring: true }],
|
||||||
'no-console': ['error', { allow: ['info', 'warn', 'error'] }],
|
'no-console': ['error', { allow: ['info', 'warn', 'error'] }],
|
||||||
'sort-imports': ['error', { ignoreDeclarationSort: true }],
|
'sort-imports': ['error', { ignoreDeclarationSort: true }],
|
||||||
|
|
||||||
// Stylistic rules (using @stylistic)
|
|
||||||
'@stylistic/indent': ['error', 2, { SwitchCase: 1 }],
|
|
||||||
'@stylistic/linebreak-style': 'off',
|
|
||||||
'@stylistic/quotes': ['error', 'single'],
|
|
||||||
'@stylistic/semi': ['error', 'always'],
|
|
||||||
'@stylistic/no-extra-semi': 'error',
|
|
||||||
'@stylistic/comma-dangle': ['error', 'always-multiline'],
|
|
||||||
'@stylistic/space-before-function-paren': ['error', {
|
|
||||||
anonymous: 'always',
|
|
||||||
named: 'never',
|
|
||||||
asyncArrow: 'always',
|
|
||||||
}],
|
|
||||||
'@stylistic/multiline-ternary': ['error', 'never'],
|
|
||||||
'@stylistic/member-delimiter-style': ['error', {
|
|
||||||
multiline: { delimiter: 'semi' },
|
|
||||||
singleline: { delimiter: 'comma' },
|
|
||||||
}],
|
|
||||||
'@stylistic/arrow-spacing': ['error', { before: true, after: true }],
|
|
||||||
'@stylistic/brace-style': ['error', 'stroustrup', { allowSingleLine: true }],
|
|
||||||
'@stylistic/no-multi-spaces': 'error',
|
|
||||||
'@stylistic/space-before-blocks': 'error',
|
|
||||||
'@stylistic/no-trailing-spaces': 'error',
|
|
||||||
|
|
||||||
// Nuxt specific rules
|
// Nuxt specific rules
|
||||||
'nuxt/prefer-import-meta': 'error',
|
'nuxt/prefer-import-meta': 'error',
|
||||||
|
|
||||||
// Vue specific rules
|
// Vue specific rules
|
||||||
'vue/first-attribute-linebreak': ['error', { singleline: 'ignore', multiline: 'ignore' }],
|
'vue/first-attribute-linebreak': ['error', { singleline: 'ignore', multiline: 'ignore' }],
|
||||||
|
'vue/no-unused-vars': ['error', {
|
||||||
|
ignorePattern: '^_',
|
||||||
|
}],
|
||||||
'vue/max-attributes-per-line': ['error', { singleline: 100 }],
|
'vue/max-attributes-per-line': ['error', { singleline: 100 }],
|
||||||
'vue/singleline-html-element-content-newline': ['off'],
|
'vue/singleline-html-element-content-newline': ['off'],
|
||||||
'vue/no-multiple-template-root': ['off'],
|
'vue/no-multiple-template-root': ['off'],
|
||||||
|
|
@ -52,4 +48,5 @@ export default withNuxt({
|
||||||
'vue/html-indent': ['error', 2],
|
'vue/html-indent': ['error', 2],
|
||||||
'vue/multiline-html-element-content-newline': ['error', { ignores: [] }],
|
'vue/multiline-html-element-content-newline': ['error', { ignores: [] }],
|
||||||
},
|
},
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
|
||||||
11
package.json
11
package.json
|
|
@ -10,8 +10,11 @@
|
||||||
"dev": "concurrently \"pnpm run dev:nuxt\" \"pnpm run dev:electron\"",
|
"dev": "concurrently \"pnpm run dev:nuxt\" \"pnpm run dev:electron\"",
|
||||||
"dev:nuxt": "nuxt dev --config-file .config/nuxt.ts",
|
"dev:nuxt": "nuxt dev --config-file .config/nuxt.ts",
|
||||||
"dev:electron": "cross-env NODE_ENV=development electron-forge start",
|
"dev:electron": "cross-env NODE_ENV=development electron-forge start",
|
||||||
"build": "nuxt generate --config-file .config/nuxt.ts && electron-forge make",
|
"build": "cross-env NODE_ENV=production nuxt generate --config-file .config/nuxt.ts && cross-env NODE_ENV=production electron-forge make",
|
||||||
"package": "electron-forge package",
|
"build:dev": "cross-env NODE_ENV=development nuxt generate --config-file .config/nuxt.ts && cross-env NODE_ENV=development electron-forge make",
|
||||||
|
"build:prod": "cross-env NODE_ENV=production nuxt generate --config-file .config/nuxt.ts && cross-env NODE_ENV=production electron-forge make",
|
||||||
|
"package": "cross-env NODE_ENV=production electron-forge package",
|
||||||
|
"package:dev": "cross-env NODE_ENV=development electron-forge package",
|
||||||
"make": "electron-forge make",
|
"make": "electron-forge make",
|
||||||
"publish": "electron-forge publish",
|
"publish": "electron-forge publish",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
|
|
@ -39,6 +42,7 @@
|
||||||
"@electron/fuses": "^1.8.0",
|
"@electron/fuses": "^1.8.0",
|
||||||
"@nuxt/eslint": "^1.4.1",
|
"@nuxt/eslint": "^1.4.1",
|
||||||
"@pinia/nuxt": "^0.11.1",
|
"@pinia/nuxt": "^0.11.1",
|
||||||
|
"@stylistic/eslint-plugin": "^4.4.1",
|
||||||
"@tailwindcss/cli": "^4.1.10",
|
"@tailwindcss/cli": "^4.1.10",
|
||||||
"@tailwindcss/postcss": "^4.1.10",
|
"@tailwindcss/postcss": "^4.1.10",
|
||||||
"@tailwindcss/vite": "^4.1.10",
|
"@tailwindcss/vite": "^4.1.10",
|
||||||
|
|
@ -65,10 +69,13 @@
|
||||||
"vite": "^6.3.5",
|
"vite": "^6.3.5",
|
||||||
"vite-plugin-electron": "^0.29.0",
|
"vite-plugin-electron": "^0.29.0",
|
||||||
"vite-plugin-electron-renderer": "^0.14.6",
|
"vite-plugin-electron-renderer": "^0.14.6",
|
||||||
|
"vite-plugin-eslint2": "^5.0.3",
|
||||||
"vitest": "^3.2.4",
|
"vitest": "^3.2.4",
|
||||||
"vue-tsc": "^2.2.10"
|
"vue-tsc": "^2.2.10"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@nuxt/icon": "^1.14.0",
|
||||||
|
"@solana/kit": "^2.1.1",
|
||||||
"electron-squirrel-startup": "^1.0.1",
|
"electron-squirrel-startup": "^1.0.1",
|
||||||
"ioredis": "^5.6.1"
|
"ioredis": "^5.6.1"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
715
pnpm-lock.yaml
generated
715
pnpm-lock.yaml
generated
|
|
@ -8,6 +8,12 @@ importers:
|
||||||
|
|
||||||
.:
|
.:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
'@nuxt/icon':
|
||||||
|
specifier: ^1.14.0
|
||||||
|
version: 1.14.0(magicast@0.3.5)(vite@6.3.5(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0))(vue@3.5.17(typescript@5.8.3))
|
||||||
|
'@solana/kit':
|
||||||
|
specifier: ^2.1.1
|
||||||
|
version: 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)(ws@8.18.2)
|
||||||
electron-squirrel-startup:
|
electron-squirrel-startup:
|
||||||
specifier: ^1.0.1
|
specifier: ^1.0.1
|
||||||
version: 1.0.1
|
version: 1.0.1
|
||||||
|
|
@ -50,10 +56,13 @@ importers:
|
||||||
version: 1.8.0
|
version: 1.8.0
|
||||||
'@nuxt/eslint':
|
'@nuxt/eslint':
|
||||||
specifier: ^1.4.1
|
specifier: ^1.4.1
|
||||||
version: 1.4.1(@typescript-eslint/utils@8.34.1(eslint@9.29.0(jiti@2.4.2))(typescript@5.8.3))(@vue/compiler-sfc@3.5.17)(eslint-import-resolver-node@0.3.9)(eslint@9.29.0(jiti@2.4.2))(magicast@0.3.5)(typescript@5.8.3)(vite@6.3.5(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0))
|
version: 1.4.1(@typescript-eslint/utils@8.34.1(eslint@9.29.0(jiti@2.4.2))(typescript@5.8.3))(@vue/compiler-sfc@3.5.17)(eslint-import-resolver-node@0.3.9)(eslint@9.29.0(jiti@2.4.2))(magicast@0.3.5)(typescript@5.8.3)(vite-plugin-eslint2@5.0.3(eslint@9.29.0(jiti@2.4.2))(rollup@4.44.0)(vite@6.3.5(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0)))(vite@6.3.5(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0))
|
||||||
'@pinia/nuxt':
|
'@pinia/nuxt':
|
||||||
specifier: ^0.11.1
|
specifier: ^0.11.1
|
||||||
version: 0.11.1(magicast@0.3.5)(pinia@3.0.3(typescript@5.8.3)(vue@3.5.17(typescript@5.8.3)))
|
version: 0.11.1(magicast@0.3.5)(pinia@3.0.3(typescript@5.8.3)(vue@3.5.17(typescript@5.8.3)))
|
||||||
|
'@stylistic/eslint-plugin':
|
||||||
|
specifier: ^4.4.1
|
||||||
|
version: 4.4.1(eslint@9.29.0(jiti@2.4.2))(typescript@5.8.3)
|
||||||
'@tailwindcss/cli':
|
'@tailwindcss/cli':
|
||||||
specifier: ^4.1.10
|
specifier: ^4.1.10
|
||||||
version: 4.1.10
|
version: 4.1.10
|
||||||
|
|
@ -132,6 +141,9 @@ importers:
|
||||||
vite-plugin-electron-renderer:
|
vite-plugin-electron-renderer:
|
||||||
specifier: ^0.14.6
|
specifier: ^0.14.6
|
||||||
version: 0.14.6
|
version: 0.14.6
|
||||||
|
vite-plugin-eslint2:
|
||||||
|
specifier: ^5.0.3
|
||||||
|
version: 5.0.3(eslint@9.29.0(jiti@2.4.2))(rollup@4.44.0)(vite@6.3.5(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0))
|
||||||
vitest:
|
vitest:
|
||||||
specifier: ^3.2.4
|
specifier: ^3.2.4
|
||||||
version: 3.2.4(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0)
|
version: 3.2.4(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0)
|
||||||
|
|
@ -152,6 +164,9 @@ packages:
|
||||||
'@antfu/install-pkg@1.1.0':
|
'@antfu/install-pkg@1.1.0':
|
||||||
resolution: {integrity: sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ==}
|
resolution: {integrity: sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ==}
|
||||||
|
|
||||||
|
'@antfu/utils@8.1.1':
|
||||||
|
resolution: {integrity: sha512-Mex9nXf9vR6AhcXmMrlz/HVgYYZpVGJ6YlPgwl7UnaFpnshXs6EK/oa5Gpf3CzENMjkvEx2tQtntGnb7UtSTOQ==}
|
||||||
|
|
||||||
'@apidevtools/json-schema-ref-parser@11.9.3':
|
'@apidevtools/json-schema-ref-parser@11.9.3':
|
||||||
resolution: {integrity: sha512-60vepv88RwcJtSHrD6MjIL6Ta3SOYbgfnkHb+ppAVK+o9mXprRtulx7VlRl3lN3bbvysAfCS7WMVfhUYemB0IQ==}
|
resolution: {integrity: sha512-60vepv88RwcJtSHrD6MjIL6Ta3SOYbgfnkHb+ppAVK+o9mXprRtulx7VlRl3lN3bbvysAfCS7WMVfhUYemB0IQ==}
|
||||||
engines: {node: '>= 16'}
|
engines: {node: '>= 16'}
|
||||||
|
|
@ -720,6 +735,20 @@ packages:
|
||||||
resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==}
|
resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==}
|
||||||
engines: {node: '>=18.18'}
|
engines: {node: '>=18.18'}
|
||||||
|
|
||||||
|
'@iconify/collections@1.0.561':
|
||||||
|
resolution: {integrity: sha512-Bn3YLaXwNwVpVUk6YfxOc1I69r7pAV7GsDtkknXAa0Fk4vlh3YxwQU5J8N8h++tRmw702IVjQm6csyAyFZuADQ==}
|
||||||
|
|
||||||
|
'@iconify/types@2.0.0':
|
||||||
|
resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==}
|
||||||
|
|
||||||
|
'@iconify/utils@2.3.0':
|
||||||
|
resolution: {integrity: sha512-GmQ78prtwYW6EtzXRU1rY+KwOKfz32PD7iJh6Iyqw68GiKuoZ2A6pRtzWONz5VQJbp50mEjXh/7NkumtrAgRKA==}
|
||||||
|
|
||||||
|
'@iconify/vue@5.0.0':
|
||||||
|
resolution: {integrity: sha512-C+KuEWIF5nSBrobFJhT//JS87OZ++QDORB6f2q2Wm6fl2mueSTpFBeBsveK0KW9hWiZ4mNiPjsh6Zs4jjdROSg==}
|
||||||
|
peerDependencies:
|
||||||
|
vue: '>=3'
|
||||||
|
|
||||||
'@ioredis/commands@1.2.0':
|
'@ioredis/commands@1.2.0':
|
||||||
resolution: {integrity: sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==}
|
resolution: {integrity: sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==}
|
||||||
|
|
||||||
|
|
@ -909,6 +938,9 @@ packages:
|
||||||
vite-plugin-eslint2:
|
vite-plugin-eslint2:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
|
'@nuxt/icon@1.14.0':
|
||||||
|
resolution: {integrity: sha512-4kb2rbvbSll784LUme2fDm62NW0Tryr8wADFEU3vIoOj4TZywcwPafIl0MT6ah3RNgbPd174EFVOaUdPSUQENA==}
|
||||||
|
|
||||||
'@nuxt/kit@3.17.5':
|
'@nuxt/kit@3.17.5':
|
||||||
resolution: {integrity: sha512-NdCepmA+S/SzgcaL3oYUeSlXGYO6BXGr9K/m1D0t0O9rApF8CSq/QQ+ja5KYaYMO1kZAEWH4s2XVcE3uPrrAVg==}
|
resolution: {integrity: sha512-NdCepmA+S/SzgcaL3oYUeSlXGYO6BXGr9K/m1D0t0O9rApF8CSq/QQ+ja5KYaYMO1kZAEWH4s2XVcE3uPrrAVg==}
|
||||||
engines: {node: '>=18.12.0'}
|
engines: {node: '>=18.12.0'}
|
||||||
|
|
@ -1370,6 +1402,225 @@ packages:
|
||||||
resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==}
|
resolution: {integrity: sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
|
'@solana/accounts@2.1.1':
|
||||||
|
resolution: {integrity: sha512-Q9mG0o/6oyiUSw1CXCkG50TWlYiODJr3ZilEDLIyXpYJzOstRZM4XOzbRACveX4PXFoufPzpR1sSVK6qfcUUCw==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/addresses@2.1.1':
|
||||||
|
resolution: {integrity: sha512-yX6+brBXFmirxXDJCBDNKDYbGZHMZHaZS4NJWZs31DTe5To3Ky3Y9g3wFEGAX242kfNyJcgg5OeoBuZ7vdFycQ==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/assertions@2.1.1':
|
||||||
|
resolution: {integrity: sha512-ln6dXkliyb9ybqLGFf5Gn+LJaPZGmer9KloIFfHiiSfYFdoAqOu6+pVY+323SKWXHG+hHl9VkwuZYpSp02OroA==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/codecs-core@2.1.1':
|
||||||
|
resolution: {integrity: sha512-iPQW3UZ2Vi7QFBo2r9tw0NubtH8EdrhhmZulx6lC8V5a+qjaxovtM/q/UW2BTNpqqHLfO0tIcLyBLrNH4HTWPg==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/codecs-data-structures@2.1.1':
|
||||||
|
resolution: {integrity: sha512-OcR7FIhWDFqg6gEslbs2GVKeDstGcSDpkZo9SeV4bm2RLd1EZfxGhWW+yHZfHqOZiIkw9w+aY45bFgKrsLQmFw==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/codecs-numbers@2.1.1':
|
||||||
|
resolution: {integrity: sha512-m20IUPJhPUmPkHSlZ2iMAjJ7PaYUvlMtFhCQYzm9BEBSI6OCvXTG3GAPpAnSGRBfg5y+QNqqmKn4QHU3B6zzCQ==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/codecs-strings@2.1.1':
|
||||||
|
resolution: {integrity: sha512-uhj+A7eT6IJn4nuoX8jDdvZa7pjyZyN+k64EZ8+aUtJGt5Ft4NjRM8Jl5LljwYBWKQCgouVuigZHtTO2yAWExA==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
fastestsmallesttextencoderdecoder: ^1.0.22
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/codecs@2.1.1':
|
||||||
|
resolution: {integrity: sha512-89Fv22fZ5dNiXjOKh6I3U1D/lVO/dF/cPHexdiqjS5k5R5uKeK3506rhcnc4ciawQAoOkDwHzW+HitUumF2PJg==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/errors@2.1.1':
|
||||||
|
resolution: {integrity: sha512-sj6DaWNbSJFvLzT8UZoabMefQUfSW/8tXK7NTiagsDmh+Q87eyQDDC9L3z+mNmx9b6dEf6z660MOIplDD2nfEw==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
hasBin: true
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/fast-stable-stringify@2.1.1':
|
||||||
|
resolution: {integrity: sha512-+gyW8plyMOURMuO9iL6eQBb5wCRwMGLO5T6jBIDGws8KR4tOtIBlQnQnzk81nNepE6lbf8tLCxS8KdYgT/P+wQ==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/functional@2.1.1':
|
||||||
|
resolution: {integrity: sha512-HePJ49Cyz4Mb26zm5holPikm8bzsBH5zLR41+gIw9jJBmIteILNnk2OO1dVkb6aJnP42mdhWSXCo3VVEGT6aEw==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/instructions@2.1.1':
|
||||||
|
resolution: {integrity: sha512-Zx48hav9Lu+JuC+U0QJ8B7g7bXQZElXCjvxosIibU2C7ygDuq0ffOly0/irWJv2xmHYm6z8Hm1ILbZ5w0GhDQQ==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/keys@2.1.1':
|
||||||
|
resolution: {integrity: sha512-SXuhUz1c2mVnPnB+9Z9Yw6HPluIZbMlSByr+vPFLgaPYM356bRcNnu1pa28tONiQzRBFvl9qL08SL0OaYsmqPg==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/kit@2.1.1':
|
||||||
|
resolution: {integrity: sha512-vV0otDSO9HFWIkAv7lxfeR7W6ruS/kqFYzTeRI+EuaZCgKdueavZnx9ydbpMCXis3BZ4Ao+k/ebzVWXMVvz+Lw==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/nominal-types@2.1.1':
|
||||||
|
resolution: {integrity: sha512-EpdDhuoATsm9bmuduv6yoNm1EKCz2tlq13nAazaVyQvkMBHhVelyT/zq0ruUplQZbl7qyYr5hG7p1SfGgQbgSQ==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/options@2.1.1':
|
||||||
|
resolution: {integrity: sha512-rnEExUGVOAV79kiFUEl/51gmSbBYxlcuw2VPnbAV/q53mIHoTgCwDD576N9A8wFftxaJHQFBdNuKiRrnU/fFHA==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/programs@2.1.1':
|
||||||
|
resolution: {integrity: sha512-fVOA4SEijrIrpG7GoBWhid43w3pT7RTfmMYciVKMb17s2GcnLLcTDOahPf0mlIctLtbF8PgImtzUkXQyuFGr8Q==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/promises@2.1.1':
|
||||||
|
resolution: {integrity: sha512-8M+QBgJAQD0nhHzaezwwHH4WWfJEBPiiPAjMNBbbbTHA8+oYFIGgY1HwDUePK8nrT1Q1dX3gC+epBCqBi/nnGg==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/rpc-api@2.1.1':
|
||||||
|
resolution: {integrity: sha512-MTBuoRA9HtxW+CRpj1Ls5XVhDe00g8mW2Ib4/0k6ThFS0+cmjf+O78d8hgjQMqTtuzzSLZ4355+C7XEAuzSQ4g==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/rpc-parsed-types@2.1.1':
|
||||||
|
resolution: {integrity: sha512-+n1IWYYglevvNE1neMiLOH6W67EzmWj8GaRlwGxcyu6MwSc/8x1bd2hnEkgK6md+ObPOxoOBdxQXIY/xnZgLcw==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/rpc-spec-types@2.1.1':
|
||||||
|
resolution: {integrity: sha512-3/G/MTi/c70TVZcB0DJjh5AGV7xqOYrjrpnIg+rLZuH65qHMimWiTHj0k8lxTzRMrN06Ed0+Q7SCw9hO/grTHA==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/rpc-spec@2.1.1':
|
||||||
|
resolution: {integrity: sha512-3Hd21XpaKtW3tG0oXAUlc1k0hX7/eqHpf8Gg744sr9G3ib5gT7EopcZRsH5LdESgS0nbv/c75TznCXjaUyRi+g==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/rpc-subscriptions-api@2.1.1':
|
||||||
|
resolution: {integrity: sha512-b4JuVScYGaEgO3jszYf7LqXdJK4GoUIevXcyQWq4Zk+R7P41VxGQWa2kzdPX9LIi+UGBmCThdRBfgOYyyHRKDg==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/rpc-subscriptions-channel-websocket@2.1.1':
|
||||||
|
resolution: {integrity: sha512-xEDnMXnwMtKDEpzmIXTkxxvLqGsxqlKILmyfGsQOMJ9RHYkHmz/8MarHcjnYhyZ5lrs2irN/wExUNlSZTegSEw==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
ws: ^8.18.0
|
||||||
|
|
||||||
|
'@solana/rpc-subscriptions-spec@2.1.1':
|
||||||
|
resolution: {integrity: sha512-ANT5Tub/ZqqewRtklz02km8iCUe0qwBGi3wsKTgiX7kRx3izHn6IHl90w1Y19wPd692mfZW8+Pk5PUrMSXhR3g==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/rpc-subscriptions@2.1.1':
|
||||||
|
resolution: {integrity: sha512-xGLIuJHxg0oCNiS40NW/5BPxHM5RurLcEmBAN1VmVtINWTm8wSbEo85a5q7cbMlPP4Vu/28lD7IITjS5qb84UQ==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/rpc-transformers@2.1.1':
|
||||||
|
resolution: {integrity: sha512-rBOCDQjOI1eQICkqYFV43SsiPdLcahgnrGuDNorS3uOe70pQRPs1PTuuEHqLBwuu9GRw89ifRy49aBNUNmX8uQ==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/rpc-transport-http@2.1.1':
|
||||||
|
resolution: {integrity: sha512-Wp7018VaPqhodQjQTDlCM7vTYlm3AdmRyvPZiwv5uzFgnC8B0xhEZW+ZSt1zkSXS6WrKqtufobuBFGtfG6v5KQ==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/rpc-types@2.1.1':
|
||||||
|
resolution: {integrity: sha512-IaQKiWyTVvDoD0/3IlUxRY3OADj3cEjfLFCp1JvEdl0ANGReHp4jtqUqrYEeAdN/tGmGoiHt3n4x61wR0zFoJA==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/rpc@2.1.1':
|
||||||
|
resolution: {integrity: sha512-X15xAx8U0ATznkoNGPUkGIuxTIOmdew1pjQRHAtPSKQTiPbAnO1sowpt4UT7V7bB6zKPu+xKvhFizUuon0PZxg==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/signers@2.1.1':
|
||||||
|
resolution: {integrity: sha512-OfYEUgrJSrBDTC43kSQCz9A12A9+6xt2azmG8pP78yXN/bDzDmYF2i4nSzg/JzjjA5hBBYtDJ+15qpS/4cSgug==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/subscribable@2.1.1':
|
||||||
|
resolution: {integrity: sha512-k6qe/Iu94nVtapap9Ei+3mm14gx1H+7YgB6n2bj9qJCdVN6z6ZN9nPtDY2ViIH4qAnxyh7pJKF7iCwNC/iALcw==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/sysvars@2.1.1':
|
||||||
|
resolution: {integrity: sha512-bG7hNFpFqZm6qk763z5/P9g9Nxc0WXe+aYl6CQSptaPsmqUz1GhlBjAov9ePVFb29MmyMZ5bA+kmCTytiHK1fQ==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/transaction-confirmation@2.1.1':
|
||||||
|
resolution: {integrity: sha512-hXv0D80u1jNEq2/k1o9IBXXq7+JYg8x4tm0kVWjzvdJjYow8EkQay5quq5o0ciFfWqlOyFwYRC7AGrKc3imE7A==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/transaction-messages@2.1.1':
|
||||||
|
resolution: {integrity: sha512-sDf3OWV5X1C8huqsap+DyHIBAUenNJd3h7j/WI9MeIJZdGEtqxssGa2ixhecsMaevtUBKKJM9RqAvfTdRTAnLw==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
|
'@solana/transactions@2.1.1':
|
||||||
|
resolution: {integrity: sha512-LX/7XfcHH9o0Kpv+tpnCl56IaatD/0sMWw9NnaeZ2f7pJyav9Jmeu5LJXvdHJw2jh277UEqc9bHwKruoMrtOTw==}
|
||||||
|
engines: {node: '>=20.18.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=5.3.3'
|
||||||
|
|
||||||
'@speed-highlight/core@1.2.7':
|
'@speed-highlight/core@1.2.7':
|
||||||
resolution: {integrity: sha512-0dxmVj4gxg3Jg879kvFS/msl4s9F3T9UXC1InxgOf7t5NvcPD97u/WTA5vL/IxWHMn7qSxBozqrnnE2wvl1m8g==}
|
resolution: {integrity: sha512-0dxmVj4gxg3Jg879kvFS/msl4s9F3T9UXC1InxgOf7t5NvcPD97u/WTA5vL/IxWHMn7qSxBozqrnnE2wvl1m8g==}
|
||||||
|
|
||||||
|
|
@ -2244,6 +2495,10 @@ packages:
|
||||||
resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
|
resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
|
|
||||||
|
chalk@5.4.1:
|
||||||
|
resolution: {integrity: sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==}
|
||||||
|
engines: {node: ^12.17.0 || ^14.13 || >=16.0.0}
|
||||||
|
|
||||||
changelogen@0.6.1:
|
changelogen@0.6.1:
|
||||||
resolution: {integrity: sha512-rTw2bZgiEHMgyYzWFMH+qTMFOSpCf4qwmd8LyxLDUKCtL4T/7O7978tPPtKYpjiFbPoHG64y4ugdF0Mt/l+lQg==}
|
resolution: {integrity: sha512-rTw2bZgiEHMgyYzWFMH+qTMFOSpCf4qwmd8LyxLDUKCtL4T/7O7978tPPtKYpjiFbPoHG64y4ugdF0Mt/l+lQg==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
@ -2364,6 +2619,10 @@ packages:
|
||||||
resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==}
|
resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
|
commander@13.1.0:
|
||||||
|
resolution: {integrity: sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
commander@2.20.3:
|
commander@2.20.3:
|
||||||
resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
|
resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==}
|
||||||
|
|
||||||
|
|
@ -3226,6 +3485,9 @@ packages:
|
||||||
resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==}
|
resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==}
|
||||||
engines: {node: '>= 4.9.1'}
|
engines: {node: '>= 4.9.1'}
|
||||||
|
|
||||||
|
fastestsmallesttextencoderdecoder@1.0.22:
|
||||||
|
resolution: {integrity: sha512-Pb8d48e+oIuY4MaM64Cd7OW1gt4nxCHs7/ddPPZ/Ic3sg8yVGM7O9wDvZ7us6ScaUupzM+pfBolwtYhN1IxBIw==}
|
||||||
|
|
||||||
fastq@1.19.1:
|
fastq@1.19.1:
|
||||||
resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==}
|
resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==}
|
||||||
|
|
||||||
|
|
@ -3517,6 +3779,10 @@ packages:
|
||||||
resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==}
|
resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
|
globals@15.15.0:
|
||||||
|
resolution: {integrity: sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
globals@16.2.0:
|
globals@16.2.0:
|
||||||
resolution: {integrity: sha512-O+7l9tPdHCU320IigZZPj5zmRCFG9xHmx9cU8FqU2Rp+JN714seHV+2S9+JslCpY4gJwU2vOGox0wzgae/MCEg==}
|
resolution: {integrity: sha512-O+7l9tPdHCU320IigZZPj5zmRCFG9xHmx9cU8FqU2Rp+JN714seHV+2S9+JslCpY4gJwU2vOGox0wzgae/MCEg==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
|
|
@ -4097,6 +4363,9 @@ packages:
|
||||||
known-css-properties@0.37.0:
|
known-css-properties@0.37.0:
|
||||||
resolution: {integrity: sha512-JCDrsP4Z1Sb9JwG0aJ8Eo2r7k4Ou5MwmThS/6lcIe1ICyb7UBJKGRIUUdqc2ASdE/42lgz6zFUnzAIhtXnBVrQ==}
|
resolution: {integrity: sha512-JCDrsP4Z1Sb9JwG0aJ8Eo2r7k4Ou5MwmThS/6lcIe1ICyb7UBJKGRIUUdqc2ASdE/42lgz6zFUnzAIhtXnBVrQ==}
|
||||||
|
|
||||||
|
kolorist@1.8.0:
|
||||||
|
resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==}
|
||||||
|
|
||||||
kuler@2.0.0:
|
kuler@2.0.0:
|
||||||
resolution: {integrity: sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==}
|
resolution: {integrity: sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==}
|
||||||
|
|
||||||
|
|
@ -6065,6 +6334,9 @@ packages:
|
||||||
undici-types@6.21.0:
|
undici-types@6.21.0:
|
||||||
resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
|
resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==}
|
||||||
|
|
||||||
|
undici-types@7.10.0:
|
||||||
|
resolution: {integrity: sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==}
|
||||||
|
|
||||||
undici-types@7.8.0:
|
undici-types@7.8.0:
|
||||||
resolution: {integrity: sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==}
|
resolution: {integrity: sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==}
|
||||||
|
|
||||||
|
|
@ -6313,6 +6585,20 @@ packages:
|
||||||
vite-plugin-electron-renderer:
|
vite-plugin-electron-renderer:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
|
vite-plugin-eslint2@5.0.3:
|
||||||
|
resolution: {integrity: sha512-kbjjbSyxSYK1oK0kOnSVs2er8DhqNbVA5pNN21SJo8AldQIOgG4LVQvwp6ISYMDXQaaBMOCrmXFTfGkQUjIZ1g==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
peerDependencies:
|
||||||
|
'@types/eslint': ^7.0.0 || ^8.0.0 || ^9.0.0
|
||||||
|
eslint: ^7.0.0 || ^8.0.0 || ^9.0.0
|
||||||
|
rollup: ^2.0.0 || ^3.0.0 || ^4.0.0
|
||||||
|
vite: ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0
|
||||||
|
peerDependenciesMeta:
|
||||||
|
'@types/eslint':
|
||||||
|
optional: true
|
||||||
|
rollup:
|
||||||
|
optional: true
|
||||||
|
|
||||||
vite-plugin-inspect@11.2.0:
|
vite-plugin-inspect@11.2.0:
|
||||||
resolution: {integrity: sha512-hcCncl4YK20gcrx22cPF5mR+zfxsCmX6vUQKCyudgOZMYKVVGbrxVaL3zU62W0MVSVawtf5ZR4DrLRO+9fZVWQ==}
|
resolution: {integrity: sha512-hcCncl4YK20gcrx22cPF5mR+zfxsCmX6vUQKCyudgOZMYKVVGbrxVaL3zU62W0MVSVawtf5ZR4DrLRO+9fZVWQ==}
|
||||||
engines: {node: '>=14'}
|
engines: {node: '>=14'}
|
||||||
|
|
@ -6644,6 +6930,8 @@ snapshots:
|
||||||
package-manager-detector: 1.3.0
|
package-manager-detector: 1.3.0
|
||||||
tinyexec: 1.0.1
|
tinyexec: 1.0.1
|
||||||
|
|
||||||
|
'@antfu/utils@8.1.1': {}
|
||||||
|
|
||||||
'@apidevtools/json-schema-ref-parser@11.9.3':
|
'@apidevtools/json-schema-ref-parser@11.9.3':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@jsdevtools/ono': 7.1.3
|
'@jsdevtools/ono': 7.1.3
|
||||||
|
|
@ -7481,6 +7769,30 @@ snapshots:
|
||||||
|
|
||||||
'@humanwhocodes/retry@0.4.3': {}
|
'@humanwhocodes/retry@0.4.3': {}
|
||||||
|
|
||||||
|
'@iconify/collections@1.0.561':
|
||||||
|
dependencies:
|
||||||
|
'@iconify/types': 2.0.0
|
||||||
|
|
||||||
|
'@iconify/types@2.0.0': {}
|
||||||
|
|
||||||
|
'@iconify/utils@2.3.0':
|
||||||
|
dependencies:
|
||||||
|
'@antfu/install-pkg': 1.1.0
|
||||||
|
'@antfu/utils': 8.1.1
|
||||||
|
'@iconify/types': 2.0.0
|
||||||
|
debug: 4.4.1
|
||||||
|
globals: 15.15.0
|
||||||
|
kolorist: 1.8.0
|
||||||
|
local-pkg: 1.1.1
|
||||||
|
mlly: 1.7.4
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- supports-color
|
||||||
|
|
||||||
|
'@iconify/vue@5.0.0(vue@3.5.17(typescript@5.8.3))':
|
||||||
|
dependencies:
|
||||||
|
'@iconify/types': 2.0.0
|
||||||
|
vue: 3.5.17(typescript@5.8.3)
|
||||||
|
|
||||||
'@ioredis/commands@1.2.0': {}
|
'@ioredis/commands@1.2.0': {}
|
||||||
|
|
||||||
'@isaacs/balanced-match@4.0.1': {}
|
'@isaacs/balanced-match@4.0.1': {}
|
||||||
|
|
@ -7825,7 +8137,7 @@ snapshots:
|
||||||
- supports-color
|
- supports-color
|
||||||
- typescript
|
- typescript
|
||||||
|
|
||||||
'@nuxt/eslint@1.4.1(@typescript-eslint/utils@8.34.1(eslint@9.29.0(jiti@2.4.2))(typescript@5.8.3))(@vue/compiler-sfc@3.5.17)(eslint-import-resolver-node@0.3.9)(eslint@9.29.0(jiti@2.4.2))(magicast@0.3.5)(typescript@5.8.3)(vite@6.3.5(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0))':
|
'@nuxt/eslint@1.4.1(@typescript-eslint/utils@8.34.1(eslint@9.29.0(jiti@2.4.2))(typescript@5.8.3))(@vue/compiler-sfc@3.5.17)(eslint-import-resolver-node@0.3.9)(eslint@9.29.0(jiti@2.4.2))(magicast@0.3.5)(typescript@5.8.3)(vite-plugin-eslint2@5.0.3(eslint@9.29.0(jiti@2.4.2))(rollup@4.44.0)(vite@6.3.5(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0)))(vite@6.3.5(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0))':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@eslint/config-inspector': 1.1.0(eslint@9.29.0(jiti@2.4.2))
|
'@eslint/config-inspector': 1.1.0(eslint@9.29.0(jiti@2.4.2))
|
||||||
'@nuxt/devtools-kit': 2.5.0(magicast@0.3.5)(vite@6.3.5(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0))
|
'@nuxt/devtools-kit': 2.5.0(magicast@0.3.5)(vite@6.3.5(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0))
|
||||||
|
|
@ -7841,6 +8153,8 @@ snapshots:
|
||||||
mlly: 1.7.4
|
mlly: 1.7.4
|
||||||
pathe: 2.0.3
|
pathe: 2.0.3
|
||||||
unimport: 5.0.1
|
unimport: 5.0.1
|
||||||
|
optionalDependencies:
|
||||||
|
vite-plugin-eslint2: 5.0.3(eslint@9.29.0(jiti@2.4.2))(rollup@4.44.0)(vite@6.3.5(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0))
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- '@typescript-eslint/utils'
|
- '@typescript-eslint/utils'
|
||||||
- '@vue/compiler-sfc'
|
- '@vue/compiler-sfc'
|
||||||
|
|
@ -7853,6 +8167,28 @@ snapshots:
|
||||||
- utf-8-validate
|
- utf-8-validate
|
||||||
- vite
|
- vite
|
||||||
|
|
||||||
|
'@nuxt/icon@1.14.0(magicast@0.3.5)(vite@6.3.5(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0))(vue@3.5.17(typescript@5.8.3))':
|
||||||
|
dependencies:
|
||||||
|
'@iconify/collections': 1.0.561
|
||||||
|
'@iconify/types': 2.0.0
|
||||||
|
'@iconify/utils': 2.3.0
|
||||||
|
'@iconify/vue': 5.0.0(vue@3.5.17(typescript@5.8.3))
|
||||||
|
'@nuxt/devtools-kit': 2.5.0(magicast@0.3.5)(vite@6.3.5(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0))
|
||||||
|
'@nuxt/kit': 3.17.5(magicast@0.3.5)
|
||||||
|
consola: 3.4.2
|
||||||
|
local-pkg: 1.1.1
|
||||||
|
mlly: 1.7.4
|
||||||
|
ohash: 2.0.11
|
||||||
|
pathe: 2.0.3
|
||||||
|
picomatch: 4.0.2
|
||||||
|
std-env: 3.9.0
|
||||||
|
tinyglobby: 0.2.14
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- magicast
|
||||||
|
- supports-color
|
||||||
|
- vite
|
||||||
|
- vue
|
||||||
|
|
||||||
'@nuxt/kit@3.17.5(magicast@0.3.5)':
|
'@nuxt/kit@3.17.5(magicast@0.3.5)':
|
||||||
dependencies:
|
dependencies:
|
||||||
c12: 3.0.4(magicast@0.3.5)
|
c12: 3.0.4(magicast@0.3.5)
|
||||||
|
|
@ -8328,6 +8664,358 @@ snapshots:
|
||||||
|
|
||||||
'@sindresorhus/merge-streams@2.3.0': {}
|
'@sindresorhus/merge-streams@2.3.0': {}
|
||||||
|
|
||||||
|
'@solana/accounts@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/addresses': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/codecs-core': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-strings': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-spec': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-types': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- fastestsmallesttextencoderdecoder
|
||||||
|
|
||||||
|
'@solana/addresses@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/assertions': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-core': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-strings': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/nominal-types': 2.1.1(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- fastestsmallesttextencoderdecoder
|
||||||
|
|
||||||
|
'@solana/assertions@2.1.1(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
|
||||||
|
'@solana/codecs-core@2.1.1(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
|
||||||
|
'@solana/codecs-data-structures@2.1.1(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/codecs-core': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-numbers': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
|
||||||
|
'@solana/codecs-numbers@2.1.1(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/codecs-core': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
|
||||||
|
'@solana/codecs-strings@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/codecs-core': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-numbers': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
fastestsmallesttextencoderdecoder: 1.0.22
|
||||||
|
typescript: 5.8.3
|
||||||
|
|
||||||
|
'@solana/codecs@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/codecs-core': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-data-structures': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-numbers': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-strings': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/options': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- fastestsmallesttextencoderdecoder
|
||||||
|
|
||||||
|
'@solana/errors@2.1.1(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
chalk: 5.4.1
|
||||||
|
commander: 13.1.0
|
||||||
|
typescript: 5.8.3
|
||||||
|
|
||||||
|
'@solana/fast-stable-stringify@2.1.1(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
typescript: 5.8.3
|
||||||
|
|
||||||
|
'@solana/functional@2.1.1(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
typescript: 5.8.3
|
||||||
|
|
||||||
|
'@solana/instructions@2.1.1(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/codecs-core': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
|
||||||
|
'@solana/keys@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/assertions': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-core': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-strings': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/nominal-types': 2.1.1(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- fastestsmallesttextencoderdecoder
|
||||||
|
|
||||||
|
'@solana/kit@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)(ws@8.18.2)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/accounts': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/addresses': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/codecs': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/functional': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/instructions': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/keys': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/programs': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/rpc': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/rpc-parsed-types': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-spec-types': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-subscriptions': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)(ws@8.18.2)
|
||||||
|
'@solana/rpc-types': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/signers': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/sysvars': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/transaction-confirmation': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)(ws@8.18.2)
|
||||||
|
'@solana/transaction-messages': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/transactions': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- fastestsmallesttextencoderdecoder
|
||||||
|
- ws
|
||||||
|
|
||||||
|
'@solana/nominal-types@2.1.1(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
typescript: 5.8.3
|
||||||
|
|
||||||
|
'@solana/options@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/codecs-core': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-data-structures': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-numbers': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-strings': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- fastestsmallesttextencoderdecoder
|
||||||
|
|
||||||
|
'@solana/programs@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/addresses': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- fastestsmallesttextencoderdecoder
|
||||||
|
|
||||||
|
'@solana/promises@2.1.1(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
typescript: 5.8.3
|
||||||
|
|
||||||
|
'@solana/rpc-api@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/addresses': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/codecs-core': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-strings': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/keys': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/rpc-parsed-types': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-spec': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-transformers': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/rpc-types': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/transaction-messages': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/transactions': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- fastestsmallesttextencoderdecoder
|
||||||
|
|
||||||
|
'@solana/rpc-parsed-types@2.1.1(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
typescript: 5.8.3
|
||||||
|
|
||||||
|
'@solana/rpc-spec-types@2.1.1(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
typescript: 5.8.3
|
||||||
|
|
||||||
|
'@solana/rpc-spec@2.1.1(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-spec-types': 2.1.1(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
|
||||||
|
'@solana/rpc-subscriptions-api@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/addresses': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/keys': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/rpc-subscriptions-spec': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-transformers': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/rpc-types': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/transaction-messages': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/transactions': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- fastestsmallesttextencoderdecoder
|
||||||
|
|
||||||
|
'@solana/rpc-subscriptions-channel-websocket@2.1.1(typescript@5.8.3)(ws@8.18.2)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/functional': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-subscriptions-spec': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/subscribable': 2.1.1(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
ws: 8.18.2
|
||||||
|
|
||||||
|
'@solana/rpc-subscriptions-spec@2.1.1(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/promises': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-spec-types': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/subscribable': 2.1.1(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
|
||||||
|
'@solana/rpc-subscriptions@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)(ws@8.18.2)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/fast-stable-stringify': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/functional': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/promises': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-spec-types': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-subscriptions-api': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/rpc-subscriptions-channel-websocket': 2.1.1(typescript@5.8.3)(ws@8.18.2)
|
||||||
|
'@solana/rpc-subscriptions-spec': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-transformers': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/rpc-types': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/subscribable': 2.1.1(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- fastestsmallesttextencoderdecoder
|
||||||
|
- ws
|
||||||
|
|
||||||
|
'@solana/rpc-transformers@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/functional': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/nominal-types': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-spec-types': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-types': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- fastestsmallesttextencoderdecoder
|
||||||
|
|
||||||
|
'@solana/rpc-transport-http@2.1.1(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-spec': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-spec-types': 2.1.1(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
undici-types: 7.10.0
|
||||||
|
|
||||||
|
'@solana/rpc-types@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/addresses': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/codecs-core': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-numbers': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-strings': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/nominal-types': 2.1.1(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- fastestsmallesttextencoderdecoder
|
||||||
|
|
||||||
|
'@solana/rpc@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/fast-stable-stringify': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/functional': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-api': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/rpc-spec': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-spec-types': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-transformers': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/rpc-transport-http': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-types': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- fastestsmallesttextencoderdecoder
|
||||||
|
|
||||||
|
'@solana/signers@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/addresses': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/codecs-core': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/instructions': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/keys': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/nominal-types': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/transaction-messages': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/transactions': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- fastestsmallesttextencoderdecoder
|
||||||
|
|
||||||
|
'@solana/subscribable@2.1.1(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
|
||||||
|
'@solana/sysvars@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/accounts': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/codecs': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-types': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- fastestsmallesttextencoderdecoder
|
||||||
|
|
||||||
|
'@solana/transaction-confirmation@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)(ws@8.18.2)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/addresses': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/codecs-strings': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/keys': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/promises': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/rpc-subscriptions': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)(ws@8.18.2)
|
||||||
|
'@solana/rpc-types': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/transaction-messages': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/transactions': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- fastestsmallesttextencoderdecoder
|
||||||
|
- ws
|
||||||
|
|
||||||
|
'@solana/transaction-messages@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/addresses': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/codecs-core': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-data-structures': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-numbers': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/functional': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/instructions': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/nominal-types': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-types': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- fastestsmallesttextencoderdecoder
|
||||||
|
|
||||||
|
'@solana/transactions@2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)':
|
||||||
|
dependencies:
|
||||||
|
'@solana/addresses': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/codecs-core': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-data-structures': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-numbers': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/codecs-strings': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/errors': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/functional': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/instructions': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/keys': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/nominal-types': 2.1.1(typescript@5.8.3)
|
||||||
|
'@solana/rpc-types': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
'@solana/transaction-messages': 2.1.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.8.3)
|
||||||
|
typescript: 5.8.3
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- fastestsmallesttextencoderdecoder
|
||||||
|
|
||||||
'@speed-highlight/core@1.2.7': {}
|
'@speed-highlight/core@1.2.7': {}
|
||||||
|
|
||||||
'@stylistic/eslint-plugin@4.4.1(eslint@9.29.0(jiti@2.4.2))(typescript@5.8.3)':
|
'@stylistic/eslint-plugin@4.4.1(eslint@9.29.0(jiti@2.4.2))(typescript@5.8.3)':
|
||||||
|
|
@ -9371,6 +10059,8 @@ snapshots:
|
||||||
ansi-styles: 4.3.0
|
ansi-styles: 4.3.0
|
||||||
supports-color: 7.2.0
|
supports-color: 7.2.0
|
||||||
|
|
||||||
|
chalk@5.4.1: {}
|
||||||
|
|
||||||
changelogen@0.6.1(magicast@0.3.5):
|
changelogen@0.6.1(magicast@0.3.5):
|
||||||
dependencies:
|
dependencies:
|
||||||
c12: 3.0.4(magicast@0.3.5)
|
c12: 3.0.4(magicast@0.3.5)
|
||||||
|
|
@ -9495,6 +10185,8 @@ snapshots:
|
||||||
|
|
||||||
commander@12.1.0: {}
|
commander@12.1.0: {}
|
||||||
|
|
||||||
|
commander@13.1.0: {}
|
||||||
|
|
||||||
commander@2.20.3: {}
|
commander@2.20.3: {}
|
||||||
|
|
||||||
commander@5.1.0: {}
|
commander@5.1.0: {}
|
||||||
|
|
@ -10544,6 +11236,8 @@ snapshots:
|
||||||
|
|
||||||
fastest-levenshtein@1.0.16: {}
|
fastest-levenshtein@1.0.16: {}
|
||||||
|
|
||||||
|
fastestsmallesttextencoderdecoder@1.0.22: {}
|
||||||
|
|
||||||
fastq@1.19.1:
|
fastq@1.19.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
reusify: 1.1.0
|
reusify: 1.1.0
|
||||||
|
|
@ -10897,6 +11591,8 @@ snapshots:
|
||||||
|
|
||||||
globals@14.0.0: {}
|
globals@14.0.0: {}
|
||||||
|
|
||||||
|
globals@15.15.0: {}
|
||||||
|
|
||||||
globals@16.2.0: {}
|
globals@16.2.0: {}
|
||||||
|
|
||||||
globalthis@1.0.4:
|
globalthis@1.0.4:
|
||||||
|
|
@ -11433,6 +12129,8 @@ snapshots:
|
||||||
|
|
||||||
known-css-properties@0.37.0: {}
|
known-css-properties@0.37.0: {}
|
||||||
|
|
||||||
|
kolorist@1.8.0: {}
|
||||||
|
|
||||||
kuler@2.0.0: {}
|
kuler@2.0.0: {}
|
||||||
|
|
||||||
lambda-local@2.2.0:
|
lambda-local@2.2.0:
|
||||||
|
|
@ -13691,6 +14389,8 @@ snapshots:
|
||||||
|
|
||||||
undici-types@6.21.0: {}
|
undici-types@6.21.0: {}
|
||||||
|
|
||||||
|
undici-types@7.10.0: {}
|
||||||
|
|
||||||
undici-types@7.8.0: {}
|
undici-types@7.8.0: {}
|
||||||
|
|
||||||
unenv@2.0.0-rc.17:
|
unenv@2.0.0-rc.17:
|
||||||
|
|
@ -13941,6 +14641,17 @@ snapshots:
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
vite-plugin-electron-renderer: 0.14.6
|
vite-plugin-electron-renderer: 0.14.6
|
||||||
|
|
||||||
|
vite-plugin-eslint2@5.0.3(eslint@9.29.0(jiti@2.4.2))(rollup@4.44.0)(vite@6.3.5(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0)):
|
||||||
|
dependencies:
|
||||||
|
'@rollup/pluginutils': 5.2.0(rollup@4.44.0)
|
||||||
|
debug: 4.4.1
|
||||||
|
eslint: 9.29.0(jiti@2.4.2)
|
||||||
|
vite: 6.3.5(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0)
|
||||||
|
optionalDependencies:
|
||||||
|
rollup: 4.44.0
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- supports-color
|
||||||
|
|
||||||
vite-plugin-inspect@11.2.0(@nuxt/kit@3.17.5(magicast@0.3.5))(vite@6.3.5(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0)):
|
vite-plugin-inspect@11.2.0(@nuxt/kit@3.17.5(magicast@0.3.5))(vite@6.3.5(@types/node@24.0.3)(jiti@2.4.2)(lightningcss@1.30.1)(terser@5.43.1)(yaml@2.8.0)):
|
||||||
dependencies:
|
dependencies:
|
||||||
ansis: 3.17.0
|
ansis: 3.17.0
|
||||||
|
|
|
||||||
18
test-ipfs.js
Normal file
18
test-ipfs.js
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
// Simple test to verify IPFS functionality
|
||||||
|
import { fetchTokenMetadata } from './app/utils/ipfs.js';
|
||||||
|
|
||||||
|
async function testIpfs() {
|
||||||
|
console.info('Testing IPFS fetch...');
|
||||||
|
|
||||||
|
// Test with a common IPFS URI format
|
||||||
|
const testUri = 'https://ipfs.io/ipfs/QmPFELY2WMF7KRcpegQxjLqiFGD5AL6bGA9cYB6bE7WVd9';
|
||||||
|
|
||||||
|
try {
|
||||||
|
const result = await fetchTokenMetadata(testUri);
|
||||||
|
console.info('Result:', result);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
testIpfs();
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
{
|
{
|
||||||
"extends": "./.nuxt/tsconfig.json"
|
"extends": "./.nuxt/tsconfig.json",
|
||||||
|
"include": [
|
||||||
|
"app/**/*",
|
||||||
|
"electron/**/*",
|
||||||
|
"types/**/*"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
26
types/electron.d.ts
vendored
26
types/electron.d.ts
vendored
|
|
@ -1,28 +1,30 @@
|
||||||
import type { handlers } from './../electron/preload';
|
export interface RedisMessage {
|
||||||
|
channel: string;
|
||||||
type ElectronAPI = typeof handlers;
|
data: unknown;
|
||||||
|
timestamp: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface IElectronAPI {
|
export interface IElectronAPI {
|
||||||
|
// Window controls
|
||||||
minimizeWindow: () => Promise<void>;
|
minimizeWindow: () => Promise<void>;
|
||||||
maximizeWindow: () => Promise<void>;
|
maximizeWindow: () => Promise<void>;
|
||||||
closeWindow: () => Promise<void>;
|
closeWindow: () => Promise<void>;
|
||||||
isMaximized: () => Promise<boolean>;
|
isMaximized: () => Promise<boolean>;
|
||||||
onMaximizeChange: (callback: (event: any, maximized: boolean) => void) => void;
|
|
||||||
removeMaximizeListener: (callback: (event: any, maximized: boolean) => void) => void;
|
// Window state listeners
|
||||||
|
onMaximizeChange: (callback: (event: unknown, maximized: boolean) => void) => void;
|
||||||
|
removeMaximizeListener: (callback: (event: unknown, maximized: boolean) => void) => void;
|
||||||
|
|
||||||
|
// External links
|
||||||
openExternal: (url: string) => Promise<void>;
|
openExternal: (url: string) => Promise<void>;
|
||||||
|
|
||||||
|
// Redis data subscription
|
||||||
onRedisData: (callback: (data: RedisMessage) => void) => void;
|
onRedisData: (callback: (data: RedisMessage) => void) => void;
|
||||||
removeRedisDataListener: () => void;
|
removeRedisDataListener: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RedisMessage {
|
|
||||||
channel: string;
|
|
||||||
data: any;
|
|
||||||
timestamp: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
electron: ElectronAPI;
|
|
||||||
electronAPI: IElectronAPI;
|
electronAPI: IElectronAPI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
3
types/nuxt.d.ts
vendored
Normal file
3
types/nuxt.d.ts
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
/// <reference types="nuxt" />
|
||||||
|
|
||||||
|
export { };
|
||||||
75
types/redis-events.ts
Normal file
75
types/redis-events.ts
Normal file
|
|
@ -0,0 +1,75 @@
|
||||||
|
// Type for new token created event (from NewTokenCache in muhafidh/src/storage/redis/model.rs)
|
||||||
|
export interface NewTokenCreatedData {
|
||||||
|
mint: number[]; // 32-byte array from Rust Pubkey
|
||||||
|
bonding_curve?: number[]; // 32-byte array from Rust Pubkey
|
||||||
|
name: string;
|
||||||
|
symbol: string;
|
||||||
|
uri: string;
|
||||||
|
creator: number[]; // 32-byte array from Rust Pubkey
|
||||||
|
created_at: number; // Unix timestamp in seconds
|
||||||
|
}
|
||||||
|
|
||||||
|
// Type for token CEX updated event (from creator.rs line 133-144)
|
||||||
|
export interface TokenCexUpdatedData {
|
||||||
|
mint: string; // Mint address as string
|
||||||
|
name: string;
|
||||||
|
uri: string;
|
||||||
|
dev_name: string;
|
||||||
|
cex_name: string;
|
||||||
|
cex_address: string;
|
||||||
|
creator: string; // Creator address as string
|
||||||
|
created_at: number; // Unix timestamp in seconds
|
||||||
|
updated_at: number; // Unix timestamp in seconds
|
||||||
|
node_count: number;
|
||||||
|
edge_count: number;
|
||||||
|
graph: unknown; // Connection graph data
|
||||||
|
}
|
||||||
|
|
||||||
|
// Type for max depth reached event (from creator.rs line 133-144)
|
||||||
|
export interface MaxDepthReachedData {
|
||||||
|
mint: string; // Mint address as string
|
||||||
|
name: string;
|
||||||
|
uri: string;
|
||||||
|
dev_name: string;
|
||||||
|
cex_name: string;
|
||||||
|
cex_address: string;
|
||||||
|
creator: string; // Creator address as string
|
||||||
|
bonding_curve: string; // Bonding curve address as string
|
||||||
|
created_at: number; // Unix timestamp in seconds (now consistent with backend fix)
|
||||||
|
updated_at: number; // Unix timestamp in seconds (now consistent with backend fix)
|
||||||
|
node_count: number;
|
||||||
|
edge_count: number;
|
||||||
|
graph: unknown; // Connection graph data
|
||||||
|
}
|
||||||
|
|
||||||
|
// Redis message wrapper
|
||||||
|
export interface RedisMessage<T = unknown> {
|
||||||
|
channel: string;
|
||||||
|
data: T;
|
||||||
|
timestamp: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
// IPFS metadata structure for token URIs
|
||||||
|
export interface TokenMetadata {
|
||||||
|
name?: string;
|
||||||
|
symbol?: string;
|
||||||
|
description?: string;
|
||||||
|
image?: string;
|
||||||
|
external_url?: string;
|
||||||
|
attributes?: Array<{
|
||||||
|
trait_type: string;
|
||||||
|
value: string | number;
|
||||||
|
}>;
|
||||||
|
properties?: {
|
||||||
|
files?: Array<{
|
||||||
|
uri: string;
|
||||||
|
type: string;
|
||||||
|
}>;
|
||||||
|
category?: string;
|
||||||
|
};
|
||||||
|
// Social links that might be in the metadata
|
||||||
|
twitter?: string;
|
||||||
|
telegram?: string;
|
||||||
|
website?: string;
|
||||||
|
discord?: string;
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue