@secondlayer/cli 5.4.5 → 5.4.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 +50 -24
- package/dist/cli.js.map +5 -5
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -32321,7 +32321,7 @@ var {
|
|
|
32321
32321
|
// package.json
|
|
32322
32322
|
var package_default = {
|
|
32323
32323
|
name: "@secondlayer/cli",
|
|
32324
|
-
version: "5.4.
|
|
32324
|
+
version: "5.4.6",
|
|
32325
32325
|
description: "CLI for subgraphs and blockchain indexing on Stacks",
|
|
32326
32326
|
type: "module",
|
|
32327
32327
|
bin: {
|
|
@@ -32367,7 +32367,7 @@ var package_default = {
|
|
|
32367
32367
|
"@secondlayer/sdk": "^3.6.0",
|
|
32368
32368
|
"@secondlayer/shared": "^6.4.3",
|
|
32369
32369
|
"@secondlayer/stacks": "^2.2.0",
|
|
32370
|
-
"@secondlayer/subgraphs": "^2.0.
|
|
32370
|
+
"@secondlayer/subgraphs": "^2.0.8",
|
|
32371
32371
|
"@biomejs/js-api": "^0.7.0",
|
|
32372
32372
|
"@biomejs/wasm-nodejs": "^1.9.0",
|
|
32373
32373
|
esbuild: "^0.19.0",
|
|
@@ -33750,7 +33750,17 @@ function printDead(rows) {
|
|
|
33750
33750
|
async function confirmOrExit(message, yes) {
|
|
33751
33751
|
if (yes)
|
|
33752
33752
|
return true;
|
|
33753
|
-
|
|
33753
|
+
let ok = false;
|
|
33754
|
+
try {
|
|
33755
|
+
ok = await confirm({ message });
|
|
33756
|
+
} catch (promptErr) {
|
|
33757
|
+
const m = promptErr instanceof Error ? promptErr.message : String(promptErr);
|
|
33758
|
+
if (m.includes("ExitPromptError") || m.includes("force closed")) {
|
|
33759
|
+
error("Interactive prompt unavailable. Re-run with -y to skip confirmation.");
|
|
33760
|
+
process.exit(1);
|
|
33761
|
+
}
|
|
33762
|
+
throw promptErr;
|
|
33763
|
+
}
|
|
33754
33764
|
if (!ok) {
|
|
33755
33765
|
info("Cancelled");
|
|
33756
33766
|
return false;
|
|
@@ -34862,6 +34872,10 @@ export default defineSubgraph({
|
|
|
34862
34872
|
version: "1.0.0",
|
|
34863
34873
|
description: "sBTC deposits, withdrawals, signer rotations, governance",
|
|
34864
34874
|
|
|
34875
|
+
// Skip pre-sBTC history. Raise this (e.g., to a recent block near tip) for
|
|
34876
|
+
// a smaller backfill, or lower it if you need every sBTC event from genesis.
|
|
34877
|
+
startBlock: 860000,
|
|
34878
|
+
|
|
34865
34879
|
sources: {
|
|
34866
34880
|
registry: {
|
|
34867
34881
|
type: "print_event",
|
|
@@ -34884,18 +34898,19 @@ export default defineSubgraph({
|
|
|
34884
34898
|
|
|
34885
34899
|
handlers: {
|
|
34886
34900
|
registry: (event, ctx) => {
|
|
34887
|
-
// biome-ignore lint/suspicious/noExplicitAny: print
|
|
34888
|
-
const
|
|
34889
|
-
const topic =
|
|
34890
|
-
if (
|
|
34901
|
+
// biome-ignore lint/suspicious/noExplicitAny: print event shape varies by topic
|
|
34902
|
+
const e = event as any;
|
|
34903
|
+
const topic = typeof e.topic === "string" ? e.topic : null;
|
|
34904
|
+
if (!topic) return;
|
|
34905
|
+
const data = (e.data ?? {}) as Record<string, unknown>;
|
|
34891
34906
|
|
|
34892
34907
|
ctx.insert("flows", {
|
|
34893
34908
|
topic,
|
|
34894
|
-
request_id:
|
|
34895
|
-
amount:
|
|
34896
|
-
sender:
|
|
34897
|
-
bitcoin_txid:
|
|
34898
|
-
burn_height:
|
|
34909
|
+
request_id: data.requestId ?? null,
|
|
34910
|
+
amount: data.amount != null ? String(data.amount) : null,
|
|
34911
|
+
sender: (data.sender as string) ?? null,
|
|
34912
|
+
bitcoin_txid: (data.bitcoinTxid as string) ?? null,
|
|
34913
|
+
burn_height: data.burnHeight ?? null,
|
|
34899
34914
|
});
|
|
34900
34915
|
},
|
|
34901
34916
|
},
|
|
@@ -34997,19 +35012,20 @@ export default defineSubgraph({
|
|
|
34997
35012
|
|
|
34998
35013
|
handlers: {
|
|
34999
35014
|
bns: (event, ctx) => {
|
|
35000
|
-
// biome-ignore lint/suspicious/noExplicitAny: print
|
|
35001
|
-
const
|
|
35002
|
-
const topic =
|
|
35003
|
-
if (
|
|
35004
|
-
const
|
|
35005
|
-
const
|
|
35015
|
+
// biome-ignore lint/suspicious/noExplicitAny: print event shape
|
|
35016
|
+
const e = event as any;
|
|
35017
|
+
const topic = typeof e.topic === "string" ? e.topic : null;
|
|
35018
|
+
if (!topic) return;
|
|
35019
|
+
const data = (e.data ?? {}) as Record<string, unknown>;
|
|
35020
|
+
const namespace = decodeBuffUtf8(data.namespace);
|
|
35021
|
+
const nameLabel = decodeBuffUtf8(data.name);
|
|
35006
35022
|
if (!namespace || !nameLabel) return;
|
|
35007
35023
|
ctx.insert("names", {
|
|
35008
35024
|
topic,
|
|
35009
35025
|
namespace,
|
|
35010
35026
|
name: nameLabel,
|
|
35011
35027
|
fqn: \`\${nameLabel}.\${namespace}\`,
|
|
35012
|
-
owner: topic === "burn-name" ? null : (
|
|
35028
|
+
owner: topic === "burn-name" ? null : ((data.owner as string) ?? null),
|
|
35013
35029
|
});
|
|
35014
35030
|
},
|
|
35015
35031
|
},
|
|
@@ -35829,10 +35845,20 @@ ${rows.length} row(s)`));
|
|
|
35829
35845
|
return;
|
|
35830
35846
|
}
|
|
35831
35847
|
}
|
|
35832
|
-
|
|
35833
|
-
|
|
35834
|
-
|
|
35835
|
-
|
|
35848
|
+
try {
|
|
35849
|
+
const result = await deleteSubgraphApi(name, {
|
|
35850
|
+
force: options2.force
|
|
35851
|
+
});
|
|
35852
|
+
success(result.message);
|
|
35853
|
+
} catch (delErr) {
|
|
35854
|
+
const msg = delErr instanceof Error ? delErr.message : String(delErr);
|
|
35855
|
+
const status = delErr?.status;
|
|
35856
|
+
if (status === 404 || /not found/i.test(msg)) {
|
|
35857
|
+
info(`Subgraph "${name}" not found (already deleted?)`);
|
|
35858
|
+
return;
|
|
35859
|
+
}
|
|
35860
|
+
throw delErr;
|
|
35861
|
+
}
|
|
35836
35862
|
} catch (err) {
|
|
35837
35863
|
handleApiError(err, "delete subgraph");
|
|
35838
35864
|
}
|
|
@@ -37101,5 +37127,5 @@ registerAccountCommand(program);
|
|
|
37101
37127
|
registerBillingCommand(program);
|
|
37102
37128
|
program.parse();
|
|
37103
37129
|
|
|
37104
|
-
//# debugId=
|
|
37130
|
+
//# debugId=CB87EFABAE883E2964756E2164756E21
|
|
37105
37131
|
//# sourceMappingURL=cli.js.map
|