Constructors
constructor
- new AccountsBuilder(provider, programId): AccountsBuilder
-
Parameters
-
provider: AnchorProvider
-
programId: PublicKey
Properties
Readonly
utils
utils: Utils
Methods
addAchievementAccounts
- addAchievementAccounts(game, authority, nextAchievement?): Promise<{
authority: PublicKey;
game: PublicKey;
newAchievement: PublicKey;
payer: PublicKey;
systemProgram: PublicKey;
}>
-
Parameters
-
game: PublicKey
-
authority: PublicKey
-
Optional
nextAchievement: PublicKey
Returns Promise<{
authority: PublicKey;
game: PublicKey;
newAchievement: PublicKey;
payer: PublicKey;
systemProgram: PublicKey;
}>
addFtRewardAccounts
- addFtRewardAccounts(authority, newReward, achievement, sourceTokenAccount, tokenAccountOwner, mint, game?): Promise<{
achievement: PublicKey;
authority: PublicKey;
delegateFromTokenAccount: PublicKey;
game: PublicKey;
newReward: PublicKey;
payer: PublicKey;
rewardTokenMint: PublicKey;
systemProgram: PublicKey;
tokenAccountOwner: PublicKey;
tokenProgram: PublicKey;
}>
-
Parameters
-
authority: PublicKey
-
newReward: PublicKey
-
achievement: PublicKey
-
sourceTokenAccount: PublicKey
-
tokenAccountOwner: PublicKey
-
mint: PublicKey
-
Optional
game: PublicKey
Returns Promise<{
achievement: PublicKey;
authority: PublicKey;
delegateFromTokenAccount: PublicKey;
game: PublicKey;
newReward: PublicKey;
payer: PublicKey;
rewardTokenMint: PublicKey;
systemProgram: PublicKey;
tokenAccountOwner: PublicKey;
tokenProgram: PublicKey;
}>
addLeaderboardAccounts
- addLeaderboardAccounts(game, authority, nextLeaderboard?, nullTopEntries?): Promise<{
authority: PublicKey;
game: PublicKey;
leaderboard: PublicKey;
payer: PublicKey;
systemProgram: PublicKey;
topEntries: null | PublicKey;
}>
-
Parameters
-
game: PublicKey
-
authority: PublicKey
-
Optional
nextLeaderboard: PublicKey
-
Optional
nullTopEntries: boolean
Returns Promise<{
authority: PublicKey;
game: PublicKey;
leaderboard: PublicKey;
payer: PublicKey;
systemProgram: PublicKey;
topEntries: null | PublicKey;
}>
addNftRewardAccounts
- addNftRewardAccounts(authority, newReward, achievement, collectionMint?, collectionUpdateAuthority?, game?): Promise<{
achievement: PublicKey;
authority: PublicKey;
collectionMetadata: null | PublicKey;
collectionUpdateAuth: null | PublicKey;
game: PublicKey;
newReward: PublicKey;
payer: PublicKey;
rewardCollectionMint: null | PublicKey;
systemProgram: PublicKey;
tokenMetadataProgram: null | PublicKey;
}>
-
Parameters
-
authority: PublicKey
-
newReward: PublicKey
-
achievement: PublicKey
-
Optional
collectionMint: PublicKey
-
Optional
collectionUpdateAuthority: PublicKey
-
Optional
game: PublicKey
Returns Promise<{
achievement: PublicKey;
authority: PublicKey;
collectionMetadata: null | PublicKey;
collectionUpdateAuth: null | PublicKey;
game: PublicKey;
newReward: PublicKey;
payer: PublicKey;
rewardCollectionMint: null | PublicKey;
systemProgram: PublicKey;
tokenMetadataProgram: null | PublicKey;
}>
claimFtRewardAccounts
- claimFtRewardAccounts(authority, achievement, user, reward?, game?): Promise<{
achievement: PublicKey;
authority: PublicKey;
game: PublicKey;
mint: PublicKey;
playerAccount: PublicKey;
playerAchievement: PublicKey;
reward: PublicKey;
sourceTokenAccount: PublicKey;
tokenProgram: PublicKey;
user: PublicKey;
userTokenAccount: PublicKey;
}>
-
Parameters
-
authority: PublicKey
-
achievement: PublicKey
-
user: PublicKey
-
Optional
reward: PublicKey
-
Optional
game: PublicKey
Returns Promise<{
achievement: PublicKey;
authority: PublicKey;
game: PublicKey;
mint: PublicKey;
playerAccount: PublicKey;
playerAchievement: PublicKey;
reward: PublicKey;
sourceTokenAccount: PublicKey;
tokenProgram: PublicKey;
user: PublicKey;
userTokenAccount: PublicKey;
}>
claimNftRewardAccounts
- claimNftRewardAccounts(authority, achievement, mint, user, reward?, game?): Promise<{
achievement: PublicKey;
associatedTokenProgram: PublicKey;
authority: PublicKey;
claim: PublicKey;
game: PublicKey;
mintTo: PublicKey;
newMasterEdition: PublicKey;
newMetadata: PublicKey;
newMint: PublicKey;
payer: PublicKey;
playerAccount: PublicKey;
playerAchievement: PublicKey;
rent: PublicKey;
reward: PublicKey;
systemProgram: PublicKey;
tokenMetadataProgram: PublicKey;
tokenProgram: PublicKey;
user: PublicKey;
}>
-
Parameters
-
authority: PublicKey
-
achievement: PublicKey
-
mint: PublicKey
-
user: PublicKey
-
Optional
reward: PublicKey
-
Optional
game: PublicKey
Returns Promise<{
achievement: PublicKey;
associatedTokenProgram: PublicKey;
authority: PublicKey;
claim: PublicKey;
game: PublicKey;
mintTo: PublicKey;
newMasterEdition: PublicKey;
newMetadata: PublicKey;
newMint: PublicKey;
payer: PublicKey;
playerAccount: PublicKey;
playerAchievement: PublicKey;
rent: PublicKey;
reward: PublicKey;
systemProgram: PublicKey;
tokenMetadataProgram: PublicKey;
tokenProgram: PublicKey;
user: PublicKey;
}>
initializeGameAccounts
- initializeGameAccounts(game): Promise<{
creator: PublicKey;
game: PublicKey;
systemProgram: PublicKey;
}>
-
Returns Promise<{
creator: PublicKey;
game: PublicKey;
systemProgram: PublicKey;
}>
initializePlayerAccounts
- initializePlayerAccounts(user): Promise<{
payer: PublicKey;
playerAccount: PublicKey;
systemProgram: PublicKey;
user: PublicKey;
}>
-
Returns Promise<{
payer: PublicKey;
playerAccount: PublicKey;
systemProgram: PublicKey;
user: PublicKey;
}>
initiateMergeAccounts
- initiateMergeAccounts(user, mergeAccount): Promise<{
mergeAccount: PublicKey;
payer: PublicKey;
playerAccount: PublicKey;
systemProgram: PublicKey;
user: PublicKey;
}>
-
Parameters
-
user: PublicKey
-
mergeAccount: PublicKey
Returns Promise<{
mergeAccount: PublicKey;
payer: PublicKey;
playerAccount: PublicKey;
systemProgram: PublicKey;
user: PublicKey;
}>
registerMergeApprovalAccounts
- registerMergeApprovalAccounts(user, mergeAccount): Promise<{
mergeAccount: PublicKey;
playerAccount: PublicKey;
user: PublicKey;
}>
-
Parameters
-
user: PublicKey
-
mergeAccount: PublicKey
Returns Promise<{
mergeAccount: PublicKey;
playerAccount: PublicKey;
user: PublicKey;
}>
registerPlayerEntryAccounts
- registerPlayerEntryAccounts(user, leaderboard, game?): Promise<{
game: PublicKey;
leaderboard: PublicKey;
newList: PublicKey;
payer: PublicKey;
playerAccount: PublicKey;
systemProgram: PublicKey;
user: PublicKey;
}>
-
Parameters
-
user: PublicKey
-
leaderboard: PublicKey
-
Optional
game: PublicKey
Returns Promise<{
game: PublicKey;
leaderboard: PublicKey;
newList: PublicKey;
payer: PublicKey;
playerAccount: PublicKey;
systemProgram: PublicKey;
user: PublicKey;
}>
submitScoreAccounts
- submitScoreAccounts(user, authority, leaderboard, game?): Promise<{
authority: PublicKey;
game: PublicKey;
leaderboard: PublicKey;
payer: PublicKey;
playerAccount: PublicKey;
playerScores: PublicKey;
systemProgram: PublicKey;
topEntries: null | PublicKey;
}>
-
Parameters
-
user: PublicKey
-
authority: PublicKey
-
leaderboard: PublicKey
-
Optional
game: PublicKey
Returns Promise<{
authority: PublicKey;
game: PublicKey;
leaderboard: PublicKey;
payer: PublicKey;
playerAccount: PublicKey;
playerScores: PublicKey;
systemProgram: PublicKey;
topEntries: null | PublicKey;
}>
unlockPlayerAchievementAccounts
- unlockPlayerAchievementAccounts(user, authority, achievement, leaderboard, game?): Promise<{
achievement: PublicKey;
authority: PublicKey;
game: PublicKey;
payer: PublicKey;
playerAccount: PublicKey;
playerAchievement: PublicKey;
playerScores: PublicKey;
}>
-
Parameters
-
user: PublicKey
-
authority: PublicKey
-
achievement: PublicKey
-
leaderboard: PublicKey
-
Optional
game: PublicKey
Returns Promise<{
achievement: PublicKey;
authority: PublicKey;
game: PublicKey;
payer: PublicKey;
playerAccount: PublicKey;
playerAchievement: PublicKey;
playerScores: PublicKey;
}>
updateAchievementAccounts
- updateAchievementAccounts(authority, achievement, game?): Promise<{
achievement: PublicKey;
authority: PublicKey;
game: PublicKey;
}>
-
Parameters
-
authority: PublicKey
-
achievement: PublicKey
-
Optional
game: PublicKey
Returns Promise<{
achievement: PublicKey;
authority: PublicKey;
game: PublicKey;
}>
updateGameAccounts
- updateGameAccounts(game, authority): Promise<{
authority: PublicKey;
game: PublicKey;
payer: PublicKey;
systemProgram: PublicKey;
}>
-
Parameters
-
game: PublicKey
-
authority: PublicKey
Returns Promise<{
authority: PublicKey;
game: PublicKey;
payer: PublicKey;
systemProgram: PublicKey;
}>
updateLeaderboardAccounts
- updateLeaderboardAccounts(authority, leaderboard, game?): Promise<{
authority: PublicKey;
game: PublicKey;
leaderboard: PublicKey;
}>
-
Parameters
-
authority: PublicKey
-
leaderboard: PublicKey
-
Optional
game: PublicKey
Returns Promise<{
authority: PublicKey;
game: PublicKey;
leaderboard: PublicKey;
}>
updatePlayerAccounts
- updatePlayerAccounts(user): Promise<{
playerAccount: PublicKey;
user: PublicKey;
}>
-
Returns Promise<{
playerAccount: PublicKey;
user: PublicKey;
}>
verifyNftRewardAccounts
- verifyNftRewardAccounts(user, achievement, mint, reward?, game?): Promise<{
achievement: PublicKey;
claim: PublicKey;
collectionEdition: PublicKey;
collectionMetadata: PublicKey;
collectionMint: PublicKey;
game: PublicKey;
metadataToVerify: PublicKey;
mint: PublicKey;
payer: PublicKey;
playerAccount: PublicKey;
playerAchievement: PublicKey;
reward: PublicKey;
tokenMetadataProgram: PublicKey;
user: PublicKey;
}>
-
Parameters
-
user: PublicKey
-
achievement: PublicKey
-
mint: PublicKey
-
Optional
reward: PublicKey
-
Optional
game: PublicKey
Returns Promise<{
achievement: PublicKey;
claim: PublicKey;
collectionEdition: PublicKey;
collectionMetadata: PublicKey;
collectionMint: PublicKey;
game: PublicKey;
metadataToVerify: PublicKey;
mint: PublicKey;
payer: PublicKey;
playerAccount: PublicKey;
playerAchievement: PublicKey;
reward: PublicKey;
tokenMetadataProgram: PublicKey;
user: PublicKey;
}>