@secondlayer/cli 22.2.2 → 22.3.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/dist/cli.js CHANGED
@@ -200335,7 +200335,9 @@ var init_subgraphs2 = __esm(() => {
200335
200335
 
200336
200336
  // src/commands/index-api.ts
200337
200337
  import { resolve as resolve6 } from "node:path";
200338
- import { Index as Index3 } from "@secondlayer/sdk";
200338
+ import {
200339
+ Index as Index3
200340
+ } from "@secondlayer/sdk";
200339
200341
  import {
200340
200342
  DECODED_EVENT_TYPES as DECODED_EVENT_TYPES3
200341
200343
  } from "@secondlayer/shared";
@@ -200377,6 +200379,14 @@ function parseRuneSort(value) {
200377
200379
  }
200378
200380
  return value;
200379
200381
  }
200382
+ function parseIndexOrder(value) {
200383
+ if (value === undefined)
200384
+ return;
200385
+ if (value !== "asc" && value !== "desc") {
200386
+ throw new Error(`invalid --order "${value}"; expected asc or desc`);
200387
+ }
200388
+ return value;
200389
+ }
200380
200390
  function parseRuneKinds(value) {
200381
200391
  if (value === undefined)
200382
200392
  return;
@@ -200434,10 +200444,12 @@ function registerIndexCommand(program) {
200434
200444
  const index = program.command("index").description("Query decoded Index data (events + contract calls)");
200435
200445
  const rangeFlags = (cmd) => cmd.option("--contract-id <id>", "Filter by contract id").option("--from-height <n>", "Start block height (inclusive)").option("--to-height <n>", "End block height (inclusive)").option("--cursor <cursor>", "Resume token from a previous next_cursor").option("--limit <n>", "Rows per page").option("--json", "Print the full envelope as JSON");
200436
200446
  const heightFlags = (cmd) => cmd.option("--from-height <n>", "Start block height (inclusive)").option("--to-height <n>", "End block height (inclusive)").option("--cursor <cursor>", "Resume token from a previous next_cursor").option("--limit <n>", "Rows per page").option("--json", "Print the full envelope as JSON");
200437
- rangeFlags(index.command("ft-transfers")).description("List decoded SIP-010 fungible-token transfers").option("--sender <principal>", "Filter by sender").option("--recipient <principal>", "Filter by recipient").action(async (o) => {
200447
+ const orderFlag = (cmd) => cmd.option("--order <asc|desc>", "asc (default) reads oldest first; desc reads newest first");
200448
+ orderFlag(rangeFlags(index.command("ft-transfers"))).description("List decoded SIP-010 fungible-token transfers").option("--sender <principal>", "Filter by sender").option("--recipient <principal>", "Filter by recipient").action(async (o) => {
200438
200449
  try {
200439
200450
  emit(await client().ftTransfers.list({
200440
200451
  ...rangeParams(o),
200452
+ order: parseIndexOrder(o.order),
200441
200453
  sender: o.sender,
200442
200454
  recipient: o.recipient
200443
200455
  }), o.json);
@@ -200445,10 +200457,11 @@ function registerIndexCommand(program) {
200445
200457
  fail("list ft transfers", err);
200446
200458
  }
200447
200459
  });
200448
- rangeFlags(index.command("nft-transfers")).description("List decoded SIP-009 non-fungible-token transfers").option("--sender <principal>", "Filter by sender").option("--recipient <principal>", "Filter by recipient").option("--asset-identifier <id>", "Filter by asset identifier").action(async (o) => {
200460
+ orderFlag(rangeFlags(index.command("nft-transfers"))).description("List decoded SIP-009 non-fungible-token transfers").option("--sender <principal>", "Filter by sender").option("--recipient <principal>", "Filter by recipient").option("--asset-identifier <id>", "Filter by asset identifier").action(async (o) => {
200449
200461
  try {
200450
200462
  emit(await client().nftTransfers.list({
200451
200463
  ...rangeParams(o),
200464
+ order: parseIndexOrder(o.order),
200452
200465
  sender: o.sender,
200453
200466
  recipient: o.recipient,
200454
200467
  assetIdentifier: o.assetIdentifier
@@ -200457,11 +200470,12 @@ function registerIndexCommand(program) {
200457
200470
  fail("list nft transfers", err);
200458
200471
  }
200459
200472
  });
200460
- 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 (o) => {
200473
+ orderFlag(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 (o) => {
200461
200474
  try {
200462
200475
  emit(await client().events.list({
200463
200476
  eventType: parseIndexEventType(o.eventType, o.types),
200464
200477
  ...rangeParams(o),
200478
+ order: parseIndexOrder(o.order),
200465
200479
  sender: o.sender,
200466
200480
  recipient: o.recipient,
200467
200481
  assetIdentifier: o.assetIdentifier
@@ -202716,7 +202730,7 @@ var {
202716
202730
  // package.json
202717
202731
  var package_default = {
202718
202732
  name: "@secondlayer/cli",
202719
- version: "22.2.2",
202733
+ version: "22.3.0",
202720
202734
  description: "Run a Stacks index on your own hardware — set it up, restore verified history, and keep it current.",
202721
202735
  repository: {
202722
202736
  type: "git",
@@ -202755,7 +202769,7 @@ var package_default = {
202755
202769
  "@inquirer/prompts": "^8.2.0",
202756
202770
  "@secondlayer/bundler": "^0.7.1",
202757
202771
  "@secondlayer/scaffold": "^1.6.2",
202758
- "@secondlayer/sdk": "^15.4.2",
202772
+ "@secondlayer/sdk": "^15.5.0",
202759
202773
  "@secondlayer/shared": "^14.0.0",
202760
202774
  "@secondlayer/stacks": "^6.5.1",
202761
202775
  "@secondlayer/subgraphs": "^7.7.1",
@@ -208932,5 +208946,5 @@ registerCreditsCommand(program);
208932
208946
  registerArchiveCommand(program);
208933
208947
  program.parse();
208934
208948
 
208935
- //# debugId=A8D3C98CA784D75764756E2164756E21
208949
+ //# debugId=BC182F143EF2A01564756E2164756E21
208936
208950
  //# sourceMappingURL=cli.js.map