@secondlayer/cli 5.6.1 → 5.6.3

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
@@ -32321,7 +32321,7 @@ var {
32321
32321
  // package.json
32322
32322
  var package_default = {
32323
32323
  name: "@secondlayer/cli",
32324
- version: "5.6.1",
32324
+ version: "5.6.3",
32325
32325
  description: "CLI for subgraphs and blockchain indexing on Stacks",
32326
32326
  type: "module",
32327
32327
  bin: {
@@ -32363,11 +32363,11 @@ var package_default = {
32363
32363
  license: "MIT",
32364
32364
  dependencies: {
32365
32365
  "@inquirer/prompts": "^8.2.0",
32366
- "@secondlayer/bundler": "^0.3.5",
32367
- "@secondlayer/sdk": "^4.0.0",
32366
+ "@secondlayer/bundler": "^0.3.6",
32367
+ "@secondlayer/sdk": "^4.0.1",
32368
32368
  "@secondlayer/shared": "^6.4.3",
32369
32369
  "@secondlayer/stacks": "^2.2.0",
32370
- "@secondlayer/subgraphs": "^2.0.9",
32370
+ "@secondlayer/subgraphs": "^3.2.0",
32371
32371
  "@biomejs/js-api": "^0.7.0",
32372
32372
  "@biomejs/wasm-nodejs": "^1.9.0",
32373
32373
  esbuild: "^0.19.0",
@@ -34804,7 +34804,7 @@ export default defineSubgraph({
34804
34804
  // { type: "stx_transfer", minAmount: 1000000n }
34805
34805
  // { type: "nft_transfer", assetIdentifier: "SP...nft::nft-name" }
34806
34806
  sources: {
34807
- handler: { type: "contract_call", contractId: "SP000000000000000000002Q6VF78.pox-4" },
34807
+ handler: { type: "ft_transfer" },
34808
34808
  },
34809
34809
 
34810
34810
  // Schema defines the tables this subgraph creates.
@@ -34825,9 +34825,11 @@ export default defineSubgraph({
34825
34825
  // ctx.patchOrInsert(), ctx.findOne(), ctx.findMany()
34826
34826
  handlers: {
34827
34827
  handler: (event, ctx) => {
34828
+ // event is typed from the source — for ft_transfer: sender, recipient,
34829
+ // amount (bigint), assetIdentifier. ctx.insert is checked against schema.
34828
34830
  ctx.insert("data", {
34829
- sender: ctx.tx.sender,
34830
- amount: event.amount ?? 0,
34831
+ sender: event.sender,
34832
+ amount: event.amount,
34831
34833
  memo: null,
34832
34834
  });
34833
34835
  },
@@ -34957,18 +34959,22 @@ export default defineSubgraph({
34957
34959
 
34958
34960
  handlers: {
34959
34961
  registry: (event, ctx) => {
34960
- // biome-ignore lint/suspicious/noExplicitAny: print event shape varies by topic
34961
- const e = event as any;
34962
- const topic = typeof e.topic === "string" ? e.topic : null;
34963
- if (!topic) return;
34964
- const data = (e.data ?? {}) as Record<string, unknown>;
34965
-
34962
+ if (!event.topic) return;
34963
+ // event.data is untyped across topics — cast to the fields you read, or
34964
+ // declare \`prints\` per topic on the source for fully typed event.data.
34965
+ const data = event.data as {
34966
+ requestId?: bigint;
34967
+ amount?: bigint | string;
34968
+ sender?: string;
34969
+ bitcoinTxid?: string;
34970
+ burnHeight?: bigint;
34971
+ };
34966
34972
  ctx.insert("flows", {
34967
- topic,
34973
+ topic: event.topic,
34968
34974
  request_id: data.requestId ?? null,
34969
34975
  amount: data.amount != null ? String(data.amount) : null,
34970
- sender: (data.sender as string) ?? null,
34971
- bitcoin_txid: (data.bitcoinTxid as string) ?? null,
34976
+ sender: data.sender ?? null,
34977
+ bitcoin_txid: data.bitcoinTxid ?? null,
34972
34978
  burn_height: data.burnHeight ?? null,
34973
34979
  });
34974
34980
  },
@@ -35017,12 +35023,11 @@ export default defineSubgraph({
35017
35023
 
35018
35024
  handlers: {
35019
35025
  pox: (event, ctx) => {
35020
- // biome-ignore lint/suspicious/noExplicitAny: contract_call event shape
35021
- const fnName = (event as any).functionName ?? ctx.tx.functionName ?? "";
35022
- // biome-ignore lint/suspicious/noExplicitAny: raw_result is hex-encoded Clarity
35023
- const resultHex = (event as any).rawResult ?? "";
35026
+ // contract_call events are typed: functionName, resultHex, args, sender.
35027
+ // (Add an \`abi\` to the source to also get typed \`event.input\`.)
35028
+ const resultHex = event.resultHex ?? "";
35024
35029
  ctx.insert("calls", {
35025
- function_name: fnName,
35030
+ function_name: event.functionName || ctx.tx.functionName || "",
35026
35031
  caller: ctx.tx.sender,
35027
35032
  result_ok: resultHex.startsWith("0x07"), // 0x07 = response-ok type tag
35028
35033
  });
@@ -35071,20 +35076,17 @@ export default defineSubgraph({
35071
35076
 
35072
35077
  handlers: {
35073
35078
  bns: (event, ctx) => {
35074
- // biome-ignore lint/suspicious/noExplicitAny: print event shape
35075
- const e = event as any;
35076
- const topic = typeof e.topic === "string" ? e.topic : null;
35077
- if (!topic) return;
35078
- const data = (e.data ?? {}) as Record<string, unknown>;
35079
+ if (!event.topic) return;
35080
+ const data = event.data as { namespace?: unknown; name?: unknown; owner?: string };
35079
35081
  const namespace = decodeBuffUtf8(data.namespace);
35080
35082
  const nameLabel = decodeBuffUtf8(data.name);
35081
35083
  if (!namespace || !nameLabel) return;
35082
35084
  ctx.insert("names", {
35083
- topic,
35085
+ topic: event.topic,
35084
35086
  namespace,
35085
35087
  name: nameLabel,
35086
35088
  fqn: \`\${nameLabel}.\${namespace}\`,
35087
- owner: topic === "burn-name" ? null : ((data.owner as string) ?? null),
35089
+ owner: event.topic === "burn-name" ? null : (data.owner ?? null),
35088
35090
  });
35089
35091
  },
35090
35092
  },
@@ -37218,5 +37220,5 @@ registerAccountCommand(program);
37218
37220
  registerBillingCommand(program);
37219
37221
  program.parse();
37220
37222
 
37221
- //# debugId=6A52C3B4E82BB08964756E2164756E21
37223
+ //# debugId=E95A7EECEFA93E2364756E2164756E21
37222
37224
  //# sourceMappingURL=cli.js.map