From 2104ff663361ae5b8dbaafdb96f3a16a7fd1b7c0 Mon Sep 17 00:00:00 2001 From: Gabriele Picco Date: Tue, 5 Dec 2023 12:14:11 +0100 Subject: [PATCH] :bug: Fix fetchAllLeaderboardAccounts --- client/sdk/package.json | 2 +- client/sdk/src/soar.program.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/sdk/package.json b/client/sdk/package.json index 47285e5..751e9f3 100644 --- a/client/sdk/package.json +++ b/client/sdk/package.json @@ -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", diff --git a/client/sdk/src/soar.program.ts b/client/sdk/src/soar.program.ts index bcd81ad..1d4a279 100644 --- a/client/sdk/src/soar.program.ts +++ b/client/sdk/src/soar.program.ts @@ -661,12 +661,12 @@ export class SoarProgram { public async fetchAllLeaderboardAccounts( memcmp?: Buffer | GetProgramAccountsFilter[] ): Promise { - 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 ) ); }