Skip to content

Commit

Permalink
🐛 Fix fetchAllLeaderboardAccounts (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielePicco authored Dec 5, 2023
1 parent 0ec46a9 commit 63df3e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@magicblock-labs/soar-sdk",
"version": "0.1.20",
"version": "0.1.21",
"description": "Sdk bindings for the SOAR smart contract.",
"repository": {
"type": "git",
Expand Down
8 changes: 4 additions & 4 deletions client/sdk/src/soar.program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -661,12 +661,12 @@ export class SoarProgram {
public async fetchAllLeaderboardAccounts(
memcmp?: Buffer | GetProgramAccountsFilter[]
): Promise<LeaderBoardAccount[]> {
const achievements = await this.program.account.achievement.all(memcmp);
const leaderboards = await this.program.account.leaderBoard.all(memcmp);

return achievements.map((achievement) =>
return leaderboards.map((leaderboard) =>
LeaderBoardAccount.fromIdlAccount(
achievement.account,
achievement.publicKey
leaderboard.account,
leaderboard.publicKey
)
);
}
Expand Down

0 comments on commit 63df3e5

Please sign in to comment.