diff --git a/src/app/(dashboard)/home/page.tsx b/src/app/(dashboard)/home/page.tsx index 85c9dea..4fe8f90 100644 --- a/src/app/(dashboard)/home/page.tsx +++ b/src/app/(dashboard)/home/page.tsx @@ -10,7 +10,7 @@ import { LeadBoardCard } from '@/components/cards/leadboard-card'; // import { getApi } from '@/lib/polkadot'; // import { web3Enable, web3FromAddress } from '@polkadot/extension-dapp'; import LiveGamePlay from './_components/live-game-container'; -import { getAvailableNFTs, getUserData } from '@/lib/queries'; +import { getUserData } from '@/lib/queries'; import ProfileHeader from './_components/profile-header'; import { useSubstrateContext } from '@/context/polkadot-contex'; import { useEffect, useState } from 'react'; diff --git a/src/lib/queries.ts b/src/lib/queries.ts index 5d0a42a..53b9fd6 100644 --- a/src/lib/queries.ts +++ b/src/lib/queries.ts @@ -48,3 +48,75 @@ export async function getListings() { const output = result.toHuman(); return output; } + +export async function getGamesExpiring(gameId: number) { + const api = await getApi(); + const result = await api.query.gameModule.gamesExpiring(gameId); + const output = result.toHuman(); + return output; +} + +export async function getNextColorId(id: number) { + const api = await getApi(); + const result = await api.query.gameModule.nextColorId(id); + const output = result.toHuman(); + return output; +} + +export async function getNextListingId() { + const api = await getApi(); + const result = await api.query.gameModule.nextListingId(); + const output = result.toHuman(); + return output; +} +export async function getNextOfferId(){ + const api = await getApi(); + const result = await api.query.gameModule.nextOfferId(); + const output = result.toHuman(); + return output; +} + +export async function getOffers(id: number) { + const api = await getApi(); + const result = await api.query.gameModule.offers(id); + const output = result.toHuman(); + return +} + + +export async function getPalletVersion() { + const api = await getApi(); + const result = await api.query.gameModule.palletVersion(); + const output = result.toHuman(); + return output; +} + +export async function isRoundActive(){ + const api = await getApi(); + const result = await api.query.gameModule.roundActive(); + const output = result.toHuman(); + return output; +} + + +export async function getRoundChampion(id: number){ + const api = await getApi(); + const result = await api.query.gameModule.roundChampion(id); + const output = result.toHuman(); + return output; +} + +export async function getGameProperties(){ + const api = await getApi(); + const result = await api.query.gameModule.gameProperties(); + const output = result.toHuman(); + return output; +} + +export async function getCollectionColor(id: number){ + const api = await getApi(); + const result = await api.query.gameModule.collectionColor(id); + const output = result.toHuman(); + return output; +} +