149 lines
3.3 KiB
Markdown
149 lines
3.3 KiB
Markdown
# π ESPN Integration Complete!
|
|
|
|
## What Was Added
|
|
|
|
β
**Full ESPN Sports API Integration** - No API key required!
|
|
|
|
### Supported Sports (16+ leagues!)
|
|
|
|
1. **American Football**
|
|
- NFL (all teams)
|
|
- College Football (all conferences)
|
|
|
|
2. **Basketball**
|
|
- NBA
|
|
- WNBA
|
|
- Men's College Basketball
|
|
- Women's College Basketball
|
|
|
|
3. **Baseball**
|
|
- MLB
|
|
- College Baseball
|
|
|
|
4. **Hockey**
|
|
- NHL
|
|
|
|
5. **Soccer** (8 major leagues)
|
|
- English Premier League
|
|
- La Liga
|
|
- Bundesliga
|
|
- Serie A
|
|
- Ligue 1
|
|
- MLS
|
|
- Champions League
|
|
- World Cup
|
|
|
|
## New Files Created
|
|
|
|
- β
`lib/oracle/espn.ts` - ESPN API integration
|
|
- β
`SPORTS_POLLS_GUIDE.md` - Complete documentation
|
|
- β
Updated `lib/oracle/index.ts` - Added ESPN to verification system
|
|
- β
Updated `types/index.ts` - Added ESPN verification type
|
|
- β
Updated `database/schema.sql` - Added ESPN to verification types
|
|
|
|
## How It Works
|
|
|
|
### 1. Create Sports Poll
|
|
```typescript
|
|
const poll = await createPoll({
|
|
question: 'Chiefs vs Bills - Who wins?',
|
|
verificationType: 'espn',
|
|
verificationConfig: {
|
|
sport: 'football/nfl',
|
|
homeTeam: 'Kansas City Chiefs',
|
|
awayTeam: 'Buffalo Bills',
|
|
},
|
|
// ... rest of poll config
|
|
})
|
|
```
|
|
|
|
### 2. Automatic Verification
|
|
- Cron runs hourly
|
|
- Fetches game result from ESPN
|
|
- Determines winner automatically
|
|
- No manual intervention needed!
|
|
|
|
### 3. Automatic Distribution
|
|
- Winners get paid automatically
|
|
- Proportional payouts
|
|
- All tracked in database
|
|
|
|
## Example Polls
|
|
|
|
### NFL Game
|
|
```typescript
|
|
{
|
|
question: 'Super Bowl - Who wins?',
|
|
sport: 'football/nfl',
|
|
homeTeam: 'Kansas City Chiefs',
|
|
awayTeam: 'San Francisco 49ers',
|
|
}
|
|
```
|
|
|
|
### NBA Over/Under
|
|
```typescript
|
|
{
|
|
question: 'Lakers vs Warriors - Over/Under 220?',
|
|
sport: 'basketball/nba',
|
|
homeTeam: 'Los Angeles Lakers',
|
|
awayTeam: 'Golden State Warriors',
|
|
comparisonType: 'over_under',
|
|
targetScore: 220,
|
|
}
|
|
```
|
|
|
|
### Soccer Match
|
|
```typescript
|
|
{
|
|
question: 'Man City vs Liverpool - Winner?',
|
|
sport: 'soccer',
|
|
league: 'eng.1',
|
|
homeTeam: 'Manchester City',
|
|
awayTeam: 'Liverpool',
|
|
}
|
|
```
|
|
|
|
## Features
|
|
|
|
β
**Automatic Score Fetching** - ESPN updates in real-time
|
|
β
**No API Key Required** - Free to use
|
|
β
**16+ Leagues Supported** - Football, basketball, baseball, hockey, soccer
|
|
β
**Multiple Bet Types**:
|
|
- Winner prediction
|
|
- Over/Under
|
|
- Draw/No draw
|
|
- Exact scores
|
|
β
**Team Name Matching** - Flexible team name recognition
|
|
β
**Game ID Support** - Use specific ESPN game IDs
|
|
β
**Error Handling** - Retries if game not completed
|
|
|
|
## Complete Oracle System
|
|
|
|
Your PollCelo now has **5 verification methods**:
|
|
|
|
1. β
**Chainlink** - Crypto prices (BTC, ETH, CELO)
|
|
2. β
**Curve Finance** - DeFi token prices
|
|
3. β
**DexScreener** - DEX pair prices
|
|
4. β
**External API** - Any REST API (weather, forex, etc.)
|
|
5. β
**ESPN** - Sports scores (16+ leagues) π
|
|
|
|
## Ready to Use
|
|
|
|
Everything is integrated and ready:
|
|
- Database schema updated
|
|
- Types updated
|
|
- Cron jobs will handle ESPN polls
|
|
- Full documentation included
|
|
|
|
## Next Steps
|
|
|
|
1. Deploy to production
|
|
2. Create your first sports poll
|
|
3. Watch it verify and distribute automatically!
|
|
|
|
See `SPORTS_POLLS_GUIDE.md` for detailed examples and best practices.
|
|
|
|
---
|
|
|
|
**PollCelo now supports the most popular sports betting markets!** ππβΎπβ½
|