Get Formatted Leaderboard

Fetches and formats the leaderboard with ranks for a specific tournament.

getFormattedLeaderboard

Fetches and formats the leaderboard with ranks for a specific tournament.

Syntax

getFormattedLeaderboard(tournamentID, userAddress)

Parameters

  • tournamentID: ID of the tournament.

  • userAddress (optional): Address of the user to highlight their rank.

Returns

  • Array: Leaderboard data with ranks and statistics.

Example

const leaderboard = await sdk.getFormattedLeaderboard(1, "0xUser...");
console.log(leaderboard);

Sample Return

[
  {
    "rank": 1,
    "address": "0x123...",
    "data": [30, 10, 5000]
  },
  {
    "rank": 2,
    "address": "0x456...",
    "data": [25, 8, 4500]
  }
]

Last updated