@b3dotfun/leaderboards
Version:
SDK to interact with leaderboards smart contract
1,121 lines • 27.7 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LeaderboardABI = void 0;
exports.LeaderboardABI = [
{
inputs: [],
name: "AccessControlBadConfirmation",
type: "error",
},
{
inputs: [
{
internalType: "address",
name: "account",
type: "address",
},
{
internalType: "bytes32",
name: "neededRole",
type: "bytes32",
},
],
name: "AccessControlUnauthorizedAccount",
type: "error",
},
{
inputs: [],
name: "InvalidInitialization",
type: "error",
},
{
inputs: [],
name: "LeaderboardConcluded",
type: "error",
},
{
inputs: [
{
internalType: "uint256",
name: "endTime",
type: "uint256",
},
],
name: "LeaderboardEnded",
type: "error",
},
{
inputs: [
{
internalType: "uint256",
name: "startTime",
type: "uint256",
},
],
name: "LeaderboardNotStarted",
type: "error",
},
{
inputs: [],
name: "NotInitializing",
type: "error",
},
{
inputs: [
{
internalType: "uint256",
name: "timestamp",
type: "uint256",
},
],
name: "ScoreTimestampBeforeStart",
type: "error",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "sender",
type: "address",
},
{
indexed: false,
internalType: "address",
name: "admin",
type: "address",
},
],
name: "AdminAddedEvent",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address",
name: "sender",
type: "address",
},
{
indexed: false,
internalType: "address",
name: "admin",
type: "address",
},
],
name: "AdminRemovedEvent",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address[]",
name: "users",
type: "address[]",
},
],
name: "EligibleUsersAddedEvent",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address[]",
name: "users",
type: "address[]",
},
],
name: "EligibleUsersRemovedEvent",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "uint64",
name: "version",
type: "uint64",
},
],
name: "Initialized",
type: "event",
},
{
anonymous: false,
inputs: [],
name: "LeaderboardConcludedEvent",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "uint256",
name: "startTime",
type: "uint256",
},
{
indexed: false,
internalType: "uint256",
name: "endTime",
type: "uint256",
},
{
indexed: false,
internalType: "string",
name: "title",
type: "string",
},
],
name: "LeaderboardUpdatedEvent",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "role",
type: "bytes32",
},
{
indexed: true,
internalType: "bytes32",
name: "previousAdminRole",
type: "bytes32",
},
{
indexed: true,
internalType: "bytes32",
name: "newAdminRole",
type: "bytes32",
},
],
name: "RoleAdminChanged",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "role",
type: "bytes32",
},
{
indexed: true,
internalType: "address",
name: "account",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "sender",
type: "address",
},
],
name: "RoleGranted",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "role",
type: "bytes32",
},
{
indexed: true,
internalType: "address",
name: "account",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "sender",
type: "address",
},
],
name: "RoleRevoked",
type: "event",
},
{
anonymous: false,
inputs: [
{
components: [
{
internalType: "address",
name: "user",
type: "address",
},
{
internalType: "uint256",
name: "score",
type: "uint256",
},
{
internalType: "uint256",
name: "timestamp",
type: "uint256",
},
],
indexed: false,
internalType: "struct Leaderboard.ScoreUpdate[]",
name: "scoreUpdates",
type: "tuple[]",
},
],
name: "ScoreBatchEvent",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "user",
type: "address",
},
],
name: "UserUnblacklistedEvent",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: false,
internalType: "address[]",
name: "users",
type: "address[]",
},
],
name: "UsersBlacklistedEvent",
type: "event",
},
{
inputs: [],
name: "ADMIN_ROLE",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "DEFAULT_ADMIN_ROLE",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "newAdmin",
type: "address",
},
],
name: "addAdmin",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address[]",
name: "users",
type: "address[]",
},
],
name: "addEligibleUsers",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address[]",
name: "users",
type: "address[]",
},
],
name: "blacklistUsers",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "concludeLeaderboard",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "user",
type: "address",
},
{
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "decreaseUserAttempts",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
components: [
{
internalType: "address",
name: "user",
type: "address",
},
{
internalType: "uint256",
name: "score",
type: "uint256",
},
{
internalType: "uint256",
name: "timestamp",
type: "uint256",
},
],
internalType: "struct Leaderboard.ScoreUpdate[]",
name: "inputs",
type: "tuple[]",
},
],
name: "decrementScores",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "getAdmins",
outputs: [
{
internalType: "address[]",
name: "",
type: "address[]",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getBlacklistUsers",
outputs: [
{
internalType: "address[]",
name: "",
type: "address[]",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getEligibleUsers",
outputs: [
{
internalType: "address[]",
name: "",
type: "address[]",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getLeaderboard",
outputs: [
{
internalType: "address[]",
name: "users",
type: "address[]",
},
{
internalType: "uint256[]",
name: "scores",
type: "uint256[]",
},
{
internalType: "uint256[]",
name: "lastUpdated",
type: "uint256[]",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getLeaderboardEndTime",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getLeaderboardProps",
outputs: [
{
components: [
{
internalType: "uint256",
name: "startTime",
type: "uint256",
},
{
internalType: "uint256",
name: "endTime",
type: "uint256",
},
{
internalType: "bool",
name: "hasConcluded",
type: "bool",
},
{
internalType: "string",
name: "slug",
type: "string",
},
{
internalType: "string",
name: "title",
type: "string",
},
{
internalType: "bool",
name: "isPrivate",
type: "bool",
},
{
internalType: "bool",
name: "useLatestScore",
type: "bool",
},
{
internalType: "bool",
name: "hasAttemptLimit",
type: "bool",
},
{
internalType: "uint256",
name: "initialAttempts",
type: "uint256",
},
{
internalType: "bool",
name: "isReverseSort",
type: "bool",
},
],
internalType: "struct Leaderboard.LeaderboardInfo",
name: "",
type: "tuple",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getLeaderboardStartTime",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getLeaderboardUserCount",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getRemainingTime",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "role",
type: "bytes32",
},
],
name: "getRoleAdmin",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getSlug",
outputs: [
{
internalType: "string",
name: "",
type: "string",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getTimeUntilStart",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "getTitle",
outputs: [
{
internalType: "string",
name: "",
type: "string",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "user",
type: "address",
},
],
name: "getUserAttempts",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "user",
type: "address",
},
],
name: "getUserScore",
outputs: [
{
internalType: "uint256",
name: "scores",
type: "uint256",
},
{
internalType: "uint256",
name: "lastUpdated",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "role",
type: "bytes32",
},
{
internalType: "address",
name: "account",
type: "address",
},
],
name: "grantRole",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "role",
type: "bytes32",
},
{
internalType: "address",
name: "account",
type: "address",
},
],
name: "hasRole",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "user",
type: "address",
},
{
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "increaseUserAttempts",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
components: [
{
internalType: "address",
name: "user",
type: "address",
},
{
internalType: "uint256",
name: "score",
type: "uint256",
},
{
internalType: "uint256",
name: "timestamp",
type: "uint256",
},
],
internalType: "struct Leaderboard.ScoreUpdate[]",
name: "inputs",
type: "tuple[]",
},
],
name: "incrementScores",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_admin",
type: "address",
},
{
internalType: "address",
name: "_creatorAdmin",
type: "address",
},
{
internalType: "uint256",
name: "_startTime",
type: "uint256",
},
{
internalType: "uint256",
name: "_endTime",
type: "uint256",
},
{
internalType: "string",
name: "_slug",
type: "string",
},
{
internalType: "string",
name: "_title",
type: "string",
},
{
internalType: "bool",
name: "_isPrivate",
type: "bool",
},
{
internalType: "bool",
name: "_useLatestScore",
type: "bool",
},
{
internalType: "bool",
name: "_hasAttemptLimit",
type: "bool",
},
{
internalType: "uint256",
name: "_initialAttempts",
type: "uint256",
},
{
internalType: "bool",
name: "_isReverseSort",
type: "bool",
},
],
name: "initialize",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "isLeaderboardActive",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "isLeaderboardEnded",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "isPrivate",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "user",
type: "address",
},
],
name: "isUserBlacklisted",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "user",
type: "address",
},
],
name: "isUserEligible",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
components: [
{
internalType: "address",
name: "user",
type: "address",
},
{
internalType: "uint256",
name: "score",
type: "uint256",
},
{
internalType: "uint256",
name: "timestamp",
type: "uint256",
},
],
internalType: "struct Leaderboard.ScoreUpdate[]",
name: "inputs",
type: "tuple[]",
},
],
name: "overwriteScores",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "admin",
type: "address",
},
],
name: "removeAdmin",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address[]",
name: "users",
type: "address[]",
},
],
name: "removeEligibleUsers",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "role",
type: "bytes32",
},
{
internalType: "address",
name: "callerConfirmation",
type: "address",
},
],
name: "renounceRole",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "bytes32",
name: "role",
type: "bytes32",
},
{
internalType: "address",
name: "account",
type: "address",
},
],
name: "revokeRole",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "bytes4",
name: "interfaceId",
type: "bytes4",
},
],
name: "supportsInterface",
outputs: [
{
internalType: "bool",
name: "",
type: "bool",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "user",
type: "address",
},
],
name: "unblacklistUser",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint256",
name: "startTime",
type: "uint256",
},
{
internalType: "uint256",
name: "endTime",
type: "uint256",
},
{
internalType: "string",
name: "title",
type: "string",
},
],
name: "updateLeaderboard",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
components: [
{
internalType: "address",
name: "user",
type: "address",
},
{
internalType: "uint256",
name: "score",
type: "uint256",
},
{
internalType: "uint256",
name: "timestamp",
type: "uint256",
},
],
internalType: "struct Leaderboard.ScoreUpdate[]",
name: "inputs",
type: "tuple[]",
},
],
name: "updateScores",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
];
//# sourceMappingURL=LeaderboardABI.js.map