@reflectmoney/stable.ts 2.5.0 → 2.5.1

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,4 +102,8 @@ 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
+ fetchAdminByRole(role: Role): Promise<{
106
+ pubkey: PublicKey;
107
+ account: UserPermissions;
108
+ }[]>;
105
109
  }
@@ -209,5 +209,21 @@ class ReflectKeeper {
209
209
  }, reflect_main_1.PROGRAM_ID);
210
210
  return ix;
211
211
  }
212
+ fetchAdminByRole(role) {
213
+ return __awaiter(this, void 0, void 0, function* () {
214
+ const data = yield reflect_main_1.UserPermissions
215
+ .gpaBuilder(reflect_main_1.PROGRAM_ID)
216
+ .addFilter("accountDiscriminator", reflect_main_1.userPermissionsDiscriminator)
217
+ .run(this.connection);
218
+ return data.map(({ pubkey, account: { data } }) => {
219
+ const [account] = reflect_main_1.UserPermissions.deserialize(data);
220
+ return {
221
+ pubkey,
222
+ account
223
+ };
224
+ })
225
+ .filter(({ account }) => account.protocolRoles.roles.includes(role));
226
+ });
227
+ }
212
228
  }
213
229
  exports.ReflectKeeper = ReflectKeeper;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reflectmoney/stable.ts",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "type": "commonjs",
5
5
  "author": "stablecoinjesus @ Palindrome Engineering",
6
6
  "repository": {
@@ -9,7 +9,8 @@
9
9
  },
10
10
  "scripts": {
11
11
  "test": "mocha --require ts-node/register ./tests/index.test.ts",
12
- "test:slippage": "mocha --require ts-node/register ./tests/slippage.test.ts"
12
+ "test:slippage": "mocha --require ts-node/register ./tests/slippage.test.ts",
13
+ "test:keeper": "mocha --require ts-node/register ./tests/keeper.test.ts"
13
14
  },
14
15
  "dependencies": {
15
16
  "@coral-xyz/anchor": "0.29.0",