Skip to main content

Seasonal Competitions

Methods for working with seasonal competitions.

getCurrentSeason

Gets the current active season.
async getCurrentSeason(): Promise<Season>

Returns

Season object containing season details.

Example

const season = await sdk.getCurrentSeason();
console.log('Prize pool:', season.totalPrizePool);
console.log('Winners count:', season.winnersCount);

getCurrentSeasonId

Gets the ID of the current season.
async getCurrentSeasonId(): Promise<number>

Returns

number - Current season ID.

Example

const seasonId = await sdk.getCurrentSeasonId();
console.log('Current season ID:', seasonId);

getSeason

Gets details for a specific season.
async getSeason(seasonId: number): Promise<Season>

Parameters

NameTypeDescription
seasonIdnumberID of the season

Returns

Season object containing season details.

Example

const season = await sdk.getSeason(1);
console.log('Season name:', season.name);

getSeasonUserStats

Gets a user’s stats for a specific season.
async getSeasonUserStats(seasonId: number, userAddress: Address): Promise<SeasonUserStats>

Parameters

NameTypeDescription
seasonIdnumberID of the season
userAddressAddressAddress of the user

Returns

SeasonUserStats object containing user season stats.

Example

const seasonId = await sdk.getCurrentSeasonId();
const userStats = await sdk.getSeasonUserStats(seasonId, '0x1234...');
console.log('Season referrals:', userStats.referrals);
console.log('Season earnings:', userStats.earnings);

listSeasons

Lists all seasons.
async listSeasons(): Promise<Season[]>

Returns

Array of Season objects.

Example

const seasons = await sdk.listSeasons();
console.log('Total seasons:', seasons.length);

getSeasonCount

Gets the total number of seasons.
async getSeasonCount(): Promise<number>

Returns

number - Total season count.

Example

const count = await sdk.getSeasonCount();
console.log('Total seasons:', count);