@reflectmoney/stable.ts 2.5.2 → 2.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -102,6 +102,10 @@ export declare class ReflectKeeper {
102
102
  * @returns TransactionInstruction
103
103
  */
104
104
  updateActionRoleProtocol(signer: PublicKey, action: Action, affectedRole: Role, update: Update): import("@solana/web3.js").TransactionInstruction;
105
+ fetchAllAdminAccounts(): Promise<{
106
+ pubkey: PublicKey;
107
+ account: UserPermissions;
108
+ }[]>;
105
109
  fetchAdminByRole(role: Role): Promise<{
106
110
  pubkey: PublicKey;
107
111
  account: UserPermissions;
@@ -209,7 +209,7 @@ class ReflectKeeper {
209
209
  }, reflect_main_1.PROGRAM_ID);
210
210
  return ix;
211
211
  }
212
- fetchAdminByRole(role) {
212
+ fetchAllAdminAccounts() {
213
213
  return __awaiter(this, void 0, void 0, function* () {
214
214
  const data = yield reflect_main_1.UserPermissions.gpaBuilder(reflect_main_1.PROGRAM_ID)
215
215
  .addFilter("accountDiscriminator", reflect_main_1.userPermissionsDiscriminator)
@@ -221,23 +221,19 @@ class ReflectKeeper {
221
221
  pubkey,
222
222
  account,
223
223
  };
224
- })
225
- .filter(({ account }) => account.protocolRoles.roles.includes(role));
224
+ });
225
+ });
226
+ }
227
+ fetchAdminByRole(role) {
228
+ return __awaiter(this, void 0, void 0, function* () {
229
+ const data = yield this.fetchAllAdminAccounts();
230
+ return data.filter(({ account }) => account.protocolRoles.roles.includes(role));
226
231
  });
227
232
  }
228
233
  fetchAdminByStrategyRole(strategy, role) {
229
234
  return __awaiter(this, void 0, void 0, function* () {
230
- const data = yield reflect_main_1.UserPermissions.gpaBuilder(reflect_main_1.PROGRAM_ID)
231
- .addFilter("accountDiscriminator", reflect_main_1.userPermissionsDiscriminator)
232
- .run(this.connection);
235
+ const data = yield this.fetchAllAdminAccounts();
233
236
  const strategyPermissionAccounts = data
234
- .map(({ pubkey, account: { data } }) => {
235
- const [account] = reflect_main_1.UserPermissions.deserialize(data);
236
- return {
237
- pubkey,
238
- account,
239
- };
240
- })
241
237
  .filter(({ account }) => account.strategyRoles.some(({ strategyId }) => strategyId === strategy));
242
238
  return strategyPermissionAccounts.filter(({ account }) => {
243
239
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reflectmoney/stable.ts",
3
- "version": "2.5.2",
3
+ "version": "2.5.4",
4
4
  "type": "commonjs",
5
5
  "author": "stablecoinjesus @ Palindrome Engineering",
6
6
  "repository": {
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@coral-xyz/anchor": "0.29.0",
17
- "@drift-labs/sdk": "2.143.0-beta.4",
17
+ "@drift-labs/sdk": "2.150.0-beta.3",
18
18
  "@metaplex-foundation/beet": "=0.7.2",
19
19
  "@metaplex-foundation/beet-solana": "=0.4.1",
20
20
  "@metaplex-foundation/mpl-token-metadata": "2.13.0",