@secondlayer/cli 22.2.2 → 22.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 +25 -11
- package/dist/cli.js.map +5 -5
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -2388,7 +2388,7 @@ async function httpArchiveOps(path, opts = {}) {
|
|
|
2388
2388
|
throw err;
|
|
2389
2389
|
}
|
|
2390
2390
|
}
|
|
2391
|
-
var CliHttpError, REQUEST_TIMEOUT_MS = 30000, ARCHIVE_AUTH_HINT = "Set SECONDLAYER_API_KEY to your account key (sk-sl_…, from /account
|
|
2391
|
+
var CliHttpError, REQUEST_TIMEOUT_MS = 30000, ARCHIVE_AUTH_HINT = "Set SECONDLAYER_API_KEY to your account key (sk-sl_…, from /account#keys), or run `secondlayer login`.", ARCHIVE_CREDENTIAL_RE;
|
|
2392
2392
|
var init_http = __esm(() => {
|
|
2393
2393
|
init_api_url();
|
|
2394
2394
|
init_resolve_auth();
|
|
@@ -2573,7 +2573,7 @@ function authFailureMessage(code, status, ossMode) {
|
|
|
2573
2573
|
if (code === "KEY_REVOKED") {
|
|
2574
2574
|
return {
|
|
2575
2575
|
message: "Your saved login was revoked.",
|
|
2576
|
-
hint: "Run `secondlayer login` to sign in again. If you set SECONDLAYER_API_KEY, replace it with a key from /account
|
|
2576
|
+
hint: "Run `secondlayer login` to sign in again. If you set SECONDLAYER_API_KEY, replace it with a key from /account#keys."
|
|
2577
2577
|
};
|
|
2578
2578
|
}
|
|
2579
2579
|
if (code === "SESSION_EXPIRED" || status === 401) {
|
|
@@ -2675,7 +2675,7 @@ async function getContractPrintSchema(contractId) {
|
|
|
2675
2675
|
}
|
|
2676
2676
|
return client.index.printSchema(contractId);
|
|
2677
2677
|
}
|
|
2678
|
-
var CREDITS_URL = "https://www.secondlayer.tools/account
|
|
2678
|
+
var CREDITS_URL = "https://www.secondlayer.tools/account#usage";
|
|
2679
2679
|
var init_api_client = __esm(() => {
|
|
2680
2680
|
init_http();
|
|
2681
2681
|
init_output();
|
|
@@ -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 {
|
|
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
|
-
|
|
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.
|
|
202733
|
+
version: "22.3.1",
|
|
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,8 +202769,8 @@ 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.
|
|
202759
|
-
"@secondlayer/shared": "^14.0.
|
|
202772
|
+
"@secondlayer/sdk": "^15.5.0",
|
|
202773
|
+
"@secondlayer/shared": "^14.0.1",
|
|
202760
202774
|
"@secondlayer/stacks": "^6.5.1",
|
|
202761
202775
|
"@secondlayer/subgraphs": "^7.7.1",
|
|
202762
202776
|
"@secondlayer/verify": "^0.6.0",
|
|
@@ -208932,5 +208946,5 @@ registerCreditsCommand(program);
|
|
|
208932
208946
|
registerArchiveCommand(program);
|
|
208933
208947
|
program.parse();
|
|
208934
208948
|
|
|
208935
|
-
//# debugId=
|
|
208949
|
+
//# debugId=09E38A927260AA0964756E2164756E21
|
|
208936
208950
|
//# sourceMappingURL=cli.js.map
|