@spectratools/assembly-cli 0.4.3 → 0.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.
Files changed (2) hide show
  1. package/dist/cli.js +20 -4
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/cli.ts
4
- import { realpathSync } from "fs";
4
+ import { readFileSync, realpathSync } from "fs";
5
+ import { dirname, resolve } from "path";
5
6
  import { fileURLToPath } from "url";
6
7
  import { Cli as Cli6, z as z6 } from "incur";
7
8
 
@@ -4629,7 +4630,7 @@ council.command("auctions", {
4629
4630
  };
4630
4631
  })
4631
4632
  },
4632
- {
4633
+ c.format === "json" || c.format === "jsonl" ? void 0 : {
4633
4634
  cta: {
4634
4635
  description: "Inspect and bid:",
4635
4636
  commands: [
@@ -4661,6 +4662,18 @@ council.command("auction", {
4661
4662
  examples: [{ args: { day: 0, slot: 0 }, description: "Inspect day 0, slot 0 auction" }],
4662
4663
  async run(c) {
4663
4664
  const client = createAssemblyPublicClient(c.env.ABSTRACT_RPC_URL);
4665
+ const slotsPerDay = await client.readContract({
4666
+ abi: councilSeatsAbi,
4667
+ address: ABSTRACT_MAINNET_ADDRESSES.councilSeats,
4668
+ functionName: "AUCTION_SLOTS_PER_DAY"
4669
+ });
4670
+ if (c.args.slot >= Number(slotsPerDay)) {
4671
+ return c.error({
4672
+ code: "OUT_OF_RANGE",
4673
+ message: `Slot ${c.args.slot} does not exist (max: ${Number(slotsPerDay) - 1})`,
4674
+ retryable: false
4675
+ });
4676
+ }
4664
4677
  const [auctionTuple, windowEnd, latestBlock] = await Promise.all([
4665
4678
  client.readContract({
4666
4679
  abi: councilSeatsAbi,
@@ -4898,7 +4911,7 @@ forum.command("threads", {
4898
4911
  threads,
4899
4912
  count: threads.length
4900
4913
  },
4901
- {
4914
+ c.format === "json" || c.format === "jsonl" ? void 0 : {
4902
4915
  cta: {
4903
4916
  description: "Inspect or comment:",
4904
4917
  commands: [
@@ -5348,7 +5361,7 @@ governance.command("proposals", {
5348
5361
  proposals: items,
5349
5362
  count: items.length
5350
5363
  },
5351
- {
5364
+ c.format === "json" || c.format === "jsonl" ? void 0 : {
5352
5365
  cta: {
5353
5366
  description: "Inspect or vote:",
5354
5367
  commands: [
@@ -6062,7 +6075,10 @@ function applyFriendlyErrorHandling(cli2) {
6062
6075
  }
6063
6076
 
6064
6077
  // src/cli.ts
6078
+ var __dirname = dirname(fileURLToPath(import.meta.url));
6079
+ var pkg = JSON.parse(readFileSync(resolve(__dirname, "../package.json"), "utf8"));
6065
6080
  var cli = Cli6.create("assembly", {
6081
+ version: pkg.version,
6066
6082
  description: "Assembly governance CLI for Abstract chain."
6067
6083
  });
6068
6084
  cli.command(members);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectratools/assembly-cli",
3
- "version": "0.4.3",
3
+ "version": "0.5.1",
4
4
  "description": "CLI for Assembly governance on Abstract (members, council, forum, proposals, and treasury).",
5
5
  "type": "module",
6
6
  "license": "MIT",