Trenchr provides both internal API routes and external integrations for wallet analysis and real-time features.
Standard HTTP endpoints
WebSocket subscriptions
Coming soon
/api/analyze-walletAnalyzes a Solana wallet address and returns comprehensive trading metrics.
| Parameter | Type | Required | Description |
|---|---|---|---|
address | string | Yes | Valid Solana wallet address |
curl "https://trenchr.app/api/analyze-wallet?address=7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU"
{
"address": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"winRate": 62.5,
"solBalance": 15.75,
"totalProfit": 1250.5,
"realizedProfit7d": 125.25,
"realizedProfit30d": 890.75,
"totalValue": 2850.25,
"riskScore": 45
}{
"error": "Wallet address is required"
}// Sign Up
const { data, error } = await supabase.auth.signUp({
email: 'user@example.com',
password: 'securepassword',
options: {
data: {
username: 'trencher_legend'
}
}
})
// Sign In
const { data, error } = await supabase.auth.signInWithPassword({
email: 'user@example.com',
password: 'securepassword'
})// Create/Update User Profile
const { data, error } = await supabase
.from('users')
.upsert({
id: user.id,
username: 'trencher_legend',
display_name: 'The BONK Believer',
trading_style: 'Degen'
})
.select()
.single()
// Record a Swipe
const { error } = await supabase
.from('swipes')
.insert({
swiper_id: currentUserId,
swiped_id: targetUserId,
direction: 'right'
})// Listen for New Messages
const subscription = supabase
.channel(`messages:${matchId}`)
.on(
'postgres_changes',
{
event: 'INSERT',
schema: 'public',
table: 'messages',
filter: `match_id=eq.${matchId}`
},
(payload) => {
const newMessage = payload.new
// Handle new message
}
)
.subscribe()| Endpoint | Limit | Window |
|---|---|---|
/api/analyze-wallet | 60 requests | 1 minute |
| All API routes | 1000 requests | 1 hour |
X-RateLimit-Limit: 60 X-RateLimit-Remaining: 59 X-RateLimit-Reset: 1640995200
// User types
interface User {
id: string
email: string
username: string
display_name?: string
bio?: string
wallet_address?: string
trading_style?: 'Degen' | 'Swing' | 'Copy' | 'Sniper'
wallet_size_tier?: 'Micro' | 'Small' | 'Medium' | 'Large' | 'Whale'
// ... more fields
}
// Wallet analysis types
interface WalletAnalysisData {
address: string
winRate: number
solBalance: number
totalProfit: number
realizedProfit7d: number
realizedProfit30d: number
totalValue: number
riskScore: number
}