From 4ea288845530c869e1d7a6a9d7c320f20f6083e9 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Wed, 6 Dec 2023 17:49:23 -0800 Subject: [PATCH] get unique authorities fix --- src/dlobProvider.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/dlobProvider.ts b/src/dlobProvider.ts index e0dc287..fc541c4 100644 --- a/src/dlobProvider.ts +++ b/src/dlobProvider.ts @@ -57,11 +57,12 @@ export function getDLOBProviderFromOrderSubscriber( return await orderSubscriber.getDLOB(slot); }, getUniqueAuthorities: () => { - const authorities = new Set(); + const authorities = new Set(); for (const { userAccount } of orderSubscriber.usersAccounts.values()) { - authorities.add(userAccount.authority); + authorities.add(userAccount.authority.toBase58()); } - return Array.from(authorities.values()); + const pubkeys = Array.from(authorities).map((a) => new PublicKey(a)); + return pubkeys; }, getUserAccounts: function* () { for (const [ @@ -95,11 +96,12 @@ export function getDLOBProviderFromGrpcOrderSubscriber( return await orderSubscriber.getDLOB(slot); }, getUniqueAuthorities: () => { - const authorities = new Set(); + const authorities = new Set(); for (const { userAccount } of orderSubscriber.usersAccounts.values()) { - authorities.add(userAccount.authority); + authorities.add(userAccount.authority.toBase58()); } - return Array.from(authorities.values()); + const pubkeys = Array.from(authorities).map((a) => new PublicKey(a)); + return pubkeys; }, getUserAccounts: function* () { for (const [