@spectratools/assembly-cli 0.11.3 → 0.11.6
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 +95 -84
- package/dist/index.js +8098 -0
- package/package.json +9 -3
package/dist/cli.js
CHANGED
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
import { readFileSync, realpathSync } from "fs";
|
|
5
5
|
import { dirname, resolve } from "path";
|
|
6
6
|
import { fileURLToPath } from "url";
|
|
7
|
+
import {
|
|
8
|
+
initTelemetry,
|
|
9
|
+
shutdownTelemetry,
|
|
10
|
+
withCommandSpan
|
|
11
|
+
} from "@spectratools/cli-shared/telemetry";
|
|
7
12
|
import { Cli as Cli6, z as z7 } from "incur";
|
|
8
13
|
|
|
9
14
|
// src/commands/_common.ts
|
|
@@ -7955,49 +7960,51 @@ cli.command("status", {
|
|
|
7955
7960
|
}),
|
|
7956
7961
|
examples: [{ description: "Fetch the current Assembly system status" }],
|
|
7957
7962
|
async run(c) {
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
|
|
7964
|
-
|
|
7965
|
-
|
|
7966
|
-
|
|
7967
|
-
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7983
|
-
|
|
7984
|
-
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
7963
|
+
return withCommandSpan("assembly status", {}, async () => {
|
|
7964
|
+
const client = createAssemblyPublicClient(c.env.ABSTRACT_RPC_URL);
|
|
7965
|
+
const [
|
|
7966
|
+
activeMemberCount,
|
|
7967
|
+
seatCount,
|
|
7968
|
+
proposalCount,
|
|
7969
|
+
currentAuctionDay,
|
|
7970
|
+
currentAuctionSlot,
|
|
7971
|
+
treasuryBalance
|
|
7972
|
+
] = await Promise.all([
|
|
7973
|
+
client.readContract({
|
|
7974
|
+
abi: registryAbi,
|
|
7975
|
+
address: ABSTRACT_MAINNET_ADDRESSES.registry,
|
|
7976
|
+
functionName: "activeMemberCount"
|
|
7977
|
+
}),
|
|
7978
|
+
client.readContract({
|
|
7979
|
+
abi: councilSeatsAbi,
|
|
7980
|
+
address: ABSTRACT_MAINNET_ADDRESSES.councilSeats,
|
|
7981
|
+
functionName: "seatCount"
|
|
7982
|
+
}),
|
|
7983
|
+
client.readContract({
|
|
7984
|
+
abi: governanceAbi,
|
|
7985
|
+
address: ABSTRACT_MAINNET_ADDRESSES.governance,
|
|
7986
|
+
functionName: "proposalCount"
|
|
7987
|
+
}),
|
|
7988
|
+
client.readContract({
|
|
7989
|
+
abi: councilSeatsAbi,
|
|
7990
|
+
address: ABSTRACT_MAINNET_ADDRESSES.councilSeats,
|
|
7991
|
+
functionName: "currentAuctionDay"
|
|
7992
|
+
}),
|
|
7993
|
+
client.readContract({
|
|
7994
|
+
abi: councilSeatsAbi,
|
|
7995
|
+
address: ABSTRACT_MAINNET_ADDRESSES.councilSeats,
|
|
7996
|
+
functionName: "currentAuctionSlot"
|
|
7997
|
+
}),
|
|
7998
|
+
client.getBalance({ address: ABSTRACT_MAINNET_ADDRESSES.treasury })
|
|
7999
|
+
]);
|
|
8000
|
+
return c.ok({
|
|
8001
|
+
activeMemberCount: Number(activeMemberCount),
|
|
8002
|
+
seatCount: Number(seatCount),
|
|
8003
|
+
proposalCount: Number(proposalCount),
|
|
8004
|
+
currentAuctionDay: Number(currentAuctionDay),
|
|
8005
|
+
currentAuctionSlot: Number(currentAuctionSlot),
|
|
8006
|
+
treasuryBalance: eth(treasuryBalance)
|
|
8007
|
+
});
|
|
8001
8008
|
});
|
|
8002
8009
|
}
|
|
8003
8010
|
});
|
|
@@ -8023,47 +8030,49 @@ cli.command("health", {
|
|
|
8023
8030
|
}
|
|
8024
8031
|
],
|
|
8025
8032
|
async run(c) {
|
|
8026
|
-
|
|
8027
|
-
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
|
|
8033
|
-
|
|
8034
|
-
|
|
8035
|
-
|
|
8036
|
-
|
|
8037
|
-
|
|
8038
|
-
|
|
8039
|
-
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8043
|
-
|
|
8044
|
-
|
|
8045
|
-
|
|
8046
|
-
|
|
8047
|
-
|
|
8048
|
-
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
|
|
8052
|
-
|
|
8053
|
-
|
|
8054
|
-
|
|
8055
|
-
|
|
8056
|
-
|
|
8057
|
-
|
|
8058
|
-
|
|
8059
|
-
|
|
8060
|
-
|
|
8061
|
-
|
|
8062
|
-
|
|
8063
|
-
|
|
8064
|
-
|
|
8065
|
-
|
|
8066
|
-
|
|
8033
|
+
return withCommandSpan("assembly health", { address: c.args.address }, async () => {
|
|
8034
|
+
const client = createAssemblyPublicClient(c.env.ABSTRACT_RPC_URL);
|
|
8035
|
+
const [isActive, member, isCouncilMember, pendingReturns, votingPower] = await Promise.all([
|
|
8036
|
+
client.readContract({
|
|
8037
|
+
abi: registryAbi,
|
|
8038
|
+
address: ABSTRACT_MAINNET_ADDRESSES.registry,
|
|
8039
|
+
functionName: "isActive",
|
|
8040
|
+
args: [c.args.address]
|
|
8041
|
+
}),
|
|
8042
|
+
client.readContract({
|
|
8043
|
+
abi: registryAbi,
|
|
8044
|
+
address: ABSTRACT_MAINNET_ADDRESSES.registry,
|
|
8045
|
+
functionName: "members",
|
|
8046
|
+
args: [c.args.address]
|
|
8047
|
+
}),
|
|
8048
|
+
client.readContract({
|
|
8049
|
+
abi: councilSeatsAbi,
|
|
8050
|
+
address: ABSTRACT_MAINNET_ADDRESSES.councilSeats,
|
|
8051
|
+
functionName: "isCouncilMember",
|
|
8052
|
+
args: [c.args.address]
|
|
8053
|
+
}),
|
|
8054
|
+
client.readContract({
|
|
8055
|
+
abi: councilSeatsAbi,
|
|
8056
|
+
address: ABSTRACT_MAINNET_ADDRESSES.councilSeats,
|
|
8057
|
+
functionName: "pendingReturns",
|
|
8058
|
+
args: [c.args.address]
|
|
8059
|
+
}),
|
|
8060
|
+
client.readContract({
|
|
8061
|
+
abi: councilSeatsAbi,
|
|
8062
|
+
address: ABSTRACT_MAINNET_ADDRESSES.councilSeats,
|
|
8063
|
+
functionName: "getVotingPower",
|
|
8064
|
+
args: [c.args.address]
|
|
8065
|
+
})
|
|
8066
|
+
]);
|
|
8067
|
+
return c.ok({
|
|
8068
|
+
address: toChecksum(c.args.address),
|
|
8069
|
+
isActive,
|
|
8070
|
+
activeUntil: timeValue(member.activeUntil, c.format),
|
|
8071
|
+
activeUntilRelative: relTime(member.activeUntil),
|
|
8072
|
+
isCouncilMember,
|
|
8073
|
+
pendingReturnsWei: pendingReturns.toString(),
|
|
8074
|
+
votingPower: Number(votingPower)
|
|
8075
|
+
});
|
|
8067
8076
|
});
|
|
8068
8077
|
}
|
|
8069
8078
|
});
|
|
@@ -8080,6 +8089,8 @@ var isMain = (() => {
|
|
|
8080
8089
|
}
|
|
8081
8090
|
})();
|
|
8082
8091
|
if (isMain) {
|
|
8092
|
+
initTelemetry("assembly");
|
|
8093
|
+
process.on("beforeExit", () => shutdownTelemetry());
|
|
8083
8094
|
cli.serve();
|
|
8084
8095
|
}
|
|
8085
8096
|
export {
|