Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4 from XcavateBlockchain/nikku-wrappers
Browse files Browse the repository at this point in the history
Nikku wrappers
  • Loading branch information
izaakwalz authored Jun 28, 2024
2 parents 15d6794 + 3aa5704 commit eed048b
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/(dashboard)/home/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
72 changes: 72 additions & 0 deletions src/lib/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit eed048b

Please sign in to comment.