@wkalidev/trivia-quest-sdk 1.4.0 โ†’ 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,213 +1,173 @@
1
1
  # Trivia Q ๐ŸŽฎ
2
2
 
3
- > Play. Learn. Earn on Celo.
3
+ > Play. Learn. Earn on Celo & Base.
4
4
 
5
- Trivia Q is a blockchain-powered quiz game built on Celo where players earn real CELO rewards, $TRIVQ tokens, and unique NFT badges by answering questions about African culture, geography, Web3, science, sports, and general knowledge.
5
+ [![Live Demo](https://img.shields.io/badge/Live-trivia--quest--eight.vercel.app-FBCD00?style=for-the-badge)](https://trivia-quest-eight.vercel.app)
6
+ [![npm](https://img.shields.io/badge/SDK-npm-CB3837?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@wkalidev/trivia-quest-sdk)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green?style=for-the-badge)](LICENSE)
6
8
 
7
9
  ## ๐ŸŒ Why Africa?
8
10
 
9
- Celo's mission is financial inclusion for the unbanked. With 57% of African adults lacking bank accounts but owning smartphones, MiniPay is the perfect gateway. Trivia Q brings fun, education, and real micro-rewards to this audience.
10
-
11
- ## ๐Ÿš€ Live Demo
12
-
13
- ๐Ÿ‘‰ [trivia-quest-eight.vercel.app](https://trivia-quest-eight.vercel.app)
14
-
15
- ## ๐ŸŽฎ Game Features
16
-
17
- - โœ… 446 questions dans 6 catรฉgories
18
- - โœ… 10 questions alรฉatoires par partie
19
- - โœ… Timer de 15 secondes par question
20
- - โœ… Systรจme de Streak x2 / x3 multiplicateur de points
21
- - โœ… Rรฉcompenses $TRIVQ mintรฉes on-chain ร  chaque partie
22
- - โœ… Daily Check-in โ€” 100 TRIVQ/jour + NFT badge unique
23
- - โœ… 7-day streak bonus โ€” 2000 TRIVQ + badge Legendary
24
- - โœ… 150 NFT badges uniques (ERC-1155) sur Pinata IPFS
25
- - โœ… Page collection badges `/badges`
26
- - โœ… Protocol fee 10% sur chaque round
27
- - โœ… Animations Framer Motion
28
- - โœ… Sons & feedback audio (๐Ÿ”Š/๐Ÿ”‡ toggle)
29
- - โœ… Leaderboard on-chain en temps rรฉel
30
- - โœ… Support 4 langues : ๐Ÿ‡ซ๐Ÿ‡ท FR / ๐Ÿ‡ฌ๐Ÿ‡ง EN / ๐Ÿ‡ช๐Ÿ‡ธ ES / ๐Ÿ‡ฎ๐Ÿ‡น IT
31
- - โœ… MiniPay compatible (dรฉtection automatique)
32
- - โœ… PWA installable sur Android
33
- - โœ… Cron auto-finish rounds (GitHub Actions)
34
- โœ… Referral system โ€” invite & earn 500 TRIVQ
35
- - โœ… $TRIVQ price tracker live
36
- - โœ… PWA push notifications
37
-
38
- ## ๐Ÿ“š Question Categories
39
-
40
- | Catรฉgorie | Nb questions |
41
- |---|---|
42
- | ๐ŸŒ Gรฉographie Africaine | ~80 |
43
- | ๐Ÿ’ฐ Web3 & Crypto | ~100 |
44
- | ๐Ÿ“– Histoire & Culture | ~60 |
45
- | ๐Ÿ”ฌ Science & Tech | ~80 |
46
- | โšฝ Sports | ~40 |
47
- | ๐ŸŒ Culture Gรฉnรฉrale | ~86 |
11
+ Celo's mission is financial inclusion for the unbanked. With **57% of African adults** lacking bank accounts but owning smartphones, MiniPay is the perfect gateway. Trivia Q brings fun, education, and real micro-rewards to this audience โ€” fully playable inside MiniPay with zero-click wallet connect.
48
12
 
49
- ## ๐Ÿ—๏ธ Architecture
13
+ ## ๐Ÿš€ Live
50
14
 
51
- - **Smart Contracts** โ€” Solidity 0.8.20/0.8.24 + OpenZeppelin sur Celo Mainnet
52
- - **Frontend** โ€” Next.js 16 + TypeScript + TailwindCSS
53
- - **Animations** โ€” Framer Motion
54
- - **Wallet** โ€” RainbowKit + Wagmi + Viem + MiniPay hook
55
- - **NFT Storage** โ€” Pinata IPFS (150 NFTs)
56
- - **i18n** โ€” next-intl (FR, EN, ES, IT)
57
- - **Deploy** โ€” Vercel + GitHub Actions (cron)
15
+ | Resource | Link |
16
+ |---|---|
17
+ | App | https://trivia-quest-eight.vercel.app |
18
+ | Duel 1v1 | https://trivia-quest-eight.vercel.app/duel |
19
+ | SDK | npm install @wkalidev/trivia-quest-sdk |
20
+ | Stats API | GET /api/stats |
21
+ | GitHub | https://github.com/wkalidev/trivia-quest |
22
+
23
+ ## ๐ŸŽฎ Features
24
+
25
+ - 446 questions across 6 categories
26
+ - 10 random questions per game, 15s timer
27
+ - Streak system x2 / x3 multiplier
28
+ - $TRIVQ tokens minted on-chain after every game
29
+ - Daily Check-in โ€” 100 TRIVQ/day + NFT badge
30
+ - 7-day streak bonus โ€” 2,000 TRIVQ + Legendary badge
31
+ - 150 unique NFT badges (ERC-1155) on Pinata IPFS
32
+ - Round-based prize pool โ€” top 3 players split the pot
33
+ - Referral system โ€” invite & earn 500 TRIVQ
34
+ - Real-time on-chain leaderboard
35
+ - $TRIVQ live price tracker (Ubeswap v3)
36
+ - MiniPay compatible โ€” auto wallet connect
37
+ - Multi-chain โ€” Celo Mainnet + Base Mainnet
38
+ - 4 languages โ€” FR / EN / ES / IT
39
+ - PWA installable on Android
40
+ - Discord Bot 24/7
41
+ - ๐Ÿ†• AI Mode โ€” questions by Groq AI (LLaMA 3.1)
42
+ - ๐Ÿ†• Trivia Duel 1v1 โ€” wager CELO on-chain
43
+ - ๐Ÿ†• Discord AI Agent โ€” /ask /askcat
44
+
45
+ ## ๐Ÿค– AI Mode (NEW โ€” May 2026)
46
+
47
+ Questions generated in real-time by Groq AI (LLaMA 3.1-8b-instant):
48
+ - Available in all 6 categories
49
+ - Infinite unique questions โ€” never the same quiz twice
50
+ - Questions preloaded in background while you play
51
+ - Accessible via /quiz โ†’ Mode IA button
52
+ - API: GET /api/ai-question?category=Web3%20%26%20Crypto
53
+
54
+ ## โš”๏ธ Trivia Duel 1v1 (NEW โ€” May 2026)
55
+
56
+ - Create a duel with a wager (0.01 to 0.5 CELO)
57
+ - Share the duel ID with your opponent
58
+ - Both play independently โ€” best score wins the pot
59
+ - Tie = both players refunded minus fees
60
+ - Expires in 24h if no one joins โ†’ full refund
61
+ - 10% protocol fee on winnings
62
+ - Contract: 0xee7be00cd5454b9bea56d864d82076b8b5de5ca1
58
63
 
59
64
  ## ๐Ÿ”— Smart Contracts
60
65
 
61
- | Contract | Network | Address |
62
- |---|---|---|
63
-
64
- | TriviaQToken ($TRIVQ) v2 | Celo Mainnet | `0xe65fc5cacaf9a5aebbc0e151dee08a53f24a05c5` |
65
- | TriviaQuest v3 | Celo Mainnet | `0xffe22d3d1b63866ac9da8ac92fdb9ceddeadb0bb` |
66
- | DailyCheckIn v2 | Celo Mainnet | `0x8650e6c477f8ae3933dc6d61d85e65c90cf71828` |
67
- | Referral v2 | Celo Mainnet | `0xa0fcd85a25ecb71ca1ea9d63da058c832c27c62e` |
68
- | TriviaQuest | Celo Sepolia (testnet) | `0xa93422cb14278ac5d1a6f60f95b03aa723e6448e` |
69
- | TriviaQToken ($TRIVQ) | Celo Sepolia (testnet) | `0xa829214ea492f32818efa2c58cc7e9090572c17c` |
70
-
71
- ## ๐Ÿ’Ž $TRIVQ Tokenomics
72
-
73
- | Allocation | Amount | % |
74
- |---|---|---|
75
- | ๐ŸŽฎ Player Rewards | 500,000,000 | 50% |
76
- | ๐Ÿ’ง Liquidity | 200,000,000 | 20% |
77
- | ๐Ÿ‘ฅ Team | 150,000,000 | 15% |
78
- | ๐ŸŒฑ Ecosystem | 100,000,000 | 10% |
79
- | ๐Ÿ“ฃ Marketing | 50,000,000 | 5% |
80
-
81
- - **Total Supply** : 1,000,000,000 $TRIVQ
82
- - **Reward Rate** : 100 TRIVQ par point marquรฉ
83
- - **Daily Check-in** : 100 TRIVQ/jour + 2000 TRIVQ bonus (7 jours consรฉcutifs)
84
- - **Minting** : uniquement par TriviaQuest + DailyCheckIn (cap 500M)
85
-
86
- ## ๐ŸŽจ NFT Badges (ERC-1155)
87
-
88
- 150 badges uniques gรฉnรฉrรฉs on-chain et stockรฉs sur Pinata IPFS :
89
-
90
- | Badge | Catรฉgorie | Raretรฉ |
91
- |---|---|---|
92
- | ๐ŸŒ Africa Explorer | Gรฉographie Africaine | Common โ†’ Legendary |
93
- | โ›“ Crypto Master | Web3 & Crypto | Common โ†’ Legendary |
94
- | ๐Ÿ“œ Culture Keeper | Histoire & Culture | Common โ†’ Legendary |
95
- | โšก Tech Wizard | Science & Tech | Common โ†’ Legendary |
96
- | ๐Ÿ† Sport Champion | Sports | Common โ†’ Legendary |
97
- | โœจ Trivia Legend | Culture Gรฉnรฉrale | Common โ†’ Legendary |
98
-
99
- Chaque badge est unique grรขce aux combinaisons de palettes, backgrounds et frames.
100
-
101
- ## ๐Ÿ”ฅ Daily Check-in System
102
-
103
- | Jour | Rรฉcompense |
66
+ ### Celo Mainnet
67
+ | Contract | Address |
104
68
  |---|---|
105
- | Jour 1-6 | 100 TRIVQ + NFT badge |
106
- | Jour 7 ๐ŸŽ | 100 TRIVQ + 2000 TRIVQ BONUS + NFT badge |
107
- | Reset | Si miss > 48h, streak repart ร  0 |
108
-
109
- ## ๐Ÿ’ฐ Protocol Fee
110
-
111
- | Parameter | Value |
69
+ | TriviaQToken ($TRIVQ) v2 | 0xe65fc5cacaf9a5aebbc0e151dee08a53f24a05c5 |
70
+ | TriviaQuest v3 | 0xffe22d3d1b63866ac9da8ac92fdb9ceddeadb0bb |
71
+ | TriviaDuel v1 NEW | 0xee7be00cd5454b9bea56d864d82076b8b5de5ca1 |
72
+ | DailyCheckIn v2 | 0x8650e6c477f8ae3933dc6d61d85e65c90cf71828 |
73
+ | Referral v2 | 0xa0fcd85a25ecb71ca1ea9d63da058c832c27c62e |
74
+
75
+ ### Base Mainnet
76
+ | Contract | Address |
112
77
  |---|---|
113
- | Fee | 10% sur chaque entry fee |
114
- | Treasury | `0xdeacde6ec27fd0cd972c1232c4f0d4171dda2357` |
115
- | Max fee | 20% (hardcoded cap) |
116
-
117
- ## ๐Ÿ“ฑ MiniPay Compatible
78
+ | TriviaQToken ($TRIVQ) | 0x3217e21a74a068779902213ab06ad3301a8e6a02 |
79
+ | TriviaQuest | 0xf44dfec3230bcf917ca7ccc59b4e67df2507e21f |
80
+ | DailyCheckIn | 0x8a6f59c5f1f11a7ae75c54b1eb95c477405f1bda |
81
+ | Referral | 0x4dafb4d844ce8bd52ce3ad4cee2a4e73780d0c91 |
118
82
 
119
- Trivia Q detects MiniPay automatically and connects the wallet without any popup โ€” seamless UX for mobile users in Africa.
120
-
121
- ## ๐Ÿ”ฅ Streak System
83
+ ## ๐Ÿ’Ž $TRIVQ Tokenomics
122
84
 
123
- | Streak | Multiplicateur | Points par bonne rรฉponse |
85
+ | Allocation | Amount | % |
124
86
  |---|---|---|
125
- | 0-2 | x1 | 100 pts |
126
- | 3-4 | x2 ๐Ÿ”ฅ๐Ÿ”ฅ | 200 pts |
127
- | 5+ | x3 ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ | 300 pts |
128
-
129
- ## ๐Ÿ† Leaderboard On-Chain
130
-
131
- Le leaderboard est stockรฉ directement sur la blockchain Celo. Chaque joueur accumule des points, et les 10 meilleurs sont affichรฉs en temps rรฉel.
87
+ | Player Rewards | 500,000,000 | 50% |
88
+ | Liquidity | 200,000,000 | 20% |
89
+ | Team | 150,000,000 | 15% |
90
+ | Ecosystem | 100,000,000 | 10% |
91
+ | Marketing | 50,000,000 | 5% |
132
92
 
133
- ## ๐Ÿ† Prize Distribution (Multi-Winner)
93
+ ## ๐Ÿ”ฅ Reward System
134
94
 
135
- | Position | Share |
95
+ | Action | Reward |
136
96
  |---|---|
137
- | ๐Ÿฅ‡ 1st place | 50% |
138
- | ๐Ÿฅˆ 2nd place | 30% |
139
- | ๐Ÿฅ‰ 3rd place | 20% |
97
+ | Per point scored | 100 TRIVQ |
98
+ | Daily check-in | 100 TRIVQ |
99
+ | 7-day streak bonus | 2,000 TRIVQ |
100
+ | Referral | 500 TRIVQ |
101
+ | Round winner 1st | 50% prize pool |
102
+ | Round winner 2nd | 30% prize pool |
103
+ | Round winner 3rd | 20% prize pool |
104
+ | Duel winner | 90% of total wager |
140
105
 
141
- ## ๐ŸŒ Multi-Language Support
106
+ ## ๐Ÿ—๏ธ Architecture
142
107
 
143
- | Language | Code |
108
+ | Layer | Tech |
144
109
  |---|---|
145
- | ๐Ÿ‡ซ๐Ÿ‡ท Franรงais | fr |
146
- | ๐Ÿ‡ฌ๐Ÿ‡ง English | en |
147
- | ๐Ÿ‡ช๐Ÿ‡ธ Espaรฑol | es |
148
- | ๐Ÿ‡ฎ๐Ÿ‡น Italiano | it |
149
-
150
- ## โš™๏ธ Automation
151
-
152
- Rounds are automatically finished every hour via GitHub Actions cron job โ€” no manual intervention needed.
110
+ | Blockchain | Celo Mainnet + Base Mainnet |
111
+ | Smart Contracts | Solidity 0.8.20/0.8.24 + OpenZeppelin |
112
+ | NFT Storage | Pinata IPFS |
113
+ | Frontend | Next.js 16 + TypeScript + TailwindCSS |
114
+ | Web3 | Wagmi + Viem + RainbowKit |
115
+ | AI | Groq API (LLaMA 3.1-8b-instant) NEW |
116
+ | i18n | next-intl (FR, EN, ES, IT) |
117
+ | Bot | discord.js v14 + ethers.js v6 |
118
+ | Bot Hosting | Railway (24/7) |
119
+ | Deploy | Vercel + GitHub Actions |
153
120
 
154
121
  ## ๐Ÿ› ๏ธ Local Setup
155
122
 
156
123
  ```bash
157
- # Clone
158
124
  git clone https://github.com/wkalidev/trivia-quest.git
159
125
  cd trivia-quest
160
126
 
161
127
  # Frontend
162
- cd frontend
163
- yarn install
164
- cp .env.example .env.local # puis remplis les valeurs
128
+ cd frontend && yarn install
129
+ # Add GROQ_API_KEY to .env.local
165
130
  yarn dev
166
131
 
132
+ # Bot
133
+ cd ../bot && npm install
134
+ # Add DISCORD_TOKEN, CLIENT_ID, GUILD_ID, GROQ_API_KEY to .env
135
+ npm run build && npm start
136
+
167
137
  # Contracts
168
- cd ../contracts
169
- npm install
138
+ cd ../contracts && npm install
170
139
  npx hardhat compile
171
140
  ```
172
141
 
173
- ## โš™๏ธ Environment Variables
174
-
175
- ```env
176
- NEXT_PUBLIC_TRIVQ_ADDRESS=0xf50afd22d5285f0398bf1be433252ce6a9fd9579
177
- NEXT_PUBLIC_GAME_ADDRESS=0x002570e6fee3e4f0ab1708a1e8b3aaf7d6a5578f
178
- NEXT_PUBLIC_CHECKIN_ADDRESS=0x12a76267fd15f013daaf4f20824295afa4ebcd91
179
- NEXT_PUBLIC_CHAIN_ID=42220
180
- ```
181
-
182
142
  ## ๐ŸŽฏ Proof of Ship Checklist
183
143
 
184
- - โœ… Build For MiniPay โ€” MiniPay hook integrated
185
- - โœ… Deploy On Celo โ€” Smart contracts on Celo Mainnet
186
- - โœ… $TRIVQ Token โ€” ERC20 reward token with 1B supply
187
- - โœ… NFT Badges โ€” 150 unique ERC-1155 badges on IPFS
188
- - โœ… Daily Check-in โ€” On-chain streak system with rewards
189
- - โœ… Protocol Fee โ€” 10% revenue on every round
190
- - โœ… Auto Round Management โ€” GitHub Actions cron
191
- - โœ… Prove Your Humanity โ€” Coinbase Verification
192
- - โœ… Submit Your Project
193
- โœ… Referral System โ€” 500 TRIVQ per referral
194
- - โœ… $TRIVQ Price Tracker โ€” live on Ubeswap
195
- - โœ… PWA Push Notifications
196
-
197
- ## ๐Ÿ“‹ Tech Stack
198
-
199
- | Layer | Tech |
200
- |---|---|
201
- | Blockchain | Celo Mainnet |
202
- | Smart Contracts | Solidity 0.8.20/0.8.24 + OpenZeppelin |
203
- | NFT Storage | Pinata IPFS |
204
- | Frontend | Next.js 16 + TypeScript |
205
- | Styling | TailwindCSS |
206
- | Animations | Framer Motion |
207
- | Web3 | Wagmi + Viem + RainbowKit |
208
- | i18n | next-intl |
209
- | Deploy | Vercel + GitHub Actions |
144
+ - Build For MiniPay
145
+ - Deploy On Celo (5 contracts)
146
+ - Deploy On Base (4 contracts)
147
+ - $TRIVQ Token ERC-20 verified
148
+ - 150 NFT Badges ERC-1155 on IPFS
149
+ - Daily Check-in on-chain
150
+ - Protocol Fee 10%
151
+ - Auto Round Management via cron
152
+ - Referral System
153
+ - $TRIVQ Price Tracker
154
+ - Liquidity Pool on Ubeswap v3
155
+ - PWA Push Notifications
156
+ - Public SDK on npm
157
+ - Farcaster Frame
158
+ - Dynamic OG image
159
+ - Score share card
160
+ - Public Stats API
161
+ - Discord Bot 24/7 on Railway
162
+ - Multi-chain Celo + Base
163
+ - Coinbase Verification
164
+ - Terms of Service + Privacy Policy
165
+ - ๐Ÿ†• AI Question Mode (Groq LLaMA 3.1)
166
+ - ๐Ÿ†• Trivia Duel 1v1 on-chain
167
+ - ๐Ÿ†• Discord AI Agent /ask /askcat
210
168
 
211
169
  ## ๐Ÿ‘ค Author
212
170
 
213
- Built with ๐Ÿ’™ by [@wkalidev](https://github.com/wkalidev) for Celo Proof of Ship โ€” April 2026
171
+ Built by [@wkalidev](https://github.com/wkalidev) โ€” zcodebase.eth
172
+
173
+ > Built for Celo Proof of Ship 2026
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wkalidev/trivia-quest-sdk",
3
- "version": "1.4.0",
3
+ "version": "2.0.0",
4
4
  "description": "TriviaQ SDK โ€” Interact with TriviaQ smart contracts โ€” Blockchain quiz game on Celo",
5
5
  "main": "sdk/index.js",
6
6
  "types": "sdk/index.d.ts",
package/sdk/README.md CHANGED
@@ -1,9 +1,10 @@
1
1
  # @wkalidev/trivia-quest-sdk
2
2
 
3
- > Official SDK for TriviaQ โ€” Blockchain quiz game on Celo Network
3
+ > Official SDK for TriviaQ โ€” Blockchain quiz game on Celo & Base Network
4
4
 
5
5
  [![npm version](https://badge.fury.io/js/%40wkalidev%2Ftrivia-quest-sdk.svg)](https://www.npmjs.com/package/@wkalidev/trivia-quest-sdk)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+ [![npm downloads](https://img.shields.io/npm/dm/@wkalidev/trivia-quest-sdk)](https://www.npmjs.com/package/@wkalidev/trivia-quest-sdk)
7
8
 
8
9
  ## Installation
9
10
 
@@ -15,82 +16,169 @@ yarn add @wkalidev/trivia-quest-sdk
15
16
 
16
17
  ## What's included
17
18
 
18
- - โœ… Contract addresses (Mainnet + Testnet)
19
- - โœ… Full ABIs (TRIVQ, TriviaQuest, DailyCheckIn, Referral)
20
- - โœ… TypeScript types
21
- - โœ… Chain ID constants
19
+ - โœ… Contract addresses (Celo Mainnet + Base Mainnet + Testnet)
20
+ - โœ… Full ABIs (TriviaQuest, TriviaDuel, TRIVQ Token)
21
+ - โœ… TypeScript types (`Round`, `Duel`, `DuelStatus`, `PlayerStats`, `LeaderboardEntry`)
22
+ - โœ… Multi-chain helper `getAddress(chainId, contract)`
23
+ - โœ… Score & streak utils (`getMultiplier`, `calculatePoints`, `getStreakLabel`)
24
+ - โœ… Duel utils (`formatWager`, `getDuelNetPrize`, `isDuelExpired`, `getDuelStatusLabel`)
25
+ - โœ… Format utils (`formatTrivq`, `formatCelo`, `formatAddress`)
26
+ - โœ… MiniPay detection (`isMiniPay`, `getMiniPayAccount`)
22
27
 
23
- ## Contracts (Celo Mainnet)
28
+ ---
29
+
30
+ ## Contracts
31
+
32
+ ### Celo Mainnet
24
33
 
25
34
  | Contract | Address |
26
35
  |---|---|
27
- | TriviaQToken ($TRIVQ) | `0xe65fc5cacaf9a5aebbc0e151dee08a53f24a05c5` |
28
- | TriviaQuest | `0xffe22d3d1b63866ac9da8ac92fdb9ceddeadb0bb` |
29
- | DailyCheckIn (ERC-1155) | `0x8650e6c477f8ae3933dc6d61d85e65c90cf71828` |
36
+ | TriviaQuest (Game) | `0xffe22d3d1b63866ac9da8ac92fdb9ceddeadb0bb` |
37
+ | TriviaDuel (1v1) ๐Ÿ†• | `0xee7be00cd5454b9bea56d864d82076b8b5de5ca1` |
38
+ | TRIVQ Token | `0xe65fc5cacaf9a5aebbc0e151dee08a53f24a05c5` |
39
+ | DailyCheckIn | `0x8650e6c477f8ae3933dc6d61d85e65c90cf71828` |
30
40
  | Referral | `0xa0fcd85a25ecb71ca1ea9d63da058c832c27c62e` |
31
41
 
32
- ## Contracts (Celo Sepolia Testnet)
42
+ ### Base Mainnet
33
43
 
34
44
  | Contract | Address |
35
45
  |---|---|
36
- | TriviaQToken ($TRIVQ) | `0xa829214ea492f32818efa2c58cc7e9090572c17c` |
37
- | TriviaQuest | `0xa93422cb14278ac5d1a6f60f95b03aa723e6448e` |
46
+ | TriviaQuest | `0x1e2c209412ec30915ccf922654f0593faf61fcfb` |
47
+ | TRIVQ Token | `0x8ecc1dc70f3bc5be941b61b42707eb7dbddb54c3` |
48
+ | DailyCheckIn | `0x0f19851d5cd905d110c000a7d26d74a2f21f8ff9` |
49
+ | Referral | `0x4fb5285263354e1e75f044c65166ab22c3840074` |
50
+
51
+ ---
38
52
 
39
53
  ## Usage
40
54
 
55
+ ### Basic โ€” Read game stats
56
+
41
57
  ```typescript
42
58
  import {
43
- TRIVQ_TOKEN_ADDRESS,
44
- TRIVIA_QUEST_ADDRESS,
45
- DAILY_CHECKIN_ADDRESS,
46
- REFERRAL_ADDRESS,
59
+ TRIVIA_QUEST_ADDRESS_CELO,
60
+ TRIVQ_TOKEN_ADDRESS_CELO,
61
+ CONTRACT_ABI,
47
62
  TRIVQ_ABI,
48
- TRIVIA_QUEST_ABI,
49
- DAILY_CHECKIN_ABI,
50
- REFERRAL_ABI,
51
- CELO_CHAIN_ID,
63
+ formatTrivq,
64
+ formatCelo,
52
65
  } from "@wkalidev/trivia-quest-sdk";
53
-
54
- // Use with viem
55
66
  import { createPublicClient, http } from "viem";
56
67
  import { celo } from "viem/chains";
57
68
 
58
- const client = createPublicClient({
59
- chain: celo,
60
- transport: http(),
61
- });
69
+ const client = createPublicClient({ chain: celo, transport: http() });
62
70
 
63
- // Read prize pool / current round
71
+ // Read current round
64
72
  const round = await client.readContract({
65
- address: TRIVIA_QUEST_ADDRESS,
66
- abi: TRIVIA_QUEST_ABI,
73
+ address: TRIVIA_QUEST_ADDRESS_CELO,
74
+ abi: CONTRACT_ABI,
67
75
  functionName: "getCurrentRound",
68
76
  });
77
+ console.log("Prize pool:", formatCelo(round.prizePool));
69
78
 
70
79
  // Read TRIVQ balance
71
80
  const balance = await client.readContract({
72
- address: TRIVQ_TOKEN_ADDRESS,
81
+ address: TRIVQ_TOKEN_ADDRESS_CELO,
73
82
  abi: TRIVQ_ABI,
74
83
  functionName: "balanceOf",
75
84
  args: ["0xYOUR_ADDRESS"],
76
85
  });
86
+ console.log("Balance:", formatTrivq(balance));
87
+ ```
77
88
 
78
- // Check daily check-in status
79
- const playerData = await client.readContract({
80
- address: DAILY_CHECKIN_ADDRESS,
81
- abi: DAILY_CHECKIN_ABI,
82
- functionName: "getPlayerData",
83
- args: ["0xYOUR_ADDRESS"],
89
+ ### Multi-chain โ€” Get address by chainId
90
+
91
+ ```typescript
92
+ import { getAddress } from "@wkalidev/trivia-quest-sdk";
93
+
94
+ const gameAddress = getAddress(42220, "game"); // Celo
95
+ const duelAddress = getAddress(42220, "duel"); // Celo
96
+ const gameBase = getAddress(8453, "game"); // Base
97
+ ```
98
+
99
+ ### Duel 1v1
100
+
101
+ ```typescript
102
+ import {
103
+ DUEL_ADDRESS_CELO,
104
+ DUEL_ABI,
105
+ formatWager,
106
+ getDuelNetPrize,
107
+ isDuelExpired,
108
+ getDuelStatusLabel,
109
+ DuelStatus,
110
+ } from "@wkalidev/trivia-quest-sdk";
111
+ import { createPublicClient, http } from "viem";
112
+ import { celo } from "viem/chains";
113
+
114
+ const client = createPublicClient({ chain: celo, transport: http() });
115
+
116
+ // Get open duels
117
+ const duels = await client.readContract({
118
+ address: DUEL_ADDRESS_CELO,
119
+ abi: DUEL_ABI,
120
+ functionName: "getOpenDuels",
121
+ args: [BigInt(10)],
84
122
  });
85
123
 
86
- // Get top 10 leaderboard
87
- const leaderboard = await client.readContract({
88
- address: TRIVIA_QUEST_ADDRESS,
89
- abi: TRIVIA_QUEST_ABI,
90
- functionName: "getLeaderboard",
124
+ // Format duel info
125
+ duels.forEach(duel => {
126
+ console.log(`Duel #${duel.id}`);
127
+ console.log("Wager:", formatWager(duel.wager));
128
+ console.log("Net prize:", formatWager(getDuelNetPrize(duel.wager)));
129
+ console.log("Status:", getDuelStatusLabel(duel.status));
130
+ console.log("Expired:", isDuelExpired(duel.expiresAt));
91
131
  });
92
132
  ```
93
133
 
134
+ ### Score & Streak
135
+
136
+ ```typescript
137
+ import {
138
+ getMultiplier,
139
+ calculatePoints,
140
+ getStreakLabel,
141
+ } from "@wkalidev/trivia-quest-sdk";
142
+
143
+ const streak = 4;
144
+ console.log(getMultiplier(streak)); // 2
145
+ console.log(calculatePoints(true, streak)); // 200
146
+ console.log(getStreakLabel(streak)); // "๐Ÿ”ฅ๐Ÿ”ฅ x2 HOT"
147
+ ```
148
+
149
+ ### MiniPay Detection
150
+
151
+ ```typescript
152
+ import { isMiniPay, getMiniPayAccount } from "@wkalidev/trivia-quest-sdk";
153
+
154
+ if (isMiniPay()) {
155
+ const account = await getMiniPayAccount();
156
+ console.log("MiniPay user:", account);
157
+ }
158
+ ```
159
+
160
+ ---
161
+
162
+ ## Types
163
+
164
+ ```typescript
165
+ import type {
166
+ Round,
167
+ Duel,
168
+ DuelStatus,
169
+ PlayerStats,
170
+ LeaderboardEntry,
171
+ } from "@wkalidev/trivia-quest-sdk";
172
+
173
+ // DuelStatus enum
174
+ // DuelStatus.Open = 0
175
+ // DuelStatus.Active = 1
176
+ // DuelStatus.Finished = 2
177
+ // DuelStatus.Cancelled = 3
178
+ ```
179
+
180
+ ---
181
+
94
182
  ## Reward Rates
95
183
 
96
184
  | Action | Reward |
@@ -99,6 +187,26 @@ const leaderboard = await client.readContract({
99
187
  | ๐Ÿ”ฅ Daily check-in | 100 TRIVQ |
100
188
  | ๐ŸŽ 7-day streak bonus | 2,000 TRIVQ |
101
189
  | ๐Ÿ”— Referral reward | 500 TRIVQ |
190
+ | โš”๏ธ Duel winner | 90% of total wager |
191
+
192
+ ---
193
+
194
+ ## Changelog
195
+
196
+ ### v2.0.0
197
+ - Added `DUEL_ABI` and `DUEL_ADDRESS_CELO` for TriviaDuel 1v1
198
+ - Added `BASE_MAINNET` contracts
199
+ - Added `getAddress(chainId, contract)` multi-chain helper
200
+ - Added duel utils: `formatWager`, `getDuelNetPrize`, `isDuelExpired`, `getDuelStatusLabel`
201
+ - Added format utils: `formatTrivq`, `formatCelo`, `formatAddress`
202
+ - Added `TRIVQ_ABI` full token ABI
203
+ - Added `DuelStatus` enum and `Duel` type
204
+ - Updated `Round` type with `topWinners` array
205
+
206
+ ### v1.4.0
207
+ - Initial public release
208
+
209
+ ---
102
210
 
103
211
  ## Live Demo
104
212
 
package/sdk/index.d.ts CHANGED
@@ -1,5 +1,55 @@
1
- export declare const CONTRACT_ADDRESS_MAINNET: "0xe7faded5157341911a99cae5c49ad4c1eeb1116a";
1
+ export declare const SDK_VERSION = "2.0.0";
2
+ export declare const TRIVIA_QUEST_ADDRESS_CELO: "0xffe22d3d1b63866ac9da8ac92fdb9ceddeadb0bb";
3
+ export declare const TRIVQ_TOKEN_ADDRESS_CELO: "0xe65fc5cacaf9a5aebbc0e151dee08a53f24a05c5";
4
+ export declare const CHECKIN_ADDRESS_CELO: "0x8650e6c477f8ae3933dc6d61d85e65c90cf71828";
5
+ export declare const REFERRAL_ADDRESS_CELO: "0xa0fcd85a25ecb71ca1ea9d63da058c832c27c62e";
6
+ export declare const DUEL_ADDRESS_CELO: "0xee7be00cd5454b9bea56d864d82076b8b5de5ca1";
7
+ export declare const TRIVIA_QUEST_ADDRESS_BASE: "0x1e2c209412ec30915ccf922654f0593faf61fcfb";
8
+ export declare const TRIVQ_TOKEN_ADDRESS_BASE: "0x8ecc1dc70f3bc5be941b61b42707eb7dbddb54c3";
9
+ export declare const CHECKIN_ADDRESS_BASE: "0x0f19851d5cd905d110c000a7d26d74a2f21f8ff9";
10
+ export declare const REFERRAL_ADDRESS_BASE: "0x4fb5285263354e1e75f044c65166ab22c3840074";
11
+ export declare const CONTRACT_ADDRESS_MAINNET: "0xffe22d3d1b63866ac9da8ac92fdb9ceddeadb0bb";
2
12
  export declare const CONTRACT_ADDRESS_TESTNET: "0x50b20728ba0ad803679b5428f267c89aede9a378";
13
+ export declare const CELO_MAINNET: {
14
+ id: number;
15
+ name: string;
16
+ rpcUrl: string;
17
+ explorerUrl: string;
18
+ contracts: {
19
+ game: "0xffe22d3d1b63866ac9da8ac92fdb9ceddeadb0bb";
20
+ token: "0xe65fc5cacaf9a5aebbc0e151dee08a53f24a05c5";
21
+ checkin: "0x8650e6c477f8ae3933dc6d61d85e65c90cf71828";
22
+ referral: "0xa0fcd85a25ecb71ca1ea9d63da058c832c27c62e";
23
+ duel: "0xee7be00cd5454b9bea56d864d82076b8b5de5ca1";
24
+ };
25
+ };
26
+ export declare const BASE_MAINNET: {
27
+ id: number;
28
+ name: string;
29
+ rpcUrl: string;
30
+ explorerUrl: string;
31
+ contracts: {
32
+ game: "0x1e2c209412ec30915ccf922654f0593faf61fcfb";
33
+ token: "0x8ecc1dc70f3bc5be941b61b42707eb7dbddb54c3";
34
+ checkin: "0x0f19851d5cd905d110c000a7d26d74a2f21f8ff9";
35
+ referral: "0x4fb5285263354e1e75f044c65166ab22c3840074";
36
+ duel: "";
37
+ };
38
+ };
39
+ export declare const CELO_TESTNET: {
40
+ id: number;
41
+ name: string;
42
+ rpcUrl: string;
43
+ explorerUrl: string;
44
+ contracts: {
45
+ game: "0x50b20728ba0ad803679b5428f267c89aede9a378";
46
+ token: "";
47
+ checkin: "";
48
+ referral: "";
49
+ duel: "0xd9456518d7acbe6bcab494aa5894ce4cdf7c5ad7";
50
+ };
51
+ };
52
+ export declare function getAddress(chainId: number, contract: "game" | "token" | "checkin" | "referral" | "duel"): `0x${string}`;
3
53
  export declare const CONTRACT_ABI: readonly [{
4
54
  readonly name: "joinRound";
5
55
  readonly type: "function";
@@ -26,8 +76,8 @@ export declare const CONTRACT_ABI: readonly [{
26
76
  readonly name: "endTime";
27
77
  readonly type: "uint256";
28
78
  }, {
29
- readonly name: "winner";
30
- readonly type: "address";
79
+ readonly name: "topWinners";
80
+ readonly type: "address[]";
31
81
  }, {
32
82
  readonly name: "finished";
33
83
  readonly type: "bool";
@@ -116,6 +166,190 @@ export declare const CONTRACT_ABI: readonly [{
116
166
  }];
117
167
  readonly outputs: readonly [];
118
168
  }];
169
+ export declare const DUEL_ABI: readonly [{
170
+ readonly name: "createDuel";
171
+ readonly type: "function";
172
+ readonly stateMutability: "payable";
173
+ readonly inputs: readonly [];
174
+ readonly outputs: readonly [{
175
+ readonly type: "uint256";
176
+ }];
177
+ }, {
178
+ readonly name: "joinDuel";
179
+ readonly type: "function";
180
+ readonly stateMutability: "payable";
181
+ readonly inputs: readonly [{
182
+ readonly name: "duelId";
183
+ readonly type: "uint256";
184
+ }];
185
+ readonly outputs: readonly [];
186
+ }, {
187
+ readonly name: "cancelExpiredDuel";
188
+ readonly type: "function";
189
+ readonly stateMutability: "nonpayable";
190
+ readonly inputs: readonly [{
191
+ readonly name: "duelId";
192
+ readonly type: "uint256";
193
+ }];
194
+ readonly outputs: readonly [];
195
+ }, {
196
+ readonly name: "getDuel";
197
+ readonly type: "function";
198
+ readonly stateMutability: "view";
199
+ readonly inputs: readonly [{
200
+ readonly name: "duelId";
201
+ readonly type: "uint256";
202
+ }];
203
+ readonly outputs: readonly [{
204
+ readonly type: "tuple";
205
+ readonly components: readonly [{
206
+ readonly name: "id";
207
+ readonly type: "uint256";
208
+ }, {
209
+ readonly name: "playerA";
210
+ readonly type: "address";
211
+ }, {
212
+ readonly name: "playerB";
213
+ readonly type: "address";
214
+ }, {
215
+ readonly name: "wager";
216
+ readonly type: "uint256";
217
+ }, {
218
+ readonly name: "scoreA";
219
+ readonly type: "uint256";
220
+ }, {
221
+ readonly name: "scoreB";
222
+ readonly type: "uint256";
223
+ }, {
224
+ readonly name: "scoreASubmitted";
225
+ readonly type: "bool";
226
+ }, {
227
+ readonly name: "scoreBSubmitted";
228
+ readonly type: "bool";
229
+ }, {
230
+ readonly name: "winner";
231
+ readonly type: "address";
232
+ }, {
233
+ readonly name: "status";
234
+ readonly type: "uint8";
235
+ }, {
236
+ readonly name: "createdAt";
237
+ readonly type: "uint256";
238
+ }, {
239
+ readonly name: "expiresAt";
240
+ readonly type: "uint256";
241
+ }];
242
+ }];
243
+ }, {
244
+ readonly name: "getOpenDuels";
245
+ readonly type: "function";
246
+ readonly stateMutability: "view";
247
+ readonly inputs: readonly [{
248
+ readonly name: "limit";
249
+ readonly type: "uint256";
250
+ }];
251
+ readonly outputs: readonly [{
252
+ readonly type: "tuple[]";
253
+ readonly components: readonly [{
254
+ readonly name: "id";
255
+ readonly type: "uint256";
256
+ }, {
257
+ readonly name: "playerA";
258
+ readonly type: "address";
259
+ }, {
260
+ readonly name: "playerB";
261
+ readonly type: "address";
262
+ }, {
263
+ readonly name: "wager";
264
+ readonly type: "uint256";
265
+ }, {
266
+ readonly name: "scoreA";
267
+ readonly type: "uint256";
268
+ }, {
269
+ readonly name: "scoreB";
270
+ readonly type: "uint256";
271
+ }, {
272
+ readonly name: "scoreASubmitted";
273
+ readonly type: "bool";
274
+ }, {
275
+ readonly name: "scoreBSubmitted";
276
+ readonly type: "bool";
277
+ }, {
278
+ readonly name: "winner";
279
+ readonly type: "address";
280
+ }, {
281
+ readonly name: "status";
282
+ readonly type: "uint8";
283
+ }, {
284
+ readonly name: "createdAt";
285
+ readonly type: "uint256";
286
+ }, {
287
+ readonly name: "expiresAt";
288
+ readonly type: "uint256";
289
+ }];
290
+ }];
291
+ }, {
292
+ readonly name: "getPlayerDuels";
293
+ readonly type: "function";
294
+ readonly stateMutability: "view";
295
+ readonly inputs: readonly [{
296
+ readonly name: "player";
297
+ readonly type: "address";
298
+ }];
299
+ readonly outputs: readonly [{
300
+ readonly type: "uint256[]";
301
+ }];
302
+ }, {
303
+ readonly name: "duelCounter";
304
+ readonly type: "function";
305
+ readonly stateMutability: "view";
306
+ readonly inputs: readonly [];
307
+ readonly outputs: readonly [{
308
+ readonly type: "uint256";
309
+ }];
310
+ }];
311
+ export declare const TRIVQ_ABI: readonly [{
312
+ readonly name: "balanceOf";
313
+ readonly type: "function";
314
+ readonly stateMutability: "view";
315
+ readonly inputs: readonly [{
316
+ readonly name: "account";
317
+ readonly type: "address";
318
+ }];
319
+ readonly outputs: readonly [{
320
+ readonly type: "uint256";
321
+ }];
322
+ }, {
323
+ readonly name: "transfer";
324
+ readonly type: "function";
325
+ readonly stateMutability: "nonpayable";
326
+ readonly inputs: readonly [{
327
+ readonly name: "to";
328
+ readonly type: "address";
329
+ }, {
330
+ readonly name: "amount";
331
+ readonly type: "uint256";
332
+ }];
333
+ readonly outputs: readonly [{
334
+ readonly type: "bool";
335
+ }];
336
+ }, {
337
+ readonly name: "totalSupply";
338
+ readonly type: "function";
339
+ readonly stateMutability: "view";
340
+ readonly inputs: readonly [];
341
+ readonly outputs: readonly [{
342
+ readonly type: "uint256";
343
+ }];
344
+ }, {
345
+ readonly name: "decimals";
346
+ readonly type: "function";
347
+ readonly stateMutability: "view";
348
+ readonly inputs: readonly [];
349
+ readonly outputs: readonly [{
350
+ readonly type: "uint8";
351
+ }];
352
+ }];
119
353
  export type LeaderboardEntry = {
120
354
  player: string;
121
355
  totalPoints: bigint;
@@ -135,27 +369,39 @@ export type Round = {
135
369
  prizePool: bigint;
136
370
  startTime: bigint;
137
371
  endTime: bigint;
138
- winner: string;
372
+ topWinners: string[];
139
373
  finished: boolean;
140
374
  };
141
- export declare function isMiniPay(): boolean;
142
- export declare function getMiniPayAccount(): Promise<string | null>;
375
+ export declare enum DuelStatus {
376
+ Open = 0,
377
+ Active = 1,
378
+ Finished = 2,
379
+ Cancelled = 3
380
+ }
381
+ export type Duel = {
382
+ id: bigint;
383
+ playerA: string;
384
+ playerB: string;
385
+ wager: bigint;
386
+ scoreA: bigint;
387
+ scoreB: bigint;
388
+ scoreASubmitted: boolean;
389
+ scoreBSubmitted: boolean;
390
+ winner: string;
391
+ status: DuelStatus;
392
+ createdAt: bigint;
393
+ expiresAt: bigint;
394
+ };
143
395
  export declare function getMultiplier(streak: number): number;
144
396
  export declare function calculatePoints(correct: boolean, streak: number): number;
145
397
  export declare function getStreakLabel(streak: number): string;
146
- export declare const CELO_MAINNET: {
147
- id: number;
148
- name: string;
149
- rpcUrl: string;
150
- explorerUrl: string;
151
- contractAddress: "0xe7faded5157341911a99cae5c49ad4c1eeb1116a";
152
- };
153
- export declare const CELO_TESTNET: {
154
- id: number;
155
- name: string;
156
- rpcUrl: string;
157
- explorerUrl: string;
158
- contractAddress: "0x50b20728ba0ad803679b5428f267c89aede9a378";
159
- };
160
- export declare const SDK_VERSION = "1.0.0";
398
+ export declare function getDuelStatusLabel(status: DuelStatus): string;
399
+ export declare function formatWager(wager: bigint): string;
400
+ export declare function getDuelNetPrize(wager: bigint, feeBps?: number): bigint;
401
+ export declare function isDuelExpired(expiresAt: bigint): boolean;
402
+ export declare function isMiniPay(): boolean;
403
+ export declare function getMiniPayAccount(): Promise<string | null>;
404
+ export declare function formatAddress(address: string): string;
405
+ export declare function formatTrivq(raw: bigint): string;
406
+ export declare function formatCelo(wei: bigint): string;
161
407
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../sdk-src/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,wBAAwB,EAAG,4CAAqD,CAAC;AAC9F,eAAO,MAAM,wBAAwB,EAAG,4CAAqD,CAAC;AAE9F,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwFf,CAAC;AAGX,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAA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MAAM,GAAG,MAAM,CAIjD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,SAAO,GAAG,MAAM,CAIpE;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAExD;AAID,wBAAgB,SAAS,IAAI,OAAO,CAGnC;AAUD,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAUhE;AAID,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAM/C;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAK9C"}
package/sdk/index.js CHANGED
@@ -1,15 +1,87 @@
1
1
  "use strict";
2
- // TriviaQuest SDK
3
- // Blockchain quiz game on Celo
2
+ // TriviaQuest SDK v2.0.0
3
+ // Blockchain quiz game on Celo & Base
4
+ // https://trivia-quest-eight.vercel.app
4
5
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.SDK_VERSION = exports.CELO_TESTNET = exports.CELO_MAINNET = exports.CONTRACT_ABI = exports.CONTRACT_ADDRESS_TESTNET = exports.CONTRACT_ADDRESS_MAINNET = void 0;
6
- exports.isMiniPay = isMiniPay;
7
- exports.getMiniPayAccount = getMiniPayAccount;
6
+ exports.DuelStatus = exports.TRIVQ_ABI = exports.DUEL_ABI = exports.CONTRACT_ABI = exports.CELO_TESTNET = exports.BASE_MAINNET = exports.CELO_MAINNET = exports.CONTRACT_ADDRESS_TESTNET = exports.CONTRACT_ADDRESS_MAINNET = exports.REFERRAL_ADDRESS_BASE = exports.CHECKIN_ADDRESS_BASE = exports.TRIVQ_TOKEN_ADDRESS_BASE = exports.TRIVIA_QUEST_ADDRESS_BASE = exports.DUEL_ADDRESS_CELO = exports.REFERRAL_ADDRESS_CELO = exports.CHECKIN_ADDRESS_CELO = exports.TRIVQ_TOKEN_ADDRESS_CELO = exports.TRIVIA_QUEST_ADDRESS_CELO = exports.SDK_VERSION = void 0;
7
+ exports.getAddress = getAddress;
8
8
  exports.getMultiplier = getMultiplier;
9
9
  exports.calculatePoints = calculatePoints;
10
10
  exports.getStreakLabel = getStreakLabel;
11
- exports.CONTRACT_ADDRESS_MAINNET = "0xe7faded5157341911a99cae5c49ad4c1eeb1116a";
11
+ exports.getDuelStatusLabel = getDuelStatusLabel;
12
+ exports.formatWager = formatWager;
13
+ exports.getDuelNetPrize = getDuelNetPrize;
14
+ exports.isDuelExpired = isDuelExpired;
15
+ exports.isMiniPay = isMiniPay;
16
+ exports.getMiniPayAccount = getMiniPayAccount;
17
+ exports.formatAddress = formatAddress;
18
+ exports.formatTrivq = formatTrivq;
19
+ exports.formatCelo = formatCelo;
20
+ exports.SDK_VERSION = "2.0.0";
21
+ // โ”€โ”€ Contract Addresses โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
22
+ // Celo Mainnet
23
+ exports.TRIVIA_QUEST_ADDRESS_CELO = "0xffe22d3d1b63866ac9da8ac92fdb9ceddeadb0bb";
24
+ exports.TRIVQ_TOKEN_ADDRESS_CELO = "0xe65fc5cacaf9a5aebbc0e151dee08a53f24a05c5";
25
+ exports.CHECKIN_ADDRESS_CELO = "0x8650e6c477f8ae3933dc6d61d85e65c90cf71828";
26
+ exports.REFERRAL_ADDRESS_CELO = "0xa0fcd85a25ecb71ca1ea9d63da058c832c27c62e";
27
+ exports.DUEL_ADDRESS_CELO = "0xee7be00cd5454b9bea56d864d82076b8b5de5ca1";
28
+ // Base Mainnet
29
+ exports.TRIVIA_QUEST_ADDRESS_BASE = "0x1e2c209412ec30915ccf922654f0593faf61fcfb";
30
+ exports.TRIVQ_TOKEN_ADDRESS_BASE = "0x8ecc1dc70f3bc5be941b61b42707eb7dbddb54c3";
31
+ exports.CHECKIN_ADDRESS_BASE = "0x0f19851d5cd905d110c000a7d26d74a2f21f8ff9";
32
+ exports.REFERRAL_ADDRESS_BASE = "0x4fb5285263354e1e75f044c65166ab22c3840074";
33
+ // Legacy exports (backwards compatibility)
34
+ exports.CONTRACT_ADDRESS_MAINNET = exports.TRIVIA_QUEST_ADDRESS_CELO;
12
35
  exports.CONTRACT_ADDRESS_TESTNET = "0x50b20728ba0ad803679b5428f267c89aede9a378";
36
+ // โ”€โ”€ Network Config โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
37
+ exports.CELO_MAINNET = {
38
+ id: 42220,
39
+ name: "Celo Mainnet",
40
+ rpcUrl: "https://forno.celo.org",
41
+ explorerUrl: "https://celoscan.io",
42
+ contracts: {
43
+ game: exports.TRIVIA_QUEST_ADDRESS_CELO,
44
+ token: exports.TRIVQ_TOKEN_ADDRESS_CELO,
45
+ checkin: exports.CHECKIN_ADDRESS_CELO,
46
+ referral: exports.REFERRAL_ADDRESS_CELO,
47
+ duel: exports.DUEL_ADDRESS_CELO,
48
+ },
49
+ };
50
+ exports.BASE_MAINNET = {
51
+ id: 8453,
52
+ name: "Base Mainnet",
53
+ rpcUrl: "https://mainnet.base.org",
54
+ explorerUrl: "https://basescan.org",
55
+ contracts: {
56
+ game: exports.TRIVIA_QUEST_ADDRESS_BASE,
57
+ token: exports.TRIVQ_TOKEN_ADDRESS_BASE,
58
+ checkin: exports.CHECKIN_ADDRESS_BASE,
59
+ referral: exports.REFERRAL_ADDRESS_BASE,
60
+ duel: "",
61
+ },
62
+ };
63
+ exports.CELO_TESTNET = {
64
+ id: 11142220,
65
+ name: "Celo Sepolia",
66
+ rpcUrl: "https://forno.celo-sepolia.celo-testnet.org",
67
+ explorerUrl: "https://sepolia.celoscan.io",
68
+ contracts: {
69
+ game: exports.CONTRACT_ADDRESS_TESTNET,
70
+ token: "",
71
+ checkin: "",
72
+ referral: "",
73
+ duel: "0xd9456518d7acbe6bcab494aa5894ce4cdf7c5ad7",
74
+ },
75
+ };
76
+ // โ”€โ”€ Helper: get contract address by chainId โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
77
+ function getAddress(chainId, contract) {
78
+ if (chainId === 42220)
79
+ return exports.CELO_MAINNET.contracts[contract];
80
+ if (chainId === 8453)
81
+ return exports.BASE_MAINNET.contracts[contract];
82
+ return exports.CELO_TESTNET.contracts[contract];
83
+ }
84
+ // โ”€โ”€ TriviaQuest ABI โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
13
85
  exports.CONTRACT_ABI = [
14
86
  {
15
87
  name: "joinRound",
@@ -31,7 +103,7 @@ exports.CONTRACT_ABI = [
31
103
  { name: "prizePool", type: "uint256" },
32
104
  { name: "startTime", type: "uint256" },
33
105
  { name: "endTime", type: "uint256" },
34
- { name: "winner", type: "address" },
106
+ { name: "topWinners", type: "address[]" },
35
107
  { name: "finished", type: "bool" },
36
108
  ],
37
109
  },
@@ -99,6 +171,180 @@ exports.CONTRACT_ABI = [
99
171
  outputs: [],
100
172
  },
101
173
  ];
174
+ // โ”€โ”€ TriviaDuel ABI โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
175
+ exports.DUEL_ABI = [
176
+ {
177
+ name: "createDuel",
178
+ type: "function",
179
+ stateMutability: "payable",
180
+ inputs: [],
181
+ outputs: [{ type: "uint256" }],
182
+ },
183
+ {
184
+ name: "joinDuel",
185
+ type: "function",
186
+ stateMutability: "payable",
187
+ inputs: [{ name: "duelId", type: "uint256" }],
188
+ outputs: [],
189
+ },
190
+ {
191
+ name: "cancelExpiredDuel",
192
+ type: "function",
193
+ stateMutability: "nonpayable",
194
+ inputs: [{ name: "duelId", type: "uint256" }],
195
+ outputs: [],
196
+ },
197
+ {
198
+ name: "getDuel",
199
+ type: "function",
200
+ stateMutability: "view",
201
+ inputs: [{ name: "duelId", type: "uint256" }],
202
+ outputs: [
203
+ {
204
+ type: "tuple",
205
+ components: [
206
+ { name: "id", type: "uint256" },
207
+ { name: "playerA", type: "address" },
208
+ { name: "playerB", type: "address" },
209
+ { name: "wager", type: "uint256" },
210
+ { name: "scoreA", type: "uint256" },
211
+ { name: "scoreB", type: "uint256" },
212
+ { name: "scoreASubmitted", type: "bool" },
213
+ { name: "scoreBSubmitted", type: "bool" },
214
+ { name: "winner", type: "address" },
215
+ { name: "status", type: "uint8" },
216
+ { name: "createdAt", type: "uint256" },
217
+ { name: "expiresAt", type: "uint256" },
218
+ ],
219
+ },
220
+ ],
221
+ },
222
+ {
223
+ name: "getOpenDuels",
224
+ type: "function",
225
+ stateMutability: "view",
226
+ inputs: [{ name: "limit", type: "uint256" }],
227
+ outputs: [
228
+ {
229
+ type: "tuple[]",
230
+ components: [
231
+ { name: "id", type: "uint256" },
232
+ { name: "playerA", type: "address" },
233
+ { name: "playerB", type: "address" },
234
+ { name: "wager", type: "uint256" },
235
+ { name: "scoreA", type: "uint256" },
236
+ { name: "scoreB", type: "uint256" },
237
+ { name: "scoreASubmitted", type: "bool" },
238
+ { name: "scoreBSubmitted", type: "bool" },
239
+ { name: "winner", type: "address" },
240
+ { name: "status", type: "uint8" },
241
+ { name: "createdAt", type: "uint256" },
242
+ { name: "expiresAt", type: "uint256" },
243
+ ],
244
+ },
245
+ ],
246
+ },
247
+ {
248
+ name: "getPlayerDuels",
249
+ type: "function",
250
+ stateMutability: "view",
251
+ inputs: [{ name: "player", type: "address" }],
252
+ outputs: [{ type: "uint256[]" }],
253
+ },
254
+ {
255
+ name: "duelCounter",
256
+ type: "function",
257
+ stateMutability: "view",
258
+ inputs: [],
259
+ outputs: [{ type: "uint256" }],
260
+ },
261
+ ];
262
+ // โ”€โ”€ TRIVQ Token ABI โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
263
+ exports.TRIVQ_ABI = [
264
+ {
265
+ name: "balanceOf",
266
+ type: "function",
267
+ stateMutability: "view",
268
+ inputs: [{ name: "account", type: "address" }],
269
+ outputs: [{ type: "uint256" }],
270
+ },
271
+ {
272
+ name: "transfer",
273
+ type: "function",
274
+ stateMutability: "nonpayable",
275
+ inputs: [
276
+ { name: "to", type: "address" },
277
+ { name: "amount", type: "uint256" },
278
+ ],
279
+ outputs: [{ type: "bool" }],
280
+ },
281
+ {
282
+ name: "totalSupply",
283
+ type: "function",
284
+ stateMutability: "view",
285
+ inputs: [],
286
+ outputs: [{ type: "uint256" }],
287
+ },
288
+ {
289
+ name: "decimals",
290
+ type: "function",
291
+ stateMutability: "view",
292
+ inputs: [],
293
+ outputs: [{ type: "uint8" }],
294
+ },
295
+ ];
296
+ var DuelStatus;
297
+ (function (DuelStatus) {
298
+ DuelStatus[DuelStatus["Open"] = 0] = "Open";
299
+ DuelStatus[DuelStatus["Active"] = 1] = "Active";
300
+ DuelStatus[DuelStatus["Finished"] = 2] = "Finished";
301
+ DuelStatus[DuelStatus["Cancelled"] = 3] = "Cancelled";
302
+ })(DuelStatus || (exports.DuelStatus = DuelStatus = {}));
303
+ // โ”€โ”€ Score & Streak Utils โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
304
+ function getMultiplier(streak) {
305
+ if (streak >= 5)
306
+ return 3;
307
+ if (streak >= 3)
308
+ return 2;
309
+ return 1;
310
+ }
311
+ function calculatePoints(correct, streak) {
312
+ if (!correct)
313
+ return 0;
314
+ return 100 * getMultiplier(streak + 1);
315
+ }
316
+ function getStreakLabel(streak) {
317
+ if (streak >= 5)
318
+ return "๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ x3 MEGA";
319
+ if (streak >= 3)
320
+ return "๐Ÿ”ฅ๐Ÿ”ฅ x2 HOT";
321
+ if (streak >= 1)
322
+ return "๐Ÿ”ฅ Streak";
323
+ return "";
324
+ }
325
+ // โ”€โ”€ Duel Utils โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
326
+ function getDuelStatusLabel(status) {
327
+ switch (status) {
328
+ case DuelStatus.Open: return "Open";
329
+ case DuelStatus.Active: return "Active";
330
+ case DuelStatus.Finished: return "Finished";
331
+ case DuelStatus.Cancelled: return "Cancelled";
332
+ }
333
+ }
334
+ function formatWager(wager) {
335
+ const n = Number(wager) / 1e18;
336
+ if (n < 0.001)
337
+ return "<0.001 CELO";
338
+ return `${n.toFixed(3)} CELO`;
339
+ }
340
+ function getDuelNetPrize(wager, feeBps = 1000) {
341
+ const total = wager * BigInt(2);
342
+ const fee = (total * BigInt(feeBps)) / BigInt(10000);
343
+ return total - fee;
344
+ }
345
+ function isDuelExpired(expiresAt) {
346
+ return Date.now() / 1000 > Number(expiresAt);
347
+ }
102
348
  // โ”€โ”€ MiniPay Utils โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
103
349
  function isMiniPay() {
104
350
  if (typeof window === "undefined")
@@ -119,42 +365,26 @@ async function getMiniPayAccount() {
119
365
  return null;
120
366
  }
121
367
  }
122
- // โ”€โ”€ Score Utils โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
123
- function getMultiplier(streak) {
124
- if (streak >= 5)
125
- return 3;
126
- if (streak >= 3)
127
- return 2;
128
- return 1;
368
+ // โ”€โ”€ Format Utils โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
369
+ function formatAddress(address) {
370
+ return `${address.slice(0, 6)}...${address.slice(-4)}`;
129
371
  }
130
- function calculatePoints(correct, streak) {
131
- if (!correct)
132
- return 0;
133
- return 100 * getMultiplier(streak + 1);
372
+ function formatTrivq(raw) {
373
+ const n = Number(raw) / 1e18;
374
+ if (n >= 1000000000)
375
+ return `${(n / 1000000000).toFixed(1)}B`;
376
+ if (n >= 1000000)
377
+ return `${(n / 1000000).toFixed(1)}M`;
378
+ if (n >= 1000)
379
+ return `${(n / 1000).toFixed(1)}K`;
380
+ return n.toFixed(0);
134
381
  }
135
- function getStreakLabel(streak) {
136
- if (streak >= 5)
137
- return "๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ x3 MEGA";
138
- if (streak >= 3)
139
- return "๐Ÿ”ฅ๐Ÿ”ฅ x2 HOT";
140
- if (streak >= 1)
141
- return "๐Ÿ”ฅ Streak";
142
- return "";
382
+ function formatCelo(wei) {
383
+ const n = Number(wei) / 1e18;
384
+ if (n === 0)
385
+ return "0";
386
+ if (n < 0.001)
387
+ return "<0.001";
388
+ return n.toFixed(3);
143
389
  }
144
- // โ”€โ”€ Network Config โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
145
- exports.CELO_MAINNET = {
146
- id: 42220,
147
- name: "Celo Mainnet",
148
- rpcUrl: "https://forno.celo.org",
149
- explorerUrl: "https://celoscan.io",
150
- contractAddress: exports.CONTRACT_ADDRESS_MAINNET,
151
- };
152
- exports.CELO_TESTNET = {
153
- id: 11142220,
154
- name: "Celo Sepolia",
155
- rpcUrl: "https://forno.celo-sepolia.celo-testnet.org",
156
- explorerUrl: "https://sepolia.celoscan.io",
157
- contractAddress: exports.CONTRACT_ADDRESS_TESTNET,
158
- };
159
- exports.SDK_VERSION = "1.0.0";
160
390
  //# sourceMappingURL=index.js.map
package/sdk/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../sdk-src/index.ts"],"names":[],"mappings":";AAAA,kBAAkB;AAClB,+BAA+B;;;AA0H/B,8BAGC;AAUD,8CAUC;AAGD,sCAIC;AAED,0CAGC;A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C;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,8DAA8D;AAE9D,SAAgB,aAAa,CAAC,OAAe;IAC3C,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACzD,CAAC;AAED,SAAgB,WAAW,CAAC,GAAW;IACrC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IAC7B,IAAI,CAAC,IAAI,UAAa;QAAE,OAAO,GAAG,CAAC,CAAC,GAAG,UAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;IACpE,IAAI,CAAC,IAAI,OAAS;QAAM,OAAO,GAAG,CAAC,CAAC,GAAG,OAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;IAChE,IAAI,CAAC,IAAI,IAAK;QAAU,OAAO,GAAG,CAAC,CAAC,GAAG,IAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;IAC5D,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC;AAED,SAAgB,UAAU,CAAC,GAAW;IACpC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IAC7B,IAAI,CAAC,KAAK,CAAC;QAAM,OAAO,GAAG,CAAC;IAC5B,IAAI,CAAC,GAAG,KAAK;QAAI,OAAO,QAAQ,CAAC;IACjC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC"}
package/sdk/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wkalidev/trivia-quest-sdk",
3
- "version": "1.4.0",
3
+ "version": "2.0.0",
4
4
  "description": "TriviaQ SDK โ€” Interact with TriviaQ smart contracts โ€” Blockchain quiz game on Celo",
5
5
  "main": "sdk/index.js",
6
6
  "types": "sdk/index.d.ts",