@spectratools/assembly-cli 0.5.0 → 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.
- package/dist/cli.js +17 -1
- 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
|
|
|
@@ -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,
|
|
@@ -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);
|