githubEdit

Get Wander tier info

Wander Injected API getWanderTierInfo() function

Some applications may request access to the Wander tier information of the user. The getWanderTierInfo() function returns detailed information about the user's tier, balance, rank, and other related metrics in the Wander ecosystem.

circle-info

Note: This function requires the ACCESS_ADDRESS permission.

Result

The getWanderTierInfo() function returns an object containing comprehensive tier information for the user.

circle-exclamation
type Tier = "Prime" | "Edge" | "Reserve" | "Select" | "Core";

interface WanderTierInfo {
  tier: Tier;                    // User's current tier
  balance: string;               // User's WNDR token balance from the snapshot
  rank: "" | number;             // User's rank in the balance leaderboard (empty string if not ranked)
  progress: number;              // User's progress within the tier system (0-100)
  snapshotTimestamp: number;     // Timestamp of the last snapshot update (in milliseconds)
  totalHolders: number;          // Total number of WNDR token holders in the snapshot
}

Example usage

// Connect to the extension and request access to the ACCESS_ADDRESS permission
await window.arweaveWallet.connect(["ACCESS_ADDRESS"]);

try {
  // Retrieve the tier information of the user
  const tierInfo = await window.arweaveWallet.getWanderTierInfo();
  
  console.log("Tier:", tierInfo.tier);
  console.log("Balance:", tierInfo.balance);
  console.log("Rank:", tierInfo.rank);
  console.log("Progress:", tierInfo.progress);
  console.log("Snapshot timestamp:", tierInfo.snapshotTimestamp);
  console.log("Total holders:", tierInfo.totalHolders);
} catch (error) {
  console.error("Error fetching tier information:", error);
}

Alternative implementation via dryrun

For applications that need to query tier information for any wallet address (not just the connected user), you can also use the dryrun approach to query the Wander leaderboard process directly.

circle-info

Note: The tier information is updated every 24 hours at 4:00 PM GMT. Make sure to cache the results using the snapshotTimestamp to avoid unnecessary calls to the process.

Single wallet query

Batch wallet query

Last updated

Was this helpful?