@spectratools/assembly-cli 0.5.0 → 0.6.0

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 +23 -2
  2. package/package.json +3 -2
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
 
@@ -4301,7 +4302,12 @@ var ABSTRACT_MAINNET_DEPLOYMENT_BLOCKS = {
4301
4302
  };
4302
4303
 
4303
4304
  // src/contracts/client.ts
4304
- import { http, createPublicClient, defineChain } from "viem";
4305
+ import {
4306
+ http,
4307
+ createPublicClient,
4308
+ createWalletClient,
4309
+ defineChain
4310
+ } from "viem";
4305
4311
  var abstractMainnet = defineChain({
4306
4312
  id: 2741,
4307
4313
  name: "Abstract Mainnet",
@@ -4661,6 +4667,18 @@ council.command("auction", {
4661
4667
  examples: [{ args: { day: 0, slot: 0 }, description: "Inspect day 0, slot 0 auction" }],
4662
4668
  async run(c) {
4663
4669
  const client = createAssemblyPublicClient(c.env.ABSTRACT_RPC_URL);
4670
+ const slotsPerDay = await client.readContract({
4671
+ abi: councilSeatsAbi,
4672
+ address: ABSTRACT_MAINNET_ADDRESSES.councilSeats,
4673
+ functionName: "AUCTION_SLOTS_PER_DAY"
4674
+ });
4675
+ if (c.args.slot >= Number(slotsPerDay)) {
4676
+ return c.error({
4677
+ code: "OUT_OF_RANGE",
4678
+ message: `Slot ${c.args.slot} does not exist (max: ${Number(slotsPerDay) - 1})`,
4679
+ retryable: false
4680
+ });
4681
+ }
4664
4682
  const [auctionTuple, windowEnd, latestBlock] = await Promise.all([
4665
4683
  client.readContract({
4666
4684
  abi: councilSeatsAbi,
@@ -6062,7 +6080,10 @@ function applyFriendlyErrorHandling(cli2) {
6062
6080
  }
6063
6081
 
6064
6082
  // src/cli.ts
6083
+ var __dirname = dirname(fileURLToPath(import.meta.url));
6084
+ var pkg = JSON.parse(readFileSync(resolve(__dirname, "../package.json"), "utf8"));
6065
6085
  var cli = Cli6.create("assembly", {
6086
+ version: pkg.version,
6066
6087
  description: "Assembly governance CLI for Abstract chain."
6067
6088
  });
6068
6089
  cli.command(members);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectratools/assembly-cli",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "CLI for Assembly governance on Abstract (members, council, forum, proposals, and treasury).",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -32,7 +32,8 @@
32
32
  "incur": "^0.2.2",
33
33
  "ox": "^0.14.0",
34
34
  "viem": "^2.47.0",
35
- "@spectratools/cli-shared": "0.1.1"
35
+ "@spectratools/cli-shared": "0.1.1",
36
+ "@spectratools/tx-shared": "0.3.0"
36
37
  },
37
38
  "devDependencies": {
38
39
  "typescript": "5.7.3",