UNPKG

@b3dotfun/leaderboards

Version:

SDK to interact with leaderboards smart contract

24 lines (23 loc) 1.28 kB
import type { Address, EIP1193Provider } from "viem"; import { SupportedChainId } from "./config"; import type { LeaderboardWithProps } from "./types"; export declare class LeaderboardFactory { private contract; private publicClient; private contractAddress; private chain; private walletKey; constructor(chainId: SupportedChainId, walletKey?: string); connect(provider?: EIP1193Provider): boolean; private handleError; createLeaderboard(admin: Address, slug: string, startTime: bigint, endTime: bigint, title: string, isPrivate?: boolean, useLatestScore?: boolean, hasAttemptLimit?: boolean, initialAttempts?: number, isReverseSort?: boolean): Promise<Address>; getLeaderboardAddressesBySlug(slug: string): Promise<Address[]>; getAllLeaderboards(): Promise<readonly Address[]>; getLatestLeaderboardBySlug(slug: string): Promise<Address>; getLeaderboardCountBySlug(slug: string): Promise<number>; getTotalLeaderboardCount(): Promise<number>; getLeaderboardsWithProps(slug: string): Promise<LeaderboardWithProps[]>; getLatestLeaderboardWithProps(slug: string): Promise<LeaderboardWithProps | undefined>; getAllLeaderboardsWithProps(): Promise<LeaderboardWithProps[]>; getAdmins(): Promise<readonly Address[]>; }