@wkalidev/trivia-quest-sdk 1.2.0 → 1.3.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.
Files changed (2) hide show
  1. package/README.md +88 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,88 @@
1
+ # @wkalidev/trivia-quest-sdk
2
+
3
+ > Official SDK for TriviaQ — Blockchain quiz game on Celo Network
4
+
5
+ [![npm version](https://badge.fury.io/js/%40wkalidev%2Ftrivia-quest-sdk.svg)](https://www.npmjs.com/package/@wkalidev/trivia-quest-sdk)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install @wkalidev/trivia-quest-sdk
12
+ # or
13
+ yarn add @wkalidev/trivia-quest-sdk
14
+ ```
15
+
16
+ ## Contracts (Celo Mainnet)
17
+
18
+ | Contract | Address |
19
+ |---|---|
20
+ | TriviaQToken ($TRIVQ) | `0xe65fc5cacaf9a5aebbc0e151dee08a53f24a05c5` |
21
+ | TriviaQuest | `0xffe22d3d1b63866ac9da8ac92fdb9ceddeadb0bb` |
22
+ | DailyCheckIn (ERC-1155) | `0x8650e6c477f8ae3933dc6d61d85e65c90cf71828` |
23
+ | Referral | `0xa0fcd85a25ecb71ca1ea9d63da058c832c27c62e` |
24
+
25
+ ## Usage
26
+
27
+ ```typescript
28
+ import {
29
+ TRIVQ_TOKEN_ADDRESS,
30
+ TRIVIA_QUEST_ADDRESS,
31
+ DAILY_CHECKIN_ADDRESS,
32
+ REFERRAL_ADDRESS,
33
+ TRIVQ_ABI,
34
+ TRIVIA_QUEST_ABI,
35
+ DAILY_CHECKIN_ABI,
36
+ REFERRAL_ABI,
37
+ CELO_CHAIN_ID,
38
+ } from "@wkalidev/trivia-quest-sdk";
39
+
40
+ // Use with viem
41
+ import { createPublicClient, http } from "viem";
42
+ import { celo } from "viem/chains";
43
+
44
+ const client = createPublicClient({
45
+ chain: celo,
46
+ transport: http(),
47
+ });
48
+
49
+ // Read prize pool
50
+ const round = await client.readContract({
51
+ address: TRIVIA_QUEST_ADDRESS,
52
+ abi: TRIVIA_QUEST_ABI,
53
+ functionName: "getCurrentRound",
54
+ });
55
+
56
+ // Read TRIVQ balance
57
+ const balance = await client.readContract({
58
+ address: TRIVQ_TOKEN_ADDRESS,
59
+ abi: TRIVQ_ABI,
60
+ functionName: "balanceOf",
61
+ args: ["0xYOUR_ADDRESS"],
62
+ });
63
+
64
+ // Check daily check-in status
65
+ const playerData = await client.readContract({
66
+ address: DAILY_CHECKIN_ADDRESS,
67
+ abi: DAILY_CHECKIN_ABI,
68
+ functionName: "getPlayerData",
69
+ args: ["0xYOUR_ADDRESS"],
70
+ });
71
+ ```
72
+
73
+ ## Reward Rates
74
+
75
+ | Action | Reward |
76
+ |---|---|
77
+ | 🎮 Per point scored | 100 TRIVQ |
78
+ | 🔥 Daily check-in | 100 TRIVQ |
79
+ | 🎁 7-day streak bonus | 2,000 TRIVQ |
80
+ | 🔗 Referral reward | 500 TRIVQ |
81
+
82
+ ## Live Demo
83
+
84
+ 👉 [trivia-quest-eight.vercel.app](https://trivia-quest-eight.vercel.app)
85
+
86
+ ## Author
87
+
88
+ Built with 💙 by [@wkalidev](https://github.com/wkalidev)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wkalidev/trivia-quest-sdk",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "TriviaQ SDK — Interact with TriviaQ smart - Blockchain quiz game on Celo",
5
5
  "main": "sdk/index.js",
6
6
  "types": "sdk/index.d.ts",