@glamsystems/glam-cli 1.0.14-alpha.4 → 1.0.14-alpha.5

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.
Files changed (2) hide show
  1. package/main.js +39 -6
  2. package/package.json +2 -2
package/main.js CHANGED
@@ -6269,11 +6269,7 @@ class Reserve extends base_1.Decodable {
6269
6269
  return this.config.tokenInfo.scopeConfiguration.priceFeed;
6270
6270
  }
6271
6271
  get liquidityFeeReceiver() {
6272
- return web3_js_1.PublicKey.findProgramAddressSync([
6273
- Buffer.from("fee_receiver"),
6274
- this.lendingMarket.toBuffer(),
6275
- this.liquidity.mintPubkey.toBuffer(),
6276
- ], constants_1.KAMINO_LENDING_PROGRAM)[0];
6272
+ return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("fee_receiver"), this._address.toBuffer()], constants_1.KAMINO_LENDING_PROGRAM)[0];
6277
6273
  }
6278
6274
  get farmDebtNullable() {
6279
6275
  return this.farmDebt.equals(web3_js_1.PublicKey.default) ? null : this.farmDebt;
@@ -48569,6 +48565,43 @@ function installVaultCommands(program, context) {
48569
48565
  message: `Confirm removing ${asset} from allowlist?`,
48570
48566
  }, (txSig) => `${asset} removed from allowlist: ${txSig}`);
48571
48567
  });
48568
+ program
48569
+ .command("allowlist-borrowable-asset")
48570
+ .argument("<asset>", "Borrowable asset mint public key", utils_1.validatePublicKey)
48571
+ .option("-y, --yes", "Skip confirmation prompt", false)
48572
+ .description("Add a borrowable asset to the global borrowable allowlist")
48573
+ .action(async (asset, options) => {
48574
+ const stateModel = await context.glamClient.fetchStateModel();
48575
+ const borrowableSet = new glam_sdk_1.PkSet(stateModel.borrowable || []);
48576
+ if (borrowableSet.has(asset)) {
48577
+ console.error(`Borrowable asset ${asset} already allowlisted`);
48578
+ process.exit(1);
48579
+ }
48580
+ const borrowable = Array.from(borrowableSet.add(asset));
48581
+ await (0, utils_1.executeTxWithErrorHandling)(() => context.glamClient.state.update({ borrowable }, context.txOptions), {
48582
+ skip: options?.yes,
48583
+ message: `Confirm adding ${asset} to global borrowable allowlist?`,
48584
+ }, (txSig) => `${asset} added to global borrowable allowlist: ${txSig}`);
48585
+ });
48586
+ program
48587
+ .command("remove-borrowable-asset")
48588
+ .argument("<asset>", "Borrowable asset mint public key", utils_1.validatePublicKey)
48589
+ .option("-y, --yes", "Skip confirmation prompt", false)
48590
+ .description("Remove a borrowable asset from the global borrowable allowlist")
48591
+ .action(async (asset, options) => {
48592
+ const stateModel = await context.glamClient.fetchStateModel();
48593
+ const borrowableSet = new glam_sdk_1.PkSet(stateModel.borrowable || []);
48594
+ const removed = borrowableSet.delete(asset);
48595
+ if (!removed) {
48596
+ console.error(`${asset} not found in global borrowable allowlist, nothing to remove`);
48597
+ process.exit(1);
48598
+ }
48599
+ const borrowable = Array.from(borrowableSet);
48600
+ await (0, utils_1.executeTxWithErrorHandling)(() => context.glamClient.state.update({ borrowable }, context.txOptions), {
48601
+ skip: options?.yes,
48602
+ message: `Confirm removing ${asset} from global borrowable allowlist?`,
48603
+ }, (txSig) => `${asset} removed from global borrowable allowlist: ${txSig}`);
48604
+ });
48572
48605
  program
48573
48606
  .command("holdings")
48574
48607
  .description("Get all vault holdings")
@@ -50341,7 +50374,7 @@ program
50341
50374
  initialize(config, skipSimulation);
50342
50375
  await (0, idl_1.idlCheck)(context.glamClient);
50343
50376
  })
50344
- .version("1.0.14-alpha.4");
50377
+ .version("1.0.14-alpha.5");
50345
50378
  program
50346
50379
  .command("env")
50347
50380
  .description("Display current environment setup")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glamsystems/glam-cli",
3
- "version": "1.0.14-alpha.4",
3
+ "version": "1.0.14-alpha.5",
4
4
  "description": "CLI for interacting with the GLAM Protocol",
5
5
  "main": "./main.js",
6
6
  "bin": {
@@ -21,7 +21,7 @@
21
21
  "node": ">=20.20.0"
22
22
  },
23
23
  "dependencies": {
24
- "@glamsystems/glam-sdk": "1.0.14-alpha.4",
24
+ "@glamsystems/glam-sdk": "1.0.14-alpha.5",
25
25
  "@switchboard-xyz/common": "^3.0.0",
26
26
  "commander": "^11.1.0",
27
27
  "decimal.js": "^10.6.0",