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.
Result
The getWanderTierInfo() function returns an object containing comprehensive tier information for the user.
Note: This function throws an error if there is an issue retrieving the tier information. Please make sure to handle such cases in your code.
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.
Single wallet query
Batch wallet query
Last updated
Was this helpful?