@secondlayer/cli 14.0.2 → 14.1.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.
package/README.md CHANGED
@@ -224,7 +224,8 @@ export default defineConfig({
224
224
  |---|---|
225
225
  | `clarinet()` | Parse local Clarinet project — includes `[project.requirements]` dependency contracts too (`includeRequirements: false` to opt out) |
226
226
  | `react()` | Typed React Query hooks |
227
- | `testing()` | Clarinet SDK test helpers |
227
+
228
+ For Clarinet simnet tests, use `getContract` with `@secondlayer/stacks/simnet` rather than generated helpers.
228
229
 
229
230
  Generated output includes named per-function type aliases (`TokenTransferArgs`,
230
231
  `TokenTransferResult`), a `TokenTypes` bundle, and a `tokenAbi` const branded
package/dist/cli.js CHANGED
@@ -30950,10 +30950,31 @@ var init_subgraphs2 = __esm(() => {
30950
30950
  var exports_index_api = {};
30951
30951
  __export(exports_index_api, {
30952
30952
  runIndexCodegen: () => runIndexCodegen,
30953
- registerIndexCommand: () => registerIndexCommand
30953
+ registerIndexCommand: () => registerIndexCommand,
30954
+ parseIndexEventType: () => parseIndexEventType,
30955
+ VALID_INDEX_TYPES: () => VALID_INDEX_TYPES
30954
30956
  });
30955
30957
  import { resolve as resolve4 } from "node:path";
30956
30958
  import { Index as Index2 } from "@secondlayer/sdk";
30959
+ import {
30960
+ DECODED_EVENT_TYPES as DECODED_EVENT_TYPES2
30961
+ } from "@secondlayer/shared";
30962
+ function parseIndexEventType(eventType, types5) {
30963
+ if (eventType !== undefined && types5 !== undefined) {
30964
+ throw new Error("--event-type and --types are mutually exclusive");
30965
+ }
30966
+ const raw = (eventType ?? types5)?.trim();
30967
+ if (!raw) {
30968
+ throw new Error(`--event-type is required (one of: ${VALID_INDEX_TYPES.join(", ")})`);
30969
+ }
30970
+ if (raw.includes(",")) {
30971
+ throw new Error("--types takes ONE value on Index reads. Pagination is keyed per event type; make one request per type (or use `secondlayer streams events` for a multi-type feed)");
30972
+ }
30973
+ if (!VALID_INDEX_TYPES.includes(raw)) {
30974
+ throw new Error(`invalid --event-type "${raw}"; expected one of: ${VALID_INDEX_TYPES.join(", ")}`);
30975
+ }
30976
+ return raw;
30977
+ }
30957
30978
  function client() {
30958
30979
  return new Index2({
30959
30980
  baseUrl: resolveApiUrl(),
@@ -31028,10 +31049,10 @@ function registerIndexCommand(program2) {
31028
31049
  fail("list nft transfers", err);
31029
31050
  }
31030
31051
  });
31031
- rangeFlags(index.command("events")).description("List decoded events by type (stx_*, ft/nft mint/burn, print, …)").option("--event-type <type>", "Decoded event type").option("--types <type>", "alias for --event-type, ONE value (the Streams spelling)").option("--sender <principal>", "Filter by sender").option("--recipient <principal>", "Filter by recipient").option("--asset-identifier <id>", "Filter by asset identifier").action(async (o3) => {
31052
+ rangeFlags(index.command("events")).description("List decoded events by type (stx_*, ft/nft mint/burn, print, …)").option("--event-type <type>", `decoded event type (${VALID_INDEX_TYPES.join(", ")})`).option("--types <type>", "alias for --event-type, ONE value (the Streams spelling)").option("--sender <principal>", "Filter by sender").option("--recipient <principal>", "Filter by recipient").option("--asset-identifier <id>", "Filter by asset identifier").action(async (o3) => {
31032
31053
  try {
31033
31054
  emit(await client().events.list({
31034
- eventType: o3.eventType ?? o3.types,
31055
+ eventType: parseIndexEventType(o3.eventType, o3.types),
31035
31056
  ...rangeParams(o3),
31036
31057
  sender: o3.sender,
31037
31058
  recipient: o3.recipient,
@@ -31151,10 +31172,12 @@ async function runIndexCodegen(o3) {
31151
31172
  process.exit(1);
31152
31173
  }
31153
31174
  }
31175
+ var VALID_INDEX_TYPES;
31154
31176
  var init_index_api = __esm(() => {
31155
31177
  init_fs();
31156
31178
  init_output();
31157
31179
  init_resolve_auth();
31180
+ VALID_INDEX_TYPES = DECODED_EVENT_TYPES2;
31158
31181
  });
31159
31182
 
31160
31183
  // src/lib/docker.ts
@@ -36774,7 +36797,7 @@ var {
36774
36797
  // package.json
36775
36798
  var package_default = {
36776
36799
  name: "@secondlayer/cli",
36777
- version: "14.0.2",
36800
+ version: "14.1.0",
36778
36801
  description: "Run a Stacks index on your own hardware — set it up, restore verified history, and keep it current.",
36779
36802
  repository: {
36780
36803
  type: "git",
@@ -36821,16 +36844,24 @@ var package_default = {
36821
36844
  "@secondlayer/scaffold": "^1.5.5",
36822
36845
  "@secondlayer/sdk": "^10.0.0",
36823
36846
  "@secondlayer/shared": "^11.2.1",
36824
- "@secondlayer/stacks": "^5.0.1",
36847
+ "@secondlayer/stacks": "^5.1.0",
36825
36848
  "@secondlayer/subgraphs": "^4.1.1",
36826
36849
  esbuild: "^0.27.4",
36827
36850
  react: "^19.1.0",
36828
36851
  "smol-toml": "^1.6.1",
36829
36852
  zod: "^4.3.6"
36830
36853
  },
36854
+ peerDependencies: {
36855
+ "@stacks/clarinet-sdk": "^3"
36856
+ },
36857
+ peerDependenciesMeta: {
36858
+ "@stacks/clarinet-sdk": {
36859
+ optional: true
36860
+ }
36861
+ },
36831
36862
  devDependencies: {
36832
36863
  "@antfu/ni": "^24.4.0",
36833
- "@hirosystems/clarinet-sdk": "^3.0.2",
36864
+ "@stacks/clarinet-sdk": "3.21.1",
36834
36865
  "@tanstack/react-query": "^5.77.0",
36835
36866
  "@types/bun": "^1.1.14",
36836
36867
  "@types/react": "^19.1.5",
@@ -42743,5 +42774,5 @@ program.commandsGroup("Archive:");
42743
42774
  registerCreditsCommand(program);
42744
42775
  program.parse();
42745
42776
 
42746
- //# debugId=D8CADFD6A7EDEE7D64756E2164756E21
42777
+ //# debugId=9D3B4D4D53C7B3B564756E2164756E21
42747
42778
  //# sourceMappingURL=cli.js.map