@spectratools/assembly-cli 0.3.0 → 0.3.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 +52 -38
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4823,17 +4823,20 @@ var forum = Cli2.create("forum", {
|
|
|
4823
4823
|
forum.command("threads", {
|
|
4824
4824
|
description: "List forum threads with author and creation metadata.",
|
|
4825
4825
|
env: env2,
|
|
4826
|
-
output: z2.
|
|
4827
|
-
z2.
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4826
|
+
output: z2.object({
|
|
4827
|
+
threads: z2.array(
|
|
4828
|
+
z2.object({
|
|
4829
|
+
id: z2.number(),
|
|
4830
|
+
kind: z2.number(),
|
|
4831
|
+
author: z2.string(),
|
|
4832
|
+
createdAt: z2.number(),
|
|
4833
|
+
createdAtRelative: z2.string(),
|
|
4834
|
+
category: z2.string().nullable().optional(),
|
|
4835
|
+
title: z2.string().nullable().optional()
|
|
4836
|
+
})
|
|
4837
|
+
),
|
|
4838
|
+
count: z2.number()
|
|
4839
|
+
}),
|
|
4837
4840
|
examples: [{ description: "List all forum threads" }],
|
|
4838
4841
|
async run(c) {
|
|
4839
4842
|
const client = createAssemblyPublicClient(c.env.ABSTRACT_RPC_URL);
|
|
@@ -4853,16 +4856,20 @@ forum.command("threads", {
|
|
|
4853
4856
|
}))
|
|
4854
4857
|
}) : [];
|
|
4855
4858
|
const items = threadTuples.map(decodeThread);
|
|
4859
|
+
const threads = items.map((x) => ({
|
|
4860
|
+
id: x.id,
|
|
4861
|
+
kind: x.kind,
|
|
4862
|
+
author: x.author,
|
|
4863
|
+
createdAt: x.createdAt,
|
|
4864
|
+
createdAtRelative: relTime(x.createdAt),
|
|
4865
|
+
category: x.category ?? null,
|
|
4866
|
+
title: x.title ?? null
|
|
4867
|
+
}));
|
|
4856
4868
|
return c.ok(
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
createdAt: x.createdAt,
|
|
4862
|
-
createdAtRelative: relTime(x.createdAt),
|
|
4863
|
-
category: x.category ?? null,
|
|
4864
|
-
title: x.title ?? null
|
|
4865
|
-
})),
|
|
4869
|
+
{
|
|
4870
|
+
threads,
|
|
4871
|
+
count: threads.length
|
|
4872
|
+
},
|
|
4866
4873
|
{
|
|
4867
4874
|
cta: {
|
|
4868
4875
|
description: "Inspect or comment:",
|
|
@@ -5187,16 +5194,19 @@ var governance = Cli3.create("governance", {
|
|
|
5187
5194
|
governance.command("proposals", {
|
|
5188
5195
|
description: "List governance proposals with status and vote end time.",
|
|
5189
5196
|
env: env3,
|
|
5190
|
-
output: z3.
|
|
5191
|
-
z3.
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5197
|
+
output: z3.object({
|
|
5198
|
+
proposals: z3.array(
|
|
5199
|
+
z3.object({
|
|
5200
|
+
id: z3.number(),
|
|
5201
|
+
kind: z3.number(),
|
|
5202
|
+
status: z3.number(),
|
|
5203
|
+
title: z3.string().nullable().optional(),
|
|
5204
|
+
voteEndAt: z3.number(),
|
|
5205
|
+
voteEndRelative: z3.string()
|
|
5206
|
+
})
|
|
5207
|
+
),
|
|
5208
|
+
count: z3.number()
|
|
5209
|
+
}),
|
|
5200
5210
|
examples: [{ description: "List all proposals" }],
|
|
5201
5211
|
async run(c) {
|
|
5202
5212
|
const client = createAssemblyPublicClient(c.env.ABSTRACT_RPC_URL);
|
|
@@ -5216,15 +5226,19 @@ governance.command("proposals", {
|
|
|
5216
5226
|
}))
|
|
5217
5227
|
}) : [];
|
|
5218
5228
|
const proposals = proposalTuples.map(decodeProposal);
|
|
5229
|
+
const items = proposals.map((p, i) => ({
|
|
5230
|
+
id: i + 1,
|
|
5231
|
+
kind: asNum(p.kind),
|
|
5232
|
+
status: asNum(p.status),
|
|
5233
|
+
title: p.title ?? null,
|
|
5234
|
+
voteEndAt: asNum(p.voteEndAt),
|
|
5235
|
+
voteEndRelative: relTime(p.voteEndAt)
|
|
5236
|
+
}));
|
|
5219
5237
|
return c.ok(
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
title: p.title ?? null,
|
|
5225
|
-
voteEndAt: asNum(p.voteEndAt),
|
|
5226
|
-
voteEndRelative: relTime(p.voteEndAt)
|
|
5227
|
-
})),
|
|
5238
|
+
{
|
|
5239
|
+
proposals: items,
|
|
5240
|
+
count: items.length
|
|
5241
|
+
},
|
|
5228
5242
|
{
|
|
5229
5243
|
cta: {
|
|
5230
5244
|
description: "Inspect or vote:",
|