npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wkalidev/trivia-quest-sdk

v2.1.0

Published

TriviaQ SDK — Interact with TriviaQ smart contracts — Blockchain quiz game on Celo

Readme

@wkalidev/trivia-quest-sdk

Official SDK for TriviaQ — Blockchain quiz game on Celo & Base Network

npm version License: MIT npm downloads

Installation

npm install @wkalidev/trivia-quest-sdk
# or
yarn add @wkalidev/trivia-quest-sdk

What's included

  • ✅ Contract addresses (Celo Mainnet + Base Mainnet + Testnet)
  • ✅ Full ABIs (TriviaQuest, TriviaDuel, TRIVQ Token)
  • ✅ TypeScript types (Round, Duel, DuelStatus, PlayerStats, LeaderboardEntry)
  • ✅ Multi-chain helper getAddress(chainId, contract)
  • ✅ Score & streak utils (getMultiplier, calculatePoints, getStreakLabel)
  • ✅ Duel utils (formatWager, getDuelNetPrize, isDuelExpired, getDuelStatusLabel)
  • ✅ Format utils (formatTrivq, formatCelo, formatAddress)
  • ✅ MiniPay detection (isMiniPay, getMiniPayAccount)

Contracts

Celo Mainnet

| Contract | Address | |---|---| | TriviaQuest (Game) | 0xffe22d3d1b63866ac9da8ac92fdb9ceddeadb0bb | | TriviaDuel (1v1) 🆕 | 0xee7be00cd5454b9bea56d864d82076b8b5de5ca1 | | TRIVQ Token | 0xe65fc5cacaf9a5aebbc0e151dee08a53f24a05c5 | | DailyCheckIn | 0x8650e6c477f8ae3933dc6d61d85e65c90cf71828 | | Referral | 0xa0fcd85a25ecb71ca1ea9d63da058c832c27c62e |

Base Mainnet

| Contract | Address | |---|---| | TriviaQuest | 0x1e2c209412ec30915ccf922654f0593faf61fcfb | | TRIVQ Token | 0x8ecc1dc70f3bc5be941b61b42707eb7dbddb54c3 | | DailyCheckIn | 0x0f19851d5cd905d110c000a7d26d74a2f21f8ff9 | | Referral | 0x4fb5285263354e1e75f044c65166ab22c3840074 |


Usage

Basic — Read game stats

import {
  TRIVIA_QUEST_ADDRESS_CELO,
  TRIVQ_TOKEN_ADDRESS_CELO,
  CONTRACT_ABI,
  TRIVQ_ABI,
  formatTrivq,
  formatCelo,
} from "@wkalidev/trivia-quest-sdk";
import { createPublicClient, http } from "viem";
import { celo } from "viem/chains";

const client = createPublicClient({ chain: celo, transport: http() });

// Read current round
const round = await client.readContract({
  address: TRIVIA_QUEST_ADDRESS_CELO,
  abi: CONTRACT_ABI,
  functionName: "getCurrentRound",
});
console.log("Prize pool:", formatCelo(round.prizePool));

// Read TRIVQ balance
const balance = await client.readContract({
  address: TRIVQ_TOKEN_ADDRESS_CELO,
  abi: TRIVQ_ABI,
  functionName: "balanceOf",
  args: ["0xYOUR_ADDRESS"],
});
console.log("Balance:", formatTrivq(balance));

Multi-chain — Get address by chainId

import { getAddress } from "@wkalidev/trivia-quest-sdk";

const gameAddress = getAddress(42220, "game");  // Celo
const duelAddress = getAddress(42220, "duel");  // Celo
const gameBase    = getAddress(8453,  "game");  // Base

Duel 1v1

import {
  DUEL_ADDRESS_CELO,
  DUEL_ABI,
  formatWager,
  getDuelNetPrize,
  isDuelExpired,
  getDuelStatusLabel,
  DuelStatus,
} from "@wkalidev/trivia-quest-sdk";
import { createPublicClient, http } from "viem";
import { celo } from "viem/chains";

const client = createPublicClient({ chain: celo, transport: http() });

// Get open duels
const duels = await client.readContract({
  address: DUEL_ADDRESS_CELO,
  abi: DUEL_ABI,
  functionName: "getOpenDuels",
  args: [BigInt(10)],
});

// Format duel info
duels.forEach(duel => {
  console.log(`Duel #${duel.id}`);
  console.log("Wager:", formatWager(duel.wager));
  console.log("Net prize:", formatWager(getDuelNetPrize(duel.wager)));
  console.log("Status:", getDuelStatusLabel(duel.status));
  console.log("Expired:", isDuelExpired(duel.expiresAt));
});

Score & Streak

import {
  getMultiplier,
  calculatePoints,
  getStreakLabel,
} from "@wkalidev/trivia-quest-sdk";

const streak = 4;
console.log(getMultiplier(streak));        // 2
console.log(calculatePoints(true, streak)); // 200
console.log(getStreakLabel(streak));        // "🔥🔥 x2 HOT"

MiniPay Detection

import { isMiniPay, getMiniPayAccount } from "@wkalidev/trivia-quest-sdk";

if (isMiniPay()) {
  const account = await getMiniPayAccount();
  console.log("MiniPay user:", account);
}

Types

import type {
  Round,
  Duel,
  DuelStatus,
  PlayerStats,
  LeaderboardEntry,
} from "@wkalidev/trivia-quest-sdk";

// DuelStatus enum
// DuelStatus.Open      = 0
// DuelStatus.Active    = 1
// DuelStatus.Finished  = 2
// DuelStatus.Cancelled = 3

Reward Rates

| Action | Reward | |---|---| | 🎮 Per point scored | 100 TRIVQ | | 🔥 Daily check-in | 100 TRIVQ | | 🎁 7-day streak bonus | 2,000 TRIVQ | | 🔗 Referral reward | 500 TRIVQ | | ⚔️ Duel winner | 90% of total wager |


Changelog

v2.0.0

  • Added DUEL_ABI and DUEL_ADDRESS_CELO for TriviaDuel 1v1
  • Added BASE_MAINNET contracts
  • Added getAddress(chainId, contract) multi-chain helper
  • Added duel utils: formatWager, getDuelNetPrize, isDuelExpired, getDuelStatusLabel
  • Added format utils: formatTrivq, formatCelo, formatAddress
  • Added TRIVQ_ABI full token ABI
  • Added DuelStatus enum and Duel type
  • Updated Round type with topWinners array

v1.4.0

  • Initial public release

Live Demo

👉 trivia-quest-eight.vercel.app

Author

Built with 💙 by @wkalidev